@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;
}

:root {
  font: 14.5px/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;
}

*, *::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;
}
/* Sleek Visible Studio Scrollbars (Page, Sidebar, Popups, Modals) */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 36%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 72%, var(--muted));
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Multi-Stage 3D Quantum Crystal Intro Overlay */
.qt-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 65% 58% at 50% 45%, rgba(17, 24, 39, 0.92) 0%, rgba(6, 8, 15, 0.985) 72%, #05070c 100%);
  backdrop-filter: blur(18px);
  color: #f8fafc;
  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: 8px;
  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: 7px;
  padding: 4px 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.18);
}
.qt-intro-title {
  display: block;
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #f8fafc;
  text-shadow: 0 8px 28px rgba(139, 92, 246, 0.45);
}
.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, #8b5cf6 0%, #38bdf8 55%, #22d3ee 100%);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.85);
  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); }
}

/* Antigravity Zero-Gravity Field & Floating Aurora Nebula Orbs */
.ag-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ag-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ag-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.34;
  will-change: transform;
}
:root[data-theme="light"] .ag-orb {
  opacity: 0.2;
}
:root[data-modal-open="true"] .ag-orb {
  animation-play-state: paused !important;
}
.ag-orb-1 {
  width: 46vw;
  height: 46vw;
  max-width: 580px;
  max-height: 580px;
  top: -14%;
  right: -8%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.58) 0%, rgba(34, 211, 238, 0) 70%);
  animation: ag-float-1 19s ease-in-out infinite;
}
.ag-orb-2 {
  width: 50vw;
  height: 50vw;
  max-width: 640px;
  max-height: 640px;
  bottom: -18%;
  left: -10%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.56) 0%, rgba(139, 92, 246, 0) 70%);
  animation: ag-float-2 23s ease-in-out infinite;
}
.ag-orb-3 {
  width: 34vw;
  height: 34vw;
  max-width: 420px;
  max-height: 420px;
  top: 42%;
  left: 38%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.36) 0%, rgba(99, 102, 241, 0) 70%);
  animation: ag-float-3 27s ease-in-out infinite;
}
@keyframes ag-float-1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-44px, 34px, 0) scale(1.09); }
}
@keyframes ag-float-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(48px, -40px, 0) scale(1.07); }
}
@keyframes ag-float-3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(32px, -28px, 0) scale(1.1); }
  66% { transform: translate3d(-26px, 24px, 0) scale(0.95); }
}

.ambient-light, .brand-intro { display: none; pointer-events: none; }
.app-shell { isolation: isolate; position: relative; }
.sidebar, .workspace-header, .sign-in-header, .workspace {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .brand-intro {
    display: grid;
    position: fixed;
    z-index: var(--z-splash);
    inset: 0;
    place-items: center;
    color: #f8fafc;
    animation: intro-exit 540ms var(--ease-out) both;
  }
  .brand-intro.intro-rendered { animation: intro-exit-3d 720ms var(--ease-out) both; }
  .brand-intro-mark {
    display: grid;
    gap: 0;
    justify-items: center;
    font-size: clamp(20px, 3.6vw, 26px);
    font-weight: 660;
    letter-spacing: -.03em;
    animation: intro-mark 260ms var(--ease-out) both;
  }
  .filter-popup { transform-origin: top; animation: popup-in 145ms var(--ease-out) both; }
  .opens-up > .filter-popup { transform-origin: bottom; }
  .detail-opening { animation: detail-in 190ms var(--ease-out) both; }
  #issue-dialog[open], .switcher-dialog[open] { animation: popup-in 170ms var(--ease-out) both; }
}
@keyframes intro-exit { 0%, 40% { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes intro-exit-3d { 0%, 54% { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes intro-mark { from { opacity: .25; transform: translateY(6px) scale(.97); } }
@keyframes popup-in { from { opacity: 0; transform: scale(.98); } }
@keyframes detail-in { from { grid-template-rows: 0fr; opacity: .65; } }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
h1 { font-size: clamp(24px, 3vw, 30px); line-height: 1.18; letter-spacing: -.032em; font-weight: 700; }
h1[tabindex]:focus { outline: 0; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.016em; font-weight: 670; }
h3 { font-size: 14.5px; font-weight: 650; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: var(--font-mono); }

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

/* Precision SaaS Console Shell */
.app-shell {
  --workspace-width: 1200px;
  --gutter: clamp(18px, 2.8vw, 32px);
  --bar-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

.sidebar {
  position: sticky;
  z-index: 2;
  top: 0;
  grid-row: 1 / span 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: 100vh;
  height: 100dvh;
  padding: var(--space-5) var(--space-3) var(--space-4);
  border-inline-end: 1px solid var(--edge);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(20px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.brand img, .mobile-brand {
  flex: none;
  border-radius: 9px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.28);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.brand:hover img {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.36);
}
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: 0; }
.sidebar .brand { padding-inline: 6px; }
.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 0;
  margin-top: 22px;
  padding: 2px;
  overflow: auto;
}
.nav-group { display: grid; gap: 2px; }
.nav-group h2 {
  margin: 0 10px 6px;
  text-align: start;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sidebar-nav button, .switcher-links button {
  width: 100%;
  justify-content: start;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: start;
  font-size: 13.5px;
  font-weight: 540;
}
.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: color-mix(in srgb, var(--primary) 26%, var(--edge));
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 640;
}
.sidebar-nav button[aria-current] svg, .switcher-links button[aria-current] svg { color: var(--primary); }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: 13px;
}
.sidebar-footer button { margin-inline-start: auto; border-color: var(--edge); color: var(--ink); }

.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(--edge);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
}
.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: 60px; gap: 9px; font-size: 15px; font-weight: 700; }
.sign-in-header:not([hidden]) + .workspace { padding-top: clamp(28px, 6vw, 56px); }

.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: 12px;
  min-height: var(--bar-height);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; }
