@import url('/admin-theme.css');

@font-face {
  font-family: 'IBM Plex Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url('/admin-fonts/latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url('/admin-fonts/vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* QT Studio — Unified Design System (08. Sapphire Emerald · Đen Chì Studio #101215) */
:root {
  /* Đen Chì Studio Ground & Layered Frosted Surfaces (Dark Default — 0% Purple/Blue Tint) */
  --bg: #101215;
  --ground: #101215;
  --sidebar-bg: rgba(21, 24, 28, 0.88);
  --topbar-bg: rgba(18, 21, 25, 0.86);
  --surface: rgba(27, 31, 37, 0.90);
  --surface-solid: #1b1f25;
  --surface-shine: rgba(255, 255, 255, 0.05);
  --raised: #181c22;
  --well: rgba(28, 33, 40, 0.78);
  --well-solid: #161a20;
  --well-hover: #242a33;

  /* Strictly Neutral Graphite Borders */
  --border: #2b313b;
  --edge: #2b313b;
  --edge-strong: #38404d;
  --control: #38404d;

  /* High-Contrast Typography Ink */
  --ink: #f1f5f8;
  --muted: #94a0ae;
  --text-soft: #687585;

  /* Sapphire-Emerald Focal Accent (Thủy sinh Mộc) */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-soft: rgba(16, 185, 129, 0.14);
  --primary-ink: #04130e;
  --sapphire: #0f52ba;
  --cyan: #06b6d4;
  --emerald: #34d399;
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.14);
  --ring: #10b981;
  --violet: #10b981;
  --violet-deep: #0f52ba;

  /* Canonical 3 Plan Tier Colors (Basic Sapphire · Pro Amethyst · Ultra Platinum Diamond Ice — 0% Warm Pink/Amber) */
  --qt-tier-basic-bg: rgba(37, 99, 235, 0.20);
  --qt-tier-basic-border: rgba(96, 165, 250, 0.40);
  --qt-tier-basic-ink: #bfdbfe;
  --qt-tier-basic-dot: #3b82f6;

  --qt-tier-pro-bg: rgba(124, 58, 237, 0.20);
  --qt-tier-pro-border: rgba(168, 85, 247, 0.44);
  --qt-tier-pro-ink: #e9d5ff;
  --qt-tier-pro-dot: rgb(168, 85, 247);

  --qt-tier-ultra-from: #e0f2fe;
  --qt-tier-ultra-mid: #7dd3fc;
  --qt-tier-ultra-indigo: #a5b4fc;
  --qt-tier-ultra-to: #e9d5ff;
  --qt-tier-ultra-bg: linear-gradient(110deg, rgba(224, 242, 254, 0.16) 0%, rgba(125, 211, 252, 0.16) 38%, rgba(165, 180, 252, 0.18) 72%, rgba(233, 213, 255, 0.18) 100%);
  --qt-tier-ultra-border: rgba(125, 211, 252, 0.46);
  --qt-tier-ultra-ink: #e0f2fe;

  /* Semantic Status Tokens */
  --good: #34d399;
  --good-bg: rgba(16, 185, 129, 0.13);
  --good-edge: rgba(52, 211, 153, 0.28);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.13);
  --warn-edge: rgba(251, 191, 36, 0.28);
  --danger: #fb7185;
  --danger-bg: rgba(244, 63, 94, 0.13);
  --danger-edge: rgba(251, 113, 133, 0.30);

  /* OpenDesign Comfort Modular Type Scale (Wave E1 Sync) */
  --text-xs: 12.5px;
  --text-sm: 14px;
  --text-base: 15.5px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;

  /* OpenDesign 8pt Spatial Rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.34), 0 2px 6px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.52);

  /* Atmospheric Mesh & Precision Grid Variables */
  --mesh-sapphire: rgba(15, 82, 186, 0.14);
  --mesh-sapphire-soft: rgba(15, 82, 186, 0.04);
  --mesh-cyan: rgba(6, 182, 212, 0.12);
  --mesh-cyan-soft: rgba(6, 182, 212, 0.03);
  --mesh-bottom: rgba(16, 185, 129, 0.08);
  --grid-line: rgba(255, 255, 255, 0.028);

  font: 14px/1.5 var(--font-sans);
  background: var(--ground);
  color: var(--ink);
  accent-color: var(--primary);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-strong) transparent;
}

