/* ═══════════════════════════════════════════
   DASHBOARD FASE — Tabellone Maxi-Schermo
   Stile industriale verde scuro
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg: #0a0f0a;
  --green: #1b4332;
  --green-light: #2d6a4f;
  --gold: #d4a017;
  --gold-dim: #b8860b;
  --white: #f0ede6;
  --white-dim: #a8a8a0;
  --red: #dc2626;
  --orange: #f59e0b;
  --blue: #60a5fa;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--white);
}

.board {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #162416 0%, #0a0f0a 100%);
}

/* ── HEADER ──────────────────────────── */

.board__header {
  background: var(--green);
  padding: 2.5vh 0;
  text-align: center;
  border-bottom: 3px solid var(--green-light);
  flex-shrink: 0;
}

.board__fase {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 5vh;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--white);
}

/* ── CENTER ──────────────────────────── */

.board__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh 4vw;
}

.board__label {
  font-family: var(--font-body);
  font-size: 2.2vh;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--white-dim);
  margin-bottom: 1vh;
  padding: 0.8vh 3vw;
  border-top: 1px solid rgba(255,255,255,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.board__targa {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 6vh;
  letter-spacing: 4px;
  color: var(--white-dim);
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.board__timer {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14vh;
  color: #22c55e;
  letter-spacing: 4px;
  margin-top: 1vh;
  transition: color 0.5s;
}

.board__timer.attenzione { color: #f59e0b; }
.board__timer.critico { color: #dc2626; animation: pulse 1s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.board__std {
  font-family: var(--font-body);
  font-size: 2.8vh;
  color: var(--white-dim);
  margin-top: 0.5vh;
  letter-spacing: 2px;
}

.board__stato {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.8vh;
  margin-top: 1.5vh;
  padding: 0.6vh 3vw;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.board__stato.ok { color: #22c55e; }
.board__stato.attenzione { color: var(--orange); background: rgba(245,158,11,0.12); }
.board__stato.critico { color: var(--red); background: rgba(220,38,38,0.15); }
.board__stato.libero { color: var(--white-dim); }

.board__operatore {
  font-family: var(--font-body);
  font-size: 2vh;
  color: var(--white-dim);
  margin-top: 1vh;
}

/* Centro quando nessun veicolo */
.board__center--idle .board__targa {
  font-size: 6vh;
  color: var(--white-dim);
}

.board__center--idle .board__timer {
  display: none;
}

/* ── FOOTER KPI ──────────────────────── */

.board__footer {
  background: var(--green);
  border-top: 3px solid var(--green-light);
  padding: 2vh 4vw;
  flex-shrink: 0;
}

.board__kpi {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.kpi {
  text-align: center;
}

.kpi__label {
  font-family: var(--font-body);
  font-size: 1.6vh;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--white-dim);
  margin-bottom: 0.5vh;
}

.kpi__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 4.5vh;
  color: var(--white);
}

/* === Colori per tempo trascorso vs STD (porting da .board__* a .zone__*) === */
.zone__timer.attenzione { color: #f59e0b; }
.zone__timer.critico    { color: #dc2626; animation: pulse 1s ease-in-out infinite; }

.zone__stato.attenzione { color: #f59e0b; background: rgba(245,158,11,0.15); padding: 4px 12px; border-radius: 6px; }
.zone__stato.critico    { color: #dc2626; background: rgba(220,38,38,0.18); padding: 4px 12px; border-radius: 6px; font-weight: 700; }
.zone__stato.pausa      { color: #6366f1; background: rgba(99,102,241,0.15); padding: 4px 12px; border-radius: 6px; }

/* Bordo+background della zone intera per visibilita a distanza */
.zone.zone--critico    { background: rgba(220,38,38,0.08); border: 2px solid #dc2626; }
.zone.zone--attenzione { background: rgba(245,158,11,0.08); border: 2px solid #f59e0b; }
