/* Geo.Net come app: barra a schede, schede al posto delle tabelle, tocchi comodi, zone sicure dell'iPhone. */
:root { --gx-bar: 66px; --gx-safe: env(safe-area-inset-bottom, 0px); --gx-accent: #0e7490; }
html { -webkit-tap-highlight-color: transparent; }
.gx-tabbar, .gx-install { display: none; }

@media (max-width: 1023px) {
  html, body { overscroll-behavior-y: none; }
  body { padding-bottom: calc(var(--gx-bar) + var(--gx-safe) + 8px); }

  /* barra a schede */
  .gx-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    height: calc(var(--gx-bar) + var(--gx-safe)); padding: 6px 6px calc(var(--gx-safe) + 6px);
    background: color-mix(in srgb, #ffffff 86%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid rgb(15 29 36 / .08); box-shadow: 0 -10px 30px -18px rgb(15 29 36 / .35); }
  .dark .gx-tabbar { background: color-mix(in srgb, #111819 84%, transparent); border-top-color: rgb(255 255 255 / .07); }
  .gx-tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0 2px; color: #6c767c; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; border-radius: 14px; transition: color .2s, transform .15s; }
  .gx-tab:active, .gx-fab:active { transform: scale(.92); }
  .gx-tab__icon { width: 25px; height: 25px; }
  .gx-tab.is-active { color: var(--gx-accent); }
  .dark .gx-tab { color: #93a3ab; } .dark .gx-tab.is-active { color: #22c5ec; }
  .gx-tab.is-active .gx-tab__icon { animation: gx-pop .35s cubic-bezier(.2, .9, .3, 1.4); }
  .gx-fab { display: grid; justify-items: center; gap: 3px; color: var(--gx-accent); font-size: 10.5px; font-weight: 700; transition: transform .15s; }
  .dark .gx-fab { color: #22c5ec; }
  .gx-fab__btn { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; color: #fff;
    background: linear-gradient(145deg, #16a3c4, #0b4b5f); box-shadow: 0 10px 22px -8px rgb(14 116 144 / .8), inset 0 1px 0 rgb(255 255 255 / .35);
    transform: perspective(300px) rotateX(10deg); border: 3px solid var(--gx-ring, #fff); }
  .dark .gx-fab__btn { --gx-ring: #111819; }
  .gx-fab__btn svg { width: 28px; height: 28px; }
  @keyframes gx-pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }

  /* barra in alto più compatta e sempre visibile */
  .fi-topbar { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px); }
  .fi-topbar nav, .fi-topbar > div { min-height: 56px; }

  /* contenuti: margini da app, titoli più compatti */
  .fi-main { padding-inline: 14px !important; }
  .fi-header-heading { font-size: 1.45rem !important; line-height: 1.2 !important; }
  .fi-header-subheading { font-size: .9rem !important; }
  .fi-header .fi-ac { flex-wrap: wrap; gap: .5rem; }
  .fi-section { border-radius: 18px !important; }
  .fi-ta-ctn { border-radius: 18px !important; }

  /* niente zoom di iOS sui campi */
  input, select, textarea, .fi-input { font-size: 16px !important; }

  /* pulsanti e righe comode da toccare */
  .fi-btn { min-height: 42px; }
  .fi-ta-row { min-height: 56px; }

  /* entrata morbida a ogni cambio pagina */
  .fi-main > * { animation: gx-entra .32s ease-out both; }
  @keyframes gx-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* l'assistente sopra la barra */
  .ga-chat__fab { bottom: calc(var(--gx-bar) + var(--gx-safe) + 12px) !important; right: 12px !important; padding: 6px !important; }
  .ga-chat__fab-label { display: none; }
  .ga-chat__panel { z-index: 70 !important; }
  .ga-chat__scrim { z-index: 65 !important; }

  /* pulsanti già presenti nella barra o poco usati da telefono */
  .gx-solo-desktop { display: none !important; }

  /* invito a installare */
  .gx-install:not([hidden]) { display: grid; grid-template-columns: 42px 1fr auto auto; gap: 10px; align-items: center; position: fixed; z-index: 45; left: 10px; right: 10px;
    bottom: calc(var(--gx-bar) + var(--gx-safe) + 12px); padding: 10px 10px 10px 12px; border-radius: 18px; background: #0b4b5f; color: #fff;
    box-shadow: 0 18px 40px -14px rgb(0 0 0 / .6); animation: gx-entra .4s ease-out both; }
  .gx-install img { width: 42px; height: 42px; border-radius: 11px; }
  .gx-install b { display: block; font-size: .9rem; } .gx-install span { display: block; font-size: .76rem; opacity: .85; line-height: 1.3; }
  .gx-install button { font-weight: 700; font-size: .82rem; padding: .5rem .8rem; border-radius: 999px; background: #fff; color: #0b4b5f; }
  .gx-install #gx-install-no { background: transparent; color: #fff; padding: .4rem; }

  /* calendario cantieri: si scorre col dito un giorno alla volta */
  .gn-cal { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding: 2px 2px 10px; margin-inline: -4px; scrollbar-width: none; }
  .gn-cal::-webkit-scrollbar { display: none; }
  .gn-day { flex: 0 0 72%; scroll-snap-align: start; }
  .gn-kpi-grid { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; scrollbar-width: none; padding-bottom: 6px; }
  .gn-kpi-grid::-webkit-scrollbar { display: none; }
  .gn-kpi { flex: 0 0 66%; scroll-snap-align: start; }

  /* mappa: a tutta larghezza, scheda sotto */
  .gm-map-wrap { transform: none !important; border-radius: 18px; }
}

/* app installata: niente rimbalzi e testo non selezionabile sui comandi */
@media (display-mode: standalone) {
  .gx-tab, .gx-fab, .fi-btn, .fi-sidebar-item { -webkit-user-select: none; user-select: none; }
}

/* schede al posto delle righe di tabella (colonna «scheda» visibile solo su telefono) */
.gx-card { display: grid; gap: 4px; padding: 2px 0; width: 100%; }
.gx-card__top { display: flex; align-items: center; gap: 10px; }
.gx-card__badge { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: #0e7490; box-shadow: 0 6px 14px -8px #0e7490; }
.gx-card__badge.c2 { background: #0891b2; } .gx-card__badge.c3 { background: #d97706; } .gx-card__badge.is-off { background: #9aa6ab; }
.gx-card__title { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.gx-card__sub { font-size: .8rem; color: #6c767c; line-height: 1.3; }
.dark .gx-card__sub { color: #93a3ab; }
.gx-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gx-chip { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgb(14 116 144 / .1); color: #0b5f76; }
.dark .gx-chip { background: rgb(34 197 236 / .12); color: #a5eefc; }
.gx-chip.warn { background: rgb(217 119 6 / .14); color: #b45309; } .gx-chip.bad { background: rgb(209 67 67 / .13); color: #c03535; } .gx-chip.ok { background: rgb(21 146 90 / .13); color: #15784b; }
.gx-card__right { margin-left: auto; text-align: right; font-size: .78rem; color: #6c767c; white-space: nowrap; }

@media (max-width: 767px) {
  /* tabelle a schede: niente riga di intestazione vuota, scheda a tutta larghezza */
  .fi-ta-table thead { display: none; }
  .fi-ta-cell:has(.gx-card) { width: 100%; padding-inline: 12px !important; }
  .fi-ta-row:active { background: rgb(14 116 144 / .06); }
}
@media (max-width: 767px) {
  /* azioni di riga: solo icona, grande da toccare */
  .fi-ta-actions .fi-link { font-size: 0; padding: 10px; border-radius: 12px; }
  .fi-ta-actions .fi-link svg { width: 22px; height: 22px; }
  .fi-ta-actions .fi-link:active { background: rgb(14 116 144 / .1); }
}
.gn-passi__testo { font-style: normal; }
@media (max-width: 640px) {
  .gn-passi { display: flex !important; gap: 8px !important; }
  .gn-passi__voce { flex: none; }
  .gn-passi__voce.is-attivo { flex: 1; }
  .gn-passi__voce:not(.is-attivo) .gn-passi__testo { display: none; }
}

/* elenco allegati (pannello e area clienti) */
.gx-allegati { display: grid; gap: 8px; }
.gx-allegato { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid rgb(15 29 36 / .1); background: rgb(14 116 144 / .04); transition: transform .15s, box-shadow .15s; }
.gx-allegato:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgb(14 116 144 / .7); }
.dark .gx-allegato { border-color: rgb(255 255 255 / .08); background: rgb(34 197 236 / .05); }
.gx-allegato__ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: #0e7490; }
.gx-allegato__ico svg { width: 22px; height: 22px; }
.gx-ext-pdf { background: #c03535; } .gx-ext-doc, .gx-ext-docx { background: #2563eb; } .gx-ext-kmz, .gx-ext-kml { background: #15803d; } .gx-ext-jpg, .gx-ext-jpeg, .gx-ext-png { background: #7c3aed; }
.gx-allegato__txt { display: grid; min-width: 0; }
.gx-allegato__txt b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-allegato__txt small { font-size: .74rem; color: #6c767c; }
.gx-allegato__dl { width: 20px; height: 20px; color: #0e7490; }
.gx-allegati__vuoto { font-size: .85rem; color: #6c767c; }
