/* MandatoEngine: Aurora Design System v1.0 ("Light & Air"), applicato alla console server-side.
   Fonte: Interfaccia/Aurora Design System.pdf e i due prototipi React (bespoke_erp_aurora*.tsx), tradotti in CSS
   senza Tailwind: la CSP della console ammette solo script e stili dello stesso sito.
   Pilastri: vetro (pannelli semitrasparenti con sfocatura), griglia bento, spazi ampi su fondo chiaro; navigazione
   in un dock fluttuante in basso al posto della barra laterale. REQ: ACC WCAG 2.2 AA come default.
   Scostamenti voluti dalla specifica, per il contrasto AA: gradiente primario indigo-600 → purple-600 (il 500 con
   testo bianco resta sotto 4,5:1) e testo secondario slate-600 invece di slate-500 sui pannelli di vetro. */

:root {
  /* --- Palette Aurora --- */
  --indigo-50: #eef2ff; --indigo-100: #e0e7ff; --indigo-200: #c7d2fe; --indigo-500: #6366f1;
  --indigo-600: #4f46e5; --indigo-700: #4338ca; --indigo-900: #312e81;
  --purple-500: #a855f7; --purple-600: #9333ea;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
  --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --emerald-50: #ecfdf5; --emerald-100: #d1fae5; --emerald-200: #a7f3d0; --emerald-500: #10b981; --emerald-700: #047857;
  --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-500: #3b82f6; --blue-700: #1d4ed8;
  --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-500: #f59e0b; --amber-700: #b45309; --amber-800: #92400e;
  --rose-50: #fff1f2; --rose-100: #ffe4e6; --rose-200: #fecdd3; --rose-500: #f43f5e; --rose-600: #e11d48; --rose-700: #be123c;
  --violet-100: #f3e8ff; --violet-200: #e9d5ff; --violet-700: #7e22ce;

  /* --- Ruoli --- */
  --bg: var(--slate-50);
  --text: var(--slate-900);
  --text-strong: var(--slate-800);
  --muted: var(--slate-600);
  --faint: var(--slate-500);
  --line: rgba(226, 232, 240, .8);        /* slate-200 */
  --line-strong: var(--slate-300);
  --primary: var(--indigo-600);
  --primary-hover: var(--indigo-700);
  --primary-soft: var(--indigo-50);
  --gradient: linear-gradient(90deg, var(--indigo-600), var(--purple-600));
  --gradient-hover: linear-gradient(90deg, var(--indigo-700), #7e22ce);
  --focus: 0 0 0 3px rgba(99, 102, 241, .35);

  /* --- Vetro (aurora-glass-card) --- */
  --glass: rgba(255, 255, 255, .7);
  --glass-hover: rgba(255, 255, 255, .85);
  --glass-strong: rgba(255, 255, 255, .9);
  --glass-line: rgba(255, 255, 255, .55);
  --glass-blur: blur(24px);
  --shadow-card: 0 20px 40px -10px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-card-hover: 0 30px 60px -15px rgba(15, 23, 42, .09), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-float: 0 20px 50px rgba(15, 23, 42, .12);

  /* --- Forma, spazi, tipo, movimento --- */
  --radius-xl: 24px; --radius: 16px; --radius-md: 12px; --radius-sm: 10px; --radius-xs: 8px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --dur: 200ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --dock-space: 128px;

  /* --- Alias dei nomi precedenti (usati negli stili in linea dei template) --- */
  --navy: var(--slate-900); --card: #fff;
  --amber-bg: var(--amber-50); --amber-line: var(--amber-200); --amber-chip: var(--amber-100); --amber-text: var(--amber-800);
  --red-bg: var(--rose-100); --red-text: var(--rose-700);
  --green-bg: var(--emerald-100); --green-text: var(--emerald-700);
  --purple-bg: var(--violet-100); --purple-text: var(--violet-700);
  --blue-bg: var(--blue-100); --blue-text: var(--blue-700);
  --grey-bg: var(--slate-100); --grey-text: var(--slate-600);
  --dot-green: var(--emerald-500); --dot-amber: var(--amber-500); --dot-grey: var(--slate-400);
}

* { box-sizing: border-box; }
html { font-size: 100%; scroll-padding-bottom: var(--dock-space); }
body {
  margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg);
  font-size: 0.875rem; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
::selection { background: var(--indigo-200); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--indigo-500); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--text); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 200; border-radius: 10px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Sfondo aurora: sfere sfumate fisse dietro il contenuto --------------------------------------------
   Gradienti radiali invece di filter: blur (molto più leggeri). L'animazione lenta è attiva solo sulle pagine
   con classe .aurora-animate (accesso e panoramica): sotto pannelli di vetro uno sfondo in movimento costringe a
   ricalcolare la sfocatura a ogni fotogramma, e le pagine di lavoro restano ferme e fluide. */
