/* Whitelab Brand Guidelines 2026 tokens, as in whitelab-whitetec-nextjs/styles/variables.css. */
:root {
  color-scheme: light;
  --bg: #f1f1f1;
  --panel: #ffffff;
  --panel-muted: #f7f7f7;
  --border: rgba(60, 60, 60, 0.12);
  --border-strong: rgba(60, 60, 60, 0.22);
  --text: #3c3c3c;
  --muted: #6b6b6b;
  --muted-soft: #9a9a9a;
  --primary: #d32378;
  --primary-soft: #fce8f1;
  --petrol: #004f5a;
  --petrol-soft: #eaf2f3;
  --series: #2a8794;
  --grid: rgba(60, 60, 60, 0.1);
  --up: #147d5b;
  --up-soft: #e7f7ef;
  --warn: #a46300;
  --warn-soft: #fff4d9;
  --down: #ba1a1a;
  --down-soft: #fff0f0;
  --unknown: #b5b5b5;
  --bar-empty: #e3e3e3;
  --shadow: 0 1px 2px rgba(60, 60, 60, 0.06), 0 8px 24px rgba(60, 60, 60, 0.06);
  --glass: rgba(241, 241, 241, 0.78);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Poppins, var(--font);
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1f23;
    --panel: #122c31;
    --panel-muted: #183840;
    --border: rgba(200, 210, 212, 0.13);
    --border-strong: rgba(200, 210, 212, 0.24);
    --text: #f1f1f1;
    --muted: #c2c8c9;
    --muted-soft: #94a0a2;
    --primary: #ff5aa4;
    --primary-soft: #3c1530;
    --petrol: #4fb3c0;
    --petrol-soft: #123940;
    --series: #37c8d6;
    --grid: rgba(200, 210, 212, 0.12);
    --up: #79dca9;
    --up-soft: #14392f;
    --warn: #ffd166;
    --warn-soft: #3b2f14;
    --down: #ff8b8b;
    --down-soft: #3d1f23;
    --unknown: #5b6d70;
    --bar-empty: #1f4047;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.2);
    --glass: rgba(11, 31, 35, 0.78);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1f23;
  --panel: #122c31;
  --panel-muted: #183840;
  --border: rgba(200, 210, 212, 0.13);
  --border-strong: rgba(200, 210, 212, 0.24);
  --text: #f1f1f1;
  --muted: #c2c8c9;
  --muted-soft: #94a0a2;
  --primary: #ff5aa4;
  --primary-soft: #3c1530;
  --petrol: #4fb3c0;
  --petrol-soft: #123940;
  --series: #37c8d6;
  --grid: rgba(200, 210, 212, 0.12);
  --up: #79dca9;
  --up-soft: #14392f;
  --warn: #ffd166;
  --warn-soft: #3b2f14;
  --down: #ff8b8b;
  --down-soft: #3d1f23;
  --unknown: #5b6d70;
  --bar-empty: #1f4047;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.2);
  --glass: rgba(11, 31, 35, 0.78);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-word { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.brand-tag {
  font-size: 12px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 9px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.updated { font-size: 13px; color: var(--muted); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--panel); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: block; }
}

/* Hero */
.hero {
  display: flex; gap: 20px; align-items: flex-start;
  margin: 32px 0 20px; padding: 28px 28px;
  border-radius: var(--r-xl); border: 1px solid var(--border);
  background: var(--panel); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--unknown);
}
.hero[data-overall="operational"]::before { background: var(--up); }
.hero[data-overall="degraded"]::before { background: var(--warn); }
.hero[data-overall="outage"]::before { background: var(--down); }
.hero-icon {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel-muted);
}
.hero-icon svg { width: 26px; height: 26px; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hero[data-overall="operational"] .hero-icon { background: var(--up-soft); color: var(--up); }
.hero[data-overall="degraded"] .hero-icon { background: var(--warn-soft); color: var(--warn); }
.hero[data-overall="outage"] .hero-icon { background: var(--down-soft); color: var(--down); }
.hero-icon svg { stroke: currentColor; }
.hero h1 { font-size: 28px; line-height: 1.25; margin-top: 8px; }
.problems { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--muted); }
.problems li::before { content: "•"; margin-right: 8px; color: var(--muted-soft); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); }

/* Section nav */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; margin: 24px 0 8px;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tabs a {
  white-space: nowrap; padding: 10px 12px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--primary); }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font-size: 20px; }
.section-head p { margin: 0; font-size: 13px; }
.stack { display: grid; gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}

/* Status label: a dot and a word, never colour alone */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); flex: none; }
.st-up .dot, .dot.st-up { background: var(--up); }
.st-degraded .dot, .dot.st-degraded { background: var(--warn); }
.st-down .dot, .dot.st-down { background: var(--down); }
.st-up { color: var(--up); }
.st-degraded { color: var(--warn); }
.st-down { color: var(--down); }
.st-unknown { color: var(--muted); }
.st-down .dot { box-shadow: 0 0 0 0 var(--down); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--down-soft); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .st-down .dot { animation: none; } html { scroll-behavior: auto; } }

