/* =========================================================
   Uptime Monitor
   Navy control-room sidebar, cool grey workspace.
   Green / red / amber are reserved for status only.
   ========================================================= */
:root {
  --night: #0F2436;
  --night-2: #17324A;
  --night-ink: #C9D6E2;
  --night-dim: #7F95AA;

  --paper: #ECEFF3;
  --surface: #FFFFFF;
  --surface-2: #F5F7FA;
  --ink: #142231;
  --muted: #5F6E7E;
  --line: #E1E6EC;
  --line-strong: #C9D1DA;

  --accent: #2B59C3;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7EDFA;

  --up: #12875B;
  --up-soft: #E2F4EB;
  --down: #D33A2C;
  --down-soft: #FCE8E5;
  --warn: #C27C00;
  --warn-soft: #FFF2D6;
  --paused: #8794A3;
  --paused-soft: #EBEEF2;
  --none: #DDE3EA;

  --lamp-up: #34C38A;
  --lamp-down: #FF5A4A;
  --lamp-warn: #F2B33D;
  --lamp-paused: #3C5770;

  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 36, 54, .06), 0 4px 16px rgba(15, 36, 54, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 232px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --night: #0A1826;
    --night-2: #13283B;
    --paper: #0E1B27;
    --surface: #142433;
    --surface-2: #182B3C;
    --ink: #E4EBF2;
    --muted: #93A4B5;
    --line: #22384B;
    --line-strong: #2E475C;
    --accent: #7AA2FF;
    --accent-ink: #0B1626;
    --accent-soft: #1B2E4D;
    --up: #3FCB8E;
    --up-soft: #133528;
    --down: #FF7466;
    --down-soft: #3D1C1A;
    --warn: #F0B54A;
    --warn-soft: #3A2C10;
    --paused: #8597A9;
    --paused-soft: #1E3142;
    --none: #24394C;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w);
  flex: none;
  background: var(--night);
  color: var(--night-ink);
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem;
  color: #fff; text-decoration: none;
  padding: 0 8px 26px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: #1E4566; color: var(--lamp-up);
}
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.6; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--night-ink); font-weight: 600;
  text-decoration: none;
}
.nav a svg { color: var(--night-dim); }
.nav a:hover { background: var(--night-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--lamp-up); }
.nav a[aria-current="page"] svg { color: var(--lamp-up); }

