/* GC Studio Intelligence — dashboard.
   Foglio di stile del prototipo (prototype/src/style.css) senza il blocco dei
   token, che sta in tokens.css (copia di design/tokens.css). In fondo le sole
   aggiunte della prima versione online. I caratteri non si scaricano da terzi:
   valgono quelli installati, poi le alternative indicate nei token. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--body); }
#app { height: 100%; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: 27px; line-height: 1.15; font-weight: 700; }
h2, .h2 { font-size: 17px; font-weight: 600; font-family: var(--display); margin: 0; }
h3 { font-size: 14px; margin-top: 14px; }
p { margin: 0; }
a { color: var(--accent); }
code, .json { font-family: var(--mono); font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Barra laterale */
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-body { display: flex; flex-direction: column; gap: 20px; flex: 1 1 auto; }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 44px; color: #FFFFFF; border-color: var(--side-muted); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand div { display: flex; flex-direction: column; }
.brand strong { font-family: var(--display); font-size: 17px; color: #FFFFFF; }
.brand span { font-size: 12px; color: var(--side-muted); }
.brand strong { line-height: 1.1; }
.brand .brand-sub { font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin-top: 3px; }
.side-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--side-muted); }
.side-f select { min-height: 38px; padding: 0 8px; background: #1A262D; color: #FFFFFF; border: 1px solid var(--side-line); border-radius: 4px; font-weight: 400; font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 4px; color: var(--side-ink); text-decoration: none; }
.nav a:hover { background: #1A262D; }
.nav a[aria-current="page"] { background: var(--side-on); color: #FFFFFF; font-weight: 600; }
.nav-h { padding: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--side-muted); }
.badge { padding: 1px 7px; border-radius: 3px; background: var(--brand); color: #111A1F; font-size: 12px; font-weight: 600; }
.side .seg { display: flex; background: #1A262D; border-color: var(--side-line); }
.side .seg .btn { flex: 1 1 0; padding: 0 8px; color: var(--side-ink); font-size: 13px; }
.side .seg .btn.on { background: #E8ECEA; color: #111A1F; }
.side-b { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 10px; }

/* Area di lavoro */
.main { overflow-y: auto; padding: 26px 30px 56px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn); border-radius: 6px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.head p { color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack0 { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.grow1 { flex: 1 1 300px; min-width: 0; }
.grow2 { flex: 2 1 540px; min-width: 0; }
.grow3 { flex: 3 1 600px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.sub { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
a.strong { text-decoration: none; }
a.strong:hover { text-decoration: underline; }
.t-warn { color: var(--warn-ink); } .t-ok { color: var(--ok-ink); } .t-bad { color: var(--bad-ink); }
.undone { text-decoration: line-through; color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; }
.note { font-size: 13px; color: var(--muted); max-width: 90ch; }
.box { padding: 10px 12px; background: var(--bg); border-radius: 4px; font-size: 13px; }
.box p + p { margin-top: 6px; }
.nw { white-space: nowrap; }

/* Indicatori */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi strong { font-family: var(--display); font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 13px; color: var(--muted); }
.kpi em.t-bad { color: var(--bad-ink); font-weight: 600; }

/* Tabelle */
.scroll { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl thead th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tbl tbody th { font-weight: 500; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.total > * { background: var(--bg); font-weight: 600; }
.tbl select { min-height: 34px; }
.tbl .w-main { min-width: 230px; }

/* Etichette di stato */
.chip { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.c-info { background: var(--info-bg); color: var(--info-ink); } .c-warn { background: var(--warn-bg); color: var(--warn-ink); }
.c-ok { background: var(--ok-bg); color: var(--ok-ink); } .c-bad { background: var(--bad-bg); color: var(--bad-ink); }
.c-neutral { background: var(--neu-bg); color: var(--neu-ink); } .c-dark { background: var(--strong); color: var(--strong-ink); }
.tag { padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 3px; font-size: 12px; }
.bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-t { flex: 1 1 70px; height: 8px; background: var(--neu-bg); border-radius: 2px; overflow: hidden; }
.bar-f { display: block; height: 100%; background: var(--accent); }
.bar-f.dark { background: var(--strong); }
.bar-n { width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* Pulsanti e campi */
.btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--strong); color: var(--strong-ink); border-color: var(--strong); }
.btn.sm { min-height: 32px; padding: 0 10px; }
.btn.danger { color: var(--bad-ink); }
.btn.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); text-align: left; }
.btn.link:hover { text-decoration: underline; }
.btn.ghost-d { background: transparent; color: var(--side-ink); border-color: var(--side-line); }
.btn:disabled { opacity: .55; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); }
.seg .btn { border: 0; border-radius: 3px; min-height: 36px; font-weight: 500; background: transparent; }
.seg .btn.on { background: var(--strong); color: var(--strong-ink); font-weight: 600; }
select, input[type="text"], input[type="search"], input[type="date"], input[type="datetime-local"], input[type="number"], textarea { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); color: var(--ink); max-width: 100%; }
textarea { min-height: 88px; resize: vertical; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.filters label, .modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters label > *, .modal label > input, .modal label > select, .modal label > textarea { font-size: 14px; font-weight: 400; color: var(--ink); }
.filters label.wide { grid-column: 1 / -1; }
.inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.inline input { width: 96px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chk input { width: 18px; height: 18px; }

/* Schede di progetto */
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 12px 24px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.facts.tight { padding: 0; border: 0; background: none; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-2); }
.tabs button { min-height: 40px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; flex-direction: column; gap: 4px; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 2px; }
.plain { margin: 6px 0 0; padding-left: 18px; }

/* Cronoprogramma */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.lg-base { height: 4px; background: var(--base); } .lg-bar { background: var(--bar); } .lg-done { background: var(--accent); }
.lg-pend { background: var(--warn-bg); border: 1px dashed var(--warn); } .lg-today { width: 2px; height: 14px; background: var(--warn); }
.gantt { min-width: 700px; }
.g-row { position: relative; display: grid; grid-template-columns: 180px minmax(0, 1fr) 142px; align-items: center; border-bottom: 1px solid var(--line); }
.g-head { border-bottom-color: var(--line-2); padding-bottom: 4px; }
.g-name { display: flex; flex-direction: column; padding: 4px 10px 4px 0; min-width: 0; }
.g-months { position: relative; height: 20px; font-size: 12px; font-weight: 600; color: var(--muted); }
.g-months span { position: absolute; top: 0; padding-left: 4px; white-space: nowrap; }
.g-body { position: relative; }
.g-lines { position: absolute; left: 180px; right: 142px; top: 0; bottom: 0; }
.g-lines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-lines i.g-today { width: 2px; background: var(--warn); }
.g-track { position: relative; height: 44px; }
.g-base { position: absolute; top: 10px; height: 4px; background: var(--base); border-radius: 1px; }
.g-bar { position: absolute; top: 19px; height: 14px; background: var(--bar); border-radius: 2px; overflow: hidden; }
.g-bar span { display: block; height: 100%; background: var(--accent); }
.g-pend { position: absolute; top: 19px; height: 14px; background: var(--warn-bg); border: 1px dashed var(--warn); }
.g-ms { position: absolute; top: 16px; width: 12px; height: 12px; margin-left: -6px; background: var(--ink); transform: rotate(45deg); }
.g-ms-b { background: var(--surface); border: 2px solid var(--base); }
.g-act { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-left: 8px; }
.g-pct { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Documenti, comunicazioni, task */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.doc p { max-width: 95ch; }
.doc-t { font-size: 15px; font-weight: 600; }
.task { flex-direction: row !important; align-items: center; gap: 12px !important; }
.task > div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.check { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line-2); border-radius: 4px; background: var(--surface); color: var(--strong-ink); cursor: pointer; padding: 0; }
.check[aria-checked="true"] { background: var(--strong); border-color: var(--strong); }
.cal { min-width: 780px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-h { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-d.off { background: var(--bg); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--warn); }
.cal-n { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-e { padding: 2px 6px; border-radius: 3px; font-size: 11.5px; line-height: 1.3; overflow-wrap: anywhere; }

/* Permessi e MCP */
.users { gap: 4px; }
.user { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 0; border-radius: 4px; background: none; text-align: left; cursor: pointer; }
.user span { font-size: 12px; color: var(--muted); }
.user:hover { background: var(--bg); }
.user.on { background: var(--strong); color: var(--strong-ink); }
.user.on span { color: var(--strong-ink); opacity: .8; }
.matrix { min-width: 820px; display: flex; flex-direction: column; gap: 6px; }
.mx-r { display: grid; grid-template-columns: 210px repeat(6, minmax(0, 1fr)); gap: 6px; align-items: center; }
.mx-h { font-size: 12px; font-weight: 600; color: var(--muted); align-items: end; }
.lvl { min-height: 38px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lvl:disabled { cursor: default; opacity: 1; }
.l0 { background: var(--surface); color: var(--muted); border-color: var(--line-2); }
.l1 { background: var(--l1); color: var(--ink); border-color: var(--l1); }
.l2 { background: var(--l2); color: var(--l2-ink); border-color: var(--l2); }
.l3 { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.l4 { background: var(--strong); color: var(--strong-ink); border-color: var(--strong); }
.legend .lg.l0 { border: 1px solid var(--line-2); }
.flags { padding-top: 12px; border-top: 1px solid var(--line); gap: 10px 24px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 8px; }
.tool { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.tool em { font-style: normal; font-size: 12px; color: var(--muted); }
.tool.no { border-style: dashed; }
.tool.no code { color: var(--muted); text-decoration: line-through; }
.tool.ok em { color: var(--ok-ink); font-weight: 600; }
.json { margin: 4px 0 0; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: auto; max-height: 360px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.json.err { border-color: var(--bad-ink); color: var(--bad-ink); }

/* Finestre e avvisi */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(10, 16, 19, .55); overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 20px 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.modal form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.modal input[type="range"] { width: 100%; }
.modal output { color: var(--ink); font-variant-numeric: tabular-nums; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(620px, calc(100% - 32px)); padding: 11px 16px; background: var(--strong); color: var(--strong-ink); border-radius: 6px; font-weight: 500; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
.toast[hidden] { display: none; }

/* Grafici della dashboard */
.vz-sub { font-size: 13px; color: var(--muted); margin-top: -6px; max-width: 70ch; }
.vz-leg { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); }
.vz-leg li { display: inline-flex; align-items: center; gap: 6px; }
.vz-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.vz-sw.tick { width: 2px; height: 14px; border-radius: 0; background: var(--ink); margin: 0 4px; }
.vz-c1 { background: var(--c1); } .vz-c2 { background: var(--c2); } .vz-c3 { background: var(--c3); }
.vz-q0 { background: var(--q0); } .vz-q1 { background: var(--q1); } .vz-q2 { background: var(--q2); } .vz-q3 { background: var(--q3); } .vz-q4 { background: var(--q4); }
.vz-acc { background: var(--accent); }
.vz-rows { display: flex; flex-direction: column; gap: 12px; }
.vz-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) minmax(104px, auto); align-items: center; gap: 4px 12px; }
.vz-lab { font-size: 13px; line-height: 1.3; }
.vz-val { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.3; }
.vz-val strong { display: block; color: var(--ink); font-size: 13.5px; }
.vz-hit { padding: 7px 0; cursor: default; }
.vz-track { position: relative; height: 14px; background: var(--neu-bg); border-radius: 0 4px 4px 0; }
.vz-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.vz-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.vz-segs { display: flex; gap: 2px; height: 14px; }
.vz-segs span { display: block; min-width: 3px; }
.vz-segs span:last-child { border-radius: 0 4px 4px 0; }
.vz-hit:hover .vz-track, .vz-hit:hover .vz-segs { filter: brightness(.93); }
.vz-colchart { min-width: 430px; }
.vz-plot { position: relative; margin-left: 44px; border-bottom: 1px solid var(--line-2); }
.vz-gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.vz-gl em { position: absolute; right: 100%; top: -8px; margin-right: 8px; font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vz-colrow, .vz-xrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.vz-colrow { position: relative; height: 100%; }
.vz-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.vz-col:hover { background: color-mix(in srgb, var(--neu-bg) 70%, transparent); }
.vz-cap { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vz-stk { display: flex; flex-direction: column; gap: 2px; width: min(24px, 60%); }
.vz-stk span { display: block; }
.vz-stk span:first-child { border-radius: 4px 4px 0 0; }
.vz-xrow { margin: 6px 0 0 44px; font-size: 11.5px; color: var(--muted); text-align: center; }
.vz-xrow .late { color: var(--bad-ink); font-weight: 600; }
.vz-data { font-size: 13px; }
.vz-data summary { cursor: pointer; color: var(--accent); width: fit-content; min-height: 28px; display: flex; align-items: center; }
.vz-data[open] summary { margin-bottom: 8px; }
.vz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); padding: 8px 10px; font-size: 12.5px; max-width: 280px; }
.vz-tt { font-weight: 600; margin-bottom: 4px; }
.vz-tr { display: grid; grid-template-columns: 12px auto 1fr; align-items: center; gap: 6px; }
.vz-tr strong { font-variant-numeric: tabular-nums; }
.vz-tr span { color: var(--muted); }
.vz-k { display: block; width: 12px; height: 3px; border-radius: 2px; }
.vz-rows.stacked .vz-row { grid-template-columns: minmax(0, 1fr) auto; }
.vz-rows.stacked .vz-hit { grid-column: 1 / -1; order: 3; }
.vz-rows.stacked .vz-val strong { display: inline; margin-right: 6px; }
@media (max-width: 560px) { .vz-row { grid-template-columns: minmax(0, 1fr) auto; } .vz-row .vz-hit { grid-column: 1 / -1; order: 3; } }
@media (max-width: 900px) {
  html, body { height: auto; }
  #app { display: block; height: auto; }
  .side { position: sticky; top: 0; z-index: 10; overflow: visible; padding: 10px 14px; gap: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
  .menu-btn { display: inline-flex; }
  .side-body { display: none; max-height: calc(100vh - 90px); overflow-y: auto; padding-bottom: 8px; }
  .side-body.open { display: flex; }
  .nav a { min-height: 44px; font-size: 15px; }
  .main { overflow: visible; padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .nav a, .lvl { transition: background-color .12s, border-color .12s; } }

/* ---------- Aggiunte della prima versione online ---------- */
.brand img { display: block; flex: none; border-radius: 3px; }
.side-user { font-weight: 400; font-size: 13px; color: var(--side-ink); overflow-wrap: anywhere; }
.btn.ghost-d:hover { border-color: var(--side-muted); }

/* Prima dei dati: caricamento, accesso richiesto, errore */
#app.boot { display: block; }
.gate { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; background: var(--side); }
.gate-card { width: min(480px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.gate-card p { color: var(--muted); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 900px) { .gate { min-height: 100vh; } }

/* Evidenza in tempo reale: ciò che un evento del server ha appena cambiato */
[data-el].hl, .tbl tr.hl > * { background-color: var(--info-bg); }
@media (prefers-reduced-motion: no-preference) { [data-el], .tbl tr[data-el] > * { transition: background-color .5s; } }

/* Avviso con un messaggio d'errore del server */
.toast.err { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-ink); }
