/* vdfplanner: grafica «Divisa». I colori stanno tutti nelle variabili qui sotto. */

/* Blu notte della divisa, rosso VVF per le azioni. */
:root {
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", var(--font);
  --display-weight: 650; --display-track: -.005em;
  --bg: #EDF0F4; --surface: #FFFFFF; --sunken: #F5F7FA; --raised: #FFFFFF;
  --ink: #121A2B; --ink-2: #48546A; --ink-3: #78839A; --line: #E0E5EC; --line-2: #C9D1DC;
  --accent: #C8102E; --accent-hover: #A30C25; --accent-fg: #FFFFFF; --accent-soft: #FCE9EC; --accent-line: #C8102E;
  --mark: #C8102E; --mark-fg: #FFFFFF;
  --side-bg: #14213D; --side-line: #22325A; --side-ink: #B8C3D9; --side-ink-hi: #FFFFFF; --side-hover: rgba(255, 255, 255, .07);
  --side-on-bg: rgba(255, 255, 255, .11); --side-on-ink: #FFFFFF; --side-on-icon: #FF5A6E; --side-sub: #8B98B5;
  --brand-bg: #C8102E; --brand-fg: #FFFFFF;
  --hover: rgba(18, 26, 43, .055); --night-cell: #F2F4F9; --cell-hover: #121A2B;
  --day: #A86400; --day-soft: #FFF2D6; --night: #14213D; --night-soft: #E7EBF4; --night-dot-fg: #FFFFFF;
  --ok: #17663A; --ok-soft: #E0F2E7; --warn: #855700; --warn-soft: #FFF0C4; --no: #A3162B; --no-soft: #FBE4E7; --pending: #E39A00;
  --strong: #14213D; --strong-fg: #FFFFFF; --strong-sub: rgba(255, 255, 255, .7);
  --hero-day-bg: linear-gradient(135deg, #FFF3D6, #FFE4A8); --hero-day-fg: #3B2900;
  --hero-night-bg: linear-gradient(135deg, #1B2B50, #0E1830); --hero-night-fg: #FFFFFF;
  --auth-bg: linear-gradient(180deg, #14213D 0 38%, var(--bg) 38%);
  --backdrop: rgba(12, 18, 32, .5);
  --shadow: 0 1px 2px rgba(14, 24, 48, .06), 0 10px 28px rgba(14, 24, 48, .1);
  --card-shadow: 0 1px 2px rgba(14, 24, 48, .05);
  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  color-scheme: light;
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, .display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sunken); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { display: inline-flex; flex: none; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.loading { padding: 80px 24px; text-align: center; color: var(--ink-3); }

/* ---- cornice ---- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 0 6px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: var(--r-m); background: var(--brand-bg); color: var(--brand-fg); display: grid; place-items: center; flex: none; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; color: var(--side-ink-hi); }
.brand-text span { font-size: 12.5px; color: var(--side-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand.compact { display: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-m); text-decoration: none; color: var(--side-ink); font-weight: 550; }
.side nav a:hover { background: var(--side-hover); color: var(--side-ink-hi); }
.side nav a.on { background: var(--side-on-bg); color: var(--side-on-ink); font-weight: 650; }
.side nav a.on .ico { color: var(--side-on-icon); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--side-line); font-size: 12.5px; color: var(--side-sub); line-height: 1.4; }
.badge { background: var(--accent); color: var(--accent-fg); font-size: 11.5px; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: inline-grid; place-items: center; margin-left: auto; }
.side .badge { background: #E5303F; color: #fff; }
main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 12px 28px 0; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--strong); color: var(--strong-fg); padding: 9px 28px; font-size: 14px; }
.banner .btn { margin-left: auto; background: transparent; border-color: currentColor; color: inherit; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 4px 8px 4px 4px; border-radius: 999px; }
.user-btn:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--strong); color: var(--strong-fg); display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.user-name { font-weight: 550; font-size: 14px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -2px; right: -3px; margin: 0; }
.view { flex: 1; min-width: 0; }
.page { padding: 8px 28px 56px; display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 760px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.1; }
.page-sub { color: var(--ink-3); margin-top: -10px; font-size: 14px; }
.section-title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; color: var(--ink); margin-bottom: 10px; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav h1 { font-size: 30px; line-height: 1.1; min-width: 220px; text-align: center; }
.month-nav h1 span { color: var(--ink-3); font-weight: 500; }
.foot-note { font-size: 13px; }

/* ---- controlli ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--no); border-color: var(--no); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover, .btn.ghost.active { background: var(--hover); color: var(--ink); }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--no); }
.btn.danger-ghost:hover { background: var(--no-soft); }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; border-radius: calc(var(--r-m) - 2px); }
.btn.big { height: 46px; font-size: 15.5px; width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: var(--r-m); color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.draft { background: var(--warn-soft); color: var(--warn); }
.pill.no { background: var(--no-soft); color: var(--no); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.tools { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); }
input[type=text], input[type=password], input[type=number], select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: transparent; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chips button { height: 30px; padding: 0 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.check-chips button.on { background: var(--strong); border-color: var(--strong); color: var(--strong-fg); }
.form-error { color: var(--no); background: var(--no-soft); padding: 9px 12px; border-radius: var(--r-m); font-size: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface); border: 1px solid var(--line); padding: 3px; border-radius: calc(var(--r-m) + 3px); align-self: flex-start; }
.seg button { border: 0; background: none; height: 32px; padding: 0 11px; border-radius: var(--r-m); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seg button:hover { background: var(--hover); }
.seg button.on { background: var(--strong); color: var(--strong-fg); }
.year-select { width: auto; font-weight: 650; }

/* ---- sigle ---- */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 27px; padding: 0 6px; border-radius: var(--r-s); font-size: 12.5px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.small { min-width: 30px; height: 22px; font-size: 11.5px; border-radius: calc(var(--r-s) - 1px); }
.chip.stripes { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .07) 5px 10px); }
.chip.auto { opacity: .72; }
.chip.empty { background: none; color: var(--line-2); font-weight: 400; }
.shift { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.shift.day { background: var(--day-soft); color: var(--day); }
.shift.night { background: var(--night-soft); color: var(--night); }
.qual { display: inline-grid; place-items: center; min-width: 34px; height: 21px; padding: 0 5px; border-radius: calc(var(--r-s) - 1px); background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; font-weight: 700; letter-spacing: .02em; flex: none; }
.psalto { font-size: 11.5px; font-weight: 650; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: calc(var(--r-s) - 1px); padding: 0 5px; height: 21px; display: inline-grid; place-items: center; flex: none; }

/* ---- griglia ---- */
.grid-layout { display: flex; flex-direction: column; gap: 12px; }
.grid-wrap { overflow: auto; max-height: calc(100vh - 150px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--card-shadow); }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { border-bottom: 1px solid var(--line); }
.grid thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.grid th.day { padding: 8px 2px 7px; min-width: 46px; font-weight: 500; }
.grid th.day > * { display: block; text-align: center; line-height: 1.15; }
.grid th.day .wd { font-size: 11.5px; color: var(--ink-3); }
.grid th.day strong { font-family: var(--font-display); font-size: 19px; font-weight: var(--display-weight); margin: 1px auto 3px; width: 30px; height: 26px; line-height: 26px; border-radius: var(--r-s); }
.grid th.day .gn { display: grid; place-items: center; width: 22px; height: 22px; margin: 0 auto 3px; border-radius: 50%; }
.grid th.is-day .gn { background: var(--day-soft); color: var(--day); }
.grid th.is-night .gn { background: var(--night); color: var(--night-dot-fg); }
.grid th.day .salto { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.grid th.day.today strong { background: var(--mark); color: var(--mark-fg); }
.grid .is-night, .grid thead th.is-night { background-color: var(--night-cell); }
.grid .pair-start { border-left: 1px solid var(--line-2); }
.grid th.person-h, .grid th.note-h, .grid th.stat-h { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-align: left; padding: 0 12px 9px; vertical-align: bottom; }
.grid th.stat-h { text-align: center; padding: 0 5px 9px; }
.grid th.person-h, .grid th.person, .grid tfoot th { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line-2); }
.grid thead th.person-h { z-index: 4; }
.grid th.person { padding: 0; font-weight: 500; text-align: left; }
.person-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 232px; height: 40px; padding: 0 12px; border: 0; background: none; text-align: left; }
button.person-btn:hover { background: var(--sunken); }
.pname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; font-size: 14px; }
.person-btn.add { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.person-btn.add:hover { color: var(--ink); }
.grid td.cell { text-align: center; padding: 0 2px; height: 40px; position: relative; user-select: none; -webkit-user-select: none; }
.grid.editable td.cell { cursor: pointer; }
.grid.editable td.cell:hover { box-shadow: inset 0 0 0 2px var(--cell-hover); border-radius: calc(var(--r-s) + 3px); }
.painting .grid.editable td.cell { cursor: cell; }
.pending-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--pending); box-shadow: 0 0 0 2px var(--surface); }
.grid td.note { font-size: 13px; color: var(--ink-2); padding: 0 12px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line-2); }
.grid td.stat { text-align: center; font-size: 13px; font-weight: 600; padding: 0 6px; }
.grid td.stat.zero { color: var(--line-2); }
.grid tr.me th.person, .grid tr.me td { background-color: var(--accent-soft); }
.grid tr.me th.person { box-shadow: inset 4px 0 0 var(--accent-line); }
.grid tr.me .pname { font-weight: 700; }
.grid tr.add-row td, .grid tr.add-row th { border-bottom: 1px solid var(--line-2); }
.grid tfoot th { text-align: left; font-weight: 550; font-size: 13px; color: var(--ink-2); padding: 0 12px; height: 30px; white-space: nowrap; background: var(--sunken); }
.grid tfoot td { text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--sunken); }
.grid tfoot tr.foot-presenti th, .grid tfoot tr.foot-presenti td { color: var(--ink); font-weight: 750; font-size: 14px; }
.grid tfoot td.warn { background: var(--warn-soft); color: var(--warn); }
.grid tfoot tr:last-child th, .grid tfoot tr:last-child td { border-bottom: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }

.palette { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; box-shadow: var(--card-shadow); }
.palette section { display: flex; align-items: center; gap: 8px; }
.palette h3 { font-size: 12px; color: var(--ink-3); font-weight: 600; white-space: nowrap; font-family: var(--font); }
.brushes { display: flex; flex-wrap: wrap; gap: 3px; }
.brush { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border: 0; background: none; border-radius: calc(var(--r-s) + 3px); font-size: 13px; color: var(--ink-2); }
.brush:hover { background: var(--hover); }
.brush.on { background: var(--strong); box-shadow: 0 0 0 2px var(--strong); }
.brush.eraser { border: 1px dashed var(--line-2); height: 33px; padding: 0 10px; font-weight: 600; }
.brush.eraser.on { border-color: var(--strong); color: var(--strong-fg); }
.palette-hint { flex-basis: 100%; font-size: 13px; color: var(--ink-3); }
.palette-hint strong { color: var(--ink); }

.picker { position: fixed; z-index: 50; width: 316px; max-height: 70vh; overflow: auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.picker header { display: flex; flex-direction: column; line-height: 1.25; }
.picker header span { font-size: 12.5px; color: var(--ink-3); }
.picker h4 { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.picker-list { display: flex; flex-direction: column; gap: 9px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.picker-chips button { border: 0; background: none; padding: 2px; border-radius: calc(var(--r-s) + 2px); }
.picker-chips button:hover, .picker-chips button.on { box-shadow: 0 0 0 2px var(--cell-hover); }

/* ---- finestre, avvisi ---- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-l); width: min(480px, calc(100vw - 28px)); box-shadow: var(--shadow); color: var(--ink); background: var(--raised); }
dialog.modal::backdrop { background: var(--backdrop); }
dialog.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
dialog.modal h2 { font-size: 21px; }
.modal-body { padding: 8px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
dialog.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--sunken); }
.creds { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; padding: 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-m); }
.creds dt { color: var(--ink-3); font-size: 13px; }
.creds dd { margin: 0; font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notes li a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.notes li.new span { font-weight: 650; }
.notes time { font-size: 12.5px; color: var(--ink-3); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { background: var(--strong); color: var(--strong-fg); padding: 10px 16px; border-radius: var(--r-m); font-size: 14px; font-weight: 550; box-shadow: var(--shadow); animation: rise .2s ease-out; max-width: calc(100vw - 32px); }
.toast.err { background: var(--no); color: #fff; }
.toast.bye { opacity: 0; transition: opacity .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---- tabelle ---- */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--card-shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 12px 14px 9px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--sunken); }
.table .num { text-align: center; font-variant-numeric: tabular-nums; }
.table tr.inactive { color: var(--ink-3); }
.who { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: calc(var(--r-s) - 1px); background: var(--night-soft); color: var(--night); }
.acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { vertical-align: middle; }
.more summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 6px 0 12px; }
.table.summary td.heat { font-weight: 650; position: relative; }
.table.summary td.heat::before { content: ""; position: absolute; inset: 3px; border-radius: var(--r-s); background: var(--accent); opacity: calc(var(--heat) * .22); pointer-events: none; }
.table.summary td.zero { color: var(--line-2); font-weight: 400; }