.aurora-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora-bg::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .35); }
.orb { position: absolute; border-radius: 50%; will-change: transform; }
.orb-1 { top: -18%; left: -12%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(216, 180, 254, .55), rgba(216, 180, 254, 0)); }
.orb-2 { top: 12%; right: -14%; width: 52vw; height: 52vw; max-width: 800px; max-height: 800px;
  background: radial-gradient(closest-side, rgba(103, 232, 249, .45), rgba(103, 232, 249, 0)); }
.orb-3 { bottom: -28%; left: 18%; width: 66vw; height: 66vw; max-width: 1000px; max-height: 1000px;
  background: radial-gradient(closest-side, rgba(253, 230, 138, .5), rgba(253, 230, 138, 0)); }
@keyframes aurora-drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(.94); }
  100% { transform: translate(0, 0) scale(1); }
}
.aurora-animate .orb { animation: aurora-drift 24s ease-in-out infinite alternate; }
.aurora-animate .orb-2 { animation-delay: -8s; }
.aurora-animate .orb-3 { animation-delay: -16s; }

/* --- Vetro --- */
.glass, .card, .page-head, .topbar, .dock, .pending, .chain, .warn-box, .stepper {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .page-head, .topbar, .dock, .pending, .chain, .warn-box, .stepper { background: var(--glass-strong); }
}

/* --- Struttura: barra in alto, contenuto, dock in basso --- */
.shell { position: relative; z-index: 1; min-height: 100vh; }
.topbar {
  position: sticky; top: var(--s-4); z-index: 40; margin: var(--s-4) auto 0; max-width: 1280px; width: calc(100% - 32px);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 10px 12px 10px 18px; border-radius: 999px; box-shadow: var(--shadow-card);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--gradient); display: grid; place-items: center;
  color: #fff; box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .5); flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.userbox { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px;
  text-decoration: none; color: var(--text); transition: background var(--dur) var(--ease); }
.user-chip:hover { background: rgba(255, 255, 255, .7); color: var(--text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--indigo-100); color: var(--indigo-700);
  display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; flex: none; }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip .who strong { font-size: 0.82rem; }
.user-chip .who span { font-size: 0.72rem; color: var(--muted); }
.devbox { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 0.74rem;
  background: var(--amber-100); color: var(--amber-800); border: 1px solid var(--amber-200); }
.devbox code { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.12em; color: var(--slate-900); }
.devbox a { color: var(--amber-800); font-weight: 600; }

main { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--dock-space); min-width: 0; }
.page-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  margin-bottom: var(--s-6); padding: var(--s-6) var(--s-8); border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
}
.page-head h1 { font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.crumb { font-size: 0.78rem; font-weight: 600; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center;
  gap: 4px; margin-bottom: 6px; }
.crumb::before { content: "‹"; font-size: 1rem; line-height: 1; }
.crumb:hover { text-decoration: underline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- Dock fluttuante (sostituisce la barra laterale) --- */
.dock {
  position: fixed; bottom: var(--s-6); left: 50%; transform: translateX(-50%); z-index: 50;
  border-radius: 999px; padding: 10px 14px; box-shadow: var(--shadow-float); background: rgba(255, 255, 255, .75);
  border-color: rgba(255, 255, 255, .85); max-width: calc(100vw - 24px);
}
.dock ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.dock a {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
  color: var(--slate-500); text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dock a svg { width: 22px; height: 22px; }
.dock a:hover, .dock a:focus-visible { color: var(--slate-800); background: rgba(255, 255, 255, .7); transform: translateY(-4px); }
.dock a[aria-current="page"] { color: var(--primary); background: #fff; box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .25);
  transform: translateY(-8px); }
.dock a[aria-current="page"]::after { content: ""; position: absolute; bottom: -10px; left: 50%; width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: var(--indigo-500); box-shadow: 0 0 8px rgba(99, 102, 241, .8); }
.dock .sep { width: 1px; height: 28px; background: var(--slate-200); margin: 0 4px; }
.dock-tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: rgba(30, 41, 59, .92); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 6px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .25);
}
.dock-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent;
  border-top-color: rgba(30, 41, 59, .92); }
.dock a:hover .dock-tip, .dock a:focus-visible .dock-tip { opacity: 1; }
.dock .count {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--rose-600); color: #fff; font-size: 0.66rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff;
}

