/* =============================================================================
   Gestionale centro cinofilo — stile
   Una sola famiglia tipografica, un solo colore d'accento, bordi sottili,
   niente ombre. I colori delle discipline arrivano dai dati.
   ============================================================================= */

:root {
  --bg: #ffffff;
  --surface: #f5f7f4;
  --surface-2: #eaeee8;
  --line: #dfe4de;
  --line-strong: #c5ccc3;
  --ink: #1c2a22;
  --ink-2: #4a5851;
  --muted: #7c8a82;
  --accent: #1f7a45;
  --accent-ink: #145a32;
  --accent-soft: #e4f2e9;
  --warn: #a8690c;
  --warn-soft: #fbf1dc;
  --danger: #b3382f;
  --danger-soft: #fae6e4;
  --info-soft: #e6eef8;
  --radius: 6px;
  --radius-lg: 10px;
  --sidebar: 224px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--surface);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .hint { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-demo {
  margin-top: 16px; padding: 12px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn); font-size: 13px;
}

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface);
  position: sticky; top: 0; height: 100vh;
  z-index: 20;   /* sopra il contenuto: la tendina delle notifiche deve coprirlo */
}
.brand { padding: 4px 10px 18px; display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; flex: none; }
.brand .name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand .role { color: var(--muted); font-size: 13px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.disabled { color: var(--muted); opacity: .6; pointer-events: none; }
.nav a .soon { margin-left: auto; font-size: 11px; color: var(--muted); }
.nav a .nav-badge[hidden] { display: none; }
.nav a .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
/* scheda richiesta (pannello) */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 16px; }
.kv > div > div { font-weight: 500; margin-top: 2px; word-break: break-word; }
.nota-lunga { white-space: pre-wrap; background: var(--bg); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.sidebar .user { padding: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.sidebar .link-aiuto { display: inline-block; margin-bottom: 8px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.sidebar .link-aiuto:hover { background: var(--accent); color: #fff; }
.sidebar .user button { display: block; margin-top: 4px; }

.main { padding: 28px 36px 60px; max-width: 1180px; width: 100%; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.page-head > div:first-child { flex: 1 1 420px; min-width: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--bg);
  cursor: pointer; font-weight: 500; line-height: 1.2; white-space: nowrap;
  transition: background .12s;
}
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: #e4b8b4; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field .help { font-size: 12px; color: var(--muted); }
.input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--bg);
}
.input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 72px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
tr.inattivo td:not(:last-child) { opacity: .6; }
.accesso-row.inattivo > div:first-child { opacity: .6; }
.accesso-row .input.sm { padding: 4px 8px; font-size: 13px; width: auto; }
/* form a sezioni (scheda cliente): titoletto, riga CAP · Città · Provincia */
.form-sez { margin-bottom: 6px; }
.form-sez > h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; }
.form-sez > h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-sez + .form-sez { margin-top: 8px; }
.row-ind { display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px; gap: 12px; }
.search { max-width: 340px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .field { margin-bottom: 0; }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }
.ok-box { background: var(--accent-soft); color: var(--accent-ink); padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; background: var(--bg); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface); }
td.num, th.num { text-align: right; }
td.muted { color: var(--muted); }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }

/* ---------- Small elements ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.info { background: var(--info-soft); color: #2b4d80; border-color: transparent; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: inline-grid; place-items: center; font-weight: 600; font-size: 14px; flex: none;
}
.money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Stat strip (home) ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.stat { padding: 16px 18px 14px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .v { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }

.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; align-items: start; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.section-title .more { font-size: 13px; }
.richieste-box { background: var(--warn-soft); border: 1px solid #f0d899; border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 16px; }
.richieste-box .section-title h3 { display: flex; gap: 8px; align-items: center; }

/* timeline of today's lessons */
.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
.tl-item { position: relative; padding: 4px 0 18px 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -7px; top: 10px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--muted)); border: 2px solid var(--bg);
}
.tl-item .when { font-weight: 600; }
.tl-item .what { color: var(--ink-2); }
.tl-item .who { color: var(--muted); font-size: 13px; }
.tl-item.done { opacity: .55; }
.tl-item.cancelled .what { text-decoration: line-through; }