:root[data-resolved-theme="light"],
:root[data-theme="light"] {
  --bg: #f2f6f7;
  --ground: #f2f6f7;
  --sidebar-bg: rgba(230, 236, 238, 0.88);
  --topbar-bg: rgba(248, 251, 252, 0.88);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-shine: rgba(255, 255, 255, 0.92);
  --raised: #ffffff;
  --well: #e6ecee;
  --well-solid: #e6ecee;
  --well-hover: #dce5e8;

  --border: #cbd7dc;
  --edge: #cbd7dc;
  --edge-strong: #b3c4cb;
  --control: #b3c4cb;

  --ink: #0d171e;
  --muted: #4b5e6b;
  --text-soft: #647886;

  --primary: #059669;
  --primary-hover: #047857;
  --primary-soft: rgba(5, 150, 105, 0.10);
  --primary-ink: #ffffff;
  --sapphire: #0f52ba;
  --cyan: #0077be;
  --accent: #0077be;
  --accent-soft: rgba(0, 119, 190, 0.10);
  --ring: #059669;
  --violet: #059669;
  --violet-deep: #0f52ba;

  --qt-tier-basic-bg: rgba(37, 99, 235, 0.10);
  --qt-tier-basic-border: rgba(37, 99, 235, 0.32);
  --qt-tier-basic-ink: #1d4ed8;
  --qt-tier-basic-dot: #2563eb;

  --qt-tier-pro-bg: rgba(124, 58, 237, 0.10);
  --qt-tier-pro-border: rgba(124, 58, 237, 0.34);
  --qt-tier-pro-ink: rgb(109, 40, 217);
  --qt-tier-pro-dot: rgb(124, 58, 237);

  --qt-tier-ultra-from: #0284c7;
  --qt-tier-ultra-mid: #38bdf8;
  --qt-tier-ultra-indigo: #6366f1;
  --qt-tier-ultra-to: rgb(139, 92, 246);
  --qt-tier-ultra-bg: linear-gradient(110deg, rgba(2, 132, 199, 0.10) 0%, rgba(56, 189, 248, 0.12) 42%, rgba(99, 102, 241, 0.12) 74%, rgba(139, 92, 246, 0.12) 100%);
  --qt-tier-ultra-border: rgba(2, 132, 199, 0.34);
  --qt-tier-ultra-ink: #0369a1;

  --good: #047857;
  --good-bg: #ecfdf5;
  --good-edge: #a7f3d0;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-edge: #fde68a;
  --danger: #be123c;
  --danger-bg: #fff1f2;
  --danger-edge: #fecdd3;

  --shadow-sm: 0 1px 2px rgba(13, 23, 30, 0.04), 0 2px 6px rgba(13, 23, 30, 0.025);
  --shadow-md: 0 4px 14px rgba(13, 23, 30, 0.07);
  --shadow-lg: 0 14px 34px rgba(13, 23, 30, 0.11);

  --mesh-sapphire: rgba(15, 82, 186, 0.08);
  --mesh-sapphire-soft: rgba(15, 82, 186, 0.02);
  --mesh-cyan: rgba(0, 119, 190, 0.07);
  --mesh-cyan-soft: rgba(0, 119, 190, 0.02);
  --mesh-bottom: rgba(5, 150, 105, 0.06);
  --grid-line: rgba(13, 23, 30, 0.042);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body, h1, h2, h3, p, dl, dd { margin: 0; }
body {
  min-height: 100vh;
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Atmospheric Studio Mesh + Subtle Precision Grid (Luxury Depth · Zero CPU Churn) */
body.app-shell::before,
body.app-shell::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: '';
}
body.app-shell::before {
  background:
    radial-gradient(ellipse 64% 46% at 14% -4%, var(--mesh-sapphire) 0%, var(--mesh-sapphire-soft) 44%, transparent 74%),
    radial-gradient(ellipse 56% 42% at 88% -6%, var(--mesh-cyan) 0%, var(--mesh-cyan-soft) 44%, transparent 72%),
    radial-gradient(ellipse 46% 36% at 52% 106%, var(--mesh-bottom) 0%, transparent 68%);
}
body.app-shell::after {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 90% 72% at 50% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.30) 46%, rgba(0, 0, 0, 0.05) 76%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 72% at 50% 0%, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.30) 46%, rgba(0, 0, 0, 0.05) 76%, transparent 100%);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 10000;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: var(--text-sm);
  font-weight: 620;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-140%);
  transition: transform 160ms var(--ease-out), opacity 160ms ease;
}
.skip-link:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 54%, transparent);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Multi-Stage 3D Quantum Crystal Intro Overlay (Sign-In Only) */
.qt-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse 65% 58% at 50% 45%, rgba(21, 27, 35, 0.94) 0%, rgba(16, 18, 21, 0.985) 72%, #0b0d10 100%);
  backdrop-filter: blur(18px);
  color: #f1f5f8;
  user-select: none;
  cursor: pointer;
  transition: opacity 440ms var(--ease-out), transform 460ms var(--ease-out), backdrop-filter 440ms ease;
}
.qt-intro.qt-intro-exit {
  opacity: 0;
  transform: scale(1.06);
  backdrop-filter: blur(0px);
  pointer-events: none;
}
.qt-intro-preload { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.qt-intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.qt-intro-hud {
  position: relative;
  z-index: 2;
  align-self: end;
  margin-bottom: clamp(36px, 9vh, 80px);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  text-align: center;
  pointer-events: none;
  animation: qt-hud-rise 680ms var(--ease-out) 260ms both;
}
.qt-intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.qt-intro-title {
  display: block;
  font-size: clamp(24px, 3.6vw, var(--text-2xl));
  font-weight: 740;
  letter-spacing: -0.032em;
  line-height: 1.14;
  color: #f8fafc;
}
.qt-intro-track {
  position: relative;
  width: min(240px, 56vw);
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.qt-intro-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, #0f52ba 0%, #06b6d4 52%, #10b981 100%);
  animation: qt-intro-bar 2200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes qt-hud-rise { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes qt-intro-bar { 0% { transform: scaleX(0.03); } 35% { transform: scaleX(0.46); } 75% { transform: scaleX(0.88); } 100% { transform: scaleX(1); } }

/* Calm Admin Rule: Hide moving canvas particles & aurora behind the logged-in dashboard */
.ag-field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.34; }
.ag-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
body:has(#dashboard:not([hidden])) #ag-canvas,
body:has(#dashboard:not([hidden])) .ag-aurora {
  display: none !important;
}
.ag-orb { position: absolute; border-radius: 50%; filter: blur(96px); opacity: 0.14; will-change: transform; }
:root[data-resolved-theme="light"] .ag-orb,
:root[data-theme="light"] .ag-orb { opacity: 0.08; }
:root[data-modal-open="true"] .ag-orb { animation-play-state: paused !important; }
.ag-orb-1 {
  width: 42vw; height: 42vw; max-width: 520px; max-height: 520px;
  top: -16%; right: -8%;
  background: radial-gradient(circle, rgba(15, 82, 186, 0.34) 0%, rgba(15, 82, 186, 0) 70%);
}
.ag-orb-2 {
  width: 46vw; height: 46vw; max-width: 560px; max-height: 560px;
  bottom: -20%; left: -10%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.26) 0%, rgba(16, 185, 129, 0) 70%);
}
.ag-orb-3 { display: none; }

/* App Shell */
.app-shell {
  --workspace-width: 1380px;
  --gutter: clamp(16px, 2.2vw, 28px);
  --bar-height: 60px;
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}
.sidebar, .workspace-header, .sign-in-header, .workspace { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .filter-popup { transform-origin: top; animation: popup-in 130ms var(--ease-out); }
  .opens-up > .filter-popup { transform-origin: bottom; }
  .detail-opening { animation: detail-in 170ms var(--ease-out) both; }
  #issue-dialog[open], .switcher-dialog[open], .inspector-modal[open] { animation: popup-in 160ms var(--ease-out); }
  #dashboard > section:not([hidden]) { animation: ag-section-in 180ms var(--ease-out) both; }
  button:active:not(:disabled) { transform: scale(0.985); }
}
/* Animate scale/opacity without touching transform/translate so centered dialogs & popups never drift */
@keyframes popup-in { from { opacity: 0; scale: 0.98; } to { opacity: 1; scale: 1; } }
@keyframes detail-in { from { grid-template-rows: 0fr; opacity: .65; } }
@keyframes ag-section-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

:focus-visible,
a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.workspace:focus { outline: none; }
:is(input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}
select { min-width: 0; text-overflow: ellipsis; }
h1 { font-size: clamp(22px, 2.1vw, var(--text-xl)); line-height: 1.24; letter-spacing: -.026em; font-weight: 700; text-wrap: balance; }
h1[tabindex]:focus { outline: 0; }
h2 { font-size: var(--text-base); line-height: 1.35; letter-spacing: -.014em; font-weight: 660; }
h3 { font-size: var(--text-sm); line-height: 1.35; font-weight: 640; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:is(#ov-tier-breakdown, #ov-system-health, .ops-tier-breakdown, .ops-system-health, .ops-donut-wrap, .ops-chart-svg-wrap) svg,
svg[data-chart],
svg.ops-chart-svg {
  width: revert;
  height: revert;
  fill: revert;
  stroke: revert;
  stroke-width: revert;
  overflow: visible;
}
button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; }
code { font-family: var(--font-mono); }

/* Keep console headings crisp neutral inside workspace */
.workspace .pro-accent {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: inherit;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Frosted Glass Precision Sidebar (248px · 8pt Grid) */
.sidebar {
  position: sticky;
  z-index: 3;
  top: 0;
  grid-row: 1 / span 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  height: 100dvh;
  padding: var(--space-4) var(--space-3);
  border-inline-end: 1px solid var(--border);
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  font-weight: 670;
  letter-spacing: -.018em;
  line-height: 1.2;
}
.brand img, .mobile-brand {
  flex: none;
  border-radius: var(--radius-sm);
}
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; }
.sidebar .brand { padding: 2px 8px; }
.sidebar-nav {
  display: grid;
  align-content: start;
  gap: var(--space-5);
  min-height: 0;
  margin-top: var(--space-5);
  padding: 2px;
  overflow: auto;
}
.nav-group { display: grid; gap: 4px; }
.nav-group h2 {
  margin: 0 10px 4px;
  text-align: start;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sidebar-nav button, .switcher-links button {
  position: relative;
  width: 100%;
  justify-content: start;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: start;
  font-size: var(--text-sm);
  font-weight: 540;
}
.sidebar-nav button[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  margin-inline-start: auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.sidebar-nav button[aria-current][data-count]:not([data-count=""])::after {
  background: var(--well-solid);
  border: 1px solid var(--border);
  color: var(--ink);
}
.sidebar-nav button:hover, .switcher-links button:hover {
  background: var(--well);
  color: var(--ink);
}
.sidebar-nav button[aria-current], .switcher-links button[aria-current] {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 620;
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-sm);
}
/* 2% Violet Focal Accent: Thin 2.5px active rail on Sidebar */
.sidebar-nav button[aria-current]::before {
  position: absolute;
  inset: 7px auto 7px 0;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  content: '';
}
.sidebar-nav button[aria-current] svg,
.switcher-links button[aria-current] svg { color: var(--primary); }

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.sidebar-web-link,
.signin-web-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 580;
  text-decoration: none;
  touch-action: manipulation;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.sidebar-web-link:hover,
.signin-web-link:hover {
  border-color: var(--edge-strong);
  background: var(--well-hover);
  color: var(--ink);
}
.signin-web-link {
  margin-inline-start: auto;
  min-height: 30px;
  padding: 0 10px;
  font-family: var(--font-mono);
}
.sidebar-health {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-xs);
  color: var(--muted);
}
.health-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent);
}
.health-dot[data-online="false"],
.health-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}
.health-dot.is-warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent);
}
.health-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.sidebar-footer button { margin-inline-start: auto; border-color: var(--border); color: var(--ink); }

