@import url("/fonts/brand-fonts.css");
:root{
  --green:#16A34A; --green-dk:#0F7A37; --green-lt:#E8F4EC;
  --ink:#15211B; --grey:#5B6B63; --line:#E2EBE5; --bg:#F4F7F4; --white:#fff;
  --red:#DC2626; --amber:#E2A300; --orange:#F97316;
  --font:Inter,-apple-system,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font);background:var(--bg);color:var(--ink);-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased}
.wrap{max-width:460px;margin:0 auto;padding:18px 16px 40px;min-height:100dvh}
.brand{display:flex;align-items:center;gap:10px;justify-content:center;padding:14px 0 6px}
.brand .logo{width:36px;height:36px;border-radius:10px;background:#111527;display:grid;place-items:center}
.brand b{font-size:20px;color:var(--green-dk);letter-spacing:.3px}
.brand span{font-size:11px;color:var(--grey);display:block;margin-top:-2px}
.card{background:var(--white);border:1px solid var(--line);border-radius:16px;padding:18px;margin-top:14px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
label{display:block;font-size:12.5px;color:var(--grey);margin:10px 0 5px;font-weight:600}
input{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:11px;font-size:16px;background:#fbfdfc}
input:focus{outline:none;border-color:var(--green)}
button{font-family:inherit;cursor:pointer;border:none}
.btn{width:100%;padding:14px;border-radius:12px;font-size:16px;font-weight:700;background:var(--green);color:#fff}
.btn:active{transform:translateY(1px)}
.btn.ghost{background:var(--green-lt);color:var(--green-dk)}
.btn.red{background:var(--red)}
.btn.grey{background:#eef2f0;color:var(--grey)}
.btn[disabled]{opacity:.55}
.hello{text-align:center;margin:6px 0 2px;font-size:15px;color:var(--grey)}
.hello b{color:var(--ink)}
.status{text-align:center;padding:8px 0 2px}
.status .dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:7px;vertical-align:middle}
.in .dot{background:var(--green)} .out .dot{background:var(--grey)}
.status .lbl{font-size:13px;color:var(--grey)}
.bigbtn{display:block;width:100%;padding:30px 16px;border-radius:18px;font-size:23px;font-weight:800;color:#fff;margin-top:10px;letter-spacing:.3px}
.bigbtn small{display:block;font-size:12px;font-weight:600;opacity:.9;margin-top:6px;letter-spacing:0}
.bigbtn.enter{background:var(--green)} .bigbtn.exit{background:var(--red)}
.bigbtn.grey{background:#eef2f0;color:#16201b;border:1px solid #d7e2db}
.bigbtn.grey small{opacity:.7}
.geo{font-size:12px;color:var(--grey);text-align:center;margin-top:12px;min-height:16px}
.geo.ok{color:var(--green-dk)} .geo.warn{color:#8A5A00} .geo.err{color:var(--red)}
.list{margin-top:8px}
.row{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;row-gap:6px;padding:10px 2px;border-bottom:1px solid var(--line);font-size:13.5px}
.row:last-child{border-bottom:none}
.tag{font-size:11px;font-weight:700;padding:3px 8px;border-radius:20px;white-space:nowrap}
.tag.in{background:var(--green-lt);color:var(--green-dk)} .tag.out{background:#f1f3f2;color:var(--grey)}
.muted{color:var(--grey);font-size:12px}
.banner{display:none;text-align:center;font-size:12.5px;padding:9px;border-radius:10px;margin-top:10px}
.banner.show{display:block}
.banner.offline{background:#FFF6E5;color:#8a6500;border:1px solid #f0d68a}
.banner.err{background:#fde8e8;color:#9b1c1c;border:1px solid #f3b4b4}
.banner.ok{background:var(--green-lt);color:var(--green-dk)}
.foot{text-align:center;margin-top:22px;font-size:11px;color:#7A8A80}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
.linkbtn{background:none;color:var(--grey);font-size:12.5px;text-decoration:underline;padding:7px 8px;min-height:34px;display:inline-flex;align-items:center;vertical-align:middle;box-sizing:border-box}
/* admin */
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{text-align:left;padding:9px 8px;border-bottom:1px solid var(--line)}
th{color:var(--grey);font-weight:600;font-size:12px}
.adminwrap{max-width:1000px}
.grid{display:grid;gap:14px}
@media(min-width:760px){.grid.two{grid-template-columns:1fr 1fr}}
.pill{font-size:11px;padding:2px 8px;border-radius:20px;background:var(--green-lt);color:var(--green-dk)}
.pill.no{background:#fde8e8;color:#9b1c1c}
.inline{display:flex;gap:8px;flex-wrap:wrap;align-items:end}
.inline > div{flex:1;min-width:120px}
h2.sec{font-size:15px;margin:4px 0 0}

/* ===== design v2 (allineato al prototipo) ===== */
.adminwrap{max-width:1200px;padding:22px 22px 70px}
.adminwrap .card{border:1px solid #E2EBE5;border-radius:22px;padding:20px 22px;margin-top:16px;box-shadow:0 14px 40px -30px rgba(15,90,55,.35)}
.adminwrap .brand{justify-content:flex-start;padding:2px 0 8px}
.adminwrap .brand .logo{background:transparent;border:0;box-shadow:none;padding:0}
.adminwrap .brand b{color:#15211B;font-weight:800;letter-spacing:-0.02em;font-size:18px}
.adminwrap h2.sec{font-size:17px;font-weight:800;letter-spacing:-0.01em}
.btn{background:linear-gradient(145deg,#16A34A,#0F7A37);box-shadow:0 12px 22px -12px rgba(15,90,55,.5);font-weight:800;border-radius:14px}
.btn.ghost{background:#E8F4EC;color:#0F7A37;box-shadow:none}
.btn.grey{background:#fff;color:#0F7A37;border:1.5px solid #D7E2DB;box-shadow:none}
input,select,textarea{border:1.5px solid #D7E2DB;border-radius:13px;font-family:var(--font);box-sizing:border-box}
input:focus,select:focus,textarea:focus{outline:none;border-color:#16A34A}
.pill{font-size:11.5px;font-weight:800;padding:4px 11px;border-radius:999px;background:#E8F4EC;color:#0F7A37}
.pill.no{background:#FDECEC;color:#9b1c1c}
.pill.warn{background:#FEF3E2;color:#8A5A00}
th{color:#5B6B63;font-weight:800;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
td,th{border-bottom:1px solid #EBF1EC}
.linkbtn{color:#5B6B63;font-weight:700;text-decoration:none}
.linkbtn:hover{color:#0F7A37}
.foot{color:#7A8A80}
.row{border-bottom:1px solid #EBF1EC}
.tag{font-weight:800}
.tag.in{background:#E8F4EC;color:#0F7A37}.tag.out{background:#F1F5F2;color:#5B6B63}

button,a,input,select,.linkbtn,label{touch-action:manipulation}

/* safe-area per notch iPhone (viewport-fit=cover) */
#app{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}

.rowmenu .menuitem{display:block;width:100%;text-align:left;padding:8px 10px;border-radius:8px;white-space:nowrap;background:none;border:none;font-family:inherit;font-size:14px;cursor:pointer}
.rowmenu .menuitem:hover{background:#F1F5F2}
.kebab{font-size:20px;line-height:1;padding:0 8px}
/* body overflow-x:auto rimosso: le tabelle hanno scroll INTERNO (.tbl-scroll) — niente scroll orizzontale della pagina */


/* ===== Fase 1: percezione premium (02/07) ===== */
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif}
h1,h2,h3,.sec,.brand{font-family:'Sora','Inter',sans-serif;letter-spacing:-0.02em}
/* feedback di pressione: i bottoni "rispondono" al tocco */
button{transition:transform .15s ease,box-shadow .2s ease,filter .15s ease,background .2s ease}
button:active{transform:scale(.97)}
a{transition:color .15s ease,opacity .15s ease}
.pill,.tag{transition:background .2s ease,color .2s ease}
/* skeleton shimmer per i caricamenti */
.skel{color:transparent!important;border-radius:8px;background:linear-gradient(90deg,#EDF2EE 25%,#F8FBF9 50%,#EDF2EE 75%);background-size:200% 100%;animation:skelmove 1.2s linear infinite}
@keyframes skelmove{0%{background-position:200% 0}100%{background-position:-200% 0}}
/* contenuti che appaiono: fade morbido */
.tabsec{animation:fadein .18s ease}
@keyframes fadein{from{opacity:.55}to{opacity:1}}
/* accessibilità: rispetta chi disattiva le animazioni */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}


/* ===== Sedi: autocomplete indirizzo + mappa (04/07) ===== */
.suggest-box{display:none;position:absolute;left:0;right:0;top:100%;z-index:60;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 14px 30px -10px rgba(0,0,0,.28);max-height:240px;overflow:auto;margin-top:3px}
.sg-item{padding:9px 12px;font-size:13px;line-height:1.3;cursor:pointer;border-bottom:1px solid var(--line)}
.sg-item:last-child{border-bottom:0}
.sg-item:hover{background:var(--green-lt)}
.leaflet-container{font-family:inherit}

/* ============================================================
   THEME PRO — look allineato al sito (tutte le org tranne Mauro).
   Attivo solo su #homeView.theme-pro: la classica (Mauro) è intatta.
   ============================================================ */
.theme-pro{
  --p-ink:#111527;--p-mut:#5b6779;--p-faint:#9aa6b2;--p-line:#e7ebef;--p-bg2:#f6f8f9;
  --p-green:#3caf75;--p-green-d:#2f9a63;--p-green-t:#e8f6ee;
  --p-act-a:#18a94e;--p-act-b:#0f7a37;
  --p-amber:#E58A00;--p-amber-t:#FDF3E1;--p-amber-ink:#8A5200;--p-amber-line:#F0E0BE;
  --p-red-a:#E23B3B;--p-red-b:#B91C1C;
  --p-dsp:'Bricolage Grotesque','Sora',-apple-system,system-ui,sans-serif;
  color:var(--p-ink);
}
.theme-pro .p-dsp{font-family:var(--p-dsp);letter-spacing:-.02em}
.theme-pro .p-num{font-variant-numeric:tabular-nums}
.theme-pro .ic{stroke:currentColor;stroke-width:1.85;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;display:block;width:22px;height:22px}
.theme-pro .p-top{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 4px}
.theme-pro .p-brand{display:flex;align-items:center;gap:10px}
.theme-pro .p-brand img{width:36px;height:36px;border-radius:11px;display:block}
.theme-pro .p-brand b{font-size:15px;font-weight:800}
.theme-pro .p-brand .p-org{font-size:11px;color:var(--p-mut);font-weight:600}
.theme-pro .p-hcol{display:flex;align-items:center;gap:12px}
.theme-pro .p-avt{width:37px;height:37px;border-radius:50%;background:var(--p-green-t);color:var(--p-green-d);display:flex;align-items:center;justify-content:center;font-weight:700;font-family:var(--p-dsp);font-size:14px}
.theme-pro .p-exit{display:flex;align-items:center;gap:5px;background:none;border:none;color:var(--p-mut);font-weight:600;font-size:12.5px;font-family:inherit;cursor:pointer;padding:10px 8px;min-height:44px;box-sizing:border-box}
.theme-pro .p-exit .ic{width:16px;height:16px}
.theme-pro .p-hello{font-size:25px;font-weight:700;margin:12px 2px 1px}
.theme-pro .p-date{font-size:13px;color:var(--p-mut);font-weight:500;margin:0 2px 14px;text-transform:capitalize}
.theme-pro .p-hero{background:var(--p-bg2);border:1px solid var(--p-line);border-radius:22px;padding:18px 16px 20px;margin-bottom:15px}
.theme-pro .p-site{display:flex;align-items:center;gap:9px;font-size:13.5px}
.theme-pro .p-site .ic{width:17px;height:17px;color:var(--p-green-d)}
.theme-pro .p-site b{font-weight:700}
.theme-pro .p-ok{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--p-green-d);font-weight:700;background:var(--p-green-t);padding:4px 9px;border-radius:999px}
.theme-pro .p-ok .ic{width:12px;height:12px;color:var(--p-green-d)}
.theme-pro .p-outchip{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--p-amber-ink);font-weight:700;background:var(--p-amber-t);padding:4px 9px;border-radius:999px}
.theme-pro .p-outchip .ic{width:12px;height:12px;color:var(--p-amber)}
.theme-pro .p-ringwrap{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:14px 0 4px;position:relative}
.theme-pro .p-ringwrap svg.p-ring{width:168px;height:168px;transform:rotate(-90deg)}
.theme-pro .p-ringlbl{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}
.theme-pro .p-ringlbl .p-big{font-size:38px;font-weight:800;line-height:1}
.theme-pro .p-ringlbl .p-big small{font-size:20px;font-weight:700;color:var(--p-mut)}
.theme-pro .p-ringlbl .p-cap{font-size:11.5px;font-weight:600;color:var(--p-mut);margin-top:3px;text-transform:uppercase;letter-spacing:.05em}
.theme-pro .p-statusline{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:6px;font-size:13px;font-weight:600;color:var(--p-mut)}
.theme-pro .p-statusline .p-st{display:inline-flex;align-items:center;gap:6px;font-weight:700}
.theme-pro .p-statusline .p-st .ic{width:15px;height:15px}
.theme-pro .p-meta{text-align:center;font-size:12.5px;color:#6B7683;font-weight:500;margin-top:3px}
.theme-pro .p-scard{display:flex;align-items:center;gap:11px;background:var(--p-bg2);border:1px solid var(--p-line);border-radius:18px;padding:15px 16px;margin-bottom:15px}
.theme-pro .p-scard.amber{background:var(--p-amber-t);border-color:var(--p-amber-line)}
.theme-pro .p-scard .p-badge{width:44px;height:44px;border-radius:13px;display:flex;align-items:center;justify-content:center;flex:none;background:#eef1f0;color:var(--p-mut)}
.theme-pro .p-scard.amber .p-badge{background:#fff;color:var(--p-amber)}
.theme-pro .p-scard.green .p-badge{background:var(--p-green-t);color:var(--p-green-d)}
.theme-pro .p-scard .p-badge .ic{width:23px;height:23px}
.theme-pro .p-scard .p-t{font-size:16px;font-weight:700}
.theme-pro .p-scard.amber .p-t{color:var(--p-amber-ink)}
.theme-pro .p-scard .p-s{font-size:12.5px;color:var(--p-mut);font-weight:500;margin-top:1px}
.theme-pro .p-primary{width:100%;min-height:112px;border:none;border-radius:22px;padding:20px 22px;cursor:pointer;text-align:left;display:flex;align-items:center;gap:16px;font-family:inherit;color:#fff;background:linear-gradient(150deg,var(--p-act-a),var(--p-act-b));box-shadow:0 16px 30px -14px rgba(15,90,55,.5)}
.theme-pro .p-primary.end{background:linear-gradient(150deg,var(--p-red-a),var(--p-red-b));box-shadow:0 16px 30px -14px rgba(180,30,30,.45)}
.theme-pro .p-primary.grey{background:#fff;color:var(--p-green-d);border:2px solid var(--p-line);box-shadow:none}
.theme-pro .p-primary .p-badge{width:56px;height:56px;border-radius:17px;background:rgba(255,255,255,.17);display:flex;align-items:center;justify-content:center;flex:none}
.theme-pro .p-primary.grey .p-badge{background:var(--p-green-t)}
.theme-pro .p-primary .p-badge .ic{width:29px;height:29px;stroke-width:2}
.theme-pro .p-primary .p-txt{display:flex;flex-direction:column}
.theme-pro .p-primary .p-t{font-size:24px;font-weight:700;line-height:1.05}
.theme-pro .p-primary .p-s{font-size:13px;font-weight:500;opacity:.92;margin-top:4px}
.theme-pro .p-btrow{display:flex;gap:10px;margin-top:11px}
.theme-pro .p-sec{flex:1;min-height:58px;display:flex;align-items:center;justify-content:center;gap:9px;border:1.5px solid var(--p-line);background:#fff;color:var(--p-ink);font-weight:700;font-size:15px;padding:14px;border-radius:16px;cursor:pointer;font-family:inherit}
.theme-pro .p-sec .ic{width:19px;height:19px;color:var(--p-green-d)}
.theme-pro .p-sec.warn{border-color:var(--p-amber-line);background:var(--p-amber-t);color:var(--p-amber-ink)}
.theme-pro .p-sec.warn .ic{color:var(--p-amber)}
.theme-pro .p-gps{display:flex;align-items:center;justify-content:center;gap:8px;margin:16px 0 3px;font-size:13px;font-weight:700;color:var(--p-green-d)}
.theme-pro .p-gps .p-live{position:relative;width:9px;height:9px}
.theme-pro .p-gps .p-live i{position:absolute;inset:0;border-radius:50%;background:var(--p-green)}
.theme-pro .p-gps .p-live i:last-child{animation:ecpulse 1.8s ease-out infinite}
.theme-pro .p-gpsnote{text-align:center;font-size:11.5px;color:var(--p-mut);font-weight:500;margin-top:3px}
.theme-pro .p-sect{font-size:11.5px;font-weight:800;color:var(--p-mut);text-transform:uppercase;letter-spacing:.07em;margin:22px 2px 6px}
.theme-pro .p-ev{display:flex;align-items:center;justify-content:space-between;padding:11px 0;border-bottom:1px solid #eef2ef}
.theme-pro .p-ev .p-l{display:flex;align-items:center;gap:10px}
.theme-pro .p-chip{font-size:10.5px;font-weight:800;padding:4px 10px;border-radius:999px;letter-spacing:.02em}
.theme-pro .p-chip.in{background:var(--p-green-t);color:var(--p-green-d)}
.theme-pro .p-chip.out{background:#eef1f0;color:var(--p-mut)}
.theme-pro .p-ev .p-w{font-size:12.5px;color:var(--p-mut);font-weight:600}
.theme-pro .p-ev .p-tm{font-size:14px;font-weight:700}
.theme-pro .p-quick{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px}
.theme-pro .p-ql{display:flex;flex-direction:column;align-items:center;gap:8px;border:1.5px solid var(--p-line);background:#fff;border-radius:16px;padding:15px 6px;text-decoration:none;color:var(--p-ink)}
.theme-pro .p-ql .ic{width:22px;height:22px;color:var(--p-green-d)}
.theme-pro .p-ql span{font-size:12.5px;font-weight:600}
.theme-pro .p-locbtn{display:inline-flex;align-items:center;gap:7px;background:#fff;border:1.5px solid var(--p-line);border-radius:999px;padding:11px 15px;min-height:44px;box-sizing:border-box;font-size:12.5px;font-weight:700;color:var(--p-mut);margin:2px 0 14px;cursor:pointer;font-family:inherit}
.theme-pro .p-locbtn .ic{width:15px;height:15px;color:var(--p-green-d)}
.theme-pro .p-locbtn .chg{color:var(--p-green-d);text-decoration:underline}
.theme-pro .p-locsel{width:100%;box-sizing:border-box;padding:13px;margin:2px 0 14px;border:1.5px solid var(--p-line);border-radius:13px;font-size:15px;font-weight:600;font-family:inherit;background:#fff;color:var(--p-ink)}
.theme-pro .p-rap{background:#fff;border:1.5px solid var(--p-line);border-radius:18px;padding:16px;margin-top:16px}
.theme-pro .p-rap .p-h{display:flex;align-items:center;gap:9px;font-size:14.5px;font-weight:700}
.theme-pro .p-rap .p-h .ic{width:19px;height:19px;color:var(--p-green-d)}
.theme-pro .p-rap p{font-size:12.5px;color:var(--p-mut);margin:8px 0 12px;line-height:1.45}
.theme-pro .p-rap a{display:block;text-align:center;background:var(--p-act-a);color:#fff;border-radius:12px;padding:13px;font-weight:700;font-size:15px;text-decoration:none;font-family:inherit}
.theme-pro .p-resp{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--p-green-t);color:var(--p-green-d);border:1px solid var(--p-green);border-radius:14px;padding:13px;font-weight:700;font-size:14.5px;text-decoration:none;margin-bottom:6px}
.theme-pro .p-resp .ic{width:18px;height:18px}


/* ============================================================
   FONDAZIONE CONDIVISA (redesign 13/07) — icone + tabelle + campi data
   fuori da .theme-pro. Additiva: .theme-pro .ic (spec. maggiore) resta intatta.
   ============================================================ */
.ic{stroke:currentColor;stroke-width:1.85;fill:none;stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:-.15em;width:1em;height:1em;flex:none}
.adminwrap .ic{width:18px;height:18px;vertical-align:-3px}
h2.sec .ic,.set-glab .ic{color:var(--green-dk)}
/* tabella con scroll orizzontale INTERNO (mai il body) */
.tbl-scroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
/* centratura celle (prima colonna resta a sinistra per leggibilità) */
.tbl-c th,.tbl-c td{text-align:center}
.tbl-c th:first-child,.tbl-c td:first-child{text-align:left}
/* campi data: dentro la card, valore centrato, mai overflow in flex */
.ec-date{box-sizing:border-box;max-width:100%;text-align:center}
.ec-date::-webkit-date-and-time-value{text-align:center}
/* controlli dei filtri/form: riempiono il wrapper e non sforano mai (fix overflow select/input in .inline) */
.inline > div > input:not([style*="width"]),.inline > div > select{width:100%}
.inline > div > input,.inline > div > select{max-width:100%;box-sizing:border-box}
/* i contenitori data/ora mantengono un floor leggibile e vanno a capo puliti (evita che si riducano a icona) */
.inline > div:has(> input[type=date]),.inline > div:has(> input[type=datetime-local]){flex:1 1 160px;min-width:150px}
/* (.ec-back rimossa: i link "indietro" delle sotto-pagine usano stile inline) */
