:root {
  color-scheme: light;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  --bg-hover: #f1f5f9;

  --ink-primary: #0f172a;
  --ink-secondary: #475569;
  --ink-tertiary: #64748b;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --brand-600: #0b74de;
  --brand-700: #0052b0;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-ring: rgba(11, 116, 222, 0.24);

  --ok-text: #047857;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  --ok-dot: #10b981;

  --warn-text: #b45309;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-dot: #f59e0b;

  --err-text: #b91c1c;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  --err-dot: #ef4444;

  --info-text: #0369a1;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;

  --neutral-text: #475569;
  --neutral-bg: #f1f5f9;
  --neutral-border: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --rail-width: 264px;
}

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

::selection {
  background: var(--brand-100);
  color: var(--ink-primary);
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--brand-600);
}

[hidden] {
  display: none !important;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand-600);
  text-underline-offset: 3px;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-secondary);
}

.subtle {
  color: var(--ink-tertiary);
  font-size: 12.5px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus & Scrollbars */
:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 42px;
  padding: 9px 18px;
  font-size: 14px;
}

.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-700);
  color: #ffffff;
}

.btn-danger {
  background: #ffffff;
  border-color: var(--err-border);
  color: var(--err-text);
}

.btn-danger-solid {
  background: var(--err-text);
  border-color: #991b1b;
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-secondary);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: #94a3b8;
  }
  .btn-primary:hover:not(:disabled) {
    background: var(--brand-700);
    border-color: #003e8a;
  }
  .btn-danger:hover:not(:disabled) {
    background: var(--err-bg);
    border-color: #fca5a5;
  }
  .btn-danger-solid:hover:not(:disabled) {
    background: #991b1b;
    border-color: #7f1d1d;
  }
  .btn-ghost:hover:not(:disabled) {
    background: var(--bg-subtle);
    color: var(--ink-primary);
    border-color: transparent;
  }
}

/* Form Controls */
.form-stack {
  display: grid;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-primary);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-tertiary);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* Badges & Status Indicators */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-ok {
  color: var(--ok-text);
  background: var(--ok-bg);
  border-color: var(--ok-border);
}
.badge-ok .badge-dot { background: var(--ok-dot); }

.badge-warn {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.badge-warn .badge-dot { background: var(--warn-dot); }

.badge-err {
  color: var(--err-text);
  background: var(--err-bg);
  border-color: var(--err-border);
}
.badge-err .badge-dot { background: var(--err-dot); }

.badge-info {
  color: var(--info-text);
  background: var(--info-bg);
  border-color: var(--info-border);
}
.badge-info .badge-dot { background: var(--brand-600); }

.badge-neutral {
  color: var(--neutral-text);
  background: var(--neutral-bg);
  border-color: var(--neutral-border);
}
.badge-neutral .badge-dot { background: #94a3b8; }

/* Public Landing / Auth Experience */
.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.public-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-lockup img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-tertiary);
}

.public-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-main {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 64px;
  flex: 1;
}

.public-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 44px;
  align-items: start;
}

.public-copy {
  padding-top: 12px;
}

.public-copy h1 {
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 16px;
  max-width: 18ch;
}

.public-copy .lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 56ch;
  margin-bottom: 24px;
}

.public-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.spec-item h3 {
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 4px;
  color: var(--ink-primary);
}

.spec-item p {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.auth-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.auth-tab {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.auth-tab.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

.auth-panel h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-panel .auth-sub {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 18px;
}

.dev-hint-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.dev-hint-box strong {
  color: var(--ink-primary);
}

.public-download-band {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.public-download-band h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.public-steps-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.step-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.step-box h3 {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 6px;
}

.step-box p {
  font-size: 13px;
  color: var(--ink-secondary);
}

.public-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 16px 24px;
}

.public-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-tertiary);
}

/* Clean Minimal Authentication Shell (Web Login & Desktop Device Authorization) */
.auth-page-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  background: var(--bg-canvas);
}

.auth-page-card {
  width: min(100%, 420px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  padding: clamp(22px, 4vw, 32px);
  display: grid;
  gap: 18px;
}

.auth-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  margin: 0 0 4px;
}

.auth-page-card .auth-sub {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin: 0 0 14px;
}

.device-confirm-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.auth-action-stack {
  display: grid;
  gap: 8px;
}

.auth-complete-box {
  display: grid;
  gap: 14px;
}

.auth-page-foot {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--ink-tertiary);
  text-align: center;
}