/* Frosted Glass Operations Topbar (56px height · 36px baseline controls) */
.workspace-header {
  position: sticky;
  z-index: var(--z-sticky);
  top: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}
.workspace-header, .sign-in-header {
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}
.sign-in-header { grid-column: 2; grid-row: 1; }
.sign-in-header .brand, .sign-in-header:not([hidden]) + .workspace {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.sign-in-header .brand { min-height: 56px; gap: 10px; font-size: var(--text-base); font-weight: 680; }
.sign-in-header:not([hidden]) + .workspace { padding-top: clamp(32px, 6vw, 64px); }

.workspace-bar, .workspace {
  width: 100%;
  max-width: var(--workspace-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.workspace-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--bar-height);
}
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.breadcrumb-root, .breadcrumb-divider { color: var(--muted); font-size: var(--text-sm); }
#current-view { font-size: var(--text-sm); font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.header-live-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  content: '';
}
.header-live-pill[data-online="false"]::before { background: var(--danger); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.switcher-trigger {
  min-width: clamp(210px, 24vw, 300px);
  justify-content: start;
  min-height: 40px;
  padding-inline: 12px;
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--well);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.switcher-trigger:hover { border-color: var(--edge-strong); color: var(--ink); background: var(--well-hover); }
.switcher-trigger kbd {
  margin-inline-start: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface-solid);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.header-refresh-btn, .header-theme-btn {
  border: 1px solid var(--border);
  width: 40px;
  min-height: 40px;
  background: var(--surface);
}
.header-refresh-btn:hover, .header-theme-btn:hover { background: var(--well-hover); border-color: var(--edge-strong); }
.header-quick-issue { min-height: 40px; padding: 0 16px; font-size: var(--text-sm); }
.header-theme-btn .icon-moon { display: none; }
:root[data-resolved-theme="light"] .header-theme-btn .icon-sun,
:root[data-theme="light"] .header-theme-btn .icon-sun { display: none; }
:root[data-resolved-theme="light"] .header-theme-btn .icon-moon,
:root[data-theme="light"] .header-theme-btn .icon-moon { display: block; }
.mobile-brand, .switcher-mobile-label, .switcher-menu-icon { display: none; }

/* Workspace & Page Toolbars (8pt Grid) */
.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding-block: var(--space-5) var(--space-8);
}
.workspace :is(button, input, select, textarea, h1) { scroll-margin-top: calc(var(--bar-height) + 16px); }

.ops-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-sm);
}
.ops-toolbar-lead { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.ops-toolbar-copy { min-width: 0; }
.ops-toolbar-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  max-width: 68ch;
}
.ops-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* 40x40 Brand Emblem (preserves #hero-art safely for admin-motion.js) */
.hero-art-emblem {
  position: relative;
  z-index: 1;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--well);
  box-shadow: inset 0 1px 0 var(--surface-shine);
  overflow: hidden;
  pointer-events: none;
}
.hero-art-emblem img,
.hero-art-emblem canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.view-heading, .roster-heading, .release-summary, .dialog-heading, .release-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}
.view-heading { margin-bottom: var(--space-4); flex-wrap: wrap; }
.view-heading p, .release-form > p, .release-form-head p { margin-top: 4px; color: var(--muted); font-size: var(--text-sm); }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-sm);
}

/* Subtle Hover Elevation (no distracting cyan/violet spotlight borders) */
.ag-tilt {
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms var(--ease-out), background-color 150ms ease;
}
.ag-tilt:hover {
  border-color: var(--edge-strong) !important;
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-md) !important;
}
.ag-tilt::after { display: none; content: none; }

/* Overview Command Center: 8 Balanced Studio KPI Cards (8pt Grid) */
.ov-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}
.ov-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 92px;
  padding: var(--space-4) 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-sm);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
