/* Dashboard Vigilanza Civis. Struttura dal componente "Dashboard Sidebar" di 21st (palette Charcoal Ink), schede e
   grafici dal kit "Charts & KPI Cards" (Layro). Superfici antracite, bordi sottili, un solo accento (blu della
   vigilanza, validato per i grafici sul fondo scuro), niente bagliori né griglie di sfondo. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/static/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/static/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/static/fonts/display.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/static/fonts/display-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0f1012;
  --sidebar: #131416;
  --card: #17191c;
  --card-2: #1c1f23;
  --input: #111215;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --veil: rgba(255, 255, 255, 0.05);
  --veil-strong: rgba(255, 255, 255, 0.09);
  --text: #ececee;
  --text-2: #b9bcc2;
  --muted: #8a8f97;
  --accent: #4a8ce6;
  --accent-ink: #0b1a2e;
  --chart: #4a8ce6;
  --ok: #4fb37f;
  --warn: #d79a3c;
  --err: #df645d;
  --info: #7ea3d4;
  --radius: 12px;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
small { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.5; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* --- Struttura ------------------------------------------------------------------------------------ */

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.workspace { position: relative; margin-bottom: 14px; }
.workspace summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; user-select: none; }
.workspace summary::-webkit-details-marker { display: none; }
.workspace summary:hover { background: var(--veil); }
.ws-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.ws-mark img { width: 100%; height: 100%; object-fit: cover; }
.ws-mark .icon { width: 18px; height: 18px; }
.ws-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ws-text strong { font-size: 13px; font-weight: 600; }
.ws-text small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chevron { margin-left: auto; color: var(--muted); }
.ws-menu { position: absolute; top: 54px; left: 0; right: 0; background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 4px; z-index: 20; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.ws-menu a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 13px; color: var(--text-2); }
.ws-menu a:hover { background: var(--veil); color: var(--text); }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; scrollbar-width: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-heading { padding: 0 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 13px; letter-spacing: 0.01em; transition: background 0.15s, color 0.15s; width: 100%; border: 0; background: none; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--veil); color: var(--text); }
.nav-item.active { background: var(--veil-strong); color: var(--text); font-weight: 500; }
.nav-item .icon { color: inherit; opacity: 0.85; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(223, 100, 93, 0.16); color: #f1a29d; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.me img { width: 28px; height: 28px; border-radius: 50%; }
.me span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me strong { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { font-size: 11.5px; }

.topbar { height: 56px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--bg); position: sticky; top: 0; z-index: 10; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.crumbs span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs strong { color: var(--text); font-weight: 500; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 640px; }

/* --- Pulsanti, campi, stati --------------------------------------------------------------------------- */

.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text); font: 500 13px 'Inter', sans-serif; text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: #23272c; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #5b98ea; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--veil); }
.btn.danger { background: transparent; color: #f1a29d; border-color: rgba(223, 100, 93, 0.35); }
.btn.danger:hover { background: rgba(223, 100, 93, 0.1); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; height: 44px; padding: 0 18px; font-size: 14px; }
.btn.discord:hover { background: #6872f4; }
.icon-btn { width: 32px; height: 32px; border-radius: 7px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--veil); color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--veil); color: var(--text-2); white-space: nowrap; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #8fd3ad; background: rgba(79, 179, 127, 0.12); }
.pill.warn { color: #ebc07d; background: rgba(215, 154, 60, 0.13); }
.pill.err { color: #f1a29d; background: rgba(223, 100, 93, 0.13); }
.pill.info { color: #a9c4e8; background: rgba(74, 140, 230, 0.13); }
.pill.muted { color: var(--muted); }
.ok-text { color: #8fd3ad; }
.err-text { color: #f1a29d; }

.flash { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; margin-bottom: 20px; font-size: 13.5px; border: 1px solid; }
.flash.ok { border-color: rgba(79, 179, 127, 0.3); background: rgba(79, 179, 127, 0.08); color: #b9e4cb; }
.flash.err { border-color: rgba(223, 100, 93, 0.35); background: rgba(223, 100, 93, 0.08); color: #f4bcb8; }

/* --- KPI e grafici (Charts & KPI Cards) ---------------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; align-content: start; min-width: 0; overflow: hidden; }
.kpi-label { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 0; }
.kpi-value { margin: 0; font: 600 24px/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-delta { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi-delta small { font-weight: 400; }
.kpi-delta .icon { width: 13px; height: 13px; }
.kpi-delta .up { transform: rotate(-45deg); }
.kpi-delta .down { transform: rotate(45deg); }
.kpi-delta.good { color: #8fd3ad; }
.kpi-delta.bad { color: #f1a29d; }
.spark { width: 72px; height: 28px; flex-shrink: 1; min-width: 0; }
.spark path { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card figcaption > span { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card figcaption small { font-size: 12px; }
.card-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.link { color: var(--info); font-size: 12.5px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.empty { color: var(--muted); margin: 0; font-size: 13px; }
td.empty { text-align: center; padding: 28px; }

.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--chart); }
.chart .hit { fill: transparent; }
.chart .mark:hover .hit { fill: rgba(255, 255, 255, 0.035); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart); opacity: 0.1; }
.chart .cross { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.chart .dot { fill: var(--chart); stroke: var(--card); stroke-width: 2; opacity: 0; }
.chart .mark:hover .cross, .chart .mark:hover .dot { opacity: 1; }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rank li { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.rank-label { color: var(--text-2); }
.rank-track { height: 8px; border-radius: 4px; background: var(--veil); overflow: hidden; }
.rank-fill { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.rank-value { font-variant-numeric: tabular-nums; font-weight: 500; }
.rank-value small { margin-left: 8px; font-weight: 400; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; min-width: 120px; background: #22262b; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font-size: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.tooltip strong { display: block; margin-bottom: 2px; font-weight: 500; color: var(--text-2); }
.tooltip span { display: flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip span::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--chart); }

.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.list strong { font-weight: 500; }
.list small { font-size: 12px; }
.person { display: inline-flex; flex-direction: column; line-height: 1.25; }
.person small { font-size: 11px; font-variant-numeric: tabular-nums; }

/* --- Tabelle e filtri --------------------------------------------------------------------------------- */

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
input[type='text'], input[type='search'], input[type='number'], select {
  height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--input); color: var(--text); padding: 0 10px; font: 13.5px 'Inter', sans-serif; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 140, 230, 0.2); }
select { padding-right: 28px; }

.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sub { display: block; font-size: 12px; color: var(--muted); }
.table strong { font-weight: 500; }
.table.compact th, .table.compact td { padding: 8px 10px; }
.card .table.compact th:first-child, .card .table.compact td:first-child { padding-left: 0; }
.card .table.compact th:last-child, .card .table.compact td:last-child { padding-right: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.inline { display: inline-flex; gap: 4px; align-items: center; }
.money { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 8px; border-radius: 6px; background: var(--veil); font-size: 12.5px; }
.seg { display: inline-flex; background: var(--input); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg a { padding: 3px 10px; border-radius: 7px; font-size: 12px; text-decoration: none; color: var(--muted); }
.seg a.on { background: var(--card-2); color: var(--text); }

.hier { list-style: none; margin: 0; padding: 0; display: grid; }
.hier li { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.hier li:first-child { border-top: 0; padding-top: 0; }
.hier-grade { color: var(--text-2); font-weight: 500; display: flex; gap: 8px; align-items: baseline; }

/* --- Impostazioni ------------------------------------------------------------------------------------------- */

.settings { display: grid; gap: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 16px; }
.panel header h2 { font-size: 16px; font-weight: 600; }
.panel header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field small { font-size: 12px; }
.field input, .field select { width: 100%; }
.input-wrap { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input); }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 140, 230, 0.2); }
.input-wrap input { border: 0; background: transparent; box-shadow: none !important; font-variant-numeric: tabular-nums; }
.suffix { padding: 0 10px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.toggle { grid-template-columns: auto 1fr; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.switch { width: 36px; height: 20px; border-radius: 999px; background: var(--veil-strong); position: relative; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #d9dbdf; transition: transform 0.15s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview { border-top: 1px solid var(--line); padding-top: 14px; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(23, 25, 28, 0.92); backdrop-filter: blur(6px); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 13px; color: var(--muted); }

/* --- Login e pagine di avviso -------------------------------------------------------------------------------- */

body.login { min-height: 100vh; }
.login-split { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; min-height: 100vh; }
.login-form { padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.brand .icon { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.75; }
.login-body h1 { font-size: 40px; line-height: 1.05; font-weight: 700; margin-bottom: 12px; }
.lead { color: var(--text-2); font-size: 15px; margin: 0 0 28px; max-width: 420px; }
.steps { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.steps span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }
.fineprint { color: var(--muted); font-size: 12px; margin: 0; }
.login-aside { background: var(--sidebar); display: grid; place-items: center; padding: 48px; }

.dc-message { display: flex; gap: 14px; max-width: 520px; width: 100%; font-family: 'Inter', sans-serif; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.dc-avatar .icon { width: 20px; height: 20px; }
.dc-body { min-width: 0; flex: 1; }
.dc-name { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.dc-tag { font-size: 10px; font-weight: 600; background: #5865f2; color: #fff; border-radius: 4px; padding: 0 5px; line-height: 16px; }
.dc-time { color: var(--muted); font-size: 12px; margin-left: 2px; }
.dc-content { margin: 2px 0 8px; color: #dbdee1; font-size: 14.5px; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-embed { background: #2b2d31; border-left: 4px solid #a63a3a; border-radius: 4px; padding: 12px 16px; display: grid; gap: 8px; }
.dc-title { font-size: 15px; color: #f2f3f5; }
.dc-embed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; color: #dbdee1; }
.dc-embed ul li::before { content: '•'; color: #b5bac1; margin-right: 8px; }
.dc-embed code { background: #1e1f22; border-radius: 3px; padding: 1px 4px; font-size: 12.5px; }
.dc-foot { font-size: 12px; color: #b5bac1; }
.dc-buttons { display: flex; gap: 8px; margin-top: 8px; }
.dc-btn { background: #4e5058; color: #fff; border-radius: 4px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; }
.dc-btn.primary { background: #5865f2; }

.notice { max-width: 520px; padding: 72px 32px; display: grid; gap: 16px; justify-items: start; }
.notice h1 { font-size: 32px; }
.notice .lead { margin: 0; }
.chooser { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* --- Schermi stretti -------------------------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .login-split { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-form { border-right: 0; padding: 32px 24px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 20px; }
  .spark { display: none; }
  .page-head h1 { font-size: 22px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .hier li { grid-template-columns: 1fr; gap: 6px; }
  .rank li { grid-template-columns: 90px 1fr auto; }
  .savebar { flex-direction: column; align-items: stretch; }
  .login-body h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