/* ---- ferie ---- */
.req-list { display: flex; flex-direction: column; gap: 12px; }
.req, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--card-shadow); }
.req.attesa { box-shadow: inset 4px 0 0 var(--pending), var(--card-shadow); }
.req header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.req h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; }
.req header .muted { font-size: 13px; }
.req footer { display: flex; justify-content: flex-end; gap: 8px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r-m); background: var(--sunken); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.day-chip em { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.quote { border-left: 3px solid var(--line-2); padding-left: 11px; color: var(--ink-2); }
.note-line { background: var(--sunken); border-radius: var(--r-m); padding: 9px 12px; font-size: 14px; }
.req.rifiutata .note-line { background: var(--no-soft); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; display: flex; flex-direction: column; box-shadow: var(--card-shadow); }
.stat-card strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 32px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 13px; color: var(--ink-3); }
.stat-card.accent { background: var(--strong); border-color: var(--strong); color: var(--strong-fg); }
.stat-card.accent span { color: var(--strong-sub); }
.card .month-nav h1 { font-size: 22px; min-width: 170px; }
.pick-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pick-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; min-height: 104px; border-radius: var(--r-l); border: 1.5px solid var(--line); background: var(--surface); }
.pick-day .wd { font-size: 12px; color: var(--ink-3); }
.pick-day strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 24px; line-height: 1.1; }
.pick-day .gn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
.pick-day.night { background: var(--night-cell); }
.pick-day em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.pick-day:hover:not(:disabled) { border-color: var(--ink-3); }
.pick-day.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pick-day:disabled { opacity: .5; cursor: default; }
.pick-count { font-size: 14px; color: var(--ink-2); min-height: 21px; }
.card-actions { display: flex; justify-content: flex-end; }

