/* =========================================================================
 * DriftSense -- design system + component styles
 * -------------------------------------------------------------------------
 * Palette: midnight navy background + steel-teal primary + amber warnings.
 * Distinct from every portfolio site (cyan/indigo/violet/emerald/burgundy/amber)
 * -- reads as "watchtower / observatory / cool precision instrument."
 * ========================================================================= */

:root {
  /* Backgrounds -- deep, cool, with subtle blue tint */
  --bg-0: #030710;
  --bg-1: #0a1220;
  --bg-2: #131e30;
  --bg-3: #1a2740;
  --bg-panel: linear-gradient(180deg, #131e30 0%, #0a1220 100%);

  /* Borders */
  --border: #223050;
  --border-hi: #2d3d5f;
  --border-focus: #14b8a6;

  /* Text */
  --text: #e5edf5;
  --text-dim: #96a3b8;
  --text-muted: #6a7a94;

  /* Accents */
  --accent: #14b8a6;              /* Teal -- primary, "sense" color */
  --accent-hi: #2dd4bf;
  --accent-deep: #0f766e;
  --accent-glow: rgba(20, 184, 166, 0.35);

  --accent-warn: #f59e0b;          /* Amber -- drift alert */
  --accent-warn-hi: #fbbf24;

  --accent-danger: #f43f5e;        /* Rose -- critical */
  --accent-danger-hi: #fb7185;

  --accent-ok: #34d399;            /* Emerald -- clean baseline */
  --accent-ok-hi: #6ee7b7;

  --accent-info: #38bdf8;          /* Sky-blue -- info notices */

  /* Typography */
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Sizing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(ellipse 1000px 600px at 15% 0%, rgba(20, 184, 166, 0.10), transparent 65%),
    radial-gradient(ellipse 900px 500px at 90% 100%, rgba(56, 189, 248, 0.08), transparent 65%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* =========================================================================
 * APP SHELL -- sidebar + main
 * ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #0a1220 0%, #050810 100%);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 8px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-brand .logo {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: #0a1220;
  border: 1px solid #fff;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  position: relative;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.40);
  z-index: 1;
}
.sidebar-brand .logo::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent-hi) 100%);
  filter: blur(12px);
  opacity: 0.32;
  z-index: -1;
}
.sidebar-brand .name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sidebar-brand .name .accent { color: var(--accent-hi); }
.sidebar-brand .role {
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}
.sidebar-section-label {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: color .12s ease, background .12s ease, border-left-color .12s ease;
}
.sidebar-link svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.85; }
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,.02); }
.sidebar-link.active {
  color: var(--accent-hi);
  background: linear-gradient(90deg, rgba(20, 184, 166, .12), transparent 90%);
  border-left-color: var(--accent);
}
.sidebar-link.active svg { opacity: 1; }

/* Trend arrows on KPI tiles (Wave 5) */
.ds-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 3px;
  margin-left: 8px;
}
.ds-trend.ds-trend-up {
  background: rgba(52, 211, 153, .14);
  color: #86efac;
  border: 1px solid rgba(52, 211, 153, .35);
}
.ds-trend.ds-trend-down {
  background: rgba(244, 63, 94, .14);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, .35);
}
.ds-trend.ds-trend-flat {
  background: rgba(148, 163, 184, .14);
  color: var(--text-dim);
  border: 1px solid rgba(148, 163, 184, .30);
}
.ds-trend svg {
  width: 10px; height: 10px;
}

