/*
 * Tema condiviso "pannello industriale": sfondo scuro, monospace, indicatori a LED
 * (verde=ok, ambra=warning, rosso=error, grigio=idle), bordi da rack di controllo.
 * Nessun font/risorsa esterna: solo stack di sistema, funziona offline sulla VPS.
 * Il logo/colore accento del tenant si sovrascrive a runtime via variabili CSS
 * (vedi applyBranding() in app.js) — non toccare questo file per un tema per-cliente.
 */
:root {
  --bg: #14171a;
  --panel: #1b1f23;
  --panel-raised: #22272c;
  --border: #33393f;
  --text: #d8dee4;
  --text-dim: #838d97;
  --accent: #4da3ff;   /* sovrascritto per tenant via --accent inline */
  --led-ok: #3ecf6e;
  --led-warning: #e8a33d;
  --led-error: #e5484d;
  --led-idle: #5a636b;
  --font-mono: ui-monospace, "SF Mono", "IBM Plex Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.rack {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.panel-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--text-dim);
}

h1, h2, h3 { font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 18px; letter-spacing: 0.02em; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }

a { color: var(--accent); }

label { display: block; font-size: 12px; color: var(--text-dim); margin: 10px 0 4px; }

input, select, textarea {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 3px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

button {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--accent);
  color: #08101c;
  border: none;
  padding: 9px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--panel-raised); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--led-error); color: #200; }

/* --- LED di stato --- */
.led {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 4px currentColor;
}
.led.ok { background: var(--led-ok); color: var(--led-ok); }
.led.warning { background: var(--led-warning); color: var(--led-warning); }
.led.error { background: var(--led-error); color: var(--led-error); }
.led.idle { background: var(--led-idle); color: var(--led-idle); }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge.golden { color: #e8c33d; border-color: #4a3f1a; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255,255,255,0.02); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.muted { color: var(--text-dim); font-size: 12px; }
.error-box {
  background: rgba(229,72,77,0.08);
  border: 1px solid var(--led-error);
  color: #ff9a9c;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 13px;
  margin: 10px 0;
}
.hint-box {
  background: rgba(77,163,255,0.06);
  border: 1px solid var(--accent);
  padding: 12px 14px;
  border-radius: 3px;
  margin: 10px 0;
}

.choices { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.brand-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brand-header img { height: 28px; }
.brand-header .name { font-size: 16px; font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs button { background: var(--panel-raised); color: var(--text-dim); border: 1px solid var(--border); }
.tabs button.active { background: var(--accent); color: #08101c; border-color: var(--accent); }

.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-tile { background: var(--panel-raised); border: 1px solid var(--border); border-radius: 3px; padding: 12px; }
.stat-tile .value { font-size: 22px; font-weight: 700; }
.stat-tile .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