.breadcrumb-root, .breadcrumb-divider { color: var(--muted); font-size: 13px; }
#current-view { font-weight: 660; }
.switcher-trigger {
  min-width: 210px;
  justify-content: start;
  min-height: 36px;
  padding-inline: 12px;
  border-radius: 9px;
  background: var(--well);
  color: var(--muted);
  font-size: 13px;
}
.switcher-trigger kbd {
  margin-inline-start: auto;
  border: 1px solid var(--edge-strong);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.mobile-brand, .switcher-mobile-label, .switcher-menu-icon, .switcher-footer { display: none; }

.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding-block: var(--space-6) var(--space-8);
}
.workspace :is(button, input, select, textarea) { scroll-margin-top: calc(var(--bar-height) + 16px); }

.view-heading, .roster-heading, .release-summary, .dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.view-heading { margin-bottom: var(--space-5); }
.view-heading p, .release-form > p { margin-top: 5px; color: var(--muted); }

.panel {
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

/* Antigravity Glitch-Free Hover Elevation, Mouse-Tracking Specular Spotlight & Entrance Choreography */
.ag-tilt {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition:
    transform 200ms var(--ease-out),
    border-color 180ms ease,
    box-shadow 220ms var(--ease-out),
    background-color 180ms ease;
}
.ag-tilt:hover {
  transform: translate3d(0, -2.5px, 0);
  border-color: color-mix(in srgb, var(--primary) 68%, var(--accent)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 14px 32px -6px rgba(0, 0, 0, 0.54),
    0 0 26px -4px rgba(139, 92, 246, 0.38),
    0 0 18px -5px rgba(34, 211, 238, 0.3) !important;
}
.ag-tilt::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(167, 139, 250, 0.28),
    rgba(34, 211, 238, 0.14) 38%,
    transparent 68%
  );
  transition: opacity 180ms ease;
  content: '';
}
.ag-tilt:hover::after {
  opacity: 1;
}
.overview-hero.ag-tilt::after {
  background: radial-gradient(
    500px circle at var(--mx, 50%) var(--my, 50%),
    rgba(34, 211, 238, 0.26),
    rgba(139, 92, 246, 0.18) 42%,
    transparent 72%
  );
}

@media (prefers-reduced-motion: no-preference) {
  #dashboard > section:not([hidden]) {
    animation: ag-section-in 420ms var(--ease-out) both;
  }
  .overview-hero {
    animation: ag-rise 520ms var(--ease-out) both;
  }
  .metrics .metric-item {
    animation: ag-rise 520ms var(--ease-out) both;
  }
  .metrics .metric-item:nth-child(1) { animation-delay: 50ms; }
  .metrics .metric-item:nth-child(2) { animation-delay: 110ms; }
  .metrics .metric-item:nth-child(3) { animation-delay: 170ms; }
  .metrics .metric-item:nth-child(4) { animation-delay: 230ms; }
  .roster {
    animation: ag-rise 560ms var(--ease-out) 160ms both;
  }
  .sign-in {
    animation: ag-rise 520ms var(--ease-out) both;
  }
  .metric-item.ag-pulse {
    animation: ag-metric-pulse 640ms var(--ease-out);
  }
}
@keyframes ag-section-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ag-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ag-metric-pulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.42); }
  65% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
  100% { box-shadow: var(--shadow-sm); }
}