.ov-kpi-card:hover {
  border-color: var(--edge-strong);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-md);
}
.ov-kpi-card dt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 580;
  line-height: 1.35;
}
.ov-kpi-card[data-status-dot] dt::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  content: '';
}
.ov-kpi-card[data-status-dot="good"] dt::before { background: var(--good); }
.ov-kpi-card[data-status-dot="warn"] dt::before { background: var(--warn); }
.ov-kpi-card[data-status-dot="danger"] dt::before { background: var(--danger); }
.ov-kpi-card dd {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: var(--space-4);
  align-items: start;
}
.ops-col { display: grid; gap: var(--space-4); min-width: 0; }
.ops-panel { padding: var(--space-5) var(--space-6); min-width: 0; }
.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.ops-panel-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.ops-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

/* Tier Breakdown, Interactive SVG Charts & System Health Panels */
.ops-tier-breakdown { display: grid; gap: var(--space-3); font-variant-numeric: tabular-nums; position: relative; }
.ops-tier-row,
.tier-bar-row { display: grid; gap: 6px; }
.ops-tier-head,
.tier-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.ops-tier-head strong, .tier-bar-head strong { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 620; color: var(--ink); }
.ops-tier-head span, .tier-bar-head span { font-size: var(--text-sm); color: var(--muted); }
.ops-tier-track,
.tier-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--well);
  overflow: hidden;
}
.ops-tier-fill,
.tier-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
  transition: width 240ms var(--ease-out);
}
/* Tier Breakdown Colors — Canonical 3 Plan Tiers (Basic Sapphire · Pro Amethyst · Ultra Platinum Ice · Admin Emerald) */
.ops-tier-fill.tier-basic, .ops-tier-fill.is-basic, .tier-bar-fill.is-basic {
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 55%, #60a5fa 100%);
}
.ops-tier-fill.tier-pro, .ops-tier-fill.is-pro, .tier-bar-fill.is-pro {
  background: linear-gradient(90deg, rgb(109, 40, 217) 0%, rgb(139, 92, 246) 55%, rgb(168, 85, 247) 100%);
}
.ops-tier-fill.tier-ultra, .ops-tier-fill.is-ultra, .tier-bar-fill.is-ultra {
  background: linear-gradient(90deg, var(--qt-tier-ultra-from) 0%, var(--qt-tier-ultra-mid) 38%, var(--qt-tier-ultra-indigo) 72%, var(--qt-tier-ultra-to) 100%);
}
.ops-tier-fill.tier-admin, .ops-tier-fill.is-admin, .tier-bar-fill.is-admin {
  background: linear-gradient(90deg, #059669 0%, #10b981 55%, #34d399 100%);
}

/* Harmonized SVG Donut / Stacked Bar Chart & Interactive Tooltip Hooks */
.ops-viz-grid,
.ops-chart-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-5);
}
.ops-donut-wrap,
.ops-chart-svg-wrap {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}
.ops-chart-tooltip {
  position: static;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: 1.45;
  white-space: normal;
}
.ops-stacked-bar {
  display: flex;
  width: 100%;
  height: 10px;
  gap: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--well);
}

.ops-system-health { display: grid; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.ops-system-health dl,
.ops-health-grid { display: grid; gap: var(--space-2); }
.ops-system-health dl > div,
.ops-system-health .ops-health-item,
.ops-health-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  font-size: var(--text-sm);
}
.ops-system-health dt,
.ops-system-health .ops-health-item > span,
.ops-health-row span { color: var(--muted); }
.ops-system-health dd,
.ops-system-health .ops-health-item > strong,
.ops-health-row strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 620;
  text-align: end;
}

/* Actionable Ops Alerts List */
.ops-alerts-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.ops-alerts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--well);
  font-size: var(--text-sm);
}
.ops-alerts-list li.is-danger,
.ops-alerts-list li.severity-high,
.ops-alerts-list li.severity-critical,
.ops-alerts-list li[data-severity="danger"],
.ops-alerts-list li[data-severity="high"] {
  border-inline-start-color: var(--danger);
}
.ops-alerts-list li.is-info,
.ops-alerts-list li.severity-low,
.ops-alerts-list li[data-severity="info"] {
  border-inline-start-color: var(--accent);
}
.ops-alerts-list li.is-empty,
.ops-alerts-list li.ops-alert-empty {
  border-inline-start-color: var(--good);
  color: var(--muted);
}
.ops-alert-msg { min-width: 0; line-height: 1.45; color: var(--ink); }
.ops-alert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: none;
}

/* Guarded 2-Column Operations Forms & Lock Notices */
.ops-form-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.35fr);
  gap: var(--space-4);
  align-items: start;
}
.ops-guard-note {
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
}
.ops-guard-note h2 { margin-bottom: var(--space-2); }
.ops-guard-note > p { margin-bottom: var(--space-3); font-size: var(--text-sm); line-height: 1.5; }
.ops-guard-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.ops-guard-list code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--well);
  color: var(--ink);
  font-size: var(--text-xs);
}

.form-lock-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--danger-edge);
  border-inline-start: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: 560;
  line-height: 1.45;
}
.form-lock-notice.is-warn,
.form-lock-notice[data-tone="warn"] {
  border-color: var(--warn-edge);
  border-inline-start-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}
.form-lock-notice.is-info,
.form-lock-notice[data-tone="info"] {
  border-color: var(--border);
  border-inline-start-color: var(--accent);
  background: var(--well);
  color: var(--ink);
}
.form-lock-notice:empty { display: none; }

/* 4 Balanced KPI Cards inside License View (Neutral Surface · Aligned Rhythm) */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}
.metric-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 92px;
  padding: var(--space-4) 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.metric-item:hover {
  border-color: var(--edge-strong);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-md);
}
.metric-item[data-active="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 52%, var(--surface));
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.metric-item dt { color: var(--muted); font-size: var(--text-xs); font-weight: 580; line-height: 1.35; }
.metric-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--muted);
}
.metric-icon svg { width: 15px; height: 15px; }
.metric-icon-aqua { color: var(--good); }
.metric-icon-amber { color: var(--warn); }
.metric-item dd { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.metric-value {
  display: block;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: 1.1;
  font-weight: 680;
  letter-spacing: -.03em;
}
#expiring-count[data-attention="true"] { color: var(--warn); }
.metric-quick-btn {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 540;
}
.metric-quick-btn:hover,
.metric-quick-btn[aria-pressed="true"] {
  border-color: var(--edge-strong);
  background: var(--well-hover);
  color: var(--ink);
}

.muted { color: var(--muted); font-size: var(--text-sm); }

/* Precision Buttons — Harmonized 40px / 36px Comfort Heights · 2% Violet ONLY on .primary */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--well);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 120ms var(--ease-out);
}
button:disabled { opacity: .55; cursor: not-allowed; }
.primary {
  min-height: 42px;
  padding-inline: 18px;
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--shadow-sm);
}
.primary:not(:disabled):hover { background: var(--primary-hover); }
.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.secondary:not(:disabled):hover { background: var(--well-hover); border-color: var(--edge-strong); }
.danger { border-color: var(--danger-edge); background: var(--danger-bg); color: var(--danger); }
.danger:not(:disabled):hover { filter: brightness(0.95); }
.compact { min-height: 36px; padding: 0 12px; font-size: 13px; gap: 6px; }
.icon-button { width: 38px; min-height: 38px; padding: 0; border-radius: var(--radius-sm); background: var(--well); }
.icon-button:hover { background: var(--well-hover); }

