/* ===========================================================================
   ARGT Dashboards — Design System v1 (shared stylesheet)
   Tokens lifted from artifacts/argt-app/src/styles/argt-tokens.css.
   Do not invent new --pvt-* names; do not invent new hex values.
   =========================================================================== */

:root {
  --pvt-bg: rgb(12, 10, 24);
  --pvt-surface: rgb(24, 19, 44);
  --pvt-surface-mid: rgb(34, 27, 58);
  --pvt-surface-light: rgb(46, 36, 78);
  --pvt-surface-raised: rgb(58, 46, 96);

  --pvt-text: rgb(248, 246, 255);
  --pvt-text-dim: rgba(248, 246, 255, 0.66);
  --pvt-muted: rgba(248, 246, 255, 0.85);

  --pvt-gold: rgb(181, 0, 106);          /* alias: MAGENTA */
  --pvt-gold-dim: rgb(145, 0, 85);
  --pvt-gold-bright: rgb(216, 40, 132);

  --pvt-mint: rgb(0, 168, 188);          /* alias: TEAL */

  --pvt-border: rgba(181, 0, 106, 0.20);
  --pvt-border-light: rgba(255, 255, 255, 0.06);

  --accent-amber: #C49800;
  --accent-magenta: #B5006A;
  --accent-teal: #007A8A;
  --accent-purple: #4C1285;

  --pvt-font-display: 'DM Sans', 'Manrope', 'Inter', system-ui, sans-serif;
  --pvt-font-body: 'DM Sans', 'Manrope', 'Inter', system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --gap: 24px;
  --pad: 24px;

  /* role accent (overridable via inline style on a surface) */
  --role-accent: var(--pvt-gold);
  --role-accent-bright: var(--pvt-gold-bright);
}

[data-density="compact"]     { --gap: 14px; --pad: 16px; }
[data-density="comfortable"] { --gap: 24px; --pad: 24px; }
[data-density="airy"]        { --gap: 36px; --pad: 36px; }

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

@keyframes argtBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes argtSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

html, body {
  margin: 0;
  background: var(--pvt-bg);
  color: var(--pvt-text);
  font-family: var(--pvt-font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(181, 0, 106, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 400px at 90% 30%, rgba(76, 18, 133, 0.16), transparent 60%),
    radial-gradient(ellipse 600px 400px at 10% 70%, rgba(0, 168, 188, 0.06), transparent 60%),
    var(--pvt-bg);
  min-height: 100vh;
}

/* ---------- TYPE ---------- */
.eyebrow {
  font-family: var(--pvt-font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--role-accent-bright);
}
.display-1 { font-family: var(--pvt-font-display); font-size: clamp(48px, 7vw, 96px); line-height: 0.92; letter-spacing: -0.035em; font-weight: 700; margin: 0; }
.display-2 { font-family: var(--pvt-font-display); font-size: 56px; line-height: 0.95; letter-spacing: -0.03em; font-weight: 700; margin: 0; }
.display-3 { font-family: var(--pvt-font-display); font-size: 32px; line-height: 1.05; letter-spacing: -0.022em; font-weight: 700; margin: 0; }
.h-section { font-family: var(--pvt-font-display); font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--pvt-text-dim); margin: 0 0 24px; }
.lede { font-size: 18px; line-height: 1.5; color: var(--pvt-muted); max-width: 720px; text-wrap: balance; }
.micro { font-size: 11px; letter-spacing: 0.10em; color: var(--pvt-text-dim); text-transform: uppercase; font-weight: 700; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }

/* ---------- PILL ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pvt-border-light);
  background: transparent;
  color: var(--pvt-muted);
  font-size: 13px; font-weight: 600;
  font-family: var(--pvt-font-body);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}
.pill:hover { background: var(--pvt-surface-mid); color: var(--pvt-text); }
.pill.active { background: var(--role-accent); color: white; border-color: var(--role-accent); }
.pill.dark { background: rgba(0, 0, 0, 0.45); color: var(--pvt-text); border-color: transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pvt-mint); }
.pill.active .dot { background: white; }
.pill-lg { padding: 12px 22px; font-size: 14px; }

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  font-family: var(--pvt-font-body);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending    { background: rgba(196, 152, 0, 0.16); color: #E0B638; }
.badge.review     { background: rgba(0, 168, 188, 0.16); color: #4DD0DD; }
.badge.approved   { background: rgba(0, 168, 188, 0.16); color: #4DD0DD; }
.badge.rejected   { background: rgba(181, 0, 106, 0.20); color: #F25BA7; }
.badge.withdrawn  { background: rgba(248, 246, 255, 0.08); color: var(--pvt-text-dim); }
.badge.paid       { background: rgba(0, 168, 188, 0.16); color: #4DD0DD; }
.badge.draft      { background: rgba(248, 246, 255, 0.08); color: var(--pvt-text-dim); }
.badge.published  { background: rgba(0, 168, 188, 0.16); color: #4DD0DD; }
.badge.archived   { background: rgba(248, 246, 255, 0.08); color: var(--pvt-text-dim); }
.badge.failed     { background: rgba(181, 0, 106, 0.20); color: #F25BA7; }

/* ---------- JOURNEY ---------- */
.journey { display: flex; gap: 8px; width: 100%; }
.journey .step {
  flex: 1;
  background: var(--pvt-surface-mid);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  border: 1px solid transparent;
}
.journey .step.current {
  background: linear-gradient(180deg, color-mix(in srgb, var(--role-accent) 22%, transparent), color-mix(in srgb, var(--role-accent) 6%, transparent));
  border-color: var(--role-accent);
}
.journey .step.done { border-color: var(--pvt-border-light); opacity: 0.7; }
.journey .step .idx { font-family: var(--pvt-font-display); font-size: 10px; letter-spacing: 0.15em; color: var(--pvt-text-dim); }
.journey .step.current .idx { color: var(--role-accent-bright); }
.journey .step .label { font-family: var(--pvt-font-display); font-size: 14px; line-height: 1.1; }
.journey .step .desc { font-size: 11px; color: var(--pvt-text-dim); line-height: 1.35; }

/* ---------- STAT TRIAD ---------- */
.stat-triad {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-pill);
  padding: 8px; gap: 4px;
}
.stat-cell {
  padding: 10px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-radius: var(--r-pill);
  min-width: 76px;
}
.stat-cell .num { font-family: var(--pvt-font-display); font-size: 18px; line-height: 1; color: var(--pvt-text); }
.stat-cell .lab { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pvt-text-dim); font-weight: 700; }

/* ---------- TILE ---------- */
.tile {
  background: var(--pvt-surface-mid);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 160px;
  position: relative;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}
.tile:hover { transform: translateY(-3px); border-color: var(--pvt-border); background: var(--pvt-surface-light); }
.tile .ico {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--role-accent) 22%, transparent);
  color: var(--role-accent-bright);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800;
}
.tile .name { font-family: var(--pvt-font-display); font-size: 17px; letter-spacing: -0.005em; line-height: 1.1; }
.tile .desc { font-size: 13px; color: var(--pvt-muted); line-height: 1.45; margin-top: auto; max-width: 90%; }
.tile .arr {
  position: absolute; right: 16px; bottom: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--pvt-surface-light);
  display: grid; place-items: center;
  font-weight: 800; color: var(--pvt-text);
  transition: background 200ms;
}
.tile:hover .arr { background: var(--role-accent); }

/* ---------- ICON RAIL ---------- */
.icon-rail {
  width: 80px;
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-xl);
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.rail-item {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  color: var(--pvt-text-dim);
  cursor: pointer;
  position: relative;
  transition: background 160ms, color 160ms;
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item:hover { background: var(--pvt-surface-mid); color: var(--pvt-text); }
.rail-item.active { background: var(--pvt-text); color: var(--pvt-bg); }
.rail-item .badge-dot {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--role-accent-bright);
  box-shadow: 0 0 0 2px var(--pvt-surface);
}
.rail-divider { width: 32px; height: 1px; background: var(--pvt-border-light); margin: 6px 0; }
.rail-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-accent), var(--accent-purple));
  margin-top: 4px;
}