/* --- Pannelli --- */
.card { border-radius: var(--radius-xl); box-shadow: var(--shadow-card); transition: background-color .3s ease, box-shadow .3s ease; }
a.card:hover, .card.hoverable:hover { background: var(--glass-hover); box-shadow: var(--shadow-card-hover); }
.card-pad { padding: var(--s-6); }
.card h2, section > h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s-5) var(--s-6) var(--s-3); gap: 12px; }
.card-head a { font-weight: 600; font-size: 0.82rem; text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mono { font-family: var(--mono); }
.grid { display: grid; gap: var(--s-6); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.main-side { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
.side-main { grid-template-columns: minmax(280px, 1fr) minmax(0, 2.4fr); align-items: start; }
.grid > *, .bento > * { min-width: 0; }   /* tabelle larghe scorrono nel loro contenitore, non allargano la pagina */
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Griglia bento a 12 colonne */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.icon-tile { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.icon-tile svg { width: 18px; height: 18px; }
.tile-indigo { background: var(--indigo-50); color: var(--indigo-600); }
.tile-emerald { background: var(--emerald-50); color: var(--emerald-700); }
.tile-rose { background: var(--rose-50); color: var(--rose-600); }
.tile-amber { background: var(--amber-50); color: var(--amber-700); }
.title-row { display: flex; align-items: center; gap: 10px; }

/* --- Bottoni: primario a gradiente, secondario a contorno, terziario «ghost» --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 0 18px; border-radius: var(--radius-md); font: inherit; font-weight: 600; font-size: 0.85rem; line-height: 1.2;
  border: 1px solid var(--slate-200); background: #fff; color: var(--slate-700); cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--slate-50); color: var(--slate-800); box-shadow: 0 4px 10px -4px rgba(15, 23, 42, .12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--indigo-600); outline-offset: 2px; box-shadow: var(--focus); }
.btn-primary { background: var(--gradient); border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, .55); }
.btn-primary:hover { background: var(--gradient-hover); color: #fff; box-shadow: 0 14px 26px -8px rgba(99, 102, 241, .65); }
.btn-ghost { background: var(--slate-100); border-color: transparent; box-shadow: none; color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); box-shadow: none; }
.btn-success { background: linear-gradient(90deg, #059669, var(--emerald-700)); border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -8px rgba(16, 185, 129, .5); }
.btn-success:hover { color: #fff; filter: brightness(.95); }
.btn-danger { color: var(--rose-700); border-color: var(--rose-200); background: #fff; }
.btn-danger:hover { background: var(--rose-50); color: var(--rose-700); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-link { background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 6px 4px;
  font: inherit; font-size: 0.85rem; min-height: 32px; border-radius: 6px; }
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }
.btn-link.danger { color: var(--rose-700); }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }

/* --- Badge (pillole): sfondo pastello, testo ad alto contrasto --- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 0.7rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; line-height: 1.4; }
.b-deny, .b-ko { background: rgba(255, 228, 230, .85); color: var(--rose-700); border-color: var(--rose-200); }
.b-ask, .timer { background: rgba(254, 243, 199, .85); color: var(--amber-800); border-color: var(--amber-200); }
.b-allow, .b-ok { background: rgba(209, 250, 229, .85); color: var(--emerald-700); border-color: var(--emerald-200); }
.b-alto, .b-irr { background: rgba(243, 232, 255, .85); color: var(--violet-700); border-color: var(--violet-200); }
.b-medio { background: rgba(219, 234, 254, .85); color: var(--blue-700); border-color: var(--blue-200); }
.b-basso, .b-grey, .b-origin { background: rgba(241, 245, 249, .9); color: var(--slate-600); border-color: var(--slate-200); }
.b-ko, .b-ok, .b-irr, .b-origin { border-radius: 8px; padding: 1px 8px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot-green { background: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.dot-amber { background: var(--amber-500); box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.dot-grey { background: var(--slate-400); }
.dot-red { background: var(--rose-500); box-shadow: 0 0 0 3px rgba(244, 63, 94, .15); }

/* --- Tabelle --- */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; font-size: 0.7rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px var(--s-6); border-bottom: 1px solid var(--line); background: rgba(248, 250, 252, .55); }
td { padding: 14px var(--s-6); border-bottom: 1px solid rgba(226, 232, 240, .6); vertical-align: middle; }
tbody tr { transition: background-color var(--dur) var(--ease); }
tbody tr:hover td { background: rgba(255, 255, 255, .55); }
tr:last-child td { border-bottom: 0; }
td .sub, dd .sub { display: block; color: var(--muted); font-size: 0.78rem; }
.table-wrap { overflow-x: auto; }
.table-wrap table, .card > table { font-variant-numeric: tabular-nums; }
tr.selected td { background: rgba(224, 231, 255, .6); }
td a.rowlink { color: var(--text-strong); text-decoration: none; font-weight: 600; }
td a.rowlink:hover { color: var(--primary); }
table.compact th, table.compact td { padding: 10px 14px; }
table.compact td:last-child, table.compact th:last-child { white-space: nowrap; width: 1%; }
table.compact td:first-child, table.compact td:nth-child(2) { white-space: nowrap; }

/* --- Panoramica --- */
.pending { border-radius: var(--radius-xl); padding: var(--s-5) var(--s-6); margin-bottom: var(--s-6);
  background: linear-gradient(135deg, rgba(255, 251, 235, .85), rgba(255, 255, 255, .7)); border-color: rgba(253, 230, 138, .7);
  box-shadow: var(--shadow-card); }
.pending h2 { color: var(--amber-800); }
.pending-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.pending-card { background: rgba(255, 255, 255, .8); border: 1px solid rgba(253, 230, 138, .8); border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: inherit; display: block; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.pending-card:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(180, 83, 9, .3); }
.pending-card p { margin: 6px 0 4px; }
.kpi { padding: var(--s-5) var(--s-6); }
.kpi .label { color: var(--slate-500); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 2px; color: var(--slate-800);
  font-variant-numeric: tabular-nums; }
.kpi.accent .value { color: var(--indigo-600); }
.kpi.danger .value { color: var(--rose-600); }
.kpi.ok .value { color: var(--emerald-700); }
.feed { list-style: none; margin: 0; padding: 0 var(--s-4) var(--s-3); }
.feed li { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 10px; padding: 12px var(--s-2); border-radius: var(--radius-md);
  transition: background-color var(--dur) var(--ease); }
.feed li + li { border-top: 1px solid rgba(226, 232, 240, .6); }
.feed li:hover { background: rgba(255, 255, 255, .6); }
.feed time { font-family: var(--mono); color: var(--slate-500); font-size: 0.76rem; padding-top: 2px; }
.feed .desc { grid-column: 2 / 4; color: var(--muted); font-size: 0.8rem; }

/* --- Procedure guidate (stepper) --- */
.stepper { display: flex; align-items: center; padding: var(--s-4) var(--s-6); gap: 10px; margin-bottom: var(--s-6); overflow-x: auto;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.step { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--slate-500); text-decoration: none; font-size: 0.82rem;
  font-weight: 500; }
.step:hover { color: var(--slate-800); }
.step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--slate-200); color: var(--slate-500); background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  transition: background-color .3s ease, color .3s ease; }
.step.done .n { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; }
.step.current .n { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; box-shadow: 0 0 0 4px var(--indigo-100); }
.step.current { color: var(--indigo-900); font-weight: 600; }
.step-line { flex: 1; min-width: 24px; height: 4px; border-radius: 999px; background: var(--slate-100); }
.step-line.done { background: var(--indigo-500); }

.mandate-text { font-family: var(--serif); font-size: 1.02rem; line-height: 1.65; }
.mandate-text h3 { font-family: var(--sans); font-size: 0.7rem; color: var(--slate-500); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin: 18px 0 4px; }
.mandate-text h3:first-child { margin-top: 0; }
.mandate-text p { margin: 0; }
mark { background: var(--amber-100); border-bottom: 2px solid var(--amber-500); padding: 0 1px; color: inherit; border-radius: 2px; }
.question { padding: var(--s-4) var(--s-5); }
.question .quote { display: inline-block; background: var(--amber-100); color: var(--amber-800); font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.question h3 { font-size: 0.92rem; margin: 0 0 8px; }
.answered { color: var(--emerald-700); font-weight: 600; font-size: 0.82rem; }
.progress { height: 6px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gradient); border-radius: 999px; }
.progress.green > span { background: linear-gradient(90deg, var(--emerald-500), #059669); }

/* --- Moduli --- */
label { font-weight: 600; font-size: 0.82rem; color: var(--slate-700); display: block; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.78rem; display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], input[type=number],
input[type=url], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--slate-800); border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  padding: 10px 14px; background: rgba(255, 255, 255, .6); min-height: 44px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--slate-400); }
input:hover, select:hover, textarea:hover { border-color: var(--slate-300); }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--indigo-200); box-shadow: var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--indigo-600); outline-offset: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--rose-500); }
input[disabled], select[disabled], textarea[disabled] { background: var(--slate-100); color: var(--slate-500); cursor: not-allowed; }
select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select[multiple] { background-image: none; padding-right: 14px; }
textarea { min-height: 88px; resize: vertical; }
textarea.code, .code { font-family: var(--mono); font-size: 0.8rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--indigo-600); }
.field { margin-bottom: var(--s-4); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 0.82rem; color: var(--slate-700); padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--slate-700); }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.otp { font-family: var(--mono); letter-spacing: 0.4em; font-size: 1.1rem; text-align: center; }
.error-text { color: var(--rose-700); font-size: 0.8rem; margin-top: 4px; }

