/* Mont3 Operations: design system. Generato da gen/export_css.py: modifica i token in gen/tokens.py, le regole in gen/css.py. */

:root, :root[data-theme="dark"] {
  --bg: #151412;
  --surface: #1C1B18;
  --surface2: #24221E;
  --surface3: #2B2925;
  --border: #2E2C27;
  --border2: #3B3832;
  --text: #F2EFE9;
  --text2: #B8B3A9;
  --text3: #8F8A80;
  --ink: #F2EFE9;
  --inkText: #151412;
  --crit: #F26B62;
  --critBg: #3A1E1C;
  --critFill: #F26B62;
  --warn: #F0B440;
  --warnBg: #3A2E14;
  --ok: #4FC48C;
  --okBg: #16302A;
  --mute: #A39E94;
  --muteBg: #2A2825;
  --work: #7FB5F5;
  --workBg: #1B2A3D;
  --pause: #C4A8F2;
  --pauseBg: #2A2140;
  --link: #8AB8F8;
  --focus: #8AB8F8;
  --brandRed: #CB2828;
  --brandMid: #FFFFFF;
  --brandGrey: #7E7A72;
  --shadowSm: 0 1px 2px rgba(0,0,0,.35);
  --shadowMd: 0 8px 24px rgba(0,0,0,.45);
  --shadowLg: 0 24px 64px rgba(0,0,0,.6);
  --overlay: rgba(9,8,7,.62);
  --onStatus: #151412;
}
:root[data-theme="light"] {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface2: #F1EEE8;
  --surface3: #E9E5DD;
  --border: #E2DED6;
  --border2: #CFCAC0;
  --text: #1A1917;
  --text2: #55524C;
  --text3: #6E6A63;
  --ink: #1A1917;
  --inkText: #FFFFFF;
  --crit: #B82323;
  --critBg: #FBE9E7;
  --critFill: #CB2828;
  --warn: #8A5A00;
  --warnBg: #FCF1D8;
  --ok: #1B7A47;
  --okBg: #E2F4E8;
  --mute: #6E6A63;
  --muteBg: #EEEBE4;
  --work: #1D5DB8;
  --workBg: #E3ECFA;
  --pause: #6740B8;
  --pauseBg: #EDE6FA;
  --link: #1A56B8;
  --focus: #1D5DB8;
  --brandRed: #CB2828;
  --brandMid: #141414;
  --brandGrey: #7E7A72;
  --shadowSm: 0 1px 2px rgba(20,20,20,.06);
  --shadowMd: 0 8px 24px rgba(20,20,20,.10);
  --shadowLg: 0 24px 64px rgba(20,20,20,.18);
  --overlay: rgba(26,25,23,.45);
  --onStatus: #FFFFFF;
}
* { box-sizing: border-box; }
body { margin: 0; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; }
:where(body) a { color: inherit; text-decoration: none; }
:where(body) a:hover { color: inherit; }
:where(body) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
.i { flex: none; display: inline-block; vertical-align: -3px; }
.mark { flex: none; display: block; }
.t1 { color: var(--text); } .t2 { color: var(--text2); } .t3 { color: var(--text3); }
.c-crit { color: var(--crit); } .c-warn { color: var(--warn); } .c-ok { color: var(--ok); } .c-mute { color: var(--mute); }
.c-work { color: var(--work); } .c-pause { color: var(--pause); } .c-link { color: var(--link); }
.cap { font-size: 12px; line-height: 16px; } .dense { font-size: 13px; line-height: 18px; }
.w5 { font-weight: 500; } .w6 { font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border2); }
.hint { font-size: 12px; line-height: 16px; color: var(--text3); }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--border2); border-bottom-width: 2px; border-radius: 5px;
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; line-height: 18px; color: var(--text2); background: var(--surface); }

