/* ==========================================================================
   AI AUTOMATION COMMAND CENTER - STYLESHEET
   Sci-Fi Mission Control / Cyber Dark HUD Theme
   ========================================================================== */

:root {
    /* ==========================================================================
       OPSFLOW CLOUD - ENTERPRISE SLATE & OBSIDIAN DARK DESIGN SYSTEM
       High-end Linear/Stripe/Datadog inspired theme with refined glassmorphism
       ========================================================================== */
    --bg-base: #080c14;
    --bg-dark: #080c14;
    --bg-sidebar: #0b1120;
    --bg-panel: #0d1527;
    --bg-card: #111a2e;
    --bg-card-hover: #16223b;
    --bg-input: #0b1120;
    --bg-topbar: rgba(11, 17, 32, 0.85);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-highlight: rgba(59, 130, 246, 0.35);

    /* Refined Semantic Accents */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.2);

    --cyan-glow: #06b6d4;
    --cyan-dim: rgba(6, 182, 212, 0.15);
    --emerald-glow: #10b981;
    --emerald-dim: rgba(16, 185, 129, 0.15);
    --amber-glow: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.15);
    --red-glow: #f43f5e;
    --red-dim: rgba(244, 63, 94, 0.15);
    --purple-glow: #8b5cf6;
    --purple-dim: rgba(139, 92, 246, 0.15);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-glow: #ffffff;

    /* Modular Typography Scale (Phase 1) */
    --text-2xs: 0.6875rem; /* 11px */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.875rem; /* 14px */
    --text-md: 1rem;       /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */

    /* 8pt / 4pt Spacing Scale (Phase 1) */
    --space-0-5: 2px;
    --space-1: 4px;
    --space-1-5: 6px;
    --space-2: 8px;
    --space-2-5: 10px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-card: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.12);
}

/* ==========================================================================
   LIGHT MODE PALETTE (when root <html> lacks .dark or has .light)
   Crisp high-contrast enterprise theme (bg-slate-50 / bg-white / text-slate-900)
   ========================================================================== */
html:not(.dark), html.light {
    --bg-base: #f8fafc;
    --bg-dark: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-panel: #ffffff;
    --bg-card: #f1f5f9;
    --bg-card-hover: #e2e8f0;
    --bg-input: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.95);

    --border-color: #cbd5e1;
    --border-subtle: #e2e8f0;
    --border-highlight: rgba(37, 99, 235, 0.45);

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --cyan-glow: #0284c7;
    --cyan-dim: rgba(2, 132, 199, 0.12);
    --emerald-glow: #047857;
    --emerald-dim: rgba(4, 120, 87, 0.12);
    --amber-glow: #b45309;
    --amber-dim: rgba(180, 83, 9, 0.12);
    --red-glow: #be123c;
    --red-dim: rgba(190, 18, 60, 0.12);
    --purple-glow: #6d28d9;
    --purple-dim: rgba(109, 40, 217, 0.12);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;
    --text-dim: #64748b;
    --text-glow: #020617;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);
}

html:not(.dark) body.command-center-body, html.light body.command-center-body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(124, 58, 237, 0.04) 0%, transparent 40%),
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

html:not(.dark) .hud-modal, html.light .hud-modal,
html:not(.dark) .command-palette-card, html.light .command-palette-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html:not(.dark) .command-palette-input, html.light .command-palette-input {
    color: #0f172a !important;
}

html:not(.dark) .palette-item.selected, html.light .palette-item.selected {
    background: #f1f5f9 !important;
}

html:not(.dark) .hud-input, html.light .hud-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .hud-table th, html.light .hud-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #e2e8f0 !important;
}

html:not(.dark) .hud-table td, html.light .hud-table td {
    border-bottom-color: #f1f5f9 !important;
    color: #1e293b !important;
}