/* --- Regole e scelte --- */
.rule { padding: var(--s-4) var(--s-5); }
.rule.approved { border-color: var(--emerald-200); }
.rule .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.74rem; }
.rule .code-id { font-family: var(--mono); color: var(--slate-500); font-size: 0.78rem; }
.rule p { margin: 8px 0 4px; font-weight: 500; }
.rule .origin { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 0.85rem; }
.status-ok { color: var(--emerald-700); font-weight: 600; font-size: 0.78rem; margin-left: auto; }
.status-pending { color: var(--amber-800); font-weight: 600; font-size: 0.78rem; margin-left: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.chip { border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px); border-radius: 999px; padding: 7px 16px; font-size: 0.82rem; font-weight: 600; color: var(--slate-600);
  text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.chip:hover { background: #fff; color: var(--slate-800); }
.chip[aria-current="true"] { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.warn-box { border-radius: var(--radius-xl); padding: var(--s-5); box-shadow: var(--shadow-card);
  background: linear-gradient(135deg, rgba(255, 251, 235, .85), rgba(255, 255, 255, .7)); border-color: rgba(253, 230, 138, .7); }
.warn-box h2 { font-size: 0.95rem; margin: 0 0 10px; color: var(--amber-800); }
.warn-item + .warn-item { border-top: 1px solid var(--amber-200); margin-top: 12px; padding-top: 12px; }
.warn-item h3 { font-size: 0.85rem; margin: 0 0 4px; }
details summary { cursor: pointer; }
details.inline-edit { margin-top: 8px; }
details.inline-edit > summary { list-style: none; display: inline; }
details.inline-edit > summary::-webkit-details-marker { display: none; }

.metric { background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: var(--s-4); }
.metric .value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.doc-preview { padding: var(--s-8) var(--s-10); }
.doc-preview h2 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; margin: 12px 0 14px; }
.doc-preview p, .doc-body { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.doc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); padding: 12px 0; margin: 14px 0; }
.doc-meta dt { color: var(--slate-500); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.doc-meta dd { margin: 0; font-weight: 700; }

/* --- Escalation --- */
.esc-item { display: block; padding: var(--s-4) var(--s-5); text-decoration: none; color: inherit; }
.esc-item:hover { color: inherit; background: var(--glass-hover); }
.esc-item[aria-current="true"] { border: 2px solid var(--indigo-500); background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px -12px rgba(99, 102, 241, .45); }
.esc-item p { margin: 6px 0 4px; }
.codeblock { background: rgba(241, 245, 249, .8); border: 1px solid var(--slate-200); border-radius: var(--radius-md); padding: 12px 14px;
  font-family: var(--mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; color: var(--slate-800); }
.judges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.judge { border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .55); border-radius: var(--radius); padding: 14px 16px; }
.bar { height: 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--gradient); border-radius: 999px; }
.bar.ko > span { background: linear-gradient(90deg, var(--amber-500), var(--rose-500)); }
.quote-serif { font-family: var(--serif); font-size: 1.05rem; }
h3.section { font-size: 0.7rem; color: var(--slate-500); margin: 20px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* --- Registro --- */
.chain { display: flex; gap: 14px; align-items: center; padding: 12px var(--s-5); border-radius: var(--radius); margin-bottom: var(--s-4);
  flex-wrap: wrap; background: linear-gradient(135deg, rgba(236, 253, 245, .85), rgba(255, 255, 255, .7)); border-color: var(--emerald-200);
  box-shadow: var(--shadow-card); }
.chain.broken { background: linear-gradient(135deg, rgba(255, 241, 242, .9), rgba(255, 255, 255, .7)); border-color: var(--rose-200); }
.chain strong { color: var(--emerald-700); }
.chain.broken strong { color: var(--rose-700); }
.filters { display: grid; grid-template-columns: 1fr 160px 170px 150px auto; gap: 10px; margin-bottom: var(--s-4); }
.path { list-style: none; margin: 0; padding: 0; }
.path li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 0.85rem; }
.path li + li { border-top: 1px solid rgba(226, 232, 240, .5); }
.path li span:last-child { color: var(--muted); font-size: 0.8rem; text-align: right; }
.explain { background: rgba(238, 242, 255, .6); border: 1px solid var(--indigo-100); border-radius: var(--radius); padding: var(--s-4); }
.explain p { font-family: var(--serif); font-size: 1rem; line-height: 1.6; margin: 6px 0 0; }
dl.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 14px; margin: 12px 0; }
dl.kv dt { color: var(--slate-500); }
dl.kv dd { margin: 0; color: var(--slate-800); overflow-wrap: anywhere; }
.hash { font-family: var(--mono); font-size: 0.76rem; word-break: break-all; }