/* Site links in sidebar (Wave 5) */
.ds-site-link {
  font-size: 12.5px;
  padding: 6px 20px 6px 20px;
}
.ds-site-badge {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(20, 184, 166, .18), rgba(6, 78, 74, .12));
  border: 1px solid rgba(20, 184, 166, .25);
  color: var(--accent-hi);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.ds-site-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-site-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex: 0 0 auto;
  background: #334155;
}
.ds-site-dot.ds-dot-live  { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,.6); }
.ds-site-dot.ds-dot-warm  { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.ds-site-dot.ds-dot-hot   { background: #f43f5e; box-shadow: 0 0 8px rgba(244,63,94,.7); }
.ds-site-dot.ds-dot-quiet { background: #334155; }

/* Stable release links in sidebar (Wave 5) */
.ds-stable-link {
  font-size: 12.5px;
  padding: 6px 20px;
}
.ds-stable-tag {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, #34d399, #0f766e);
  color: #052e2b;
  font-size: 10.5px;
  font-weight: 900;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(52,211,153,.35);
}
.ds-stable-link:hover .ds-stable-tag { box-shadow: 0 0 12px rgba(52,211,153,.7); }

/* Main content area */
.app-main { min-width: 0; }
.topbar {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(10, 18, 32, 0.5);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
}
.topbar-user .initials {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #030710;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  font-family: var(--mono);
}

.app-content {
  padding: 32px 40px 96px;
  /* Fill the available width -- the sidebar already grabs a fixed column
   * via .app-shell grid, so the main area fills the rest naturally.
   * A hard max-width here was cutting off wide-screen tables. */
  max-width: none;
  width: 100%;
  min-width: 0;
}

/* =========================================================================
 * DASHBOARD FILE-CHANGES KPI -- 4 sub-count links (Modified/Added/Deleted/All)
 * inside the main tile. Shows even when 0 so the operator sees the shape.
 * ========================================================================= */
.kpi-file-tile { display: flex; flex-direction: column; }
.fc-subgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(20, 184, 166, .03);
}
.fc-sub {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  transition: background .12s, color .12s, transform .12s;
  border: 1px solid transparent;
}
.fc-sub svg { width: 14px; height: 14px; opacity: .55; }
.fc-sub:hover { color: var(--text); background: rgba(20, 184, 166, .07); border-color: rgba(20, 184, 166, .20); transform: translateY(-1px); }
.fc-sub:hover svg { opacity: 1; }
.fc-sub-num { font-family: var(--mono); font-size: 20px; font-weight: 800; line-height: 1; letter-spacing: -.01em; color: var(--text); }
.fc-sub-lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.fc-sub-modified:hover svg { color: var(--accent-warn-hi); }
.fc-sub-added:hover    svg { color: var(--accent-ok); }
.fc-sub-deleted:hover  svg { color: var(--accent-danger-hi); }
/* Amber variant for the schema tile so the hover tint reads as amber
 * territory instead of teal. */
.fc-subgrid-amber { background: rgba(245, 158, 11, .03); }
.fc-subgrid-amber .fc-sub:hover { background: rgba(245, 158, 11, .07); border-color: rgba(245, 158, 11, .25); }

/* Non-zero sub-KPI is HOT: number + icon light up in the semantic color so
 * a glance at the row tells you which lane has activity. Zero stays muted. */
.fc-sub-hot .fc-sub-num              { color: var(--accent-hi);        text-shadow: 0 0 12px rgba(20,184,166,.35); }
.fc-sub-hot.fc-sub-modified .fc-sub-num  { color: var(--accent-warn-hi);   text-shadow: 0 0 12px rgba(245,158,11,.40); }
.fc-sub-hot.fc-sub-modified svg          { color: var(--accent-warn-hi);   opacity: 1; }
.fc-sub-hot.fc-sub-added .fc-sub-num     { color: var(--accent-ok);        text-shadow: 0 0 12px rgba(52,211,153,.40); }
.fc-sub-hot.fc-sub-added svg             { color: var(--accent-ok);        opacity: 1; }
.fc-sub-hot.fc-sub-deleted .fc-sub-num   { color: var(--accent-danger-hi); text-shadow: 0 0 12px rgba(244,63,94,.40); }
.fc-sub-hot.fc-sub-deleted svg           { color: var(--accent-danger-hi); opacity: 1; }
.fc-sub-hot.fc-sub-all .fc-sub-num       { color: var(--accent-hi);        text-shadow: 0 0 12px rgba(20,184,166,.40); }
.fc-sub-hot.fc-sub-all svg               { color: var(--accent-hi);        opacity: 1; }
.fc-sub-hot .fc-sub-lbl                  { color: var(--text-dim); }

/* Dashboard-top range bar (wraps the shared RangePicker so it sits nicely
 * above the KPI grid). */
.dash-range-bar { margin: 0 0 14px; }
/* .dash-range-bar chrome removed -- sites.html now wraps the picker
 * in a .rp-range-wrap module so it inherits the shared teal frame. */
.dash-range-bar .range-bar { padding: 6px 4px; background: transparent; border: 0; box-shadow: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dash-range-bar .rb-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-right: 4px; }

/* =========================================================================
 * STATUS FILTER TABS (.fc-tabs / .fc-tab) -- used on /file_changes.cgi and
 * /schema_changes.cgi. Sit inside a .module, above the .module-head.
 * Modified | Added | Deleted | All -- active tab underlined + colored.
 * ========================================================================= */
.fc-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 184, 166, .02);
}
.fc-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 11px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s, background .12s;
  border-radius: 6px 6px 0 0;
}
.fc-tab:hover { color: var(--text); background: rgba(20, 184, 166, .06); }
.fc-tab-active { color: var(--accent-hi); border-bottom-color: var(--accent); background: rgba(20, 184, 166, .10); }
.fc-tab-active .fc-tab-badge { background: rgba(20, 184, 166, .20); color: var(--accent-hi); }
.fc-tab-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.fc-tab svg { opacity: .7; flex: 0 0 auto; }
.fc-tab-active svg { opacity: 1; color: var(--accent-hi); }