/* Oggi: lezioni con i prenotati */
.oggi-strip .stat .l span { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.oggi-tl .tl-item { padding: 6px 10px 12px 22px; margin-left: -10px; }
.oggi-tl .tl-item.svolta { opacity: .6; }
.oggi-tl .tl-item.in-corso { background: var(--accent-soft); border-radius: var(--radius); }
.oggi-tl .tl-item.in-corso::before { box-shadow: 0 0 0 4px var(--accent-soft); }
.oggi-tl .tl-item.annullata .what { text-decoration: line-through; }
.tl-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-top .when { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tl-top .when:hover { color: var(--accent); }
.tl-top .what { color: var(--ink-2); flex: 1; min-width: 160px; }
.tl-top .tl-tag { flex: none; }
.tl-chi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tl-pren { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.tl-pren:hover { text-decoration: none; border-color: var(--line-strong); }
.tl-pren.assente { text-decoration: line-through; color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.tl-pren .tl-online { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; margin-left: 2px; }
.tl-nota { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-style: italic; }
.tl-now { position: relative; margin: 2px 0 10px 12px; border-top: 2px dashed var(--accent); }
.tl-now span { position: absolute; right: 0; top: -9px; background: var(--bg); color: var(--accent); font-size: 11px; font-weight: 600; padding: 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.tl-domani { display: block; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); font-size: 13.5px; }
.tl-domani:hover { text-decoration: none; background: var(--surface); }
.novita { display: flex; flex-direction: column; }
.novita-row { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.novita-row:last-child { border-bottom: 0; }
.novita-row .q { color: var(--muted); font-size: 12.5px; padding-top: 2px; white-space: nowrap; }
.novita-row .det { color: var(--ink-2); margin-top: 2px; }
.novita-row .pill { margin-right: 4px; }

/* alert list */
.alerts { display: flex; flex-direction: column; }
.alert-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .tag { flex: none; width: 118px; }
.alert-row .tag .pill { white-space: nowrap; }
.alert-row .who { font-weight: 500; }
.alert-row .det { color: var(--ink-2); font-size: 13.5px; }

/* ---------- Client detail ---------- */
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.detail-head .avatar { width: 52px; height: 52px; font-size: 18px; }
.detail-head .meta { color: var(--muted); font-size: 14px; }
/* Linguette (fase 33): una sola regola per gestionale, pannello e portale. Markup: <div class="tabs"><button class="tab on">…</button></div>
   oppure <button role="tab" class="active">; il numero accanto alla voce sta in <span class="n">. */
.tabs { display: flex; gap: 4px; align-items: flex-end; border-bottom: 1px solid var(--line-strong); margin: 20px 0 18px; overflow-x: auto; scrollbar-width: none; padding: 0 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs .tab {
  background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 9px 14px 10px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
  margin-bottom: 0; position: relative; top: 1px; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2;
}
.tabs button:hover, .tabs .tab:hover { background: var(--surface); color: var(--ink); }
.tabs button.active, .tabs .tab.on { background: var(--bg); color: var(--ink); font-weight: 650; border-color: var(--line-strong); border-bottom: 1px solid var(--bg); }
.tabs button .n, .tabs .tab .n { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--line); border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center; margin-left: 0; }
.tabs button.active .n, .tabs .tab.on .n { background: var(--accent-soft); color: var(--accent-ink); }
.tabs button:focus-visible, .tabs .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* linguette secondarie (dentro una scheda): più piccole, a pillola */
.tabs.sub { border-bottom: 0; gap: 6px; margin: 0 0 16px; padding: 0; }
.tabs.sub button, .tabs.sub .tab { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; top: 0; font-size: 13px; background: var(--bg); }
.tabs.sub button.active, .tabs.sub .tab.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--bg); }
.card .t { font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .d { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.card .foot { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card .foot .btn { white-space: nowrap; }
.card .kv dd { overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--accent); }

/* ---------- Drawer ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(28, 42, 34, .35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--bg); z-index: 41; display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px 22px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.drawer-foot .btn { white-space: nowrap; }
.drawer-foot .left { margin-right: auto; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 14px; animation: slide .18s; }
.toast.err { background: var(--danger); }
.toast.warn { background: #7a5a00; max-width: 460px; }

/* ---------- Telefono (≤ 860px): testata + barra in basso; su computer tutto invariato ---------- */
.m-top, .m-nav, .m-altro { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  /* il gestionale ha la barra in basso: la laterale sparisce. Il pannello superadmin (senza barra) tiene il menu
     in alto, compatto, come prima */
  .shell:has(.m-nav) .sidebar { display: none; }
  .shell:not(:has(.m-nav)) .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 2px; }
  .shell:not(:has(.m-nav)) .brand { padding: 4px 10px; width: 100%; }
  .shell:not(:has(.m-nav)) .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .shell:not(:has(.m-nav)) .nav a { padding: 6px 10px; }
  .shell:not(:has(.m-nav)) .sidebar .spacer, .shell:not(:has(.m-nav)) .sidebar .user { display: none; }
  .shell:not(:has(.m-nav)) .main { padding-bottom: 40px; }
  .m-top {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .assistenza-bar + .shell .m-top { top: 33px; }
  .m-top img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; flex: none; }
  .m-logo-vuoto { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
  .m-nome { flex: 1; min-width: 0; }
  .m-nome .name { font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-nome .role { color: var(--muted); font-size: 12px; }
  .m-top .campanella-box { margin-left: auto; position: relative; }
  .m-top .notifiche-pop { left: auto; right: 0; }
  .main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .m-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .m-nav a, .m-nav .m-altro-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 2px; border-radius: var(--radius); color: var(--muted); font-size: 11px; font-weight: 500;
    background: none; border: 0; font-family: inherit; position: relative; min-height: 48px; text-decoration: none;
  }
  .m-nav svg { width: 22px; height: 22px; }
  .m-nav a.active, .m-nav .m-altro-btn.active, .m-nav .m-altro-btn.in-altro { color: var(--accent-ink); }
  .m-nav a.active svg, .m-nav .in-altro svg, .m-nav .active svg { stroke-width: 2.2; }
  .m-nav .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 10px; }
  .m-nav .soon { display: none; }
  /* foglio «Altro» */
  .m-altro { display: block; position: fixed; inset: 0; z-index: 30; }
  .m-altro[hidden] { display: none; }
  .m-altro-bg { position: absolute; inset: 0; background: rgba(28, 42, 34, .35); }
  .m-altro-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg);
    border-radius: 16px 16px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    max-height: 80vh; overflow: auto; animation: su .18s ease-out;
  }
  @keyframes su { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .m-altro-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 12px; }
  .m-altro-nav a { padding: 12px 12px; font-size: 16px; }
  .m-altro-nav .soon { display: inline; }
  .m-altro-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 12px 0; border-top: 1px solid var(--line); margin-top: 8px; }
  #cambio-centro-m { flex-basis: 100%; }
  body.no-scroll { overflow: hidden; }

  /* contenuti: niente che allarghi la pagina oltre lo schermo */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .main img, .main svg { max-width: 100%; }
  .input.search { width: 100%; max-width: none; }
  .stat-filtri select { min-width: 0; max-width: 100%; }
  .stat-filtri .custom { flex-wrap: wrap; }
  .detail-head > div { min-width: 0; flex: 1 1 200px; }
  .detail-head .meta { overflow-wrap: anywhere; }
  .page-head p.small { overflow-wrap: anywhere; }
  .two-col, .row, .row-3 { grid-template-columns: 1fr; }
  .row-ind { grid-template-columns: 1fr 2fr 1fr; gap: 8px; }
  .page-head { margin-bottom: 16px; }
  .page-head > div:first-child { flex-basis: 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
  h1 { font-size: 22px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .input, select.input, textarea.input { min-height: 42px; font-size: 16px; }   /* 16px: niente zoom automatico su iPhone */
  .stat-strip { grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px 10px; }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat .v { font-size: 24px; }
  .detail-head { flex-wrap: wrap; }
  .detail-head .avatar { width: 44px; height: 44px; font-size: 16px; }
  .detail-head h1 { font-size: 20px; }
  .tabs { -webkit-overflow-scrolling: touch; }

  /* tabelle → schede: ogni riga diventa una card, ogni cella una riga «etichetta · valore» */
  .table-wrap { border: 0; overflow: visible; background: none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); padding: 10px 14px; margin-bottom: 10px; }
  .table-wrap tr.clickable:hover { background: var(--surface); }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: left; }
  .table-wrap td.num { text-align: right; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; flex: none; }
  .table-wrap td:first-child { font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td[data-label=""]::before { display: none; }
  .table-wrap td[data-label=""]:not(:first-child) { justify-content: flex-end; }
  .table-wrap td[colspan] { display: block; }
  .table-wrap td[colspan]::before { display: none; }
  .table-wrap tr:has(td[colspan]) { border: 0; padding: 0; background: none; }

  /* pannelli a tutto schermo */
  .drawer { width: 100%; border-left: 0; }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 16px; }
  .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .drawer-foot .btn { flex: 1 1 auto; justify-content: center; }
  .drawer-foot .left { flex-basis: 100%; margin-right: 0; }
  .accesso-row .actions, .accesso-row .chips { width: 100%; }
  .alert-row .tag { width: auto; }
  .alert-row { flex-direction: column; gap: 4px; }
  .novita-row { grid-template-columns: 1fr; gap: 2px; }
  .logo-box { width: 110px; height: 110px; }
  .two-col[style] { grid-template-columns: 1fr !important; }   /* Impostazioni: colonna del logo sotto */
  .main .tessere { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .main .tessera { padding: 10px 12px; }
  .main .tessera .v { font-size: 22px; }
  .section-title { flex-wrap: wrap; gap: 8px; }
  .prog .section-title .chips { width: 100%; }
  .page-head .actions .btn:not(.primary) { flex: 1 1 40%; }
  /* settimana come elenco */
  .week-list { display: flex; flex-direction: column; gap: 14px; }
  .week-day-h { display: flex; align-items: baseline; gap: 6px; width: 100%; border: 0; background: none; font: inherit; color: var(--ink); padding: 0 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; text-align: left; }
  .week-day-h .dn { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
  .week-day-h .dd { font-weight: 700; font-size: 18px; }
  .week-day-h .small { margin-left: auto; }
  .week-day.oggi .dd { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 8px; }
  .week-day .day-row { margin-bottom: 6px; }
}

/* ---------- Calendario ---------- */
.seg { display: inline-flex; gap: 0; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.cal-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.cal-head, .cal-body { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-day { padding: 8px 6px; text-align: center; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); }
.cal-day .dd { font-size: 16px; font-weight: 600; color: var(--ink); margin-left: 2px; }
.cal-day.oggi .dd { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.cal-body { max-height: 70vh; overflow-y: auto; }
.cal-gutter { position: relative; }
.cal-hour { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; border-top: 1px solid var(--line); box-sizing: border-box; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.oggi { background: #fafcf9; }
.cal-cell { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); cursor: pointer; }
.cal-cell:hover { background: var(--accent-soft); }
.cal-ev { position: absolute; padding: 1px 2px; box-sizing: border-box; }
.chip {
  height: 100%; box-sizing: border-box; overflow: hidden; cursor: pointer;
  border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, white);
  border-radius: 4px; padding: 3px 6px; font-size: 12px; line-height: 1.25;
}
.chip:hover { background: color-mix(in srgb, var(--c) 22%, white); }
.chip-t { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-s { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.pieno .chip-chi { color: var(--accent-ink); font-weight: 600; }
.chip.passato { opacity: .55; }
.chip.annullato { background: var(--surface); border-left-style: dashed; border-left-color: var(--muted); }
.chip.annullato .chip-t { text-decoration: line-through; color: var(--muted); }
.day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.day-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.day-tab .dn { font-size: 11px; color: var(--muted); }
.day-tab .dd { font-weight: 600; font-size: 16px; }
.day-tab .dc { font-size: 10px; color: var(--accent-ink); min-height: 12px; }
.day-tab.active { border-color: var(--ink); }
.day-tab.oggi .dd { color: var(--accent-ink); }
.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row .chip { height: auto; padding: 10px 12px; font-size: 14px; }
.day-row .chip-t, .day-row .chip-s { white-space: normal; }
.pren-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pren-row .grow { flex: 1; min-width: 180px; }
.pren-actions { display: flex; gap: 4px; }
.inline-form { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border-radius: var(--radius); }
.sugg { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; }
.sugg-item { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-top: 0; background: var(--bg); cursor: pointer; }
.sugg-item:first-child { border-top: 1px solid var(--line); }
.sugg-item:hover { background: var(--surface); }
.tl-item { display: block; color: inherit; }
.tl-item:hover { text-decoration: none; background: var(--surface); border-radius: var(--radius); }
@media (max-width: 860px) {
  .cal-head, .cal-body { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); }
  .chip { font-size: 10px; padding: 2px 3px; }
  .cal-body { max-height: none; }
}

/* ---------- Accesso online (scheda cliente) ---------- */
.accesso-box { margin-top: 14px; }
.account-row { margin-top: 10px; background: var(--bg); }
.accesso-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

/* ---------- Impostazioni ---------- */
.logo-box { width: 140px; height: 140px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--surface); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Assistenza superadmin ---------- */
.assistenza-bar { background: var(--ink); color: #fff; padding: 8px 16px; font-size: 13px; text-align: center; position: sticky; top: 0; z-index: 30; }
.assistenza-bar + .shell .sidebar { top: 33px; height: calc(100vh - 33px); }

/* ---------- Editor email ---------- */
.editor-email { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.editor-email textarea { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.editor-email .pill { cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.editor-email .pill:hover { background: var(--surface-2); }
.anteprima-box { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #f2f4f1; }
.anteprima-oggetto { padding: 10px 14px; font-weight: 600; font-size: 14px; background: #fff; border-bottom: 1px solid var(--line); min-height: 20px; }
.anteprima-box iframe { width: 100%; height: 520px; border: 0; display: block; background: #f2f4f1; }
.modelli-lista .accesso-row { margin-bottom: 8px; }
@media (max-width: 900px) { .editor-email { grid-template-columns: 1fr; } .anteprima-box iframe { height: 380px; } }

/* ---------- Brand del centro sulle pagine pubbliche ---------- */
.brand-pub { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand-pub img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 3px; }
.brand-pub-iniziali { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 18px; }
.brand-pub-nome { font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-pub-pie { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* ---------- Primi passi ---------- */
.progresso { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; color: var(--ink-2); font-size: 14px; }
.progresso .barra { flex: 1; max-width: 420px; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progresso .barra i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.tappe { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.pp-sezione { margin: 26px 0 0; max-width: 860px; }
.pp-sezione h2 { margin: 0 0 2px; font-size: 18px; }
.pp-intro { margin: 0 0 10px; }
.pp-scoperte { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pp-scoperta { text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.pp-scoperta:hover { border-color: var(--accent); }
.pp-scoperta span { color: var(--ink-2); font-size: 13px; }
.tappa .dettaglio { overflow-wrap: anywhere; }
.tappa { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); }
.tappa .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.tappa.fatta .num { background: var(--accent); color: #fff; }
.tappa.fatta { background: var(--surface); }
.tappa .titolo { font-weight: 600; font-size: 16px; }
.tappa .dettaglio { color: var(--accent-ink); font-size: 13px; margin-top: 2px; }
.tappa.fatta .dettaglio { color: var(--ink-2); }
.tappa .spiega { color: var(--ink-2); font-size: 14px; margin-top: 8px; line-height: 1.5; }
.tappa .az { align-self: center; }
@media (max-width: 720px) { .tappa { grid-template-columns: 32px 1fr; } .tappa .az { grid-column: 2; } }

/* ---------- Statistiche & grafici ---------- */
.stat-filtri { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-filtri select { width: auto; min-width: 180px; }
.stat-filtri .custom { display: flex; align-items: center; gap: 8px; }
.stat-filtri .custom input { width: 150px; }
/* .tabs / .tab: vedi «Linguette» più sopra */
.tessere { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tessera { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--bg); }
.tessera .v { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.tessera .l { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tessera .delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tessera .delta.su { background: var(--accent-soft); color: var(--accent-ink); }
.tessera .delta.giu { background: var(--danger-soft); color: var(--danger); }
.due-grafici { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
@media (max-width: 1000px) { .due-grafici { grid-template-columns: 1fr; } }
.gr { position: relative; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px 10px; background: var(--bg); }
.gr figcaption, .gr-titolo { font-weight: 600; font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.gr-svg { width: 100%; height: 220px; display: block; overflow: visible; }
.gr-griglia { stroke: var(--line); stroke-width: 1; }
.gr-base { stroke: var(--line-strong); stroke-width: 1; }
.gr-asse { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.gr-legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.gr-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.gr-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.gr-vuoto { color: var(--muted); font-size: 14px; padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.gr-classifica { display: flex; flex-direction: column; gap: 8px; }
.gr-classifica .riga { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.gr-classifica .et { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-classifica .barra { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.gr-classifica .barra i { display: block; height: 100%; border-radius: 999px; }
.gr-classifica .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-mappa { position: relative; display: grid; gap: 3px; font-size: 12px; }
.gr-mappa .int { color: var(--muted); text-align: center; align-self: center; }
.gr-mappa .cella { aspect-ratio: 1.6; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--surface)); display: grid; place-items: center; color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }

/* ---------- Campanella e notifiche ---------- */
.campanella-box { position: relative; display: inline-flex; }
.campanella { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.campanella:hover { background: var(--surface-2); color: var(--ink); }
.campanella.ha-nuove { color: var(--accent-ink); border-color: var(--accent); }
.campanella-n[hidden] { display: none; }
.campanella-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.notifiche-pop { position: absolute; top: 48px; left: 0; width: min(380px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(28, 42, 34, .18); z-index: 30; overflow: hidden; }
.notifiche-pop.destra, .p-top .notifiche-pop { left: auto; right: 0; }
.np-head, .np-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 14px; }
.np-head { border-bottom: 1px solid var(--line); }
.np-foot { border-top: 1px solid var(--line); }
.np-list { max-height: min(420px, 60vh); overflow: auto; }
.np-item { display: grid; grid-template-columns: 14px 1fr; gap: 8px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; cursor: pointer; }
.np-item:last-child { border-bottom: 0; }
.np-item:hover { background: var(--surface); }
.np-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.np-item.nuova .np-dot { background: var(--accent); }
.np-item.nuova .np-titolo { font-weight: 600; }
.np-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-titolo { font-size: 14px; line-height: 1.35; }
.np-testo { font-size: 13px; color: var(--ink-2); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.np-quando { font-size: 12px; color: var(--muted); }
.brand .campanella-box { margin-left: auto; }
.brand .notifiche-pop { left: 0; }
@media (max-width: 860px) { .brand .notifiche-pop { left: auto; right: 0; } }

/* preferenze email */
.pref-lista { display: flex; flex-direction: column; }
.pref-riga { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pref-riga:last-child { border-bottom: 0; }
.pref-riga.presto { opacity: .7; }
.pref-nome { display: block; font-weight: 500; }
.pref-descr { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.interruttore { position: relative; flex: none; width: 42px; height: 24px; }
.interruttore input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interruttore i { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); transition: background .15s; }
.interruttore i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.interruttore input:checked + i { background: var(--accent); border-color: var(--accent); }
.interruttore input:checked + i::after { transform: translateX(18px); }

/* ---------- Messaggi ---------- */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); min-height: min(640px, calc(100vh - 140px)); overflow: hidden; }
.msg-lista { border-right: 1px solid var(--line); overflow: auto; }
.msg-lista-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px; }
.msg-lista-head h1 { font-size: 18px; margin: 0; }
.msg-conv { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); color: inherit; }
.msg-conv:hover { background: var(--surface); text-decoration: none; }
.msg-conv.attiva { background: var(--accent-soft); }
.msg-conv .avatar { width: 36px; height: 36px; font-size: 13px; }
.msg-conv-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.msg-conv-top { display: flex; justify-content: space-between; gap: 8px; }
.msg-conv-nome { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-conv.nuovi .msg-conv-nome, .msg-conv.nuovi .msg-conv-testo { font-weight: 600; color: var(--ink); }
.msg-conv-quando { font-size: 12px; color: var(--muted); flex: none; }
.msg-conv-centro { font-size: 12px; color: var(--accent-ink); }
.msg-conv-testo { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.msg-chat { display: flex; flex-direction: column; min-height: 0; }
.msg-vuoto { flex: 1; display: grid; place-items: center; padding: 40px; text-align: center; }
.msg-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.msg-chat-head .avatar { width: 36px; height: 36px; font-size: 13px; }
.msg-chat-nome { font-weight: 600; }
.msg-indietro { display: none; font-size: 26px; line-height: 1; padding: 0 6px; color: var(--ink-2); }
.msg-flusso { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.msg-giorno { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.msg { max-width: min(78%, 560px); display: flex; flex-direction: column; }
.msg.mio { align-self: flex-end; align-items: flex-end; }
.msg.altro { align-self: flex-start; align-items: flex-start; }
.msg-bolla { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: 15px; background: var(--bg); border: 1px solid var(--line); }
.msg.mio .msg-bolla { background: var(--accent); color: #fff; border-color: var(--accent); border-bottom-right-radius: 4px; }
.msg.altro .msg-bolla { border-bottom-left-radius: 4px; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 3px 6px 0; }
.msg-scrivi { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.msg-scrivi textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 20px; font: inherit; font-size: 15px; background: var(--surface); }
.msg-scrivi textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.msg-bloccato { padding: 12px 16px; border-top: 1px solid var(--line); text-align: center; }
.msg-contatti { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.msg-contatto { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font: inherit; color: inherit; cursor: pointer; }
.msg-contatto:hover { background: var(--surface); }
.msg-contatto .avatar { width: 32px; height: 32px; font-size: 12px; }
.msg-contatto > span:last-child { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .msg-layout { grid-template-columns: 1fr; min-height: calc(100vh - 150px); border: 0; border-radius: 0; }
  .msg-lista { border-right: 0; }
  .msg-layout.con-chat .msg-lista { display: none; }
  .msg-layout:not(.con-chat) .msg-chat { display: none; }
  .msg-indietro { display: inline-block; }
  .msg-chat { height: calc(100vh - 150px); }
}
.msg-sezioni { display: flex; gap: 4px; padding: 0 10px 8px; }
.msg-sezioni button { flex: 1; padding: 7px 8px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.msg-sezioni button.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.msg-nota { padding: 4px 14px 10px; }


/* ---------- Ricevute (fase 15): foglio A4 e stampa ---------- */
.ric-barra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.ric-foglio { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 40px; max-width: 760px; margin: 0 auto 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.ricevuta { position: relative; color: #1c2a22; font-size: 14px; line-height: 1.45; }
.ricevuta.annullata::after { content: "ANNULLATA"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 800; color: rgba(179,56,47,.14); transform: rotate(-24deg); pointer-events: none; letter-spacing: .1em; }
.ric-annullata { background: var(--danger-soft); color: var(--danger); padding: 6px 10px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.ric-testa { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #1c2a22; padding-bottom: 16px; margin-bottom: 20px; }
.ric-ente { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.ric-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; }
.ric-nome { font-weight: 700; font-size: 17px; }
.ric-riga { color: #4a5851; font-size: 13px; }
.ric-numero { text-align: right; flex: none; }
.ric-titolo { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: #7c8a82; }
.ric-n { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.ric-dest { margin-bottom: 22px; }
.ric-etichetta { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #7c8a82; margin-bottom: 2px; }
.ric-tab { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.ric-tab th, .ric-tab td { padding: 10px 8px; border-bottom: 1px solid #dfe4de; vertical-align: top; text-align: left; }
.ric-tab th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7c8a82; font-weight: 600; }
.ric-tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ric-tab tfoot td { border-bottom: 0; border-top: 2px solid #1c2a22; font-size: 15px; }
.ric-descr { color: #4a5851; }
.kv-tab th { width: 150px; color: #7c8a82; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13px; }
.kv-tab td { overflow-wrap: anywhere; }
.ric-bollo { margin: 14px 0 0 auto; width: 150px; height: 84px; border: 1px dashed #c5ccc3; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: #7c8a82; padding: 6px; }
.ric-piede { margin-top: 30px; font-size: 12.5px; color: #4a5851; }
.ric-firma { margin: 36px 0 0 auto; width: 240px; border-top: 1px solid #1c2a22; padding-top: 4px; text-align: center; font-size: 12px; color: #7c8a82; }
.ric-fine { margin-top: 22px; font-size: 11px; }
@media (max-width: 860px) { .ric-foglio { padding: 20px 16px; } .ric-testa { flex-direction: column; } .ric-numero { text-align: left; } }
/* ---------- Tessera associativa (fase 16a): formato tessera dentro il foglio ---------- */
.ric-foglio.tessera { max-width: 640px; padding: 0; overflow: hidden; }
.tess { display: flex; min-height: 300px; color: #1c2a22; font-size: 14px; line-height: 1.45; position: relative; }
.tess-banda { flex: 0 0 210px; background: var(--accent); color: #fff; padding: 26px 20px; display: flex; flex-direction: column; gap: 4px; }
.tess-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; margin-bottom: 10px; }
.tess-logo.iniziali { display: grid; place-items: center; font-weight: 800; font-size: 26px; color: var(--accent); }
.tess-ente { font-weight: 700; font-size: 16px; line-height: 1.25; }
.tess-banda .tess-riga { color: rgba(255,255,255,.82); font-size: 12px; word-break: break-word; }
.tess-corpo { flex: 1; padding: 26px 28px; min-width: 0; }
.tess-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tess-n { font-size: 28px; font-weight: 800; letter-spacing: .02em; }
.tess-socio { font-size: 22px; font-weight: 700; }
.tess-corpo .tess-riga { color: #4a5851; font-size: 13px; }
.tess-dati { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 16px 0 0; font-size: 14px; }
.tess-dati dt { color: #7c8a82; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.tess-dati dd { margin: 0; }
.tess-piede { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 28px; }
.tess-firma { width: 170px; border-top: 1px solid #1c2a22; padding-top: 4px; text-align: center; font-size: 12px; color: #7c8a82; }
.tess.annullata::after { content: "ANNULLATA"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 800; color: rgba(179,56,47,.16); transform: rotate(-20deg); pointer-events: none; letter-spacing: .1em; }
@media (max-width: 860px) { .tess { flex-direction: column; } .tess-banda { flex: none; padding: 18px 16px; } .tess-corpo { padding: 18px 16px; } }

/* ---------- Documenti firmati (fase 17) ---------- */
.firma-testo { white-space: pre-wrap; line-height: 1.55; font-size: 14px; margin: 6px 0 22px; }
.firma-box { border: 1px solid #dfe4de; border-radius: 10px; padding: 14px 16px; margin-top: 10px; background: #fafbf9; }
.firma-box.ok { border-color: #9fc9ad; background: #f1f8f3; }
.firma-box.no { border-color: #e4b4af; background: #fbf1f0; }
.firma-box.attesa { border-style: dashed; }
.firma-nome { font-weight: 700; font-size: 18px; margin: 2px 0 4px; }
.firma-hash { font-size: 11px; word-break: break-all; }
.firma-azioni { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; margin: 0 auto 24px; max-width: 760px; background: var(--bg); }
.firma-azioni .codice { font-size: 24px; letter-spacing: .3em; text-align: center; max-width: 220px; }
.firma-azioni .passo { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.firma-azioni .passo .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.firma-azioni .passo.fatto .n { background: var(--accent); color: #fff; }
.mod-testo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 320px; }
.segnaposto { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 12px; }
.segnaposto code { cursor: pointer; }

/* ---------- Cartello QR iscrizioni (fase 16b) ---------- */
.ric-foglio.cartello { max-width: 640px; }
.cart { text-align: center; color: #1c2a22; padding: 10px 0; }
.cart-logo { width: 110px; height: 110px; object-fit: contain; border-radius: 14px; margin-bottom: 8px; }
.cart-nome { font-weight: 700; font-size: 20px; color: #4a5851; }
.cart h1 { font-size: 34px; margin: 12px 0 8px; letter-spacing: -.01em; }
.cart p { font-size: 17px; color: #4a5851; max-width: 460px; margin: 0 auto 22px; line-height: 1.4; }
.cart-qr svg { width: 320px; height: 320px; max-width: 100%; border: 1px solid #dfe4de; border-radius: 12px; padding: 10px; background: #fff; }
.cart-link { margin-top: 14px; font-size: 14px; color: #4a5851; word-break: break-all; }
.cart-pie { margin-top: 26px; padding-top: 12px; border-top: 1px solid #dfe4de; font-size: 13px; color: #7c8a82; }

/* ---------- Piani e moduli (fase 18) ---------- */
.nav a.spento { opacity: .55; }
.nav a.spento .soon { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.modulo-box { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--surface); display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.mod-matrice th, .mod-matrice td { vertical-align: middle; }
.mod-matrice input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.mod-lista { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.mod-riga { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.mod-riga.incluso { background: var(--accent-soft); }
.mod-riga .input.sm { width: 150px; padding: 4px 8px; font-size: 13px; }
.mod-riga.non-disp { opacity: .55; }
.mod-matrice td.cella { text-align: center; min-width: 120px; }
.mod-matrice td.cella .input.sm { width: 100%; padding: 4px 6px; font-size: 13px; }
.mod-matrice td.cella .cella-prezzo { margin-top: 4px; }
.canone-box { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; background: var(--accent-soft); margin: 4px 0 8px; }
.canone-cifre { display: flex; gap: 18px; flex-wrap: wrap; font-size: 17px; margin: 4px 0; }
.canone-cifre .forte { font-weight: 700; }
.canone-cifre small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.error-text { color: var(--danger); font-size: 13px; }
.abb-config { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px 16px 16px; margin-top: 12px; background: var(--bg); }
.piano-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.piano-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; cursor: pointer; display: block; position: relative; background: var(--surface); }
.piano-card input { position: absolute; top: 12px; right: 12px; accent-color: var(--accent); }
.piano-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.piano-card.bloccato { opacity: .55; cursor: not-allowed; }
.piano-card .piano-nome { font-weight: 700; margin-bottom: 2px; }
.piano-card .piano-prezzo { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.piano-card .piano-prezzo small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 640px) { .piano-cards { grid-template-columns: 1fr; } }
.abb-pagina { display: grid; gap: 14px; max-width: 860px; }
.abb-pagina .card { background: var(--bg); }
.abb-stato.allarme { border-color: var(--danger); }
.abb-stato-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.avviso-agg { background: #fff6e0; border: 1px solid #f0d899; color: #5a4300; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin: 0 0 12px; line-height: 1.5; }
.cambio-quando { margin-top: 8px; padding: 8px 10px; background: #f3f7ff; border: 1px solid #cfdcf5; border-radius: var(--radius); color: #1f3a66; }
.passi-accesso { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.passo-accesso.ok { color: var(--ok, #1f7a45); }
.passo-accesso.no { color: var(--warn, #9a6a00); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent, #1f7a45); text-decoration: underline; cursor: pointer; font: inherit; }
.abb-colonne { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .abb-colonne { grid-template-columns: 1fr; } }
.abb-lista { margin: 0; padding-left: 18px; font-size: 14px; }
.abb-lista li { margin: 3px 0; }
.abb-config { margin-top: 0; padding: 14px 16px 16px; }
.abb-passo { margin: 14px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.abb-accetta { display: grid; gap: 6px; }
.abb-accetta .check { margin: 0; align-items: flex-start; }
.abb-tab td, .abb-tab th { font-size: 13.5px; padding: 8px 10px; }
.doc-semplice { font-size: 14px; line-height: 1.55; }
.doc-semplice .ds-titolo { font-size: 16px; margin: 0 0 10px; }
.doc-semplice h3 { font-size: 14px; margin: 14px 0 4px; }
.doc-semplice p { margin: 0 0 8px; }
.doc-semplice ul { margin: 0 0 8px; padding-left: 20px; }
.login-card.larga { max-width: 720px; }
.doc-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-editor .mod-testo { min-height: 520px; }
.doc-anteprima { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-height: 560px; overflow: auto; background: var(--surface); }
@media (max-width: 900px) { .doc-editor { grid-template-columns: 1fr; } }
.acc-lista { display: grid; gap: 8px; max-height: 50vh; overflow: auto; padding-right: 4px; }
.acc-doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.acc-doc summary { cursor: pointer; list-style: none; }
.acc-doc summary::-webkit-details-marker { display: none; }
.acc-doc .acc-leggi { float: right; }
.acc-doc[open] .acc-leggi { display: none; }
.acc-doc[open] summary { margin-bottom: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.acc-doc .doc-semplice { max-height: 40vh; overflow: auto; }

/* ---------- Documenti (fase 16a) ---------- */
.doc-tipo { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.doc-tipo svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.doc-griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.doc-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.doc-card .v { font-size: 24px; font-weight: 700; }
.doc-card .l { color: var(--muted); font-size: 13px; }
.doc-card .foot { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.doc-card.presto { border-style: dashed; color: var(--muted); }

/* ---------- Pannello di controllo (fase 21): scheda del centro, elenco con filtri ---------- */
.due-col-pannello { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.filtri-centri { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-bottom: 14px; }
.filtri-centri .input { margin: 0; }
.avanzamento { width: 160px; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; flex: none; }
.avanzamento > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }
.avanzamento.sm { width: 90px; height: 6px; margin-bottom: 3px; }
.avvio-lista { display: grid; gap: 4px; }
.avvio-voce { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.avvio-voce .segno { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--line); color: var(--muted); font-size: 12px; }
.avvio-voce.ok { border-color: transparent; background: var(--surface-2); color: var(--muted); }
.avvio-voce.ok .segno { background: var(--accent); border-color: var(--accent); color: #fff; }
.avvio-voce.ok strong { font-weight: 500; }
@media (max-width: 900px) {
  .due-col-pannello { grid-template-columns: 1fr; }
  .filtri-centri { grid-template-columns: 1fr; }
  .avvio-voce { grid-template-columns: 22px 1fr; }
  .avvio-voce > div:last-child { grid-column: 2; }
}

@media print {
  body * { visibility: hidden; }
  .ric-foglio, .ric-foglio * { visibility: visible; }
  .ric-foglio { position: static; border: 0; box-shadow: none; padding: 0; max-width: none; margin: 0; page-break-after: always; break-after: page; }
  .ric-foglio.tessera { border: 1px solid #1c2a22; border-radius: 12px; overflow: hidden; max-width: 640px; }
  .tess-banda { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print, .sidebar, .m-top, .m-nav, .page-head, .toolbar, .p-top, .p-nav { display: none !important; }
  .shell, .main, .p-shell, .p-main { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .ricevuta.annullata::after { color: rgba(179,56,47,.25); }
  @page { margin: 18mm; }
}

/* Fase 31a — import da Excel: mappa colonne → campi */
.imp-col { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.imp-c { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.imp-c .muted.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-c .esempio { color: var(--text); font-size: 13px; font-style: italic; }
.imp-c select { width: 100%; }

/* Fase 32 — ricevuta di pagamento (serie P): avviso «non valida ai fini fiscali» */
.ric-nonfiscale { border: 1.5px solid #b45309; color: #7c2d12; background: #fff7ed; padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; font-size: 12.5px; }

/* ---------- Fase 33: ordine nelle interfacce ---------- */
.pill-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; vertical-align: baseline; }
.pill-btn:hover .pill { filter: brightness(0.95); }
/* sezioni delle impostazioni: ogni gruppo di campi è una card con titolo, così la pagina si legge a blocchi */
.sez { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; background: var(--bg); }
.sez > h2:first-child, .sez > h3:first-child { margin: 0 0 12px; font-size: 16px; }
.sez .sez-sub { color: var(--ink-2); font-size: 13px; margin: -8px 0 12px; }
.imp-salva { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 4px; display: flex; gap: 8px; align-items: center; z-index: 2; }

/* ---------- fase 37: scheda del cane (righe di elenco condivise con il portale) ---------- */
.riga-lista { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.riga-lista:first-child { border-top: 0; }
.riga-lista .t { font-weight: 600; }
.riga-lista .d { color: var(--muted); font-size: 13px; }
.lista-righe { margin-bottom: 8px; }
.cane-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.cane-head .avatar-cane { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }

/* ---------- fase 38: asilo diurno ---------- */
.asilo-card.presente { border-color: var(--accent); }
.asilo-card.da_confermare { border-color: var(--warn); }
.asilo-card.annullata, .asilo-card.annullata_tardi, .asilo-card.rifiutata, .asilo-card.assente { opacity: .7; }
.asilo-cose { display: grid; gap: 4px; margin-top: 6px; }
.asilo-cose .check { margin: 0; align-items: flex-start; }
.asilo-cose .check.fatto span { text-decoration: line-through; color: var(--muted); }
.asilo-mese { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.asilo-intest { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-soft, #f6f7f5); border-bottom: 1px solid var(--line); }
.asilo-intest div { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.asilo-griglia { display: grid; grid-template-columns: repeat(7, 1fr); }
.asilo-cella { display: block; min-height: 78px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.asilo-cella:nth-child(7n) { border-right: 0; }
.asilo-cella.vuota { background: var(--bg-soft, #f6f7f5); }
.asilo-cella.chiusa { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.035) 6px 12px); color: var(--muted); }
.asilo-cella.passata { opacity: .65; }
.asilo-cella.oggi .n { color: var(--accent-ink); font-weight: 700; }
.asilo-cella.piena .asilo-barra span { background: var(--danger); }
.asilo-cella:hover:not(.vuota) { background: var(--accent-soft); }
.asilo-cella .n { font-weight: 600; margin-bottom: 4px; }
.asilo-barra { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 2px 0 4px; }
.asilo-barra span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 720px) { .asilo-cella { min-height: 60px; padding: 4px; font-size: 11px; } .asilo-intest div { padding: 4px; font-size: 10px; } }
.asilo-cella.mia { background: var(--accent-soft); }

/* ---- Barra della demo (fase 41) ---- */
:root { --demo-bar-h: 0px; }
body.con-demo-bar { --demo-bar-h: 44px; }
#demo-bar { position: sticky; top: 0; z-index: 70; height: var(--demo-bar-h); box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #1c2a22; color: #e8efe9; font-size: 13px; line-height: 1.2; overflow: hidden; white-space: nowrap; }
#demo-bar .demo-tag { background: #f2b544; color: #1c2a22; font-weight: 800; letter-spacing: .08em; font-size: 11px; padding: 3px 7px; border-radius: 6px; }
#demo-bar .demo-chi { display: flex; align-items: center; gap: 8px; }
#demo-bar select { background: #2a3b31; color: #fff; border: 1px solid #456; border-radius: 7px; padding: 5px 8px; font: inherit; max-width: 320px; }
#demo-bar .demo-cosa { color: #b9c9bf; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
#demo-bar .demo-azioni { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#demo-bar .demo-btn { background: transparent; color: #e8efe9; border: 1px solid #456; border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
#demo-bar .demo-btn:hover { background: #2a3b31; }
#demo-bar .demo-cta { background: #f2b544; color: #1c2a22; border-color: #f2b544; font-weight: 600; }
#demo-bar .demo-ico { display: none; }
@media (max-width: 760px) { #demo-bar .demo-ico { display: inline; } }
#demo-bar .demo-n { background: #f2b544; color: #1c2a22; border-radius: 10px; padding: 1px 6px; font-size: 11px; font-weight: 700; margin-left: 4px; }
body.con-demo-bar .sidebar { top: var(--demo-bar-h); height: calc(100vh - var(--demo-bar-h)); }
body.con-demo-bar .m-top, body.con-demo-bar .p-top, body.con-demo-bar .assistenza-bar { top: var(--demo-bar-h); }
body.con-demo-bar .giorno-h { top: calc(53px + var(--demo-bar-h)); }
@media (max-width: 760px) {
  body.con-demo-bar { --demo-bar-h: 40px; }
  #demo-bar { gap: 8px; padding: 0 8px; }
  #demo-bar .demo-cosa, #demo-bar .demo-cta, #demo-bar .demo-lbl { display: none; }
  #demo-bar .demo-chi { flex: 1; min-width: 0; }
  #demo-bar select { max-width: 100%; width: 100%; }
  #demo-bar .demo-btn { padding: 5px 8px; }
}
