/* ==========================================================================
   Gesthes — token del tema (colori, tipografia, misure, tempi)
   I colori del marchio vengono dal logo THES: blu navy #04366C e rosso #E72C31.
   La build li minifica: qui restano leggibili.
   ========================================================================== */

/* Archivo (SIL Open Font License, vedi fonts/Archivo-OFL.txt), ospitato in locale:
   nessuna chiamata a Google Fonts. Font variabile: peso 100–900, larghezza 62–125%. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tema chiaro ---------------------------------------------------------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --brand-navy: #04366C;
  --brand-red: #E72C31;

  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface2: #EEF1F6;
  --row-hover: #F5F8FD;
  --border: #E0E5EE;
  --border-strong: #C6CEDB;

  --text: #12203A;
  --text2: #47546B;
  --text3: #616D85;

  --accent: #1D55C4;
  --accent-strong: #04366C;
  --on-accent: #FFFFFF;
  --accent-soft: #E8EFFC;
  --accent-border: #BCCDF1;

  --pos: #157A4C;
  --pos-soft: #E2F3EA;
  --neg: #C0262B;
  --neg-soft: #FCEBEB;
  --warn: #965A06;
  --warn-soft: #FBF0DB;

  /* menu laterale: sempre blu THES */
  --side-bg: #04366C;
  --side-ink: #FFFFFF;
  --side-ink2: rgba(255, 255, 255, .76);
  --side-ink3: rgba(255, 255, 255, .6);
  --side-line: rgba(255, 255, 255, .12);
  --side-hover: rgba(255, 255, 255, .08);
  --side-active: rgba(255, 255, 255, .14);
  --side-trace: #FF5A5F;

  --toast-bg: #0F2342;
  --toast-ink: #FFFFFF;
  --scrim: rgba(6, 22, 48, .46);

  --shadow: 0 1px 2px rgba(10, 30, 70, .05);
  --shadow-lg: 0 24px 56px -16px rgba(8, 28, 64, .30), 0 2px 8px rgba(8, 28, 64, .08);
  --shadow-hover: 0 10px 28px -12px rgba(8, 28, 64, .24);
  --ring: 0 0 0 3px rgba(29, 85, 196, .18);

  /* grafici: palette categoriale validata (contrasto e daltonismo), prima il blu THES */
  --cat-1: #1D55C4;
  --cat-2: #EB6834;
  --cat-3: #1BAF7A;
  --cat-4: #EDA100;
  --cat-5: #E87BA4;
  --cat-6: #008300;
  --cat-7: #6250D6;
  --cat-8: #E34948;
  --chart-5: #6250D6;
  --chart-6: #1BAF7A;
  --chart-7: #E87BA4;
  --chart-8: #6B7280;
}

/* ---- Tema scuro ----------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --brand-red: #FF4D52;

  --bg: #0B1322;
  --surface: #111B2E;
  --surface2: #18243A;
  --row-hover: #16223A;
  --border: #22304A;
  --border-strong: #33425F;

  --text: #E7ECF4;
  --text2: #AAB5C9;
  --text3: #8592AA;

  --accent: #7FA4FF;
  --accent-strong: #A9C2FF;
  --on-accent: #071534;
  --accent-soft: #17284A;
  --accent-border: #2B4576;

  --pos: #4CC38A;
  --pos-soft: #12291F;
  --neg: #FF7A7A;
  --neg-soft: #36181D;
  --warn: #E8A93A;
  --warn-soft: #2F2512;

  --side-bg: #08192F;
  --side-line: rgba(255, 255, 255, .08);
  --side-active: rgba(127, 164, 255, .16);

  --toast-bg: #1D2B45;
  --scrim: rgba(2, 6, 14, .62);

  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .4);
  --shadow-hover: 0 10px 28px -10px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(127, 164, 255, .24);

  --cat-1: #3987E5;
  --cat-2: #D95926;
  --cat-3: #199E70;
  --cat-4: #C98500;
  --cat-5: #D55181;
  --cat-6: #008300;
  --cat-7: #9085E9;
  --cat-8: #E66767;
  --chart-5: #9085E9;
  --chart-6: #199E70;
  --chart-7: #D55181;
  --chart-8: #9CA3AF;
}

/* ---- Alias, tipografia, misure, tempi -------------------------------------- */
:root {
  --ok: var(--pos);
  --ok-soft: var(--pos-soft);
  --danger: var(--neg);
  --danger-soft: var(--neg-soft);
  --info: var(--accent);
  --info-soft: var(--accent-soft);
  --accent-text: var(--on-accent);
  --border2: var(--border-strong);
  --surface3: var(--surface2);
  --neutral-soft: var(--surface2);
  --sidebar: var(--side-bg);
  --chart-1: var(--accent);
  --chart-2: var(--border-strong);
  --chart-3: var(--cat-3);
  --chart-4: var(--cat-4);

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* titoli e numeri grandi in Archivo «espanso», come il logotipo THES */
  --wide: 114%;
  --wider: 122%;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  --sidebar-w: 252px;
  --sidebar-w-mini: 72px;
  --topbar-h: 60px;
  --control-h: 36px;

  --t-fast: .12s;
  --t-med: .2s;
  --ease: cubic-bezier(.2, .6, .35, 1);
  --ease-out: cubic-bezier(.2, .85, .25, 1);
  --t-view: .26s;
  --t-rise: .3s;
  --t-chart: .7s;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 0ms;
    --t-med: 0ms;
  }
}

/* ---- Tutto in maiuscolo (richiesta del 29/10/2026) ----
   Solo a schermo: nel database, negli export e nelle mail i testi restano come
   sono stati scritti. Restano com'erano email, password e le password temporanee
   mostrate all'admin, dove maiuscole e minuscole contano. La classe «caps» su
   <html> la mettono index.html e login.html; dalla ricerca rapida si spegne. */
html.caps body,
html.caps input,
html.caps select,
html.caps textarea,
html.caps button {
  text-transform: uppercase;
}
html.caps input[type="email"],
html.caps input[type="password"],
html.caps input[type="url"],
html.caps input[name="email"],
html.caps a[href^="mailto:"],
html.caps .pw-reveal,
html.caps .no-caps {
  text-transform: none;
}
/* il maiuscolo occupa più spazio: le voci del menu scendono di un punto */
html.caps .nav-label,
html.caps .side-user {
  font-size: 13px;
}
html.caps table.data {
  font-size: 12.5px;
}
html.caps table.data th {
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
