/**
 * ============================================================================
 * ZUKRO COMMERCE OS (ZOS) — UNIFIED BRAND DESIGN SYSTEM
 * Authoritative Design Tokens, Liquid Glass Surfaces, and Theme Foundations
 * Compliant with ZOS Brand Guidelines (Dark & Light Themes)
 * ============================================================================
 */

/* ── 1. Fonts Setup ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   ZOS LIQUID GLASS v2 — MASTER DESIGN SYSTEM FOUNDATION
   "Content is crisp. Controls float."
   "Neutral by default. Semantic by meaning. Glass by function."
   ========================================================================== */

:root {
  /* ── 00. Typography Architecture ─────────────────────────────────────── */
  --zk-font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --zk-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --zk-unit: 4px;

  /* Typography Scale */
  --zk-text-xs: 11px;
  --zk-text-sm: 13px;
  --zk-text-md: 14px;
  --zk-text-lg: 16px;
  --zk-text-xl: 20px;
  --zk-text-2xl: 24px;
  --zk-text-3xl: 30px;
  --zk-text-4xl: 36px;

  /* Concentric Radius Architecture */
  --zk-radius-xs: 8px;
  --zk-radius-sm: 10px;
  --zk-radius-md: 14px;
  --zk-radius-lg: 18px;
  --zk-radius-xl: 24px;
  --zk-radius-pill: 999px;

  /* ── 01. Content Layer (Plane 1 — Solid, Crisp, Opaque) ───────────────── */
  --zk-surface-0: #F8FAFC;
  --zk-surface-1: #FFFFFF;
  --zk-surface-2: #F1F5F9;
  --zk-surface-3: #E2E8F0;

  --zk-text-1: #0F172A;
  --zk-text-2: #475569;
  --zk-text-3: #64748B;
  --zk-text-disabled: #94A3B8;

  --zk-border-subtle: rgba(15, 23, 42, 0.08);
  --zk-border: rgba(15, 23, 42, 0.12);
  --zk-border-strong: rgba(15, 23, 42, 0.18);

  /* ── 02. ZOS Origin Taxonomy Colors (Rule 14 v2) ──────────────────────── */
  --zk-brand-amber: #D6AF36;
  --zk-ai-violet: #8E9FC4;
  --zk-ai-violet-strong: #6E798A;
  --zk-telemetry-cyan: #63A9C2;
  --zk-telemetry-cyan-strong: #5C7C8D;

  --zk-danger: #C96D70;
  --zk-success: #62A77D;
  --zk-warning: #C79A32;

  --zk-obsidian: #07111F;
  --zk-obsidian-strong: #0D1A2B;

  /* ── 03. Liquid Glass Material Tokens (Plane 2 — Controls & Nav ONLY) ─── */
  --zk-glass-clear: rgba(255, 255, 255, 0.46);
  --zk-glass-regular: rgba(255, 255, 255, 0.72);
  --zk-glass-prominent: rgba(255, 255, 255, 0.88);
  --zk-glass-border: rgba(255, 255, 255, 0.65);
  --zk-glass-highlight: rgba(255, 255, 255, 0.9);
  --zk-glass-blur: 24px;
  --zk-glass-saturation: 150%;

  /* ── 04. Surface Elevations (E0 to E4) ─────────────────────────────────── */
  --zk-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04);
  --zk-shadow-2: 0 4px 16px rgba(15, 23, 42, 0.06);
  --zk-shadow-3: 0 8px 32px rgba(15, 23, 42, 0.12);
  --zk-shadow-4: 0 20px 60px rgba(15, 23, 42, 0.18);

  /* ── 05. Spatial Dimensions & ERP Layout ──────────────────────────────── */
  --zk-header-h: 64px;
  --zk-sidebar-w: 248px;
  --zk-sidebar-w-collapsed: 72px;

  --zk-content-standard: 1280px;
  --zk-content-wide: 1440px;
  --zk-content-ultra: 1600px;

  /* ── 06. Interaction & Motion ─────────────────────────────────────────── */
  --zk-target-min: 44px;
  --zk-duration-fast: 120ms;
  --zk-duration-standard: 160ms;
  --zk-duration-slow: 240ms;
}