/* ---------- Layout desktop ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); width: 100%; height: 100%; }
.shell.narrow { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); padding: 12px; gap: 4px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 16px; }
.brand .word { font-weight: 700; font-size: 17px; line-height: 20px; letter-spacing: -0.02em; }
.brand .word b { color: var(--brandRed); font-weight: 700; }
.brand .sub { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10px; line-height: 12px; letter-spacing: .14em; color: var(--text3); text-transform: uppercase; }
.brand .collapse { margin-left: auto; color: var(--text3); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--text2); font-weight: 500; }
.nav-item .i { color: var(--text3); }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface2); color: var(--text); }
.nav-item.active .i { color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text); }
.nav-item .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--critFill); color: var(--onStatus); }
.nav-item .count.zero { background: var(--surface3); color: var(--text3); }
.sidebar .spacer { flex: 1; }
.sidebar .foot { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  background: var(--surface3); color: var(--text); border: 1px solid var(--border2); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
.me .name { font-weight: 500; line-height: 16px; } .me .role { font-size: 12px; line-height: 14px; color: var(--text3); }
.me .out { margin-left: auto; color: var(--text3); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar { position: sticky; top: 0; z-index: 3; height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--bg); }
.org { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--text2); }
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text3); height: 28px; }
.live .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 3px var(--okBg); }
.live.stale .dot { background: var(--mute); box-shadow: 0 0 0 3px var(--muteBg); }
.searchbtn { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text3); min-width: 240px; }
.searchbtn .kbd { margin-left: auto; }
.page { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; }
.page-head .grow { flex: 1; min-width: 0; }
.h1 { margin: 0; font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.lede { margin: 4px 0 0; color: var(--text2); }
.h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.h2 .n { color: var(--text3); font-weight: 400; font-size: 14px; }
.sect { display: flex; flex-direction: column; gap: 12px; }
.sect-head { display: flex; align-items: center; gap: 12px; }
.sect-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--text2); font-size: 13px; line-height: 18px; }
.meta .mono { color: var(--text2); }
.tagchip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--text2); }
.footer { margin-top: 8px; color: var(--text3); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Bottoni: tre livelli ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; line-height: 1; }
.btn.primary { background: var(--ink); color: var(--inkText); }
.btn.primary:hover { filter: brightness(.94); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border2); }
.btn.secondary:hover { background: var(--surface2); }
.btn.ghost { background: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--surface2); color: var(--text); }
.btn.danger { background: var(--critFill); color: var(--onStatus); }
.btn.danger-ghost { color: var(--crit); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn .i { color: inherit; }
.btn.secondary .i { color: var(--text2); }
.btn.tall { height: 44px; padding: 0 16px; }
.btn:focus-visible, .input:focus-visible, .nav-item:focus-visible, .row-head:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn.loading { opacity: .7; pointer-events: none; }
.spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; }

/* ---------- Badge di stato: forma + parola + colore ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 6px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.badge .i { width: 14px; height: 14px; }
.badge.crit { color: var(--crit); background: var(--critBg); }
.badge.warn { color: var(--warn); background: var(--warnBg); }
.badge.ok { color: var(--ok); background: var(--okBg); }
.badge.mute { color: var(--mute); background: var(--muteBg); border: 1px dashed var(--mute); }
.badge.work { color: var(--work); background: var(--workBg); }
.badge.pause { color: var(--pause); background: var(--pauseBg); }
.badge.done { color: var(--ok); background: transparent; border: 1px solid var(--ok); }
.badge.info { color: var(--work); background: var(--workBg); }
.badge.neutral { color: var(--text2); background: var(--surface2); border: 1px solid var(--border); font-weight: 500; }
.badge.solid.crit { background: var(--critFill); color: var(--onStatus); }
.badge.lg { height: 28px; font-size: 13px; padding: 0 10px 0 8px; }
.badge.lg .i { width: 16px; height: 16px; }
.badge.sq { border-radius: 6px; }
.env { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; font-weight: 500; border: 1px solid var(--border2); color: var(--text); }
.env.prod { border-color: var(--text2); }
.env.staging { color: var(--warn); border-color: var(--warn); }
.env.dev { color: var(--work); border-color: var(--work); }
.env.arch { color: var(--pause); border-color: var(--pause); }
.env.off { color: var(--text3); border-style: dashed; }
.sig { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sig .i { width: 14px; height: 14px; }

/* ---------- Banda di stato (regione viva: altezza fissa) ---------- */
.band { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.band > * { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 112px; min-width: 0; }
.band > * + * { border-left: 1px solid var(--border); }
.band .lead { display: flex; align-items: center; gap: 16px; }
.band .glyph { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.band .glyph.crit { background: var(--critBg); color: var(--crit); }
.band .glyph.warn { background: var(--warnBg); color: var(--warn); }
.band .glyph.ok { background: var(--okBg); color: var(--ok); }
.band .glyph.mute { background: var(--muteBg); color: var(--mute); border: 2px dashed var(--mute); }
.band .glyph.pause { background: var(--pauseBg); color: var(--pause); }
.band .title { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.band .sub { color: var(--text2); font-size: 13px; line-height: 18px; }
.band .k { font-size: 12px; line-height: 16px; color: var(--text3); font-weight: 500; }
.band .v { font-size: 26px; line-height: 30px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.band .v .badge { font-size: 12px; }
.band a.cell:hover { background: var(--surface2); }
.band.mute-band { border-style: dashed; border-color: var(--mute); }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.kpi .k { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--text3); font-weight: 500; }
.kpi .v { font-size: 22px; line-height: 26px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .v .i { width: 18px; height: 18px; }
.kpi .s { font-size: 12px; line-height: 16px; color: var(--text2); }
.kpi.crit { border-color: var(--crit); } .kpi.crit .v { color: var(--crit); }
.kpi.warn { border-color: var(--warn); } .kpi.warn .v { color: var(--warn); }
.kpi.mute { border-style: dashed; border-color: var(--mute); } .kpi.mute .v { color: var(--mute); }
.kpi.big .v { font-size: 30px; line-height: 34px; }
.signals { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; color: var(--text2); font-size: 13px; line-height: 18px; }
.signals a { display: inline-flex; align-items: center; gap: 6px; }
.signals b { font-weight: 600; color: var(--text); }
.signals .i { color: var(--text3); }

/* ---------- Righe espandibili ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.row.crit { border-left: 3px solid var(--crit); } .row.warn { border-left: 3px solid var(--warn); } .row.mute { border-left: 3px dashed var(--mute); }
.row.next { border-color: var(--border2); box-shadow: var(--shadowMd); }
.row-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px 10px 14px; width: 100%; text-align: left; }
.rh-main { display: grid; grid-template-columns: 24px 128px minmax(0, 1fr); align-items: center; gap: 14px; width: 100%; text-align: left; min-width: 0; min-height: 40px; }
.rh-main.nobadge { grid-template-columns: 24px minmax(0, 1fr); }
.row-head .chev { color: var(--text3); }
.row-head .who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.row-head .ttl { font-weight: 600; font-size: 15px; line-height: 20px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.row-head .ttl .ip { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 400; font-size: 13px; color: var(--text3); }
.row-head .ttl .sep { color: var(--text3); font-weight: 400; }
.row-head .det { color: var(--text2); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-head .det b { color: var(--text); font-weight: 500; }
.row-head .acts { display: flex; align-items: center; gap: 8px; }
.row-head .since { color: var(--text3); font-size: 12px; white-space: nowrap; }
.row-body { border-top: 1px solid var(--border); padding: 16px 20px 20px 51px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.row-body h4 { margin: 0; font-size: 12px; line-height: 16px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.row-body p { margin: 0; color: var(--text2); }
.row-body p b { color: var(--text); font-weight: 500; }
.row-body code, .meta code, .p code { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text); }
.raw { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; line-height: 18px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; max-height: 92px; overflow: hidden; position: relative; }
.raw.open { max-height: none; }
.cmds { display: flex; flex-direction: column; gap: 6px; }
.cmd { display: flex; align-items: center; gap: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 6px 6px 12px; font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.cmd span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story { display: flex; gap: 24px; flex-wrap: wrap; color: var(--text2); font-size: 13px; }
.story b { color: var(--text); font-weight: 500; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.group-head .ttl { font-weight: 600; font-size: 15px; }
.group-head .n { color: var(--text3); font-size: 13px; }
.group-head .right { margin-left: auto; font-size: 13px; color: var(--text3); }

/* ---------- Tabelle ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tbl th { text-align: left; font-size: 11px; line-height: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13.5px; line-height: 18px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.link:hover td { background: var(--surface2); }
.tbl .num { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.tbl .name { font-weight: 600; font-size: 14px; }
.tbl .sub { color: var(--text3); font-size: 12px; line-height: 16px; font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.tbl .r { text-align: right; }
.tbl .ico { width: 44px; }
.cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell .i { width: 14px; height: 14px; }
.cell.crit { color: var(--crit); font-weight: 600; } .cell.warn { color: var(--warn); font-weight: 600; } .cell.ok { color: var(--text2); } .cell.mute { color: var(--mute); }
.tbl .sub-row td { background: var(--surface2); color: var(--text2); font-size: 13px; padding-top: 6px; padding-bottom: 8px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .right { margin-left: auto; color: var(--text3); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border2); color: var(--text2); font-size: 13px; font-weight: 500; background: var(--surface); }
.chip.on { background: var(--ink); color: var(--inkText); border-color: var(--ink); }
.chip .n { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; opacity: .8; }
.chip.warn { color: var(--warn); border-color: var(--warn); } .chip.crit { color: var(--crit); border-color: var(--crit); }
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button, .seg a { height: 30px; padding: 0 12px; border-radius: 6px; color: var(--text2); font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadowSm); }
.seg .n { color: var(--text3); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }

/* ---------- Card e liste di dettaglio ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.card.quiet { background: transparent; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head .ttl { font-weight: 600; font-size: 15px; }
.card-head .n { color: var(--text3); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--text3); font-size: 12px; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; line-height: 18px; }
.dl dt { color: var(--text3); margin: 0; } .dl dd { margin: 0; color: var(--text); }
.dl dd .mono { font-size: 12.5px; }
.checks { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.checks > div { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 18px; display: flex; align-items: center; gap: 6px; }
.checks > div:nth-last-child(-n+2) { border-bottom: 0; }
.checks > div:nth-child(odd) { color: var(--text3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--surface2); }
.linkcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.linkcard .lg { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text2); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; font-weight: 600; flex: none; }
.linkcard .b { min-width: 0; flex: 1; } .linkcard .b .t { font-weight: 600; } .linkcard .b .s { color: var(--text3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkcard .i.ext { color: var(--text3); }
.acc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.acc-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; width: 100%; text-align: left; }
.acc-head .n { color: var(--text3); font-weight: 400; font-size: 13px; }
.acc-head .right { margin-left: auto; color: var(--text3); font-size: 13px; font-weight: 400; }
.acc-body { border-top: 1px solid var(--border); padding: 16px; }

/* ---------- Menu Altro ---------- */
.menu { width: 260px; background: var(--surface); border: 1px solid var(--border2); border-radius: 10px; box-shadow: var(--shadowMd); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu .mi { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 6px; width: 100%; text-align: left; }
.menu .mi:hover { background: var(--surface2); }
.menu .mi .i { color: var(--text3); }
.menu .mi .hint { margin-left: auto; }
.menu .mi.danger { color: var(--crit); } .menu .mi.danger .i { color: var(--crit); }
.menu .sep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu .lab { padding: 8px 10px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); font-weight: 600; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; line-height: 18px; font-weight: 500; }
.label .opt { color: var(--text3); font-weight: 400; }
.input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border2); background: var(--surface); color: var(--text); display: flex; align-items: center; gap: 8px; min-width: 0; }
.input.ph { color: var(--text3); }
.input .bare { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 0; color: inherit; font: inherit; height: 100%; }
.input textarea.bare { resize: vertical; height: auto; }
.input .bare::placeholder { color: var(--text3); }
.input .endb { margin-left: auto; color: var(--text3); display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 6px; }
.input.err { border-color: var(--crit); box-shadow: 0 0 0 3px var(--critBg); }
.input.focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--workBg); }
.input.tall { height: 44px; }
.input.area { height: auto; min-height: 88px; align-items: flex-start; padding: 10px 12px; }
.input .i.end { margin-left: auto; color: var(--text3); }
.help { font-size: 12px; line-height: 16px; color: var(--text3); }
.ferr { font-size: 12px; line-height: 16px; color: var(--crit); display: flex; align-items: center; gap: 6px; }
.frow { display: grid; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check .box { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border2); background: var(--surface); }
.check .box.on { background: var(--ink); border-color: var(--ink); color: var(--inkText); display: inline-flex; align-items: center; justify-content: center; }
.toggle { width: 36px; height: 20px; border-radius: 999px; background: var(--border2); position: relative; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--surface); }
.toggle.on { background: var(--ok); } .toggle.on::after { left: 18px; }
.radio-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Banner ---------- */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); }
.banner .i { margin-top: 2px; }
.banner .b { flex: 1; min-width: 0; } .banner .b b { font-weight: 600; }
.banner .b p { margin: 0; color: var(--text2); font-size: 13px; line-height: 18px; }
.banner .act { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.banner.info { background: var(--workBg); border-color: transparent; } .banner.info .i { color: var(--work); }
.banner.warn { background: var(--warnBg); border-color: transparent; } .banner.warn .i { color: var(--warn); }
.banner.crit { background: var(--critBg); border-color: transparent; } .banner.crit .i { color: var(--crit); }
.banner.mute { background: var(--muteBg); border: 1px dashed var(--mute); } .banner.mute .i { color: var(--mute); }
.banner.pause { background: var(--pauseBg); border-color: transparent; } .banner.pause .i { color: var(--pause); }
.banner.ok { background: var(--okBg); border-color: transparent; } .banner.ok .i { color: var(--ok); }
.newpill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: var(--inkText); font-size: 13px; font-weight: 500; box-shadow: var(--shadowMd); }