html:not(.dark) .hud-btn.outline, html.light .hud-btn.outline {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .hud-btn.outline:hover, html.light .hud-btn.outline:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

html:not(.dark) .topbar-search-bar, html.light .topbar-search-bar {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .subtle-status-pill, html.light .subtle-status-pill {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .account-dropdown-menu, html.light .account-dropdown-menu {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   LIGHT MODE: KPI & METRIC CARDS
   ========================================================================== */
html:not(.dark) .metric-card, html.light .metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

html:not(.dark) .metric-card:hover, html.light .metric-card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) .metric-val, html.light .metric-val {
    color: #0f172a !important;
}

html:not(.dark) .metric-title, html.light .metric-title {
    color: #475569 !important;
}

html:not(.dark) .metric-sub, html.light .metric-sub {
    color: #64748b !important;
}

html:not(.dark) .metric-badge, html.light .metric-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .metric-card.cyan, html.light .metric-card.cyan { border-top-color: #0284c7 !important; }
html:not(.dark) .metric-card.emerald, html.light .metric-card.emerald { border-top-color: #059669 !important; }
html:not(.dark) .metric-card.amber, html.light .metric-card.amber,
html:not(.dark) .metric-card.gold, html.light .metric-card.gold { border-top-color: #d97706 !important; }
html:not(.dark) .metric-card.purple, html.light .metric-card.purple { border-top-color: #7c3aed !important; }
html:not(.dark) .metric-card.red, html.light .metric-card.red,
html:not(.dark) .metric-card.rose, html.light .metric-card.rose { border-top-color: #e11d48 !important; }
html:not(.dark) .metric-card.blue, html.light .metric-card.blue { border-top-color: #2563eb !important; }

html:not(.dark) .metric-delta.up, html.light .metric-delta.up {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
}

html:not(.dark) .metric-delta.down, html.light .metric-delta.down {
    color: #b91c1c !important;
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

html:not(.dark) .metric-delta.neutral, html.light .metric-delta.neutral {
    color: #475569 !important;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

html:not(.dark) .action-overflow-menu, html.light .action-overflow-menu {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}
html:not(.dark) .action-overflow-menu .overflow-item, html.light .action-overflow-menu .overflow-item {
    color: #334155 !important;
}
html:not(.dark) .action-overflow-menu .overflow-item:hover, html.light .action-overflow-menu .overflow-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html:not(.dark) .action-overflow-menu .overflow-divider, html.light .action-overflow-menu .overflow-divider {
    background: #e2e8f0 !important;
}
html:not(.dark) .action-overflow-btn, html.light .action-overflow-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html:not(.dark) .action-overflow-btn:hover, html.light .action-overflow-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* ==========================================================================
   LIGHT MODE: SIDEBAR NAVIGATION AREA
   ========================================================================== */
html:not(.dark) .enterprise-sidebar, html.light .enterprise-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.04) !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-brand, html.light .enterprise-sidebar .sidebar-brand {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html:not(.dark) .enterprise-sidebar .brand-title, html.light .enterprise-sidebar .brand-title {
    color: #0f172a !important;
}

html:not(.dark) .enterprise-sidebar .brand-badge-cloud, html.light .enterprise-sidebar .brand-badge-cloud {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-workspace-card, html.light .enterprise-sidebar .sidebar-workspace-card {
    border-bottom: 1px solid #e2e8f0 !important;
}

html:not(.dark) .enterprise-sidebar .workspace-card-inner, html.light .enterprise-sidebar .workspace-card-inner {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .enterprise-sidebar .workspace-select, html.light .enterprise-sidebar .workspace-select {
    color: #0f172a !important;
}

html:not(.dark) .enterprise-sidebar .workspace-select option, html.light .enterprise-sidebar .workspace-select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-search-btn, html.light .enterprise-sidebar .sidebar-search-btn {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-search-btn:hover, html.light .enterprise-sidebar .sidebar-search-btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-search-btn .search-text, html.light .enterprise-sidebar .sidebar-search-btn .search-text {
    color: #64748b !important;
}

html:not(.dark) .enterprise-sidebar .sidebar-search-btn .search-kbd, html.light .enterprise-sidebar .sidebar-search-btn .search-kbd {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .sidebar-nav, html.light .sidebar-nav,
html:not(.dark) .enterprise-sidebar .sidebar-nav, html.light .enterprise-sidebar .sidebar-nav,
html:not(.dark) .sidebar-nav.hud-tabs, html.light .sidebar-nav.hud-tabs {
    background: #ffffff !important;
    border: none !important;
}

html:not(.dark) .nav-category-header, html.light .nav-category-header {
    color: #94a3b8 !important;
}

html:not(.dark) .enterprise-sidebar .hud-tab, html.light .enterprise-sidebar .hud-tab {
    color: #475569 !important;
    background: transparent !important;
}

html:not(.dark) .enterprise-sidebar .hud-tab:hover, html.light .enterprise-sidebar .hud-tab:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

html:not(.dark) .enterprise-sidebar .hud-tab.active, html.light .enterprise-sidebar .hud-tab.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-left: 3px solid #2563eb !important;
    font-weight: 600 !important;
}

html:not(.dark) .enterprise-sidebar .nav-counter-pill, html.light .enterprise-sidebar .nav-counter-pill {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

html:not(.dark) .sidebar-footer, html.light .sidebar-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

html:not(.dark) .sidebar-toggle-btn, html.light .sidebar-toggle-btn {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

html:not(.dark) .sidebar-toggle-btn:hover, html.light .sidebar-toggle-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* ==========================================================================
   LIGHT MODE: TELEMETRY, PANELS, WIDGETS & FOOTER
   ========================================================================== */
html:not(.dark) .hud-panel, html.light .hud-panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

html:not(.dark) .panel-header, html.light .panel-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html:not(.dark) .panel-title, html.light .panel-title {
    color: #0f172a !important;
}

html:not(.dark) .telemetry-widget-panel, html.light .telemetry-widget-panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .telemetry-gauge-card, html.light .telemetry-gauge-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .telemetry-gauge-card .gauge-val, html.light .telemetry-gauge-card .gauge-val {
    color: #0f172a !important;
}

html:not(.dark) .progress-track, html.light .progress-track,
html:not(.dark) .telemetry-gauge-card .progress-track, html.light .telemetry-gauge-card .progress-track {
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .op-status-strip, html.light .op-status-strip {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .workflow-studio-header, html.light .workflow-studio-header {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .app-global-footer, html.light .app-global-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

html:not(.dark) .app-global-footer .creator-mark, html.light .app-global-footer .creator-mark {
    color: #64748b !important;
}

/* Light Mode: Enterprise Topbar */
html:not(.dark) .enterprise-topbar, html.light .enterprise-topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

html:not(.dark) .topbar-brand-title, html.light .topbar-brand-title {
    color: #0f172a !important;
}

html:not(.dark) .breadcrumb-current, html.light .breadcrumb-current {
    color: #0f172a !important;
}

html:not(.dark) .account-menu-trigger, html.light .account-menu-trigger {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .account-menu-trigger:hover, html.light .account-menu-trigger:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .user-trigger-info .user-name, html.light .user-trigger-info .user-name {
    color: #0f172a !important;
}

html:not(.dark) .table-container, html.light .table-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .incident-card, html.light .incident-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html:not(.dark) .workflow-table .trigger-code-pill, html.light .workflow-table .trigger-code-pill {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0284c7 !important;
}

html:not(.dark) .workflow-table .wf-name-text, html.light .workflow-table .wf-name-text {
    color: #0f172a !important;
}

/* ==========================================================================
   PHASE 1: LIGHT MODE WCAG CONTRAST ENHANCEMENTS FOR BADGES & CHIPS
   Guarantees WCAG AA/AAA compliance (> 4.5:1 ratio) on light backgrounds
   ========================================================================== */
html:not(.dark) .status-badge.success, html.light .status-badge.success,
html:not(.dark) .sim-status-pill.matched, html.light .sim-status-pill.matched {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

html:not(.dark) .status-badge.failed, html.light .status-badge.failed,
html:not(.dark) .sim-status-pill.skipped, html.light .sim-status-pill.skipped {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

html:not(.dark) .status-badge.skipped, html.light .status-badge.skipped,
html:not(.dark) .rule-priority-tag, html.light .rule-priority-tag {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .filter-pill, html.light .filter-pill {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .filter-pill:hover, html.light .filter-pill:hover,
html:not(.dark) .filter-pill.active, html.light .filter-pill.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

html:not(.dark) .role-badge, html.light .role-badge {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .prompt-chip, html.light .prompt-chip {
    background: #f8fafc !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .prompt-chip:hover, html.light .prompt-chip:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

html:not(.dark) .entity-tag, html.light .entity-tag {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .rule-category-badge, html.light .rule-category-badge {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

html:not(.dark) .panel-badge, html.light .panel-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

html:not(.dark) .live-pill, html.light .live-pill {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

/* Status Pills (Light Mode Contrast) */
html:not(.dark) .status-pill.green, html.light .status-pill.green,
html:not(.dark) .status-pill.active, html.light .status-pill.active,
html:not(.dark) .status-pill.healthy, html.light .status-pill.healthy {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

html:not(.dark) .status-pill.blue, html.light .status-pill.blue,
html:not(.dark) .status-pill.simulation, html.light .status-pill.simulation {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

html:not(.dark) .status-pill.cyan, html.light .status-pill.cyan,
html:not(.dark) .status-pill.running, html.light .status-pill.running {
    background: #f0fdfa !important;
    color: #0f766e !important;
    border: 1px solid #99f6e4 !important;
}

html:not(.dark) .status-pill.yellow, html.light .status-pill.yellow,
html:not(.dark) .status-pill.amber, html.light .status-pill.amber,
html:not(.dark) .status-pill.warning, html.light .status-pill.warning {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

html:not(.dark) .status-pill.red, html.light .status-pill.red,
html:not(.dark) .status-pill.failed, html.light .status-pill.failed,
html:not(.dark) .status-pill.error, html.light .status-pill.error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

html:not(.dark) .status-pill.purple, html.light .status-pill.purple {
    background: #faf5ff !important;
    color: #6d28d9 !important;
    border: 1px solid #e9d5ff !important;
}

html:not(.dark) .status-pill.dim, html.light .status-pill.dim,
html:not(.dark) .status-pill.paused, html.light .status-pill.paused,
html:not(.dark) .status-pill.inactive, html.light .status-pill.inactive,
html:not(.dark) .status-pill.disconnected, html.light .status-pill.disconnected {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Workflow Studio Graph (Light Mode Contrast) */
html:not(.dark) .wf-canvas-viewport, html.light .wf-canvas-viewport {
    background-color: #f8fafc !important;
    background-image: radial-gradient(circle, rgba(37, 99, 235, 0.1) 1px, transparent 1px) !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .wf-graph-node, html.light .wf-graph-node {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) .wf-graph-node:hover, html.light .wf-graph-node:hover {
    border-color: #94a3b8 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
}

html:not(.dark) .wf-graph-node .wf-node-desc, html.light .wf-graph-node .wf-node-desc {
    color: #475569 !important;
}

html:not(.dark) .wf-graph-node.trigger, html.light .wf-graph-node.trigger {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.trigger .node-type-pill, html.light .wf-graph-node.trigger .node-type-pill {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

html:not(.dark) .wf-graph-node.condition, html.light .wf-graph-node.condition,
html:not(.dark) .wf-graph-node.urgency_detection, html.light .wf-graph-node.urgency_detection {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.condition .node-type-pill, html.light .wf-graph-node.condition .node-type-pill,
html:not(.dark) .wf-graph-node.urgency_detection .node-type-pill, html.light .wf-graph-node.urgency_detection .node-type-pill {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

html:not(.dark) .wf-graph-node.ai_analysis, html.light .wf-graph-node.ai_analysis,
html:not(.dark) .wf-graph-node.ai_generate, html.light .wf-graph-node.ai_generate,
html:not(.dark) .wf-graph-node.ai_summarize, html.light .wf-graph-node.ai_summarize,
html:not(.dark) .wf-graph-node.ai_classify, html.light .wf-graph-node.ai_classify {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.ai_analysis .node-type-pill, html.light .wf-graph-node.ai_analysis .node-type-pill,
html:not(.dark) .wf-graph-node.ai_generate .node-type-pill, html.light .wf-graph-node.ai_generate .node-type-pill,
html:not(.dark) .wf-graph-node.ai_summarize .node-type-pill, html.light .wf-graph-node.ai_summarize .node-type-pill,
html:not(.dark) .wf-graph-node.ai_classify .node-type-pill, html.light .wf-graph-node.ai_classify .node-type-pill {
    background: #faf5ff !important;
    color: #6d28d9 !important;
    border: 1px solid #e9d5ff !important;
}

html:not(.dark) .wf-graph-node.approval, html.light .wf-graph-node.approval {
    background: linear-gradient(180deg, rgba(225, 29, 72, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.approval .node-type-pill, html.light .wf-graph-node.approval .node-type-pill {
    background: #fff1f2 !important;
    color: #be123c !important;
    border: 1px solid #fecdd3 !important;
}

html:not(.dark) .wf-graph-node.action, html.light .wf-graph-node.action,
html:not(.dark) .wf-graph-node.notification, html.light .wf-graph-node.notification,
html:not(.dark) .wf-graph-node.webhook_call, html.light .wf-graph-node.webhook_call,
html:not(.dark) .wf-graph-node.database_record, html.light .wf-graph-node.database_record,
html:not(.dark) .wf-graph-node.email_draft, html.light .wf-graph-node.email_draft,
html:not(.dark) .wf-graph-node.route, html.light .wf-graph-node.route,
html:not(.dark) .wf-graph-node.lead_scoring, html.light .wf-graph-node.lead_scoring {
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.action .node-type-pill, html.light .wf-graph-node.action .node-type-pill,
html:not(.dark) .wf-graph-node.notification .node-type-pill, html.light .wf-graph-node.notification .node-type-pill,
html:not(.dark) .wf-graph-node.webhook_call .node-type-pill, html.light .wf-graph-node.webhook_call .node-type-pill,
html:not(.dark) .wf-graph-node.database_record .node-type-pill, html.light .wf-graph-node.database_record .node-type-pill,
html:not(.dark) .wf-graph-node.email_draft .node-type-pill, html.light .wf-graph-node.email_draft .node-type-pill,
html:not(.dark) .wf-graph-node.route .node-type-pill, html.light .wf-graph-node.route .node-type-pill,
html:not(.dark) .wf-graph-node.lead_scoring .node-type-pill, html.light .wf-graph-node.lead_scoring .node-type-pill {
    background: #f0fdfa !important;
    color: #0f766e !important;
    border: 1px solid #99f6e4 !important;
}

html:not(.dark) .wf-graph-node.end, html.light .wf-graph-node.end,
html:not(.dark) .wf-graph-node.outcome, html.light .wf-graph-node.outcome {
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.06) 0%, #ffffff 40%) !important;
}

html:not(.dark) .wf-graph-node.end .node-type-pill, html.light .wf-graph-node.end .node-type-pill,
html:not(.dark) .wf-graph-node.outcome .node-type-pill, html.light .wf-graph-node.outcome .node-type-pill {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

/* Light Mode Workflow Studio Polish */
html:not(.dark) .view-switcher-group, html.light .view-switcher-group {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html:not(.dark) .view-switch-btn:hover, html.light .view-switch-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
html:not(.dark) .wf-graph-toolbar, html.light .wf-graph-toolbar {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}
html:not(.dark) .wf-rule-select, html.light .wf-rule-select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html:not(.dark) .wf-toolbar-label, html.light .wf-toolbar-label {
    color: #334155 !important;
}
html:not(.dark) .wf-zoom-group, html.light .wf-zoom-group {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html:not(.dark) .wf-ctrl-btn, html.light .wf-ctrl-btn {
    color: #475569 !important;
}
html:not(.dark) .wf-ctrl-btn:hover, html.light .wf-ctrl-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
html:not(.dark) .wf-zoom-badge, html.light .wf-zoom-badge {
    color: #0284c7 !important;
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    border-radius: 4px;
}
html:not(.dark) .wf-graph-legend, html.light .wf-graph-legend {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}
html:not(.dark) .wf-canvas-helper-hint, html.light .wf-canvas-helper-hint {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}
html:not(.dark) .wf-graph-node .wf-node-title, html.light .wf-graph-node .wf-node-title {
    color: #0f172a !important;
}
html:not(.dark) .wf-node-port, html.light .wf-node-port {
    border-color: #ffffff !important;
    background: #0284c7 !important;
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.5) !important;
}
html:not(.dark) .wf-connector-path, html.light .wf-connector-path {
    stroke: #0284c7 !important;
}
html:not(.dark) .wf-connector-path:hover, html.light .wf-connector-path:hover {
    stroke: #0369a1 !important;
}
html:not(.dark) #wfGraphStepsPill, html.light #wfGraphStepsPill {
    background: #f0f9ff !important;
    color: #0284c7 !important;
    border-color: #bae6fd !important;
}

/* Light Mode Mini-Map & Empty State */
html:not(.dark) .wf-minimap-container, html.light .wf-minimap-container {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}
html:not(.dark) .wf-minimap-container #wfMinimapWrapper, html.light .wf-minimap-container #wfMinimapWrapper {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html:not(.dark) #wfMinimapViewportRect, html.light #wfMinimapViewportRect {
    border-color: #2563eb !important;
    background: rgba(37, 99, 235, 0.12) !important;
}
html:not(.dark) .wf-graph-empty-state, html.light .wf-graph-empty-state {
    background: radial-gradient(circle, rgba(37,99,235,0.04) 1px, transparent 1px), #ffffff !important;
}

/* ==========================================================================
   PHASE 1: ACCESSIBLE FOCUS INDICATORS (WCAG 2.4.7)
   ========================================================================== */
.hud-btn:focus-visible,
.hud-tab:focus-visible,
.sidebar-search-btn:focus-visible,
.plan-pill-btn:focus-visible,
.account-menu-trigger:focus-visible,
.wf-graph-btn:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   PHASE 1: REUSABLE HUD UTILITY & LAYOUT CLASSES
   ========================================================================== */

/* Flexbox Row & Column layouts */
.hud-flex-row {
    display: flex;
    align-items: center;
}

.hud-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hud-flex-col {
    display: flex;
    flex-direction: column;
}

.hud-flex-1 {
    flex: 1;
}

/* Spacing Gap Utilities */
.hud-gap-xs {
    gap: var(--space-1); /* 4px */
}

.hud-gap-sm {
    gap: var(--space-2); /* 8px */
}

.hud-gap-md {
    gap: var(--space-2-5, 10px); /* 10px */
}

.hud-gap-lg {
    gap: var(--space-4); /* 16px */
}

/* Margin Bottom Utilities */
.hud-mb-xs {
    margin-bottom: var(--space-1); /* 4px */
}

.hud-mb-sm {
    margin-bottom: var(--space-2); /* 8px */
}

.hud-mb-md {
    margin-bottom: var(--space-3); /* 12px */
}

.hud-mb-lg {
    margin-bottom: var(--space-4); /* 16px */
}

.hud-mb-xl {
    margin-bottom: var(--space-6); /* 24px */
}

/* Margin Top Utilities */
.hud-mt-sm {
    margin-top: var(--space-2);
}

.hud-mt-md {
    margin-top: var(--space-3);
}

.hud-mt-lg {
    margin-top: var(--space-4);
}

.hud-mt-xl {
    margin-top: var(--space-6);
}

/* Typography Utilities */
.hud-label {
    font-size: var(--text-xs);
    font-weight: 600;
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-secondary);
}

.hud-subtext {
    font-size: var(--text-2xs);
    color: var(--text-dim);
}

.hud-mono-text {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.hud-code-area {
    width: 100%;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
}

.hud-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: var(--text-2xs);
    font-family: var(--font-mono);
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

html:not(.dark) .hud-badge-pill, html.light .hud-badge-pill {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.hud-card-padding {
    padding: 20px;
}

.hud-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 36px 8px 12px;
    border-radius: 6px;
    font-size: var(--text-sm);
    outline: none;
    width: 100%;
    font-family: var(--font-sans);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hud-textarea {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: var(--text-sm);
    outline: none;
    width: 100%;
    font-family: var(--font-sans);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hud-select:focus,
.hud-textarea:focus {
    border-color: var(--cyan-glow);
}

html:not(.dark) .hud-select, html.light .hud-select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 16px !important;
}

html:not(.dark) .hud-textarea, html.light .hud-textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html:not(.dark) .hud-select option, html.light .hud-select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

.hud-mono-input,
.hud-input.hud-mono-text,
.hud-input.mono {
    font-family: var(--font-mono);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.command-center-body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(178, 75, 243, 0.03) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
}

/* ==========================================================================
   HUD HEADER
   ========================================================================== */

.hud-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-hexagon {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 255, 157, 0.1));
    border: 1px solid var(--cyan-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--cyan-dim);
}

.brand-symbol {
    font-size: 22px;
}

.pulse-ring {
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    border: 1px solid var(--cyan-glow);
    animation: ringPulse 2.5s infinite;
}

@keyframes ringPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 0.2; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cyan-glow);
    text-shadow: 0 0 10px var(--cyan-dim);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.hud-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background: var(--emerald-glow);
    box-shadow: 0 0 8px var(--emerald-glow);
}

.status-dot.yellow, .status-dot.amber {
    background: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.status-dot.red {
    background: var(--red-glow);
    box-shadow: 0 0 8px var(--red-glow);
}

.status-dot.pulse {
    animation: statusBlink 1.5s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.clock-display {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cyan-glow);
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.hud-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 7px 16px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.hud-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.hud-btn.primary {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.05));
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
}

.hud-btn.primary:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 240, 255, 0.15));
    box-shadow: 0 0 15px var(--cyan-dim);
}

.hud-btn.red-btn {
    border-color: var(--red-glow);
    color: var(--red-glow);
}

.hud-btn.red-btn:hover {
    background: var(--red-dim);
}

.hud-btn.outline {
    background: transparent;
}

.hud-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 16px;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--red-glow);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.notif-wrapper {
    position: relative;
}

.notif-drawer {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    width: 340px;
    background: var(--bg-panel);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 200;
}

.notif-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h3 {
    font-size: 14px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.notif-actions button {
    background: none;
    border: none;
    color: var(--cyan-glow);
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.notif-item {
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-card);
    margin-bottom: 8px;
    border-left: 3px solid var(--cyan-glow);
}

.notif-item.critical { border-left-color: var(--red-glow); }
.notif-item.warning { border-left-color: var(--amber-glow); }
.notif-item.success { border-left-color: var(--emerald-glow); }

.notif-item .title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.notif-item .msg { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.notif-item .time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.notif-empty { text-align: center; padding: 20px; font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */

.hud-tabs {
    background: rgba(13, 21, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.hud-tab {
    flex-shrink: 0;
    white-space: nowrap;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 14px 18px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-tab:hover {
    color: var(--text-primary);
}

.hud-tab.active {
    color: var(--cyan-glow);
    border-bottom-color: var(--cyan-glow);
    background: linear-gradient(to top, rgba(0, 240, 255, 0.08), transparent);
}

/* ==========================================================================
   MAIN CONTENT & TABS
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 24px 28px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.tab-panel.active {
    display: block;
}

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

/* ==========================================================================
   METRIC CARDS GRID
   ========================================================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
}

.metric-card.cyan { border-top: 2px solid var(--cyan-glow); }
.metric-card.emerald { border-top: 2px solid var(--emerald-glow); }
.metric-card.amber, .metric-card.gold { border-top: 2px solid var(--amber-glow); }
.metric-card.purple { border-top: 2px solid var(--purple-glow); }
.metric-card.red, .metric-card.rose { border-top: 2px solid var(--red-glow); }
.metric-card.blue, .metric-card.primary { border-top: 2px solid var(--primary); }

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

.metric-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.metric-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-glow);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

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

/* ==========================================================================
   DASHBOARD COLUMNS & PANELS
   ========================================================================== */

.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

.hud-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}

.hud-panel.fill-height {
    height: calc(100% - 24px);
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: rgba(19, 31, 56, 0.5);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--cyan-glow);
}

.live-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--emerald-dim);
    color: var(--emerald-glow);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.panel-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.panel-body {
    padding: 20px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Telemetry Gauges */
.gauge-item {
    margin-bottom: 18px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.gauge-value {
    font-family: var(--font-mono);
    font-weight: 700;
}

.gauge-bar-bg {
    background: rgba(0, 0, 0, 0.4);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gauge-bar-fill {
    height: 100%;
    transition: width 0.5s ease-out;
}

.cyan-fill { background: linear-gradient(90deg, #00b4d8, var(--cyan-glow)); box-shadow: 0 0 10px var(--cyan-dim); }
.emerald-fill { background: linear-gradient(90deg, #059669, var(--emerald-glow)); box-shadow: 0 0 10px var(--emerald-dim); }
.amber-fill { background: linear-gradient(90deg, #d97706, var(--amber-glow)); box-shadow: 0 0 10px var(--amber-dim); }

.system-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.meta-item {
    font-size: 12px;
}

.meta-label { color: var(--text-muted); margin-right: 6px; }
.meta-val { font-family: var(--font-mono); }
.green-text { color: var(--emerald-glow); }

/* Quick Action Buttons */
.quick-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-btn {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.action-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
}

.action-btn.red-btn:hover { border-color: var(--red-glow); background: var(--red-dim); }
.action-btn.amber-btn:hover { border-color: var(--amber-glow); background: var(--amber-dim); }
.action-btn.purple-btn:hover { border-color: var(--purple-glow); background: var(--purple-dim); }
.action-btn.green-btn:hover { border-color: var(--emerald-glow); background: var(--emerald-dim); }

/* Event Activity Stream */
.stream-container {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stream-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    border-left: 3px solid var(--cyan-glow);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.stream-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stream-event-name {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--cyan-glow);
}

.stream-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.stream-details {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    word-break: break-all;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.stream-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   AUTOMATION RULES TAB
   ========================================================================== */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.category-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill:hover, .filter-pill.active {
    background: var(--bg-card-hover);
    color: var(--cyan-glow);
    border-color: var(--cyan-glow);
}

.toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    min-width: 220px;
}

.search-input:focus {
    border-color: var(--cyan-glow);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.rule-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.rule-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.workflow-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.workflow-row:hover {
    background-color: rgba(0, 240, 255, 0.07) !important;
}

.workflow-row:hover td {
    color: var(--text-glow);
}

.rule-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.rule-category-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--cyan-glow);
}

.rule-priority-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--amber-glow);
    background: var(--amber-dim);
    padding: 2px 6px;
    border-radius: 4px;
}

.rule-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    min-height: 38px;
}

.rule-specs {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    margin-bottom: 16px;
}

.rule-spec-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.rule-spec-row:last-child {
    margin-bottom: 0;
}

.rule-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.rule-actions-group {
    display: flex;
    gap: 8px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--emerald-glow); }
input:checked + .slider:before { transform: translateX(18px); }

/* ==========================================================================
   AI NLP SANDBOX
   ========================================================================== */

.nlp-sandbox-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nlp-input-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
}

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

.nlp-input-card h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
}

.local-ai-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--purple-dim);
    color: var(--purple-glow);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(178, 75, 243, 0.3);
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.preset-prompts-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

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

.prompt-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.prompt-chip:hover {
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
}

.nlp-textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 14px;
    font-size: 14px;
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    margin-bottom: 16px;
}

.nlp-textarea:focus {
    border-color: var(--cyan-glow);
    box-shadow: 0 0 10px var(--cyan-dim);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    gap: 8px;
}

/* Results Section */
.nlp-results-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
}

.timing-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--emerald-glow);
}

.nlp-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.nlp-metric-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
}

.nlp-metric-badge .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.nlp-metric-badge .value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-glow);
}

.entities-card, .matched-rules-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.entities-card h4, .matched-rules-card h4 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.entities-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-tag {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--cyan-glow);
    color: var(--cyan-glow);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
}

.matched-rules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matched-rule-row {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.matched-rule-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.eval-trace-steps {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 4px;
    margin-top: 6px;
}

/* ==========================================================================
   EXECUTION LOGS & TABLES
   ========================================================================== */

.table-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow-x: auto;
    position: relative;
}

.table-container.sticky-scroll {
    max-height: 540px;
    overflow-y: auto;
}

.table-container.sticky-scroll .hud-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0b1120;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.hud-table th {
    background: rgba(19, 31, 56, 0.8);
    padding: 14px 18px;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.hud-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(31, 49, 82, 0.5);
    font-family: var(--font-sans);
}

.hud-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.status-badge.success { background: var(--emerald-dim); color: var(--emerald-glow); }
.status-badge.failed { background: var(--red-dim); color: var(--red-glow); }
.status-badge.skipped { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* ==========================================================================
   BLUEPRINTS GALLERY
   ========================================================================== */

.blueprints-intro {
    margin-bottom: 24px;
}

.blueprints-intro h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--cyan-glow);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.blueprints-intro p {
    color: var(--text-secondary);
    font-size: 14px;
}

.blueprints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.blueprint-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.blueprint-card:hover {
    border-color: var(--cyan-glow);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--cyan-dim);
}

.blueprint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.blueprint-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.blueprint-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    min-height: 48px;
}

/* ==========================================================================
   SETTINGS & DIAGNOSTICS
   ========================================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
}

.settings-card h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
    margin-bottom: 8px;
}

.settings-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.settings-btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.file-btn {
    position: relative;
    overflow: hidden;
}

.file-btn input[type="file"] {
    position: absolute;
    top: 0; left: 0; opacity: 0;
    width: 100%; height: 100%;
    cursor: pointer;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-row span:first-child { color: var(--text-muted); }
.spec-row span:last-child { font-family: var(--font-mono); color: var(--text-primary); }

/* ==========================================================================
   MODALS
   ========================================================================== */

.hud-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.hud-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(19, 31, 56, 0.5);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.close-btn:hover { color: var(--text-primary); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(19, 31, 56, 0.5);
}

/* Forms */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.hud-input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    width: 100%;
}

.hud-input:focus {
    border-color: var(--cyan-glow);
}

.form-section-title {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
    margin: 20px 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.conditions-builder-list, .actions-builder-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.builder-row {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.small-btn {
    padding: 4px 10px;
    font-size: 12px;
    margin-bottom: 16px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--red-glow);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: var(--bg-panel);
    border: 1px solid var(--border-highlight);
    border-left: 4px solid var(--cyan-glow);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease-out;
}

.toast.error { border-left-color: var(--red-glow); }
.toast.success { border-left-color: var(--emerald-glow); }

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

/* ==========================================================================
   SYSTEM.METRICS SIMULATOR & TEST HARNESS STYLES
   ========================================================================== */

.sim-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.sim-inputs-grid {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.label-with-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cpu-val-display {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--cyan-glow);
    font-size: 13px;
}

.cpu-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-slider {
    flex: 1;
    accent-color: var(--cyan-glow);
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.cpu-number-input {
    width: 80px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
}

.sim-presets-bar {
    margin-top: 2px;
    margin-bottom: 2px;
}

.sim-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sim-trace-container {
    margin-top: 16px;
    background: rgba(10, 15, 28, 0.95);
    border: 1px solid var(--cyan-glow);
    border-radius: 8px;
    padding: 14px;
    animation: slideIn 0.3s ease-out;
}

.sim-trace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.sim-trace-header h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--cyan-glow);
}

.sim-status-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.sim-status-pill.matched {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-glow);
    border: 1px solid var(--emerald-glow);
}

.sim-status-pill.skipped {
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber-glow);
    border: 1px solid var(--amber-glow);
}

.sim-trace-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sim-trace-rules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-rule-item {
    background: rgba(19, 31, 56, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    transition: var(--transition);
}

.sim-rule-item.matched-highlight {
    border-color: var(--emerald-glow);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.sim-rule-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.sim-rule-trace {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 10px;
    border-radius: 4px;
    margin-top: 6px;
    line-height: 1.5;
}

.trace-pass {
    color: var(--emerald-glow);
    font-weight: 700;
}

.trace-fail {
    color: var(--amber-glow);
    font-weight: 700;
}

.metrics-sim-page-layout {
    max-width: 900px;
    margin: 0 auto;
}



/* ==========================================================================
   ENTERPRISE SAAS EXTENSIONS (RBAC, Multi-Tenancy, Incidents, API Keys)
   ========================================================================== */

/* Workspace Switcher & User Profile */
.workspace-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.workspace-select {
    background: transparent;
    border: none;
    color: var(--cyan-glow);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}
.workspace-select option {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 6px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.role-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.owner, .role-badge.admin {
    background: rgba(178, 75, 243, 0.2);
    color: #d88eff;
    border: 1px solid rgba(178, 75, 243, 0.4);
}

.role-badge.operator {
    background: rgba(0, 240, 255, 0.15);
    color: var(--cyan-glow);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.role-badge.viewer {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Incident Response Center */
.incidents-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.incident-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.incident-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}

.incident-main {
    flex: 1;
}

.incident-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.incident-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.incident-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.severity-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.severity-pill.critical {
    background: rgba(255, 51, 102, 0.2);
    color: var(--red-glow);
    border: 1px solid rgba(255, 51, 102, 0.5);
}

.severity-pill.high {
    background: rgba(255, 184, 0, 0.2);
    color: var(--amber-glow);
    border: 1px solid rgba(255, 184, 0, 0.5);
}

.severity-pill.warning {
    background: rgba(0, 240, 255, 0.15);
    color: var(--cyan-glow);
    border: 1px solid rgba(0, 240, 255, 0.4);
}

.severity-pill.info {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-badge.open {
    background: rgba(255, 51, 102, 0.15);
    color: #ff6b8b;
}
.status-badge.acknowledged {
    background: rgba(255, 184, 0, 0.15);
    color: #ffd166;
}
.status-badge.resolved {
    background: rgba(0, 255, 157, 0.15);
    color: var(--emerald-glow);
}

/* API Key & Inbound Webhooks */
.token-reveal-banner {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--cyan-glow);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.token-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-dark);
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.token-code {
    font-family: var(--font-mono);
    color: var(--cyan-glow);
    font-size: 0.95rem;
    flex: 1;
    word-break: break-all;
}

.curl-snippet {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--emerald-glow);
    overflow-x: auto;
    position: relative;
    margin: 8px 0;
}

.copy-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.copy-btn:hover {
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
}

/* Team Grid */
.team-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.team-table th, .team-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.85rem;
}
.team-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}


/* ==========================================================================
   ENTERPRISE APP SHELL & SIDEBAR NAVIGATION
   ========================================================================== */

body.command-center-body.enterprise-layout {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
}

.enterprise-sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 120;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.enterprise-sidebar.collapsed {
    width: 72px;
    min-width: 72px;
}

.enterprise-sidebar .sidebar-brand {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
    height: 64px;
    background: rgba(0, 0, 0, 0.15);
}

.enterprise-sidebar .brand-hexagon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.enterprise-sidebar .brand-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.enterprise-sidebar.collapsed .brand-meta {
    display: none;
}

.enterprise-sidebar .brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    font-family: var(--font-heading);
    text-shadow: none;
}

.brand-badge-cloud {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--cyan-glow);
    background: var(--cyan-dim);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* Sidebar Workspace Card */
.sidebar-workspace-card {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.enterprise-sidebar.collapsed .sidebar-workspace-card {
    padding: 10px 8px;
}

.workspace-card-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.enterprise-sidebar.collapsed .workspace-card-inner {
    justify-content: center;
    padding: 8px 0;
}

.workspace-avatar {
    font-size: 16px;
    flex-shrink: 0;
}

.workspace-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.enterprise-sidebar.collapsed .workspace-details {
    display: none;
}

.workspace-select {
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.workspace-select option {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.workspace-plan-row {
    display: flex;
    align-items: center;
}

.plan-pill-btn {
    background: var(--purple-dim);
    color: var(--purple-glow);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.plan-pill-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--purple-glow);
}

.plan-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--purple-glow);
    box-shadow: 0 0 6px var(--purple-glow);
}

/* Sidebar Search / Command Palette Trigger Button */
.sidebar-search-btn {
    margin: 10px 12px 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-search-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-highlight);
}

.enterprise-sidebar.collapsed .sidebar-search-btn {
    margin: 10px 8px;
    padding: 8px;
    justify-content: center;
}

.sidebar-search-btn .search-icon {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-search-btn .search-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-muted);
}

.enterprise-sidebar.collapsed .sidebar-search-btn .search-text,
.enterprise-sidebar.collapsed .sidebar-search-btn .search-kbd {
    display: none;
}

.sidebar-search-btn .search-kbd {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Navigation List */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
}

.nav-category-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    padding: 14px 10px 4px;
    text-transform: uppercase;
}

.enterprise-sidebar.collapsed .nav-category-header {
    display: none;
}

.enterprise-sidebar .hud-tab {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    white-space: nowrap;
}

.enterprise-sidebar.collapsed .hud-tab {
    padding: 10px;
    justify-content: center;
}

.enterprise-sidebar.collapsed .tab-label,
.enterprise-sidebar.collapsed .nav-counter-pill {
    display: none;
}

.enterprise-sidebar .hud-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.enterprise-sidebar .hud-tab.active {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    font-weight: 600;
    border-left-color: var(--primary);
}

.nav-counter-pill {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.nav-counter-pill.danger {
    background: var(--red-dim);
    color: var(--red-glow);
}

.nav-counter-pill.success {
    background: var(--emerald-dim);
    color: var(--emerald-glow);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.enterprise-sidebar.collapsed .sidebar-footer {
    padding: 12px 8px;
    justify-content: center;
}

.sidebar-toggle-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 7px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.enterprise-sidebar.collapsed .toggle-label {
    display: none;
}

/* ==========================================================================
   ENTERPRISE MAIN APPLICATION SHELL & TOPBAR
   ========================================================================== */

.enterprise-app-main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-dark);
}

.enterprise-topbar {
    height: 64px;
    padding: 0 24px;
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-sans);
}

.breadcrumb-corp {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-sep {
    color: var(--border-color);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Topbar Center Search Trigger */
.topbar-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 7px 14px;
    border-radius: 20px;
    width: 320px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-search-bar:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-highlight);
}

.topbar-search-bar .search-icon {
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-search-bar .search-placeholder {
    flex: 1;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search-bar .search-kbd {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar-pill {
    font-size: 14px;
}

/* ==========================================================================
   GLOBAL ENTERPRISE COMMAND PALETTE (CTRL+K / CMD+K)
   ========================================================================== */

.command-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.78);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: fadeIn 0.15s ease-out;
}

.command-palette-card {
    width: 640px;
    max-width: 90vw;
    background: #0f172a;
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 25px rgba(59, 130, 246, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.command-palette-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.palette-search-icon {
    font-size: 18px;
    color: var(--text-muted);
}

.command-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
}

.palette-esc-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.command-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 12px;
}

.palette-group-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 10px 10px 4px;
    text-transform: uppercase;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    color: var(--text-secondary);
}

.palette-item:hover,
.palette-item.selected {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
}

.palette-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.palette-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.palette-item-kbd {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.palette-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.command-palette-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-muted);
}

.palette-hint {
    display: flex;
    gap: 12px;
}

.mini-kbd {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 992px) {
    .enterprise-sidebar {
        position: fixed;
        left: -260px;
    }
    .enterprise-sidebar.open {
        left: 0;
    }
    .mobile-toggle-btn {
        display: block;
    }
    .topbar-search-bar {
        display: none;
    }
}


/* ==========================================================================
   ENTERPRISE TOPBAR REFINED COMPONENTS & ACCOUNT MENU
   ========================================================================== */

.topbar-brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.topbar-brand-title {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.topbar-brand-divider {
    color: var(--text-muted);
    font-size: 12px;
}

.topbar-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.subtle-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #34d399;
    cursor: pointer;
    transition: var(--transition);
}

.subtle-status-pill:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.topbar-icon-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 34px;
    height: 34px;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

/* User Account Menu */
.account-menu-wrapper {
    position: relative;
}

.account-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.account-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-color);
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-trigger-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-trigger-info .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
}

.menu-chevron {
    font-size: 10px;
    color: var(--text-muted);
}

/* Account Dropdown Menu */
.account-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 240px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

.account-menu-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.user-info-full {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info-full strong {
    font-size: 13px;
    color: #ffffff;
}

.user-email-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.user-org-sub {
    font-size: 10px;
    color: var(--cyan-glow);
    font-weight: 600;
    margin-top: 2px;
}

.account-menu-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.account-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.menu-item-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.account-menu-footer {
    padding: 6px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.1);
}

.account-menu-item.signout-item {
    color: #f87171;
}

.account-menu-item.signout-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ffffff;
}

/* Restrained Enterprise Components */
.hud-panel {
    background: #0d1527;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.panel-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 20px;
}

.panel-title {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.metric-card {
    background: #0d1527;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 124px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    padding: var(--space-4);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.metric-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.metric-card.cyan { border-top: 2px solid var(--cyan-glow); }
.metric-card.emerald { border-top: 2px solid var(--emerald-glow); }
.metric-card.amber, .metric-card.gold { border-top: 2px solid var(--amber-glow); }
.metric-card.purple { border-top: 2px solid var(--purple-glow); }
.metric-card.red, .metric-card.rose { border-top: 2px solid var(--red-glow); }
.metric-card.blue, .metric-card.primary { border-top: 2px solid var(--primary); }

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

.metric-title {
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.metric-val {
    color: #ffffff;
    font-size: var(--text-3xl, 30px);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.metric-sub {
    font-size: var(--text-xs, 12px);
    color: var(--text-dim, #64748b);
    line-height: 1.4;
}

/* Micro-Trend Delta Pills */
.metric-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 9999px;
    letter-spacing: 0.2px;
    line-height: 1;
}

.metric-delta.up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.metric-delta.down {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.metric-delta.neutral {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enterprise HUD Table Modernization */
.table-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow-x: auto;
    position: relative;
    max-height: 560px;
    overflow-y: auto;
}

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

.hud-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #0b1120;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    white-space: nowrap;
}

.hud-table td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 12.5px;
    color: #cbd5e1;
    vertical-align: middle;
}

.hud-table tbody tr {
    transition: background 0.15s ease;
}

.hud-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

/* Tabular Monospace Numeric Columns */
.hud-table .num-cell,
.hud-table td.numeric,
.hud-table th.numeric,
.hud-table td.mono-num,
.hud-table th.mono-num,
.hud-table .text-right {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.hud-table .text-center {
    text-align: center;
}

/* Standardized Table Actions & Kebab Menu */
.hud-table .action-col,
.hud-table .table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.hud-kebab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.hud-kebab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Table Empty States */
.table-empty-state,
.hud-table tr.empty-row td,
.hud-table tr.table-empty-row td {
    padding: 36px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-sans);
}

/* Button Hierarchy Standardization */
.hud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.hud-btn.primary {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hud-btn.primary:hover {
    background: #1d4ed8;
    border-color: #1e40af;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.hud-btn.outline,
.hud-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hud-btn.outline:hover,
.hud-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.hud-btn.danger,
.hud-btn.red-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.hud-btn.danger:hover,
.hud-btn.red-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.hud-btn.small {
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 4px;
}

.hud-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Consistent Table Action Buttons */
.hud-table .action-btn {
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

/* Secondary table actions: View / Inspect / Test */
.hud-table .action-btn.cyan-btn,
.hud-table .action-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
}

.hud-table .action-btn.cyan-btn:hover,
.hud-table .action-btn.secondary:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.35);
    color: #00f0ff;
    transform: none;
}

/* Destructive table actions: Delete / Revoke / Remove / Disconnect */
.hud-table .action-btn.red-btn,
.hud-table .action-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.hud-table .action-btn.red-btn:hover,
.hud-table .action-btn.danger:hover {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(239, 68, 68, 0.35);
    transform: none;
}

/* Secondary 1-click copy buttons */
.copy-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    color: #f8fafc;
}

/* Workflow Studio Enterprise Redesign Styles */
.workflow-table .wf-title-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.workflow-table .wf-name-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.1px;
}

.workflow-table .wf-desc-sub {
    font-size: 11.5px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    line-height: 1.3;
}

.workflow-table .trigger-code-pill {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--cyan-glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.workflow-table .never-run-badge {
    display: inline-block;
    font-size: 11.5px;
    color: #64748b;
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 7px;
    border-radius: 4px;
}

.workflow-table .run-primary-btn {
    background: #0284c7;
    border: 1px solid #0369a1;
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.workflow-table .run-primary-btn:hover {
    background: #0369a1;
    border-color: #075985;
    transform: translateY(-1px);
}

.action-overflow-wrapper {
    position: relative;
    display: inline-block;
}

.action-overflow-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 28px;
    height: 26px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -1px;
    transition: all 0.15s ease;
}

.action-overflow-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.2);
}

.action-overflow-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    min-width: 170px;
    z-index: 1000;
    padding: 4px;
    animation: fadeInMenu 0.15s ease-out;
}

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

.action-overflow-menu .overflow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 12px;
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.action-overflow-menu .overflow-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.action-overflow-menu .overflow-item.danger {
    color: #f87171;
}

.action-overflow-menu .overflow-item.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.action-overflow-menu .overflow-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* Workflow Details Drawer */
.workflow-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 2000;
}

.workflow-details-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: #090e1a;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2001;
}

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



/* ==========================================================================
   19. UNIFIED ENTERPRISE STATUS SYSTEM
   ========================================================================== */
.status-pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Status: Active / Connected / Healthy / Resolved */
.status-pill.active,
.status-pill.connected,
.status-pill.healthy,
.status-pill.green,
.status-badge.active,
.status-badge.connected,
.status-badge.healthy,
.status-badge.resolved,
.status-badge.success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.28);
}

/* Status: Running */
.status-pill.running,
.status-pill.cyan,
.status-badge.running {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.28);
}

/* Status: Paused / Disconnected / Disabled / Inactive */
.status-pill.paused,
.status-pill.disconnected,
.status-pill.inactive,
.status-pill.dim,
.status-badge.paused,
.status-badge.disconnected,
.status-badge.inactive,
.status-badge.dim {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.22);
}

/* Status: Failed / Critical / Error */
.status-pill.failed,
.status-pill.error,
.status-pill.red,
.status-badge.failed,
.status-badge.error,
.status-badge.open,
.status-badge.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.28);
}

/* Status: Warning / Acknowledged */
.status-pill.warning,
.status-pill.amber,
.status-badge.warning,
.status-badge.acknowledged,
.status-badge.amber {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.28);
}

/* Status: Simulation / Sandbox */
.status-pill.simulation,
.status-pill.blue,
.status-badge.simulation {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.28);
}

/* Status: Not Configured / Unlinked */
.status-pill.not-configured,
.status-badge.not-configured {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   20. RESPONSIVE DESIGN & MOBILE CARD STACKING
   ========================================================================== */

/* Mobile Sidebar Backdrop Drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 2400;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Base Horizontal Overflow Containment */
.table-container {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

pre, code, .hud-code-snippet, .raw-json-viewer {
    max-width: 100%;
    overflow-x: auto;
    word-break: break-word;
}

/* Large Displays / Tablet Landscape (<= 1200px) */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

/* Medium Tablets & Mobile Drawer Switch (<= 992px) */
@media (max-width: 992px) {
    .enterprise-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -290px !important;
        width: 280px !important;
        min-width: 0 !important;
        max-width: 85vw !important;
        z-index: 2500 !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7) !important;
        transition: left 0.25s ease !important;
    }
    .enterprise-sidebar.open {
        left: 0 !important;
    }
    .enterprise-sidebar.collapsed {
        width: 280px !important;
        min-width: 0 !important;
    }
    .enterprise-sidebar.collapsed .tab-label,
    .enterprise-sidebar.collapsed .nav-counter-pill {
        display: inline !important;
    }
    .mobile-toggle-btn {
        display: inline-flex !important;
        min-width: 40px !important;
        min-height: 40px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .enterprise-app-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .topbar-search-bar {
        display: none !important;
    }
    .workflow-details-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Small Tablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
    .hud-header.enterprise-topbar {
        padding: 0 14px !important;
    }
    .main-content,
    .enterprise-content-area {
        padding: 16px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .panel-header,
    .rules-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    .rules-header-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    .rules-header-actions button {
        flex: 1;
        min-height: 38px;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .rules-filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    .category-filters {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .category-filters select {
        flex: 1;
        min-width: 140px;
        min-height: 38px;
    }
    .table-container {
        border-radius: 8px;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
        overflow-x: auto !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }
    /* Modal Dialogs Tablet */
    .hud-modal-overlay {
        padding: 12px !important;
    }
    .hud-modal {
        max-width: 95vw !important;
        width: 100% !important;
        max-height: 94vh !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border-radius: 10px !important;
    }
    .modal-body {
        padding: 16px !important;
        max-height: calc(94vh - 120px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .modal-footer {
        padding: 12px 16px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    /* Category Filter Segmented Control Swipe */
    .pill-segmented-control {
        max-width: 100% !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 4px 6px !important;
        border-radius: 12px !important;
    }
    .pill-toggle,
    .filter-chip {
        min-height: 34px !important;
    }
    /* Workflow Studio Tablet Breakpoint */
    .wf-graph-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px !important;
        gap: 10px !important;
    }
    .wf-toolbar-left {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .wf-rule-select {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 38px !important;
    }
    .wf-toolbar-right {
        width: 100% !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .wf-zoom-group {
        flex: 1 !important;
        justify-content: space-around !important;
        min-height: 38px !important;
    }
    .wf-ctrl-btn {
        min-height: 36px !important;
        min-width: 36px !important;
    }
    .wf-run-btn {
        min-height: 38px !important;
    }
    .wf-canvas-viewport {
        height: 420px !important;
        min-height: 360px !important;
    }
    .wf-graph-legend {
        gap: 8px 12px !important;
        font-size: 11px !important;
        flex-wrap: wrap !important;
        padding: 8px 10px !important;
    }
}

/* Mobile Screens & Card Stacking (<= 640px) */
@media (max-width: 640px) {
    /* Topbar Mobile Polish */
    .hud-header.enterprise-topbar {
        height: 56px !important;
        padding: 0 10px !important;
    }
    .topbar-divider {
        display: none !important;
    }
    .subtle-status-pill {
        padding: 5px 8px !important;
        border-radius: 9999px !important;
        min-height: 32px !important;
    }
    .subtle-status-pill .status-text {
        display: none !important;
    }
    .account-menu-trigger {
        padding: 4px !important;
        border-radius: 50% !important;
        min-width: 36px !important;
        min-height: 36px !important;
        justify-content: center !important;
    }
    .account-menu-trigger .user-trigger-info,
    .account-menu-trigger .menu-chevron {
        display: none !important;
    }
    .topbar-right-controls {
        gap: 6px !important;
    }
    .topbar-icon-btn {
        min-width: 36px !important;
        min-height: 36px !important;
    }

    /* KPI Metrics 1-Column Stacking */
    .metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .metric-card {
        min-height: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .telemetry-grid,
    .telemetry-cards-container {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Form & Modal Multi-column Grids Stacking */
    .hud-modal-overlay {
        padding: 8px !important;
    }
    .hud-modal {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .modal-body [style*="grid-template-columns: 1fr 1fr"],
    .modal-body [style*="grid-template-columns: repeat(2"],
    .modal-body [style*="grid-template-columns: repeat(4"],
    .form-grid-2,
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .hud-input,
    select.hud-input,
    textarea.hud-input,
    .workspace-select {
        min-height: 38px !important;
        font-size: 13.5px !important;
    }
    .modal-footer button {
        flex: 1 !important;
        min-height: 38px !important;
    }

    /* Workflow Studio Mobile Polish: Zero Overlap */
    .view-switcher-group {
        width: 100% !important;
        display: flex !important;
    }
    .view-switch-btn {
        flex: 1 !important;
        min-height: 40px !important;
        justify-content: center !important;
        font-size: 13px !important;
    }
    .wf-toolbar-right {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    .wf-zoom-group {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        overflow-x: auto !important;
        padding: 3px !important;
        border-radius: 8px !important;
    }
    .wf-ctrl-btn {
        flex: 1 !important;
        min-height: 38px !important;
        min-width: 36px !important;
        font-size: 13px !important;
        justify-content: center !important;
    }
    .wf-zoom-badge {
        min-width: 44px !important;
        text-align: center !important;
        font-size: 11px !important;
    }
    .wf-run-btn {
        width: 100% !important;
        min-height: 40px !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        justify-content: center !important;
    }
    .wf-canvas-helper-hint {
        display: none !important;
    }

    /* Enterprise Table Mobile Card Stacking */
    .table-container:has(.stack-mobile) {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        overflow-x: visible !important;
    }

    .hud-table.stack-mobile {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
    }

    .hud-table.stack-mobile thead {
        display: none !important;
    }

    .hud-table.stack-mobile tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .hud-table.stack-mobile tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 10px !important;
        padding: 14px 16px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
        gap: 6px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .hud-table.stack-mobile tbody tr:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    }

    .hud-table.stack-mobile tbody tr td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 7px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        width: 100% !important;
        font-size: 12.5px !important;
        box-sizing: border-box !important;
        text-align: right !important;
    }

    .hud-table.stack-mobile tbody tr td::before {
        content: attr(data-label);
        font-size: 11px !important;
        font-family: var(--font-mono) !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: var(--text-muted) !important;
        margin-right: 12px !important;
        text-align: left !important;
        flex-shrink: 0 !important;
    }

    .hud-table.stack-mobile tbody tr td:last-child {
        border-bottom: none !important;
        padding-top: 10px !important;
        padding-bottom: 2px !important;
        justify-content: flex-end !important;
    }

    .hud-table.stack-mobile tbody tr td:last-child::before {
        margin-right: auto !important;
    }

    .hud-table.stack-mobile tbody tr td.action-col .action-btn-row {
        width: 100% !important;
        justify-content: flex-end !important;
    }

    /* Single-cell Empty State rows (colspan rows) */
    .hud-table.stack-mobile tbody tr:has(.empty-cell) td,
    .hud-table.stack-mobile tbody tr td.empty-cell,
    .hud-table.stack-mobile tbody tr.empty-row td,
    .hud-table.stack-mobile tbody tr.table-empty-row td {
        display: block !important;
        text-align: center !important;
        border: none !important;
        padding: 32px 16px !important;
    }

    .hud-table.stack-mobile tbody tr td.empty-cell::before,
    .hud-table.stack-mobile tbody tr.empty-row td::before,
    .hud-table.stack-mobile tbody tr.table-empty-row td::before {
        display: none !important;
    }

    /* Light Theme Mobile Stacked Cards */
    html:not(.dark) .hud-table.stack-mobile tbody tr,
    html.light .hud-table.stack-mobile tbody tr {
        background: #ffffff !important;
        border-color: #cbd5e1 !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    }

    html:not(.dark) .hud-table.stack-mobile tbody tr td,
    html.light .hud-table.stack-mobile tbody tr td {
        border-bottom: 1px solid #f1f5f9 !important;
        color: #1e293b !important;
    }

    html:not(.dark) .hud-table.stack-mobile tbody tr td::before,
    html.light .hud-table.stack-mobile tbody tr td::before {
        color: #64748b !important;
    }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
    .main-content,
    .enterprise-content-area {
        padding: 12px 8px !important;
    }
    .topbar-brand-title {
        font-size: 13.5px !important;
        font-weight: 700 !important;
    }
    .topbar-brand-divider,
    .breadcrumb-current {
        display: none !important;
    }
    .topbar-left {
        gap: 8px !important;
    }
    .mobile-toggle-btn {
        padding: 6px 8px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    .hud-btn {
        font-size: 12.5px !important;
        padding: 6px 10px !important;
        min-height: 36px !important;
    }
    .table-container table:not(.stack-mobile) {
        min-width: 540px;
    }
    .wf-canvas-viewport {
        height: 360px !important;
        min-height: 300px !important;
    }
    .wf-minimap-container {
        bottom: 8px !important;
        right: 8px !important;
    }
    .app-global-footer {
        padding: 16px 10px !important;
    }
    .app-global-footer .creator-mark {
        font-size: 0.75rem !important;
    }
}

/* ==========================================================================
   20b. ULTRA COMPACT MOBILE RESPONSIVENESS (< 380px) - iPhone SE & Foldables
   ========================================================================== */
@media (max-width: 380px) {
    html, body {
        overflow-x: hidden !important;
        font-size: 13px !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .main-content,
    .enterprise-content-area,
    .app-container,
    .main-layout {
        padding: 6px 3px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Data Tables Horizontal Overflow Fix */
    .table-container,
    .hud-table-wrapper,
    .table-responsive,
    [class*="table-responsive"] {
        width: 100% !important;
        max-width: calc(100vw - 12px) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        box-sizing: border-box !important;
        margin: 6px 0 !important;
    }
    .table-container table,
    .hud-table {
        min-width: 300px !important;
        width: 100% !important;
    }

    /* Modal Dialogs Horizontal Overflow Prevention */
    .modal,
    .modal-backdrop,
    .hud-modal-overlay {
        padding: 4px !important;
        box-sizing: border-box !important;
    }
    .modal-box,
    .modal-content,
    .modal-card,
    .hud-modal,
    .dialog-content,
    [class*="modal-dialog"] {
        width: 96vw !important;
        max-width: 96vw !important;
        padding: 10px 8px !important;
        margin: 8px auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        max-height: 88vh !important;
    }

    /* Topbar adjustments */
    .topbar-container {
        padding: 4px 6px !important;
        height: 48px !important;
    }
    .topbar-brand-title {
        font-size: 12px !important;
        max-width: 130px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .topbar-right {
        gap: 4px !important;
    }
    .topbar-btn,
    .hud-btn {
        padding: 4px 6px !important;
        font-size: 11px !important;
        min-height: 30px !important;
    }

    /* Sidebar Drawer Mobile App-like Transformation */
    .enterprise-sidebar {
        position: fixed !important;
        top: 48px !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 10050 !important;
        width: 250px !important;
        max-width: 80vw !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6) !important;
    }
    .enterprise-sidebar.mobile-open,
    .enterprise-sidebar.open {
        transform: translateX(0) !important;
    }

    /* WhatsApp Web Chat Interface Native App Feel */
    .whatsapp-web-container,
    .wa-main-layout {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - 58px) !important;
        max-height: calc(100vh - 58px) !important;
        width: 100% !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        border: none !important;
        padding-bottom: env(safe-area-inset-bottom, 8px) !important;
    }

    .whatsapp-conversations-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
        height: 100% !important;
    }

    .whatsapp-conversations-sidebar.mobile-hidden,
    .wa-chat-list-panel.mobile-hidden {
        display: none !important;
    }

    .whatsapp-chat-main-area.mobile-fullscreen,
    .wa-chat-detail-panel.mobile-fullscreen {
        display: flex !important;
        width: 100% !important;
        flex: 1 1 100% !important;
        height: 100% !important;
    }

    .wa-mobile-back-btn {
        display: inline-flex !important;
        align-items: center !important;
        background: transparent !important;
        border: none !important;
        color: var(--cyan-glow, #06b6d4) !important;
        font-weight: 600 !important;
        font-size: 13px !important;
        padding: 4px 8px !important;
        margin-right: 6px !important;
        cursor: pointer !important;
    }

    .wa-chat-footer,
    .wa-input-bar {
        padding: 6px 4px !important;
        gap: 4px !important;
    }

    .wa-chat-input-wrapper input {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }

    .wa-send-btn,
    .wa-ptt-record-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        padding: 4px !important;
    }

    /* QR Code Canvas on Small Phones */
    #qrImageWrapper,
    #qr-code-canvas,
    #qr-code-img {
        max-width: 200px !important;
        max-height: 200px !important;
    }
}

/* ==========================================================================
   21. ACCESSIBILITY & VISIBLE FOCUS STATES
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--cyan-glow, #06b6d4) !important;
    outline-offset: 2px !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible,
.hud-btn:focus-visible,
.action-btn:focus-visible,
.icon-btn:focus-visible,
.segmented-btn:focus-visible,
.action-overflow-btn:focus-visible {
    outline: 2px solid var(--cyan-glow, #06b6d4) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25) !important;
}

html:not(.dark) :focus-visible, html.light :focus-visible {
    outline-color: var(--primary, #2563eb) !important;
}

html:not(.dark) button:focus-visible, html.light button:focus-visible,
html:not(.dark) input:focus-visible, html.light input:focus-visible,
html:not(.dark) select:focus-visible, html.light select:focus-visible,
html:not(.dark) textarea:focus-visible, html.light textarea:focus-visible,
html:not(.dark) a:focus-visible, html.light a:focus-visible,
html:not(.dark) summary:focus-visible, html.light summary:focus-visible,
html:not(.dark) .hud-btn:focus-visible, html.light .hud-btn:focus-visible,
html:not(.dark) .action-btn:focus-visible, html.light .action-btn:focus-visible {
    outline: 2px solid var(--primary, #2563eb) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2) !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* ==========================================================================
   GLOBAL APPLICATION FOOTER & CREATOR MARK (SECTION 23)
   ========================================================================== */
.app-global-footer {
    padding: 24px 32px 28px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    text-align: center;
    width: 100%;
}

.app-global-footer .footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-global-footer .creator-mark {
    font-size: 0.8rem;
    color: var(--text-dim, #64748b);
    letter-spacing: 0.02em;
    font-weight: 400;
    user-select: none;
    white-space: pre-wrap;
}

/* ==========================================================================
   REUSABLE ENTERPRISE EMPTY STATE COMPONENT (SECTION 26)
   ========================================================================== */
.hud-empty-state {
    padding: 52px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hud-empty-state-cell {
    padding: 0 !important;
    border: none !important;
}

.hud-empty-state .empty-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
    line-height: 1;
}

.hud-empty-state .empty-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-light, #f8fafc);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.hud-empty-state .empty-desc {
    font-size: 0.88rem;
    color: var(--text-dim, #94a3b8);
    max-width: 440px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

.hud-empty-state .empty-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   27. PREMIUM ENTERPRISE STATUS BADGES & ACCENTS
   ========================================================================== */
.status-badge.success,
.status-badge.resolved,
.status-badge.completed,
.status-badge.passed {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.32) !important;
}

.status-badge.failed,
.status-badge.error {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.32) !important;
}

.status-badge.skipped,
.status-badge.paused {
    background: rgba(148, 163, 184, 0.1) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
}

/* ==========================================================================
   28. PILL-STYLE SEGMENTED CONTROLS & TOGGLES
   ========================================================================== */
.pill-segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    flex-wrap: wrap;
}

html:not(.dark) .pill-segmented-control {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pill-toggle,
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.pill-toggle:hover,
.filter-chip:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

html:not(.dark) .pill-toggle:hover,
html:not(.dark) .filter-chip:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

.pill-toggle.active,
.filter-chip.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0369a1 !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
}

.filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 0 8px;
    font-weight: 600;
}

/* ==========================================================================
   29. SLEEK HORIZONTAL FILTER TOOLBAR (CRM LEADS & WORKFLOWS)
   ========================================================================== */
.sleek-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

html:not(.dark) .sleek-filter-bar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.embedded-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
}

.embedded-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: #64748b;
    pointer-events: none;
}

.embedded-search-wrapper .embedded-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 13px;
    color: #f8fafc;
    outline: none;
    transition: all 0.15s ease;
}

html:not(.dark) .embedded-search-wrapper .embedded-search-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.embedded-search-wrapper .embedded-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

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

.custom-sleek-select {
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 12.5px;
    color: #cbd5e1;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

html:not(.dark) .custom-sleek-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.custom-sleek-select:focus {
    border-color: #0284c7;
}

.custom-sleek-select option {
    background: #0f172a;
    color: #f8fafc;
}

html:not(.dark) .custom-sleek-select option {
    background: #ffffff;
    color: #0f172a;
}

/* ==========================================================================
   30. CODE BLOCK PAYLOAD EDITOR UI
   ========================================================================== */
.code-editor-card {
    background: #080d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

html:not(.dark) .code-editor-card {
    background: #0f172a;
    border-color: #334155;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-editor-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.code-editor-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 12px 14px;
    resize: vertical;
    box-sizing: border-box;
}

/* Destructive Warning Buttons */
.hud-btn.destructive-danger,
.action-btn.destructive-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.hud-btn.destructive-danger:hover,
.action-btn.destructive-danger:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
}

/* Engine Specs Key-Value Grid */
.engine-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.engine-spec-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

html:not(.dark) .engine-spec-item {
    background: #ffffff;
    border-color: #e2e8f0;
}

.engine-spec-key {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.engine-spec-val {
    font-size: 13px;
    font-weight: 500;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

html:not(.dark) .engine-spec-val {
    color: #0f172a;
}

/* Fixed Footer Stickiness */
.enterprise-app-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

.app-global-footer {
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
}

/* =========================================================
   WHATSAPP WEB REPLICA INTERFACE STYLING
   ========================================================= */

/* Authentic WhatsApp Web QR Connect State */
.wa-connect-card {
    display: flex;
    max-width: 960px;
    margin: 20px auto 30px auto;
    background-color: #111b21;
    border: 1px solid #222d34;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (max-width: 820px) {
    .wa-connect-card {
        flex-direction: column;
    }
    .wa-connect-right {
        border-left: none !important;
        border-top: 1px solid #222d34;
    }
}

.wa-connect-left {
    flex: 1.2;
    padding: 36px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wa-connect-steps {
    list-style: decimal;
    padding-left: 20px;
    margin: 16px 0 24px 0;
    color: #aebac1;
    font-size: 14.5px;
    line-height: 1.8;
}

.wa-connect-steps strong {
    color: #e9edef;
}

.wa-connect-right {
    flex: 0.9;
    background-color: #111b21;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #222d34;
}

.wa-qr-box {
    background: #ffffff;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wa-web-app {
    display: flex;
    height: calc(100vh - 145px) !important;
    min-height: 620px !important;
    background-color: #0c1317;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    backdrop-filter: blur(16px);
}

.wa-sidebar {
    width: 360px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    background-color: #111b21;
    border-right: 1px solid #222d34;
    flex-shrink: 0;
}

.wa-sidebar-header {
    height: 60px;
    background-color: #202c33;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #222d34;
}

.wa-icon-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 50%;
    color: #aebac1;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wa-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e9edef;
}

.wa-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.15s ease;
    gap: 12px;
}

.wa-chat-item:hover {
    background-color: #202c33;
}

.wa-chat-item.active {
    background-color: #2a3942;
}

.wa-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    flex-shrink: 0;
    user-select: none;
}

.wa-chat-meta {
    flex: 1;
    min-width: 0;
}

.wa-chat-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.wa-chat-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #e9edef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-chat-time {
    font-size: 11px;
    color: #8696a0;
}

.wa-chat-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-chat-preview {
    font-size: 13px;
    color: #8696a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.wa-unread-badge {
    background-color: #00a884;
    color: #111b21;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}

/* Chat Pane */
.wa-chat-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0b141a;
    position: relative;
    min-width: 0;
}

.wa-chat-header {
    height: 60px;
    background-color: #202c33;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #222d34;
    z-index: 2;
}

.wa-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #0b141a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Message Bubbles */
.wa-bubble-wrap {
    display: flex;
    width: 100%;
}

.wa-bubble-wrap.inbound {
    justify-content: flex-start;
}

.wa-bubble-wrap.outbound {
    justify-content: flex-end;
}

.wa-bubble {
    max-width: 65%;
    min-width: 140px;
    padding: 7px 12px 6px 12px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}

.wa-bubble.inbound {
    background-color: #202c33;
    color: #e9edef;
    border-top-left-radius: 0px;
}

.wa-bubble.outbound {
    background-color: #005c4b;
    color: #e9edef;
    border-top-right-radius: 0px;
}

.wa-bubble-sender {
    font-size: 11.5px;
    font-weight: 600;
    color: #53bdeb;
    margin-bottom: 3px;
}

.wa-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 10.5px;
    color: #8696a0;
    margin-top: 4px;
    user-select: none;
}

.wa-bubble.outbound .wa-bubble-footer {
    color: rgba(255, 255, 255, 0.65);
}

.wa-ticks {
    font-size: 12px;
    font-weight: bold;
    color: #53bdeb;
}

.wa-msg-del-btn,
.wa-msg-act-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: #8696a0;
    cursor: pointer;
    font-size: 11px;
    padding: 1px 4px;
    border-radius: 4px;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.wa-bubble:hover .wa-msg-del-btn,
.wa-bubble:hover .wa-msg-act-btn {
    opacity: 0.85;
}

.wa-msg-del-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.wa-msg-act-btn:hover {
    color: #53bdeb;
    background: rgba(83, 189, 235, 0.15);
}

/* Voice Note Player */
.wa-voice-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    padding: 4px 0;
}

.wa-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #00a884;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.1s ease, background 0.15s ease;
    flex-shrink: 0;
}

.wa-play-btn:hover {
    transform: scale(1.06);
    background-color: #029474;
}

.wa-voice-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wa-prog-bar-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.wa-prog-bar-fill {
    height: 100%;
    width: 0%;
    background: #00a884;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.wa-bubble.outbound .wa-prog-bar-fill {
    background: #53bdeb;
}

.wa-voice-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #8696a0;
}

.wa-bubble.outbound .wa-voice-meta {
    color: rgba(255, 255, 255, 0.7);
}

/* Reply Bar */
.wa-reply-bar {
    background-color: #202c33;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #222d34;
    position: relative;
    z-index: 10;
}

.wa-reply-input {
    width: 100%;
    background-color: #2a3942;
    border: none;
    outline: none;
    border-radius: 8px;
    color: #e9edef;
    padding: 10px 14px;
    font-size: 13.5px;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 100px;
}

.wa-reply-input::placeholder {
    color: #8696a0;
}

.wa-reply-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #00a884;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.wa-reply-send-btn:hover {
    background-color: #029474;
    transform: scale(1.05);
}

.wa-date-divider {
    align-self: center;
    background-color: #182229;
    color: #8696a0;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    margin: 8px 0;
    text-transform: uppercase;
}

/* ==========================================================================
   ENTERPRISE SAAS GLASSMORPHISM DESIGN SYSTEM & MULTI-TENANT SUITE
   Frosted Obsidian, Dynamic Lighting, and High-Tech SaaS Accents
   ========================================================================== */

.glass-container {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
    border-radius: var(--radius-lg, 12px);
}

.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%), rgba(17, 26, 46, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-md, 10px);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition, all 0.25s ease);
}

.glass-card-interactive {
    cursor: pointer;
}

.glass-card-interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.45), 0 0 20px rgba(59, 130, 246, 0.15);
}

.glass-panel {
    background: rgba(11, 17, 32, 0.75);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
}

/* Glass Lighting & Accents */
.glass-glow-cyan {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.35);
}

.glass-glow-emerald {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.35);
}

.glass-glow-purple {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.35);
}

