/* Light only (the user, 2026-11-03): no dark mode, no media query. The values are the light
   column of the validated default palette of the dataviz method. */
:root {
  color-scheme: light;
  --surface-0: #f4f4f2;
  --surface-1: #fcfcfb;
  --surface-2: #ededea;
  --border: #d9d8d2;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7d7c75;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --good: #008300;
  --warning: #b87a00;
  --critical: #e34948;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface-0); color: var(--text-primary);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.error { color: var(--critical); min-height: 1.4em; margin-top: 8px; }
button { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
button:hover { border-color: var(--text-muted); }
button.active { background: var(--series-1); border-color: var(--series-1); color: #fff; }
button.ghost { background: transparent; }
button.danger { border-color: var(--critical); color: var(--critical); }
button:disabled { opacity: .5; cursor: default; }
input, select { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; font: inherit; }

#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
#login form { background: var(--surface-1); padding: 32px; border-radius: 12px; width: 320px;
  display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); }
#login h1 { margin: 0 0 8px; font-weight: 500; }
#login label { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); }
#login p { margin: 0; font-size: 13px; }
#totp-qr { width: 220px; height: 220px; align-self: center; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
#totp-secret { user-select: all; font-size: 13px; }
#password-dialog { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 8; }
#password-dialog form { background: var(--surface-1); padding: 24px; border-radius: 12px; width: 340px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); }
#password-dialog h1 { margin: 0; font-size: 18px; font-weight: 500; }
#password-dialog label { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); }
.row { display: flex; gap: 8px; }

header { display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-1); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 600; font-size: 18px; }
.spacer { flex: 1; }
.range { display: flex; gap: 4px; }
main { padding: 16px 20px 60px; max-width: 1500px; margin: 0 auto; }
section { margin-bottom: 36px; }
h2 { font-weight: 500; font-size: 16px; color: var(--text-secondary); margin: 0 0 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs button { padding: 3px 9px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.card .title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card .title b { font-size: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); display: inline-block; }
.dot.on { background: var(--good); }
.dot.off { background: var(--critical); }
.card .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-variant-numeric: tabular-nums; }
.card .stats span { color: var(--text-muted); }
.card .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card .actions button { padding: 3px 8px; font-size: 13px; }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; }
.chart { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.chart .ctitle { color: var(--text-secondary); margin-bottom: 4px; display: flex; justify-content: space-between; }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart .axis text { fill: var(--text-muted); font-size: 11px; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: fixed; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 9px; font-size: 12px; z-index: 5; white-space: nowrap; color: var(--text-primary); }
.tip .k { color: var(--text-secondary); }
.chart .empty { color: var(--text-muted); padding: 60px 0; text-align: center; }

table.log { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.log td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.log td.ts { color: var(--text-muted); white-space: nowrap; }
table.log td.comp { white-space: nowrap; font-weight: 500; }
table.log td.text { white-space: pre-wrap; word-break: break-word; }
table.log tr.alert td.text { color: var(--warning); }
.status-done { color: var(--good); }
.status-failed { color: var(--critical); }
.status-sent { color: var(--warning); }
#shot img { max-width: 100%; margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2);
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 8px; z-index: 9; }