/* Hero Art: 3-Layer 3D Canvas renders Back Rings -> 3D QT Crystal Core -> Front Rings & Particles */
.hero-art {
  inset: -14px 1% -14px auto;
  width: 44%;
  z-index: 1;
}
.hero-art img {
  height: 100%;
}
.hero-art canvas {
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(34, 211, 238, 0.22));
}

/* Precision Bento Overview Spotlight Hero */
.overview-hero {
  margin-bottom: var(--space-4);
  padding: clamp(22px, 2.8vw, 30px) clamp(22px, 3vw, 34px);
}
.overview-hero .hero-copy {
  position: relative;
  z-index: 3;
  max-width: min(64%, 560px);
}
.overview-hero .pro-eyebrow { margin-bottom: 10px; }
.overview-hero h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
  letter-spacing: -.034em;
  color: #f8fafc;
}
.overview-hero p {
  margin-top: 6px;
  max-width: 48ch;
  color: #cbd5e1;
  font-size: 14px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 739px) {
  .hero-art { inset: -10% -10% 10% auto; width: 56%; opacity: 0.4; }
  .overview-hero .hero-copy { max-width: 82%; }
}
@media (max-width: 480px) {
  .hero-art { display: none; }
  .overview-hero .hero-copy { max-width: 100%; }
}

/* 4 Independent Precision Bento KPI Cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  font-variant-numeric: tabular-nums;
}
.metric-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-4);
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-base) var(--ease-out), transform 280ms var(--ease-out);
}
.metric-item:hover {
  border-color: var(--edge-strong);
  box-shadow: var(--shadow-md);
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-item dt {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.metric-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.metric-icon-violet { background: var(--primary-soft); color: var(--primary); }
.metric-icon-aqua { background: var(--good-bg); color: var(--good); }
.metric-icon-sky { background: var(--accent-soft); color: var(--accent); }
.metric-icon-amber { background: var(--warn-bg); color: var(--warn); }
.metric-value {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 720;
  letter-spacing: -.035em;
}
#expiring-count[data-attention="true"] { color: var(--warn); }
.metric-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.muted { color: var(--muted); font-size: 13.5px; }

/* Precision Buttons */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 6px 13px;
  background: var(--well);
  font-size: 13.5px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease,
    color var(--t-fast) ease, box-shadow var(--t-base) var(--ease-out);
}
button:disabled { opacity: .6; cursor: wait; }
.primary {
  position: relative;
  overflow: hidden;
  padding-inline: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: var(--primary-ink);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.34);
}
.primary::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, 0.28) 50%, transparent 78%);
  transform: translateX(-130%);
  transition: transform 620ms var(--ease-out);
  pointer-events: none;
  content: '';
}
.primary:not(:disabled):hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #4f46e5 100%);
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.48);
  transform: translateY(-1px);
}
.primary:not(:disabled):hover::before {
  transform: translateX(130%);
}
.secondary {
  border-color: var(--edge-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.secondary:not(:disabled):hover { background: var(--well); }
.danger { border-color: var(--danger-edge); background: var(--danger-bg); color: var(--danger); }
.danger:not(:disabled):hover { filter: brightness(0.96); }
.compact { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.icon-button { width: 34px; min-height: 34px; padding: 0; border-radius: 8px; background: var(--well); }
.icon-button:hover { background: var(--well-hover); }

/* Data Roster Table Panel */
.roster-heading, .filters, .tier-filters { padding-inline: var(--space-5); }
.roster-heading { padding-top: var(--space-4); padding-bottom: var(--space-3); }
.roster-heading p { font-size: 12.5px; font-family: var(--font-mono); text-align: end; }
.tier-filters {
  display: flex;
  gap: 18px;
  margin: 0 var(--space-5) var(--space-4);
  padding-inline: 0;
  border-bottom: 1px solid var(--edge);
}
.tier-filters button {
  position: relative;
  min-height: 38px;
  padding-inline: 2px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.tier-filters button:hover { color: var(--ink); }
.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[aria-pressed="true"]::after { scale: 1 1; }
.filter-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tier-filters button[aria-pressed="true"] .filter-count {
  background: var(--primary-soft);
  color: var(--primary);
}

.filters { display: flex; gap: 8px; align-items: stretch; padding-bottom: var(--space-4); }
.roster-search { position: relative; flex: 1; min-width: 0; max-width: 380px; }
.filters #reload { margin-inline-start: auto; }
.status-filter { position: relative; }
.status-filter summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--edge-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.status-filter summary::-webkit-details-marker { display: none; }
.status-filter summary:hover, .status-filter[open] summary { background: var(--well); }
.status-filter[open] summary { border-color: var(--primary); }
.filter-chevron { width: 14px; height: 14px; color: var(--muted); }
.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;
  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: 218px; }
.search-suggestions {
  inset-inline-end: 0;
  margin: 0;
  max-height: min(320px, 44vh);
  overflow: auto;
  list-style: none;
}
.search-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  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; min-width: 0; overflow-wrap: anywhere; }
.suggestion-name code { font-size: 13px; }
.suggestion-name small { color: var(--muted); font-size: 12px; }
.status-options button {
  justify-content: start;
  min-height: 36px;
  border-radius: 8px;
  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(--primary); }
.status-options button::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  content: '';
}
.status-options button[data-status="activated"]::before { background: var(--good); }
.status-options .filter-count { margin-inline-start: auto; }

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding-inline: 12px;
  background: var(--well);
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--muted);
}
input, textarea, select {
  display: block;
  min-height: 38px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--control);
  border-radius: 9px;
  padding: 7px 11px;
  background: var(--well);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.search-field input { min-height: 36px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 13.5px; }