/* Data Roster Table & Smart Search Panel (8pt Grid Alignment) */
.roster-heading, .filters, .tier-filters, .active-filters { padding-inline: var(--space-6); }
.roster-heading { padding-top: var(--space-5); padding-bottom: var(--space-3); flex-wrap: wrap; }
.roster-title-cluster { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.roster-title-cluster p { font-size: var(--text-xs); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sort-control { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.sort-label { white-space: nowrap; font-weight: 560; }
.sort-control select { min-height: 32px; width: auto; padding: 0 10px; font-size: 12.5px; background: var(--surface-solid); }

.tier-filters {
  display: flex;
  gap: var(--space-5);
  margin: 0 var(--space-6) var(--space-4);
  padding-inline: 0;
  border-bottom: 1px solid var(--border);
}
.tier-filters button {
  position: relative;
  min-height: 36px;
  padding-inline: 2px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}
.tier-filters button:hover, .tier-filters button[aria-pressed="true"] { color: var(--ink); }
.tier-filters button::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 99px;
  background: var(--primary);
  content: '';
  scale: 0 1;
  transition: scale 160ms var(--ease-out);
}
.tier-filters button[data-tier="basic"]::after { background: var(--qt-tier-basic-dot); }
.tier-filters button[data-tier="pro"]::after { background: var(--qt-tier-pro-dot); }
.tier-filters button[data-tier="ultra"]::after {
  background: linear-gradient(90deg, var(--qt-tier-ultra-from) 0%, var(--qt-tier-ultra-mid) 45%, var(--qt-tier-ultra-indigo) 100%);
}
.tier-filters button[aria-pressed="true"]::after { scale: 1 1; }
.filter-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tier-filters button[aria-pressed="true"] .filter-count { background: var(--well-hover); color: var(--ink); }

.filters { display: flex; gap: var(--space-2); align-items: stretch; padding-bottom: var(--space-4); }
.roster-search { position: relative; flex: 1 1 340px; min-width: 0; }
.search-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-height: 40px;
  padding-inline: 12px 8px;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.search-field-elevated { background: var(--well); }
.search-lead-icon { color: var(--muted); transition: color 150ms ease; }
.search-field:focus-within {
  border-color: var(--ring);
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 16%, transparent);
}
.search-field:focus-within .search-lead-icon { color: var(--ink); }

input, textarea, select {
  display: block;
  min-height: 40px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--control);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  background: var(--well);
  font-size: var(--text-sm);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.search-field input { min-height: 38px; padding: 0; border: 0; background: none; color: var(--ink); font-size: var(--text-sm); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-field input:focus-visible { outline: 0; box-shadow: none; }

.search-clear-btn { width: 26px; min-height: 26px; padding: 0; border-radius: 6px; background: var(--surface-solid); border: 1px solid var(--border); color: var(--muted); }
.search-clear-btn:hover { color: var(--ink); border-color: var(--edge-strong); }
.search-clear-btn svg { width: 12px; height: 12px; }

.search-slash-kbd, .search-popup-foot kbd, .palette-hints kbd, .shortcut-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-solid);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
}
mark.search-hit {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 660;
}

.status-filter { position: relative; }
.status-filter summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 580;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.status-filter summary::-webkit-details-marker { display: none; }
.status-filter summary:hover, .status-filter[open] summary { background: var(--well-hover); border-color: var(--edge-strong); }
.filter-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 150ms ease; }
.status-filter[open] .filter-chevron { transform: rotate(180deg); }

.filter-popup {
  position: absolute;
  z-index: var(--z-dropdown);
  inset: calc(100% + 6px) auto auto 0;
  display: grid;
  gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-md);
  background: var(--raised);
  box-shadow: var(--shadow-lg);
}
.opens-up > .filter-popup { inset-block: auto calc(100% + 6px); }
.status-options { min-width: 248px; right: 0; left: auto; }
.opens-left > .filter-popup,
.status-options.align-start { left: 0; right: auto; }
.search-suggestions-shell { inset-inline: 0; padding: 0; overflow: hidden; }
.search-suggestions { margin: 0; padding: 6px; max-height: min(300px, 44vh); overflow: auto; list-style: none; display: grid; gap: 2px; }
.search-option {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  min-height: 44px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
}
.search-option:hover, .search-option[aria-selected="true"] { background: var(--well); }
.search-option[aria-selected="true"] { border-color: var(--edge-strong); }
.suggestion-name { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.suggestion-name code { font-size: 13px; font-weight: 650; }
.suggestion-name small { color: var(--muted); font-size: var(--text-xs); }
.suggestion-meta { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.suggestion-state { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.suggestion-state.activated { color: var(--good); }
.search-popup-foot {
  display: flex; align-items: center; gap: var(--space-4); padding: 8px 12px;
  border-top: 1px solid var(--border); background: var(--well-solid); color: var(--muted); font-size: var(--text-xs);
}
.search-popup-foot span { display: inline-flex; align-items: center; gap: 4px; }

.status-options button { justify-content: start; min-height: 36px; border-radius: var(--radius-sm); background: transparent; white-space: nowrap; }
.status-options button:hover, .status-options button[aria-pressed="true"] { background: var(--well); }
.status-options button[aria-pressed="true"] { color: var(--ink); font-weight: 640; }
.status-options button::before { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); content: ''; }
.status-options button[data-status="activated"]::before { background: var(--good); }
.status-options button[data-status="expiring"]::before { background: var(--warn); }
.status-options button[data-status="web"]::before { background: var(--accent); }
.status-options button[data-status="revoked"]::before { background: var(--danger); }
.status-options .filter-count { margin-inline-start: auto; }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-bottom: var(--space-3); }
.filter-chip {
  min-height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--well); color: var(--ink); font-size: var(--text-xs); font-weight: 560; gap: 6px;
}
.filter-chip:hover { border-color: var(--edge-strong); background: var(--well-hover); }
.filter-chip-x { color: var(--muted); font-weight: 700; }
.filter-chip-reset { border-color: var(--border); background: var(--surface); color: var(--muted); }

