/* Cirem
   Telefono: barra in alto, schede in basso, tasto + flottante.
   Computer (da 1024px): menu laterale fisso, contenuto largo su due colonne, tabelle complete. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/montserrat-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 900; font-display: swap; src: url("/static/fonts/montserrat-latin-900-normal.woff2") format("woff2"); }
:root {
  --orange: #FF7620; --sky: #38B6FF; --navy: #00177A;
  --bg: #F3F5FB; --card: #FFFFFF; --fg: #141A33; --muted: #5E6686; --line: #DFE4F0; --soft: #EBEFF8;
  --chip: #E0F3FF; --chip-fg: #00177A; --bar: #00177A; --bar-fg: #FFFFFF; --ink-accent: #00177A;
  --red: #D12E31; --red-soft: #FDE9E9; --green: #138A51; --green-soft: #E2F5EA;
  --amber-soft: #FFF4D4; --amber-fg: #7A5700; --orange-soft: #FFEADD; --orange-fg: #A84305;
  --chart: #00177A; --grid: #E6EAF3; --side: #00177A; --side-fg: #FFFFFF; --side-muted: #AEB9E8; --side-hover: rgba(255,255,255,.08);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --w: 680px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0A0F24; --card: #141B36; --fg: #EEF1FA; --muted: #A1A9C7; --line: #2A3456; --soft: #1D2647;
  --chip: #12305A; --chip-fg: #C4E8FF; --bar: #00105A; --bar-fg: #FFFFFF; --ink-accent: #7FD0FF;
  --red: #FF7275; --red-soft: #3A1520; --green: #45D892; --green-soft: #0F3324;
  --amber-soft: #3A2E0A; --amber-fg: #FFD36B; --orange-soft: #3D2010; --orange-fg: #FFA770;
  --chart: #38B6FF; --grid: #222C4C; --side: #060B22; --side-muted: #8C97C4; color-scheme: dark; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- struttura ---------- */