/* --- Messaggi, stati vuoti, segreti --- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: var(--s-4);
  border: 1px solid transparent; font-weight: 500; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: currentColor; }
.flash-ok { background: rgba(209, 250, 229, .85); color: var(--emerald-700); border-color: var(--emerald-200); }
.flash-error { background: rgba(255, 228, 230, .9); color: var(--rose-700); border-color: var(--rose-200); }
.flash-info { background: rgba(219, 234, 254, .85); color: var(--blue-700); border-color: var(--blue-200); }
.empty { padding: var(--s-8) var(--s-5); text-align: center; color: var(--muted); }
.token { font-family: var(--mono); background: var(--slate-900); color: #e0e7ff; padding: 14px 16px; border-radius: var(--radius-md);
  word-break: break-all; }
pre.snippet { background: var(--slate-900); color: #e0e7ff; padding: 16px; border-radius: var(--radius-md); overflow-x: auto; font-size: 0.78rem; }

/* --- Finestre modali (dialog nativo) --- */
dialog.modal { border: 1px solid var(--glass-line); border-radius: var(--radius-xl); padding: var(--s-8); max-width: min(560px, calc(100vw - 32px));
  background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .35); color: var(--text); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .2); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* --- Pagine senza dock: accesso, errore --- */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); }
.login .card { width: 100%; max-width: 440px; padding: var(--s-8); }
.login h1 { font-size: 1.6rem; font-weight: 300; letter-spacing: -0.02em; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--indigo-600); }