/* =========================================================================
 * KPI ROW -- shared across portfolio_drift / orphan_blobs / watchlist /
 * file_bio / release_diff / restore_batch pages. Auto-fit responsive grid
 * so 3-4 tiles sit side-by-side on desktop, wrap gracefully at narrower
 * widths.
 * ========================================================================= */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.kpi-tile {
  padding: 16px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.kpi-tile:hover { border-color: var(--border-hi); }
.kpi-tile .kpi-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.kpi-tile .kpi-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.kpi-tile .kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================================
 * PAGE HEAD
 * ========================================================================= */
.page-head { margin-bottom: 32px; }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-hi);
  font-weight: 700;
  padding: 5px 12px;
  background: rgba(20, 184, 166, .10);
  border: 1px solid rgba(20, 184, 166, .30);
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  text-decoration: none;
}
.page-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-hi);
  box-shadow: 0 0 10px var(--accent-hi);
}
.page-title {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 60%, var(--accent-hi) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-subtitle {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 780px;
  margin: 0;
}
/* Inline links inside subtitles / prose blocks -- readable light blue
 * with a subtle underline so they pop against the dim body text
 * without shouting. Applies wherever a bare <a> lives in a subtitle,
 * help panel, or module subtitle. */
.page-subtitle a,
.module-subtitle a,
.help-body a {
  color: #7dd3fc;
  text-decoration: underline;
  text-decoration-color: rgba(125,211,252,.45);
  text-underline-offset: 2px;
  transition: color .12s ease, text-decoration-color .12s ease;
}
.page-subtitle a:hover,
.module-subtitle a:hover,
.help-body a:hover {
  color: #bae6fd;
  text-decoration-color: #bae6fd;
}

/* =========================================================================
 * MODULES / CARDS
 * ========================================================================= */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.module {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.module:hover { border-color: var(--border-hi); }
.module-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(20, 184, 166, .03);
}
.module-head .left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.module-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--accent-hi);
  background: rgba(20, 184, 166, .10);
  border: 1px solid rgba(20, 184, 166, .30);
}
.module-title { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.module-subtitle {
  font-size: 11.5px;
  font-weight: 400;
  color: #b8c5d6;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  line-height: 1.35;
}
.module-body { padding: 16px; }
.module-body.tight { padding: 0; }

/* Module glow variants */
.module.glow-teal   { box-shadow: 0 0 0 1px rgba(20, 184, 166, .20), 0 0 26px rgba(20, 184, 166, .10); }
.module.glow-amber  { box-shadow: 0 0 0 1px rgba(245, 158, 11, .20), 0 0 26px rgba(245, 158, 11, .10); }
.module.glow-rose   { box-shadow: 0 0 0 1px rgba(244, 63, 94, .20),  0 0 26px rgba(244, 63, 94, .10); }
.module.glow-emerald{ box-shadow: 0 0 0 1px rgba(52, 211, 153, .20), 0 0 26px rgba(52, 211, 153, .10); }
.module.glow-sky    { box-shadow: 0 0 0 1px rgba(56, 189, 248, .20), 0 0 26px rgba(56, 189, 248, .10); }

/* =========================================================================
 * AREA CHART -- click-to-toggle legend (multi-series only, non-compact)
 * ========================================================================= */
.ds-area-chart.ds-area-chart-has-legend {
    display: flex;
    align-items: center;
    gap: 18px;
}
.ds-area-chart-has-legend .ds-chart-plot {
    flex: 1;
    min-width: 0;
}
.ds-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 10px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 160px;
    flex: 0 0 auto;
    align-self: center;
}
.ds-legend-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 7px;
    cursor: pointer;
    color: var(--text);
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 600;
    text-align: left;
    transition: background .12s, border-color .12s, opacity .12s;
}
.ds-legend-btn:hover {
    background: rgba(148, 163, 184, .06);
    border-color: rgba(148, 163, 184, .32);
}
.ds-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset;
    transition: opacity .12s;
}
.ds-legend-lbl {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-legend-btn.is-off {
    opacity: 0.42;
    background: transparent;
}
.ds-legend-btn.is-off .ds-legend-swatch {
    background: transparent !important;
    border: 1px solid currentColor;
    opacity: 0.6;
}
/* Series visibility toggle is done directly by JS on each element
 * (see ds_dashboard.js legend handler), so this stays future-proof for
 * any series key without CSS updates. */

/* Compact variant -- for tiny sparklines inside site cards. Just a
 * stack of color swatches beside the chart, no labels, ~14px wide. */
.ds-area-chart-compact.ds-area-chart-has-legend { gap: 8px; }
.ds-area-chart-compact .ds-chart-legend {
    padding: 4px 5px;
    gap: 4px;
    min-width: 0;
    background: transparent;
    border: 0;
}
.ds-area-chart-compact .ds-legend-btn {
    padding: 3px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0;    /* hide the label text; the swatch IS the button */
    gap: 0;
}
.ds-area-chart-compact .ds-legend-btn:hover {
    background: rgba(148, 163, 184, .10);
    border-color: rgba(148, 163, 184, .28);
}
.ds-area-chart-compact .ds-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.ds-area-chart-compact .ds-legend-lbl { display: none; }

/* =========================================================================
 * BUSY OVERLAY -- opt-in via <form data-busy="Title"> (see ds_busy.js)
 * Uses the browser's navigation lifecycle to auto-dismount on page swap.
 * ========================================================================= */
.ds-busy {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 16, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
}
.ds-busy.open { display: flex; }
.ds-busy-card {
    max-width: 520px;
    width: calc(100% - 40px);
    padding: 28px 30px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border: 1px solid rgba(20, 184, 166, .35);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 3px rgba(20, 184, 166, .10);
    text-align: center;
    animation: ds-busy-pop .18s cubic-bezier(.16, 1.2, .44, 1);
}
@keyframes ds-busy-pop {
    from { transform: translateY(10px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.ds-busy-spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid rgba(20, 184, 166, .15);
    border-top-color: var(--accent);
    border-right-color: var(--accent-hi);
    animation: ds-busy-spin .8s linear infinite;
}
@keyframes ds-busy-spin { to { transform: rotate(360deg); } }
.ds-busy-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ds-busy-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 16px;
}
.ds-busy-sub code {
    color: var(--accent-hi);
    background: rgba(20, 184, 166, .10);
    padding: 1px 6px;
    border-radius: 4px;
}
.ds-busy-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: .06em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ds-busy-step {
    padding: 5px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.ds-busy-step.ds-active {
    color: var(--accent-hi);
    background: rgba(20, 184, 166, .10);
    border-color: rgba(20, 184, 166, .35);
}
.ds-busy-sep { color: var(--text-muted); font-size: 12px; }

/* =========================================================================
 * KPI TILES
 * ========================================================================= */
.kpi { padding: 20px 22px; }
.kpi .num {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .lbl {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 6px;
}
.kpi .sub { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.kpi-teal   .num { color: var(--accent-hi); text-shadow: 0 0 24px rgba(20, 184, 166, .35); }
.kpi-amber  .num { color: var(--accent-warn-hi); text-shadow: 0 0 24px rgba(245, 158, 11, .30); }
.kpi-rose   .num { color: var(--accent-danger-hi); text-shadow: 0 0 24px rgba(244, 63, 94, .30); }
.kpi-emerald .num { color: var(--accent-ok-hi); text-shadow: 0 0 24px rgba(52, 211, 153, .30); }
.kpi-sky    .num { color: var(--accent-info); text-shadow: 0 0 24px rgba(56, 189, 248, .30); }

/* =========================================================================
 * PILLS + STATUS BADGES
 * ========================================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid var(--border);
}
.pill-ok    { background: rgba(52, 211, 153, .10); color: #a7f3d0; border-color: rgba(52, 211, 153, .35); }
.pill-warn  { background: rgba(245, 158, 11, .10); color: var(--accent-warn-hi); border-color: rgba(245, 158, 11, .35); }
.pill-mod   { background: rgba(59, 130, 246, .10); color: #3b82f6; border-color: rgba(59, 130, 246, .35); }
.pill-bad   { background: rgba(244, 63, 94, .10);  color: var(--accent-danger-hi); border-color: rgba(244, 63, 94, .35); }
.pill-info  { background: rgba(56, 189, 248, .10); color: var(--accent-info); border-color: rgba(56, 189, 248, .35); }
.pill-mute  { background: rgba(255,255,255,.03); color: var(--text-dim); }

/* =========================================================================
 * TABLES
 * ========================================================================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .dim  { color: var(--text-dim); }

/* =========================================================================
 * CHIP RANGE PICKER (portfolio-canonical .tr-chip pattern)
 * ========================================================================= */
.tr-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.tr-chip:hover { color: var(--text); border-color: var(--accent); }
.tr-chip.is-active {
  background: var(--accent);
  color: #0a1220;
  border-color: var(--accent);
}
/* Range bar itself carries no chrome -- the surrounding .rp-range-wrap
 * module provides the teal frame on every page. This gives a consistent
 * "outer dark card containing the picker" look everywhere the picker
 * appears (dashboard, sites, reports, file_changes, schema_changes,
 * portfolio_drift). */
.range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}
/* Canonical teal-framed panel wrapping every range picker. Reports.cgi
 * uses `<div class="module rp-range-wrap">` and every other page's
 * template now matches that pattern. */
.rp-range-wrap {
  background: linear-gradient(135deg, rgba(20,184,166,.18), rgba(20,184,166,.06) 60%, rgba(20,184,166,.12)) !important;
  border: 1px solid rgba(20,184,166,.55) !important;
  box-shadow: 0 0 0 1px rgba(20,184,166,.08),
              0 8px 22px -8px rgba(20,184,166,.50) !important;
}
.range-bar .rb-label {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.range-bar input[type="text"],
.range-bar input[type="datetime-local"] {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
.range-bar input[type="text"]:focus,
.range-bar input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Shared hover tooltip for any [data-ds-tip] element. Content
 * uses `||` as a paragraph separator so the CGI can build it with
 * simple string concatenation (no HTML wrangling server-side).
 * Handler in ds_dashboard.js. Renamed from data-tip -> data-ds-tip
 * because plain data-tip collided with browser default title-tooltip
 * behavior on some elements. */
.ds-tip {
  position: fixed !important;
  z-index: 99999;
  pointer-events: none;
  max-width: 340px;
  padding: 10px 12px;
  background: #0f1729;
  border: 1px solid rgba(20,184,166,.55);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(20,184,166,.08);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity .12s ease;
  left: 0;
  top: 0;
}
.ds-tip.is-visible { opacity: 1; }
.ds-tip .ds-tip-title {
  font-weight: 800;
  color: var(--accent-hi, #2dd4bf);
  margin-bottom: 4px;
  font-size: 12.5px;
}
.ds-tip .ds-tip-body { color: var(--text); }
.ds-tip .ds-tip-body p { margin: 0 0 4px 0; }
.ds-tip .ds-tip-body p:last-child {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
}

/* ---- "Showing" pill on the right side of every range picker.
 * Makes the currently-active window impossible to miss -- teal-glowing
 * chip with an icon, an uppercase eyebrow, and a big bold value. Slides
 * + fades in on load so an "on:YYYY-MM-DD" drilldown feels intentional. */
.range-bar .rp-showing {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: linear-gradient(135deg, rgba(20,184,166,.16), rgba(20,184,166,.06));
  border: 1px solid rgba(20,184,166,.55);
  border-radius: 999px;
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(20,184,166,.08),
              0 8px 24px -8px rgba(20,184,166,.55);
  animation: rp-showing-in .35s ease-out;
}
@keyframes rp-showing-in {
  0%   { opacity: 0; transform: translateX(6px) scale(.96); }
  100% { opacity: 1; transform: none; }
}
.range-bar .rp-showing-icon {
  width: 18px; height: 18px;
  color: var(--accent-hi, #2dd4bf);
  flex: 0 0 auto;
}
.range-bar .rp-showing-eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding-right: 8px;
  border-right: 1px solid rgba(148,163,184,.28);
}
.range-bar .rp-showing-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-hi, #2dd4bf);
  letter-spacing: .01em;
  white-space: nowrap;
}

/* =========================================================================
 * CHART TOOLTIP (activity timeline etc.)
 * ========================================================================= */
.chart-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 160px;
  transform: translate(-50%, calc(-100% - 10px));
  opacity: 0;
  transition: opacity .1s ease;
}
.chart-tooltip.on { opacity: 1; }
.chart-tooltip .ct-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.chart-tooltip .ct-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}
.chart-tooltip .ct-swatch {
  width: 9px; height: 9px; border-radius: 2px; display: inline-block;
}
.chart-tooltip .ct-hint {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================================================
 * BUTTONS
 * ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #030710;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease, box-shadow .1s ease, background .12s ease;
}
.btn:hover { background: var(--accent-hi); box-shadow: 0 4px 14px var(--accent-glow); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-2); border-color: var(--accent); color: var(--accent-hi); }
.btn-danger { background: var(--accent-danger); }
.btn-danger:hover { background: var(--accent-danger-hi); box-shadow: 0 4px 14px rgba(244, 63, 94, .35); }

/* =========================================================================
 * FORMS
 * ========================================================================= */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], textarea, select {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s ease;
  color-scheme: dark;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

/* =========================================================================
 * MISC UTILITIES
 * ========================================================================= */
code {
  background: rgba(20, 184, 166, .10);
  color: var(--accent-hi);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.88em;
  border: 1px solid rgba(20, 184, 166, .20);
}
.mono { font-family: var(--mono); }
.dim  { color: var(--text-dim); }
.muted { color: var(--text-muted); }

/* Banner */
.banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 10px 0;
  border-left: 3px solid;
}
.banner-ok    { background: rgba(52, 211, 153, .08); border-left-color: var(--accent-ok);       color: #a7f3d0; }
.banner-warn  { background: rgba(245, 158, 11, .08); border-left-color: var(--accent-warn);     color: var(--accent-warn-hi); }
.banner-err   { background: rgba(244, 63, 94, .08);  border-left-color: var(--accent-danger);   color: var(--accent-danger-hi); }
.banner-info  { background: rgba(56, 189, 248, .08); border-left-color: var(--accent-info);     color: var(--accent-info); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }


/* =========================================================================
 * META-ADMIN UI PARITY — 2026-07-12
 * app-shell alias for .app, brand-text tokens, topbar-title/actions/iconbtn/
 * search/pill, profile dropdown, avatar, sidebar-link-logout.
 * Palette re-uses the existing DriftSense teal/rose/emerald tokens.
 * ========================================================================= */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* Sidebar brand extra text nodes (kept .name/.role as legacy) */
.sidebar-brand .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.sidebar-brand .brand-name { font-family: var(--sans); font-weight: 700; letter-spacing: -.02em; font-size: 17px; color: var(--text); line-height: 1.1; }
.sidebar-brand .brand-name .accent { color: var(--accent-hi); }
.sidebar-brand .brand-sub { font-family: var(--sans); font-weight: 600; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }

/* Sign-out link at the bottom of the sidebar */
.sidebar-link-logout { color: var(--text-muted); }
.sidebar-link-logout:hover { color: var(--accent-danger-hi); background: rgba(244,63,94,.06); }
.sidebar-link-logout svg { opacity: .8; }

/* Topbar polish + new elements */
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: .3px; color: var(--text); margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.topbar-iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-sm); color: var(--text-muted);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s, box-shadow .15s;
}
.topbar-iconbtn:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.topbar-iconbtn svg { width: 18px; height: 18px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: var(--radius-sm);
  width: 260px; max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.topbar-search input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-size: 13px; font-family: var(--mono); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search svg { width: 14px; height: 14px; color: var(--text-dim); }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #0a1220;
  border: 1px solid #fff;
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  font-family: var(--sans);
  letter-spacing: .02em;
  flex: 0 0 auto;
  position: relative;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.40);
  z-index: 1;
}
.avatar::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent-hi) 100%);
  filter: blur(10px);
  opacity: 0.32;
  z-index: -1;
}