/* High-Density Roster Table (8pt Vertical Rhythm & Sortable Header Support) */
.table-scroll { width: 100%; overflow-x: auto; max-height: min(68vh, 720px); overflow-y: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
td, th { padding: var(--space-3) 12px; border-top: 1px solid var(--border); text-align: start; }
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--well-solid);
  border-bottom: 1px solid var(--border);
}
thead th button.table-sort-btn,
thead th .sort-header-btn {
  min-height: 28px;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  gap: 5px;
}
thead th button.table-sort-btn:hover,
thead th .sort-header-btn:hover { background: var(--well-hover); color: var(--ink); }
thead th[aria-sort="ascending"],
thead th[aria-sort="descending"] { color: var(--ink); }
td:first-child, th:first-child { padding-inline-start: var(--space-6); }
td:last-child, th:last-child { padding-inline-end: var(--space-6); }
tbody:last-child tr:last-child td:first-child { border-end-start-radius: var(--radius-md); }
tbody:last-child tr:last-child td:last-child { border-end-end-radius: var(--radius-md); }
.tier-heading th {
  background: var(--surface-solid);
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
  padding-block: 10px 6px;
}
.tier-heading-content, .plan-tag { display: inline-flex; align-items: center; gap: var(--space-2); }
.tier-heading-label { color: var(--ink); font-size: 13px; font-weight: 650; }
.tier-heading-count { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tier-heading-content::before, .plan-tag::before {
  width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--tier-color, #38bdf8); content: '';
}
.tier-heading .basic, .plan-tag.basic { --tier-color: var(--qt-tier-basic-dot); }
.tier-heading .pro, .plan-tag.pro { --tier-color: var(--qt-tier-pro-dot); }
.tier-heading .ultra, .plan-tag.ultra { --tier-color: var(--qt-tier-ultra-mid); }
.tier-heading .ultra .tier-heading-content::before,
.plan-tag.ultra::before {
  background: linear-gradient(135deg, var(--qt-tier-ultra-from) 0%, var(--qt-tier-ultra-mid) 40%, var(--qt-tier-ultra-indigo) 74%, var(--qt-tier-ultra-to) 100%);
}
.plan-tag { font-size: 13px; font-weight: 600; white-space: nowrap; }
.plan-tag.basic { color: var(--qt-tier-basic-ink); }
.plan-tag.pro { color: var(--qt-tier-pro-ink); }
.plan-tag.ultra { color: var(--qt-tier-ultra-ink); }

/* Canonical 3 Plan Tier Badges (Basic Sapphire Blue · Pro Amethyst Purple · Ultra Platinum Diamond Ice) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 640;
  white-space: nowrap;
}
.badge.basic {
  border-color: var(--qt-tier-basic-border);
  background: var(--qt-tier-basic-bg);
  color: var(--qt-tier-basic-ink);
}
.badge.pro {
  border-color: var(--qt-tier-pro-border);
  background: var(--qt-tier-pro-bg);
  color: var(--qt-tier-pro-ink);
}
.badge.ultra {
  border-color: var(--qt-tier-ultra-border);
  background: var(--qt-tier-ultra-bg);
  color: var(--qt-tier-ultra-ink);
}
.record-trial-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.record { cursor: pointer; }
.record td { transition: background-color var(--t-fast) ease; }
.tier-heading + .record td { border-top-color: transparent; }
.record:hover td, .record:focus-within td, .record-open td { background: var(--well); }
.record-toggle {
  justify-content: start; min-height: 32px; max-width: 100%; padding: 0;
  border: 0; border-radius: 4px; background: transparent; text-align: start;
}
.record-identity { display: grid; min-width: 0; gap: 2px; }
.record-identity code { font-size: var(--text-sm); font-weight: 640; font-variant-numeric: tabular-nums; }
.record-identity .code-unactivated { color: var(--danger); }
.record-customer { color: var(--muted); font-size: var(--text-xs); font-weight: 500; overflow-wrap: anywhere; }
.record-chevron {
  width: 6px; height: 6px; flex: none; margin-inline: 1px 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  rotate: -45deg; transition: rotate 150ms var(--ease-out);
}
.record-open .record-chevron { rotate: 45deg; }
.record .expiry, .record .seats, .row-action { white-space: nowrap; }
.record .expiry, .record .seats { font-family: var(--font-mono); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.record .seats, .row-action { text-align: end; }
th.seats { text-align: end; white-space: nowrap; }
.row-action-group,
.row-action > div {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
.row-action button + button { margin-inline-start: var(--space-2); }
.seat-web-tag {
  display: inline-block; margin-inline-end: 6px; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--well); color: var(--accent); font-size: 11px; font-weight: 620;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ''; }
.pill.activated { background: var(--good-bg); color: var(--good); border: 1px solid var(--good-edge); }
.pill.unactivated { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-edge); }
.record-status { display: grid; justify-items: start; gap: 3px; }
.code-restriction { color: var(--danger); font-size: var(--text-xs); }
.code-expiring-soon { color: var(--warn); font-size: 11.5px; font-weight: 600; }

/* Expanded License Detail Drawer */
.detail-row td { padding: 0; background: var(--ground); }
.detail-motion { display: grid; grid-template-rows: 1fr; }
.detail-inner { min-height: 0; overflow: hidden; }
.license-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 24px);
  padding: var(--space-5) var(--space-6);
}
.detail-devices, .detail-management { min-width: 0; }
.detail-management { border-inline-start: 1px solid var(--border); padding-inline-start: clamp(16px, 2vw, 24px); }
.detail-management h3, .detail-devices h3 { margin-bottom: var(--space-3); }
.devices { display: grid; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.device-card, .device-empty { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.device-heading, .machine-id, .device-title-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.device-heading { justify-content: space-between; margin-bottom: var(--space-2); }
.device-heading strong, .machine-id code { overflow-wrap: anywhere; }
.device-channel-pill {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--well);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 620;
}
.device-channel-pill.is-web { color: var(--accent); }
.device-channel-pill.is-desktop { color: var(--muted); }
.machine-id code { min-width: 0; font-size: var(--text-xs); }
.device-fields, .license-fields { display: grid; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.device-fields > div, .license-fields > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--space-2); }
.device-fields dt, .license-fields dt { color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.original-code { margin-top: var(--space-2); font-size: var(--text-xs); }

.empty {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--space-3) var(--space-4); padding: var(--space-5) var(--space-6); border-top: 1px solid var(--border);
}
.empty-copy { display: grid; gap: 4px; }
.empty-copy strong { font-size: var(--text-base); }

/* Sign-In Panel */
.sign-in {
  position: relative; overflow: hidden; max-width: 440px;
  padding: clamp(24px, 4vw, var(--space-8)); margin: var(--space-4) auto 0; box-shadow: var(--shadow-lg);
}
.sign-in::before {
  position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); content: '';
}
.sign-in-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--space-3);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--well); color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
}
.sign-in-badge svg { width: 14px; height: 14px; color: var(--primary); }
.sign-in h1 { font-size: var(--text-xl); }
.sign-in-subtitle { margin-top: 6px; font-size: 14.5px; line-height: 1.5; }
.sign-in-submit { width: 100%; min-height: 44px; justify-self: stretch; font-size: 15px; }

