/*
 * Token del marchio Tomasi (brain/tomasi/brand-style.md), unica fonte dei colori.
 * Un solo accento: il rosso del marchio, solo per l'occhiello e la barretta di firma.
 * Gli stati usano i colori semantici, che NON sono il rosso del marchio.
 * Ogni stato ha anche una forma (pieno, contorno, tratteggio, simbolo): non si legge solo col colore.
 */
:root {
  --brand: #D2232A;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: Calibri, Carlito, 'Segoe UI', Arial, sans-serif;
  --font-occhiello: 'Trebuchet MS', Calibri, Carlito, Arial, sans-serif;

  --radius: 6px;

  /* chiaro */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #eef0f3;
  --text: #17181a;
  --text-2: #54585f;
  --text-3: #6b7079;
  --line: #e6e8ec;
  --line-2: #d4d7dd;
  --band: #17181a;
  --band-text: #ffffff;
  --band-text-2: #b3b8c0;

  --ok: #0b7a45;
  --ok-fill: #0f9d58;
  --ok-bg: #e7f5ee;
  --att: #a14a07;
  --att-fill: #d97706;
  --att-bg: #fdf1e3;
  --crit: #b91c1c;
  --crit-fill: #c62828;
  --crit-bg: #fbe9e9;
  --none: #6b7079;
  --none-fill: #a9aeb6;
  --none-bg: #eef0f3;
  --ver: #5b3fa8;
  --ver-fill: #6d4fc2;
  --ver-bg: #efebfa;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0c0e;
  --surface: #16171a;
  --surface-2: #1d1f23;
  --surface-3: #25282d;
  --text: #f4f5f7;
  --text-2: #c2c7cf;
  --text-3: #959ba5;
  --line: #2a2d33;
  --line-2: #3a3e45;
  --band: #000000;
  --band-text: #ffffff;
  --band-text-2: #a9aeb6;

  --ok: #4fd18b;
  --ok-fill: #2fb36d;
  --ok-bg: #12291d;
  --att: #ffb547;
  --att-fill: #f29d1f;
  --att-bg: #2e2210;
  --crit: #ff6b63;
  --crit-fill: #e5413a;
  --crit-bg: #33130f;
  --none: #a9aeb6;
  --none-fill: #5d636c;
  --none-bg: #1f2125;
  --ver: #b9a6ff;
  --ver-fill: #8a6df0;
  --ver-bg: #221b38;

  color-scheme: dark;
}

/* Un tema non scelto segue il sistema. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0c0e; --surface: #16171a; --surface-2: #1d1f23; --surface-3: #25282d;
    --text: #f4f5f7; --text-2: #c2c7cf; --text-3: #959ba5; --line: #2a2d33; --line-2: #3a3e45;
    --band: #000000; --band-text: #ffffff; --band-text-2: #a9aeb6;
    --ok: #4fd18b; --ok-fill: #2fb36d; --ok-bg: #12291d;
    --att: #ffb547; --att-fill: #f29d1f; --att-bg: #2e2210;
    --crit: #ff6b63; --crit-fill: #e5413a; --crit-bg: #33130f;
    --none: #a9aeb6; --none-fill: #5d636c; --none-bg: #1f2125;
    --ver: #b9a6ff; --ver-fill: #8a6df0; --ver-bg: #221b38;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums lining-nums; }

/* Esiti: una classe per stato, colore + forma */
.e-nei-tempi { --c: var(--ok); --cf: var(--ok-fill); --cb: var(--ok-bg); }
.e-oltre-obiettivo { --c: var(--att); --cf: var(--att-fill); --cb: var(--att-bg); }
.e-oltre-preventivo { --c: var(--crit); --cf: var(--crit-fill); --cb: var(--crit-bg); }
.e-senza-riferimento { --c: var(--none); --cf: var(--none-fill); --cb: var(--none-bg); }
.e-da-verificare { --c: var(--ver); --cf: var(--ver-fill); --cb: var(--ver-bg); }
.e-vuoto { --c: var(--text-3); --cf: var(--line-2); --cb: var(--surface-2); }

/* Firma Tomasi: occhiello rosso maiuscolo + barretta */
.occhiello {
  font-family: var(--font-occhiello);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
}
.barretta { display: block; width: 40px; height: 3px; background: var(--brand); }

/* Un dato simulato (in arrivo) si riconosce: sottolineato a puntini */
.sim { text-decoration: underline dotted; text-decoration-color: var(--text-3); text-underline-offset: 0.18em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