/* ---------- TOP BAR ---------- */
.top-search {
  display: flex; align-items: center; gap: 12px;
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 14px;
  flex: 1; max-width: 460px;
}
.top-search .pill-search-ico {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--role-accent);
  color: white;
  display: grid; place-items: center;
}
.top-search input {
  flex: 1;
  background: transparent; border: 0; outline: 0;
  color: var(--pvt-text);
  font-family: var(--pvt-font-body); font-size: 13px;
}
.top-search input::placeholder { color: var(--pvt-text-dim); }
.btn-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  display: grid; place-items: center;
  color: var(--pvt-text-dim);
  cursor: pointer;
  position: relative;
}
.btn-icon.primary { background: var(--role-accent); color: white; border-color: var(--role-accent); }
.btn-icon .badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--role-accent-bright);
  box-shadow: 0 0 0 2px var(--pvt-surface);
}

/* ---------- HERO PANEL (concave + punch) ---------- */
.hero-panel {
  background: linear-gradient(135deg, var(--pvt-surface-mid) 0%, var(--pvt-surface-light) 100%);
  border-radius: var(--r-xl);
  padding: 36px;
  position: relative;
  overflow: visible;
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 14px;
}
.hero-panel::after {
  content: '';
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 88px; height: 88px;
  background: var(--pvt-bg);
  border-radius: 50%;
}
.hero-panel .punch {
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--role-accent);
  display: grid; place-items: center;
  color: white;
  font-weight: 800; font-size: 22px;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--role-accent) 40%, transparent);
  cursor: pointer;
  z-index: 5;
  transition: transform 200ms;
  border: 0;
}
.hero-panel .punch:hover { transform: translateY(-50%) scale(1.06); }
.hero-panel .eyebrow { color: var(--role-accent-bright); }
.hero-panel .title { font-family: 'Mulish', 'DM Sans', system-ui, sans-serif; font-weight: 700; font-size: clamp(28px, 2.6vw, 40px); line-height: 1; letter-spacing: -0.025em; white-space: nowrap; max-width: none; margin: 8px 0 0; }
.hero-panel .intro { color: var(--pvt-muted); font-size: 15px; line-height: 1.55; max-width: 560px; margin: 8px 0 16px; }
.hero-panel .cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--role-accent);
  color: white;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-family: var(--pvt-font-display);
  font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; align-self: flex-start;
  border: 0;
  transition: background 160ms, transform 160ms;
}
.hero-panel .cta:hover { background: var(--role-accent-bright); transform: translateY(-1px); }
.hero-panel .corner-stats { position: absolute; right: 80px; bottom: 24px; z-index: 4; }

/* Standalone solid CTA — same look as the hero CTA but usable anywhere
   (wayfinding banner, support drawer, handoff modal). */
.cta-solid {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--role-accent); color: #fff;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-family: var(--pvt-font-display); font-weight: 700; font-size: 13px;
  border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 160ms, transform 160ms;
}
.cta-solid:hover { background: var(--role-accent-bright); transform: translateY(-1px); }