.search-field:focus-within { border-color: var(--ring); outline: 2px solid var(--primary-soft); outline-offset: 0; }
.search-field input:focus-visible { outline: 0; }
select { font-size: 13.5px; }

table { width: 100%; border-collapse: collapse; text-align: start; font-size: 13.5px; }
td, th { padding: 11px 10px; border-top: 1px solid var(--edge); text-align: start; }
th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--well);
}
td:first-child, th:first-child { padding-inline-start: var(--space-5); }
td:last-child, th:last-child { padding-inline-end: var(--space-5); }
tbody:last-child tr:last-child td:first-child { border-end-start-radius: var(--radius-lg); }
tbody:last-child tr:last-child td:last-child { border-end-end-radius: var(--radius-lg); }
.tier-heading th {
  background: var(--surface);
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
  padding-block: 11px 6px;
}
.tier-heading-content, .plan-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tier-heading-label { color: var(--ink); font-size: 13px; font-weight: 670; }
.tier-heading-count { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.tier-heading-content::before, .plan-tag::before {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--tier-color, var(--muted));
  content: '';
}
.tier-heading .pro, .plan-tag.pro { --tier-color: var(--accent); }
.tier-heading .ultra, .plan-tag.ultra { --tier-color: var(--primary); }
.plan-tag { font-size: 13px; font-weight: 630; }

.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: 13.5px; font-weight: 650; }
.record-identity .code-unactivated { color: var(--danger); }
.record-customer { color: var(--muted); font-size: 12.5px; font-weight: 500; overflow-wrap: anywhere; }
.record-chevron {
  width: 7px;
  height: 7px;
  flex: none;
  margin-inline: 1px 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  rotate: -45deg;
  transition: rotate 160ms 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: 12.5px; font-variant-numeric: tabular-nums; }
.record .seats, .row-action { text-align: end; }
th.seats { text-align: end; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 630;
  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: 12px; }

.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(14px, 2vw, 24px);
  padding: var(--space-5);
}
.detail-devices, .detail-management { min-width: 0; }
.detail-management { border-inline-start: 1px solid var(--edge); padding-inline-start: clamp(14px, 2vw, 24px); }
.detail-management h3, .detail-devices h3 { margin-bottom: 10px; }
.devices { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.device-card, .device-empty { padding: 12px; border: 1px solid var(--edge); border-radius: var(--radius-md); background: var(--surface); }
.device-heading, .machine-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; }
.device-heading { justify-content: space-between; margin-bottom: 8px; }
.device-heading strong, .machine-id code { overflow-wrap: anywhere; }
.machine-id code { min-width: 0; font-size: 12px; }
.device-fields, .license-fields { display: grid; gap: 7px; font-size: 13px; }
.device-fields > div, .license-fields > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.device-fields dt, .license-fields dt { color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.original-code { margin-top: 9px; font-size: 13px; }
.empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: var(--space-5); border-top: 1px solid var(--edge); }

/* Precision Studio Sign-In Panel */
.sign-in {
  position: relative;
  overflow: hidden;
  max-width: 420px;
  padding: clamp(22px, 4vw, 32px);
  margin: 8px auto 0;
  box-shadow: var(--shadow-lg);
}
.sign-in::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  content: '';
}
.sign-in-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.sign-in-badge svg { width: 13px; height: 13px; color: var(--primary); }
.sign-in h1 { font-size: 24px; }
.sign-in-subtitle { margin-top: 6px; }
.sign-in-submit { width: 100%; min-height: 42px; justify-self: stretch; }

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

/* Studio Modals */
dialog {
  z-index: var(--z-modal);
  width: min(460px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: var(--scrim); }
.switcher-dialog { width: min(480px, calc(100% - 30px)); }
.switcher-dialog .search-field { margin-block: 14px 10px; }
.switcher-links { display: grid; gap: 3px; }
.switcher-empty { padding: 10px 0; }
.reissue-option { border-top: 1px solid var(--edge); padding-top: 14px; }
.reissue-option button { margin-top: 10px; }
.issue-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.issue-actions .primary { flex: 1; }
.created p { font-size: 13.5px; color: var(--muted); }
output {
  display: block;
  border: 1px solid var(--edge-strong);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  user-select: all;
  background: var(--well);
  color: var(--ink);
  font: 14px/1.5 var(--font-mono);
}
.notice:empty { margin: 0; padding: 0; }
.notice:not(:empty) {
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--well);
  color: var(--ink);
  font-size: 13.5px;
}
.sign-in .notice:not(:empty), dialog .notice:not(:empty) { margin: 13px 0 0; }
.notice.error:not(:empty) { border-color: var(--danger-edge); background: var(--danger-bg); color: var(--danger); }

.management-grid, .catalog-grid { display: grid; gap: var(--space-3); }
.management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalog-card { padding: var(--space-5); }
.catalog-card h2 { margin-top: 8px; }
.catalog-card p { margin-top: 6px; }
.catalog-type {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
}
.commerce-definitions { display: grid; gap: 12px; margin-top: 12px; }
.commerce-definitions dt { font-weight: 650; }
.commerce-definitions dd { color: var(--muted); font-size: 13.5px; }
.plan-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.settings-panel { max-width: 640px; }
.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: 10px;
  padding: 14px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  background: var(--well);
  color: var(--ink);
  text-align: start;
}
.theme-option:hover { border-color: var(--edge-strong); }
.theme-option[aria-checked="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
}
.theme-option-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
}
.theme-option[aria-checked="true"] .theme-option-icon {
  background: var(--primary);
  color: var(--primary-ink);
}
.theme-option > div strong { display: block; font-size: 13.5px; font-weight: 650; }
.theme-option > div span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 450; line-height: 1.4; }
@media (max-width: 650px) {
  .theme-choices { grid-template-columns: 1fr; }
}

@media (max-width: 1050px) {
  .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: 14%; }
  #license-table th.seats { width: 12%; }
  #license-table .row-action { width: 142px; }
}
@media (max-width: 860px) {
  .app-shell { --bar-height: 54px; }
  .sidebar, .breadcrumb-root, .breadcrumb-divider, .switcher-desktop-label, .switcher-trigger kbd, .switcher-search-icon { display: none; }
  .mobile-brand, .switcher-mobile-label, .switcher-menu-icon { display: block; }
  .switcher-trigger { min-width: 0; }
  .switcher-footer { display: flex; border-top: 1px solid var(--edge); padding-top: 12px; margin-top: 12px; }
}
@media (max-width: 700px) {
  .management-grid, .catalog-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .app-shell { --gutter: 16px; }
  .workspace { padding-top: 18px; }
  .filters { flex-wrap: wrap; }
  .roster-search { flex-basis: 100%; max-width: none; }
  .search-field input, input, select { font-size: 16px; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  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(--edge);
    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: 12.5px; }
  .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: 2; grid-row: 2; }
  .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); }
  .detail-management { border-inline-start: 0; border-top: 1px solid var(--edge); padding: 12px 0 0; }
}
@media (max-width: 440px) {
  .view-heading { display: grid; }
  .view-heading button { justify-self: start; }
  .tier-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tier-filters button { flex-direction: column; gap: 2px; padding: 5px 3px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  button, .tier-filters button::after, .record td, .record-chevron, .metric-item, .ag-tilt, .primary::before { transition: none !important; }
  .ag-orb, .overview-hero, .metrics .metric-item, .roster, .sign-in, #dashboard > section { animation: none !important; }
  .ag-field, .qt-intro { display: none; }
}