/* Profile dropdown */
.profile-dropdown { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent;
  padding: 4px 10px 4px 4px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.profile-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.profile-dropdown-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 280px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(20,184,166,.15);
  padding: 6px;
  z-index: 100;
}
.profile-dropdown-menu.open { display: block; }
.profile-dropdown-menu::before {
  content: ''; position: absolute; top: -6px; right: 20px;
  width: 10px; height: 10px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.profile-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 6px;
  transition: color .1s, background .1s;
}
.profile-dropdown-menu a:hover { color: var(--text); background: rgba(20,184,166,.06); }
.profile-dropdown-menu a .dropdown-icon { color: var(--text-muted); display: inline-flex; }
.profile-dropdown-menu a:hover .dropdown-icon { color: var(--accent-hi); }
.profile-dropdown-section {
  padding: 10px 12px 4px;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.profile-dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Sidebar-collapsed mode (desktop) */
html.sidebar-collapsed .app-shell { grid-template-columns: 64px 1fr; }
html.sidebar-collapsed .sidebar-brand .brand-text,
html.sidebar-collapsed .sidebar-link span,
html.sidebar-collapsed .sidebar-section-label,
html.sidebar-collapsed .ds-stable-tag { display: none; }
html.sidebar-collapsed .sidebar-link { justify-content: center; padding: 10px 0; }
html.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 8px 0 16px; }