/* ---------- SIDE CARDS (used by all dashboards) ---------- */
.side-card {
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-lg);
  padding: 18px;
}
/* sub-page side rail (right column on inner pages) */
.page-rail-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.page-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
/* Side-panel toggle button — visible at ALL widths (topbar) */
.side-drawer-trigger { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--pvt-surface-mid); border: 1px solid var(--pvt-border-light); color: var(--pvt-text); cursor: pointer; flex-shrink: 0; transition: background 160ms; }
.side-drawer-trigger:hover { background: var(--pvt-surface-light); }
.side-drawer-trigger.is-active { background: var(--role-accent); border-color: var(--role-accent); color: #fff; }
.side-drawer-trigger .ico { width: 15px; height: 12px; border: 1.6px solid currentColor; border-radius: 2px; position: relative; }
.side-drawer-trigger .ico::after { content: ''; position: absolute; top: 1px; bottom: 1px; right: 1px; width: 4px; background: currentColor; border-radius: 0 1px 1px 0; }

/* Desktop (>920): toggling hides the rail and gives the page full width */
@media (min-width: 921px) {
  html[data-rail-hidden] .page-rail-grid { grid-template-columns: 1fr !important; }
  html[data-rail-hidden] .page-rail { display: none !important; }
}
/* Narrow (≤920): the rail is an off-canvas drawer opened by the same toggle */
@media (max-width: 920px) {
  .page-rail-grid { grid-template-columns: 1fr; }
  .page-rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: 360px;
    max-width: calc(100vw - 40px); transform: translateX(-106%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 9100; background: var(--pvt-surface);
    border-right: 1px solid var(--pvt-border-light);
    padding: 22px 20px; overflow-y: auto; box-shadow: 24px 0 64px rgba(0,0,0,0.5);
    flex-direction: column; flex-wrap: nowrap;
  }
  .page-rail > * { flex: 0 0 auto; }
  html[data-rail-open] .page-rail { transform: translateX(0); }
  html[data-rail-open] body::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9099; }
}
@media (max-width: 560px) {
  .page-rail { flex-direction: column; }
}
.side-card .card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.side-card .card-head .ic {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--role-accent);
  color: white;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}
.side-card h4 { margin: 0; font-family: var(--pvt-font-display); font-size: 14px; flex: 1; letter-spacing: 0.01em; }
.side-card .head-action {
  font-size: 11px; color: var(--pvt-text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  cursor: pointer;
}
.stat-rows { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: var(--pvt-surface-mid);
  border-radius: var(--r-md);
  font-size: 13px;
}
.stat-row .lab { color: var(--pvt-muted); }
.stat-row .num { font-family: var(--pvt-font-display); font-size: 14px; }

/* ---------- LAYOUT: floating-card dashboard shell ---------- */
/* Single bordered frame — .shell is a transparent wrapper, .shell-inner carries the chrome. */
.shell {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  position: relative;
}
.shell-inner {
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.shell-topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center;
  gap: 16px;
}
.shell-topbar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-pill);
}
.shell-topbar .brand .wm {
  font-family: var(--pvt-font-display); font-size: 14px;
  color: var(--role-accent-bright); letter-spacing: -0.01em;
}
.shell-topbar .brand .sub {
  font-size: 11px; color: var(--pvt-text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.shell-topbar .actions { display: flex; gap: 10px; align-items: center; }

/* Sticky top nav on scroll (desktop) — floats as a bar above scrolling content */
@media (min-width: 769px) {
  .shell-topbar {
    position: sticky; top: 10px; z-index: 60;
    background: color-mix(in srgb, var(--pvt-surface) 90%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pvt-border-light);
    border-radius: var(--r-pill);
    padding: 8px 10px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.34);
  }
}

.shell-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

/* ---------- Tiles grid ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ---------- Section / page chrome ---------- */
.sec-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pvt-border-light);
}
.sec-head .sec-title { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Generic card ---------- */
.card {
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-lg);
  padding: var(--pad);
}

