/* PWA shell ? banner, iOS guide, standalone chrome */

.gc-pwa-install-banner,
.gc-pwa-ios-guide {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1080;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: #146c43;
  color: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.gc-pwa-install-banner .btn-light,
.gc-pwa-ios-guide .btn-light {
  font-weight: 600;
}

.gc-pwa-ios-guide {
  background: #0f5132;
}

.gc-pwa-ios-steps {
  font-size: 0.92rem;
  line-height: 1.45;
}

.gc-pwa-ios-steps strong {
  font-weight: 700;
}

html.gc-pwa-standalone body.gc-app-body {
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

.gc-pwa-bottom-nav {
  display: none;
}

html.gc-pwa-standalone .gc-pwa-bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: #1a1d21;
  color: #fff;
  padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  gap: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gc-pwa-bottom-nav a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
  flex: 1;
  padding: 0.35rem 0.2rem;
  min-height: 48px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gc-pwa-bottom-nav a.active {
  color: #fff;
  background: rgba(48, 132, 70, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.gc-pwa-bottom-nav a:hover {
  color: #fff;
}

.gc-pwa-bottom-nav i {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 0.12rem;
  line-height: 1;
}

.gc-pwa-bottom-nav .gc-pwa-nav-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-bottom: 0.12rem;
  border-radius: 0.35rem;
  border: 1.5px solid currentColor;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: none;
}

/* ??? Skin app (standalone): pi? contenuto, meno chrome ??? */

html.gc-pwa-standalone .gc-navbar {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  min-height: 0;
}

html.gc-pwa-standalone .gc-navbar .container-fluid {
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  position: relative;
}

html.gc-pwa-standalone .gc-navbar-brand span,
html.gc-pwa-standalone .gc-navbar-user,
html.gc-pwa-standalone .gc-navbar-env-badge,
html.gc-pwa-standalone .gc-navbar-account-link {
  display: none !important;
}

/* Nome operatore in header: flex, non absolute (evita overlap con Admin/bell/logout) */
.gc-navbar-pwa-name {
  display: none;
}

html.gc-pwa-standalone .gc-navbar .container-fluid {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

html.gc-pwa-standalone .gc-navbar-pwa-name {
  display: block;
  position: static;
  left: auto;
  top: auto;
  transform: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0 0.25rem;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: rgba(255, 255, 255, 0.95) !important;
  pointer-events: none;
  z-index: 1;
}

html.gc-pwa-standalone .gc-navbar-admin {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}

/* In app: solo icona scudo, senza testo "Admin" */
html.gc-pwa-standalone .gc-navbar-admin .btn {
  padding: 0.25rem 0.45rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: #fff;
}

html.gc-pwa-standalone .gc-navbar-admin-label {
  display: none !important;
}

html.gc-pwa-standalone .gc-navbar-admin-icon {
  display: inline-block !important;
  font-size: 1.15rem;
}

html.gc-pwa-standalone .gc-navbar-admin .dropdown-toggle::after {
  display: none;
}

html.gc-pwa-standalone .gc-navbar-account-actions {
  display: flex !important;
  align-items: center;
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}

html.gc-pwa-standalone .gc-navbar-logout {
  padding: 0.25rem 0.45rem;
  border: 0;
  background: transparent;
  color: #fff;
  line-height: 1;
}

html.gc-pwa-standalone .gc-navbar-logout-label {
  display: none;
}

html.gc-pwa-standalone .gc-navbar-logout-icon {
  display: inline-block !important;
  font-size: 1.25rem;
}

html.gc-pwa-standalone .gc-navbar-brand {
  margin-right: 0;
  font-size: 0;
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}

html.gc-pwa-standalone .gc-navbar-logo {
  width: 28px;
  height: 24px;
}

html.gc-pwa-standalone .gc-navbar .d-flex.align-items-center {
  margin-left: 0;
  min-width: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 0.1rem;
}

html.gc-pwa-standalone .gc-main-container {
  margin-top: 0.75rem !important;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

html.gc-pwa-standalone .gc-page-header {
  margin-bottom: 0.65rem !important;
  gap: 0.5rem !important;
}

html.gc-pwa-standalone .gc-page-header h2 {
  font-size: 1.2rem;
  line-height: 1.25;
}

html.gc-pwa-standalone .gc-page-header .text-muted.small {
  font-size: 0.8rem;
}

html.gc-pwa-standalone .gc-page-header .gc-module-icon,
html.gc-pwa-standalone .gc-btn-home,
html.gc-pwa-standalone .gc-module-chrome {
  display: none !important;
}

html.gc-pwa-standalone .gc-area-subnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.35rem !important;
  margin-bottom: 0.75rem !important;
  padding-bottom: 0.5rem !important;
  scrollbar-width: none;
}

html.gc-pwa-standalone .gc-area-subnav::-webkit-scrollbar {
  display: none;
}

html.gc-pwa-standalone .gc-area-subnav .nav-link {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.85rem;
  background: #eef2f0;
  color: #212529 !important;
}

html.gc-pwa-standalone .gc-area-subnav .nav-link.active {
  background: #308446;
  color: #fff !important;
}

/* Toggle telefono/completa meno invasivo in app */
html.gc-pwa-standalone .gc-view-toggle {
  width: 100%;
  justify-content: stretch;
  margin-bottom: 0.5rem;
}

html.gc-pwa-standalone .gc-view-toggle .btn {
  flex: 1;
  font-size: 0.8rem;
}

/* ??? Anche browser mobile stretto: riduci un po' il chrome ??? */
@media (max-width: 767.98px) {
  .gc-main-container {
    margin-top: 0.85rem !important;
  }

  .gc-page-header h2 {
    font-size: 1.25rem;
  }

  .gc-navbar-user {
    display: none !important;
  }
}

/* Toggle vista mobile/desktop su pagine dense */
.gc-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
}

.gc-view-toggle .btn {
  min-height: 40px;
}

body.gc-view-mobile .gc-desktop-only {
  display: none !important;
}

body.gc-view-desktop .gc-mobile-only {
  display: none !important;
}

@media (min-width: 992px) {
  body:not(.gc-view-mobile) .gc-mobile-only-force {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  body:not(.gc-view-desktop) .gc-desktop-only-force {
    display: none !important;
  }
}

/* Bottone abilita notifiche ? stati chiari */
#gc-enable-push-btn.is-enabled,
#gc-enable-push-btn.btn-success {
  pointer-events: none;
}

/* ??? Controlli app comuni (nav periodo, icone, input) ??? */
.gc-app-period-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.gc-app-period-nav-center {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.gc-app-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  border-radius: 0.85rem;
  border: 1px solid rgba(20, 108, 67, 0.22);
  background: #fff;
  color: #146c43;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 48, 32, 0.06);
}

.gc-app-icon-btn:hover,
.gc-app-icon-btn:focus {
  background: #eef8f1;
  color: #0f5132;
  border-color: rgba(20, 108, 67, 0.4);
}

.gc-app-icon-btn i {
  font-size: 1.15rem;
  line-height: 1;
}

.gc-app-date-input {
  width: 100%;
  min-height: 2.65rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(20, 108, 67, 0.22);
  background: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1b4332;
  box-shadow: 0 1px 2px rgba(16, 48, 32, 0.06);
}

.gc-app-period-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid rgba(20, 108, 67, 0.22);
  background: #fff;
  color: #1b4332;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 48, 32, 0.06);
}

html.gc-pwa-standalone .form-control,
html.gc-pwa-standalone .form-select {
  border-radius: 0.75rem;
  min-height: 2.5rem;
}

html.gc-pwa-standalone .btn:not(.gc-app-icon-btn) {
  border-radius: 0.75rem;
}

html.gc-pwa-standalone .gc-module-hub-card {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

html.gc-pwa-standalone .gc-module-hub-card:active {
  transform: scale(0.99);
}

.gc-navbar-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 0.35rem;
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
}

.gc-navbar-bell:hover,
.gc-navbar-bell:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.gc-navbar-bell i {
  font-size: 1.1rem;
}

html.gc-pwa-standalone .gc-navbar-bell {
  width: 2.4rem;
  height: 2.4rem;
  margin-right: 0.15rem;
  border-radius: 0.65rem;
}

html.gc-pwa-standalone .gc-navbar-bell i {
  font-size: 1.2rem;
}

.gc-navbar-bell-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.1rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

/* Filtri su una riga (Stato | Servizio) */
.gc-app-filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.gc-app-filter .form-label {
  margin-bottom: 0.2rem;
}

.gc-app-select {
  min-height: 2.55rem;
  border-radius: 0.85rem !important;
  border: 1px solid rgba(20, 108, 67, 0.22);
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(16, 48, 32, 0.06);
}

/* Evita bordi tagliati / sovrapposti dei btn-group Bootstrap */
html.gc-pwa-standalone .btn-group > .btn,
html.gc-pwa-standalone .btn-group > .btn:not(:first-child),
html.gc-pwa-standalone .btn-group > .btn:not(:last-child) {
  border-radius: 0.75rem !important;
  margin-left: 0.2rem;
}

html.gc-pwa-standalone .btn-group {
  gap: 0.25rem;
  display: inline-flex;
}

html.gc-pwa-standalone .btn-group > .btn + .btn {
  margin-left: 0;
  border-left-width: 1px;
}

.gc-app-period-label {
  box-sizing: border-box;
}