/* ---------- Stati vuoti, caricamento ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; border: 1px dashed var(--border2); border-radius: 10px; color: var(--text2); }
.empty .i { color: var(--text3); width: 28px; height: 28px; }
.empty .t { font-weight: 600; color: var(--text); font-size: 15px; }
.empty .acts { display: flex; gap: 8px; margin-top: 6px; }
.sk { background: var(--surface3); border-radius: 6px; }
.sk.line { height: 12px; } .sk.text { height: 16px; }
.sk-row { display: grid; grid-template-columns: 24px 128px 1fr auto; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 60px; }

/* ---------- Palette di ricerca ---------- */
.overlay { position: absolute; inset: 0; z-index: 6; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding-top: 96px; }
.palette { width: 640px; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: var(--shadowLg); overflow: hidden; }
.palette .in { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border-bottom: 1px solid var(--border); font-size: 16px; }
.palette .in .i { color: var(--text3); }
.palette .in .q { flex: 1; } .palette .in .q .caret { display: inline-block; width: 1px; height: 18px; background: var(--text); vertical-align: -3px; margin-left: 1px; }
.palette .grp { padding: 10px 12px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); font-weight: 600; }
.palette .res { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 14px; min-height: 48px; margin: 0 6px; border-radius: 8px; }
.palette .res.on { background: var(--surface2); }
.palette .res .i { color: var(--text3); }
.palette .res .t { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.palette .res .s { color: var(--text3); font-size: 12px; }
.palette .res .kind { font-size: 11px; color: var(--text3); font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; text-transform: uppercase; letter-spacing: .06em; }
.palette .foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); color: var(--text3); font-size: 12px; }

