/* UptimeMonitor dark theme. Every colour lives in a token so status pages
   and future themes can reuse them. */
:root {
  --bg: #090d12;
  --bg-elev: #0f151d;
  --bg-card: #121a24;
  --bg-hover: #17212d;
  --bg-input: #0c1219;
  --border: #1f2b3a;
  --border-strong: #2c3b4f;
  --text: #e8eef5;
  --text-muted: #8a99ad;
  --text-faint: #5d6c80;
  --accent: #34d399;
  --accent-ink: #062016;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --up: #34d399;
  --down: #f87171;
  --down-soft: rgba(248, 113, 113, 0.12);
  --pending: #fbbf24;
  --pending-soft: rgba(251, 191, 36, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  --glow: radial-gradient(1200px 520px at 50% -180px, rgba(52, 211, 153, 0.07), transparent 70%);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--glow) no-repeat, var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
::selection { background: rgba(52, 211, 153, 0.28); }

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.35em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.7rem; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 1.02rem; letter-spacing: -0.005em; }
p { margin: 0 0 0.75em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85em; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.top-gap { margin-top: 1rem; }
.stack { display: grid; gap: 0.6rem; }

/* ---------- Shell ---------- */
.shell {
  display: grid; grid-template-columns: 248px 1fr; min-height: 100vh;
  /* Paints the sidebar column past the sticky sidebar on long pages. */
  background: linear-gradient(90deg, var(--bg-elev) 247px, var(--border) 247px 248px, transparent 248px) no-repeat;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.1rem 0.8rem;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.035), transparent 240px), var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.content { padding: 2.25rem clamp(1rem, 4vw, 3rem) 3rem; max-width: 1240px; width: 100%; min-width: 0; }
.bare { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--text); padding: 0.25rem 0.5rem; }
.brand:hover { text-decoration: none; }
.brand.lg { font-size: 1.15rem; margin-bottom: 1.25rem; padding: 0; }
.brand-mark {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft) url("/static/favicon.svg") center / cover;
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 18px rgba(52, 211, 153, 0.18);
}
.brand.lg .brand-mark { width: 32px; height: 32px; border-radius: 9px; }

.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.48rem 0.65rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -0.8rem; top: 0.45rem; bottom: 0.45rem;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav .icon { flex: none; width: 16px; height: 16px; opacity: 0.85; }
.nav a > span:not(.icon) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-section { margin: 0.75rem 0.65rem 0; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }

.org-switcher { position: relative; }
.org-switcher summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); font-weight: 600; transition: border-color 0.12s;
}
.org-switcher summary:hover, .org-switcher[open] summary { border-color: var(--border-strong); }
.org-switcher summary::-webkit-details-marker { display: none; }
.org-switcher summary::after { content: "▾"; margin-left: auto; color: var(--text-muted); }
.org-switcher .menu {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
  display: grid; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-card); box-shadow: var(--shadow);
}
.org-switcher .menu a { padding: 0.4rem 0.55rem; border-radius: 5px; color: var(--text); }
.org-switcher .menu a:hover { background: var(--bg-elev); text-decoration: none; }

.sidebar-foot { margin-top: auto; display: grid; gap: 0.5rem; padding: 0.75rem 0.5rem 0; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 0.5rem; }

.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(96, 165, 250, 0.14));
  color: var(--accent); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18);
  object-fit: cover;
}
.avatar.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 0.75rem; }

