/* ==========================================================================
   MAHIROUTER // ENTERPRISE INFRASTRUCTURE DESIGN SYSTEM
   Bespoke Handcrafted SaaS Architecture • Inspired by Linear, Stripe & Raycast
   ========================================================================== */

:root {
  /* Unidown Dark Theme Palette */
  --bg-canvas: #121217;
  --bg-surface: #17171c;
  --bg-surface-elevated: #1c1c23;
  --bg-surface-active: #252530;
  --bg-input: #141419;

  /* Unidown Hairline Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: #2b2b36;
  --border-hover: #3d3d4e;
  --border-focus: #6362ed;

  /* Typography */
  --text-primary: #ffffff;
  --text-secondary: #9d9daf;
  --text-muted: #6c6c7e;
  --text-dim: #4b4b5a;

  /* Unidown Blurple & Vibrant Accents */
  --primary-main: #6362ed;
  --primary-hover: #7271f4;
  --primary-dim: rgba(99, 98, 237, 0.15);
  --primary-border: rgba(99, 98, 237, 0.35);
  --primary-glow: 0 4px 18px rgba(99, 98, 237, 0.35);

  --emerald-main: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.28);
  --emerald-text: #34d399;

  --amber-main: #f29d44;
  --amber-dim: rgba(242, 157, 68, 0.12);
  --amber-border: rgba(242, 157, 68, 0.3);
  --amber-text: #fbbf24;

  --indigo-main: #6362ed;
  --indigo-dim: rgba(99, 98, 237, 0.14);

  --rose-main: #f43f5e;
  --rose-dim: rgba(244, 63, 94, 0.12);

  /* Elevation & Geometry */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  --shadow-elevated: 0 12px 32px -4px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.07);

  --transition-fast: all 0.15s ease;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Duality */
[data-theme="light"] {
  --bg-canvas: #f4f4f5;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #fafafa;
  --bg-surface-active: #f4f4f5;
  --bg-input: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.18);
  --border-focus: rgba(16, 185, 129, 0.6);

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;

  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.workspace-shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* ==========================================================================
   1. PRIMARY TOP NAVIGATION BAR (Linear Style)
   ========================================================================== */
.top-navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  gap: 16px;
}

.nav-brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.brand-glyph-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-heading-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-main);
  display: inline-block;
  box-shadow: 0 0 6px var(--emerald-main);
}

.brand-meta-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Header Utilities */
.nav-utility-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.utility-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.btn-spotlight-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-spotlight-capsule:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-dim);
}

.theme-toggle-cluster {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  display: flex;
  gap: 2px;
}

.btn-theme-switch {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-theme-switch.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   2. HORIZONTAL SEGMENTED TAB BAR (Raycast / Vercel Style)
   ========================================================================== */
.segmented-navigation-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 24px;
  padding-bottom: 2px;
  gap: 12px;
  overflow-x: auto;
}

.tab-segments-stack {
  display: flex;
  align-items: center;
  gap: 4px;
}

.segment-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.segment-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.segment-tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(99, 98, 237, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(99, 98, 237, 0.18);
}

.session-profile-slot {
  display: flex;
  align-items: center;
}

.btn-auth-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 98, 237, 0.35);
  transition: var(--transition-fast);
}

.btn-auth-action:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(99, 98, 237, 0.45);
  transform: translateY(-1px);
}

.account-auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--emerald-dim);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--emerald-text);
  font-weight: 600;
}

.account-rank-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--emerald-main);
  color: #000000;
}

.btn-chip-signout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  transition: var(--transition-fast);
}

.btn-chip-signout:hover {
  color: var(--rose-main);
}

/* ==========================================================================
   3. SECTIONS WRAPPER
   ========================================================================== */
.content-deck-panel {
  display: none;
  animation: fadeInPanel 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-deck-panel.active {
  display: block;
}

@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. SECTION: OVERVIEW & TELEMETRY
   ========================================================================== */
.metric-tiles-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.metric-tile:hover {
  border-color: var(--border-hover);
}

.metric-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.metric-tile-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-tile-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.metric-tile-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.overview-split-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.panel-card-standard {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Minimalist Monospace Bar Chart */
.telemetry-bar-rail {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 120px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.bar-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar-column-fill {
  width: 100%;
  max-width: 28px;
  background: var(--bg-surface-active);
  border: 1px solid var(--border-default);
  border-radius: 4px 4px 1px 1px;
  transition: height 0.4s ease, background 0.2s;
}

.bar-slot:hover .bar-column-fill {
  background: var(--emerald-main);
  border-color: var(--emerald-main);
}

.bar-label-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ==========================================================================
   5. SECTION: ACCOUNT & PROFILE (SIAPA USERNIA & BERAPA PENGGUNAANNYA)
   ========================================================================== */
.account-ledger-deck {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-elevated);
  margin-bottom: 24px;
}

.account-identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 22px;
}

.identity-user-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-monogram {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--emerald-main);
  box-shadow: var(--shadow-sm);
}

