
:root {
  --bg:#F7F4ED; --surface:#FFFFFF; --surface-2:#F1ECE0;
  --border:#E5DDCC; --border-strong:#C9BFA7;
  --ink:#1A1815; --ink-2:#5C5648; --ink-m:#9B9281;
  --brand:#669F1E; --brand-dk:#4F7C17; --brand-sf:#E8F0D8;
  --warm:#C77B5C; --warm-sf:#F5E4DA; --warm-dk:#7a4028;
  --warning:#C99450; --warning-sf:#F8EDD8;
  --error:#B8554C; --error-sf:#F5E1DE;
}
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); -webkit-font-smoothing:antialiased; }
.mono { font-family:'SF Mono',Consolas,'Courier New',monospace; }
.uc { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.12em; color:var(--ink-m); }
button { font-family:inherit; cursor:pointer; }
input,select,textarea { font-family:inherit; }

/* ===== top nav ===== */
.topnav { position:sticky; top:0; z-index:50; background:var(--ink); padding:0 16px; display:flex;
  align-items:center; gap:4px; overflow-x:auto; box-shadow:0 2px 12px rgba(0,0,0,0.15); }
.topnav .logo { display:flex; align-items:center; gap:7px; color:#fff; font-size:13px; font-weight:600;
  letter-spacing:0.2em; padding:14px 16px 14px 4px; flex-shrink:0; }
.topnav .logo .bar { width:14px; height:2px; background:var(--brand); }
.topnav .nav-tab { text-decoration:none; display:inline-block; background:transparent; border:none; color:rgba(255,255,255,0.55); font-size:12px;
  font-weight:500; padding:15px 13px; white-space:nowrap; border-bottom:2px solid transparent; }