/* Dark Mode Tokens Override */
html[data-theme="dark"],
body[data-theme="dark"] {
  --zk-surface-0: #07111F;
  --zk-surface-1: #0D1A2B;
  --zk-surface-2: #16213A;
  --zk-surface-3: #1F2C48;

  --zk-text-1: #F8FAFC;
  --zk-text-2: #CBD5E1;
  --zk-text-3: #94A3B8;
  --zk-text-disabled: #64748B;

  --zk-border-subtle: rgba(255, 255, 255, 0.08);
  --zk-border: rgba(255, 255, 255, 0.12);
  --zk-border-strong: rgba(255, 255, 255, 0.18);

  --zk-glass-clear: rgba(14, 23, 42, 0.46);
  --zk-glass-regular: rgba(14, 23, 42, 0.72);
  --zk-glass-prominent: rgba(14, 23, 42, 0.88);
  --zk-glass-border: rgba(255, 255, 255, 0.12);
  --zk-glass-highlight: rgba(255, 255, 255, 0.18);

  --zk-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --zk-shadow-2: 0 4px 16px rgba(0, 0, 0, 0.5);
  --zk-shadow-3: 0 8px 32px rgba(0, 0, 0, 0.6);
  --zk-shadow-4: 0 20px 60px rgba(0, 0, 0, 0.75);
}

