/* Sedime admin dashboard (docs/ADMIN.md): a technical tool, out of the game's look. Dark graphite, one teal accent, tabular
   numbers, nothing from outside (the CSP allows only the dashboard itself). */
:root {
  --bg: #0e1014;
  --panel: #151920;
  --panel-2: #1b2029;
  --line: #262c37;
  --text: #e4e7ec;
  --muted: #8a93a3;
  --accent: #4fb3a9;
  --accent-2: #2f7f78;
  --ok: #5cc08a;
  --warn: #e0a84f;
  --bad: #e5615b;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; color: #cfd4dc; }
small { font-weight: 400; }
.muted { color: var(--muted); }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #12151b, #0f1217); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.02em; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: conic-gradient(from 210deg, var(--accent), #3c6fb6, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { color: #b9c0cc; padding: 8px 10px; border-radius: 8px; }
nav a:hover { background: var(--panel-2); color: var(--text); }
nav a.on { background: rgba(79, 179, 169, 0.12); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.who { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }

main { padding: 26px 32px 48px; max-width: 1400px; width: 100%; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

.panel, .card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi strong { display: block; font-size: 30px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; }
.kpi.warn strong { color: var(--warn); }

.live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.meter { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 8px; }
.meter span { color: var(--muted); font-size: 12px; }
.meter strong { display: block; font-size: 20px; font-weight: 600; margin: 2px 0 6px; }
.meter canvas { width: 100%; height: 42px; display: block; }

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.chart figcaption { color: #cfd4dc; font-size: 13px; margin-bottom: 6px; }
.chart canvas { width: 100%; height: 180px; display: block; }
.chart-note { font-size: 12px; margin: 4px 0 0; min-height: 1em; }
.ranges { margin-left: auto; display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.ranges button { background: none; border: 0; color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.ranges a { color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 12px; text-decoration: none; }
.ranges a.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.ranges button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.grid td { padding: 9px 10px; border-bottom: 1px solid rgba(38, 44, 55, 0.6); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.grid.compact td, .grid.compact th { padding: 6px 10px; }
.num, .grid th.num, .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(92, 192, 138, 0.35); background: rgba(92, 192, 138, 0.08); }
.pill.warn { color: var(--warn); border-color: rgba(224, 168, 79, 0.35); background: rgba(224, 168, 79, 0.08); }
.pill.bad { color: var(--bad); border-color: rgba(229, 97, 91, 0.35); background: rgba(229, 97, 91, 0.08); }

.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 500; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input[name="message"], form.inline input[name="text"] { flex: 1 1 320px; }
form.closure input[name="reason"] { flex: 1 1 240px; }
.panel.maintenance { border-color: var(--bad); }
.panel.maintenance form { display: flex; gap: 12px; align-items: center; }
.server-switch.closed { border-color: var(--bad); }

input, button { font: inherit; color: inherit; }
input {
  background: #0f1217; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0;
}
input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(79, 179, 169, 0.15); }
input[type="number"] { width: 70px; }
input[type="checkbox"] { accent-color: var(--accent); }
label.small { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
button:hover { border-color: #39414f; }
button.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
button.primary:hover { background: #378f87; }
button.warn { border-color: rgba(224, 168, 79, 0.5); color: var(--warn); }
button.danger { border-color: rgba(229, 97, 91, 0.5); color: var(--bad); }
button.small { padding: 4px 10px; font-size: 12px; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); }

.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--line); }
.flash.ok { border-color: rgba(92, 192, 138, 0.4); background: rgba(92, 192, 138, 0.08); }
.flash.bad { border-color: rgba(229, 97, 91, 0.4); background: rgba(229, 97, 91, 0.08); }
.note { background: rgba(229, 97, 91, 0.08); border: 1px solid rgba(229, 97, 91, 0.3); border-radius: 8px; padding: 8px 12px; }
.note.warn { background: rgba(224, 168, 79, 0.08); border-color: rgba(224, 168, 79, 0.3); }
.search input { width: 260px; }

body.gate { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #13202a, var(--bg)); }
.login { width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.login h1 { margin-top: 8px; }
.login p { margin: 0; }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.login .note { background: rgba(229, 97, 91, 0.08); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .kpis, .live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
  main { padding: 18px 16px 40px; }
  .grid { display: block; overflow-x: auto; }
}
select { font: inherit; color: inherit; background: #0f1217; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
form.filters input[name="testo"] { flex: 1 1 240px; }
.logs td { vertical-align: top; }
.logs summary { cursor: pointer; list-style: none; word-break: break-word; }
.logs summary::-webkit-details-marker { display: none; }
.logs pre { white-space: pre-wrap; word-break: break-all; background: #0f1217; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px; margin: 8px 0 0; color: #b9c0cc; }
/* the infrastructure view (25/10): who is struggling, the traffic light, the bars of the cluster */
.health { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.findings li { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.findings li strong { margin-right: 8px; }
.findings li.bad { border-color: rgba(229, 97, 91, 0.45); background: rgba(229, 97, 91, 0.08); }
.findings li.warn { border-color: rgba(224, 168, 79, 0.45); background: rgba(224, 168, 79, 0.07); }
.findings li.ok { border-color: rgba(92, 192, 138, 0.4); background: rgba(92, 192, 138, 0.07); }
.light .lamp { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.light .lamp span { width: 22px; height: 22px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
.light .lamp strong { font-size: 18px; }
.light-ok .lamp span { background: var(--ok); box-shadow: 0 0 18px rgba(92, 192, 138, 0.55); }
.light-warn .lamp span { background: var(--warn); box-shadow: 0 0 18px rgba(224, 168, 79, 0.55); }
.light-bad .lamp span { background: var(--bad); box-shadow: 0 0 18px rgba(229, 97, 91, 0.6); }
.reasons { margin: 0; padding-left: 18px; color: #cfd4dc; }
.small-print { font-size: 12px; margin: 10px 0 0; }
h3.group { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; margin: 18px 0 10px; }
h3.group:first-of-type { margin-top: 4px; }
.txt-ok { color: inherit; }
.txt-warn { color: var(--warn); }
.txt-bad { color: var(--bad); }
td.usage { min-width: 170px; font-size: 12.5px; }
.meterbar { height: 6px; background: #0f1217; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.meterbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.meterbar i.warn { background: var(--warn); }
.meterbar i.bad { background: var(--bad); }
.job { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.inline-end { margin-left: auto; }
@media (max-width: 900px) { .health { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.maps-head { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.maps-head h3 { margin: 0; font-size: 14px; }
.maps-head h3 .muted { font-weight: 400; margin-left: 6px; }
.grid.maps tr.resting td { color: var(--muted); }
.grid.maps td.num, .grid.maps td:nth-child(2), #live-channels td[data-f="awake"] { white-space: nowrap; }