.release-summary, .release-form { padding: var(--space-5) var(--space-6); margin-bottom: var(--space-4); }
.release-summary p { margin-top: 4px; font-family: var(--font-mono); font-size: 13.5px; }
.release-form-head { flex-wrap: wrap; align-items: flex-start; }
.stack { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.stack label { display: grid; gap: 6px; font-size: var(--text-sm); font-weight: 600; }
.stack button:not(.sign-in-submit) { justify-self: start; }
textarea { resize: vertical; max-width: 100%; font: 13px/1.55 var(--font-mono); }

.plan-status-card {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--well); font-variant-numeric: tabular-nums;
}
.plan-current-line { font-size: var(--text-sm); font-weight: 620; color: var(--ink); }
.manifest-check:empty { display: none; }
.manifest-check.is-ok { color: var(--good); font-weight: 580; }
.manifest-check.is-err { color: var(--danger); font-weight: 580; }

/* Modals, Command Palette & License Inspector Dialog (100% Dead-Center Solid Surface Z4) */
dialog {
  z-index: var(--z-modal);
  margin: auto;
  width: min(512px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overscroll-behavior: contain;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--surface-shine), var(--shadow-lg);
}
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(6px); }

.inspector-modal {
  width: min(780px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
}
.inspector-modal[open] { display: flex; flex-direction: column; }
.inspector-heading {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--well-solid);
}
.inspector-title-wrap { min-width: 0; display: grid; gap: 2px; }
.inspector-title-wrap h2 { font-size: var(--text-lg); }
.inspector-subtitle { font-family: var(--font-mono); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.inspector-modal > .form-lock-notice { margin: var(--space-3) var(--space-6) 0; }
.inspector-body {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6) var(--space-6);
  overflow-y: auto;
  min-height: 0;
}
.inspector-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  font-variant-numeric: tabular-nums;
}
.inspector-summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}
.inspector-summary-grid dt,
.inspector-stat-card > span { font-size: var(--text-xs); color: var(--muted); }
.inspector-summary-grid dd,
.inspector-stat-card > strong { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 640; color: var(--ink); overflow-wrap: anywhere; }

.inspector-section { display: grid; gap: var(--space-3); }
.inspector-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.inspector-trial-box {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--well);
}
.inspector-trial-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr) auto;
  gap: var(--space-3);
  align-items: end;
}
.inspector-trial-form label { display: grid; gap: 6px; font-size: var(--text-xs); font-weight: 580; color: var(--muted); }
.inspector-trial-form input, .inspector-trial-form select { min-height: 36px; font-size: var(--text-sm); background: var(--surface-solid); }
.inspector-trial-form button { min-height: 36px; }