.identity-titles-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.identity-name-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.identity-user-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.tier-badge-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.rank-standing-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  color: var(--amber-main);
}

.identity-telegram-line {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.telegram-handle-link {
  color: var(--emerald-text);
  font-weight: 600;
  text-decoration: none;
}

.countdown-clock-unit {
  text-align: right;
}

.clock-caption {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.clock-value-string {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--emerald-text);
  font-variant-numeric: tabular-nums;
}

/* User Usage 4-Columns Grid */
.account-gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.gauge-cell {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.gauge-cell-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.gauge-cell-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.progress-track-hairline {
  width: 100%;
  height: 5px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill-active {
  height: 100%;
  background: linear-gradient(90deg, #6362ed, #818cf8);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px rgba(99, 98, 237, 0.5);
  transition: width 0.5s ease;
}

/* Credentials Row */
.credentials-deck-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.credential-cell {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.credential-label-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-with-copy-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-field-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  outline: none;
}

.code-field-input:focus {
  border-color: var(--border-focus);
}

.btn-inline-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-inline-copy:hover {
  background: var(--bg-surface-active);
  border-color: var(--border-hover);
}

/* Telegram Link Bar */
.telegram-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.sync-bar-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.sync-bar-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Developer Snippets Frame */
.snippets-sandbox-frame {
  background: #000000;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.snippets-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #09090b;
  border-bottom: 1px solid var(--border-subtle);
}

.lang-selector-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-tab-pill {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-tab-pill.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.snippet-terminal-display {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #a7f3d0;
  overflow-x: auto;
  white-space: pre;
}

/* Guest Gateway Well */
.guest-onboarding-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  max-width: 580px;
  margin: 40px auto;
  box-shadow: var(--shadow-elevated);
}

/* ==========================================================================
   6. SECTION: LEADERBOARD (EXECUTIVE TOP 3 & FULL DATA TABLE)
   ========================================================================== */
.leaderboard-cards-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.leaderboard-executive-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: var(--transition-fast);
}

.leaderboard-executive-card:hover {
  border-color: var(--border-hover);
}

.rank-01-card {
  border-color: var(--amber-border);
  background: linear-gradient(180deg, var(--amber-dim) 0%, var(--bg-surface) 100%);
}

.rank-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rank-numeric-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.card-user-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-telegram-handle {
  font-size: 12px;
  color: var(--emerald-text);
  font-weight: 600;
  margin-bottom: 14px;
}

.card-metrics-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.card-metric-figure {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* High-Density Data Tables */
.data-table-chassis {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.enterprise-data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-default);
}

.enterprise-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.enterprise-data-table tr:hover td {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.rank-cell-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   7. SECTION: MODEL CATALOG
   ========================================================================== */
.catalog-controls-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  width: 300px;
}

.catalog-search-pill input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}

.filter-categories-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.category-filter-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.category-filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-canvas);
  border-color: var(--text-primary);
  font-weight: 600;
}

.models-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.model-inventory-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.model-inventory-card:hover {
  border-color: var(--border-hover);
}

.model-title-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.latency-micro-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--emerald-text);
  background: var(--emerald-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   8. MODALS & TOAST SYSTEM
   ========================================================================== */
.modal-overlay-chassis {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-overlay-chassis.active {
  display: flex;
}

.modal-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  animation: modalSlide 0.15s ease-out;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

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

.modal-footer-deck {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-default);
}

.form-field-unit {
  margin-bottom: 14px;
}

.form-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  outline: none;
}

.form-input-control:focus {
  border-color: var(--border-focus);
}

.btn-form-primary {
  padding: 7px 16px;
  background: var(--primary-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 98, 237, 0.35);
  transition: var(--transition-fast);
}

.btn-form-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(99, 98, 237, 0.45);
}

.btn-form-secondary {
  padding: 7px 14px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Toast */
.toast-stack-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-item {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastFadeIn 0.15s ease-out;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
  .metric-tiles-matrix { grid-template-columns: repeat(2, 1fr); }
  .account-gauges-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-split-grid { grid-template-columns: 1fr; }
  .credentials-deck-row { grid-template-columns: 1fr; }
  .leaderboard-cards-deck { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .metric-tiles-matrix { grid-template-columns: 1fr; }
  .account-gauges-grid { grid-template-columns: 1fr; }
  .workspace-shell { padding: 12px; }
}