.topnav .nav-tab:hover { color:rgba(255,255,255,0.85); }
.topnav .nav-tab.active { color:#fff; border-bottom-color:var(--brand); }
.topnav .group-label { color:rgba(255,255,255,0.3); font-size:9px; text-transform:uppercase;
  letter-spacing:0.1em; padding:0 8px 0 16px; white-space:nowrap; border-left:1px solid rgba(255,255,255,0.1); }

.screen { display:none; max-width:1080px; margin:0 auto; padding:22px 16px 60px; }
.screen.active { display:block; }
.screen-note { background:var(--brand-sf); border:1px solid rgba(102,159,30,0.3); border-radius:10px;
  padding:12px 16px; margin-bottom:18px; font-size:12.5px; color:var(--ink-2); line-height:1.5; }
.screen-note b { color:var(--brand-dk); }

/* ===== layout admin ===== */
.admin-wrap { display:flex; background:var(--bg); border:1px solid var(--border); border-radius:12px; overflow:hidden; min-height:640px; }
.sidebar { width:200px; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; flex-shrink:0; }
.sb-head { padding:20px 18px 16px; border-bottom:1px solid var(--border); }
.sb-logo { display:flex; align-items:center; gap:7px; font-size:16px; font-weight:600; letter-spacing:0.2em; }
.sb-logo .bar { width:14px; height:2px; background:var(--brand); }
.sb-nav { flex:1; padding:12px 10px; }
.nav-i { width:100%; display:flex; align-items:center; gap:10px; padding:9px 12px; margin-bottom:2px;
  border:none; border-radius:8px; font-size:12.5px; text-align:left; background:transparent; color:var(--ink-2); position:relative; }
.nav-i.on { background:var(--ink); color:#fff; font-weight:500; }
.nav-i .bdg { font-size:10.5px; font-weight:600; padding:1px 7px; border-radius:10px; margin-left:auto;
  background:var(--brand-sf); color:var(--brand-dk); }
.nav-i.on .bdg { background:var(--brand); color:#fff; }
.sb-user { padding:12px; border-top:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.avatar { border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:600; flex-shrink:0; }
.main { flex:1; min-width:0; }
.hdr { min-height:60px; padding:10px 22px; border-bottom:1px solid var(--border); background:var(--surface);
  display:flex; align-items:center; gap:14px; }
.card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px 16px; position:relative; }
.accent { position:absolute; top:0; left:0; width:22px; height:2px; background:var(--brand); }
.chip { padding:5px 12px; border-radius:20px; border:1px solid var(--border); background:var(--surface);
  font-size:12px; font-weight:500; color:var(--ink-2); display:inline-flex; align-items:center; gap:6px; }
.chip.on { background:var(--ink); color:#fff; border-color:var(--ink); }
.dot { width:6px; height:6px; border-radius:50%; display:inline-block; }
.pill { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:12px; font-size:10.5px; font-weight:600; }
.btn-primary { padding:9px 14px; border-radius:9px; border:none; background:var(--brand); color:#fff;
  font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:6px; }
.btn-ghost { padding:8px 12px; border-radius:8px; border:1px solid var(--border); background:var(--surface);
  color:var(--ink-2); font-size:11.5px; font-weight:500; }
.prog { height:4px; background:var(--surface-2); border-radius:2px; overflow:hidden; }
.prog > div { height:100%; border-radius:2px; background:var(--brand); }

/* client */
.cli-wrap { background:var(--bg); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.cli-head { background:var(--surface); border-bottom:1px solid var(--border); }
.cli-head-in { max-width:880px; margin:0 auto; padding:14px 22px; display:flex; align-items:center; justify-content:space-between; }
.cli-tabs { max-width:880px; margin:0 auto; padding:0 22px; display:flex; gap:2px; }
.cli-tab { display:inline-flex; align-items:center; gap:6px; padding:11px 13px; border:none; background:transparent;
  font-size:12.5px; color:var(--ink-m); border-bottom:2px solid transparent; margin-bottom:-1px; }
.cli-tab.on { color:var(--ink); font-weight:600; border-bottom-color:var(--brand); }
.cli-body { max-width:880px; margin:0 auto; padding:22px; }

.dark-card { background:linear-gradient(180deg,#1A1815 0%,#2A2620 100%); border-radius:14px; padding:20px; color:#fff; }
.seg { display:flex; gap:3px; }
.seg > div { flex:1; height:10px; border-radius:3px; }
.seg .full { background:var(--brand); }
.seg .empty { background:rgba(255,255,255,0.15); }

/* le regole responsive sono in fondo al file */

/* multi-page: screens always visible */
.screen { display:block; }

/* fix nav links: nessun colore blu/viola da browser */
.topnav a.nav-tab, .topnav a.nav-tab:visited { color:rgba(255,255,255,0.55); text-decoration:none; }
.topnav a.nav-tab:hover { color:rgba(255,255,255,0.85); }
.topnav a.nav-tab.active, .topnav a.nav-tab.active:visited { color:#fff; }
.topnav a.logo, .topnav a.logo:visited { color:#fff; text-decoration:none; }

/* ===== app: form e tabelle ===== */
.f-input, .f-select, .f-textarea { width:100%; padding:10px 12px; border-radius:9px; border:1px solid var(--border);
  background:var(--surface); font-size:13px; color:var(--ink); outline:none; font-family:inherit; }
.f-input:focus, .f-select:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(102,159,30,0.12); }
.f-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.12em; color:var(--ink-m);
  display:block; margin-bottom:6px; }
.f-row { margin-bottom:14px; }
.tbl { width:100%; border-collapse:collapse; font-size:12.5px; }
.tbl th { text-align:left; padding:9px 12px; background:var(--bg); font-size:10px; font-weight:600;
  text-transform:uppercase; letter-spacing:0.1em; color:var(--ink-m); border-bottom:1px solid var(--border); }
.tbl td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.tbl tr:last-child td { border-bottom:none; }
.alert { padding:11px 14px; border-radius:9px; font-size:12.5px; margin-bottom:14px; }
.alert.ok { background:var(--brand-sf); color:var(--brand-dk); border:1px solid rgba(102,159,30,0.3); }
.alert.err { background:var(--error-sf); color:var(--error); border:1px solid rgba(184,85,76,0.3); }
.alert.warn { background:var(--warning-sf); color:#8a5f1f; border:1px solid rgba(201,148,80,0.3); }
.btn-danger { padding:8px 12px; border-radius:8px; border:1px solid var(--error); background:var(--surface);
  color:var(--error); font-size:11.5px; font-weight:600; }
.btn-sm { padding:6px 10px; font-size:11px; }
a.plain { color:var(--brand-dk); font-weight:600; text-decoration:none; }
@media print { .sidebar, .topnav, .no-print { display:none !important; } body { background:#fff; } }

/* ===== logo ufficiale ===== */
.logo-img { display:block; height:auto; }
.logo-img.sm { width:110px; }      /* sidebar, header cliente */
.logo-img.md { width:150px; }      /* login, iscrizione */
.logo-img.lg { width:190px; }      /* pagine a tutta larghezza */
.logo-link { display:inline-block; line-height:0; text-decoration:none; }

/* ===== stampa delle guide ===== */
@media print {
  .guida { max-width: 100%; }
  .guida h2 { page-break-after: avoid; }
  .step, .nota, .attenzione { page-break-inside: avoid; }
  .indice { display: none; }
}

/* ===== mostra/nascondi password ===== */
.pw-box { position: relative; display: block; }
.pw-box input { padding-right: 40px !important; width: 100%; }
.pw-occhio { position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent; color: var(--ink-m);
  display: flex; align-items: center; justify-content: center; border-radius: 7px;
  cursor: pointer; padding: 0; }
.pw-occhio:hover { color: var(--ink); background: var(--surface-2); }
.pw-occhio:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }


/* ============================================================
   RESPONSIVE · adattamento a tablet e telefoni
   ============================================================ */

/* --- fondamenta: niente deve mai sfondare lo schermo --- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, svg, table { max-width: 100%; }

/* le tabelle non sfondano: è la card che scorre, non la tabella
   (così le colonne restano allineate) */
.card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { min-width: 100%; }

/* ------------------------------------------------------------
   TABLET  (641 – 1024px) · es. iPad in verticale
   ------------------------------------------------------------ */
@media (min-width: 641px) and (max-width: 1024px) {
  .sidebar { width: 168px; }
  .nav-i { padding: 10px; font-size: 12px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  /* le griglie a 3-4 colonne diventano 2 */
  [style*="repeat(4,1fr)"], [style*="repeat(4, 1fr)"],
  [style*="repeat(3,1fr)"], [style*="repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .hdr { flex-wrap: wrap; }
  .cli-body { padding: 20px 18px 40px; }
}

/* ------------------------------------------------------------
   TELEFONO  (fino a 640px)
   ------------------------------------------------------------ */
@media (max-width: 640px) {

  /* --- struttura admin: la sidebar diventa un menu a scomparsa --- */
  /* overflow visible: senza, la barra non resterebbe fissa in alto */
  .admin-wrap { flex-direction: column; overflow: visible; }
  .cli-wrap   { overflow: visible; }

  .sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 40; background: var(--surface);
  }
  .sb-head { display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: none; }
  .sb-nav { display: none; padding: 6px 10px 12px; border-top: 1px solid var(--border); }
  .sb-nav.aperto { display: block; }
  .sb-user { display: none; }
  .sb-user.aperto { display: flex; }
  .nav-i { padding: 12px; font-size: 14px; }          /* dita, non mouse */

  /* il bottone del menu */
  .menu-btn { display: flex !important; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--ink); flex-shrink: 0; }
  .menu-btn span { display: block; width: 18px; height: 2px; background: currentColor;
    position: relative; }
  .menu-btn span::before, .menu-btn span::after { content: ''; position: absolute;
    left: 0; width: 18px; height: 2px; background: currentColor; }
  .menu-btn span::before { top: -6px; }
  .menu-btn span::after  { top: 6px; }

  .main { width: 100%; }
  .hdr { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .main > div[style*="padding"] { padding-left: 14px !important; padding-right: 14px !important; }

  /* --- area cliente --- */
  .cli-head-in { padding: 12px 14px; }
  .cli-tabs { padding: 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; }
  .cli-tabs::-webkit-scrollbar { display: none; }
  .cli-tab { padding: 12px 11px; white-space: nowrap; font-size: 13px; }
  .cli-body { padding: 16px 14px 40px; }

  /* --- TUTTE le griglie diventano una colonna sola --- */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid-4, .grid-3 { grid-template-columns: 1fr !important; }

  /* --- le card scorrono se il contenuto è largo --- */
  .card { padding: 14px; overflow-x: auto; }
  /* la tabella tiene una larghezza minima leggibile e scorre dentro la card */
  .tbl { min-width: 460px; }

  /* --- tabelle: font più piccolo e scorrimento --- */
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 9px 8px; }

  /* --- moduli: campi grandi, niente zoom automatico su iPhone --- */
  .f-input, .f-select, .f-textarea { font-size: 16px; padding: 12px; }
  .f-label { font-size: 11px; }

  /* --- bottoni: grandi abbastanza per il dito (44px) --- */
  .btn-primary, .btn-ghost, .btn-danger {
    min-height: 44px; padding: 12px 16px; font-size: 13.5px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .btn-sm { min-height: 38px; padding: 9px 12px; font-size: 12px; }

  /* le colonne "azioni" delle tabelle: i bottoni vanno a capo */
  .tbl td[style*="text-align:right"] { white-space: normal !important; }
  .tbl td form { display: inline-block; margin: 2px 0; }

  /* --- titoli un filo più piccoli --- */
  .hdr div[style*="font-size:18px"] { font-size: 17px !important; }

  /* --- il modale/riquadri larghi si adattano --- */
  .card[style*="max-width"] { max-width: 100% !important; }
  .dark-card { padding: 16px; }
}

/* ------------------------------------------------------------
   TELEFONO PICCOLO  (fino a 400px)
   ------------------------------------------------------------ */
@media (max-width: 400px) {
  .cli-body { padding: 14px 11px 36px; }
  .card { padding: 12px; }
  .tbl { font-size: 11.5px; }
  .tbl th, .tbl td { padding: 8px 6px; }
  .logo-img.sm { width: 92px; }
  .logo-img.md { width: 130px; }
}

/* il bottone menu non esiste su schermi grandi */
.menu-btn { display: none; }


/* ============================================================
   FINESTRA DI CONFERMA (sostituisce il confirm() del browser)
   ============================================================ */
.bm-velo {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10000;
  background: rgba(26, 24, 21, 0.45);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .16s ease;
}
.bm-velo.aperto { opacity: 1; }

.bm-modale {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(26, 24, 21, 0.28);
  border-top: 4px solid var(--brand);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform .18s cubic-bezier(.22,1,.36,1);
}
.bm-velo.aperto .bm-modale { transform: translateY(0) scale(1); }
.bm-modale.pericolo { border-top-color: var(--error); }

.bm-corpo { padding: 24px 26px 18px; }

.bm-icona {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-sf); color: var(--brand-dk);
}
.bm-modale.pericolo .bm-icona { background: var(--error-sf); color: var(--error); }

.bm-titolo {
  font-size: 17px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em; margin-bottom: 7px; line-height: 1.35;
}
.bm-testo {
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
}
.bm-testo b { color: var(--ink); }

.bm-azioni {
  display: flex; gap: 9px; padding: 14px 26px 22px; justify-content: flex-end;
}
.bm-azioni button {
  padding: 11px 20px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; min-height: 44px;
}
.bm-annulla {
  background: var(--surface); border-color: var(--border) !important; color: var(--ink-2);
}
.bm-annulla:hover { background: var(--surface-2); }
.bm-ok { background: var(--brand); color: #fff; }
.bm-ok:hover { background: var(--brand-dk); }
.bm-modale.pericolo .bm-ok { background: var(--error); }
.bm-modale.pericolo .bm-ok:hover { filter: brightness(0.92); }

@media (max-width: 640px) {
  .bm-velo { align-items: flex-end; padding: 0; }
  .bm-modale { max-width: 100%; border-radius: 18px 18px 0 0;
    transform: translateY(100%); }
  .bm-velo.aperto .bm-modale { transform: translateY(0); }
  .bm-azioni { flex-direction: column-reverse; padding: 14px 20px 24px; }
  .bm-azioni button { width: 100%; }
  .bm-corpo { padding: 22px 20px 16px; }
}

/* ============================================================
   RESPONSIVE · rifiniture v6 (mobile per tutte le pagine)
   ============================================================ */
@media (max-width: 640px) {

  /* le file flex scritte in linea vanno a capo invece di sfondare
     lo schermo (filtri, intestazioni con bottoni, righe con azioni) */
  [style*="display:flex"] { flex-wrap: wrap; }

  /* eccezione: le mini-statistiche a 3 colonne nelle card scure
     restano affiancate — tre numeri stanno comodi anche su iPhone */
  .dark-card [style*="1fr 1fr 1fr"] { grid-template-columns: repeat(3, 1fr) !important; }

  /* celle di tabella che rifiutavano di andare a capo */
  .tbl th[style*="nowrap"], .tbl td[style*="nowrap"] { white-space: normal !important; }

  /* testi lunghi (email, codici fiscali, nomi file) non allargano la pagina */
  .tbl td, .card { overflow-wrap: break-word; }

  /* i "chip" filtro nell'header sono comodi da toccare */
  .hdr .chip { min-height: 36px; }

  /* le tabelle corte (2-3 colonne) non hanno bisogno della larghezza
     minima: scorrono solo quelle davvero larghe */
  .tbl.stretta { min-width: 0; }
}

/* la card evidenziata quando si arriva da "Carica la copia firmata" */
.bm-lampeggia { animation: bm-lampeggio 1.2s ease 2; }
@keyframes bm-lampeggio {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px rgba(102, 159, 30, 0.35); border-color: var(--brand); }
}

/* ============================================================
   MENU AZIONI (⋯) · usato nelle tabelle con tante azioni
   ============================================================ */
.menu-azioni { position: relative; display: inline-block; }
.menu-azioni .ma-btn { font-size: 16px; line-height: 1; padding: 5px 10px; }
.ma-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  min-width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; box-shadow: 0 10px 28px rgba(26,24,21,0.14);
  padding: 6px; z-index: 60; text-align: left;
}
.menu-azioni.aperto .ma-pop { display: block; }
.ma-pop a, .ma-pop button {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: 9px 11px; font-size: 12.5px; color: var(--ink);
  background: none; border: none; border-radius: 8px;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.ma-pop a:hover, .ma-pop button:hover { background: var(--bg); }
.ma-pop form { margin: 0; }
.ma-pop .pericolo { color: var(--error); }
.ma-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* su telefono il menu si apre come foglio dal basso, mai tagliato */
@media (max-width: 640px) {
  .ma-pop {
    position: fixed; left: 10px; right: 10px; top: auto; bottom: 12px;
    box-shadow: 0 -8px 30px rgba(26,24,21,0.25);
  }
  .ma-pop a, .ma-pop button { padding: 13px 14px; font-size: 14px; }
}

/* ============================================================
   TELEFONO · tabelle a schede (admin e cliente) (15/10/2026)
   Prima la tabella teneva 460px e scorreva di lato dentro la card:
   sul telefono si vedeva solo un pezzo di ogni riga. Ora ogni riga
   diventa una scheda: prima cella in grande, le altre sotto con il
   titolo della colonna (lo mette js/app.js), i pulsanti in fondo.
   ============================================================ */
@media (max-width: 640px) {
  :is(.admin-wrap, .cli-wrap) .card { overflow-x: visible; }
  :is(.admin-wrap, .cli-wrap) .tbl { display: block; width: 100%; min-width: 0 !important; }
  :is(.admin-wrap, .cli-wrap) .tbl > thead, :is(.admin-wrap, .cli-wrap) .tbl tr.tbl-head { display: none; }
  :is(.admin-wrap, .cli-wrap) .tbl > tbody { display: block; }
  :is(.admin-wrap, .cli-wrap) .tbl tr {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 16px;
    padding: 12px 4px; border-bottom: 1px solid var(--border);
  }
  :is(.admin-wrap, .cli-wrap) .tbl tr:last-child { border-bottom: none; }
  :is(.admin-wrap, .cli-wrap) .tbl td, :is(.admin-wrap, .cli-wrap) .tbl th {
    display: block; border: none; padding: 0 !important;
    width: auto !important; min-width: 0; max-width: 100%;
    white-space: normal !important; overflow-wrap: anywhere; text-align: left !important;
  }
  :is(.admin-wrap, .cli-wrap) .tbl td:first-child,
  :is(.admin-wrap, .cli-wrap) .tbl td.tbl-piena { flex: 1 1 100%; font-size: 13px; }
  :is(.admin-wrap, .cli-wrap) .tbl td[data-label]:not([data-label=""]):not(:first-child)::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-m);
  }
  :is(.admin-wrap, .cli-wrap) .tbl td.tbl-azioni {
    flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  }
  :is(.admin-wrap, .cli-wrap) .tbl td.tbl-azioni::before { display: none !important; }
  :is(.admin-wrap, .cli-wrap) .tbl td.tbl-azioni form { margin: 0; }
  :is(.admin-wrap, .cli-wrap) .tbl td.tbl-azioni select { flex: 1 1 160px; min-width: 0; }
}

/* ============================================================
   HOME CLIENTE (15/10/2026) · pensata prima per il telefono
   ============================================================ */
.hm-top { margin-bottom: 14px; }
.hm-uc { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); }
.hm-big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.2; }
.hm-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 3px; }
.hm-azioni { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: flex-start; }
.hm-btn-disd { background: transparent; border: 1px solid rgba(255,255,255,0.28); color: #F3C1BB;
  border-radius: 9px; padding: 9px 13px; font-size: 12.5px; font-weight: 600; min-height: 38px; }
.hm-cnt { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 14px; }
.hm-c { display: block; background: rgba(255,255,255,0.07); border: 1px solid transparent; border-radius: 12px;
  padding: 11px 12px; color: #fff; text-decoration: none; min-width: 0; }
.hm-c b { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; }
.hm-c b small { font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 600; }
.hm-c span { display: block; font-size: 11px; color: rgba(255,255,255,0.72); line-height: 1.35; margin-top: 3px; }
.hm-c em { font-style: normal; font-weight: 700; color: #fff; }
.hm-c.verde { background: rgba(102,159,30,0.28); border-color: rgba(102,159,30,0.6); }
.hm-c.verde b { color: #C0DD97; }

.hm-h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin: 18px 2px 8px; font-size: 16px; font-weight: 700; scroll-margin-top: 80px; }
.hm-h2 a { font-size: 12.5px; font-weight: 600; color: var(--brand-dk); text-decoration: none; white-space: nowrap; }
.hm-lista { padding: 2px 14px !important; overflow: visible !important; }
.hm-riga { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hm-riga:last-of-type { border-bottom: none; }
.hm-ora { width: 54px; flex-shrink: 0; }
.hm-ora b { font-size: 15px; }
.hm-ora div { font-size: 10.5px; color: var(--ink-m); }
.hm-info { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.hm-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.hm-act form { margin: 0; }
.hm-disd { color: var(--error) !important; border-color: #E9C9C4 !important; }
.hm-rec { background: var(--warm); border: 1px solid var(--warm); color: #fff; border-radius: 9px;
  font-weight: 600; padding: 8px 12px; font-size: 12px; }
.hm-vuoto { font-size: 12.5px; color: var(--ink-m); padding: 14px 0; line-height: 1.5; }
.hm-altre { display: block; font-size: 12px; color: var(--ink-m); padding: 10px 0 12px; text-decoration: none;
  border-top: 1px solid var(--border); }
.hm-altre b { color: var(--brand-dk); }

/* menu "aggiungi al calendario" */
.cal-menu { position: relative; }
.cal-menu > summary { list-style: none; cursor: pointer; user-select: none; display: inline-flex;
  align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 15px; }
.cal-menu > summary::-webkit-details-marker { display: none; }
.cal-menu.scuro > summary { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22);
  color: #fff; font-size: 12.5px; font-weight: 600; padding: 0 13px; }
.cal-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.16);
  min-width: 220px; padding: 6px; }
.cal-menu.scuro .cal-pop { left: 0; right: auto; }
.cal-pop a { display: block; padding: 11px 12px; border-radius: 8px; color: var(--ink); text-decoration: none;
  font-size: 13.5px; font-weight: 600; }
.cal-pop a:hover, .cal-pop a:active { background: var(--surface-2); }
.cal-pop a small { display: block; font-size: 11px; color: var(--ink-m); font-weight: 400; margin-top: 1px; }

/* riquadro "tutte le lezioni nel calendario" */
.hm-cal { margin-top: 14px; overflow: visible !important; }
.hm-cal-h { font-size: 14.5px; font-weight: 700; }
.hm-cal-t { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.hm-cal-b { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hm-cal-b a { text-decoration: none; flex: 1 1 140px; }
.hm-cal-altro { margin-top: 10px; }
.hm-cal-altro > summary { font-size: 12.5px; color: var(--brand-dk); font-weight: 600; cursor: pointer; }
.hm-cal-n { font-size: 11.5px; color: var(--ink-m); margin-top: 8px; line-height: 1.55; }

/* icona sul telefono */
.hm-pwa { display: flex; gap: 12px; align-items: center; background: var(--brand-sf) !important;
  border-color: rgba(102,159,30,0.35) !important; margin-top: 14px; }
.hm-pwa[hidden] { display: none !important; }
.hm-pwa img { border-radius: 11px; border: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.hm-pwa-t { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.hm-pwa-t b { color: var(--ink); }
.hm-pwa-aiuto { margin-top: 6px; background: #fff; border-radius: 8px; padding: 8px 10px; }
.hm-pwa-b { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.hm-x { background: none; border: none; color: var(--ink-m); font-size: 11.5px; padding: 4px; }

@media (max-width: 400px) {
  .hm-big { font-size: 21px; }
  .hm-riga { gap: 8px; }
  .hm-ora { width: 48px; }
  /* intestazione cliente: su telefoni stretti logo più piccolo, così "Esci" resta in riga */
  .cli-head-in .logo-img.sm { width: 84px; }
  .cli-head-in > div { gap: 6px !important; }
  .cli-head-in .pill { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
}

/* ============================================================
   ADMIN · pagina Oggi, ricerca, barra in basso, WhatsApp (15/10/2026)
   ============================================================ */
.btn-wa { background: #25D366; border: 1px solid #25D366; color: #fff !important; border-radius: 9px;
  padding: 8px 12px; font-size: 12px; font-weight: 700; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; white-space: nowrap; }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { white-space: nowrap; }

.sb-cerca { padding: 4px 8px 10px; }
.sb-cerca input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; background: var(--bg); color: var(--ink); }

.og-cerca { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 6px 6px 12px; margin-bottom: 14px; }
.og-cerca input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px;
  padding: 6px 0; color: var(--ink); }

.og-lez { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
  overflow: hidden; scroll-margin-top: 80px; }
.og-lez > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface-2); }
.og-lez > summary::-webkit-details-marker { display: none; }
.og-lez[open] > summary { border-bottom: 1px solid var(--border); }
.og-ora { font-size: 18px; flex-shrink: 0; }
.og-tit { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.og-tit small { display: block; font-size: 11px; color: var(--ink-m); font-weight: 500; margin-top: 1px; }
.og-lista { padding: 2px 0; }
.og-p { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #EFE9DD; }
.og-n { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
  overflow-wrap: anywhere; }
.og-n small { display: block; font-size: 11px; color: var(--ink-m); font-weight: 400; margin-top: 1px; }
.og-tg { display: flex; flex-shrink: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin: 0; }
.og-tg button { border: none; background: var(--surface); color: var(--ink-m); font-size: 12.5px; font-weight: 600;
  padding: 0 11px; min-height: 38px; }
.og-tg button + button { border-left: 1px solid var(--border); }
.og-tg button.si { background: var(--brand); color: #fff; }
.og-tg button.no { background: var(--error); color: #fff; }
.og-nota { font-size: 12px; color: var(--ink-m); padding: 9px 14px; }
.og-apri { display: block; padding: 11px 14px; font-size: 12.5px; font-weight: 600; color: var(--brand-dk);
  text-decoration: none; }

.og-h2 { font-size: 16px; font-weight: 700; margin: 20px 2px 8px; }
.og-todo { padding: 0 !important; overflow: hidden !important; }
.og-t { display: block; border-bottom: 1px solid var(--border); }
.og-t:last-child { border-bottom: none; }
.og-t > summary, .og-link { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; color: var(--ink); text-decoration: none; }
.og-t > summary::-webkit-details-marker { display: none; }
.og-num { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.og-num.rosso { background: var(--error-sf); color: var(--error); }
.og-num.giallo { background: var(--warning-sf); color: #8a5f1f; }
.og-tt { flex: 1; min-width: 0; font-size: 14px; }
.og-tt small { display: block; font-size: 12px; color: var(--ink-m); margin-top: 1px; }
.og-fr { color: var(--ink-m); font-size: 20px; transition: transform .15s; }
.og-t[open] .og-fr { transform: rotate(90deg); }
.og-sub { background: var(--bg); border-top: 1px solid var(--border); }
.og-subr { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #EFE9DD; }

.og-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.og-kpi .card { margin: 0; padding: 12px; }
.og-k { font-size: 20px; font-weight: 700; margin-top: 4px; }

/* barra in basso: nascosta sul computer */
.admin-bar { display: none; }
@media (max-width: 640px) {
  .admin-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 2px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,0.05); }
  .admin-bar a, .admin-bar button { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; font-weight: 600;
    color: var(--ink-m); text-decoration: none; background: none; border: none; padding: 2px 0; min-height: 44px; }
  .admin-bar i { display: block; font-style: normal; font-size: 19px; line-height: 1.3; }
  .admin-bar .on { color: var(--brand-dk); }
  body:has(.admin-bar) { padding-bottom: 76px; }
  .admin-wrap ~ .no-print { padding-bottom: 90px !important; }   /* telefoni senza :has */
  .og-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .og-k { font-size: 17px; }
  .og-kpi .uc { font-size: 9px; letter-spacing: 0.06em; }
}

/* riquadro calendario: si vede solo la parte per il telefono in uso (js/app.js) */
.hm-cal [data-cal] { display: none; }
.hm-cal:not([data-sistema]) [data-cal="altro"],
.hm-cal[data-sistema="ios"] [data-cal="ios"],
.hm-cal[data-sistema="android"] [data-cal="android"],
.hm-cal[data-sistema="altro"] [data-cal="altro"] { display: block; }
.hm-cal-op { border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-top: 10px; font-size: 13px; }
.hm-cal-pass { margin: 8px 0 4px 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.hm-cal-pass li { margin-bottom: 9px; }
.hm-cal-pass a.btn-sm { text-decoration: none; }
.hm-cal-num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2);
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-right: 4px; }

/* Home: una riga sola per il calendario; il resto nella pagina collega_calendario.php */
.hm-cal-mini { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  margin-top: 0; margin-bottom: 12px; padding: 12px 14px !important; }
.hm-cal-ic { font-size: 22px; }
.hm-cal-tx { flex: 1; min-width: 0; font-size: 14px; }
.hm-cal-tx small { display: block; font-size: 11.5px; color: var(--ink-m); margin-top: 1px; }
.hm-cal-fr { font-size: 22px; color: var(--ink-m); }
/* pagina calendario: una scheda per scelta */
.cal-scelta { display: grid; gap: 6px; margin-bottom: 10px; font-size: 14px; overflow: visible !important; }
.cal-scelta > span { font-size: 12.5px; color: var(--ink-2); }
.cal-scelta > a.btn-primary { text-decoration: none; margin-top: 4px; }
.cal-passi > summary { list-style: none; cursor: pointer; margin-top: 4px; width: 100%; }
.cal-passi > summary::-webkit-details-marker { display: none; }
.cal-passi ol { margin: 10px 0 0 18px; padding: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.cal-passi li { margin-bottom: 10px; }
.cal-passi li a.btn-sm { text-decoration: none; margin-bottom: 4px; }
.cal-passi small { display: block; color: var(--ink-m); font-size: 11.5px; }

/* >>> TEMA 2026 · INIZIO <<< */
/* ============================================================
   TEMA 2026 · colori del logo (17/10/2026)
   Verde #669F1E, nero #191814, crema #F7F4ED e loro sfumature.
   Il rosso resta SOLO per ciò che è scaduto o da fare subito.
   Questo blocco sta in fondo e ridefinisce l'aspetto senza toccare
   le pagine: per tornare alla grafica di prima basta cancellarlo
   (da qui fino a "FINE TEMA 2026").
   ============================================================ */
:root {
  --bg:#F7F4ED; --surface:#FDFCF8; --surface-2:#EFEBE1;
  --border:#E3DED2; --border-strong:#D6D0C2;
  --ink:#191814; --ink-2:#5E5B54; --ink-m:#77736A;
  --brand:#669F1E; --brand-dk:#191814; --brand-sf:#E6EED6;
  /* "caldo" (recuperi) e "attenzione" diventano verde e neutro */
  --warm:#669F1E; --warm-sf:#E6EED6; --warm-dk:#191814;
  --warning:#5E5B54; --warning-sf:#EFEBE1;
  /* rosso: solo scaduto / urgente */
  --error:#B42318; --error-sf:#FBE6E3;
  --nero:#191814; --nero-2:#2A2924; --crema:#F7F4ED;
}
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI Variable Text','Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; }
.uc { font-weight:700; letter-spacing:0.1em; color:var(--ink-2); }

/* ---- pulsanti: verde con scritta nera (si legge: contrasto 5,3:1) ---- */
.btn-primary { background:var(--brand); color:var(--nero); font-weight:700; border-radius:12px; }
.btn-primary:hover { background:#5A8D1A; }
.btn-ghost { background:transparent; border-color:var(--border-strong); color:var(--ink); border-radius:12px; font-weight:600; }
.btn-ghost:hover { background:var(--surface-2); }
.btn-danger { border-radius:12px; background:transparent; }
.btn-sm { border-radius:10px; }
a.plain { color:var(--ink); font-weight:700; text-decoration:none; box-shadow:inset 0 -2px 0 var(--brand); }
a.plain:hover { color:var(--brand); }
.btn-wa { background:transparent; border:1px solid var(--border-strong); color:var(--ink) !important; border-radius:10px; }
.btn-wa:hover { background:var(--surface-2); }

/* ---- card e superfici ---- */
.card { background:var(--surface); border-color:var(--border); border-radius:18px; }
.accent { width:56px; height:5px; border-radius:0 0 5px 5px; left:18px; }
.chip { border-radius:999px; border-color:var(--border-strong); background:transparent; color:var(--ink); font-weight:600; }
.chip.on { background:var(--nero); color:var(--crema); border-color:var(--nero); }
.pill { border-radius:999px; }
.prog { background:var(--surface-2); height:5px; border-radius:3px; }

/* ---- card nera (prossima lezione) con la barretta verde del logo ---- */
.dark-card { background:var(--nero); border-radius:22px; position:relative; overflow:hidden; color:var(--crema); }
.dark-card::before { content:''; position:absolute; top:0; left:20px; width:64px; height:6px;
  border-radius:0 0 6px 6px; background:var(--brand); }
.seg .empty { background:#3A3832; }
.hm-uc { color:var(--brand); font-weight:700; }
.hm-sub { color:#C9C5BB; }
.hm-btn-disd { color:var(--crema); border-color:#4A4740; border-radius:12px; }
.hm-c { background:var(--nero-2); border-radius:14px; }
.hm-c.verde { background:rgba(102,159,30,0.18); border-color:rgba(102,159,30,0.55); }
.hm-c.verde b { color:var(--brand); }
.cal-menu.scuro > summary { border-radius:12px; }

/* ---- area cliente ---- */
.cli-head, .cli-head-in { background:var(--bg); }
.cli-head { border-bottom:1px solid var(--border); }
.logo-img.sm { width:120px; }
.cli-tab { color:var(--ink-2); font-size:13.5px; border-bottom-width:3px; }
.cli-tab.on { color:var(--ink); font-weight:700; border-bottom-color:var(--brand); }
.hm-h2 { font-weight:800; }
.hm-h2 a { color:var(--ink); font-weight:700; box-shadow:inset 0 -2px 0 var(--brand); }
.hm-rec { background:var(--brand); border-color:var(--brand); color:var(--nero); font-weight:700; border-radius:10px; }
.hm-disd { color:var(--ink) !important; border-color:var(--border-strong) !important; }
.hm-altre b { color:var(--ink); }
.hm-pwa { background:var(--surface) !important; border-color:var(--brand) !important; }

/* ---- area admin: barra laterale nera ---- */
.admin-wrap { border-radius:0; border:none; min-height:100vh; }
.sidebar { background:var(--nero); border-right:none; color:#C9C5BB; }
.sb-head { border-bottom-color:#2E2C27; }
.sb-head .logo-img { background:var(--crema); padding:8px 10px; border-radius:12px; box-sizing:content-box; width:104px; }
.sb-logo { color:var(--crema); }
.nav-i { color:#C9C5BB; border-radius:12px; font-size:13px; }
.nav-i:hover { background:var(--nero-2); color:var(--crema); }
.nav-i.on { background:var(--nero-2); color:var(--crema); font-weight:700; box-shadow:inset 3px 0 0 var(--brand); }
.nav-i .bdg { background:#3A3832; color:var(--crema); }
.nav-i.on .bdg { background:var(--brand); color:var(--nero); }
.sb-user { border-top-color:#2E2C27; color:#C9C5BB; }
.sb-user [style*="color"], .sb-user div, .sb-user span { color:#C9C5BB !important; }
.sb-user b, .sb-user strong, .sb-user [style*="font-weight:600"], .sb-user [style*="color:var(--ink)"] { color:var(--crema) !important; }
.sb-user a { color:var(--crema) !important; }
.sb-user .avatar { background:var(--brand) !important; color:var(--nero) !important; }
.sb-cerca input { background:var(--nero-2); border-color:#3A3832; color:var(--crema); }
.sb-cerca input::placeholder { color:#8C887E; }
.hdr { background:var(--bg); }

/* ---- moduli ---- */
.f-input, .f-select, .f-textarea { background:#FFFFFF; border-color:var(--border-strong); border-radius:12px; }
.f-input:focus, .f-select:focus, .f-textarea:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(102,159,30,0.18); }
.f-label { color:var(--ink-2); font-weight:700; }

/* ---- tabelle ---- */
.tbl th { background:transparent; color:var(--ink-2); font-weight:700; border-bottom-color:var(--border); }
.tbl td { border-bottom-color:#ECE8DE; }

/* ---- avvisi ---- */
.alert { border-radius:14px; }
.alert.ok { background:var(--brand-sf); color:var(--ink); border-color:rgba(102,159,30,0.45); }
.alert.warn { background:var(--surface); color:var(--ink); border:1.5px solid var(--ink); }
.alert.err { background:var(--error-sf); color:var(--error); border-color:rgba(180,35,24,0.35); }

/* ---- pagina Oggi ---- */
.og-cerca { background:#FFFFFF; border-color:var(--border-strong); border-radius:14px; }
.og-lez { border-radius:18px; }
.og-lez > summary { background:var(--surface); }
.og-p { border-bottom-color:#ECE8DE; }
.og-tg { border-color:var(--border-strong); border-radius:10px; }
.og-tg button.si { background:var(--brand); color:var(--nero); }
.og-tg button.no { background:var(--nero); color:var(--crema); }
.og-num { border-radius:10px; }
.og-num.giallo { background:var(--surface-2); color:var(--ink); }
.og-num.rosso { background:var(--error); color:#FFFFFF; }
.og-sub { background:var(--bg); }
.og-subr { border-bottom-color:#ECE8DE; }
.og-apri { color:var(--ink); }
.og-k { font-weight:800; }
.og-ora, .hm-ora b { font-family:inherit; font-weight:800; font-variant-numeric:tabular-nums; }

/* ---- barra in basso (telefono) ---- */
@media (max-width: 640px) {
  .admin-bar { background:var(--surface); }
  .admin-bar .on { color:var(--ink); box-shadow:inset 0 3px 0 var(--brand); }
  .sidebar { background:var(--nero); border-bottom:none; }
  .sb-head .logo-img { padding:5px 7px; width:72px; border-radius:10px; }
  .sb-nav { border-top-color:#2E2C27; }
  .menu-btn { background:var(--nero-2); border-color:#3A3832; color:var(--crema); }
}

/* ---- finestre di conferma e menu ---- */
.bm-modale { border-radius:20px; background:var(--surface); }
.bm-icona { background:var(--brand-sf); color:var(--ink); }
.bm-ok { background:var(--brand); color:var(--nero); }
.bm-ok:hover { background:#5A8D1A; }
.bm-modale.pericolo .bm-ok { color:#FFFFFF; }
.bm-annulla { background:transparent; color:var(--ink); }
.ma-pop { border-radius:14px; background:var(--surface); }
.cal-pop { border-radius:14px; background:var(--surface); }
@keyframes bm-lampeggio {
  0%, 100% { box-shadow:none; }
  50% { box-shadow:0 0 0 4px rgba(102,159,30,0.45); border-color:var(--brand); }
}

/* pulsanti e etichette scritti direttamente nelle pagine con sfondo verde e testo
   bianco: il bianco sul verde del logo si legge poco, si passa al nero */
:is([style*="background:var(--brand)"], [style*="background: var(--brand)"],
     [style*="background:var(--warm)"], [style*="background: var(--warm)"])
  :not([style*="-dk)"]) { color:var(--nero) !important; }
/* ============================ FINE TEMA 2026 ============================ */
/* ---- AREA CLIENTE · disegno 2026 (19/10/2026) ---- */
.cl .cli-head { background:var(--bg); border-bottom:none; }
.cl .cli-head-in { padding:16px 18px 10px; }
.cl .cli-tabs { border-bottom:1px solid var(--border); padding:0 8px; gap:0; }
.cl .cli-tab { flex:1 1 auto; justify-content:center; text-decoration:none; padding:12px 6px 10px;
  font-size:14px; font-weight:500; color:var(--ink-2); border-bottom:3px solid transparent; margin-bottom:-1px; }
.cl .cli-tab.on { color:var(--ink); font-weight:700; border-bottom-color:var(--brand); }
.cl .cli-body { max-width:640px; padding:16px 16px 28px; }
.cl .logo-img.sm { width:auto; height:40px; }

.cl-utente { display:flex; align-items:center; gap:10px; min-width:0; }
.cl-ciao { font-size:13px; color:var(--ink-2); white-space:nowrap; }
.cl-area { font-size:12px; font-weight:600; color:var(--ink); text-decoration:none; padding:6px 11px;
  border:1px solid var(--border-strong); border-radius:999px; white-space:nowrap; max-width:170px;
  overflow:hidden; text-overflow:ellipsis; }
.cl-avatar { width:38px; height:38px; flex-shrink:0; border-radius:50%; background:var(--nero); color:var(--crema);
  display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; text-decoration:none; }
.cl-avatar.grande { width:58px; height:58px; font-size:18px; font-weight:800;
  box-shadow:0 0 0 3px var(--bg), 0 0 0 5px var(--brand); }
.cl-titolo { margin-bottom:14px; }
.cl-titolo h1 { font-size:22px; font-weight:800; letter-spacing:-0.02em; }
.cl-titolo div { font-size:12.5px; color:var(--ink-2); margin-top:3px; }

.cl-uc { font-size:11px; font-weight:700; letter-spacing:0.11em; text-transform:uppercase; color:var(--brand); }
.cl-uc-grigio { color:#8C887E; margin-top:16px; }
.cl-pallino { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--brand); margin-right:6px; flex-shrink:0; }
.cl-pallino.rosso { background:var(--error); }
.cl-rosso { color:var(--error) !important; }
.cl-grigio { color:#8C887E; }

/* card nera: prossima lezione / abbonamento */
.cl-next { position:relative; overflow:hidden; background:var(--nero); color:var(--crema);
  border-radius:24px; padding:22px 20px 20px; margin-bottom:14px; }
.cl-next::before { content:''; position:absolute; top:0; left:20px; width:64px; height:6px;
  border-radius:0 0 6px 6px; background:var(--brand); }
.cl-next-top { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.cl-tag { font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:999px; background:var(--brand); color:var(--nero); }
.cl-tag.chiaro { background:var(--crema); }
.cl-next-tit { font-size:29px; line-height:1.08; font-weight:800; letter-spacing:-0.02em; margin-top:10px; }
.cl-next-quando { font-size:14px; color:#C9C5BB; margin-top:7px; line-height:1.5; }
.cl-next-quando a { color:var(--brand); font-weight:700; }
.cl-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:13px; }
.cl-chips span { font-size:12px; padding:5px 10px; border-radius:999px; border:1px solid #3A3832; color:#E4E0D6; }
.cl-chips.pieni span { background:var(--nero-2); border-color:var(--nero-2); font-weight:700; font-size:12.5px; border-radius:10px; padding:7px 11px; }
.cl-next-az { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; align-items:flex-start; }
.cl-next-az form { margin:0; }
.cl-next .cal-menu.scuro > summary { min-height:46px; padding:0 18px; border-radius:14px; border:none;
  background:var(--brand); color:var(--nero); font-size:14px; font-weight:700; gap:8px; }
.cl-next .cal-menu .cal-pop { color:var(--ink); }

/* pulsanti */
.cl-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:0 16px;
  border-radius:14px; font-family:inherit; font-size:13.5px; font-weight:700; text-decoration:none; cursor:pointer;
  border:1px solid transparent; white-space:nowrap; line-height:1.1; }
.cl-btn-verde { background:var(--brand); color:var(--nero); }
.cl-btn-verde:hover { background:#5A8D1A; }
.cl-btn-scuro { background:var(--nero); color:var(--crema); }
.cl-btn-scuro:hover { background:var(--nero-2); }
.cl-btn-bordo { background:transparent; border-color:var(--border-strong); color:var(--ink); font-weight:600; }
.cl-btn-bordo:hover { background:var(--surface-2); }
.cl-btn-chiaro { background:transparent; border-color:#4A4740; color:var(--crema); font-weight:600; min-height:46px; }
.cl-btn-spento { background:var(--surface-2); color:#77736A; font-weight:600; cursor:default; }
button.cl-btn-spento { cursor:pointer; }
.cl-pieno { width:100%; margin-top:12px; }
.cl-btn:focus-visible, .cl a:focus-visible, .cl summary:focus-visible { outline:3px solid var(--brand); outline-offset:2px; }

/* contatori */
.cl-cnt { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-bottom:14px; }
.cl-c { display:flex; flex-direction:column; min-width:0; background:var(--surface); border:1px solid var(--border);
  border-radius:18px; padding:13px 12px; color:var(--ink); text-decoration:none; }
a.cl-c:hover { border-color:var(--border-strong); }
.cl-c-lab { font-size:11px; font-weight:600; color:var(--ink-2); }
.cl-c b { font-size:26px; font-weight:800; line-height:1; margin-top:6px; }
.cl-c b small { font-size:14px; color:#8C887E; font-weight:600; }
.cl-c-sub { display:flex; align-items:center; font-size:11px; font-weight:600; color:var(--ink-2); margin-top:8px; line-height:1.3; }
.cl-c-rosso { border-color:rgba(180,35,24,0.45); background:var(--error-sf); }
.cl-c-rosso .cl-c-sub { color:var(--error); }
.cl-barra { display:block; height:5px; border-radius:3px; background:var(--surface-2); margin-top:9px; overflow:hidden; }
.cl-barra i { display:block; height:100%; background:var(--brand); border-radius:3px; }

/* posto liberato */
.cl-liberato { display:flex; align-items:center; gap:12px; background:var(--surface); border:2px solid var(--brand);
  border-radius:22px; padding:16px; margin-bottom:14px; }
.cl-liberato-tx { flex:1; min-width:0; display:flex; flex-direction:column; }
.cl-liberato-tx .cl-uc { color:var(--ink); display:flex; align-items:center; }
.cl-liberato-tx b { font-size:15px; margin-top:5px; }
.cl-liberato-tx span:last-child { font-size:12.5px; color:var(--ink-2); }

/* sezioni ed elenchi */
.cl-sez { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin:20px 2px 8px; scroll-margin-top:90px; }
.cl-sez h2 { font-size:17px; font-weight:800; }
.cl-sez a, .cl-card-h a { font-size:13px; font-weight:700; color:var(--ink); text-decoration:none;
  box-shadow:inset 0 -2px 0 var(--brand); white-space:nowrap; }
.cl-lista { background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:2px 16px; margin-bottom:12px; }
.cl-riga { display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid #ECE8DE; }
.cl-riga:first-child { border-top:none; }
.cl-riga.mia .cl-ora b { color:var(--brand); }
.cl-data { width:46px; height:50px; flex-shrink:0; border-radius:12px; background:var(--surface-2);
  display:flex; flex-direction:column; align-items:center; justify-content:center; }
.cl-data span { font-size:10px; font-weight:700; color:var(--ink-2); }
.cl-data b { font-size:18px; font-weight:800; line-height:1.1; }
.cl-data.scura { background:var(--nero); color:var(--crema); }
.cl-data.scura span { color:var(--brand); }
.cl-ora { width:52px; flex-shrink:0; display:flex; flex-direction:column; }
.cl-ora b { font-size:17px; font-weight:800; font-variant-numeric:tabular-nums; }
.cl-ora span { font-size:11px; color:#77736A; }
.cl-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.cl-info b { font-size:14px; font-weight:700; }
.cl-info > span { font-size:12.5px; color:var(--ink-2); display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; }
.cl-az { display:flex; gap:6px; align-items:center; flex-wrap:wrap; justify-content:flex-end; flex-shrink:0; }
.cl-az form { margin:0; }
.cl-az .cl-btn { min-height:40px; padding:0 13px; font-size:13px; border-radius:12px; }
.cl-az .cal-menu > summary { min-width:40px; min-height:40px; border-radius:12px; border-color:var(--border-strong); background:transparent; color:var(--ink); }
.cl-pill { font-style:normal; display:inline-block; font-size:11px; font-weight:600; padding:3px 9px; border-radius:999px;
  border:1px solid var(--border-strong); color:var(--ink-2); line-height:1.3; white-space:nowrap; }
.cl-pill.verde { background:var(--brand); border-color:var(--brand); color:var(--nero); font-weight:700; }
.cl-pill.scura { background:var(--nero); border-color:var(--nero); color:var(--crema); font-weight:700; }
.cl-pill.rossa { background:var(--error); border-color:var(--error); color:#FFFFFF; font-weight:700; }
.cl-pill.bordo { border:1.5px solid var(--ink); color:var(--ink); font-weight:700; }
.cl-info b .cl-pill { margin-left:6px; vertical-align:1px; }
.cl-vuoto { font-size:13px; color:var(--ink-2); padding:16px 0; line-height:1.55; }
.cl-altre { display:block; font-size:12.5px; color:var(--ink-2); padding:11px 0 13px; text-decoration:none; border-top:1px solid #ECE8DE; }
.cl-altre b { color:var(--ink); }
.cl-nota { font-size:12px; color:var(--ink-2); line-height:1.5; margin:6px 4px 0; }

/* prenota */
.cl-banner { display:flex; align-items:center; gap:12px; background:var(--nero); color:var(--crema);
  border-radius:20px; padding:15px 16px; margin-bottom:12px; }
.cl-banner-n { width:42px; height:42px; flex-shrink:0; border-radius:12px; background:var(--brand); color:var(--nero);
  display:flex; align-items:center; justify-content:center; font-size:19px; font-weight:800; }
.cl-banner div { display:flex; flex-direction:column; min-width:0; }
.cl-banner b { font-size:14.5px; }
.cl-banner span:last-child { font-size:12px; color:#C9C5BB; margin-top:2px; }
.cl-filtri { display:flex; gap:6px; margin-bottom:10px; overflow-x:auto; scrollbar-width:none; }
.cl-filtri::-webkit-scrollbar { display:none; }
.cl-filtri a { display:inline-flex; align-items:center; min-height:40px; padding:0 15px; border-radius:999px;
  border:1px solid var(--border-strong); color:var(--ink); text-decoration:none; font-size:13px; font-weight:600; white-space:nowrap; }
.cl-filtri a.on { background:var(--nero); border-color:var(--nero); color:var(--crema); font-weight:700; }
.cl-periodo { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.cl-periodo span { flex:1; text-align:center; font-size:12.5px; font-weight:600; color:var(--ink-2); }
.cl-periodo a { width:44px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:12px;
  border:1px solid var(--border-strong); color:var(--ink); text-decoration:none; font-size:20px; font-weight:700; }
.cl-giorno { font-size:11px; font-weight:800; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-2); margin:16px 4px 8px; }

/* abbonamento */
.cl-abb .cl-next-tit { font-size:24px; }
.cl-abb-num { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:16px;
  padding-top:14px; border-top:1px solid #2E2C27; }
.cl-abb-num span { display:block; font-size:10.5px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#8C887E; }
.cl-abb-num b { display:block; font-size:24px; font-weight:800; margin-top:4px; }
.cl-abb-num b small { font-size:13px; color:#8C887E; }
.cl-abb-num b.piccolo { font-size:15px; margin-top:7px; }
.cl-abb-num b.verde { color:var(--brand); }
.cl-tacche { display:flex; gap:4px; margin-top:12px; }
.cl-tacche i { flex:1; height:8px; border-radius:4px; background:#3A3832; }
.cl-tacche i.piena { background:var(--brand); }
.cl-card { background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:16px; margin-bottom:12px;
  scroll-margin-top:90px; overflow:visible !important; }
.cl-card-h { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:6px; }
.cl-card-h h2 { font-size:16px; font-weight:800; }
.cl-mini { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:10px 0 4px; }
.cl-mini div { background:var(--surface-2); border-radius:14px; padding:12px; }
.cl-mini b { display:block; font-size:22px; font-weight:800; }
.cl-mini b small { font-size:13px; color:#8C887E; }
.cl-mini span { font-size:11.5px; color:var(--ink-2); }
.cl-voce { display:flex; align-items:center; gap:10px; padding:11px 0; border-top:1px solid #ECE8DE; font-size:13.5px; }
.cl-card-h + .cl-voce { border-top:none; }
.cl-voce > span { flex:1; min-width:0; }
.cl-voce small { display:block; font-size:11.5px; color:var(--ink-2); }
.cl-voce.scaduta small { color:var(--error); font-weight:600; }
.cl-voce b { white-space:nowrap; }
.cl-testo { font-size:13px; color:var(--ink-2); line-height:1.55; margin-bottom:12px; }
.cl-bottoni { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.cl-carica { margin-top:4px; padding-top:12px; border-top:1px solid #ECE8DE; }
.cl-carica-r { display:flex; gap:8px; align-items:stretch; }
.cl-carica-r .f-input { flex:1; min-width:0; }
.cl-carica-r .pw-box { flex:1; min-width:0; }
.cl-nota-p { font-size:11.5px; color:var(--ink-2); margin-top:8px; line-height:1.5; }

/* account */
.cl-profilo { display:flex; align-items:center; gap:14px; padding:6px 4px 16px; }
.cl-profilo h1 { font-size:20px; font-weight:800; letter-spacing:-0.01em; }
.cl-profilo span:not(.cl-avatar) { font-size:13px; color:var(--ink-2); }
.cl-menu { background:var(--surface); border:1px solid var(--border); border-radius:20px; margin-bottom:12px; overflow:hidden; }
.cl-menu a { display:flex; align-items:center; gap:12px; padding:13px 16px; border-top:1px solid #ECE8DE;
  color:var(--ink); text-decoration:none; font-size:14px; font-weight:600; min-height:28px; }
.cl-menu a:first-child { border-top:none; }
.cl-menu a:hover { background:var(--surface-2); }
.cl-menu i { margin-left:auto; font-style:normal; color:#8C887E; font-size:18px; }
.cl-ic { width:34px; height:34px; border-radius:10px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.cl-campi { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; margin-top:8px; }
.cl-sotto { font-size:12.5px; font-weight:700; margin:6px 0 10px; padding-top:12px; border-top:1px solid #ECE8DE; }
.cl-esci { margin:4px 0 12px; }
.cl-cancella { border-color:var(--border); }

/* avvisi in cima alle pagine: stesso raggio delle card */
.cl .cli-body > .card[style*="border-left"] { border-radius:18px; }

@media (max-width: 640px) {
  .cl .cli-body { padding:14px 14px 24px; }
  .cl .cli-tab { font-size:13.5px; padding:12px 4px 10px; }
  .cl-campi { grid-template-columns:1fr; }
  .cl-next-tit { font-size:26px; }
  .cl-riga { flex-wrap:wrap; }
  .cl-riga .cl-info { flex:1 1 140px; }
}
@media (max-width: 400px) {
  .cl-ciao { display:none; }
  .cl .logo-img.sm { height:34px; }
  .cl-cnt { gap:6px; }
  .cl-c { padding:12px 10px; }
  .cl-c b { font-size:23px; }
  .cl-lista { padding:2px 12px; }
  .cl-data { width:42px; }
  .cl-az .cl-btn { padding:0 11px; }
}

/* avvisi (contratto da firmare, certificato, rate scadute, recuperi in scadenza…) */
.cl-avviso { background:var(--surface); border:1.5px solid var(--ink); border-radius:20px; padding:14px 16px; margin-bottom:12px; }
.cl-avviso > b, .cl-avviso-tx > b { display:block; font-size:14px; font-weight:800; }
.cl-avviso > div:not(.cl-bottoni):not(.cl-avviso-r), .cl-avviso-tx > div { font-size:12.5px; color:var(--ink-2); line-height:1.6; margin-top:4px; }
.cl-avviso .cl-bottoni { margin:12px 0 0; }
.cl-avviso-r { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.cl-avviso-tx { flex:1 1 220px; min-width:0; }
.cl-avviso.rosso { border-color:var(--error); background:var(--error-sf); }
.cl-avviso.rosso > b, .cl-avviso.rosso .cl-avviso-tx > b { color:var(--error); }
.cl-avviso.verde { border:2px solid var(--brand); }
/* titoli delle card rimaste con lo stile scritto nella pagina (privacy, cancellazione) */
.cl-card > div[style*="font-size:13.5px"]:first-child { font-size:16px !important; font-weight:800 !important; }
/* ---- AREA ADMIN · ritocchi (19/10/2026) ---- */
/* intestazione della pagina: titolo grande, data e numeri su una riga sotto,
   i filtri per attività su una riga loro (sul telefono stavano tutti schiacciati) */
.hdr { background:var(--bg); border-bottom:none; padding:18px 22px 8px; gap:10px 16px; flex-wrap:wrap; }
.hdr > div:first-child > div:first-child { font-size:24px !important; font-weight:800 !important; letter-spacing:-0.02em; line-height:1.15; }
.hdr > div:first-child > div + div { font-size:13px !important; color:var(--ink-2) !important; margin-top:3px; }
.hdr .chip { min-height:36px; }
@media (max-width: 640px) {
  .hdr { padding:16px 14px 4px; }
  .hdr > div:first-child { flex:1 1 100% !important; min-width:0; }
  .hdr > div:first-child > div:first-child { font-size:23px !important; }
  .hdr > .chips-scroll, .hdr > div:not(:first-child) { flex:1 1 100%; max-width:100%; }
  .hdr .chips-scroll { padding-bottom:2px; }
}

/* menu del telefono: quando è aperto copre lo schermo e scorre da solo;
   la pagina sotto resta ferma dov'era (lo blocca js/app.js). A menu chiuso non cambia niente. */
@media (max-width: 640px) {
  html.menu-aperto .sidebar { position:fixed; top:0; left:0; right:0; bottom:0; z-index:200;
    height:100vh; height:100dvh; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  html.menu-aperto .sb-head { position:sticky; top:0; z-index:1; background:var(--nero); }
  html.menu-aperto body { position:fixed; left:0; right:0; width:100%; overflow:hidden; }
  .sb-user.aperto { padding-bottom:calc(16px + env(safe-area-inset-bottom)); }
}
.hdr a.chip { text-decoration:none; }
/* >>> TEMA 2026 · FINE <<< */

/* ---- campo Cerca delle pagine (05/11/2026) ---- */
.cerca-box { display:flex; align-items:center; gap:8px; margin-bottom:14px; max-width:560px; }
.cerca-box input[type="search"] { flex:1 1 auto; min-width:0; height:44px; padding:0 13px 0 38px; font:inherit;
  font-size:14px; color:var(--ink); background:#FFFFFF
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B675D' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  border:1px solid var(--border-strong); border-radius:12px; outline:none; -webkit-appearance:none; appearance:none; }
.cerca-box input[type="search"]:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(102,159,30,0.18); }
.cerca-box .btn-primary, .cerca-box .btn-ghost { flex:none; height:44px; display:inline-flex; align-items:center;
  justify-content:center; padding:0 15px; text-decoration:none; }
.cerca-esito { margin:0 0 14px; font-size:13px; color:var(--ink-2); }
.cerca-esito b { color:var(--ink); }
.cerca-vuoto { margin:0 0 14px; padding:14px 16px; font-size:13px; color:var(--ink-m); }
.filtra-no { display:none !important; }
@media (max-width: 640px) {
  .cerca-box { max-width:none; }
  .cerca-box input[type="search"] { font-size:16px; } /* sotto i 16px l'iPhone ingrandisce la pagina */
}