.btn-push-on {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

.contact-pill {
  min-height: 26px;
  padding: 2px 8px;
  font-size: 11.5px;
  text-decoration: none;
}

.contact-wa {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

@media (max-width: 520px) {
  .device-confirm-box {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .workspace-content {
    padding: 16px 14px 36px;
  }
}

/* Authenticated Workspace Shell (User Portal & Admin Dashboard) */
.workspace-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-subtle);
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-group {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
}

.nav-group-label {
  padding: 6px 10px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-tertiary);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease-out);
}

.nav-btn > span:not(.nav-count) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-btn .nav-count {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nav-btn .nav-count.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.nav-btn .nav-count.err {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

.nav-btn.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.nav-btn.active svg {
  color: var(--brand-600);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .nav-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink-primary);
  }
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 8px;
}

.account-chip {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.account-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.account-chip-email {
  font-size: 12px;
  color: var(--ink-tertiary);
}

/* Main Workspace Column */
.workspace-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-nav-toggle {
  display: none;
}

.topbar-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-content {
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* Inline Notice Banner */
.banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.banner > div {
  flex: 1 1 240px;
  min-width: 0;
}

.banner-warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.banner-err {
  border-color: var(--err-border);
  background: var(--err-bg);
  color: var(--err-text);
}

.banner-ok {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

/* KPI Strip (Clean flat hairline grid, no flashy metric cards) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.kpi-strip.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border-subtle);
  display: grid;
  gap: 4px;
  min-width: 0;
}

.kpi-cell:last-child {
  border-right: 0;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.kpi-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Panels & Sections */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.panel-header > div {
  min-width: 0;
}

.panel-header h2, .panel-header h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.panel-subtitle {
  font-size: 12.5px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.panel-body {
  padding: 18px;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.grid-2-wide {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Filter Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  width: 240px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
}

.filter-pills {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.filter-pill {
  min-height: 28px;
  padding: 3px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

/* Tables */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-tertiary);
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.data-table .model-cell {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kv-grid > div {
  min-width: 0;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr.clickable {
  cursor: pointer;
  transition: background-color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .data-table tbody tr.clickable:hover {
    background: var(--bg-canvas);
  }
}

.cell-primary {
  font-weight: 600;
  color: var(--ink-primary);
}

.cell-secondary {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.num-col {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Progress / Quota Bars */
.quota-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.quota-fill {
  height: 100%;
  background: var(--brand-600);
  border-radius: 999px;
  transition: width 220ms var(--ease-out);
}

.quota-fill.warn { background: var(--warn-dot); }
.quota-fill.err { background: var(--err-dot); }

/* Charts */
.chart-box {
  width: 100%;
  min-height: 220px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.hbar-list {
  display: grid;
  gap: 14px;
}

.hbar-row {
  display: grid;
  gap: 5px;
}

.hbar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.hbar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  display: flex;
}

.hbar-seg-in {
  background: var(--brand-600);
  height: 100%;
}

.hbar-seg-out {
  background: #38bdf8;
  height: 100%;
}

/* Activity & Feed Lists */
.feed-list {
  display: grid;
}

.feed-item {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-primary);
}

.feed-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

/* Code / Key Pill */
.key-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-primary);
}

.code-block {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 8px 0;
}

/* Empty & Skeleton States */
.empty-state {
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-secondary);
}

.empty-state h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 44ch;
  margin: 0 auto 14px;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Slide-Over Inspector Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(640px, 100vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms var(--ease-drawer);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.drawer-body {
  padding: 20px 22px 32px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 20px;
  align-content: start;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.kv-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-tertiary);
}

.kv-value {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-primary);
  margin-top: 2px;
  word-break: break-word;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 200ms var(--ease-out), opacity 180ms var(--ease-out);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 650;
}

.modal-body {
  padding: 18px 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast Notifications */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--ink-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}

.toast.toast-error {
  background: #991b1b;
}

.toast.toast-success {
  background: #065f46;
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .kpi-strip, .kpi-strip.cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-cell {
    border-bottom: 1px solid var(--border-subtle);
  }
  .grid-2, .grid-2-wide {
    grid-template-columns: 1fr;
  }
  .public-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 260ms var(--ease-drawer);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .topbar {
    padding: 12px 16px;
  }
  .workspace-content {
    padding: 16px 16px 40px;
  }
  .public-steps-grid {
    grid-template-columns: 1fr;
  }
  .spec-list, .form-row-2, .kv-grid {
    grid-template-columns: 1fr;
  }
  .search-input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