/* =========================================================================
 * DB-side subgrid on site cards -- mirrors fc-subgrid layout but with one
 * hue per event type so the color IS the "what happened" cue:
 *   long queries  -> amber (#fbbf24)
 *   schema change -> violet (#8b5cf6)
 *   table locks   -> red    (#ef4444)
 * The .db-sub-hot modifier fires when the count is non-zero -- number +
 * icon light up in the semantic color, zero rows stay muted.
 * ========================================================================= */
.db-subgrid {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
  background: rgba(139, 92, 246, .03);
}
.db-sub-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
.db-sub-head .db-sub-lbl { font-weight: 800; color: var(--text-dim); font-family: var(--mono); }
.db-sub-head .db-sub-name { color: var(--text); text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.db-sub-kind {
  margin-left: auto;
  font-size: 9.5px; letter-spacing: .12em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(148, 163, 184, .12); color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, .18);
}
.db-sub-kind-explicit { color: var(--accent-hi); border-color: rgba(45, 212, 191, .30); background: rgba(45, 212, 191, .10); }
.db-sub-lanes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.db-sub {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  border-radius: 8px;
  color: var(--text-dim); text-decoration: none;
  transition: background .12s, color .12s, transform .12s, border-color .12s;
  border: 1px solid transparent;
}
.db-sub svg { width: 14px; height: 14px; opacity: .55; }
.db-sub:hover { color: var(--text); background: rgba(139, 92, 246, .07); border-color: rgba(139, 92, 246, .22); transform: translateY(-1px); }
.db-sub:hover svg { opacity: 1; }
.db-sub-num { font-family: var(--mono); font-size: 20px; font-weight: 800; line-height: 1; letter-spacing: -.01em; color: var(--text); }
.db-sub-lbl2 { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }

/* Per-lane hover accent (matches the series color of its chart line) */
.db-sub-lq:hover { background: rgba(251, 191, 36, .07); border-color: rgba(251, 191, 36, .28); }
.db-sub-sc:hover { background: rgba(139, 92, 246, .07); border-color: rgba(139, 92, 246, .28); }
.db-sub-tl:hover { background: rgba(239,  68,  68, .07); border-color: rgba(239,  68,  68, .28); }
.db-sub-lq:hover svg { color: #fbbf24; }
.db-sub-sc:hover svg { color: #8b5cf6; }
.db-sub-tl:hover svg { color: #ef4444; }

/* Non-zero hot state: number + icon lit up in the per-type color. */
.db-sub-hot .db-sub-num { color: var(--text); }
.db-sub-hot .db-sub-lbl2 { color: var(--text-dim); }
.db-sub-hot.db-sub-lq .db-sub-num { color: #fbbf24; text-shadow: 0 0 12px rgba(251, 191, 36, .40); }
.db-sub-hot.db-sub-lq svg { color: #fbbf24; opacity: 1; }
.db-sub-hot.db-sub-lq { border-color: rgba(251, 191, 36, .35); }
.db-sub-hot.db-sub-sc .db-sub-num { color: #a78bfa; text-shadow: 0 0 12px rgba(139, 92, 246, .40); }
.db-sub-hot.db-sub-sc svg { color: #a78bfa; opacity: 1; }
.db-sub-hot.db-sub-sc { border-color: rgba(139, 92, 246, .35); }
.db-sub-hot.db-sub-tl .db-sub-num { color: #f87171; text-shadow: 0 0 12px rgba(239, 68, 68, .40); }
.db-sub-hot.db-sub-tl svg { color: #f87171; opacity: 1; }
.db-sub-hot.db-sub-tl { border-color: rgba(239, 68, 68, .35); }

/* No-DB state */
.db-subgrid-empty { background: transparent; }
.db-sub-empty {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; color: var(--text-muted); font-size: 12px;
}
.db-sub-empty svg { width: 14px; height: 14px; opacity: .55; }
.db-sub-empty-cta { color: var(--accent); text-decoration: none; margin-left: auto; font-weight: 700; }
.db-sub-empty-cta:hover { text-decoration: underline; }

/* Tiles for a series the user has hidden portfolio-wide: dimmed with a
 * small strike so it's obvious the number is filtered, not actually zero. */
body.ds-hide-schema .db-sub-sc,
body.ds-hide-longq  .db-sub-lq,
body.ds-hide-lock   .db-sub-tl { opacity: .45; }
body.ds-hide-schema .db-sub-sc .db-sub-num,
body.ds-hide-longq  .db-sub-lq .db-sub-num,
body.ds-hide-lock   .db-sub-tl .db-sub-num { text-decoration: line-through; text-decoration-thickness: 1px; }