/* ---------- Page ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head > div:first-child { min-width: 0; }
.crumbs { color: var(--text-faint); font-size: 0.83rem; margin-bottom: 0.35rem; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.section-head { margin-bottom: 0.9rem; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 120px), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
}
.card + .card, .grid + .card, .stats + .card { margin-top: 1rem; }
.grid > .card, .stats > .card { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.tile { display: flex; align-items: center; gap: 0.85rem; color: var(--text); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.tile:hover { border-color: rgba(52, 211, 153, 0.4); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 1px rgba(52, 211, 153, 0.12); }
.tile-title { font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.stat { position: relative; overflow: hidden; padding: 1.1rem 1.25rem; }
.stat::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--stat-color, var(--border-strong)), transparent);
}
.stat.up { --stat-color: var(--up); }
.stat.down { --stat-color: var(--down); }
.stat.degraded { --stat-color: var(--pending); }
.stat.info { --stat-color: var(--info); }
.stat-label { display: flex; align-items: center; gap: 0.45rem; color: var(--text-muted); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--stat-color, var(--text-faint)); }
.stat-value { margin-top: 0.3rem; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value.up { color: var(--up); }
.stat-value.down { color: var(--down); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state p { max-width: 52ch; margin-inline: auto; }
.empty { text-align: center; }
.empty-code { font-size: 4rem; font-weight: 800; color: var(--border-strong); line-height: 1; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--text-faint); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 0.4rem; padding-bottom: 0.55rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.card > .table, .card > .scroll { margin-inline: -0.6rem; width: calc(100% + 1.2rem); }
.table td a.name { color: var(--text); font-weight: 600; }
.table tr:hover td a.name { color: var(--accent); text-decoration: none; }
.scroll { max-height: 480px; overflow-y: auto; }
.scroll .table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-card); box-shadow: inset 0 -1px 0 var(--border); }
.table td.right { text-align: right; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.14rem 0.6rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; text-transform: capitalize; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge.down .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 6%, transparent); } }
@media (prefers-reduced-motion: reduce) { .badge.down .dot, .status-dot { animation: none !important; } }
.badge.up { color: var(--up); background: var(--accent-soft); border-color: transparent; }
.badge.down { color: var(--down); background: var(--down-soft); border-color: transparent; }
.badge.pending { color: var(--pending); background: var(--pending-soft); border-color: transparent; }
.badge.accent { color: var(--info); background: var(--info-soft); border-color: transparent; text-transform: none; }

/* ---------- Forms ---------- */
label { display: grid; gap: 0.3rem; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; min-width: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:hover, select:hover, textarea:hover { border-color: #3a4d65; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.inline-form input[type="text"], .inline-form input[type="email"] { flex: 1 1 220px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.55rem 0.95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--bg-hover); border-color: #3a4d65; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #45dca5, var(--accent)); border-color: #2fbf8a; color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 14px -4px rgba(52, 211, 153, 0.5);
}
.btn.primary:hover { background: linear-gradient(180deg, #5ee6b4, #3ddc9f); border-color: #34d399; }
.btn.danger { color: var(--down); border-color: rgba(248, 113, 113, 0.35); background: transparent; }
.btn.danger:hover { background: var(--down-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { color: var(--text); background: var(--bg-card); }
.btn.sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.btn.block { width: 100%; }

.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); margin-bottom: 0.9rem; border: 1px solid; }
.alert.error { color: #fecaca; background: var(--down-soft); border-color: rgba(248, 113, 113, 0.35); }

.code {
  font-family: var(--mono); font-size: 0.85rem; white-space: pre-wrap; word-break: break-all;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem; margin: 0.4rem 0 0; user-select: all;
}

/* ---------- Auth ---------- */
.bare { background: radial-gradient(700px 420px at 50% 30%, rgba(52, 211, 153, 0.08), transparent 70%); }
.auth-card { width: min(410px, 100%); padding: 2.25rem; border-color: var(--border-strong); box-shadow: var(--shadow), 0 30px 80px -30px rgba(0, 0, 0, 0.7); }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar { position: static; height: auto; gap: 0.6rem; padding: 0.8rem; }
  .sidebar > .brand { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: none; padding: 0.4rem 0.65rem; }
  .nav a[aria-current="page"]::before { display: none; }
  .nav-section { display: none; }
  .sidebar-foot { margin-top: 0; padding: 0.6rem 0 0; display: flex; align-items: center; justify-content: space-between; }
  .table { display: block; overflow-x: auto; }
  .card > .table, .card > .scroll { margin-inline: 0; width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.6rem; }
}

/* ---------- Local accounts ---------- */
.center { text-align: center; }
.narrow { max-width: 520px; }
.alert.success { color: #bbf7d0; background: var(--accent-soft); border-color: rgba(52, 211, 153, 0.35); }
.alert .code { margin-top: 0.6rem; }
a.me { color: var(--text); padding: 0.3rem; margin: -0.3rem; border-radius: var(--radius-sm); }
a.me:hover, a.me[aria-current="page"] { background: var(--bg-card); text-decoration: none; }
input:disabled { color: var(--text-muted); }

/* ---------- Monitors ---------- */
.block { display: block; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-head.row h2 { margin: 0; }
#monitors + .card, #monitors .stats + .card { margin-top: 1rem; }
.stat-value.degraded { color: var(--pending); }
.down-text { color: var(--down); }
.target { max-width: 42ch; }
.title-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.alert.warn { color: #fde68a; background: var(--pending-soft); border-color: rgba(251, 191, 36, 0.35); }

.type-tile { align-items: flex-start; }
.type-icon {
  flex: none; width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
}
.type-ping::before { content: "ICMP"; font-size: 0.6rem; }
.type-http::before { content: "WWW"; font-size: 0.62rem; }
.type-tcp::before { content: ":443"; font-size: 0.62rem; }
.type-rdp::before { content: "RDP"; }
.type-smtp::before { content: "@"; font-size: 1rem; }
.type-proxmox::before { content: "PVE"; }
.type-docker::before { content: "</>"; }

.form-grid { display: grid; gap: 1rem; max-width: 760px; }
.form-grid .card + .card { margin-top: 0; }
.form-grid h2 { margin-bottom: 0.2rem; }
.row-fields { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.row-fields > label { flex: 1 1 140px; }
.row-fields > label.grow { flex: 3 1 220px; }
.row-fields > label.port { flex: 0 1 130px; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--accent); margin: 0; }
.choices { display: grid; gap: 0.5rem; }
label.choice {
  display: flex; align-items: flex-start; gap: 0.7rem; font-weight: 400; cursor: pointer;
  padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input);
}
label.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.choice input { margin-top: 0.2rem; }
.choice-title { font-weight: 600; }
.form-actions { display: flex; gap: 0.5rem; }

.bars { display: flex; gap: 2px; height: 34px; align-items: stretch; }
.bar { flex: 1 1 0; min-width: 3px; max-width: 10px; border-radius: 3px; background: linear-gradient(180deg, #45dca5, #2fbf8a); opacity: 0.9; transition: transform 0.1s, opacity 0.1s; }
.bar.fail { background: linear-gradient(180deg, #fb8a8a, #ef5b5b); opacity: 1; }
.bar:hover { opacity: 1; transform: scaleY(1.08); }

/* ---------- Alerts ---------- */
.chan-discord::before { content: "DC"; }
.chan-telegram::before { content: "TG"; }
.chan-signal::before { content: "SIG"; font-size: 0.62rem; }
.chan-twilio_sms::before { content: "SMS"; font-size: 0.62rem; }
.chan-twilio_voice::before { content: "CALL"; font-size: 0.58rem; }
.actions.end { justify-content: flex-end; flex-wrap: nowrap; }
.table tr.result-row td { padding: 0; border-bottom: 0; }
.table tr.result-row td:not(:empty) { padding: 0 0.75rem 0.5rem; }
.table tr.result-row .alert { margin: 0; }
.table tr.result-row:hover { background: none; }
textarea { resize: vertical; font-family: var(--mono); font-size: 0.9rem; }
input[type="radio"] { width: 1rem; height: 1rem; accent-color: var(--accent); margin: 0; }
label.choice:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.subchoices { display: grid; gap: 0.45rem; margin: 0; padding: 0.7rem 0.85rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.subchoices legend { padding: 0 0.3rem; }
.alert-to { margin: 0; }
.actions.end .btn { white-space: nowrap; }

/* ---------- Status pages (admin) ---------- */
.prefixed { display: flex; align-items: stretch; }
.prefixed .prefix {
  display: flex; align-items: center; padding: 0 0.6rem; color: var(--text-muted);
  background: var(--bg-elev); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.prefixed input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; flex: 1; min-width: 0; }
.page-monitors td { vertical-align: middle; }
.page-monitors input[type="text"] { width: 100%; min-width: 8rem; }
.page-monitors input.order { width: 5.5rem; }
.domain-card { max-width: 760px; margin-bottom: 1rem; }
.dns-table td:first-child { white-space: nowrap; }
.break { word-break: break-all; }

/* ---------- Status pages (public) ---------- */
.status-body { min-height: 100vh; background: radial-gradient(1000px 460px at 50% -120px, var(--status-glow, rgba(52, 211, 153, 0.09)), transparent 70%) no-repeat, var(--bg); }
.status-body:has(.status-banner.degraded, .status-banner.partial) { --status-glow: rgba(251, 191, 36, 0.08); }
.status-body:has(.status-banner.major) { --status-glow: rgba(248, 113, 113, 0.1); }
.status-wrap { max-width: 880px; margin: 0 auto; padding: 3rem 1.25rem 3rem; }
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.status-brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.status-brand h1 { margin: 0; font-size: 1.75rem; }
.status-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.status-logo { max-height: 40px; max-width: 160px; object-fit: contain; }
.status-desc { margin-bottom: 1.75rem; white-space: pre-line; font-size: 0.98rem; max-width: 62ch; }
.status-banner {
  display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0;
  padding: 1.25rem 1.4rem; border-radius: var(--radius); font-size: 1.15rem; font-weight: 650;
  border: 1px solid var(--border); background: var(--bg-card); box-shadow: var(--shadow);
}
.status-banner-text { display: grid; gap: 0.1rem; }
.status-banner-sub { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.status-banner .status-dot {
  flex: none; width: 14px; height: 14px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 20%, transparent);
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent), 0 0 0 5px color-mix(in srgb, currentColor 20%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent, 0 0 0 5px color-mix(in srgb, currentColor 20%, transparent); }
}
.status-banner.operational { color: var(--up); background: linear-gradient(90deg, rgba(52, 211, 153, 0.16), rgba(52, 211, 153, 0.05)); border-color: rgba(52, 211, 153, 0.35); }
.status-banner.degraded, .status-banner.partial { color: var(--pending); background: linear-gradient(90deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.05)); border-color: rgba(251, 191, 36, 0.35); }
.status-banner.major { color: var(--down); background: linear-gradient(90deg, rgba(248, 113, 113, 0.17), rgba(248, 113, 113, 0.05)); border-color: rgba(248, 113, 113, 0.38); }
.status-banner.unknown { color: var(--text-muted); }
.status-banner.unknown .status-dot { animation: none; }
.status-section { padding: 0.4rem 1.4rem; }
.status-section + .status-section { margin-top: 1.1rem; }
.status-section h2 { margin: 0 -1.4rem; padding: 0.95rem 1.4rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); }
.status-section h2.plain { text-transform: none; letter-spacing: -0.005em; font-size: 1.02rem; color: var(--text); margin-bottom: 1rem; }
.status-monitor { padding: 1.05rem 0; }
.status-monitor + .status-monitor { border-top: 1px solid var(--border); }
.status-monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; }
.status-name { font-weight: 600; font-size: 0.98rem; }
.history { display: flex; gap: 2px; height: 32px; }
.history .day { flex: 1 1 0; min-width: 2px; border-radius: 3px; background: var(--border-strong); opacity: 0.9; transition: opacity 0.1s, transform 0.1s; }
.history .day.up { background: linear-gradient(180deg, #45dca5, #2fbf8a); }
.history .day.minor { background: linear-gradient(180deg, #fcd34d, #f59e0b); }
.history .day.major { background: linear-gradient(180deg, #fb8a8a, #ef5b5b); }
.history .day:hover { opacity: 1; transform: scaleY(1.12); }
.history-legend { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 0.45rem; }
.history-legend .uptime-pct { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.history-legend .rule { flex: 1; height: 1px; background: var(--border); }
.legend-short { display: none; }
.incidents { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0; }
.incidents li { position: relative; display: flex; gap: 0.9rem; align-items: flex-start; padding-bottom: 1rem; }
.incidents li:last-child { padding-bottom: 0; }
.incidents li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 1.3rem; bottom: 0.1rem; width: 2px; background: var(--border); border-radius: 2px; }
.incident-mark { flex: none; width: 12px; height: 12px; margin-top: 0.35rem; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--up); }
.incident-mark.ongoing { border-color: var(--down); background: var(--down); box-shadow: 0 0 0 4px var(--down-soft); }
.no-incidents { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; }
.no-incidents::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.status-foot .powered { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-faint); }
.status-foot .powered .brand-mark { width: 16px; height: 16px; border-radius: 5px; box-shadow: none; }
.preview-bar { text-align: center; padding: 0.5rem; background: var(--info-soft); color: var(--info); font-size: 0.85rem; border-bottom: 1px solid rgba(96, 165, 250, 0.25); }
/* Small screens show the last 30 days. */
@media (max-width: 640px) {
  .status-wrap { padding-top: 2rem; }
  .status-brand h1 { font-size: 1.4rem; }
  .history .day:nth-child(-n+60) { display: none; }
  .history .day { border-radius: 2px; }
  .legend-long { display: none; }
  .legend-short { display: inline; }
  .status-head { flex-wrap: wrap; }
  .status-banner { font-size: 1.02rem; padding: 1rem 1.1rem; }
  .status-section { padding-inline: 1.1rem; }
  .status-section h2 { margin-inline: -1.1rem; padding-inline: 1.1rem; }
}
.name-cell { font-weight: 600; white-space: nowrap; }
.stats + section.card, .stats + .card { margin-top: 1rem; }

/* ---------- Administration ---------- */
.kv { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 0.5rem 1.25rem; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.cols > .card { margin-top: 0; }
.stats + .cols { margin-top: 1rem; }
.search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search input { flex: 1 1 auto; max-width: 420px; }
.card.danger { border-color: rgba(248, 113, 113, 0.3); }
.card.danger h2 { color: var(--down); }
.pager { display: flex; justify-content: flex-end; margin-top: 0.9rem; }
.badge.danger { color: var(--down); background: var(--down-soft); border-color: transparent; }
.chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cols + .card, .cols + section.card { margin-top: 1rem; }
