/* Pat's Lead List — dashboard styles.
   Base copied from ../../pat-stocklist/dashboard/styles.css so Pat feels
   instantly at home: same tokens, same sheet-styled table, same topbar pills,
   same light/dark switch, same responsive rules. Everything the stocklist
   needed and this doesn't (chat, uploads, zoom, aggregator panel) is dropped;
   what's new is the score bars, the row drawer, the pat_* editors and the
   hidden-rows panel. */

:root {
  --border: #dfe3e8;
  --border-strong: #c7ccd3;
  --header-bg: #f6f7f9;
  --row-alt: #fafbfc;
  --row-hover: #edf3ef;
  --row-selected: #d7e7dd;
  --text: #1c2126;
  --muted: #6b7280;
  --accent: #0D3627;
  --accent-bg: #e7efe9;
  --surface: #ffffff;
  --page-bg: #f3f4f6;

  --green-bg: #e5f6ea;
  --green-text: #0D3627;
  --amber-bg: #fff2df;
  --amber-text: #9a5b06;
  --grey-bg: #eceef1;
  --grey-text: #5b6470;
  --yellow-bg: #fbf0c2;
  --yellow-text: #7d6304;
  --red-bg: #fdecec;
  --red-text: #c0392b;
  --blue-bg: #e5eefb;
  --blue-text: #1b4f9c;

  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

/* App-style fixed viewport: the page never scrolls — the table pane does, so
   the topbar and filter bar stay put and the scrollbars sit at the viewport
   edges. Straight from the stocklist. */
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 20px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 81px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar-mark {
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
:root[data-theme="dark"] .topbar-mark { color: #0e1013; }
.topbar-title h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.topbar-byline {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 1px 0 2px;
}
.topbar-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}
.topbar-meta > span { white-space: nowrap; }
.topbar-meta #totalCount { min-width: 92px; display: inline-block; }
.topbar-meta .dot { opacity: 0.5; }

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  justify-self: end;
}

/* ---------- light/dark switch ---------- */
.theme-toggle {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 999px;
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.theme-toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 52px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--header-bg);
  border: 1px solid var(--border-strong);
}
.theme-toggle-icon {
  font-size: 12px;
  line-height: 1;
  z-index: 1;
  transition: opacity 0.15s ease;
}
.theme-toggle-icon.sun { color: #d4a900; }
.theme-toggle-icon.moon { color: var(--muted); }
:root[data-theme="dark"] .theme-toggle-icon.sun { opacity: 0.45; }
:root[data-theme="light"] .theme-toggle-icon.moon { opacity: 0.45; }

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
:root[data-theme="dark"] .theme-toggle-thumb { transform: translateX(24px); }

/* Theme-swap fade — deliberately kept off the table cells so switching stays
   instant on a full sheet. */
html, body, .topbar, .filterbar, .table-wrap, thead th,
.filter-search, .filter-num, .filter-select, .chip, .btn-clear, .btn-primary,
.theme-toggle-track {
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
@media (prefers-reduced-motion: reduce) {
  html, body, .topbar, .filterbar, .table-wrap, thead th,
  .filter-search, .filter-num, .filter-select, .chip, .btn-clear, .btn-primary,
  .theme-toggle-track, .theme-toggle-thumb { transition: none; }
}

/* ---------- page navigation (Leads / Bad list) ---------- */
.page-nav {
  display: flex;
  gap: 3px;
  background: var(--header-bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
  justify-self: center;
}
.page-nav-link {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.page-nav-link:hover { color: var(--accent); }
.page-nav-link.active { background: var(--accent); color: #fff; }
.page-nav-link.active:hover { color: #fff; }
:root[data-theme="dark"] .page-nav-link.active { color: #0e1013; }
:root[data-theme="dark"] .page-nav-link.active:hover { color: #0e1013; }

/* ---------- filter bar ---------- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}

.filter-search {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.filter-search:focus, .filter-num:focus, .filter-select:focus {
  outline: 2px solid var(--accent-bg);
  border-color: var(--accent);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.filter-num, .filter-select {
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.filter-num { width: 68px; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .chip.active { color: #0e1013; }
.chip.active[data-chip="flag"] { background: var(--red-text); border-color: var(--red-text); color: #fff; }
.chip.active[data-chip="starred"] { background: #d4a900; border-color: #d4a900; color: #3a2f04; }

.btn-clear {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-clear:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.15); }
:root[data-theme="dark"] .btn-primary { color: #0e1013; }

.result-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- hidden-rows panel (the stocklist's restorable delete) ---------- */
.hidden-wrap { position: relative; }
.hidden-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  z-index: 60;
  min-width: 280px;
  max-width: 360px;
  padding: 4px;
}
.hidden-panel[hidden] { display: none; }
.hidden-head {
  padding: 6px 8px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}
.hidden-list { max-height: 300px; overflow-y: auto; }
.hidden-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.hidden-row:hover { background: var(--row-hover); }
.hidden-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
.hidden-restore {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
}
.hidden-restore:hover { border-color: var(--accent); }
.hidden-empty { padding: 10px 8px; color: var(--muted); font-size: 12.5px; }

/* ---------- table ---------- */
.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  margin: 0;
  overscroll-behavior: none;
  scrollbar-gutter: stable;
}

/* Always-visible Sheets-style scrollbars (any ::-webkit-scrollbar rule opts
   Chrome/Safari out of macOS's auto-hiding overlay bars). */
.table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface); }
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 3px solid var(--surface);
  background-clip: padding-box;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.table-wrap::-webkit-scrollbar-corner { background: var(--surface); }

@supports not selector(::-webkit-scrollbar) {
  .table-wrap { scrollbar-width: auto; scrollbar-color: var(--border-strong) var(--surface); }
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1680px;
}
table.bad-table { min-width: 1180px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid var(--border);
  text-align: left;
  padding: 8px 10px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); background: #eef1f5; }
:root[data-theme="dark"] thead th.sortable:hover { background: #232830; }
thead th.num { text-align: right; }
thead th.mid { text-align: center; }
thead th .arrow { margin-left: 4px; opacity: 0.6; }

tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text);
  vertical-align: middle;
}
/* Zebra striping is a class, not :nth-of-type — an open drawer inserts a <tr>
   and would otherwise flip every stripe below it. */
tbody tr.lead-row.alt { background: var(--row-alt); }
tbody tr.lead-row:hover { background: var(--row-hover); }
tbody tr.lead-row { cursor: pointer; }
tbody tr.lead-row.open,
tbody tr.lead-row.open:hover { background: var(--row-selected); }
tbody tr.lead-row.open td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mid { text-align: center; }
td.muted-cell { color: var(--muted); }
.dash { color: var(--muted); }

.loading-row, .empty-row {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px !important;
  white-space: normal !important;
}

/* company cell */
.company-cell { max-width: 260px; }
.company-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.company-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* badges + chips inside cells */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-new { background: var(--green-bg); color: var(--green-text); }
.badge-zone-infill { background: var(--blue-bg); color: var(--blue-text); }
.badge-zone-growth-corridor { background: var(--green-bg); color: var(--green-text); }
.badge-zone-regional { background: var(--grey-bg); color: var(--grey-text); }
.badge-selling { background: var(--green-bg); color: var(--green-text); }
.badge-coming { background: var(--amber-bg); color: var(--amber-text); }
.badge-sold { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-complete { background: var(--grey-bg); color: var(--grey-text); }
.badge-bad { background: var(--red-bg); color: var(--red-text); }

.tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.tag {
  display: inline-block;
  background: var(--grey-bg);
  color: var(--grey-text);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-more { background: none; color: var(--muted); }
.areas-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* score cells — a number with a quiet strength bar under it */
.score { display: inline-block; min-width: 46px; text-align: right; }
.score-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.score-bar {
  display: block;
  height: 3px;
  margin-top: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.score-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.score-hot .score-bar i { background: #2f9e44; }
.score-warm .score-bar i { background: #d4a900; }
.score-cold .score-bar i { background: var(--border-strong); }

/* flag */
.flag-cell { text-align: center; }
.flag-on { color: var(--red-text); font-size: 14px; }

/* contacts */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.link:hover { text-decoration: underline; }
.email-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.email-guessed {
  color: var(--amber-text);
  border-bottom: 1px dashed var(--amber-text);
  font-weight: 600;
}
.email-guessed::after {
  content: "unverified";
  margin-left: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--amber-bg);
  color: var(--amber-text);
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 700;
}
.rating-count { color: var(--muted); font-size: 11.5px; }

/* pat_* editors */
.pat-check { accent-color: var(--accent); cursor: pointer; width: 15px; height: 15px; }
.pat-input {
  width: 100%;
  min-width: 110px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 6px;
}
.pat-input:hover { border-color: var(--border-strong); background: var(--surface); }
.pat-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.pat-input.saving { opacity: 0.6; }
.pat-input-date { min-width: 128px; }
td.pat-cell { padding: 3px 6px; }

.star-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--border-strong);
  padding: 2px;
}
.star-btn.on { color: #d4a900; }

.hide-btn {
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--muted);
  line-height: 1;
  font-family: inherit;
}
.hide-btn:hover { background: var(--red-bg); color: var(--red-text); }

/* ---------- row drawer ---------- */
tr.drawer-row > td {
  white-space: normal;
  background: var(--page-bg);
  padding: 0;
  border-right: none;
}
.drawer {
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px 28px;
  border-left: 3px solid var(--accent);
}
.drawer h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.drawer-block { min-width: 0; }
.drawer-block + .drawer-block { margin-top: 14px; }
.drawer p { margin: 0; font-size: 13px; line-height: 1.55; }
.drawer-evidence { color: var(--text); }
.drawer-warn {
  margin-top: 8px;
  background: var(--red-bg);
  color: var(--red-text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.drawer-reason {
  background: var(--red-bg);
  color: var(--red-text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.breakdown-line {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}
.breakdown-line b { font-variant-numeric: tabular-nums; }
.breakdown-line .eq { color: var(--muted); }

.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.proj-suburb { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.notes-area {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.notes-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.notes-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2f36;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
.toast.error { background: #b3261e; }

/* ---------- password gate ---------- */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-gate[hidden] { display: none; }
.pw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 40px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  width: min(360px, 90vw);
}
.pw-card .topbar-mark { margin: 0 auto 14px; height: 52px; width: 52px; font-size: 17px; }
.pw-card h2 { margin: 0 0 4px; font-size: 17px; color: var(--accent); }
.pw-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.pw-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}
.pw-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.pw-submit {
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px;
  border-radius: var(--radius);
  cursor: pointer;
}
.pw-submit:hover { filter: brightness(1.15); }
.pw-submit:disabled { opacity: 0.6; cursor: default; }
:root[data-theme="dark"] .pw-submit { color: #0e1013; }
.pw-error { color: var(--red-text); font-size: 12.5px; min-height: 18px; margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .topbar { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .topbar-controls { justify-self: auto; }
  .page-nav { justify-self: auto; }
}

@media (max-width: 760px) {
  .topbar { padding: 12px 14px 8px; }
  .topbar-meta { flex-wrap: wrap; overflow: visible; }
  .filterbar { padding: 10px 14px; gap: 8px 10px; }
  .filter-search { flex: 1 1 100%; }
  .result-count { margin-left: 0; order: 99; width: 100%; }
  .drawer { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .hidden-panel { right: auto; left: 0; }
}

/* ---------- dark mode ----------
   Two switches, deliberately: the [data-theme] attribute (set by the toggle,
   remembered in localStorage) always wins, and the OS preference applies
   before any script runs so the page never flashes white on a dark machine.
   The stocklist used an inline pre-paint script; the CSP here forbids inline
   script, so the media query does that job instead. */
:root[data-theme="dark"] {
  --border: #2c313a;
  --border-strong: #3c4350;
  --header-bg: #1c2026;
  --row-alt: #1a1e24;
  --row-hover: #1c2922;
  --row-selected: #1e3a2b;
  --text: #e6e8eb;
  --muted: #9aa1ab;
  --accent: #6fbe98;
  --accent-bg: #14261d;
  --surface: #14171b;
  --page-bg: #0e1013;

  --green-bg: #14261d;
  --green-text: #6fbe98;
  --amber-bg: #3a2a0a;
  --amber-text: #e0a944;
  --grey-bg: #262b33;
  --grey-text: #a4acb8;
  --yellow-bg: #383008;
  --yellow-text: #f5d051;
  --red-bg: #3a1616;
  --red-text: #f08b84;
  --blue-bg: #16243a;
  --blue-text: #7fb0ef;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --border: #2c313a;
    --border-strong: #3c4350;
    --header-bg: #1c2026;
    --row-alt: #1a1e24;
    --row-hover: #1c2922;
    --row-selected: #1e3a2b;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --accent: #6fbe98;
    --accent-bg: #14261d;
    --surface: #14171b;
    --page-bg: #0e1013;

    --green-bg: #14261d;
    --green-text: #6fbe98;
    --amber-bg: #3a2a0a;
    --amber-text: #e0a944;
    --grey-bg: #262b33;
    --grey-text: #a4acb8;
    --yellow-bg: #383008;
    --yellow-text: #f5d051;
    --red-bg: #3a1616;
    --red-text: #f08b84;
    --blue-bg: #16243a;
    --blue-text: #7fb0ef;
  }
  :root:not([data-theme="light"]) .topbar-mark,
  :root:not([data-theme="light"]) .chip.active,
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .page-nav-link.active,
  :root:not([data-theme="light"]) .pw-submit { color: #0e1013; }
  :root:not([data-theme="light"]) thead th.sortable:hover { background: #232830; }
}
