/* Console operatore 2TICK. Palette ricavata dal pannello 2Tick Professionisti. Nessun font o risorsa esterna. */
:root {
  --navy: #1f3850; --navy-dark: #1a2c3d; --primary: #005377; --primary-subtle: #eaf0f6;
  --teal: #03a7c2; --green: #2e8b57; --green-bg: #e6f4ec; --danger: #b3261e; --danger-bg: #fdecea;
  --warn: #8a5a00; --warn-bg: #fff4d6; --text: #1f2933; --muted: #5b6770; --line: #dde3e8;
  --surface: #fff; --bg: #f4f6f8; --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* le regole di display non devono battere l'attributo hidden */
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; } h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* Pulsanti e campi */
.btn { border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 999px; padding: 7px 18px; font-weight: 600; }
.btn:hover { background: var(--primary); border-color: var(--primary); } .btn[disabled] { opacity: .55; cursor: wait; }
.btn-ghost { background: transparent; color: var(--navy); } .btn-ghost:hover { background: var(--primary-subtle); color: var(--navy); border-color: var(--navy); }
.btn-small { padding: 3px 12px; font-size: 13px; }
.field { margin-bottom: 14px; } .field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #b8c2cc; background: #fff; border-radius: 6px; padding: 8px 10px; font: inherit; color: inherit; }
.field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 3px; } .field .err { font-size: 12px; color: var(--danger); margin-top: 3px; font-weight: 600; }
.field .ok { font-size: 12px; color: var(--green); margin-top: 3px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.alert { border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; border: 1px solid; }
.alert-err { background: var(--danger-bg); border-color: #f0b4af; color: #7a1a14; } .alert-warn { background: var(--warn-bg); border-color: #ecd28c; color: #5c3d00; }
.alert-ok { background: var(--green-bg); border-color: #a6d4b8; color: #1d5a3a; }

/* Accesso */
.login { min-height: 100vh; display: grid; place-items: center; background: #21516f; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.login-card img { width: 34px; display: block; margin: 0 auto 6px; } .login-card h1 { text-align: center; margin-bottom: 18px; }

/* Struttura */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; font-size: 19px; font-weight: 700; }
.brand img { width: 28px; } .brand small { display: block; font-size: 11px; font-weight: 400; opacity: .75; }
.nav a { display: block; color: #dbe6f0; padding: 10px 20px; border-left: 3px solid transparent; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; } .nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--teal); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 14px 20px; font-size: 12px; opacity: .8; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.content { padding: 24px; max-width: 1320px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .cols .card { margin-bottom: 0; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; } .cols3 .card { margin-bottom: 0; }

/* Indicatori */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .v { font-size: 24px; font-weight: 700; color: var(--navy); } .kpi .l { font-size: 12px; color: var(--muted); } .kpi .s { font-size: 12px; margin-top: 2px; color: var(--muted); }
.kpi.alert-kpi .v { color: var(--danger); }

/* Tabelle */
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: #fafbfc; white-space: nowrap; } tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; } tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--primary-subtle); }
.badge { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.b-demo { background: #e7e3f5; color: #4a3b8c; } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-err { background: var(--danger-bg); color: var(--danger); } .b-ok { background: var(--green-bg); color: var(--green); }

/* Barre */
.bar { height: 8px; background: #e8edf1; border-radius: 99px; overflow: hidden; min-width: 70px; } .bar > i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.bar.warn > i { background: #d98e00; } .bar.over > i { background: var(--danger); }
.cell2 { display: grid; gap: 3px; min-width: 120px; }
.hrow { display: grid; grid-template-columns: minmax(80px, 150px) minmax(50px, 1fr) auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; } .hrow .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hrow > .num { white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
svg.chart { width: 100%; height: auto; display: block; } svg.chart text { font-size: 10px; fill: #5b6770; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; } dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; }
.empty { color: var(--muted); padding: 14px; text-align: center; }

/* Finestre */
.overlay { position: fixed; inset: 0; background: rgba(15,30,45,.55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { background: #fff; border-radius: var(--radius); padding: 22px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; }
.secret { font: 600 18px ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f4f7; border: 1px dashed #8fa0b0; padding: 10px 14px; border-radius: 6px; letter-spacing: .04em; display: inline-block; user-select: all; }
ol.steps { padding-left: 20px; margin: 0; } ol.steps li { margin-bottom: 8px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; } .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; } .nav { display: flex; } .sidebar-foot { display: none; }
  .cols, .cols3, .grid2, .grid3 { grid-template-columns: 1fr; } .content { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .4s; } }