/* ---------- KPI big-num card ---------- */
.kpi {
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 116px;
  position: relative;
  overflow: hidden;
}
.kpi .label { font-size: 11px; color: var(--pvt-text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.kpi .num { font-family: var(--pvt-font-display); font-size: 36px; line-height: 1; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; margin-top: auto; }
.kpi .delta.up { color: var(--pvt-mint); }
.kpi .delta.down { color: #F25BA7; }
.kpi .glyph {
  position: absolute; right: 16px; top: 16px;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--role-accent) 22%, transparent);
  color: var(--role-accent-bright);
  display: grid; place-items: center;
  font-weight: 800;
}
/* Clickable KPI — only those wired to a drill-down get the affordance,
   so static summary tiles read as intentionally flat. */
.kpi--link { cursor: pointer; transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.kpi--link:hover { transform: translateY(-2px); border-color: var(--role-accent); box-shadow: 0 12px 32px rgba(0,0,0,0.30); }
.kpi--link:focus-visible { outline: 2px solid var(--role-accent-bright); outline-offset: 2px; }
.kpi-go { position: absolute; right: 16px; bottom: 14px; font-size: 15px; line-height: 1; color: var(--pvt-text-dim); opacity: 0; transform: translateX(-3px); transition: opacity 140ms ease, transform 140ms ease; }
.kpi--link:hover .kpi-go, .kpi--link:focus-visible .kpi-go { opacity: 1; transform: translateX(0); color: var(--role-accent-bright); }
@keyframes lccDrawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.pm-h { font-size: 11px; color: var(--pvt-text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 10px; }

/* ---------- List row ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--pvt-surface-mid);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 160ms;
}
.list-row:hover { background: var(--pvt-surface-light); }
.list-row .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-accent), var(--accent-purple));
  flex-shrink: 0;
}
.list-row .main-text { flex: 1; min-width: 0; }
.list-row .main-text .t1 { font-family: var(--pvt-font-display); font-size: 13px; line-height: 1.2; }
.list-row .main-text .t2 { font-size: 11px; color: var(--pvt-text-dim); margin-top: 2px; }
.list-row .right-text { font-size: 12px; color: var(--pvt-text-dim); font-family: var(--pvt-font-display); }

/* ---------- Page chrome / batch nav ---------- */
.batch-nav {
  display: inline-flex;
  background: var(--pvt-surface);
  border: 1px solid var(--pvt-border-light);
  border-radius: var(--r-pill);
  padding: 4px; gap: 2px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
}
.batch-nav a { color: var(--pvt-text-dim); padding: 6px 12px; border-radius: var(--r-pill); text-decoration: none; }
.batch-nav a.active { background: var(--pvt-gold); color: white; }
.batch-nav a:hover { color: var(--pvt-text); }

/* ---------- Design canvas tweaks ---------- */
dc-host { background: transparent; }


/* ============================================================
   RESPONSIVE BREAKPOINTS
   Targets: 320 / 375 / 480 / 600 / 768 / 1024 / 1280 / 1440+
   ============================================================ */

/* Tablet portrait + narrow laptops — 1024px and below */
@media (max-width: 1024px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .shell-body { grid-template-columns: 1fr !important; }
  .row-3 { grid-template-columns: repeat(2, 1fr); }
  .row-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { padding: 26px; min-height: 0; }
  .hero-panel::after { display: none; }
  .hero-panel .punch { top: 22px; right: 22px; transform: none; width: 48px; height: 48px; font-size: 18px; }
  .hero-panel .punch:hover { transform: scale(1.06); }
  .hero-panel .title { white-space: normal; max-width: 100%; }
  .hero-panel .corner-stats { position: static; margin-top: 14px; align-self: flex-start; }
  .stat-rows { gap: 6px; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .prim-grid { grid-template-columns: repeat(2, 1fr); }
  .prim-grid .col-4, .prim-grid .col-6, .prim-grid .col-8, .prim-grid .col-12 { grid-column: span 2; }
}

/* Tablet landscape — 900px and below */
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
  .fold-grid { grid-template-columns: 1fr; }
}

/* Mobile landscape / small tablet — 768px and below */
@media (max-width: 768px) {
  body { padding: 12px !important; }
  .shell-inner { grid-template-columns: 1fr !important; padding: 14px !important; gap: 14px !important; }
  .shell-topbar { flex-wrap: wrap; gap: 8px !important; }
  .top-search { max-width: 100% !important; flex: 1 1 100% !important; order: 3; }
  .icon-rail {
    flex-direction: row !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 8px !important;
    overflow-x: auto;
    border-radius: var(--r-md) !important;
    scrollbar-width: none;
  }
  .icon-rail::-webkit-scrollbar { display: none; }
  .rail-item { width: 44px !important; height: 44px !important; flex-shrink: 0; }
  .rail-item svg { width: 18px; height: 18px; }
  .rail-divider { width: 1px !important; height: 24px !important; margin: 4px 6px !important; }
  .rail-avatar { margin: 0 0 0 auto !important; }
  .hero-panel { padding: 22px !important; min-height: 220px; }
  .hero-panel .title { white-space: normal !important; font-size: clamp(22px, 5.5vw, 30px) !important; max-width: 100% !important; letter-spacing: -0.02em !important; }
  .hero-panel .intro { font-size: 14px; }
  .hero-panel .punch { right: -10px !important; width: 48px !important; height: 48px !important; font-size: 18px !important; }
  .hero-panel::after { right: -20px !important; width: 68px !important; height: 68px !important; }
  .stat-triad { padding: 6px; gap: 2px; flex-wrap: wrap; justify-content: center; }
  .stat-cell { padding: 8px 12px; min-width: 60px; }
  .stat-cell .num { font-size: 16px; }
  .tile-grid { grid-template-columns: 1fr !important; }
  .journey { flex-wrap: wrap; gap: 6px !important; }
  .journey .step { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); padding: 12px !important; }
  .row-2 { grid-template-columns: 1fr !important; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .prim-grid { grid-template-columns: 1fr !important; }
  .prim-grid .col-4, .prim-grid .col-6, .prim-grid .col-8, .prim-grid .col-12 { grid-column: span 1 !important; }
  .sec-head { flex-wrap: wrap; }
  .type-row { grid-template-columns: 1fr; gap: 8px; }
  .scale-item { grid-template-columns: 80px 1fr 80px; }
}

/* Mobile — 600px and below */
@media (max-width: 600px) {
  body { padding: 10px !important; }
  .shell-inner { padding: 12px !important; }
  .hero-panel { padding: 18px !important; min-height: 200px; }
  .hero-panel .title { font-size: clamp(20px, 5vw, 26px) !important; }
  .hero-panel .cta { padding: 10px 18px !important; font-size: 12px !important; }
  .hero-panel .corner-stats { width: 100%; align-self: flex-start; }
  .side-card { padding: 14px !important; }
  .top-search input { font-size: 12px; }
  .brand .sub { display: none; }
  .brand-switcher [role="dialog"], .brand-switcher > div:last-child { min-width: 220px !important; }
}

/* Small mobile — 480px and below */
@media (max-width: 480px) {
  body { padding: 8px !important; }
  .shell-inner { padding: 10px !important; gap: 10px !important; }
  .hero-panel { padding: 16px !important; min-height: 180px; }
  .hero-panel .title { font-size: clamp(18px, 6.5vw, 24px) !important; }
  .hero-panel .intro { font-size: 13px; line-height: 1.5; }
  .hero-panel .punch { right: -8px !important; width: 42px !important; height: 42px !important; font-size: 16px !important; }
  .hero-panel::after { right: -18px !important; width: 56px !important; height: 56px !important; }
  .stat-cell { padding: 6px 10px; min-width: 50px; }
  .stat-cell .num { font-size: 14px; }
  .journey .step { min-width: 100%; flex: 1 1 100%; }
  .top-actions { gap: 6px !important; }
  .btn-icon { width: 38px; height: 38px; }
  .tile { padding: 16px !important; min-height: 140px !important; }
  .tile .name { font-size: 16px; }
}

/* Small mobile baseline — 360px and below */
@media (max-width: 360px) {
  body { padding: 6px !important; }
  .shell-inner { padding: 8px !important; gap: 8px !important; }
  .hero-panel { padding: 14px !important; }
  .hero-panel .title { font-size: clamp(16px, 6vw, 22px) !important; }
  .brand { padding: 6px 10px; }
  .brand .wm { font-size: 12px; }
  .icon-rail { padding: 6px !important; }
  .rail-item { width: 38px !important; height: 38px !important; }
  .rail-item svg { width: 16px; height: 16px; }
}


/* ============================================================
   PHASE 1-4 RESPONSIVE UTILITIES
   ============================================================ */

/* Utility grid classes used in place of inline gridTemplateColumns */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-cols-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.grid-cols-asym { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.grid-cols-tile-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-form-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* Data row patterns (admin tables, schedule, etc.) */
.grid-row-status3 { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; }
.grid-row-status4 { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; }
.grid-row-status5 { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 14px; align-items: center; }
.grid-row-data4   { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 14px; align-items: center; }
.grid-row-time    { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 14px; align-items: center; }
.grid-row-listed  { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: center; }
.grid-row-3lab    { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 14px; align-items: center; }

/* Mobile collapse for utility grids */
@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5,
  .grid-cols-tile-row, .grid-form-2, .grid-cols-asym { grid-template-columns: 1fr !important; }
  .grid-row-status3, .grid-row-status4, .grid-row-status5,
  .grid-row-data4, .grid-row-time, .grid-row-listed, .grid-row-3lab {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  .grid-row-status3 > *, .grid-row-status4 > *, .grid-row-status5 > *,
  .grid-row-data4 > *, .grid-row-time > *, .grid-row-listed > *, .grid-row-3lab > * {
    text-align: left !important;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

/* PHASE 2 — admin data tables become card-stack at mobile */
@media (max-width: 768px) {
  .data-table .dt-head { display: none !important; }
  .data-table .dt-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    grid-template-columns: 1fr !important;
    padding: 14px 16px !important;
    background: var(--pvt-surface-mid);
    border-radius: var(--r-md);
    margin-bottom: 8px;
  }
  .data-table .dt-row > * { width: 100%; }
  .data-table .dt-row > .avatar-sm { width: 32px !important; height: 32px !important; }
  .data-table { background: transparent !important; border: 0 !important; padding: 0 !important; }
}

/* PHASE 2 — qrow (queue rows in admin home) become vertical cards at mobile */
@media (max-width: 768px) {
  .qrow { grid-template-columns: 40px 1fr !important; grid-template-rows: auto auto !important; padding: 12px !important; gap: 8px 12px !important; }
  .qrow .avatar { grid-row: 1 / 3; }
  .qrow .info { grid-column: 2; }
  .qrow > .badge, .qrow > .pill { grid-column: 2; justify-self: start; margin-top: 4px; }
}

/* PHASE 3 — hero panel hard breaks */
@media (max-width: 600px) {
  .hero-panel::after { display: none; }
  .hero-panel .punch { right: 18px !important; }
  .hero-panel .corner-stats { position: static !important; align-self: stretch; margin-top: 14px; order: 10; }
  .hero-panel { display: flex; flex-direction: column; }
  .hero-panel .stat-triad { width: 100%; justify-content: space-around; }
}
@media (max-width: 480px) {
  .hero-panel .punch { display: none !important; }
  .hero-panel { padding: 18px !important; min-height: auto !important; gap: 10px !important; }
  .hero-panel .cta { width: 100%; justify-content: center; }
}

/* PHASE 4 — mobile chrome */
/* Brand switcher dropdown fits viewport */
@media (max-width: 480px) {
  .brand-switcher > div:last-child {
    min-width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    right: -8px !important;
    left: auto !important;
  }
}

/* Tweaks panel becomes a bottom sheet on small mobile */
@media (max-width: 480px) {
  [data-tweaks-panel],
  div[style*="position: fixed"][style*="bottom"][style*="right"] {
    max-width: 100vw !important;
  }
}

/* Admin sidebar — drawer toggle. Hidden by default at ≤768, toggle via .admin-shell.sidebar-open */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 280px !important;
    max-width: 85vw !important;
    max-height: 100vh !important;
    z-index: 9000 !important;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    border-right: 1px solid var(--pvt-border-light);
    border-bottom: 0;
    box-shadow: 24px 0 60px rgba(0,0,0,0.5);
  }
  .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }
  .admin-shell.sidebar-open::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 8999;
  }
  .admin-shell { grid-template-columns: 1fr !important; }
  .admin-main { padding: 12px !important; }
  /* show hamburger button (injected by JS) */
  .admin-hamburger {
    display: grid !important;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--pvt-surface-mid);
    border: 1px solid var(--pvt-border-light);
    color: var(--pvt-text);
    cursor: pointer;
    flex-shrink: 0;
  }
}
@media (min-width: 769px) {
  .admin-hamburger { display: none !important; }
}
.admin-hamburger { display: none; }