.inspector-devices-list { display: grid; gap: var(--space-2); }
.inspector-devices-list ul { display: grid; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.inspector-device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}
.inspector-device-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  flex: 1 1 220px;
}
.inspector-device-info strong {
  font-size: var(--text-sm);
  font-weight: 640;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.inspector-device-info small {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.inspector-leases-list { display: grid; gap: var(--space-2); overflow-x: auto; font-variant-numeric: tabular-nums; }
.inspector-leases-list table { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: 13px; }
.inspector-leases-list th, .inspector-leases-list td { padding: 8px 12px; }
.inspector-leases-list td:first-child, .inspector-leases-list th:first-child { padding-inline-start: 12px; }
.inspector-leases-list td:last-child, .inspector-leases-list th:last-child { padding-inline-end: 12px; }
.inspector-leases-list ul { display: grid; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.inspector-leases-list li,
.inspector-lease-row,
.inspector-lease-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  font-size: 13px;
}
.inspector-lease-main,
.inspector-lease-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.inspector-lease-meta { align-items: flex-end; text-align: end; }
.inspector-lease-main code { font-size: 13px; font-weight: 640; color: var(--ink); }
.inspector-lease-main small,
.inspector-lease-meta small { font-family: var(--font-mono); font-size: var(--text-xs); }

.switcher-dialog { width: min(576px, calc(100% - 24px)); padding: var(--space-4) var(--space-5); }
.switcher-dialog .search-field { margin-block: var(--space-3); }
.palette-body { display: grid; gap: var(--space-3); max-height: min(420px, 56dvh); overflow-y: auto; padding-inline-end: 2px; }
.palette-section { display: grid; gap: 4px; }
.palette-heading { padding-inline: 8px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 620; letter-spacing: 0.05em; text-transform: uppercase; }
.palette-list, .switcher-links { display: grid; gap: 2px; }
.palette-item {
  width: 100%; justify-content: space-between; min-height: 36px; padding: 6px 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--ink);
  text-align: start; font-size: var(--text-sm); font-weight: 520;
}
.switcher-links .palette-item { justify-content: start; }
.palette-item:hover, .palette-item.is-active { background: var(--well); border-color: var(--border); }
.palette-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-badge { padding: 2px 7px; border-radius: 5px; background: var(--surface-solid); border: 1px solid var(--border); color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.palette-license-main { display: grid; gap: 2px; min-width: 0; }
.palette-license-code { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.palette-license-sub { color: var(--muted); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-license-meta { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.palette-meta-note { color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.switcher-empty { padding: var(--space-4) var(--space-2); text-align: center; }
.palette-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.palette-hints { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--muted); font-size: var(--text-xs); }
.palette-hints span { display: inline-flex; align-items: center; gap: 4px; }

.reissue-option { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.reissue-option button { margin-top: var(--space-3); }
.issue-actions { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); }
.issue-actions .primary { flex: 1; }
.created p { font-size: var(--text-sm); color: var(--muted); }
output {
  display: block; border: 1px solid var(--edge-strong); border-radius: var(--radius-sm); padding: 10px 12px;
  overflow-wrap: anywhere; user-select: all; background: var(--well); color: var(--ink); font: 14px/1.5 var(--font-mono); font-variant-numeric: tabular-nums;
}
.notice:empty { margin: 0; padding: 0; }
.notice:not(:empty) {
  margin-bottom: var(--space-3); padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--well); color: var(--ink); font-size: var(--text-sm);
}
.sign-in .notice:not(:empty), dialog .notice:not(:empty) { margin: var(--space-3) 0 0; }
.notice.error:not(:empty) { border-color: var(--danger-edge); background: var(--danger-bg); color: var(--danger); }

/* Store, Plans & Settings Grids */
.management-grid, .catalog-grid { display: grid; gap: var(--space-4); }
.management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.store-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.store-search-field { min-width: 224px; min-height: 36px; }
.store-search-field input { min-height: 34px; }
.store-tier-pills { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--well); }
.store-tier-pills button { min-height: 28px; background: transparent; color: var(--muted); border-radius: 6px; }
.store-tier-pills button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.store-tier-pills button[data-store-tier="pro"][aria-pressed="true"] { border-color: var(--qt-tier-pro-border); color: var(--qt-tier-pro-ink); }
.store-tier-pills button[data-store-tier="ultra"][aria-pressed="true"] { border-color: var(--qt-tier-ultra-border); color: var(--qt-tier-ultra-ink); }
.store-empty { grid-column: 1 / -1; padding: var(--space-5); }

.catalog-card { padding: var(--space-5) var(--space-6); display: grid; align-content: start; gap: var(--space-2); }
.catalog-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.catalog-type {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--well); color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.commerce-definitions, .shortcut-list { display: grid; gap: var(--space-3); margin-top: var(--space-3); font-variant-numeric: tabular-nums; }
.commerce-definitions dt { font-size: var(--text-sm); font-weight: 620; }
.commerce-definitions dd, .shortcut-list dd { color: var(--muted); font-size: 13px; line-height: 1.48; }
.shortcut-list > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding-bottom: var(--space-2); border-bottom: 1px solid var(--border);
}
.shortcut-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.shortcut-list dt { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.shortcut-list dd { text-align: end; }
.plan-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }

.theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.theme-option {
  display: flex; flex-direction: column; align-items: start; justify-content: start; gap: var(--space-2);
  padding: var(--space-4); border: 1px solid var(--border); border-radius: 10px; background: var(--well); color: var(--ink); text-align: start;
}
.theme-option:hover { border-color: var(--edge-strong); background: var(--well-hover); }
.theme-option[aria-checked="true"] { border-color: var(--primary); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.theme-option-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--surface-solid); border: 1px solid var(--border); color: var(--muted); }
.theme-option[aria-checked="true"] .theme-option-icon { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.theme-option > div strong { display: block; font-size: var(--text-sm); font-weight: 620; }
.theme-option > div span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 450; line-height: 1.4; }

/* Responsive Breakpoints (0 horizontal overflow at 375px, 768px, 1024px, 1440px) */
@media (max-width: 1120px) {
  .ov-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-grid, .ops-form-layout { grid-template-columns: minmax(0, 1fr); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1051px) {
  #license-table .plan-column { width: 17%; }
  #license-table .expiry-column { width: 13%; }
  #license-table th.seats { width: 12%; }
  #license-table .row-action { width: 236px; }
}
@media (max-width: 860px) {
  .app-shell { --bar-height: 52px; }
  .sidebar, .breadcrumb-root, .breadcrumb-divider, .switcher-desktop-label, .switcher-trigger kbd, .switcher-search-icon, .header-live-pill { display: none; }
  .mobile-brand, .switcher-mobile-label, .switcher-menu-icon { display: block; }
  .switcher-trigger { min-width: 0; }
}
@media (max-width: 720px) {
  .management-grid, .catalog-grid, .theme-choices, .ops-viz-grid, .ops-chart-layout { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspector-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspector-trial-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .app-shell { --gutter: 16px; }
  .workspace { padding-top: var(--space-4); }
  .ops-page-toolbar, .ops-panel, .ops-guard-note, .release-summary, .release-form { padding: var(--space-4); }
  .roster-heading, .filters, .active-filters { padding-inline: var(--space-4); }
  .tier-filters { margin-inline: var(--space-4); }
  .hero-art-emblem { display: none; }
  .header-quick-issue span { display: none; }
  .filters { flex-wrap: wrap; }
  .roster-search { flex-basis: 100%; }
  .status-options { left: 0; right: auto; }
  .search-popup-foot, .palette-hints, .search-slash-kbd { display: none; }
  .search-field input, input, select { font-size: 16px; }
  .plan-fields { grid-template-columns: minmax(0, 1fr); }
  .table-scroll { max-height: none; overflow-y: visible; }
  #license-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #license-table, #license-table tbody, .tier-heading, .tier-heading th, .detail-row, .detail-row td { display: block; }
  .record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
  }
  .record td { border: 0; padding: 0; }
  .record:hover, .record:focus-within { background: var(--well); }
  .record .record-plan { grid-column: 1; grid-row: 2; }
  .record .seats, .record .expiry { grid-row: 3; font-size: var(--text-xs); }
  .record .expiry { grid-column: 1; white-space: normal; }
  .record .seats { grid-column: 2; }
  .record .seats::before, .record .expiry::before { content: attr(data-label) " · "; color: var(--muted); }
  .record .row-action { grid-column: 1 / -1; grid-row: 4; text-align: start; display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: 4px; }
  .record .row-action button + button { margin-inline-start: 0; }
  .record .row-action:empty { display: none; }
  .record td:nth-child(2) { justify-self: end; }
  .record-status { justify-items: end; text-align: end; }
  .record .row-action .compact { min-height: 36px; }
  .license-detail { grid-template-columns: minmax(0, 1fr); padding: var(--space-4); }
  .detail-management { border-inline-start: 0; border-top: 1px solid var(--border); padding: var(--space-3) 0 0; }
}
@media (max-width: 440px) {
  .ov-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .inspector-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .tier-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .tier-filters button { flex-direction: column; gap: 2px; padding: 6px 4px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto !important; }
  .skip-link, button, .sidebar-web-link, .signin-web-link, .tier-filters button::after, .record td, .record-chevron, .metric-item, .ov-kpi-card, .catalog-card, .ag-tilt, .ops-tier-fill, .filter-chevron {
    transition: none !important;
  }
  button:active:not(:disabled) { transform: none !important; }
  .ag-orb, .qt-intro-hud, .qt-intro-fill, .filter-popup, .detail-opening, .metrics .metric-item, .roster, .sign-in, #dashboard > section, dialog { animation: none !important; }
  .ag-field, .qt-intro { display: none !important; }
  .qt-inspect-toast { transition: none !important; transform: none !important; }
}

/* DevTools / Inspect (F12) Protection Toast & Shield (100% Centered · Zero TranslateX Drift) */
.qt-inspect-toast {
  position: fixed;
  inset-inline: 0;
  bottom: 20px;
  z-index: 9999;
  width: fit-content;
  margin-inline: auto;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--edge-strong);
  background: var(--surface-solid);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.qt-inspect-toast[data-visible="true"] { opacity: 1; transform: translateY(0); }
.qt-devtools-lock {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(16, 18, 21, 0.94);
  backdrop-filter: blur(14px);
}
[data-theme="light"] .qt-devtools-lock { background: rgba(242, 246, 247, 0.95); }
.qt-devtools-lock-card {
  width: min(440px, 100%);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: var(--space-3);
}
.qt-devtools-lock-badge {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 640;
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--border);
}
.qt-devtools-lock-card h2 { margin: 0; font-size: var(--text-lg); line-height: 1.3; }
.qt-devtools-lock-card p { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
