/* =========================================================
   TMJ Dashboard — design tokens
   ========================================================= */
:root {
  --bg: #f4f5f9; --panel: #ffffff; --panel-2: #f8f9fc; --hover: #f3f5fa;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --border: #e5e8f0; --border-2: #d6dbe5;
  --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #eef0ff; --accent-ink: #3730a3;
  --up: #12875a; --down: #d92d2d; --warn: #b26a00; --pending: #94a3b8; --paused: #64748b;
  --up-soft: #e4f6ee; --down-soft: #fdecec; --warn-soft: #fdf3e0; --neutral-soft: #eef1f6;
  --up-bar: #1ea672; --chart-line: #4f46e5; --chart-grid: #edf0f5;
  --side-bg: #0f1630; --side-2: #18213f; --side-text: #c7cde0; --side-muted: #7c86a6; --side-line: #222c4d; --side-accent: #8b93ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f1c; --panel: #121829; --panel-2: #161d31; --hover: #19213a;
    --text: #e7eaf3; --text-2: #c5cbdb; --muted: #8b94ad; --faint: #5f6884;
    --border: #212a42; --border-2: #2c3653;
    --accent: #7c83ff; --accent-2: #969cff; --accent-soft: #1f2347; --accent-ink: #b9bdff;
    --up: #38c98a; --down: #f46b6b; --warn: #f0a83c; --pending: #5f6884; --paused: #8b94ad;
    --up-soft: #10281f; --down-soft: #2f1619; --warn-soft: #2d2312; --neutral-soft: #1b2236;
    --up-bar: #2fb67b; --chart-line: #858cff; --chart-grid: #1e2640;
    --side-bg: #080b16; --side-2: #121a33; --side-text: #c7cde0; --side-muted: #69739a; --side-line: #1a2240; --side-accent: #8b93ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-md: 0 4px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f1c; --panel: #121829; --panel-2: #161d31; --hover: #19213a;
  --text: #e7eaf3; --text-2: #c5cbdb; --muted: #8b94ad; --faint: #5f6884;
  --border: #212a42; --border-2: #2c3653;
  --accent: #7c83ff; --accent-2: #969cff; --accent-soft: #1f2347; --accent-ink: #b9bdff;
  --up: #38c98a; --down: #f46b6b; --warn: #f0a83c; --pending: #5f6884; --paused: #8b94ad;
  --up-soft: #10281f; --down-soft: #2f1619; --warn-soft: #2d2312; --neutral-soft: #1b2236;
  --up-bar: #2fb67b; --chart-line: #858cff; --chart-grid: #1e2640;
  --side-bg: #080b16; --side-2: #121a33; --side-text: #c7cde0; --side-muted: #69739a; --side-line: #1a2240; --side-accent: #8b93ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-md: 0 4px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* =========================================================
   Base
   ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); border-radius: 9px; padding: 7px 13px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--down); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy svg { animation: spin 1s linear infinite; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .dotn { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--panel); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   App shell: sidebar + content
   ========================================================= */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; color: #fff; text-decoration: none !important; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em; flex: none; box-shadow: 0 4px 14px rgba(99, 102, 241, .45); }
.side-brand b { display: block; font-size: 15.5px; line-height: 1.2; }
.side-brand small { display: block; font-size: 11.5px; color: var(--side-muted); line-height: 1.3; }
.nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-text); font-size: 13.5px; font-weight: 500; text-decoration: none !important; margin-bottom: 2px; transition: background .12s, color .12s; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--side-accent); }
.nav a.on svg { color: var(--side-accent); }
.nav a svg { width: 18px; height: 18px; color: var(--side-muted); }
.nav a .cnt { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--side-line); color: var(--side-text); }
.nav a .cnt.bad { background: #dc2626; color: #fff; }
.nav a .cnt.warn { background: #b45309; color: #fff; }
.side-status { margin: 18px 4px 0; padding: 12px; border-radius: 10px; background: var(--side-2); font-size: 12px; color: var(--side-muted); }
.side-status b { color: #fff; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--side-line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.me .av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; flex: none; }
.me b { display: block; color: #fff; font-size: 13.5px; line-height: 1.2; }
.me small { color: var(--side-muted); font-size: 12px; }
.me .out { margin-left: auto; color: var(--side-muted); background: none; border: 0; padding: 6px; border-radius: 7px; }
.me .out:hover { color: #fff; background: var(--side-2); }
.side-bg { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.menu-btn { display: none; }
.crumbs { min-width: 0; }
.crumbs h1 { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs small { color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.gsearch { position: relative; width: 300px; }
.gsearch > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.gsearch input { width: 100%; height: 38px; padding: 0 40px 0 34px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 10px; font-size: 13.5px; }
.gsearch input:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.gsearch kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px ui-monospace, monospace; color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; background: var(--panel); }
.results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; max-height: 360px; overflow-y: auto; }
.results a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--text); text-decoration: none !important; }
.results a:hover, .results a.on { background: var(--hover); }
.results .none { padding: 12px; color: var(--muted); font-size: 13px; }
.livepill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--pending); flex: none; }
.livepill.on .pulse { background: var(--up); animation: pulse 2s infinite; }
.livepill.on b { color: var(--up); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pop { position: absolute; right: 0; top: 46px; width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.pop-list { max-height: 380px; overflow-y: auto; }
.pop-f { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.rel { position: relative; }

.view { padding: 26px 28px 40px; width: 100%; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* footer */
.foot { margin-top: auto; border-top: 1px solid var(--border); padding: 16px 28px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.foot .sep { opacity: .5; margin: 0 6px; }

/* =========================================================
   Cards, KPIs, grids
   ========================================================= */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }
.link-more { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-top span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi-ic.g { background: var(--up-soft); color: var(--up); } .kpi-ic.r { background: var(--down-soft); color: var(--down); } .kpi-ic.y { background: var(--warn-soft); color: var(--warn); }
.kpi-v { font-size: 27px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi-s { font-size: 12.5px; color: var(--muted); }
.kpi-s .bad { color: var(--down); font-weight: 650; } .kpi-s .good { color: var(--up); font-weight: 650; } .kpi-s .warn { color: var(--warn); font-weight: 650; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.banner.ok { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 28%, transparent); }
.banner.bad { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner .b-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: var(--up); }
.banner.bad .b-ic { background: var(--down); } .banner.warn .b-ic { background: var(--warn); }
.banner b { display: block; font-size: 15px; }
.banner span { color: var(--text-2); font-size: 13px; }

/* =========================================================
   Tables
   ========================================================= */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.c, .tbl td.c { text-align: center; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; transition: background .1s; }
.tbl tbody tr.click:hover { background: var(--hover); }
.tbl tr.is-down td { background: color-mix(in srgb, var(--down-soft) 60%, transparent); }
.tbl td.num, .tbl td .num { font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; color: var(--muted); font-size: 12px; }
.tbl .err { color: var(--down); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tbl .err.warn { color: var(--warn); }
.ent { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.ent b { display: block; font-weight: 650; white-space: nowrap; }
.ent .u { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sq { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; font-size: 13px; flex: none; color: #fff; }
.sq.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.tabs .count { font-size: 11px; color: var(--faint); margin-left: 5px; }
.field-s { height: 34px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 9px; padding: 0 10px; font-size: 13px; }
.field-s:focus { outline: none; border-color: var(--accent); }

/* status pills / dots / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }
.pill.degraded, .pill.partial, .pill.blocked { background: var(--warn-soft); color: var(--warn); }
.pill.paused { background: var(--neutral-soft); color: var(--paused); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--pending); flex: none; }
.dot.up { background: var(--up); } .dot.down { background: var(--down); } .dot.blocked, .dot.degraded, .dot.partial, .dot.warn { background: var(--warn); } .dot.paused { background: var(--paused); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--text-2); background: var(--panel-2); white-space: nowrap; }
.badge.wordpress { color: #1f6fb2; border-color: color-mix(in srgb, #1f6fb2 30%, transparent); background: color-mix(in srgb, #1f6fb2 8%, transparent); }
.badge.nextjs { color: var(--text); }
:root[data-theme="dark"] .badge.wordpress { color: #7fb6ee; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.wordpress { color: #7fb6ee; } }
.tag { display: inline-block; font-size: 11px; font-weight: 750; padding: 2px 8px; border-radius: 5px; letter-spacing: .02em; white-space: nowrap; background: var(--neutral-soft); color: var(--muted); }
.tag.down, .tag.check-fail { background: var(--down-soft); color: var(--down); }
.tag.up, .tag.check-pass, .tag.resumed { background: var(--up-soft); color: var(--up); }
.tag.degraded, .tag.blocked { background: var(--warn-soft); color: var(--warn); }
.days.warn { color: var(--warn); font-weight: 650; } .days.bad { color: var(--down); font-weight: 650; }
.minibars { display: flex; gap: 2px; height: 22px; width: 120px; }
.minibars i { flex: 1; border-radius: 2px; background: var(--up-bar); min-width: 2px; }
.minibars i.f { background: var(--down); } .minibars i.s { background: var(--warn); } .minibars i.b { background: var(--warn); opacity: .35; } .minibars i.e { background: var(--border); }
.hc { display: inline-flex; gap: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hc span { display: inline-flex; align-items: center; gap: 4px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

/* =========================================================
   Overview widgets
   ========================================================= */
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.attn li:last-child { border-bottom: 0; }
.attn .a-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.attn .a-ic.r { background: var(--down-soft); color: var(--down); } .attn .a-ic.y { background: var(--warn-soft); color: var(--warn); } .attn .a-ic.b { background: var(--accent-soft); color: var(--accent); } .attn .a-ic.g { background: var(--up-soft); color: var(--up); }
.attn b { display: block; font-size: 13.5px; }
.attn span { color: var(--muted); font-size: 12.5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed .f-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-soft); color: var(--muted); }
.feed .f-ic svg { width: 15px; height: 15px; }
.feed .f-ic.down, .feed .f-ic.check-fail { background: var(--down-soft); color: var(--down); }
.feed .f-ic.up, .feed .f-ic.check-pass, .feed .f-ic.resumed { background: var(--up-soft); color: var(--up); }
.feed .f-ic.blocked, .feed .f-ic.degraded { background: var(--warn-soft); color: var(--warn); }
.feed b { font-size: 13.5px; }
.feed .d { display: block; color: var(--muted); font-size: 12.5px; word-break: break-word; }
.feed time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .t { height: 10px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: var(--chart-line); border-radius: 999px; }
.hbar .t i.slow { background: var(--warn); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--panel); }
.stack i { display: block; height: 100%; }
.legend { display: grid; gap: 9px; margin-top: 16px; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.split div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.split b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.split span { color: var(--muted); font-size: 12px; }
.renew { list-style: none; margin: 0; padding: 0; }
.renew li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.renew li:last-child { border-bottom: 0; }
.renew b { font-size: 13.5px; }
.renew span { color: var(--muted); font-size: 12px; }
.renew .days { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 650; }

/* health matrix */
.matrix td.c, .matrix th.c { padding-left: 6px; padding-right: 6px; }
.matrix th.c { writing-mode: initial; font-size: 10.5px; max-width: 90px; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.hic { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; }
.hic svg { width: 13px; height: 13px; stroke-width: 3; }
.hic.pass { background: var(--up); } .hic.warn { background: var(--warn); } .hic.fail { background: var(--down); } .hic.unknown { background: var(--pending); } .hic.na { background: transparent; color: var(--faint); }

/* =========================================================
   Site record page
   ========================================================= */
.rec { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.rec h2 { font-size: 21px; font-weight: 750; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 13px; }
.rec .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rec-tabs { display: flex; gap: 2px; padding: 0 20px; border-top: 1px solid var(--border); overflow-x: auto; }
.rec-tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rec-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.rec-tabs button .count { font-size: 11px; background: var(--neutral-soft); color: var(--muted); padding: 1px 7px; border-radius: 999px; margin-left: 5px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.back:hover { color: var(--text); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 14px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat:nth-child(4n) { border-right: 0; }
.stat:nth-last-child(-n+4) { border-bottom: 0; }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 3px; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .s { font-size: 12px; color: var(--muted); }
.alert-card { background: var(--down-soft); border: 1px solid color-mix(in srgb, var(--down) 30%, transparent); color: var(--text); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.alert-card b { color: var(--down); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 30px 200px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: center; font-size: 13.5px; }
.checks li:last-child { border-bottom: 0; }
.checks .cn { font-weight: 650; }
.checks .cd { color: var(--muted); word-break: break-word; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-line); opacity: .08; }
.chart .fail { fill: var(--down); stroke: var(--panel); stroke-width: 2; }
.chart .slowline { stroke: var(--warn); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .slowlabel { fill: var(--warn); font-size: 11px; }
.chart .xhair { stroke: var(--muted); stroke-width: 1; }
.chart .hdot { fill: var(--chart-line); stroke: var(--panel); stroke-width: 2; }
.legend-inline { display: inline-flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.strip { display: flex; gap: 3px; height: 38px; }
.strip i { flex: 1; border-radius: 3px; background: var(--border); }
.strip i.g { background: var(--up-bar); } .strip i.w { background: var(--warn); } .strip i.c { background: var(--down); }
.strip-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* settings */
.kv { display: grid; grid-template-columns: 220px 1fr; }
.kv > div { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); font-weight: 600; }
.code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; }

/* tooltip + toast */
.tip { position: fixed; z-index: 80; pointer-events: none; background: #0f172a; color: #f1f5f9; font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 300px; opacity: 0; transition: opacity .08s; }
.tip.show { opacity: 1; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px); background: #0f172a; color: #f1f5f9; padding: 11px 18px; border-radius: 10px; transition: transform .25s, opacity .25s; max-width: calc(100% - 32px); opacity: 0; visibility: hidden; z-index: 90; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* =========================================================
   Login
   ========================================================= */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
  radial-gradient(700px 420px at 100% 100%, color-mix(in srgb, #a855f7 12%, transparent), transparent 60%), var(--bg); }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-side { padding: 44px 42px; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; gap: 26px; position: relative; overflow: hidden; }
.login-side::after { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(129, 140, 248, .35), transparent 65%); }
.login-side h1 { font-size: 28px; line-height: 1.25; color: #fff; letter-spacing: -.02em; }
.login-side p { margin: 10px 0 0; color: var(--side-muted); font-size: 14.5px; }
.feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; position: relative; z-index: 1; }
.feat li { display: grid; grid-template-columns: 38px 1fr; gap: 13px; align-items: start; }
.feat .fi { width: 38px; height: 38px; border-radius: 10px; background: var(--side-2); display: grid; place-items: center; color: var(--side-accent); }
.feat b { display: block; color: #fff; }
.feat span { color: var(--side-muted); font-size: 13px; }
.login-main { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-main h2 { font-size: 24px; }
.login-main .sub { color: var(--muted); margin: 6px 0 26px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.input { position: relative; }
.input > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input input { width: 100%; height: 46px; padding: 0 44px 0 38px; border: 1px solid var(--border-2); border-radius: 11px; background: var(--panel); font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
.input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 7px; border-radius: 7px; }
.input .reveal:hover { color: var(--text); }
.row-between { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 22px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.login-btn { width: 100%; height: 46px; font-size: 14.5px; border-radius: 11px; }
.alert { display: none; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 10px; background: var(--down-soft); color: var(--down); font-size: 13px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--down) 25%, transparent); }
.alert.show { display: flex; }
.login-foot { margin-top: 28px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.theme-corner { position: fixed; top: 16px; right: 16px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gsearch { width: 220px; }
}
@media (max-width: 1080px) {
  .g-2-1, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-bg.open { display: block; position: fixed; inset: 0; background: rgba(8, 11, 22, .5); z-index: 25; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .view { padding: 20px 16px 32px; }
  .foot { padding: 14px 16px; }
  .gsearch { display: none; }
  .livepill .lbl { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 14px; }
  .kpi-v { font-size: 23px; }
  .crumbs small, .hide-sm { display: none; }
  #checkAllTop span { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(4n) { border-right: 1px solid var(--border); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+4) { border-bottom: 1px solid var(--border); }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .checks li { grid-template-columns: 30px 1fr; }
  .checks .cd { grid-column: 2; }
  .kv { grid-template-columns: 1fr; }
  .kv > div.k { border-bottom: 0; padding-bottom: 0; }
  .rec .acts { margin-left: 0; width: 100%; }
  .hbar { grid-template-columns: 96px 1fr 56px; }
  .pop { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }
  .ent { min-width: 0; }
  .login-shell { grid-template-columns: 1fr; }
  .login-side { padding: 26px; gap: 14px; }
  .login-side .feat, .login-side p { display: none; }
  .login-side h1 { font-size: 22px; }
  .login-main { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .livepill { display: none; }
}