/* Hero topbar wrap fix at mobile */
@media (max-width: 600px) {
  .shell-topbar .brand .sub { display: none; }
  .shell-topbar .brand { padding: 6px 12px; }
  .shell-topbar .brand .wm { font-size: 13px; }
}


/* ============================================================
   POST-AUDIT FIX — horizontal-overflow defense
   ============================================================ */
@media (max-width: 1024px) {
  html { overflow-x: hidden; }
  body { max-width: 100vw; }
  .shell, .shell-inner, .shell-body, .admin-shell, .admin-main { max-width: 100% !important; min-width: 0 !important; }
  /* Grid implicit min-width is "auto" which can be wider than the cell — force min-width:0 on every grid child */
  .shell-inner > *, .shell-body > *, .admin-shell > *, .admin-main > * { min-width: 0 !important; }
  .hero-panel, .tile, .side-card, .card, .data-table { min-width: 0 !important; max-width: 100% !important; }
  /* The brand switcher's ABS-positioned dropdown was overflowing — clamp it harder */
  .brand-switcher > div[style*="position: absolute"] { max-width: calc(100vw - 32px) !important; }
}
@media (max-width: 768px) {
  .icon-rail { max-width: 100% !important; }
  .hero-panel { overflow: hidden !important; }
  .hero-panel .corner-stats { max-width: 100%; }
  .stat-triad { max-width: 100%; flex-wrap: wrap; }
  /* Topbar inputs must shrink, not push width */
  .top-search { min-width: 0 !important; }
  .top-search input { min-width: 0 !important; width: 100% !important; }
}