.shell { min-height: 100vh; }
.content { max-width: var(--w); margin: 0 auto; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-fg); display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; min-height: 56px; }
.top h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand { display: flex; flex-direction: column; line-height: .92; font-weight: 900; font-size: 11px; letter-spacing: -.2px; text-decoration: none; }
.b1 { color: var(--orange); } .b2 { color: var(--sky); } .b3 { color: #fff; }
.back { color: var(--bar-fg); font-size: 30px; line-height: 1; padding: 0 6px 4px 0; text-decoration: none; }
.back .lbl { display: none; }
.top-act { background: rgba(255,255,255,.16); color: var(--bar-fg); border: 0; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.me { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; text-decoration: none; flex-shrink: 0; }
main { padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 130px); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs a { flex: 1; min-width: 0; padding: 8px 0 10px; font-size: 11.5px; color: var(--muted); font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; }
.tabs svg, .side nav svg { width: 22px; height: 22px; flex-shrink: 0; }
.tabs .on { color: var(--ink-accent); }
.tabs .on svg { color: var(--orange); }
.fab { position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); right: 18px; z-index: 11; width: 60px; height: 60px; border-radius: 50%;
  background: var(--orange); color: #fff; font-size: 34px; line-height: 60px; text-align: center; text-decoration: none; box-shadow: 0 6px 18px rgba(255,118,32,.4); }

/* ---------- elementi comuni ---------- */
section { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0 0 2px; font-weight: 800; }
.h3 { font-size: 15px; color: var(--fg); margin: 16px 0 0; font-weight: 800; }
.empty { color: var(--muted); background: var(--card); border-radius: 12px; padding: 14px; margin: 0; }
.small { color: var(--muted); font-size: 13px; margin: 0; }
.card { background: var(--card); border-radius: var(--r); padding: 14px; }
.linkbtn { background: none; border: 0; color: var(--ink-accent); font-weight: 700; cursor: pointer; padding: 10px; font-size: 14px; text-decoration: underline; }
.center { text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.info { background: var(--chip); color: var(--chip-fg); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin: 0; }
.warnbox { background: var(--amber-soft); color: var(--amber-fg); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin: 0; }
.toast { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 66px); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 20px;
  font-weight: 700; z-index: 30; width: max-content; max-width: calc(100% - 32px); text-align: center; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.ok { background: var(--green); color: #fff; }
.av { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; font-size: 15px; }
.c0 { background: #00177A; } .c1 { background: #E0610F; } .c2 { background: #0E7FC2; } .c3 { background: #8A3FC7; }
.c4 { background: #1E8F5A; } .c5 { background: #B8336A; } .c6 { background: #8A6200; } .c7 { background: #2F4F9E; } .cx { background: #6B7290; }
.av.sm { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; }
.pill { background: var(--soft); padding: 2px 8px; border-radius: 20px; font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.pill.pr { background: var(--orange-soft); color: var(--orange-fg); }
.pill.st-in_corso { background: var(--chip); color: var(--chip-fg); }
.pill.st-attesa_cliente { background: var(--amber-soft); color: var(--amber-fg); }
.pill.st-fatto, .pill.ok { background: var(--green-soft); color: var(--green); }
.pill.off { background: var(--red-soft); color: var(--red); }
.chip { background: var(--chip); color: var(--chip-fg); padding: 5px 10px; border-radius: 20px; font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.late { color: var(--red); font-weight: 800; }
.owner { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.owner b { color: var(--fg); }

/* ---------- Oggi ---------- */
.hello { margin: 0 0 10px; }
.now { display: block; text-decoration: none; background: linear-gradient(120deg, var(--orange), #FF9A55); color: #fff; border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.now small { display: block; opacity: .92; font-weight: 600; }
.now strong { display: block; font-size: 20px; font-weight: 800; }
.now span { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.24); padding: 6px 10px; border-radius: 8px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--card); border-radius: var(--r); padding: 12px 6px; text-align: center; }
.stats b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stats .hot { background: var(--navy); }
.stats .hot b, .stats .hot span { color: #fff; }
.team { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); background: var(--card); border-radius: 12px; padding: 12px 14px; margin-top: 10px; border-left: 4px solid var(--red); }
.team.ok { border-left-color: var(--green); }
.team .tt { flex: 1; min-width: 0; }
.team b { font-weight: 800; }

/* ---------- ticket ---------- */
.list { display: flex; flex-direction: column; gap: 6px; }
.trow { display: flex; align-items: stretch; background: var(--card); border-radius: 12px; border-left: 4px solid transparent; }
.trow.pr-urgente { border-left-color: var(--red); }
.trow.pr-alta { border-left-color: var(--orange); }
.checkf { display: flex; margin: 0; }
.check { position: relative; width: 48px; min-height: 56px; flex-shrink: 0; background: none; border: 0; cursor: pointer; color: var(--green); font-weight: 900; padding: 0; }
.check::before { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; }
.check:hover::before { border-color: var(--green); }
.trow.done .check::before { border-color: var(--green); background: var(--green-soft); }
.tbody { flex: 1; min-width: 0; padding: 10px 12px 10px 0; text-decoration: none; color: var(--fg); display: flex; gap: 8px; align-items: center; }
.tmain { flex: 1; min-width: 0; }
.ttitle { display: block; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.trow.done .ttitle { text-decoration: line-through; color: var(--muted); }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tmeta b { color: var(--fg); font-weight: 800; }
.tc, .thead { display: none; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .full { grid-column: 1 / -1; }
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.seg a { white-space: nowrap; padding: 7px 12px; border-radius: 20px; background: var(--card); color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.seg .on { background: var(--navy); color: #fff; }
.tdetail { border-left: 4px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.tdetail.pr-urgente { border-left-color: var(--red); }
.tdetail.pr-alta { border-left-color: var(--orange); }
.tdetail h2 { margin: 0; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; text-wrap: balance; }
.desc { white-space: pre-wrap; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.filebtn { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--fg); font-weight: 700; }
.filebtn small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; overflow-wrap: anywhere; }
.ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; color: #fff; flex-shrink: 0; }
.ico.drive { background: var(--navy); } .ico.canva { background: var(--sky); color: #00124F; }
.statusbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.statusbar form { margin: 0; }
.statusbar button { width: 100%; padding: 12px 6px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.statusbar .on { border-color: var(--navy); background: var(--navy); color: #fff; }
.statusbar .on.st-fatto { background: var(--green); border-color: var(--green); }
.noteform { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.noteform textarea { flex: 1; }
.note { background: var(--card); border-radius: 10px; padding: 8px 12px; }
.note small { color: var(--muted); font-size: 12px; font-weight: 600; }
.note p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- eventi ---------- */
.ev { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--sky); }
.ev.past { opacity: .65; border-left-color: var(--line); }
.evt { font-weight: 800; font-size: 14px; min-width: 52px; font-variant-numeric: tabular-nums; }
.evb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.evb b { font-weight: 700; overflow-wrap: anywhere; }
.evb small { color: var(--muted); font-size: 12px; }
.evb .chip { margin-top: 6px; }

/* ---------- clienti ---------- */
.clist { display: flex; flex-direction: column; gap: 6px; }
.crow { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--fg); }
.cb { flex: 1; min-width: 0; }
.cb b, .cb small { display: block; }
.cb b { font-weight: 700; overflow-wrap: anywhere; }
.cb small { color: var(--muted); font-size: 13px; }
.badge { background: var(--navy); color: #fff; border-radius: 20px; padding: 3px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.late { background: var(--red); }
.grp { margin-top: 14px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-top: 10px; }
.quick a { background: var(--soft); text-align: center; padding: 11px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tool { border-radius: var(--r); padding: 16px 14px; text-decoration: none; color: #fff; }
.tool b { display: block; font-size: 18px; font-weight: 800; }
.tool small { opacity: .9; font-weight: 600; }
.tool.drive { background: var(--navy); }
.tool.canva { background: var(--sky); color: #00124F; }
.tool.off { background: var(--card); color: var(--muted); border: 2px dashed var(--line); }
.links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-weight: 700; font-size: 14px; }
.copyable { user-select: all; }

/* ---------- moduli ---------- */
input, select, textarea { width: 100%; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
.form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.form label, .lbl { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form label small { font-weight: 500; font-size: 12px; }
.err { color: var(--red); font-weight: 700; font-size: 13px; margin: 0; }
.grid2 { display: flex; flex-direction: column; gap: 12px; }
.formfoot { display: flex; flex-direction: column; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > * { min-width: 0; }
.radios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.radios legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 5px; }
.radios label { display: block; }
.radios input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radios span { display: block; text-align: center; padding: 10px 2px; border-radius: 10px; background: var(--card); border: 2px solid var(--line); font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; }
.radios input:checked + span { border-color: var(--navy); color: var(--fg); font-weight: 800; }
.radios input:focus-visible + span { outline: 2px solid var(--sky); }
.radios .pr-urgente input:checked + span { border-color: var(--red); color: var(--red); }
.radios .pr-alta input:checked + span { border-color: var(--orange); color: var(--orange-fg); }
.quickdates { display: flex; gap: 6px; }
.quickdates input { flex: 1; }
.quickdates button { border: 0; background: var(--chip); color: var(--chip-fg); border-radius: 10px; padding: 0 10px; font-size: 13px; font-weight: 800; cursor: pointer; }
details summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
details[open] > summary { margin-bottom: 10px; }
.btn { display: block; width: 100%; text-align: center; padding: 14px; border-radius: 12px; border: 0; background: var(--soft); color: var(--fg); font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.danger-btn { background: var(--red); color: #fff; }
.btn.auto { width: auto; padding: 12px 16px; }
.btn:disabled { opacity: .55; cursor: wait; }
.danger { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.danger > button, .danger form > button.ask { background: none; border: 0; color: var(--red); font-weight: 700; padding: 10px; cursor: pointer; font-size: 14px; }
.danger form { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.confirm { background: var(--red-soft); border-radius: 12px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; font-weight: 600; width: 100%; }
.confirm .yes { background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.confirm .no { background: var(--card); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.menu { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; }
.menu > a, .menu > form > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px; font-weight: 700; font-size: 15px; cursor: pointer; text-align: left; text-decoration: none; width: 100%; }
.menu > form { margin: 0; }
.menu > *:last-child, .menu > form:last-child > button { border-bottom: 0; }
.menu .arrow { color: var(--muted); }

/* ---------- pannello ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi b small { font-size: 14px; color: var(--muted); font-weight: 700; }
.kpi > small { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi.alert b { color: var(--red); }
.chartbox { position: relative; background: var(--card); border-radius: var(--r); padding: 14px 10px 8px; min-height: 230px; }
.chartbox svg { display: block; width: 100%; height: auto; overflow: visible; }
.chartbox .bar { fill: var(--chart); }
.chartbox .bar.hi { fill: var(--orange); }
.chartbox .hit { fill: transparent; cursor: pointer; }
.chartbox .gl { stroke: var(--grid); stroke-width: 1; }
.chartbox text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 600; }
.chartbox text.val { fill: var(--fg); font-weight: 800; }
.tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 700; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 2; }
.hbars { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: var(--r); padding: 14px; }
.hb { display: grid; grid-template-columns: minmax(0, 150px) 1fr 30px; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; }
.hb .lab { overflow-wrap: anywhere; line-height: 1.2; }
.hb .fill { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--chart); min-width: 2px; }
.hb .n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; background: var(--card); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 440px; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover, tr[data-href]:focus-visible { background: var(--soft); outline: none; }
td a { text-decoration: none; font-weight: 600; }
.urow { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--fg); }
.urow.inactive { opacity: .6; }
.secret { display: flex; flex-direction: column; gap: 10px; background: var(--green-soft); border-radius: 12px; padding: 16px; }
.secret code { font-size: 22px; font-weight: 800; letter-spacing: 1px; background: var(--card); padding: 12px; border-radius: 8px; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; }
.log { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.log time { color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.log p { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log .ip { color: var(--muted); font-size: 12px; }

/* ---------- guida ---------- */
.guide { display: flex; flex-direction: column; gap: 10px; }
.guide h2 { font-size: 18px; font-weight: 800; margin: 12px 0 0; text-wrap: balance; }
.guide p, .guide li { line-height: 1.55; margin: 0; }
.guide ol, .guide ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.gstep { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: var(--r); padding: 14px; }
.gstep .num { width: 28px; height: 28px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.gstep > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gstep h3 { margin: 0; font-size: 15px; font-weight: 800; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sw { width: 6px; height: 22px; border-radius: 3px; flex-shrink: 0; }
.sw.red { background: var(--red); } .sw.orange { background: var(--orange); }
.ghero { background: var(--navy); color: #fff; border-radius: var(--r); padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.ghero b { font-size: 20px; font-weight: 800; }
.ghero p { opacity: .92; }
.gsteps { display: flex; flex-direction: column; gap: 10px; }

/* ---------- accesso ---------- */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 20px; }
.loginbox { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.loginbox .logo { display: inline-flex; flex-direction: column; line-height: .92; font-weight: 900; font-size: 44px; letter-spacing: -1px; }
.loginbox .sub { color: #fff; letter-spacing: 6px; font-weight: 700; margin: 0 0 12px; }
.loginbox label { color: #DCE3FF; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 5px; }
.loginbox .err { background: #fff; color: #B3191C; padding: 10px 12px; border-radius: 10px; }
.loginbox input { background: #fff; color: #141A33; border: 0; }

/* ---------- colonne (si affiancano solo su computer) ---------- */
.cols { display: flex; flex-direction: column; }
.cols.side-first .col-side { order: -1; }
.col-main, .col-side { min-width: 0; }
section + .cols, .info + .cols { margin-top: 22px; }
.tgrid { display: flex; flex-direction: column; }
.tgrid > * { min-width: 0; }
.tgrid .t-side { order: 1; } .tgrid .t-notes { order: 2; }
.col-side > section:first-child, .col-main > section:first-child { margin-top: 0; }
.cols.side-first .col-main > section:first-child { margin-top: 22px; }
.cols:not(.side-first) .col-side > section:first-child { margin-top: 22px; }

@media (min-width: 540px) { .statusbar { grid-template-columns: repeat(4, 1fr); } .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: no-preference) { main { animation: in .16s ease-out; } @keyframes in { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } } }

/* =====================================================================
   COMPUTER: menu laterale, pagine larghe, tabelle complete
   ===================================================================== */
@media (min-width: 1024px) {
  body { font-size: 15px; }
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-fg); padding: 22px 16px; }
  .side-brand { display: inline-flex; flex-direction: column; line-height: .92; font-weight: 900; font-size: 19px; letter-spacing: -.4px; text-decoration: none; padding: 0 8px; }
  .side-new { display: block; text-align: center; background: var(--orange); color: #fff; border-radius: 12px; padding: 12px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 14px rgba(255,118,32,.35); }
  .side-new:hover { filter: brightness(1.05); }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-muted); font-weight: 700; text-decoration: none; }
  .side nav a:hover { background: var(--side-hover); color: #fff; }
  .side nav a.on { background: rgba(255,255,255,.12); color: #fff; }
  .side nav a.on svg { color: var(--orange); }
  .side nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 20px; padding: 1px 7px; }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
  .side-foot > a.lnk { color: var(--side-muted); font-weight: 700; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
  .side-foot > a.lnk:hover { background: var(--side-hover); color: #fff; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: #fff; background: rgba(255,255,255,.06); }
  .side-user:hover, .side-user.on { background: rgba(255,255,255,.12); }
  .side-user span { min-width: 0; }
  .side-user b, .side-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user small { color: var(--side-muted); font-size: 12px; }
  .side-user form { margin: 0 0 0 auto; }
  .content { max-width: none; margin: 0; min-width: 0; }
  .top { position: sticky; top: 0; background: var(--bg); color: var(--fg); padding: 22px 36px 14px; min-height: 0; border-bottom: 1px solid transparent; }
  .top h1 { font-size: 26px; letter-spacing: -.3px; }
  .top .brand, .top .me { display: none; }
  .back { color: var(--muted); font-size: 14px; font-weight: 700; padding: 6px 10px 6px 0; display: inline-flex; align-items: center; gap: 4px; }
  .back .lbl { display: inline; }
  .back:hover { color: var(--fg); }
  .top-act { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
  .top-act:hover { border-color: var(--muted); }
  main { padding: 6px 36px 48px; max-width: 1240px; }
  main.narrow { max-width: 860px; }
  .tabs, .fab { display: none; }
  .toast { top: 24px; }

  .cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
  .cols.side-first .col-side { order: 0; }
  .col-main { grid-column: 1; grid-row: 1; }
  .col-side { grid-column: 2; grid-row: 1; position: sticky; top: 90px; }
  .cols .col-main > section:first-child, .cols .col-side > section:first-child,
  .cols:not(.side-first) .col-side > section:first-child, .cols.side-first .col-main > section:first-child { margin-top: 0; }

  .tgrid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); grid-template-rows: auto 1fr; column-gap: 28px; align-items: start; }
  .tgrid .t-card { grid-column: 1; grid-row: 1; }
  .tgrid .t-notes { grid-column: 1; grid-row: 2; }
  .tgrid .t-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 90px; }
  .tgrid .t-side > section:first-child { margin-top: 0; }

  /* elenco ticket come tabella */
  .list.table { gap: 0; background: var(--card); border-radius: var(--r); overflow: hidden; }
  .list.table .trow { border-radius: 0; border-bottom: 1px solid var(--line); }
  .list.table .trow:last-child { border-bottom: 0; }
  .list.table .trow:hover { background: var(--soft); }
  .list.table .tbody { display: grid; grid-template-columns: minmax(0, 1fr) 190px 116px 130px 150px; gap: 14px; padding: 12px 16px 12px 0; }
  .list.table .tmeta .mobile-only, .list.table .tav { display: none; }
  .list.table .tc { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
  .list.table .tc > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .thead { display: grid; grid-template-columns: 48px minmax(0, 1fr) 190px 116px 130px 150px; gap: 14px; padding: 10px 16px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--line); }
  .thead span:first-child { visibility: hidden; }

  .filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .filters .full { grid-column: auto; }
  .filters.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg a:hover { color: var(--fg); }

  .clist { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
  .clist .grp { grid-column: 1 / -1; margin-top: 12px; }
  .clist .grp:first-child { margin-top: 0; }
  .crow { padding: 14px; transition: box-shadow .15s; }
  .crow:hover { box-shadow: 0 4px 16px rgba(0, 23, 122, .08); }

  .stats b { font-size: 28px; }
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .statusbar { grid-template-columns: 1fr; }
  .statusbar button { text-align: left; padding: 11px 14px; }
  .form.wide { max-width: 860px; }
  .form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .form .grid2 > * { min-width: 0; }
  .form .grid2 .span2 { grid-column: 1 / -1; }
  .formfoot { flex-direction: row; }
  .formfoot .btn { width: auto; padding: 13px 22px; }
  .gsteps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .guide { max-width: 980px; }
  .guide .gcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; align-items: start; }
  .guide .gcols > div { display: flex; flex-direction: column; gap: 10px; }
  .agenda-grid { max-width: 900px; }
  .hello { font-size: 16px; }
  .urows { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
}

@media (min-width: 1440px) {
  main { padding-left: 48px; padding-right: 48px; }
  .top { padding-left: 48px; padding-right: 48px; }
}

/* utilità (niente stili scritti nell'HTML: la protezione CSP li bloccherebbe) */
.mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt0 { margin-top: 0; }
.bold { font-weight: 800; }
.flexrow { display: flex; gap: 12px; align-items: center; }
.flexrow > .grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }
