/* ============================================================
 * INFORISK — stile applicativo
 * Layout: sidebar fissa + topbar + contenuto. Tutti i colori sono
 * variabili CSS: per adottare il template Zenith Dashboard basta
 * rimappare le variabili o sostituire questo file.
 * Tipografia: Titillium Web (font del design system della PA italiana).
 * ============================================================ */
:root {
  --ssl-primary: #0066cc;
  --ssl-primary-dark: #004d99;
  --ssl-ink: #17324d;
  --ssl-sidebar: #17324d;
  --ssl-sidebar-ink: #c5d3e2;
  --ssl-sidebar-active: #0066cc;
  --ssl-bg: #f2f5f8;
  --ssl-surface: #ffffff;
  --ssl-line: #dde4ec;
  --ssl-muted: #5c6f82;
  --ssl-radius: 6px;
  --sidebar-w: 256px;
  --bs-primary: var(--ssl-primary);
  --bs-primary-rgb: 0, 102, 204;
  --bs-link-color: var(--ssl-primary);
  --bs-link-color-rgb: 0, 102, 204;
  --bs-body-font-family: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  --bs-body-color: var(--ssl-ink);
  --bs-border-radius: var(--ssl-radius);
}
body { background: var(--ssl-bg); font-size: 0.95rem; }
.btn-primary { --bs-btn-bg: var(--ssl-primary); --bs-btn-border-color: var(--ssl-primary); --bs-btn-hover-bg: var(--ssl-primary-dark); --bs-btn-hover-border-color: var(--ssl-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--ssl-primary); --bs-btn-border-color: var(--ssl-primary); --bs-btn-hover-bg: var(--ssl-primary); --bs-btn-hover-border-color: var(--ssl-primary); }
:focus-visible { outline: 2px solid #ff9900; outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--ssl-sidebar); color: var(--ssl-sidebar-ink);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex; align-items: center; gap: .75rem;
  background: var(--ssl-surface); border-bottom: 1px solid var(--ssl-line);
  padding: .6rem 1.5rem; position: sticky; top: 0; z-index: 1020;
}
.app-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: .75rem 1.5rem; font-size: .8rem; color: var(--ssl-muted); border-top: 1px solid var(--ssl-line); }

/* ---------- Sidebar ---------- */
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--ssl-primary); color: #fff; font-size: 1.25rem; }
.brand-name { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand-sub { display: block; font-size: .78rem; opacity: .75; }
.sidebar-nav { padding: .5rem .75rem 2rem; }
.nav-section { font-size: .78rem; font-weight: 600; color: #8ea5bd; padding: 1rem .75rem .35rem; }
.app-sidebar .nav-link {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem; border-radius: var(--ssl-radius);
  color: var(--ssl-sidebar-ink); text-decoration: none;
}
.app-sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-sidebar .nav-link.active { background: var(--ssl-sidebar-active); color: #fff; font-weight: 600; }
.app-sidebar .nav-link.disabled { opacity: .45; cursor: default; }

/* ---------- Topbar ---------- */
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; font-size: 1.2rem; color: var(--ssl-ink); }
.btn-icon:hover { background: var(--ssl-bg); }
.notif-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d9364f; color: #fff; font-size: .68rem; line-height: 18px; font-weight: 700; }
.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.notif-item { display: block; padding: .6rem 1rem; border-bottom: 1px solid var(--ssl-line); text-decoration: none; color: inherit; font-size: .85rem; }
.notif-item.unread { background: #eef5fc; }
.notif-item:hover { background: var(--ssl-bg); }
.user-chip { display: flex; align-items: center; gap: .5rem; border: 0; padding: .25rem .5rem; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e1ecf7; color: var(--ssl-primary-dark); font-weight: 700; font-size: .85rem; }
.user-role { font-size: .75rem; color: var(--ssl-muted); }

/* ---------- Componenti ---------- */
.card { border-color: var(--ssl-line); }
.card-header { background: var(--ssl-surface); font-weight: 600; }
.panel-title { font-size: 1rem; font-weight: 700; margin: 0; }
.kpi { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; background: var(--ssl-surface); border: 1px solid var(--ssl-line); border-left: 4px solid var(--kpi-c, var(--ssl-primary)); border-radius: var(--ssl-radius); text-decoration: none; color: inherit; height: 100%; }
.kpi:hover { border-color: var(--kpi-c, var(--ssl-primary)); }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: .85rem; color: var(--ssl-muted); }
.kpi i { font-size: 1.5rem; color: var(--kpi-c, var(--ssl-primary)); }
.kpi.c-danger { --kpi-c: #d9364f; } .kpi.c-warning { --kpi-c: #cc7a00; } .kpi.c-success { --kpi-c: #008055; } .kpi.c-info { --kpi-c: #0073a8; }
.table > :not(caption) > * > * { padding: .55rem .6rem; }
.table thead th { font-size: .8rem; font-weight: 600; color: var(--ssl-muted); background: #f7f9fb; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ssl-muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.dl-grid dt { color: var(--ssl-muted); font-weight: 400; }
.dl-grid dd { margin: 0; }
.pre-line { white-space: pre-line; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1rem; max-height: 260px; overflow-y: auto; padding: .5rem .75rem; border: 1px solid var(--ssl-line); border-radius: var(--ssl-radius); background: #fff; }
.week-grid { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: .75rem; overflow-x: auto; }
.week-day { background: var(--ssl-surface); border: 1px solid var(--ssl-line); border-radius: var(--ssl-radius); min-height: 200px; }
.week-day.today { border-color: var(--ssl-primary); }
.week-day-head { padding: .5rem .75rem; border-bottom: 1px solid var(--ssl-line); font-weight: 600; font-size: .9rem; }
.appt { margin: .5rem; padding: .45rem .6rem; border-radius: 4px; border-left: 3px solid var(--appt-c, var(--ssl-primary)); background: #f4f8fc; font-size: .82rem; }
.appt.s-proposto { --appt-c: #0073a8; background: #eef7fb; }
.appt.s-confermato { --appt-c: #0066cc; }
.appt.s-completato { --appt-c: #008055; background: #eef8f3; }
.appt.s-no_show { --appt-c: #d9364f; background: #fcf0f2; }
.appt.s-annullato { --appt-c: #8ea5bd; background: #f5f7f9; text-decoration: line-through; }
.slot-free { font-size: .75rem; color: var(--ssl-muted); padding: 0 .75rem .5rem; }

/* ---------- Brand ---------- */
.brand-logo { width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; }
.sidebar-brand .brand-name { letter-spacing: .06em; }

/* ---------- Login ---------- */
.auth { background: #f4f7fa; min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; display: flex;
  background:
    radial-gradient(700px 420px at 110% -10%, rgba(26,140,255,.45), transparent 60%),
    radial-gradient(520px 380px at -10% 110%, rgba(0,82,163,.75), transparent 65%),
    linear-gradient(160deg, #0f2a44 0%, #123a63 55%, #0b4d8c 100%);
}
.auth-aside::before { /* trama a griglia molto leggera */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.auth-aside-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2.5rem; padding: 3rem clamp(2rem, 5vw, 4.5rem); width: 100%; max-width: 680px; margin-left: auto; }
.auth-logo { display: flex; align-items: center; gap: .85rem; }
.auth-logo img { border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.auth-logo-name { font-weight: 700; font-size: 1.45rem; letter-spacing: .09em; line-height: 1; }
.auth-logo-sub { font-size: .85rem; opacity: .75; margin-top: .25rem; }
.auth-claim { margin-top: auto; }
.auth-eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #7fd4ff; margin-bottom: .75rem; }
.auth-claim h2 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); font-weight: 700; line-height: 1.15; margin: 0 0 1rem; max-width: 18ch; }
.auth-lead { font-size: 1.05rem; line-height: 1.55; color: rgba(255,255,255,.82); max-width: 46ch; margin: 0; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-features li { display: flex; gap: .9rem; align-items: flex-start; }
.auth-feat-icon { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #bfe6ff; }
.auth-features strong { display: block; font-size: .98rem; }
.auth-features div > span { display: block; font-size: .87rem; color: rgba(255,255,255,.72); line-height: 1.45; }
.auth-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); }
.auth-badges span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo-mobile { display: none; color: var(--ssl-ink); margin-bottom: 2rem; }
.auth-logo-mobile .auth-logo-sub { color: var(--ssl-muted); opacity: 1; }
.auth-title { font-size: 1.85rem; font-weight: 700; margin: 0 0 .35rem; color: var(--ssl-ink); }
.auth-subtitle { color: var(--ssl-muted); margin-bottom: 1.75rem; }
.auth-field { margin-bottom: 1.1rem; }
.auth-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ssl-ink); }
.auth-input { position: relative; display: flex; align-items: center; background: #fff; border: 1px solid #c9d3dc; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.auth-input:focus-within { border-color: var(--ssl-primary); box-shadow: 0 0 0 4px rgba(0,102,204,.14); }
.auth-input.is-invalid { border-color: #d03b3b; }
.auth-input > i { position: absolute; left: .9rem; color: #7d8fa1; font-size: 1.05rem; pointer-events: none; }
.auth-input input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .78rem .9rem .78rem 2.6rem; font-size: 1rem; border-radius: 10px; color: var(--ssl-ink); }
.auth-input input:focus { outline: none; }
.auth-eye { border: 0; background: transparent; color: #5c6f82; width: 44px; height: 44px; border-radius: 8px; margin-right: .15rem; font-size: 1.1rem; }
.auth-eye:hover { color: var(--ssl-primary); background: #eef4fa; }
.auth-err { color: #b02a2a; font-size: .82rem; margin-top: .35rem; }
.auth-caps { color: #8a5a00; font-size: .82rem; margin-top: .35rem; }
.auth-submit { width: 100%; padding: .8rem 1rem; font-size: 1.02rem; font-weight: 600; border-radius: 10px; margin-top: .5rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.auth-alert { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1.25rem; }
.auth-alert i { margin-top: .1rem; }
.auth-alert-error { background: #fdecec; color: #8f1f1f; border: 1px solid #f5c6c6; }
.auth-alert-info { background: #e8f2fc; color: #0b4d8c; border: 1px solid #c5ddf5; }
.auth-help { font-size: .86rem; color: var(--ssl-muted); margin: 1.5rem 0 0; display: flex; gap: .45rem; line-height: 1.45; }
.auth-help i { margin-top: .1rem; }
.auth-demo { margin-top: 1.5rem; border: 1px dashed #b9c7d4; border-radius: 12px; padding: .75rem 1rem; background: #fff; }
.auth-demo summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ssl-primary-dark); list-style: none; display: flex; align-items: center; gap: .45rem; }
.auth-demo summary::-webkit-details-marker { display: none; }
.auth-demo summary::after { content: "\F282"; font-family: bootstrap-icons; margin-left: auto; transition: transform .15s; }
.auth-demo[open] summary::after { transform: rotate(180deg); }
.auth-demo p { font-size: .8rem; color: var(--ssl-muted); margin: .6rem 0; }
.auth-demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.auth-demo-btn { display: flex; align-items: center; gap: .55rem; text-align: left; border: 1px solid var(--ssl-line); background: #f8fafc; border-radius: 9px; padding: .5rem .65rem; color: var(--ssl-ink); }
.auth-demo-btn:hover { border-color: var(--ssl-primary); background: #eef5fc; }
.auth-demo-btn i { color: var(--ssl-primary); font-size: 1.1rem; }
.auth-demo-btn strong { display: block; font-size: .85rem; }
.auth-demo-btn small { display: block; font-size: .72rem; color: var(--ssl-muted); line-height: 1.2; }
.auth-foot { display: flex; flex-direction: column; gap: .2rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--ssl-line); font-size: .78rem; color: var(--ssl-muted); }

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-logo-mobile { display: flex; }
  .auth-main { align-items: flex-start; padding: 2.5rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { .auth-input { transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: 0; top: 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s ease; }
  .app.sidebar-open .app-sidebar { transform: none; }
  .sidebar-backdrop { display: none; }
  .app.sidebar-open ~ .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1040; }
  .app-content { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .app-sidebar { transition: none; } }

/* ---------- Stampa ---------- */
@media print {
  .app-sidebar, .app-topbar, .app-footer, .no-print, .dataTables_filter, .dataTables_length, .dataTables_paginate { display: none !important; }
  .app-content { padding: 0; }
  body { background: #fff; }
}

/* ============================================================
 * Dashboard
 * ============================================================ */
:root {
  --st-good: #0ca30c; --st-good-ink: #006300;
  --st-warning: #fab219; --st-warning-ink: #8a5a00;
  --st-serious: #ec835a;
  --st-critical: #d03b3b; --st-critical-ink: #b02a2a;
  --st-info: #0073a8;
}

/* Hero */
.dash-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 12px; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem;
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(255,255,255,.14), transparent 60%),
    radial-gradient(400px 200px at 0% 120%, rgba(0,153,255,.35), transparent 60%),
    linear-gradient(120deg, #17324d 0%, #0b4d8c 55%, #0066cc 100%);
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 36px solid rgba(255,255,255,.06); pointer-events: none;
}
.hero-date { font-size: .85rem; opacity: .8; }
.hero-title { font-size: 1.6rem; font-weight: 700; margin: .15rem 0 .25rem; }
.hero-sub { opacity: .9; margin: 0; max-width: 62ch; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; position: relative; z-index: 1; }
.hero-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; font-size: .85rem;
  background: rgba(255,255,255,.12); color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.18);
}
.hero-chip:hover { background: rgba(255,255,255,.2); color: #fff; }
.hero-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.hero-chip.c-critical .dot { background: #ff7b7b; } .hero-chip.c-warning .dot { background: #ffc94d; } .hero-chip.c-good .dot { background: #6ee36e; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; z-index: 1; }
.hero-actions .btn { --bs-btn-padding-y: .45rem; }
.btn-hero { background: #fff; color: #0b4d8c; font-weight: 600; border: 0; }
.btn-hero:hover { background: #e6f0fa; color: #0b4d8c; }
.btn-hero-ghost { color: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn-hero-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Tessere indicatore */
.stat {
  display: flex; flex-direction: column; height: 100%; padding: 1rem 1.1rem; background: var(--ssl-surface);
  border: 1px solid var(--ssl-line); border-radius: 10px; color: inherit; text-decoration: none;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
a.stat:hover { border-color: var(--stc); box-shadow: 0 6px 18px rgba(23,50,77,.08); transform: translateY(-1px); color: inherit; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.stat-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--stb); color: var(--stc); font-size: 1.15rem; }
.stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.stat-label { font-size: .85rem; color: var(--ssl-muted); margin-top: .3rem; }
.stat-sub { font-size: .78rem; color: var(--ssl-muted); margin-top: .35rem; }
.stat-bar { height: 5px; border-radius: 3px; background: #e8edf2; margin-top: .6rem; overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: var(--stc); border-radius: 3px; }
.stat-trend { font-size: .78rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.stat-trend.up { color: var(--st-good-ink); background: #e5f5e5; }
.stat-trend.down { color: var(--st-critical-ink); background: #fbe9e9; }
.stat-primary { --stc: #0066cc; --stb: #e6f0fa; }
.stat-info { --stc: #0073a8; --stb: #e5f3f9; }
.stat-success { --stc: #008055; --stb: #e3f4ec; }
.stat-warning { --stc: #b36b00; --stb: #fff3d9; }
.stat-danger { --stc: #c0303f; --stb: #fbe8ea; }
.stat-neutral { --stc: #5c6f82; --stb: #eef1f4; }

/* Pannelli */
.panel { border-radius: 10px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: .55rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--ssl-line); }
.panel-head > i { color: var(--ssl-primary); font-size: 1.05rem; }
.panel-h { font-size: 1rem; font-weight: 700; margin: 0; }
.panel-head .ms-auto ~ .panel-link { margin-left: .75rem; }
.panel-link { margin-left: auto; font-size: .82rem; text-decoration: none; white-space: nowrap; }
.panel .card-body { padding: 1rem 1.1rem; }
.empty-mini { display: flex; align-items: center; gap: .5rem; padding: 1.1rem; color: var(--ssl-muted); font-size: .9rem; }
.empty-mini i { color: var(--st-good-ink); font-size: 1.2rem; }

/* Grafici */
.chart-box { position: relative; width: 100%; }
.chart-data { margin-top: .5rem; font-size: .8rem; }
.chart-data summary { color: var(--ssl-muted); cursor: pointer; }
.legend-inline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8rem; color: var(--ssl-muted); }
.legend-inline span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--lc); margin-right: .35rem; vertical-align: -1px; }

/* Anelli */
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; }
.ring {
  --rc: var(--st-good); --size: 108px;
  width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), #e8edf2 0);
  position: relative;
}
.ring-value { position: absolute; font-size: 1.45rem; font-weight: 700; }
.ring-value small { font-size: .7em; font-weight: 600; color: var(--ssl-muted); }
.ring-wrap { position: relative; }
.ring-wrap > .ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--ssl-surface); }
.ring-wrap > .ring .ring-value { z-index: 1; }
.ring-good { --rc: var(--st-good); } .ring-warning { --rc: var(--st-warning); } .ring-critical { --rc: var(--st-critical); }
.ring-label { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.ring-label span { display: block; font-weight: 400; font-size: .78rem; color: var(--ssl-muted); }
.ring-wrap.sm .ring { --size: 76px; }
.ring-wrap.sm .ring::before { inset: 8px; }
.ring-wrap.sm .ring-value { font-size: 1.1rem; }

/* Cose da fare */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--ssl-line); }
.todo:last-child { border-bottom: 0; }
.todo > i { font-size: 1.1rem; flex: 0 0 auto; }
.todo-critical > i { color: var(--st-critical); } .todo-warning > i { color: #d99400; } .todo-info > i { color: var(--st-info); }
.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: .9rem; }
.todo-det { font-size: .78rem; color: var(--ssl-muted); }

/* Timeline del giorno */
.timeline { list-style: none; margin: 0; padding: .5rem 1.1rem 1rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: calc(1.1rem + 52px); top: .9rem; bottom: 1.2rem; width: 2px; background: #e3e9ef; }
.tl-item { display: grid; grid-template-columns: 52px 18px 1fr auto; align-items: start; gap: .6rem; padding: .55rem 0; }
.tl-time { font-weight: 700; font-size: .9rem; text-align: right; padding-top: .05rem; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin: .3rem 0 0 -5px; background: #fff; border: 3px solid var(--tc, var(--ssl-primary)); position: relative; z-index: 1; }
.tl-item.s-completato { --tc: var(--st-good); } .tl-item.s-no_show { --tc: var(--st-critical); } .tl-item.s-proposto { --tc: var(--st-info); }
.tl-item.now .tl-dot { box-shadow: 0 0 0 4px rgba(0,102,204,.18); }
.tl-who { font-weight: 600; }
.tl-meta { font-size: .78rem; color: var(--ssl-muted); }

/* Squadra (dirigente) */
.team-name { font-weight: 600; }
.sem { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; white-space: nowrap; }
.sem::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sc, #b8c2cc); }
.sem-good { --sc: var(--st-good); } .sem-warning { --sc: var(--st-warning); } .sem-critical { --sc: var(--st-critical); } .sem-none { --sc: #b8c2cc; }
.mini-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #e8edf2; width: 90px; gap: 2px; }
.mini-bar span { display: block; height: 100%; }
.course-row { display: grid; grid-template-columns: 1fr 120px 42px; align-items: center; gap: .75rem; padding: .45rem 0; font-size: .88rem; }
.course-row .bar { height: 8px; border-radius: 4px; background: #e8edf2; overflow: hidden; }
.course-row .bar span { display: block; height: 100%; border-radius: 4px; }

/* Area personale */
.next-visit { display: flex; gap: 1rem; align-items: center; }
.cal-tile { flex: 0 0 72px; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--ssl-line); background: #fff; }
.cal-tile .m { background: #0066cc; color: #fff; font-size: .75rem; font-weight: 700; text-transform: uppercase; padding: .2rem 0; }
.cal-tile .d { font-size: 1.7rem; font-weight: 700; line-height: 1.2; padding-top: .15rem; }
.cal-tile .w { font-size: .72rem; color: var(--ssl-muted); padding-bottom: .3rem; }
.status-big { display: flex; align-items: center; gap: .85rem; }
.status-big .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--stb); color: var(--stc); }
.journey { list-style: none; margin: 0; padding: 0; }
.journey li { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--ssl-line); font-size: .88rem; }
.journey li:last-child { border-bottom: 0; }
.journey i { color: var(--ssl-primary); }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.quick-link { display: flex; flex-direction: column; gap: .35rem; padding: .85rem; border: 1px solid var(--ssl-line); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; font-size: .88rem; font-weight: 600; }
.quick-link i { font-size: 1.3rem; color: var(--ssl-primary); }
.quick-link:hover { border-color: var(--ssl-primary); color: inherit; }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ssl-muted); margin: 2rem 0 .9rem; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--ssl-line); }
.sys-list { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; font-size: .87rem; margin: 0; }
.sys-list dt { color: var(--ssl-muted); font-weight: 400; }
.sys-list dd { margin: 0; }

@media (max-width: 575.98px) {
  .dash-hero { padding: 1.2rem; }
  .hero-title { font-size: 1.3rem; }
  .stat-value { font-size: 1.5rem; }
  .tl-item { grid-template-columns: 44px 18px 1fr; }
  .tl-item > .tl-act { grid-column: 3; }
  .timeline::before { left: calc(1.1rem + 44px); }
}
@media (prefers-reduced-motion: reduce) { .stat { transition: none; } a.stat:hover { transform: none; } }