/* Service groups */
.group-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.group-head h3 { font-size: 15px; }
.row {
  display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(240px, 2fr);
  gap: 16px; align-items: center; padding: 12px 18px;
}
.row + .row { border-top: 1px solid var(--border); }
.svc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.svc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted);
}
.env-prod { background: var(--petrol-soft); color: var(--petrol); border-color: transparent; }
.meta { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); min-width: 0; }
.meta .ver { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uptime { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bars { display: flex; gap: 2px; height: 28px; flex: 1; min-width: 0; align-items: stretch; }
.bars span { flex: 1; min-width: 2px; border-radius: 2px; background: var(--bar-empty); }
.bars span.b-up { background: var(--up); opacity: 0.85; }
.bars span.b-warn { background: var(--warn); }
.bars span.b-down { background: var(--down); }
.bars span:hover { opacity: 1; transform: scaleY(1.08); }
.pct { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); width: 58px; text-align: right; flex: none; }

/* Functions */
.fn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fn-card .group-head { border-bottom: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 3px 9px; border-radius: 999px; background: var(--panel-muted); border: 1px solid var(--border);
}
.empty { padding: 18px; color: var(--muted); font-size: 14px; }

/* Jobs table */
.table-card { overflow-x: auto; }
table.jobs { width: 100%; border-collapse: collapse; font-size: 14px; }
.jobs th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.jobs td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.jobs tr:last-child td { border-bottom: 0; }
.jobs td.when { white-space: nowrap; color: var(--muted); font-size: 13px; }
.jobs .detail { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

/* Infrastructure */
.infra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.infra { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.infra-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.infra-name { font-weight: 600; overflow-wrap: anywhere; }
.kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.infra-detail { font-size: 13px; color: var(--muted); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chart-label b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 64px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .area { fill: var(--series); opacity: 0.1; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .cross { stroke: var(--muted-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .marker { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--series); border: 2px solid var(--panel); transform: translate(-50%, -50%); pointer-events: none; }
.nodata { font-size: 12px; color: var(--muted-soft); height: 64px; display: grid; place-items: center; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.meter { height: 6px; border-radius: 999px; background: var(--petrol-soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--series); border-radius: 999px; }
.meter.hot i { background: var(--warn); }
.meter.crit i { background: var(--down); }

/* DigitalOcean */
.do-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; }
.do-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); gap: 10px; font-size: 14px; }
.incident { padding: 12px 18px; font-size: 14px; border-top: 1px solid var(--border); }

.footer { padding-top: 40px; padding-bottom: 48px; font-size: 13px; }
.footer p { margin: 4px 0; }

/* Tooltip */
.tip {
  position: fixed; z-index: 30; pointer-events: none;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; line-height: 1.4; padding: 6px 10px; border-radius: var(--r-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); max-width: 260px;
}
.tip b { font-weight: 600; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .fn-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .row .uptime { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 20px; gap: 14px; margin-top: 20px; }
  .hero h1 { font-size: 22px; margin-top: 4px; }
  .hero-icon { width: 42px; height: 42px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .meta { flex-direction: row; gap: 10px; flex-wrap: wrap; }
  .hide-sm { display: none; }
  .updated { display: none; }
  .charts { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: 1fr; }
}
.small { font-size: 13px; }
.count { font-weight: 400; font-size: 13px; }
.fn-body { padding: 16px 18px; display: grid; gap: 10px; }
.fn-count { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fn-count small { font-size: 14px; font-weight: 500; color: var(--muted); }
.area { grid-template-columns: minmax(170px, 1.2fr) minmax(120px, 0.8fr) minmax(240px, 2fr); }
.signin { padding: 20px 22px; display: grid; gap: 14px; }
.signin h2 { font-size: 17px; }
.signin p { margin: 4px 0 0; font-size: 14px; }
.signin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signin input {
  flex: 1; min-width: 200px; height: 40px; padding: 0 12px; font: inherit; color: var(--text);
  background: var(--panel-muted); border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.signin input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.primary-btn {
  height: 40px; padding: 0 18px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: var(--primary); color: #fff; font: 600 14px/1 var(--display);
}
.primary-btn:hover { filter: brightness(1.08); }
.signin-error { color: var(--down); font-size: 13px; min-height: 1em; margin: 0; }
.text-btn { background: none; border: 0; color: var(--muted); font: 500 13px var(--font); cursor: pointer; padding: 6px 4px; }
.text-btn:hover { color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 860px) {
  .area { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .area { grid-template-columns: 1fr; }
  .area .meta { display: none; }
}