/* --- Portale collaboratori: barra senza dock --- */
.collab main { padding-bottom: var(--s-10); max-width: 1000px; }

@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-side, .side-main { grid-template-columns: 1fr; }
  .pending-cards { grid-template-columns: 1fr; }
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 12; }
}
@media (max-width: 820px) {
  .topbar { border-radius: var(--radius-xl); padding: 8px 8px 8px 12px; gap: var(--s-2); }
  .brand { font-size: 0.88rem; }
  .userbox { flex-wrap: nowrap; gap: 6px; }
  .devbox { padding: 4px 10px; }
  .devbox span { display: none; }
  .user-chip { padding: 2px; }
  .user-chip .who { display: none; }
  main { padding: var(--s-4) var(--s-3) var(--dock-space); }
  .page-head { padding: var(--s-5); }
  .page-head h1 { font-size: 1.6rem; }
  .cols-2, .cols-3, .cols-4, .judges, .filters, .doc-meta { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Dock: tutte le voci restano raggiungibili; se non entrano scorre orizzontalmente (con un'ombra sul bordo). */
  .dock { bottom: var(--s-3); padding: 6px; width: calc(100vw - 24px); }
  .dock ul { overflow-x: auto; scrollbar-width: none; gap: 2px; padding-top: 10px; margin-top: -10px; justify-content: safe center;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent); }
  .dock ul::-webkit-scrollbar { display: none; }
  .dock li { flex: none; }
  .dock a { width: 44px; height: 44px; }
  .dock a[aria-current="page"] { transform: translateY(-4px); }
  .dock .sep, .dock-tip { display: none; }
}
/* --- Barra del modulo (organizzazione in moduli, navigation.py) --- */
.modbar { margin: 0 0 18px; }
.modbar-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.modbar-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--indigo-50); color: var(--indigo-600); border: 1px solid var(--indigo-100); }
.modbar-icon svg { width: 20px; height: 20px; }
.modbar-name { display: flex; flex-direction: column; line-height: 1.2; }
.modbar-name .eyebrow { font-size: 0.66rem; }
.modbar-name strong { font-size: 0.98rem; color: var(--slate-800); }
.modbar-desc { margin: 0; flex: 1 1 320px; color: var(--muted); font-size: 0.82rem; }
.modbar-help { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.modbar-nav { margin: 0; }
/* --- Home e manuale --- */
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.todo:first-of-type { border-top: 0; }
.todo .body { flex: 1; min-width: 0; }
.todo .body strong { display: block; color: var(--slate-800); }
.module-card { display: flex; flex-direction: column; gap: 8px; }
.module-card h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; }
.module-card ul { margin: 0; padding-left: 18px; font-size: 0.84rem; color: var(--slate-700); }
.module-card .row { margin-top: auto; }
.setup-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.setup-step:first-of-type { border-top: 0; }
.setup-mark { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.setup-mark.ok { background: var(--emerald-100, #d1fae5); color: var(--emerald-700); }
.setup-mark.ko { background: var(--amber-100, #fef3c7); color: var(--amber-800); }
.manual { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.manual-toc { position: sticky; top: 100px; max-height: calc(100vh - 220px); overflow: auto; font-size: 0.84rem; }
.manual-toc ol { margin: 0; padding-left: 18px; }
.manual-toc li { margin: 4px 0; }
.manual-toc ul { margin: 2px 0 6px; padding-left: 14px; list-style: none; font-size: 0.78rem; }
.manual-chapter { scroll-margin-top: 100px; margin-bottom: 18px; }
.manual-chapter h2 { margin-top: 0; }
.manual-chapter h3 { font-size: 0.95rem; margin: 18px 0 6px; scroll-margin-top: 100px; }
.manual-table th, .manual-table td { padding: 8px 12px; vertical-align: top; white-space: normal; }
.manual-table td:first-child { font-weight: 600; color: var(--slate-800); width: 26%; }
.manual-chapter p, .manual-chapter li { line-height: 1.6; }
.manual-chapter ol, .manual-chapter ul { padding-left: 22px; }
.callout { border-left: 3px solid var(--indigo-500); background: var(--indigo-50); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 0.86rem; margin: 10px 0; }
.callout.warn { border-left-color: var(--amber-500, #f59e0b); background: #fffbeb; }
.manual > * { min-width: 0; }
@media (max-width: 900px) { .manual { grid-template-columns: 1fr; } .manual-toc { position: static; max-height: none; } }
/* Telefono: le tabelle fuori da .table-wrap scorrono da sole, i badge lunghi vanno a capo */
@media (max-width: 640px) {
  main table { display: block; overflow-x: auto; max-width: 100%; }
  .table-wrap table { display: table; }
  .badge { white-space: normal; }
}
@media print { .manual-toc, .modbar { display: none !important; } .manual { display: block; } }
/* --- Monitoraggio LLM --- */
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spark { display: block; width: 100%; height: 80px; }
.spark polyline { fill: none; stroke: var(--indigo-500); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-card { padding: var(--s-4); }
.spark-card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pre-text { white-space: pre-wrap; word-break: break-word; }
.req-ok { color: var(--emerald-700); } .req-ko { color: var(--rose-700); } .req-warn { color: var(--amber-800); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .dock a:hover, .dock a:focus-visible, .dock a[aria-current="page"], .pending-card:hover { transform: none; }
}
@media print {
  .dock, .topbar, .aurora-bg, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card, .page-head, .pending, .chain, .warn-box, .stepper { background: #fff; box-shadow: none; border-color: #ddd;
    -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* --- Configurazione guidata del file .env --- */
form:not(.js) .js-only { display: none !important; }
.env-field { border-top: 1px solid var(--slate-100); padding: var(--s-4) 0; }
.env-field:first-of-type { border-top: 0; padding-top: var(--s-2); }
.env-key { display: block; font-family: var(--mono); font-size: 0.74rem; color: var(--slate-500); margin: -2px 0 6px; }
.env-input-row { display: flex; gap: 8px; align-items: center; }
.env-input-row input, .env-input-row select { flex: 1; min-width: 0; }
.env-help { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 14px; font-size: 0.8rem; color: var(--slate-700); margin: 10px 0 0; }
.env-help dt { color: var(--muted); font-weight: 600; }
.env-help dd { margin: 0; }
.env-advanced { margin-top: var(--s-3); border-top: 1px dashed var(--slate-200); padding-top: var(--s-3); }
.env-advanced > summary { cursor: pointer; }
.field-error { color: var(--rose-700); font-size: 0.8rem; margin: 6px 0 0; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: var(--s-4); }
@media (max-width: 640px) { .env-help { grid-template-columns: 1fr; } .env-help dt { margin-top: 4px; } }

/* Pagine legali: anteprima e versioni nell'editor della console (Account e amministrazione → Pagine legali e cookie) */
.legal-doc { border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 20px 24px; background: #fff; max-height: 70vh; overflow-y: auto; }
.legal-doc h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.legal-doc h2:first-child, .legal-doc > :first-child { margin-top: 0; }
.legal-doc h3 { font-size: .98rem; margin: 1.2em 0 .4em; }
.legal-doc p, .legal-doc li { font-size: .9rem; max-width: 80ch; }
.legal-doc .in-breve { background: var(--indigo-50); border-left: 3px solid var(--indigo-500); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.legal-doc .table-scroll { overflow-x: auto; margin-bottom: 1em; }
.legal-doc table { font-size: .82rem; }
.legal-doc th, .legal-doc td { vertical-align: top; text-align: left; }
mark.da-completare { background: #fef3c7; color: #92400e; border-radius: 6px; padding: 0 6px; font-weight: 600; }

/* Consumi IA: grafico del costo giornaliero (una sola serie, barre sottili ancorate alla base) e quota per funzione */
.usage-chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.usage-chart .grid-line { stroke: var(--slate-200, #e2e8f0); stroke-width: 1; }
.usage-chart .baseline { stroke: var(--slate-300, #cbd5e1); stroke-width: 1; }
.usage-chart .axis { fill: var(--slate-500, #64748b); font-size: 11px; font-family: var(--sans, system-ui); font-variant-numeric: tabular-nums; }
.usage-chart .mark { fill: var(--indigo-600, #4f46e5); }
.usage-chart .hit { fill: transparent; }
.usage-chart .bar:hover .mark { fill: var(--indigo-700, #4338ca); }
.usage-chart .bar:hover .hit { fill: rgba(99, 102, 241, .07); }
.share { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--slate-100, #f1f5f9); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.share i { display: block; height: 100%; border-radius: 3px; background: var(--indigo-600, #4f46e5); }

/* Inventario IA: procedura guidata del censimento (ai_form.html, ai_form.js) */
.wiz-note { margin-bottom: 14px; }
.wiz-nav-steps { position: sticky; top: 88px; z-index: 5; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line, #e2e8f0); border-radius: 16px; padding: 10px 10px 8px; box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .35); }
.wiz-nav-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.wiz-tab { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 10px; font-size: .78rem; color: var(--slate-600, #475569); line-height: 1.2; }
.wiz-tab:hover { background: var(--slate-100, #f1f5f9); }
.wiz-tab:focus-visible { outline: 2px solid var(--indigo-500, #6366f1); outline-offset: 1px; }
.wiz-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .72rem;
  background: var(--slate-100, #f1f5f9); color: var(--slate-600, #475569); }
.wiz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-count { min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: .68rem; font-weight: 700; text-align: center; background: var(--amber-100, #fef3c7); color: var(--amber-800, #92400e); }
.wiz-count:empty { display: none; }
.wiz-tab.done .wiz-num { background: var(--emerald-100, #d1fae5); color: var(--emerald-700, #047857); }
.wiz-tab.on { background: var(--indigo-50, #eef2ff); color: var(--slate-900, #0f172a); font-weight: 650; }
.wiz-tab.on .wiz-num { background: var(--indigo-600, #4f46e5); color: #fff; }
.wiz-bar { height: 4px; border-radius: 2px; background: var(--slate-100, #f1f5f9); margin-top: 8px; overflow: hidden; }
.wiz-bar span { display: block; height: 100%; width: 0; background: var(--indigo-600, #4f46e5); border-radius: 2px; transition: width .25s ease; }
.wiz-step h2:focus { outline: none; }
.wiz-section { border: 0; border-top: 1px solid var(--slate-200, #e2e8f0); padding: 14px 0 0; margin: 14px 0 0; min-width: 0; }
.wiz-section > legend { font-weight: 700; font-size: 1rem; padding: 0 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.wiz-ref { font-weight: 500; font-size: .72rem; color: var(--slate-500, #64748b); }
.wiz-q { margin-top: 16px; }
.wiz-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.wiz-choice > legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 6px; }
.wiz-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.wiz-options-long { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wiz-scroll { max-height: 340px; overflow-y: auto; padding: 2px; }
.wiz-opt { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--slate-200, #e2e8f0); border-radius: 10px; background: #fff;
  cursor: pointer; font-weight: 400; font-size: .88rem; line-height: 1.35; transition: border-color .15s, background-color .15s; }
.wiz-opt:hover { border-color: var(--indigo-200, #c7d2fe); }
.wiz-opt input { margin: 2px 0 0; flex: none; accent-color: var(--indigo-600, #4f46e5); }
.wiz-opt:has(input:checked) { border-color: var(--indigo-500, #6366f1); background: var(--indigo-50, #eef2ff); }
.wiz-opt:has(input:focus-visible) { outline: 2px solid var(--indigo-500, #6366f1); outline-offset: 1px; }
.wiz-req { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500, #64748b); margin-left: 6px; }
.wiz-prop { margin-left: 6px; vertical-align: 1px; }
.wiz-q.proposta { border-left: 3px solid var(--amber-500, #f59e0b); padding-left: 12px; }
.wiz-why { color: var(--amber-800, #92400e); margin-top: 4px; }
.wiz-legal { margin-top: 6px; font-size: .78rem; color: var(--slate-500, #64748b); }
.wiz-legal summary { cursor: pointer; width: fit-content; }
.wiz-legal p { margin: 6px 0 0; max-width: 90ch; }
.wiz-auto { border: 1px dashed var(--indigo-200, #c7d2fe); background: rgba(238, 242, 255, .55); border-radius: 12px; padding: 12px 14px; margin: 6px 0 4px; }
.wiz-auto summary { cursor: pointer; }
.wiz-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.wiz-outcome { border: 1px solid var(--slate-200, #e2e8f0); border-radius: 12px; padding: 14px 16px; background: #fff; }
.wiz-cat { margin: 6px 0; font-size: 1rem; }
.wiz-missing { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .88rem; }
.wiz-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--slate-200, #e2e8f0); }
.wiz-spacer { flex: 1; }
@media (max-width: 1100px) { .wiz-nav-steps ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .wiz-nav-steps { position: static; } .wiz-nav-steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wiz-summary { grid-template-columns: 1fr; }
  .wiz-options-long { grid-template-columns: 1fr; } }
/* la classe .card imposta «display» e prevarrebbe sull'attributo hidden: un passo nascosto resta nascosto */
.wiz-step[hidden], .wiz-nav-steps[hidden], .wiz-actions [hidden] { display: none !important; }