.account { margin-top: auto; border-top: 1px solid var(--night-2); padding: 14px 6px 0; }
.account-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700;
}
.account-text { display: flex; flex-direction: column; min-width: 0; }
.account-email { color: #fff; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { color: var(--night-dim); font-size: .78rem; }
.signout {
  display: inline-block; margin-top: 12px; font-size: .85rem; font-weight: 600;
  color: var(--night-ink); padding: 4px 0;
}
.signout:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.page { max-width: 1360px; margin: 0 auto; padding: 28px 32px 56px; }
.page-narrow { max-width: 720px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn-light { background: #fff; border-color: #fff; color: var(--night); }
.btn-light:hover { background: #E6F7EF; border-color: #E6F7EF; }
.btn-sm { height: 32px; padding: 0 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--accent); cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--down); }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center;
  border: 1px solid transparent; background: none; color: var(--muted);
  cursor: pointer; list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* ---------------- Status board (dashboard hero) ---------------- */
.board {
  background: var(--night);
  color: var(--night-ink);
  border-radius: var(--r-lg);
  padding: 26px 28px 0;
  margin-bottom: 22px;
  overflow: hidden;
}
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.board h1 { color: #fff; font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.board-down h1 { color: #FFB4AA; }
.board-head p { margin: 6px 0 0; max-width: 70ch; }
.board-down .board-head p { color: #FFD6D0; font-weight: 600; }

.lamps {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin: 22px 0 24px;
}
.lamp {
  width: 26px; height: 26px; border-radius: 7px;
  border: 0; padding: 0; cursor: pointer;
  background: var(--lamp-paused);
  transition: transform .12s ease;
}
.lamp:hover { transform: scale(1.18); }
.lamp:focus-visible { outline-color: #fff; }
.lamp-up { background: var(--lamp-up); box-shadow: 0 0 10px rgba(52, 195, 138, .35); }
.lamp-up.lamp-ssl { background: linear-gradient(135deg, var(--lamp-up) 55%, var(--lamp-warn) 55%); }
.lamp-down { background: var(--lamp-down); box-shadow: 0 0 0 0 rgba(255, 90, 74, .6); animation: alarm 1.6s ease-out infinite; }
.lamp-pending { background: transparent; box-shadow: inset 0 0 0 2px var(--lamp-paused); }
@keyframes alarm {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 74, .65); }
  100% { box-shadow: 0 0 0 10px rgba(255, 90, 74, 0); }
}

.kpis {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin: 0 -28px; border-top: 1px solid var(--night-2);
}
.kpi { padding: 14px 28px 16px; border-right: 1px solid var(--night-2); }
.kpi:last-child { border-right: 0; }
.kpi dt { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--night-dim); font-weight: 600; }
.kpi dd { margin: 2px 0 0; color: #fff; font-size: 1.6rem; font-weight: 800; }
.kpi dd small { font-size: .9rem; font-weight: 600; color: var(--night-dim); }
.kpi.is-alert { background: rgba(255, 90, 74, .12); }
.kpi.is-alert dd { color: #FF8A7D; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--paused); font-style: normal; }
.dot-up { background: var(--lamp-up); }
.dot-down { background: var(--lamp-down); }
.dot-warn { background: var(--lamp-warn); }
.dot-paused { background: var(--paused); }

/* ---------------- Panels + tables ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel-pad { padding: 22px 24px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 1rem; font-weight: 700; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer;
}
.chip .n {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 700;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.chip[aria-pressed="true"] .n { background: rgba(255,255,255,.16); color: #fff; }
.chip-down[aria-pressed="true"] { background: var(--down); border-color: var(--down); }
.chip-warn[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); }

.search-wrap { position: relative; flex: 0 1 300px; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); font: inherit;
}
.search:focus { background: var(--surface); outline: 2px solid var(--accent); outline-offset: -1px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .8rem; font-weight: 700; color: var(--muted);
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }

.sites td:first-child { box-shadow: inset 4px 0 0 transparent; }
.sites .row-down td:first-child { box-shadow: inset 4px 0 0 var(--down); }
.sites .row-down td { background: color-mix(in srgb, var(--down-soft) 55%, transparent); }
.sites .row-paused td { color: var(--muted); }
.sites .row-paused .site-name { color: var(--muted); }
.sites .row-paused .heartbeat { opacity: .45; }

.site-name { display: block; font-weight: 700; color: var(--ink); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.site-name:hover { color: var(--accent); }
.site-url {
  display: block; font-size: .82rem; color: var(--muted);
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.site-url:hover { color: var(--accent); }

.state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-up { color: var(--up); background: var(--up-soft); }
.state-down { color: var(--down); background: var(--down-soft); }
.state-paused { color: var(--paused); background: var(--paused-soft); }
.state-pending { color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.state-reason { display: block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--down); }

.heartbeat { display: flex; gap: 2px; height: 26px; min-width: 168px; }
.heartbeat span { flex: 1; border-radius: 2px; background: var(--none); }
.heartbeat .hb-up { background: var(--up); }
.heartbeat .hb-partial { background: var(--warn); }
.heartbeat .hb-down { background: var(--down); }
.pct-warn { color: var(--warn); font-weight: 700; }
.pct-bad { color: var(--down); font-weight: 700; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.tag-up { color: var(--up); background: var(--up-soft); }
.tag-down { color: var(--down); background: var(--down-soft); }
.tag-warn { color: var(--warn); background: var(--warn-soft); }
.tag-muted { color: var(--paused); background: var(--paused-soft); }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.btn-uptime { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.btn-uptime:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.more { position: relative; }
.more summary { list-style: none; }
.more .menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  min-width: 170px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(15, 36, 54, .16);
}
.more .menu a, .more .menu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 6px; border: 0; background: none;
  font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink); cursor: pointer;
}
.more .menu a:hover, .more .menu button:hover { background: var(--surface-2); text-decoration: none; }
.more .menu .danger { color: var(--down); }
.more form { margin: 0; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 1.05rem; margin-bottom: 6px; }
.empty p { margin: 0 0 14px; }

/* ---------------- Uptime panel (drawer) ---------------- */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 24, 38, .45);
  opacity: 0; transition: opacity .2s ease;
}
.drawer-scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(640px, 100vw);
  background: var(--paper);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
  box-shadow: -12px 0 40px rgba(10, 24, 38, .2);
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.25rem; font-weight: 800; }
.drawer-head .site-url { max-width: 480px; }
.drawer .report { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-foot { padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

/* ---------------- Report (shared) ---------------- */
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 9px;
}
.drawer .segmented { background: var(--surface); }
.segmented button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 7px;
  background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--night); color: #fff; }

.stats {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr;
  margin: 0 0 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
}
.stat { padding: 12px 16px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat dd { margin: 0; font-size: 1.3rem; font-weight: 800; }
.stat dd small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-main dd { font-size: 1.6rem; color: var(--up); }
.stat-main dd.is-warn { color: var(--warn); }
.stat-main dd.is-down { color: var(--down); }

.chart-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px 12px; margin-bottom: 14px;
}
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h3 { font-size: .95rem; font-weight: 700; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.legend .dot { width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }
.legend .dot-up { background: var(--up); }
.legend .dot-warn { background: var(--warn); }
.legend .dot-down { background: var(--down); }
.chart-box { position: relative; height: 240px; }
.chart-small { height: 170px; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--muted); font-weight: 600; text-align: center; padding: 20px;
}

.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.report.panel .stats, .report.panel .chart-card { box-shadow: none; }
.report.panel .stats, .report.panel .chart-card { background: var(--surface); }

.event-list { list-style: none; margin: 0; padding: 6px 0; }
.event-list li { display: flex; flex-direction: column; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.event-list li:last-child { border-bottom: 0; }
.event-list .tag { align-self: flex-start; }
.event-list time { font-size: .84rem; display: flex; gap: 8px; }

/* ---------------- Page heads ---------------- */
.back-link { display: inline-block; font-weight: 600; font-size: .88rem; margin-bottom: 12px; color: var(--muted); }
.back-link:hover { color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.75rem; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.head-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-meta .site-url { max-width: 420px; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .88rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input, .select {
  height: 40px; padding: 0 12px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.hint { font-size: .82rem; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }

.filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; min-width: 190px; }
.btns { display: flex; gap: 8px; }
.message-cell { color: var(--muted); max-width: 520px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); }

/* ---------------- Flash messages ---------------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { padding: 11px 14px 11px 16px; border-radius: var(--r-sm); font-weight: 600; border-left: 4px solid; }
.flash-success { background: var(--up-soft); color: var(--up); }
.flash-danger { background: var(--down-soft); color: var(--down); }
.flash-warning, .flash-info { background: var(--warn-soft); color: var(--warn); }

/* ---------------- Sign-in pages ---------------- */
.auth-body { background: var(--surface); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px); }
.auth-side {
  background: var(--night); color: var(--night-ink);
  padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side .brand { padding: 0; }
.auth-lamps { display: grid; grid-template-columns: repeat(8, 34px); gap: 9px; }
.auth-lamps span { width: 34px; height: 34px; border-radius: 9px; background: var(--lamp-up); opacity: .9; }
.auth-lamps .is-down { background: var(--lamp-down); animation: alarm 1.6s ease-out infinite; }
.auth-lamps .is-warn { background: var(--lamp-warn); }
.auth-tag { font-size: 1.15rem; line-height: 1.55; max-width: 40ch; color: #fff; font-weight: 500; margin: 0; }
.auth-card { padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; }
.auth-card .brand-dark { display: none; color: var(--ink); padding: 0 0 24px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.auth-card > p, .auth-card form + p { color: var(--muted); margin: 0 0 24px; }
.auth-card .btn-primary { height: 44px; margin-top: 4px; }
.auth-foot { margin-top: 16px; font-size: .9rem; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .col-checked { display: none; }
  .report-layout { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .col-resp, .col-ssl { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--night-2); }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 16px;
  }
  .brand { padding: 0 8px 0 0; font-size: 1rem; }
  .brand-mark { width: 26px; height: 26px; }
  .nav { flex-direction: row; flex: 1; overflow-x: auto; }
  .nav a { padding: 8px 10px; }
  .nav a span { font-size: .88rem; }
  .account { margin: 0; border: 0; padding: 0; }
  .account-who { display: none; }
  .signout { margin: 0; }
  .page { padding: 18px 16px 40px; }
  .board { padding: 20px 18px 0; }
  .board h1 { font-size: 1.45rem; }
  .kpis { margin: 0 -18px; }
  .kpi { padding: 12px 18px; }
  .lamp { width: 22px; height: 22px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card { padding: 36px 20px; }
  .auth-card .brand-dark { display: flex; }
}
@media (max-width: 640px) {
  .nav a svg { display: none; }
  .brand { font-size: 0; gap: 0; padding-right: 2px; }
  .nav a { padding: 8px 9px; }
  .board-head { flex-direction: column; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(n) { border-right: 1px solid var(--night-2); border-top: 1px solid var(--night-2); }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:last-child { grid-column: 1 / -1; border-right: 0; }
  .search-wrap { flex: 1 1 100%; }
  .sites thead { display: none; }
  .sites, .sites tbody, .sites tr, .sites td { display: block; }
  .sites tr {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
  }
  .sites tr.row-down { box-shadow: inset 4px 0 0 var(--down); background: color-mix(in srgb, var(--down-soft) 55%, transparent); }
  .sites td { padding: 0 !important; border: 0; background: none !important; box-shadow: none !important; }
  .sites .col-name { grid-column: 1; min-width: 0; }
  .sites .col-state { grid-column: 2; text-align: right; }
  .sites .col-beat { grid-column: 1 / -1; }
  .sites .col-24h { grid-column: 1; text-align: left; }
  .sites .col-24h::after { content: " in 24h"; color: var(--muted); font-weight: 500; }
  .sites .col-actions { grid-column: 2; }
  .site-name, .site-url { max-width: 100%; }
  .heartbeat { min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .drawer-head, .drawer .report, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .filters .field { min-width: 0; flex: 1 1 100%; }
  .table:not(.sites) th:nth-child(n+4), .table:not(.sites) td:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lamp-down, .auth-lamps .is-down { animation: none; }
  .drawer, .drawer-scrim, .lamp { transition: none; }
}