/* ============================================================
   SIDE-CARD DRAWER — ≤1290px viewport
   The side-card column is removed from inline flow and becomes
   a right-edge slide-out drawer toggled by a topbar trigger.
   ============================================================ */
@media (max-width: 1290px) {
  /* Side-cards column becomes fixed drawer */
  .shell-body > :first-child {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: var(--pvt-surface);
    border-left: 1px solid var(--pvt-border-light);
    padding: 24px 22px;
    transform: translateX(105%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 9100;
    overflow-y: auto;
    box-shadow: -24px 0 64px rgba(0,0,0,0.55);
    display: flex !important;
    flex-direction: column;
    gap: 14px;
  }
  html[data-side-drawer="open"] .shell-body > :first-child {
    transform: translateX(0);
  }
  /* Force shell-body to single column so main content uses full width */
  .shell-body { grid-template-columns: 1fr !important; }

  /* Backdrop */
  html[data-side-drawer="open"] body::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9099;
    cursor: pointer;
    animation: side-drawer-fade-in 220ms ease both;
  }
  @keyframes side-drawer-fade-in { from { opacity: 0; } to { opacity: 1; } }
  /* (legacy block retained but inert — overview drawer replaced by .page-rail toggle) */
  .side-drawer-trigger {
    display: inline-grid !important;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--pvt-surface-mid);
    border: 1px solid var(--pvt-border-light);
    color: var(--pvt-text);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 160ms;
  }
  .side-drawer-trigger:hover { background: var(--pvt-surface-light); }
  .side-drawer-trigger .ico { width: 16px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; display: block; position: relative; }
  .side-drawer-trigger .ico::after {
    content: ''; position: absolute;
    top: 1px; right: 1px; width: 3px; height: 3px;
    border-radius: 50%; background: var(--accent-amber);
  }
}
@media (max-width: 600px) {
  .shell-body > :first-child {
    width: calc(100vw - 32px) !important;
    padding: 18px !important;
  }
}
.side-drawer-trigger { display: none; }