/* Glass Badge & Pill */
.glass-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.glass-pill.cyan {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.3);
    color: #38bdf8;
}

.glass-pill.emerald {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.glass-pill.purple {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
    color: #c084fc;
}

/* Glass Inputs */
.glass-input {
    background: rgba(11, 17, 32, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.glass-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 0 15px rgba(59, 130, 246, 0.15) !important;
    outline: none;
}

/* AI Auto-Responder Pill in WhatsApp Web */
.ai-auto-responder-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    transition: all 0.2s ease;
    user-select: none;
}

.ai-auto-responder-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
    transform: scale(1.02);
}

.ai-auto-responder-pill.disabled {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

.ai-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-glow 2s infinite ease-in-out;
}

.ai-auto-responder-pill.disabled .ai-pill-dot {
    background: #64748b;
    box-shadow: none;
    animation: none;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* AI Message Bubble Badge */
.wa-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Settings Sections Layout */
.settings-tab-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.settings-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.settings-tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

.tenant-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tenant-meta-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tenant-meta-key {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.tenant-meta-val {
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* AI Sandbox Preview Container */
.ai-preview-box {
    background: rgba(11, 17, 32, 0.8);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 8px;
    padding: 16px;
    margin-top: 14px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ai-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

/* ==========================================
   CAMPAIGN & TARGETED BROADCASTS STYLES
   ========================================== */

.wizard-step-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    cursor: default;
}

.wizard-step-pill.active {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--cyan-glow, #00f0ff);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.status-pill.yellow {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.status-pill.red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-pill.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   WORKFLOW STUDIO - INTERACTIVE GRAPH CANVAS & VIEW SWITCHER STYLES
   ========================================================================== */

.view-switcher-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 2px;
}

.view-switch-btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-sans);
    outline: none;
    line-height: 1.2;
}

.view-switch-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.view-switch-btn.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.view-switch-btn:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Graph Canvas Header & Toolbar */
.wf-graph-toolbar {
    margin-bottom: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wf-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wf-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.wf-rule-select {
    min-width: 260px;
    max-width: 380px;
    font-size: 13px;
    font-weight: 500;
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wf-rule-select:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

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

.wf-zoom-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.wf-ctrl-btn {
    height: 30px;
    min-width: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wf-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

.wf-ctrl-btn:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 1px !important;
}

.wf-zoom-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--cyan-glow);
    min-width: 48px;
    text-align: center;
    padding: 2px 4px;
    user-select: none;
}

.wf-run-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.wf-run-btn:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.wf-run-btn:active {
    transform: translateY(0);
}

/* Color-Coded Node Legend */
.wf-graph-legend {
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 11px;
}

.wf-canvas-helper-hint {
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.wf-canvas-viewport {
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.2s ease;
}

.wf-canvas-viewport:active {
    cursor: grabbing !important;
}

/* Graph Node Card Structure */
.wf-graph-node {
    position: absolute;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wf-graph-node:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.wf-graph-node:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 3px !important;
}

.wf-graph-node.selected {
    box-shadow: 0 0 0 2px var(--primary), 0 8px 24px rgba(59, 130, 246, 0.3) !important;
    border-color: var(--primary) !important;
}

/* Colorful Node Types */
.wf-graph-node.trigger {
    border-top: 3px solid #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.trigger .node-type-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.wf-graph-node.condition,
.wf-graph-node.urgency_detection {
    border-top: 3px solid #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.condition .node-type-pill,
.wf-graph-node.urgency_detection .node-type-pill {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.wf-graph-node.ai_analysis,
.wf-graph-node.ai_generate,
.wf-graph-node.ai_summarize,
.wf-graph-node.ai_classify {
    border-top: 3px solid #8b5cf6;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.ai_analysis .node-type-pill,
.wf-graph-node.ai_generate .node-type-pill,
.wf-graph-node.ai_summarize .node-type-pill,
.wf-graph-node.ai_classify .node-type-pill {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.wf-graph-node.approval {
    border-top: 3px solid #f43f5e;
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.approval .node-type-pill {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.wf-graph-node.action,
.wf-graph-node.notification,
.wf-graph-node.webhook_call,
.wf-graph-node.database_record,
.wf-graph-node.email_draft,
.wf-graph-node.route,
.wf-graph-node.lead_scoring {
    border-top: 3px solid #14b8a6;
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.action .node-type-pill,
.wf-graph-node.notification .node-type-pill,
.wf-graph-node.webhook_call .node-type-pill,
.wf-graph-node.database_record .node-type-pill,
.wf-graph-node.email_draft .node-type-pill,
.wf-graph-node.route .node-type-pill,
.wf-graph-node.lead_scoring .node-type-pill {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.wf-graph-node.end,
.wf-graph-node.outcome {
    border-top: 3px solid #10b981;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 40%);
}
.wf-graph-node.end .node-type-pill,
.wf-graph-node.outcome .node-type-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Node Elements */
.wf-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.node-type-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.wf-node-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-node-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    max-height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ports for Connectors */
.wf-node-port {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid var(--bg-card);
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px rgba(14, 165, 233, 0.6);
}

.wf-node-port.input {
    left: -5px;
}

.wf-node-port.output {
    right: -5px;
}

/* SVG Connector Paths */
.wf-connector-path {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 2.5;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.85;
    transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

.wf-connector-path:hover {
    stroke-width: 4;
    opacity: 1;
    stroke: #00f0ff;
}

.wf-connector-path.animated {
    stroke-dasharray: 6 4;
    animation: wfFlowAnim 1.2s linear infinite;
}

@keyframes wfFlowAnim {
    from {
        stroke-dashoffset: 20;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ==========================================================================
   PHASE 3: WORKFLOW STUDIO MICRO-INTERACTIONS & RADAR MINI-MAP
   ========================================================================== */

/* 1. Execution Traversal Pulse Animation (ringPulse) */
@keyframes nodeRingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(6, 182, 212, 0), 0 8px 24px rgba(0, 0, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0), 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

@keyframes nodeSuccessFlash {
    0% {
        border-color: #10b981;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 18px rgba(16, 185, 129, 0.5);
    }
    100% {
        border-color: #10b981;
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
    }
}

.wf-graph-node.executing {
    border-color: #00f0ff !important;
    animation: nodeRingPulse 1.1s cubic-bezier(0, 0, 0.2, 1) infinite !important;
    z-index: 25 !important;
}

.wf-graph-node.executing .wf-node-port {
    background: #00f0ff !important;
    box-shadow: 0 0 10px #00f0ff !important;
}

.wf-graph-node.executed {
    border-color: #10b981 !important;
    animation: nodeSuccessFlash 0.6s ease-out forwards;
}

.wf-graph-node.executed .wf-node-port {
    background: #10b981 !important;
    box-shadow: 0 0 8px #10b981 !important;
}

.wf-connector-path.traversing {
    stroke: #00f0ff !important;
    stroke-width: 4 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 6px #00f0ff);
}

/* 2. Radar Mini-Map Styling */
.wf-minimap-container {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wf-minimap-container.collapsed #wfMinimapWrapper {
    display: none !important;
}

.wf-minimap-container.collapsed {
    padding: 4px 8px;
}

/* 3. Empty State for Visual Graph */
.wf-graph-empty-state {
    animation: wfFadeIn 0.3s ease-out;
}

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

/* 4. Unified Modal Scale-In Animation */
@keyframes hudModalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hud-modal-overlay[style*="display: flex"] .hud-modal,
.hud-modal-overlay[style*="display:flex"] .hud-modal,
#wfNodeDetailModal[style*="display: flex"] .modal-card,
#wfNodeDetailModal[style*="display:flex"] .modal-card {
    animation: hudModalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   WORKFLOW STUDIO - REDUCED MOTION ACCESSIBILITY (WCAG 2.3.3)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .wf-connector-path.animated {
        animation: none !important;
    }
    .wf-connector-path.traversing {
        animation: none !important;
        stroke: #00f0ff !important;
    }
    .wf-graph-node {
        transition: none !important;
    }
    .wf-graph-node:hover {
        transform: none !important;
    }
    .wf-graph-node.executing {
        animation: none !important;
        border-color: #00f0ff !important;
    }
    .wf-graph-node.executed {
        animation: none !important;
        border-color: #10b981 !important;
    }
    .wf-canvas-world {
        transition: none !important;
    }
    .wf-graph-empty-state {
        animation: none !important;
    }
    #wfMinimapViewportRect {
        transition: none !important;
    }
    .hud-modal-overlay .hud-modal,
    #wfNodeDetailModal .modal-card {
        animation: none !important;
    }
}

/* ==========================================================================
   PRODUCTION UTILITY CLASSES (REPLACING TAILWIND PLAY CDN)
   Self-contained production styling for core navigation and layout utilities.
   ========================================================================== */

.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }

.text-gray-900 { color: #0f172a; }
.text-gray-700 { color: #334155; }
.text-gray-600 { color: #475569; }
.text-gray-500 { color: #64748b; }

.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }

.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Dark Mode Overrides */
html.dark .dark\:bg-slate-900, .dark .dark\:bg-slate-900 { background-color: #0f172a; }
html.dark .dark\:bg-slate-800, .dark .dark\:bg-slate-800 { background-color: #1e293b; }
html.dark .dark\:text-white, .dark .dark\:text-white { color: #ffffff; }
html.dark .dark\:text-slate-100, .dark .dark\:text-slate-100 { color: #f1f5f9; }
html.dark .dark\:text-slate-300, .dark .dark\:text-slate-300 { color: #cbd5e1; }
html.dark .dark\:text-slate-400, .dark .dark\:text-slate-400 { color: #94a3b8; }
html.dark .dark\:border-slate-800, .dark .dark\:border-slate-800 { border-color: #1e293b; }
html.dark .dark\:border-slate-700, .dark .dark\:border-slate-700 { border-color: #334155; }
html.dark .dark\:hover\:bg-slate-800:hover, .dark .dark\:hover\:bg-slate-800:hover { background-color: #1e293b; }











/* ==========================================================================
   OPSFLOW CLOUD: PRODUCTS CATALOG & SHOP MANAGEMENT MODULE
   ========================================================================== */

.products-catalog-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.product-kpi-card {
    background: var(--bg-card, rgba(22, 27, 34, 0.7));
    border: 1px solid var(--border-color, #2a2e3d);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: var(--border-highlight, #3b82f6);
}

.product-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.product-kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.product-kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.product-kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.product-kpi-icon.rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.product-kpi-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.product-kpi-details .val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    line-height: 1.2;
}

.product-kpi-details .lbl {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.product-thumb-container {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, #2a2e3d);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.product-thumb-container:hover {
    border-color: var(--cyan-glow, #00f0ff);
}

.product-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.product-thumb-container:hover .product-thumb-img {
    transform: scale(1.1);
}

.product-item-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-item-title {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary, #ffffff);
    margin-bottom: 2px;
}

.product-item-desc {
    font-size: 11.5px;
    color: var(--text-secondary, #8b949e);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sku-pill {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, #2a2e3d);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text-secondary, #cbd5e1);
    display: inline-block;
}

.stock-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.stock-status-pill.in-stock {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stock-status-pill.low-stock {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stock-status-pill.out-of-stock {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.stock-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, #2a2e3d);
    border-radius: 6px;
    padding: 2px 4px;
}

.stock-qty-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-weight: 700;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.stock-qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ffffff);
}

.stock-qty-num {
    font-weight: 700;
    font-size: 13px;
    min-width: 28px;
    text-align: center;
    color: var(--text-primary, #ffffff);
}

.product-image-url-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #38bdf8;
    text-decoration: none;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(56, 189, 248, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    cursor: pointer;
}

.product-image-url-link:hover {
    background: rgba(56, 189, 248, 0.18);
    text-decoration: underline;
}

.product-category-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.product-price-val {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary, #ffffff);
}

.product-price-curr {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    margin-left: 2px;
}

.product-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.product-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.product-card {
    background: var(--bg-card, rgba(22, 27, 34, 0.7));
    border: 1px solid var(--border-color, #2a2e3d);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-color: var(--border-highlight, #3b82f6);
}

.product-card-media {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-media img {
    transform: scale(1.05);
}

.product-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

.product-card-status-pill {
    position: absolute;
    top: 10px;
    right: 10px;
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary, #ffffff);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-card-desc {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #2a2e3d);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-card-preview {
    background: var(--bg-card, rgba(22, 27, 34, 0.8));
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 10px;
}

.live-card-preview-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #334155);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-card-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ==========================================================================
   WHATSAPP WEB FILTER CHIPS & PAIRING CODE BOXES
   ========================================================================== */
.wa-filter-chips-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}
.wa-filter-chips-bar::-webkit-scrollbar {
    display: none;
}
.wa-filter-chip {
    background: #202c33;
    color: #8696a0;
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    user-select: none;
    outline: none;
}
.wa-filter-chip:hover {
    background: #2a3942;
    color: #e9edef;
}
.wa-filter-chip.active {
    background: #00a884 !important;
    color: #111b21 !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 168, 132, 0.35);
}

.wa-pairing-box {
    width: 30px;
    height: 42px;
    background: #202c33;
    border: 1.5px solid #00a884;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 700;
    color: #00a884;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.25);
    user-select: all;
    letter-spacing: 0;
}
.wa-pairing-dash {
    color: #8696a0;
    font-size: 20px;
    font-weight: 700;
    padding: 0 4px;
    user-select: none;
}


/* ==========================================================================
   WHATSAPP AUDIO CALL SCREEN STYLES & ANIMATIONS
   ========================================================================== */
@keyframes waRipple {
    0% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.7);
    }
    70% {
        transform: scale(1.32);
        box-shadow: 0 0 0 28px rgba(0, 168, 132, 0);
    }
    100% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(0, 168, 132, 0);
    }
}

.wa-call-pulse-ring.active {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    animation: waRipple 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
    border: 2px solid #00a884;
}

@keyframes eqDance {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.eq-bar {
    width: 3px;
    height: 4px;
    background: #00a884;
    border-radius: 2px;
    transition: height 0.15s ease;
}

.eq-bar.active {
    animation: eqDance 0.8s infinite ease-in-out;
}
.eq-bar.active:nth-child(1) { animation-delay: 0.1s; }
.eq-bar.active:nth-child(2) { animation-delay: 0.3s; }
.eq-bar.active:nth-child(3) { animation-delay: 0.2s; }
.eq-bar.active:nth-child(4) { animation-delay: 0.4s; }
.eq-bar.active:nth-child(5) { animation-delay: 0.15s; }

.wa-call-btn:hover {
    background: #2a3942 !important;
    border-color: #00a884 !important;
}
.wa-call-btn.muted {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* WhatsApp Live Audio Waves & Recording Bar Animation */
@keyframes waBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(0.85); }
}

@keyframes waWave {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1.1); }
}

.wa-wave-bar {
    display: inline-block;
    width: 3px;
    background: #00a884;
    border-radius: 2px;
    transform-origin: bottom;
}

/* ==========================================================================
   BASHFLOW CLOUD: WORLD-CLASS ENTERPRISE SAAS UI/UX & 5-MODULE INTERCONNECTIONS
   ========================================================================== */

/* 1. INTERCOM-STYLE REAL-TIME CUSTOMER & CRM DOSSIER (3RD COLUMN) */
.wa-customer-dossier {
    width: 320px;
    min-width: 280px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    background-color: #111b21;
    border-left: 1px solid #222d34;
    flex-shrink: 0;
    transition: width 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
    overflow-y: auto;
    position: relative;
    z-index: 5;
}

.wa-customer-dossier.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-left: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.wa-dossier-header {
    height: 60px;
    background-color: #202c33;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #222d34;
    flex-shrink: 0;
}

.wa-dossier-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

.wa-dossier-card {
    background: #182229;
    border: 1px solid #2a3942;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* 2. LINEAR-STYLE 5-MODULE PULSE COMMAND STRIP (EXECUTIVE OVERVIEW) */
.module-pulse-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.module-pulse-card {
    background: #111b21;
    border: 1px solid #202c33;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.module-pulse-card:hover {
    border-color: #00a884;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 132, 0.18);
}

.module-pulse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3.5px;
    height: 100%;
    background: #00a884;
    opacity: 0.8;
}

.module-pulse-card.cyan::before { background: #00f0ff; }
.module-pulse-card.emerald::before { background: #10b981; }
.module-pulse-card.purple::before { background: #8b5cf6; }
.module-pulse-card.amber::before { background: #f59e0b; }
.module-pulse-card.blue::before { background: #3b82f6; }

.module-pulse-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.module-pulse-meta {
    flex: 1;
    min-width: 0;
}

.module-pulse-meta .title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8696a0;
    letter-spacing: 0.5px;
}

.module-pulse-meta .value {
    font-size: 15px;
    font-weight: 700;
    color: #e9edef;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-pulse-meta .sub {
    font-size: 10.5px;
    color: #00a884;
    margin-top: 1px;
}

/* 3. UNIFIED CROSS-MODULE ACTIVITY STREAM (DASHBOARD) */
.interconnect-stream-panel {
    background: #111b21;
    border: 1px solid #202c33;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.interconnect-stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid #202c33;
    padding-bottom: 10px;
}

.interconnect-stream-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.interconnect-stream-item:hover {
    background: #182229;
    border-color: #2a3942;
}

.interconnect-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.interconnect-badge.whatsapp { background: rgba(0, 168, 132, 0.2); color: #25d366; border: 1px solid rgba(0,168,132,0.4); }
.interconnect-badge.leads { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.4); }
.interconnect-badge.products { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139,92,246,0.4); }
.interconnect-badge.rules { background: rgba(0, 240, 255, 0.2); color: #38bdf8; border: 1px solid rgba(0,240,255,0.4); }
.interconnect-badge.campaigns { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }

/* Quick Interconnection Drawer & Modal Grids */
.interconnect-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
}

.interconnect-picker-card {
    background: #182229;
    border: 1px solid #2a3942;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.interconnect-picker-card:hover {
    border-color: #00a884;
    background: #202c33;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 1024px) {
    .wa-customer-dossier {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 30;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
}

/* ==========================================================================
   ENTERPRISE UI/UX POLISH: WHATSAPP CLOUD HEADER & WAVEFORM AUDIO
   ========================================================================== */
.wa-chat-header {
    min-height: 64px !important;
    height: auto !important;
    background: rgba(32, 44, 51, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    padding: 10px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 2;
}

.wa-sidebar-header {
    min-height: 64px !important;
    height: auto !important;
    background: rgba(32, 44, 51, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.wa-header-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.wa-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(32, 44, 51, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e9edef;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.wa-header-btn:hover {
    background: rgba(0, 168, 132, 0.2);
    border-color: rgba(0, 168, 132, 0.5);
    color: #00a884;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.wa-header-btn.primary {
    background: rgba(0, 168, 132, 0.2);
    border-color: rgba(0, 168, 132, 0.45);
    color: #25d366;
}

.wa-header-btn.primary:hover {
    background: #00a884;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.4);
}

/* AI Engine Provider Badges */
.wa-ai-badge.groq {
    background: rgba(249, 115, 22, 0.18) !important;
    color: #fb923c !important;
    border: 1px solid rgba(249, 115, 22, 0.45) !important;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.2);
}

.wa-ai-badge.gemini {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

/* WhatsApp Audio Waveform Visualizer */
.wa-waveform-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(17, 27, 33, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 250px;
    max-width: 320px;
}

.wa-waveform-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00a884;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 168, 132, 0.35);
}

.wa-waveform-btn:hover {
    transform: scale(1.08);
    background: #06cf9c;
}

.wa-waveform-bars-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 26px;
    cursor: pointer;
    padding: 2px 0;
}

.wa-waveform-bar {
    flex: 1;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.26);
    transition: background-color 0.12s ease, transform 0.15s ease;
}

.wa-waveform-bar.played {
    background: #00a884;
}

.wa-waveform-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #8696a0;
    font-family: var(--font-mono, monospace);
    margin-top: 3px;
}

/* ==========================================================================
   ISSUE 1 & 2: LEAFLET RADAR MAP & 3-COLUMN RESPONSIVE LAYOUT
   ========================================================================== */
#liveRadarMap, .liveRadarMap, .wa-delivery-map-container, #live-delivery-map {
    height: calc(100vh - 80px) !important;
    min-height: 550px !important;
    width: 100% !important;
    z-index: 1 !important;
    background: #0b0f19 !important;
    position: relative !important;
    display: block !important;
}

/* Invert standard OpenStreetMap tiles into a crisp Dark Radar view without failing third-party CDNs */
#liveRadarMap .leaflet-tile-pane,
.liveRadarMap .leaflet-tile-pane,
.wa-delivery-map-container .leaflet-tile-pane,
#live-delivery-map .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

#wa-delivery-map {
    height: 280px !important;
    width: 100% !important;
    z-index: 1 !important;
    background: #0f172a !important;
    position: relative !important;
    display: block !important;
}

/* Clean 2-Column WhatsApp Web Layout with Slide-Over Customer Dossier Drawer */
#waWebViewContainer {
    position: relative !important;
    overflow: hidden !important;
}

.wa-sidebar {
    width: 280px !important;
    min-width: 260px !important;
    max-width: 320px !important;
    flex: 0 0 280px !important;
}

.wa-chat-pane, .wa-chat-main {
    flex: 1 1 0% !important;
    min-width: 360px !important;
    overflow-x: hidden !important;
}

/* Intercom-Style Slide-Over Customer Dossier Drawer */
.wa-customer-dossier, .wa-dossier-panel {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 330px !important;
    max-width: 90vw !important;
    z-index: 50 !important;
    background-color: #111b21 !important;
    border-left: 1px solid #222d34 !important;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.65) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    display: none;
    flex-direction: column !important;
}

.wa-customer-dossier:not(.collapsed), .wa-dossier-panel:not(.collapsed) {
    display: flex !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
}

.wa-customer-dossier.collapsed, .wa-dossier-panel.collapsed {
    display: none !important;
    transform: translateX(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Mobile Screen Full-Screen WhatsApp Web Experience (max-width: 768px) */
@media (max-width: 768px) {
    #waWebViewContainer {
        position: relative !important;
        flex-direction: row !important;
    }
    #waWebViewContainer .wa-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        display: flex !important;
        flex: 1 1 100% !important;
    }
    #waWebViewContainer .wa-chat-pane,
    #waWebViewContainer .wa-chat-main {
        display: none !important;
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
    #waWebViewContainer.mobile-chat-active .wa-sidebar {
        display: none !important;
    }
    #waWebViewContainer.mobile-chat-active .wa-chat-pane,
    #waWebViewContainer.mobile-chat-active .wa-chat-main {
        display: flex !important;
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
    #waWebViewContainer.mobile-chat-active #waMobileBackBtn {
        display: inline-flex !important;
    }
    .wa-customer-dossier, .wa-dossier-panel {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        left: 0 !important;
    }
}

.wa-messages-container {
    overflow-x: hidden !important;
}

/* Bottom chat input bar */
.wa-chat-input-bar, .wa-reply-bar {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    background-color: #202c33 !important;
    border-top: 1px solid #222d34 !important;
    position: relative !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
}

.wa-chat-input-bar .wa-chat-input,
.wa-chat-input-bar textarea,
.wa-chat-input-bar input,
.wa-reply-bar textarea,
.wa-reply-input {
    flex: 1 !important;
    min-width: 180px !important;
    height: 42px !important;
    max-height: 42px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background-color: #2a3942 !important;
    border: none !important;
    outline: none !important;
    border-radius: 8px !important;
    color: #e9edef !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    resize: none !important;
    font-family: inherit !important;
    line-height: 20px !important;
}

/* Total Campaigns Stat Metric Dark/Light Visibility Fix */
#cmpStatTotal {
    color: #0f172a !important;
}
.dark #cmpStatTotal {
    color: #f8fafc !important;
}

/* Blueprint Industry Card Active Badge & Highlight */
.blueprint-industry-card.active-installed {
    border-color: #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
}
.blueprint-industry-card .active-bp-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


/* ==========================================================================
   WORLD NO. 1 ENTERPRISE SAAS POLISH: LINEAR & INTERCOM GLASSMORPHISM
   ========================================================================== */
.enterprise-glass-header {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shakeCallIcon {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-15deg); }
    40% { transform: rotate(15deg); }
    60% { transform: rotate(-10deg); }
    80% { transform: rotate(10deg); }
}

@keyframes pulseAlertRing {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Light Theme Enhancements for WhatsApp Web & Enterprise Components */
html:not(.dark) .enterprise-glass-header, html.light .enterprise-glass-header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 168, 132, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}
html:not(.dark) .enterprise-glass-header h2, html.light .enterprise-glass-header h2 {
    color: #0f172a !important;
}
html:not(.dark) .wa-web-app, html.light .wa-web-app {
    background-color: #f0f2f5 !important;
    border: 1px solid rgba(0, 0, 0, 0.09) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08) !important;
}
html:not(.dark) .wa-sidebar, html.light .wa-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}
html:not(.dark) .wa-sidebar-header, html.light .wa-sidebar-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html:not(.dark) .wa-chat-header, html.light .wa-chat-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html:not(.dark) .wa-chat-input-bar, html.light .wa-chat-input-bar {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}
html:not(.dark) .wa-chat-input, html.light .wa-chat-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* Bug 2: Prevent Top Navbar Brand & Breadcrumb Wrapping */
.topbar-left,
.topbar-brand-area {
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.topbar-brand-title,
.breadcrumb-current,
#activeBreadcrumbText {
    white-space: nowrap !important;
}