/* ---------- Dialog di conferma ---------- */
.dialog { width: 480px; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: var(--shadowLg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog .t { font-size: 18px; line-height: 24px; font-weight: 600; }
.dialog p { margin: 0; color: var(--text2); }
.dialog p b { color: var(--text); font-weight: 500; }
.dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border2); border-radius: 16px 16px 0 0; padding: 12px 16px 24px; box-shadow: var(--shadowLg); display: flex; flex-direction: column; gap: 6px; }
.sheet .grab { width: 36px; height: 4px; border-radius: 4px; background: var(--border2); margin: 0 auto 8px; }
.sheet .mi { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 8px; border-radius: 8px; font-size: 15px; width: 100%; text-align: left; }
.sheet .mi .i { color: var(--text3); }
.sheet .mi.danger { color: var(--crit); } .sheet .mi.danger .i { color: var(--crit); }
.sheet .sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- Accesso ---------- */
.auth { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.auth .side { background: var(--surface); border-right: 1px solid var(--border); padding: 40px; display: flex; flex-direction: column; }
.auth .side .peaks { margin: auto 0; display: flex; flex-direction: column; gap: 20px; }
.auth .side .claim { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; max-width: 440px; }
.auth .side .sub { color: var(--text2); max-width: 420px; }
.auth .form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth .box { width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; }
.auth .foot { color: var(--text3); font-size: 13px; }
.auth .foot a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sparkline ---------- */
.spark { display: block; }
.trend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.trend .tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.trend .tcard .k { font-size: 12px; color: var(--text3); font-weight: 500; display: flex; justify-content: space-between; }
.trend .tcard .v { font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.ev { display: grid; grid-template-columns: 56px 120px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.ev:last-child { border-bottom: 0; }
.ev .t { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; color: var(--text3); }
.ev .what b { font-weight: 600; } .ev .what .d { color: var(--text2); }
.ev .what .srv { color: var(--text2); }
.day { font-weight: 600; font-size: 13px; color: var(--text2); padding: 12px 2px 6px; display: flex; gap: 8px; align-items: baseline; }
.day .n { color: var(--text3); font-weight: 400; }

/* ---------- Telefono ---------- */

/* ---------- Telefono: le stesse regole delle tavole, in media query ---------- */
@media (max-width: 720px) {
  .mtop { position: sticky; top: 0; z-index: 3; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .mtop .ttl { font-weight: 600; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtop .ib { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text2); }
  .mpage { padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 20px; }
  .tabbar { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 76px; padding: 6px 4px 14px; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; font-size: 11px; font-weight: 500; color: var(--text3); position: relative; border-radius: 8px; }
  .tabbar .on { color: var(--text); }
  .tabbar .cnt { position: absolute; top: 2px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--critFill); color: var(--onStatus); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
  .band { grid-template-columns: 1fr; }
  .band > * { min-height: 0; padding: 16px; }
  .band > * + * { border-left: 0; border-top: 1px solid var(--border); }
  .band .title { font-size: 18px; line-height: 24px; }
  .band .v { font-size: 22px; line-height: 26px; }
  .band .cells { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
  .band .cells > * { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .band .cells > * + * { border-left: 1px solid var(--border); border-top: 0; }
  .row-head { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .rh-main { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .row-head .det { white-space: normal; }
  .row-head .acts { padding-top: 6px; }
  .row-head .acts .btn { height: 44px; flex: 1; }
  .row-head .acts .btn.icon { flex: none; width: 44px; }
  .row-head .top { display: flex; align-items: center; gap: 8px; }
  .row-head .top .since { margin-left: auto; }
  .row-body { padding: 16px; }
  .h1 { font-size: 22px; line-height: 28px; }
  .btn { height: 44px; }
  .btn.sm { height: 36px; }
  .chip { height: 36px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .signals { gap: 8px 16px; }
  .mrow { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 64px; }
  .mrow .ttl { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .mrow .ttl .ip { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 400; font-size: 12px; color: var(--text3); }
  .mrow .det { color: var(--text2); font-size: 13px; line-height: 18px; }
  .mrow .chev { color: var(--text3); }
  .mrow.crit { border-left: 3px solid var(--crit); } .mrow.warn { border-left: 3px solid var(--warn); } .mrow.mute { border-left: 3px dashed var(--mute); }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fact { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .fact .k { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
  .fact .v { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
  .drawer { position: absolute; top: 0; bottom: 0; left: 0; width: 300px; background: var(--surface); border-right: 1px solid var(--border2); box-shadow: var(--shadowLg); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
  .nav-item { height: 48px; font-size: 15px; }
  .tbl td { padding: 10px 12px; }
  .ev { grid-template-columns: 48px minmax(0, 1fr); }
  .ev .srv { display: block; font-size: 12px; }
  .filters .chip { height: 40px; }
  .dl { grid-template-columns: 96px minmax(0, 1fr); }
  .trend { grid-template-columns: 1fr 1fr; }
  .checks { grid-template-columns: 84px minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth .form { padding: 24px 20px; align-items: flex-start; }
  .auth .box { width: 100%; }
  .palette { width: 100%; border-radius: 0; border: 0; height: 100%; }
  .overlay { padding: 0; }
  .dialog { width: auto; margin: auto 16px; }
  .footer { justify-content: center; }
}

[hidden] { display: none !important; }
/* ---------- Layout dell'app reale ---------- */
.shell { min-height: 100vh; height: auto; }
.sidebar { position: sticky; top: 0; height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 3; }
.overlay { position: fixed; }
.sheet, .drawer { position: fixed; }
.tabbar { position: fixed; }
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { display: none; }
  .page { padding: 16px 16px 96px; gap: 20px; }
}
@media (min-width: 721px) { .mtop, .tabbar { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .row.changed { animation: m3flash 1.6s ease-out 1; }
  @keyframes m3flash { 0% { box-shadow: inset 4px 0 0 var(--work); } 100% { box-shadow: inset 4px 0 0 transparent; } }
  .newpill { animation: m3pop .2s ease-out 1; }
  @keyframes m3pop { from { transform: translate(-50%, -8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
  .spin { animation: m3spin .8s linear infinite; }
  @keyframes m3spin { to { transform: rotate(360deg); } }
}
.row.gone { opacity: .45; }
.row.gone .ttl { text-decoration: line-through; }
.live-pill { position: sticky; top: 64px; z-index: 4; display: flex; justify-content: center; height: 0; overflow: visible; }
.live-pill .newpill { position: relative; left: 0; transform: none; }

/* ---------- Grafici (charts.js) ---------- */
.chart { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.chart .chart-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.chart .chart-head .k { color: var(--text3); font-weight: 500; }
.chart .chart-head .v { margin-left: auto; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--text3); font-size: 11px; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s0 { stroke: var(--work); } .chart .line.s1 { stroke: var(--pause); } .chart .line.s2 { stroke: var(--text2); } .chart .line.s3 { stroke: var(--ok); }
.chart .line.crit { stroke: var(--crit); } .chart .line.warn { stroke: var(--warn); }
.chart .thr line { stroke: var(--crit); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .thr text { fill: var(--crit); font-size: 11px; font-weight: 600; }
.chart .thr.warn line { stroke: var(--warn); } .chart .thr.warn text { fill: var(--warn); }
.chart .last { stroke: var(--surface); stroke-width: 2; }
.chart .cross line { stroke: var(--text3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; box-shadow: var(--shadowMd); padding: 6px 10px; font-size: 12px; line-height: 16px; white-space: nowrap; z-index: 2; }
.chart .tip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.chart .legend .sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; }
.chart .empty-line { color: var(--text3); font-size: 13px; padding: 24px 0; text-align: center; }
.chart .win { display: inline-flex; gap: 2px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 2px; }
.chart .win button { height: 24px; padding: 0 8px; border-radius: 4px; font-size: 12px; color: var(--text2); font-weight: 500; }
.chart .win button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadowSm); }
.chart.tile .chart-head .v { font-size: 22px; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sla-bar { height: 8px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.sla-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.sla-bar.warn > span { background: var(--warn); } .sla-bar.crit > span { background: var(--crit); }