/* ── Crisp Content Surface (Plane 1 — GL-0: No Glass) ──────────────────── */
.zos-surface,
.zos-card-crisp {
  background: var(--zk-surface-1) !important;
  border: 1px solid var(--zk-border-subtle) !important;
  border-radius: var(--zk-radius-lg);
  box-shadow: var(--zk-shadow-1);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ── Liquid Glass Functional Layer (Plane 2 — GL-1 & GL-2) ─────────────── */
.zos-glass,
.zos-floating-nav,
.zos-glass-toolbar {
  background: var(--zk-glass-regular) !important;
  backdrop-filter: blur(var(--zk-glass-blur)) saturate(var(--zk-glass-saturation)) !important;
  -webkit-backdrop-filter: blur(var(--zk-glass-blur)) saturate(var(--zk-glass-saturation)) !important;
  border: 1px solid var(--zk-glass-border) !important;
  box-shadow: var(--zk-shadow-3) !important;
}

/* ── Transient Layer (Plane 3 — GL-3) ──────────────────────────────────── */
.zos-transient,
.zos-command-palette,
.zos-modal-dialog {
  background: var(--zk-glass-prominent) !important;
  backdrop-filter: blur(32px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
  border: 1px solid var(--zk-glass-border) !important;
  box-shadow: var(--zk-shadow-4) !important;
}

/* ── Origin Taxonomy Modifier Classes (Rule 14 v2) ─────────────────────── */
.zos-origin--human {
  --origin-accent: var(--zk-brand-amber);
  color: #0D1A2B;
  background: var(--zk-brand-amber);
}
.zos-origin--ai {
  --origin-accent: var(--zk-ai-violet-strong);
  color: #FFFFFF;
  background: var(--zk-ai-violet-strong);
}
.zos-origin--telemetry {
  --origin-accent: var(--zk-telemetry-cyan-strong);
  color: #0D1A2B;
  background: var(--zk-telemetry-cyan-strong);
}
.zos-origin--destructive {
  --origin-accent: var(--zk-danger);
  color: #FFFFFF;
  background: var(--zk-danger);
}
.zos-origin--success {
  --origin-accent: var(--zk-success);
  color: #FFFFFF;
  background: var(--zk-success);
}
.zos-origin--warning {
  --origin-accent: var(--zk-warning);
  color: #0D1A2B;
  background: var(--zk-warning);
}

/* ── WCAG 2.2 Focus Appearance Invariant ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--zk-brand-amber) !important;
  outline-offset: 2px !important;
}

/* ── Reduced Transparency & Motion Accessibility Fallbacks ─────────────── */
@media (prefers-reduced-transparency: reduce) {
  .zos-glass,
  .zos-floating-nav,
  .zos-glass-toolbar,
  .zos-transient,
  .zos-command-palette,
  .zos-modal-dialog {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--zk-surface-1) !important;
  }
}

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


/* Strict 2-Font System Enforcement (Zero sans-serif / 3rd Font) */
code, kbd, pre, samp, var, tt, .mono, .spec-code-block, .zos-td-mono, .fcc-td-mono, .awb, .key-pill, .step-output, .tenant-id, .lc-tid, .lc-hash, .deeplink-out, .kbd, .code-tag {
  font-family: var(--font-sans, 'Plus Jakarta Sans', 'Inter', sans-serif) !important;
}

/* ── 2. Core Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Brand Core Palette (Fixed) */
  --brand-ink: #0D1A2B;
  --brand-amber: #D6AF36;
  --brand-white: #ffffff;

  /* Secondary & Semantic Hues */
  --ai-violet-dark: #8E9FC4;
  --ai-violet-light: #6E798A;
  --accent-cyan: #5C7C8D;
  --cyan-glow: rgba(51, 194, 224, 0.25);
  --success: #62A77D;
  --success-glow: rgba(34, 197, 94, 0.22);
  --warning: #D6AF36;
  --warning-alt: #C79A32;
  --danger: #C96D70;
  --danger-glow: rgba(239, 68, 68, 0.25);

  /* Slate Scale (Derivations) */
  --slate-900: #0D1A2B;
  --slate-850: #121c32;
  --slate-800: #16213a;
  --slate-700: #1f2c48;
  --slate-600: #33415f;
  --slate-500: #5b6b8c;
  --slate-400: #7b8ba6;
  --slate-300: #a9b4c9;
  --slate-200: #cbd5e1;
  --slate-100: #e7ebf3;
  --slate-50: #f8fafc;

  /* Typography — Strict 2-Font System (Plus Jakarta Sans & Inter) */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ui: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Plus Jakarta Sans', 'Inter', sans-serif;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 3. Dark Theme (Default) ─────────────────────────────────────────────── */
html,
html[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --surface-page: #07111F;
  --surface-page-gradient: #07111F;
  --surface-sidebar: #060a14;
  --surface-card: rgba(22, 33, 58, 0.65);
  --surface-card-hover: rgba(31, 44, 72, 0.85);
  --surface-elevated: rgba(31, 44, 72, 0.75);
  --surface-glass: rgba(14, 23, 42, 0.72);
  --surface-input: rgba(10, 18, 36, 0.85);

  /* Legacy variable mappings for existing views */
  --bg: #07111F;
  --bg2: #060a14;
  --main-bg: #07111F;
  --surface: rgba(22, 33, 58, 0.65);
  --surface-2: #121c32;
  --surface2: #1f2c48;
  --card-bg: rgba(22, 33, 58, 0.65);
  --sidebar: #060a14;
  --t1: #ffffff;
  --t2: rgba(255, 255, 255, 0.68);
  --t3: rgba(255, 255, 255, 0.40);
  --gold: #D6AF36;
  --gold-dark: #0D1A2B;
  --gold-bg: rgba(250, 196, 11, 0.12);
  --gold-border: rgba(250, 196, 11, 0.25);
  --amber: #D6AF36;
  --green: #62A77D;
  --green-dark: #16a34a;
  --emerald: #62A77D;
  --rose: #C96D70;
  --red: #C96D70;
  --purple: #8E9FC4;
  --violet: #8E9FC4;
  --vlight: #b8a8ff;
  --cyan: #63A9C2;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.6);
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --mono: var(--font-sans, 'Plus Jakarta Sans', 'Inter', sans-serif);
  --ui: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --sb-bg: #060a14;
  --sb-text: #ffffff;
  --sb-muted: rgba(255, 255, 255, 0.68);
  --sb-line: rgba(255, 255, 255, 0.08);
  --mn-bg: #07111F;
  --mn-text: #ffffff;
  --mn-muted: rgba(255, 255, 255, 0.68);
  --mn-border: rgba(255, 255, 255, 0.08);
  --mn-input-bg: rgba(10, 18, 36, 0.85);
  --mn-focus: rgba(250, 196, 11, 0.35);
  --mn-input-focus: rgba(250, 196, 11, 0.35);
  --prog-track: rgba(255, 255, 255, 0.12);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border2: rgba(255, 255, 255, 0.16);
  --border-active: var(--brand-amber);
  --border-glow-cyan: rgba(0, 240, 255, 0.28);
  --border-glow-amber: rgba(250, 196, 11, 0.32);

  /* Typography Colors */
  --text: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.68);
  --text-muted: rgba(255, 255, 255, 0.40);
  --text-dim: rgba(255, 255, 255, 0.24);

  /* Brand Accents */
  --accent: var(--brand-amber);
  --accent-on: var(--brand-ink);
  --accent-glow: rgba(250, 196, 11, 0.35);
  --ai-accent: var(--ai-violet-dark);
  --ai-accent-glow: rgba(156, 140, 255, 0.28);
  --cyan: #63A9C2;
  --blue: #2d62ff;

  /* Focus Ring */
  --focus-ring: rgba(250, 196, 11, 0.6);

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-floating: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ── 4. Light Theme ──────────────────────────────────────────────────────── */
html[data-theme="light"] {
  color-scheme: light;

  /* Surfaces */
  --surface-page: #f8fafc;
  --surface-page-gradient: #f8fafc;
  --surface-sidebar: #eef3f9;
  --surface-card: rgba(255, 255, 255, 0.85);
  --surface-card-hover: rgba(255, 255, 255, 0.98);
  --surface-elevated: rgba(255, 255, 255, 0.95);
  --surface-glass: rgba(255, 255, 255, 0.75);
  --surface-input: #ffffff;

  /* Legacy variable mappings for existing views */
  --bg: #f8fafc;
  --bg2: #eef3f9;
  --main-bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #edf2f9;
  --surface2: #e2e8f0;
  --card-bg: #ffffff;
  --sidebar: #eef3f9;
  --t1: #0D1A2B;
  --t2: rgba(14, 23, 42, 0.68);
  --t3: rgba(14, 23, 42, 0.45);
  --gold: #D6AF36;
  --gold-dark: #0D1A2B;
  --gold-bg: rgba(250, 196, 11, 0.12);
  --gold-border: rgba(250, 196, 11, 0.25);
  --amber: #D6AF36;
  --green: #62A77D;
  --green-dark: #16a34a;
  --emerald: #62A77D;
  --rose: #C96D70;
  --red: #C96D70;
  --purple: #6E798A;
  --violet: #6E798A;
  --vlight: #8E9FC4;
  --cyan: #5C7C8D;
  --shadow: 0 4px 16px rgba(14, 23, 42, 0.06);
  --shadow-md: 0 16px 40px rgba(14, 23, 42, 0.12);
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --mono: var(--font-sans, 'Plus Jakarta Sans', 'Inter', sans-serif);
  --ui: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --sb-bg: #0D1A2B;
  --sb-text: #ffffff;
  --sb-muted: rgba(255, 255, 255, 0.65);
  --sb-line: rgba(255, 255, 255, 0.12);
  --mn-bg: #f8fafc;
  --mn-text: #0D1A2B;
  --mn-muted: rgba(14, 23, 42, 0.68);
  --mn-border: rgba(14, 23, 42, 0.08);
  --mn-input-bg: #ffffff;
  --mn-focus: rgba(250, 196, 11, 0.35);
  --mn-input-focus: rgba(250, 196, 11, 0.35);
  --prog-track: #cbd5e1;

  /* Borders */
  --border: rgba(14, 23, 42, 0.08);
  --border-strong: rgba(14, 23, 42, 0.16);
  --border2: rgba(14, 23, 42, 0.16);
  --border-active: var(--brand-amber);
  --border-glow-cyan: rgba(51, 194, 224, 0.28);
  --border-glow-amber: rgba(250, 196, 11, 0.35);

  /* Typography Colors */
  --text: #0D1A2B;
  --text-primary: #0D1A2B;
  --text-secondary: rgba(14, 23, 42, 0.68);
  --text-muted: rgba(14, 23, 42, 0.45);
  --text-dim: rgba(14, 23, 42, 0.28);

  /* Brand Accents */
  --accent: var(--brand-amber);
  --accent-on: var(--brand-ink);
  --accent-glow: rgba(250, 196, 11, 0.25);
  --ai-accent: var(--ai-violet-light);
  --ai-accent-glow: rgba(124, 108, 246, 0.22);
  --cyan: #0284c7;
  --blue: #2563eb;

  /* Focus Ring */
  --focus-ring: rgba(250, 196, 11, 0.45);

  /* Shadows */
  --shadow-card: 0 4px 16px rgba(14, 23, 42, 0.06);
  --shadow-overlay: 0 16px 40px rgba(14, 23, 42, 0.12);
}

/* ── 5. Global Reset & Base Typography ────────────────────────────────────── */
html, body {
  background: var(--surface-page, #07111F);
  color: var(--text-primary, #ffffff);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Tabular & Numerical Formatting */
.zos-mono,
.zos-kpi-val,
.zos-metric,
.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── 6. Liquid Glass Components ───────────────────────────────────────────── */
.zos-glass-panel,
.zos-card {
  background: var(--surface-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
}

.zos-glass-panel:hover,
.zos-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
}

.zos-card-elevated {
  background: var(--surface-elevated);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
}

/* ── 7. Unified Button System ─────────────────────────────────────────────── */
.zos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.zos-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.zos-btn:disabled,
.zos-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Brand Button (Amber — User Authority) */
.zos-btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  border-color: var(--accent);
}

.zos-btn-primary:hover {
  background: #e5b30a;
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

/* AI / Autonomous Action Button (Electric Violet — AI Layer) */
.zos-btn-ai {
  background: rgba(156, 140, 255, 0.14);
  color: var(--ai-accent);
  border: 1px solid rgba(156, 140, 255, 0.35);
  font-weight: 600;
}

.zos-btn-ai:hover {
  background: rgba(156, 140, 255, 0.24);
  border-color: var(--ai-accent);
  box-shadow: 0 0 16px var(--ai-accent-glow);
  transform: translateY(-1px);
}

/* Telemetry & Navigation Action Button (Technical Cyan — Measured Data) */
.zos-btn-telemetry {
  background: rgba(51, 194, 224, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(51, 194, 224, 0.35);
  font-weight: 600;
}

.zos-btn-telemetry:hover {
  background: rgba(51, 194, 224, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
  transform: translateY(-1px);
}

/* Secondary Button (Glass Surface) */
.zos-btn-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.zos-btn-secondary:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
}

/* Destructive Action Button (Red — Danger) */
.zos-btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 600;
}

.zos-btn-danger:hover {
  background: rgba(239, 68, 68, 0.24);
  box-shadow: 0 0 14px var(--danger-glow);
}

.zos-btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 26px;
  border-radius: var(--radius-xs);
}

.zos-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
  border-radius: var(--radius-xs);
}

.zos-btn-md {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 40px;
  border-radius: var(--radius-sm);
}

.zos-btn-lg {
  padding: 11px 22px;
  font-size: 14.5px;
  min-height: 48px;
  border-radius: var(--radius-md);
}

.zos-btn-xl {
  padding: 14px 28px;
  font-size: 16px;
  min-height: 54px;
  border-radius: var(--radius-md);
}

.zos-btn-block {
  width: 100%;
  display: flex;
}

.zos-btn-pill {
  border-radius: var(--radius-full);
}

.zos-btn-circle {
  border-radius: 50% !important;
}

.zos-btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Soft Fills */
.zos-btn-primary-soft { background: var(--human-soft, rgba(214,175,54,0.14)) !important; color: var(--human-accent, #D6AF36) !important; border: 1px solid rgba(214,175,54,0.3) !important; font-weight: 600; }
.zos-btn-ai-soft { background: var(--system-soft, rgba(142,159,196,0.14)) !important; color: var(--system-accent, #8E9FC4) !important; border: 1px solid rgba(142,159,196,0.3) !important; font-weight: 600; }
.zos-btn-telemetry-soft { background: var(--telemetry-soft, rgba(99,169,194,0.14)) !important; color: var(--telemetry, #63A9C2) !important; border: 1px solid rgba(99,169,194,0.3) !important; font-weight: 600; }
.zos-btn-danger-soft { background: rgba(201,109,112,0.14) !important; color: var(--danger, #C96D70) !important; border: 1px solid rgba(201,109,112,0.3) !important; font-weight: 600; }
.zos-btn-success-soft { background: rgba(98,167,125,0.14) !important; color: var(--success, #62A77D) !important; border: 1px solid rgba(98,167,125,0.3) !important; font-weight: 600; }
.zos-btn-warning-soft { background: rgba(199,154,50,0.14) !important; color: var(--warning, #C79A32) !important; border: 1px solid rgba(199,154,50,0.3) !important; font-weight: 600; }

/* Outlines */
.zos-btn-outline-gold { background: transparent !important; color: var(--human-accent, #D6AF36) !important; border: 1px solid var(--human-accent, #D6AF36) !important; font-weight: 600; }
.zos-btn-outline-ai { background: transparent !important; color: var(--system-accent, #8E9FC4) !important; border: 1px solid var(--system-accent, #8E9FC4) !important; font-weight: 600; }
.zos-btn-outline-telemetry { background: transparent !important; color: var(--telemetry, #63A9C2) !important; border: 1px solid var(--telemetry, #63A9C2) !important; font-weight: 600; }
.zos-btn-outline-danger { background: transparent !important; color: var(--danger, #C96D70) !important; border: 1px solid var(--danger, #C96D70) !important; font-weight: 600; }
.zos-btn-outline-success { background: transparent !important; color: var(--success, #62A77D) !important; border: 1px solid var(--success, #62A77D) !important; font-weight: 600; }
.zos-btn-outline-slate { background: transparent !important; color: var(--text-secondary) !important; border: 1px solid var(--border-strong) !important; font-weight: 500; }

/* Ghosts */
.zos-btn-ghost { background: transparent !important; color: var(--text-secondary) !important; border-color: transparent !important; }
.zos-btn-ghost:hover { background: var(--surface-elevated) !important; color: var(--text-primary) !important; }
.zos-btn-ghost-gold { background: transparent !important; color: var(--human-accent, #D6AF36) !important; border-color: transparent !important; }
.zos-btn-ghost-gold:hover { background: var(--human-soft, rgba(214,175,54,0.14)) !important; }

/* Pulse animations */
.zos-btn-ai-pulse {
  position: relative;
}
.zos-btn-ai-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1.5px solid var(--system-accent, #8E9FC4);
  animation: zos-pulse 2s infinite ease-out;
  pointer-events: none;
}
@keyframes zos-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* ── 8. Badge & Pill System (Origin Taxonomy) ─────────────────────────────── */
.zos-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* User Authority Badge (Amber) */
.badge-user,
.badge-gold {
  background: rgba(250, 196, 11, 0.14);
  color: var(--warning-alt);
  border: 1px solid rgba(250, 196, 11, 0.35);
}

/* AI-Originated Badge (Electric Violet) */
.badge-ai,
.badge-violet {
  background: rgba(156, 140, 255, 0.14);
  color: var(--ai-accent);
  border: 1px solid rgba(156, 140, 255, 0.35);
}

/* Measured Telemetry Badge (Technical Cyan) */
.badge-telemetry,
.badge-cyan,
.badge-info {
  background: rgba(51, 194, 224, 0.14);
  color: var(--accent-cyan);
  border: 1px solid rgba(51, 194, 224, 0.35);
}

/* Operational Status Badges */
.badge-live {
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success,
.badge-active {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
  background: rgba(250, 196, 11, 0.14);
  color: var(--warning-alt);
  border: 1px solid rgba(250, 196, 11, 0.3);
}

.badge-danger,
.badge-suspended,
.badge-failed {
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-neutral {
  background: var(--surface-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ── 9. Forms, Inputs & Toggles ────────────────────────────────────────────── */
.zos-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.zos-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.zos-input,
.zos-select,
.zos-textarea {
  background: var(--surface-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

.zos-input:focus,
.zos-select:focus,
.zos-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.zos-input::placeholder,
.zos-textarea::placeholder {
  color: var(--text-muted);
}

/* Toggle Switch */
.zos-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
}

.zos-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.zos-toggle-slider {
  width: 38px;
  height: 22px;
  background: var(--border-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-fast);
}

.zos-toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.zos-toggle input:checked + .zos-toggle-slider {
  background: var(--human-accent, #D6AF36);
  border-color: var(--human-accent, #D6AF36);
}

.zos-toggle input:checked + .zos-toggle-slider::before {
  transform: translateX(16px);
  background: #07111F;
}

/* Toggle Switch Sizing */
.zos-toggle-sm .zos-toggle-slider { width: 28px; height: 16px; }
.zos-toggle-sm .zos-toggle-slider::before { width: 10px; height: 10px; left: 2px; top: 2px; }
.zos-toggle-sm input:checked + .zos-toggle-slider::before { transform: translateX(12px); }

.zos-toggle-lg .zos-toggle-slider { width: 48px; height: 28px; }
.zos-toggle-lg .zos-toggle-slider::before { width: 20px; height: 20px; left: 3px; top: 3px; }
.zos-toggle-lg input:checked + .zos-toggle-slider::before { transform: translateX(20px); }

/* Semantic Toggle Variant Colors */
.zos-toggle-gold input:checked + .zos-toggle-slider { background: var(--human-accent, #D6AF36); border-color: var(--human-accent, #D6AF36); }
.zos-toggle-ai input:checked + .zos-toggle-slider { background: var(--system-accent, #8E9FC4); border-color: var(--system-accent, #8E9FC4); }
.zos-toggle-telemetry input:checked + .zos-toggle-slider { background: var(--telemetry, #63A9C2); border-color: var(--telemetry, #63A9C2); }
.zos-toggle-success input:checked + .zos-toggle-slider { background: var(--success, #62A77D); border-color: var(--success, #62A77D); }
.zos-toggle-danger input:checked + .zos-toggle-slider { background: var(--danger, #C96D70); border-color: var(--danger, #C96D70); }
.zos-toggle-warning input:checked + .zos-toggle-slider { background: var(--warning, #C79A32); border-color: var(--warning, #C79A32); }

.zos-toggle input:disabled + .zos-toggle-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Search Palette Box */
.zos-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.zos-search-box:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.zos-search-box kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ── 10. Data Tables ──────────────────────────────────────────────────────── */
.zos-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-card);
  backdrop-filter: blur(20px);
}

.zos-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.zos-table th {
  background: var(--surface-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.zos-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.zos-table tr:last-child td {
  border-bottom: none;
}

.zos-table tr:hover td {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

.zos-td-mono {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.zos-td-num {
  text-align: right;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* ── 11. Autonomous Indicators ────────────────────────────────────────────── */
.zos-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
  animation: zosLivePulse 2s infinite ease-in-out;
}

.zos-live-dot.dot-ai {
  background: var(--ai-accent);
  box-shadow: 0 0 8px var(--ai-accent);
}

.zos-live-dot.dot-cyan {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

@keyframes zosLivePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Agent Presence Ring Indicator (§8) */
.zos-agent-indicator-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zos-agent-dot-core {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--ai-accent);
  color: var(--ai-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 2;
}

.zos-agent-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ai-accent);
  opacity: 0.4;
  animation: zosAgentPulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes zosAgentPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ── 12. Modal Dialogs & Drawers (WCAG 2.2 AA Compliant) ──────────────────── */
.zos-modal-overlay,
.zos-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.zos-modal-overlay.open,
.zos-drawer-overlay.open {
  display: flex;
}

.zos-modal {
  background: var(--surface-elevated);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  width: 90%;
  max-width: 540px;
  overflow: hidden;
  animation: zosModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.zos-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 440px;
  background: var(--surface-elevated);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-overlay);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  animation: zosDrawerIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zosModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes zosDrawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.zos-modal-head,
.zos-drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zos-modal-head h3,
.zos-drawer-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.zos-modal-body,
.zos-drawer-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

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


/* ── 13. Universal Component Aliases for Modular Views ─────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-card-hover);
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
  background: rgba(250, 196, 11, 0.12);
  color: var(--brand-amber);
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}

.chg {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
}

.chg.up { color: var(--success); }
.chg.down { color: var(--danger); }
.chg-note { color: var(--text-muted); font-size: 11px; }

.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.card-pad { padding: 20px; }
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card-body { padding: 20px; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  backdrop-filter: blur(20px);
}

.tabs button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition-fast);
}

.tabs button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .tabs button:hover {
  background: rgba(14, 23, 42, 0.06);
}

.tabs button.active {
  background: var(--brand-amber);
  color: var(--brand-ink);
  font-weight: 700;
}

.tab-page { display: none; }
.tab-page.active { display: block; }

.toolbar {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  backdrop-filter: blur(20px);
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface-input);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.search-box input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--brand-amber);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface-input);
  color: var(--text-primary);
  outline: none;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.page-head p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 4px 0 0;
}

.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-btn {
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--brand-amber);
  color: var(--brand-ink);
  border-color: var(--brand-amber);
  font-weight: 700;
}

.btn-primary:hover {
  background: #e5b30a;
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
}

.btn-sm,
.btn-small {
  padding: 5px 10px;
  font-size: 11.5px;
}

.seg-chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface-card);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.seg-chip:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

.seg-chip.active {
  background: var(--brand-amber) !important;
  color: var(--brand-ink) !important;
  border-color: var(--brand-amber) !important;
  font-weight: 700 !important;
}

.seg-chip .cnt {
  font-size: 11px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.1);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.seg-chip.active .cnt {
  background: rgba(14, 23, 42, 0.15);
  color: var(--brand-ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-success { background: rgba(34, 197, 94, 0.15) !important; color: var(--success) !important; border: 1px solid rgba(34, 197, 94, 0.3) !important; }
.badge-warning { background: rgba(250, 196, 11, 0.15) !important; color: var(--brand-amber) !important; border: 1px solid rgba(250, 196, 11, 0.3) !important; }
.badge-info    { background: rgba(0, 240, 255, 0.15) !important; color: var(--accent-cyan) !important; border: 1px solid rgba(0, 240, 255, 0.3) !important; }
.badge-danger  { background: rgba(239, 68, 68, 0.15) !important; color: var(--danger) !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }
.badge-pending { background: rgba(250, 196, 11, 0.12) !important; color: var(--brand-amber) !important; border: 1px solid rgba(250, 196, 11, 0.25) !important; }
.badge-paid    { background: rgba(34, 197, 94, 0.15) !important; color: var(--success) !important; border: 1px solid rgba(34, 197, 94, 0.3) !important; }
.badge-cod     { background: rgba(239, 68, 68, 0.12) !important; color: var(--danger) !important; border: 1px solid rgba(239, 68, 68, 0.25) !important; }

.stat-card {
  background: var(--surface-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.order-id {
  font-weight: 700;
  color: var(--brand-amber);
  font-family: var(--font-heading);
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

/* ── 14. Scoped Overflow Containers & Touch Scrolling Architecture ─────────── */
.table-wrap,
.zos-table-wrap,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  position: relative;
  scrollbar-width: thin;
}

.table-wrap table,
.zos-table-wrap table,
.table-responsive table {
  min-width: 600px;
}

.segments,
.spec-nav-bar,
.tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}
.segments::-webkit-scrollbar,
.spec-nav-bar::-webkit-scrollbar,
.tabs::-webkit-scrollbar {
  display: none;
}

/* ── 15. Global Mobile Responsive Standards (§23, §26, §28 Invariants) ─────── */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --touch-target-min: 44px;
}

  /* 1. Universal 16px Font-Size to prevent iOS Auto-Zoom */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .zos-input, .zos-select, .zos-textarea,
  .form-control, .search-box input,
  .toolbar select, .toolbar input {
    font-size: 16px !important;
    min-height: 44px;
    box-sizing: border-box;
  }
  input[type="checkbox"], input[type="radio"] {
    min-height: auto;
    width: 18px;
    height: 18px;
    cursor: pointer;
  }

  /* 2. Fluid Container & Padding */
  .container,
  .spec-shell,
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 14px calc(24px + var(--safe-bottom)) !important;
    box-sizing: border-box !important;
  }

  /* 3. Page Header Fluid Stacking */
  .page-head,
  .spec-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }

  .head-actions,
  .spec-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 8px !important;
  }

  .head-actions .btn,
  .spec-actions .zos-btn,
  .head-actions .icon-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  /* 4. Minimum 44px Touch Targets */
  .btn,
  .zos-btn,
  .seg-chip,
  .spec-nav-pill,
  .tabs button,
  .pager button,
  .icon-btn {
    min-height: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 5. Fluid KPI Grids */
  .kpi-grid,
  .stats-row,
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  .kpi,
  .stat-card {
    padding: 14px !important;
  }

  .kpi-value,
  .stat-value {
    font-size: 20px !important;
  }

  /* 6. Form Sections & Toolbars Full Width */
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .search-box {
    width: 100% !important;
    min-width: 100% !important;
  }

  .toolbar select,
  .toolbar button,
  .toolbar .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  .search-section,
  .filter-section,
  .form-grid-2,
  .inquiry-grid,
  .taxonomy-matrix {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* 7. Modal & Drawer Mobile Adaptation */
  .zos-modal,
  .modal-content {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    margin: 12px !important;
    max-height: 92vh !important;
    border-radius: var(--radius-md) !important;
  }

  .drawer,
  .zos-drawer {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .stats-row {
    grid-template-columns: 1fr !important;
  }

  .head-actions,
  .spec-actions {
    grid-template-columns: 1fr !important;
  }

  .page-head h1,
  .spec-title-text h1 {
    font-size: 20px !important;
  }
}

/* ── 16. Baymard-Inspired UX Standards & Interactive Architecture ──────────── */

/* 16.1 Baymard Form UX: Inline Help & Feedback */
.zos-input-help {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.zos-input-error-msg {
  font-size: 11.5px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 16.2 Baymard 1-Click Copy with Animated Tooltip */
.zos-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.zos-copy-btn:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.zos-copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-color: var(--success);
}

/* 16.3 Baymard Sticky Table Header */
.zos-table th,
.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-input);
}

/* 16.4 Baymard Zero-Results & Empty State Recovery */
.empty-state,
.zos-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin: 18px 0;
}

.empty-state i,
.zos-empty-state-icon {
  font-size: 36px;
  color: var(--brand-amber);
  margin-bottom: 12px;
  display: block;
}

.empty-state p,
.zos-empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 16px;
}

.empty-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 16.5 Baymard Skeleton Shimmer Placeholders */
.zos-skeleton {
  background: rgba(255, 255, 255, 0.06);
  background-size: 200% 100%;
  animation: zosShimmer 1.8s infinite ease-in-out;
  border-radius: var(--radius-xs);
}

html[data-theme="light"] .zos-skeleton {
  background: rgba(14, 23, 42, 0.06);
  background-size: 200% 100%;
}

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

.zos-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.zos-skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 12px;
}

.zos-skeleton-card {
  height: 100px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}

/* 16.6 Baymard Sticky Mobile Action Bar */
.zos-sticky-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 100;
}

/* 16.7 Mobile Responsive Foundation & iOS Touch Safety */
@media (max-width: 768px) {
  input, select, textarea, .zos-input, .zos-select {
    font-size: 16px !important;
  }
  .zos-btn, button.btn, .icon-btn, .spec-btn-action {
    min-height: 44px;
  }
  .zos-table-shell, .table-wrap, .pos-table-shell, .q-table-shell, .spec-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
}