/* ---- i miei turni ---- */
.hero { border-radius: calc(var(--r-l) + 4px); padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.hero.day { background: var(--hero-day-bg); color: var(--hero-day-fg); }
.hero.night { background: var(--hero-night-bg); color: var(--hero-night-fg); }
.hero-kicker { font-size: 14px; font-weight: 600; opacity: .8; }
.hero h2 { font-size: 36px; line-height: 1.05; }
.hero-line { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.hero-line span:last-child { opacity: .75; font-weight: 500; margin-left: 4px; }
.hero-post { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 17px; font-weight: 600; }
.hero-post .chip { height: 34px; min-width: 50px; font-size: 14.5px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.hero-next { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; }
.hero-next li { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.hero-next em { font-style: normal; font-weight: 500; opacity: .7; }
.my-days { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--card-shadow); }
.my-days li { display: grid; grid-template-columns: 56px 190px 1fr; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.my-days li:last-child { border-bottom: 0; }
.my-days .d { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.my-days .d strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 23px; }
.my-days .d span { font-size: 12px; color: var(--ink-3); }
.my-days .t { display: flex; align-items: center; gap: 9px; }
.my-days .hours { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.my-days .w { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 550; }
.my-days li.past { opacity: .5; }
.my-days li.off .w > span:nth-child(2) { color: var(--ink-3); font-weight: 500; }
.my-days li.today { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent-line); }
.empty:not(.chip) { text-align: center; padding: 44px 24px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-l); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 20px; }
.empty p { color: var(--ink-3); max-width: 46ch; }

/* ---- accesso ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--auth-bg); }
.auth-card { width: min(420px, 100%); background: var(--raised); border: 1px solid var(--line); border-radius: calc(var(--r-l) + 6px); padding: 30px 28px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 30px; margin-top: 6px; }
.auth-card .brand { padding: 0; }
.auth-card .brand-text strong { color: var(--ink); }
.auth-card .brand-text span { color: var(--ink-3); }

/* ---- schermi stretti ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: auto 0 0 0; top: auto; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--side-line); }
  .side .brand, .side-foot { display: none; }
  .side nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .side nav a { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 10px; position: relative; min-width: 68px; align-items: center; }
  .side nav a.on { background: none; color: var(--side-ink-hi); }
  .side nav a.on .ico { color: var(--side-on-icon); }
  .side nav .badge { position: absolute; top: 2px; right: 12px; }
  .brand.compact { display: flex; padding: 0; }
  .brand.compact strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; }
  .brand.compact .brand-mark { width: 34px; height: 34px; }
  .brand.compact .brand-logo { width: 36px; height: 36px; }
  .topbar { padding: 10px 16px 0; }
  .banner { padding: 9px 16px; }
  .user-name { display: none; }
  .page { padding: 8px 16px 96px; }
  .page-head h1, .month-nav h1 { font-size: 25px; min-width: 0; white-space: nowrap; }
  .month-nav { gap: 0; }
  .person-btn { min-width: 0; width: 138px; padding: 0 8px; gap: 6px; }
  .person-btn .qual { min-width: 28px; font-size: 10px; padding: 0 3px; }
  .person-btn .psalto { display: none; }
  .pname { font-size: 13px; }
  .grid th.day { min-width: 42px; }
  .page-head .btn.ghost { padding: 0 8px; }
  .grid-wrap { max-height: none; }
  .my-days li { grid-template-columns: 44px 1fr; row-gap: 6px; }
  .my-days .w { grid-column: 2; }
  .my-days .hours { display: none; }
  .hero h2 { font-size: 30px; }
  .form-row { grid-template-columns: 1fr; }
  .toasts { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- autista: arancione come il nome evidenziato nell'Excel ---- */
.flag-aut { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px 0 5px; border-radius: calc(var(--r-s) - 1px); background: #FFE9CC; color: #9A4A00; font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none; }
.flag-aut.compact { width: 21px; padding: 0; justify-content: center; }

/* ---- fumetto con il testo intero delle sigle ---- */
.tip { position: fixed; z-index: 200; left: 0; top: 0; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: 7px 10px; border-radius: var(--r-s); background: var(--strong); color: var(--strong-fg); font-size: 13px; font-weight: 550; line-height: 1.35; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.flag-aut.off { background: var(--sunken); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.ord { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: calc(var(--r-s) - 1px); background: var(--strong); color: var(--strong-fg); font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none; }
.grid tfoot tr.foot-comando td { font-size: 12px; font-weight: 700; color: var(--ink); }
