/* ==========================================================================
   RAZORRECOVERY AI — ULTRA-PREMIUM ENTERPRISE DESIGN SYSTEM (v4.0 PROD)
   Benchmarked: LINEAR + STRIPE + RAYCAST + VERCEL
   Architecture: Tokenized CSS, Ambient Radial Glows, Tactile Frosted Glass,
                 JetBrains Mono Micro-Typography, Sub-pixel Transitions
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
    /* Base OLED Canvas & Layered Surfaces */
    --bg-canvas: #080b11;
    --bg-surface: #0c101a;
    --bg-surface-elevated: #111726;
    --bg-card: rgba(13, 18, 30, 0.72);
    --bg-card-hover: rgba(19, 27, 44, 0.82);
    --bg-glass: rgba(13, 18, 30, 0.65);
    --bg-input: rgba(6, 9, 15, 0.85);
    
    /* Linear-Grade 1px Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-card: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(56, 189, 248, 0.35);
    --border-focus: #00d2ff;
    --border-highlight: rgba(255, 255, 255, 0.15);
    
    /* Electric Razorpay Cyan / Blue Accent (Linear + Stripe) */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary: #00d2ff;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    --primary-glow: rgba(0, 210, 255, 0.28);
    --primary-grad: linear-gradient(135deg, #00d2ff 0%, #0070f3 100%);
    --accent-glow: #00d2ff;
    
    /* Emerald Recovery Green (Stripe / Supabase) */
    --success: #10b981;
    --success-500: #10b981;
    --success-600: #059669;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.28);
    --success-glow: rgba(16, 185, 129, 0.25);
    --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    /* Amber Warning / Quiet Hours Gating */
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.28);
    --warning-glow: rgba(245, 158, 11, 0.22);
    
    /* Crimson Danger / Stopped / Disputed */
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.28);
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    /* Sky Info / Ingested */
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.1);
    --info-border: rgba(14, 165, 233, 0.28);
    --info-glow: rgba(14, 165, 233, 0.22);
    
    /* Typography Palette */
    --text-main: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-accent: #00d2ff;
    
    /* Font Families */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
    
    /* Font Sizing Scale */
    --text-3xs: 9.5px;
    --text-2xs: 10.5px;
    --text-xs: 11.5px;
    --text-sm: 12.5px;
    --text-base: 13.5px;
    --text-md: 15px;
    --text-lg: 17px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    
    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    
    /* Border Radii (Tactile Raycast Shape) */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
    --radius-full: 9999px;
    
    /* Layered Linear/Raycast Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.65), 0 4px 12px -2px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 25px var(--primary-glow);
    --shadow-success-glow: 0 0 25px var(--success-glow);
    
    /* Z-Index Hierarchy */
    --z-bg: -1;
    --z-base: 1;
    --z-sticky: 40;
    --z-drawer: 80;
    --z-helper: 90;
    --z-modal: 1000;
    --z-toast: 2000;
    
    /* High-Precision Cubic-Bezier Transitions */
    --transition-fast: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. CORE RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    background-color: var(--bg-canvas);
}

body {
    background-color: var(--bg-canvas);
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 210, 255, 0.12), transparent 70%),
        radial-gradient(ellipse 60% 40% at 85% 65%, rgba(16, 185, 129, 0.05), transparent 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    color: var(--text-body);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessible Focus States (Linear Style Ring) */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

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

/* Tabular Numerals & Monospace */
.tabular-nums, .metric-value, .amount, .res-val, th, td, code, kbd, .ticker-message, .status-mode {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

code, kbd, pre, .font-mono {
    font-family: var(--font-mono);
}

/* Tactile Keycap Key Tags (Linear Style) */
kbd {
    background: #0d1322;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--accent-glow);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: var(--text-2xs);
    font-weight: 600;
    display: inline-block;
}

/* Skip Navigation Link */
.skip-nav-link {
    position: absolute;
    top: -50px;
    left: 12px;
    background: var(--primary-grad);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: var(--z-toast);
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-nav-link:focus {
    top: 12px;
}

/* ==========================================================================
   GLOBAL HIDDEN SCROLLBAR SYSTEM (Zero-Width Invisible Scrollbars)
   Preserves full trackpad, mousewheel, touch & keyboard scrolling across
   Chrome, Safari, Edge, Firefox, and Opera with zero visual clutter.
   ========================================================================== */

/* Universal Scrollbar Hiding for Modern Browsers */
html, body, *, *::before, *::after {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE and Edge */
}

/* Chrome, Safari, Edge & Opera Webkit Engine */
*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    background: transparent !important;
}

::-webkit-scrollbar-track,
*::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
    display: none !important;
    background: transparent !important;
}

/* Ensure smooth touch/trackpad scrolling behavior across all scrollable containers */
html, body, .dashboard-container, .main-content, .sidebar, 
.pipelines-table-container, .table-container, .table-responsive,
.modal-overlay, .modal-card, .drawer-content,
.reasoning-body, .compliance-content, .roi-panel, .terminal-log-pane,
pre, code, textarea {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
}

/* Typography Elements with Tight Tracking (Vercel Style) */
h1, h2, h3, h4, h5, .logo-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

p {
    color: var(--text-body);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   3. BACKGROUND PARTICLES CANVAS
   -------------------------------------------------------------------------- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-bg);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. DASHBOARD CONTAINER LAYOUT
   -------------------------------------------------------------------------- */
.dashboard-container {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   5. SIDEBAR NAVIGATION (FROSTED GLASS & HIGH-CONTRAST BORDERS)
   -------------------------------------------------------------------------- */
.sidebar {
    background: rgba(10, 14, 24, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-5) var(--space-3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
    width: 236px;
    min-width: 236px;
    overflow-y: auto;
    z-index: var(--z-sticky);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.logo-area:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.logo-icon {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: var(--text-lg);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.logo-subtitle {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--accent-glow);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.nav-item i {
    font-size: 13.5px;
    width: 16px;
    text-align: center;
    color: var(--text-dim);
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-subtle);
}

.nav-item:hover i {
    color: var(--primary-400);
}

.nav-item.active {
    color: var(--text-main);
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.12) 0%, rgba(0, 210, 255, 0.02) 100%);
    border: 1px solid rgba(0, 210, 255, 0.28);
    box-shadow: 0 2px 10px rgba(0, 210, 255, 0.08);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--accent-glow);
}

.sidebar-footer {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.sidebar-security-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.sidebar-security-badge .security-icon {
    color: var(--success);
    font-size: 14px;
}

.security-details {
    display: flex;
    flex-direction: column;
}

.security-title {
    font-size: var(--text-3xs);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.security-grade {
    font-size: var(--text-xs);
    color: var(--success);
    font-family: var(--font-mono);
}

.system-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 6px;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-details {
    display: flex;
    flex-direction: column;
}

.status-name {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-main);
}

.status-mode {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. MAIN WORKSPACE CONTENT
   -------------------------------------------------------------------------- */
.main-content {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 100vh;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   7. HEADER BAR & GLOBAL AI COPILOT SEARCH
   -------------------------------------------------------------------------- */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    max-width: 700px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--accent-glow);
    font-size: 13.5px;
    pointer-events: none;
}

.global-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-full);
    padding: 9px 92px 9px 38px;
    color: var(--text-main);
    font-size: var(--text-sm);
    font-family: inherit;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.global-search-input:focus {
    background: rgba(13, 18, 30, 0.95);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2), 0 0 20px rgba(0, 210, 255, 0.15);
    outline: none;
}

.global-search-input::placeholder {
    color: var(--text-dim);
}

#ai-query-btn {
    position: absolute;
    right: 6px;
    background: var(--primary-grad);
    border: none;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 210, 255, 0.3);
}

#ai-query-btn:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 210, 255, 0.45);
}

#ai-query-btn:active {
    transform: translateY(0);
}

.suggested-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    padding-left: 6px;
}

.tag {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tag:hover {
    color: var(--accent-glow);
    background: rgba(0, 210, 255, 0.08);
    border-color: rgba(0, 210, 255, 0.28);
}

.user-profile-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-profile-controls i {
    font-size: 14.5px;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-profile-controls i:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   8. LIVE OPERATIONS TELEMETRY STREAM BAR (RADAR GLOW)
   -------------------------------------------------------------------------- */
.live-ops-ticker-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: linear-gradient(90deg, rgba(13, 18, 30, 0.95) 0%, rgba(18, 25, 42, 0.85) 100%);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
    min-height: 40px;
    backdrop-filter: blur(16px);
}

.ticker-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.pulsing-radar-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: var(--radius-full);
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulseRadar 1.8s infinite;
}

@keyframes pulseRadar {
    0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ticker-title {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.8px;
}

.ticker-message-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.ticker-message {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-body);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticker-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-ticker {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: var(--text-3xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.btn-ticker:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--border-hover);
}

/* --------------------------------------------------------------------------
   9. UNIFIED COMMAND CENTER KPI CARDS (TACTILE FROSTED GLASS)
   -------------------------------------------------------------------------- */
.unified-command-center {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
    width: 100%;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.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);
}

.metric-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.metric-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-value {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* Status Badges */
.badge {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-risk {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-rate {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-glow);
    border: 1px solid rgba(0, 210, 255, 0.28);
}

.trend-up {
    color: var(--success);
    font-size: 11px;
}

/* Linear Meter Bars */
.progress-bar-slider {
    width: 100%;
    margin-top: 4px;
}

.slider-fill {
    height: 4px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    box-shadow: 0 0 8px var(--danger-glow);
    transition: width 0.6s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--text-dim);
    margin-top: 2px;
}

.metric-line-indicator {
    height: 4px;
    border-radius: var(--radius-full);
    margin-top: 4px;
    transition: width 0.6s ease;
}

.fill-recovered {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 0 8px var(--success-glow);
}

.fill-rate {
    background: var(--primary-grad);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Progress Ring Mini */
.progress-ring-mini {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 88;
    transition: stroke-dashoffset 0.6s ease;
}

/* --------------------------------------------------------------------------
   10. THREE-COLUMN WORKSPACE GRID
   -------------------------------------------------------------------------- */
.workspace-grid-three {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr) 310px;
    gap: var(--space-3);
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.grid-col {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.col-pipelines, .col-noc, .col-audit {
    min-width: 0;
    max-width: 100%;
}

.grid-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.card-title-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.card-title-header h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-header-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sup-text {
    font-size: var(--text-3xs);
    color: var(--text-dim);
    font-weight: normal;
}

/* --------------------------------------------------------------------------
   11. COLUMN 1: AI GATEWAY NOC NETWORK MAP
   -------------------------------------------------------------------------- */
.noc-network-map {
    display: flex;
    justify-content: space-between;
    position: relative;
    height: 240px;
    margin: 6px 0;
}

.noc-nodes-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 2;
}

.node-bank {
    background: rgba(10, 14, 24, 0.92);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.node-bank:hover {
    border-color: var(--primary);
    transform: scale(1.03);
    box-shadow: 0 0 12px var(--primary-glow);
}

.node-bank.degraded {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.icon-red { color: #f87171; }
.icon-blue { color: #38bdf8; }
.icon-yellow { color: #fbbf24; }

.noc-svg-wires {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.noc-status-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-end;
    z-index: 2;
}

.health-target {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(10, 14, 24, 0.7);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-subtle);
}

.bullet-green { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 5px var(--success); }
.bullet-red { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 5px var(--danger); }
.bullet-orange { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 5px var(--warning); }
.bullet-yellow { width: 6px; height: 6px; border-radius: 50%; background: #eab308; box-shadow: 0 0 5px #eab308; }

.noc-footer-simulation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #27354a;
    transition: 0.3s;
    border-radius: 34px;
}

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

input:checked + .switch-slider {
    background-color: var(--danger);
}

input:checked + .switch-slider:before {
    transform: translateX(16px);
}

/* --------------------------------------------------------------------------
   12. COLUMN 2: RECOVERY PIPELINES TABLE & SCORECARD
   -------------------------------------------------------------------------- */
.pipeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.pipeline-card-header h3 {
    font-size: var(--text-sm);
    font-weight: 700;
}

.tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-2xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--primary-grad);
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(0, 210, 255, 0.3);
}

.mobile-table-hint {
    display: none;
}

.pipelines-table-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 380px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(6, 9, 15, 0.4);
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.pipelines-table-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.pipeline-table-v3 {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-xs);
    text-align: left;
}

.pipeline-table-v3 thead {
    background: rgba(9, 13, 22, 0.95);
    position: sticky;
    top: 0;
    z-index: 5;
}

.pipeline-table-v3 th {
    padding: 9px 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: var(--text-3xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-card);
    white-space: nowrap;
}

.pipeline-table-v3 td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    vertical-align: middle;
    white-space: nowrap;
}

.pipeline-table-v3 tbody tr {
    cursor: pointer;
    transition: var(--transition-fast);
}

.pipeline-table-v3 tbody tr:hover {
    background: rgba(0, 210, 255, 0.06);
}

.pipeline-table-v3 tbody tr.active-row {
    background: rgba(0, 210, 255, 0.12);
    border-left: 3px solid var(--primary);
}

/* Stage & Status Badges (Linear Style Pills) */
.stage-pill {
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: var(--text-3xs);
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.stage-ingested { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.stage-diagnosed { background: rgba(168, 85, 247, 0.1); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.stage-chasing { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.stage-gated { background: rgba(245, 158, 11, 0.15); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.35); }
.stage-recovered { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.stage-stopped { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.stage-disputed { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid var(--danger-border); }

.contact-badge {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: var(--text-3xs);
    font-weight: 600;
}

/* Impact & Performance Scorecard */
.scorecard-bottom-panel {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-3);
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

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

.scorecard-header-row h3 {
    font-size: var(--text-xs);
    font-weight: 700;
}

.days-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--text-dim);
}

.scorecard-metrics-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.3fr;
    gap: var(--space-2);
    align-items: center;
}

.compliance-progress-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compliance-label {
    font-size: var(--text-3xs);
    color: var(--text-muted);
}

.compliance-label strong {
    color: var(--success);
    font-family: var(--font-mono);
}

.progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill.fill-green {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 8px var(--success-glow);
    height: 100%;
    transition: width 0.5s ease;
}

.revenue-recovered-badge {
    font-size: var(--text-2xs);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.rev-val strong {
    color: var(--success);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

.scorecard-charts {
    width: 100%;
    height: 60px;
}

/* --------------------------------------------------------------------------
   13. COLUMN 3: SIMULATION, COPILOT, STEPPER & AUDIT
   -------------------------------------------------------------------------- */
.simulation-control-card {
    background: rgba(10, 14, 24, 0.75);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.simulation-control-card h3 {
    font-size: var(--text-xs);
    font-weight: 700;
}

.simulation-btn-group {
    display: flex;
    gap: var(--space-2);
}

.btn {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--primary-grad);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 210, 255, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-card);
    color: var(--text-body);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.btn-step-sim {
    flex: 1;
}

.btn-full-sim {
    flex: 1;
}

.override-selector-pane {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--text-2xs);
    color: var(--text-muted);
}

.override-selector-pane select, select {
    background: #080b11;
    border: 1px solid var(--border-card);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-2xs);
    outline: none;
    font-family: inherit;
}

/* Visual Customer Dunning Journey Stepper */
.customer-journey-stepper {
    background: rgba(10, 14, 24, 0.85);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

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

.journey-label {
    font-size: var(--text-3xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.journey-status-pill {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(0, 210, 255, 0.12);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.stepper-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 4px 0;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.step-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0d121f;
    border: 2px solid #27354a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #64748b;
    transition: var(--transition);
}

.step-text {
    font-size: 8.5px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}

.step-node.completed .step-circle {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.step-node.completed .step-text {
    color: #10b981;
}

.step-node.current .step-circle {
    background: rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
    color: #00d2ff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
    animation: pulseRing 1.5s infinite;
}

.step-node.current .step-text {
    color: #00d2ff;
    font-weight: 700;
}

.step-node.stopped .step-circle {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.step-node.stopped .step-text {
    color: #ef4444;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: #27354a;
    margin: 0 2px;
    margin-bottom: 14px;
    transition: var(--transition);
}

.step-connector.filled {
    background: linear-gradient(90deg, #10b981, #00d2ff);
    box-shadow: 0 0 6px rgba(0, 210, 255, 0.4);
}

@keyframes pulseRing {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(0, 210, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

/* AI Reasoning Audit Accordion */
.audit-accordion-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audit-placeholder {
    text-align: center;
    padding: 24px 14px;
    background: rgba(10, 14, 24, 0.5);
    border: 1px dashed var(--border-card);
    border-radius: var(--radius-md);
}

.brain-icon {
    font-size: 28px;
    color: var(--accent-glow);
    margin-bottom: 8px;
}

.audit-placeholder h3 {
    font-size: var(--text-sm);
    margin-bottom: 4px;
}

.audit-placeholder p {
    font-size: var(--text-2xs);
    color: var(--text-muted);
    line-height: 1.4;
}

/* Accordion Item Structure */
.accordion-item {
    background: rgba(10, 14, 24, 0.85);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    overflow: hidden;
}

.accordion-header {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 600;
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-content {
    padding: 8px 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-2xs);
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.25);
}

/* Multi-Channel Preview Components */
.channel-preview-tab-row {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.channel-tab-chip {
    font-family: var(--font-mono);
    padding: 3px 8px;
    font-size: var(--text-3xs);
    font-weight: 600;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.channel-tab-chip:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.channel-tab-chip.active {
    background: rgba(0, 210, 255, 0.15);
    color: #00d2ff;
    border-color: var(--primary);
}

.whatsapp-bubble-card {
    background: #0b141a;
    border: 1px solid #1f2c34;
    border-radius: var(--radius-sm);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.whatsapp-msg-body {
    background: #005c4b;
    color: #e9edef;
    padding: 7px 9px;
    border-radius: 8px 8px 0 8px;
    align-self: flex-end;
    max-width: 95%;
    font-size: var(--text-2xs);
    line-height: 1.4;
}

.whatsapp-action-btn {
    background: #25d366;
    color: #0b141a;
    border: none;
    font-weight: 700;
    font-size: var(--text-2xs);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: var(--transition-fast);
}

.whatsapp-action-btn:hover {
    background: #1eb954;
}

/* --------------------------------------------------------------------------
   14. MODALS & RAYCAST FROSTED GLASS OVERLAYS
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 12, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: var(--space-4);
}

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

.modal-card {
    background: rgba(13, 18, 30, 0.95);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.96) translateY(6px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
    transform: scale(1) translateY(0);
}

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

.modal-header h2 {
    font-size: var(--text-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.modal-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.5;
}

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

/* Results Grid in Simulation Modal */
.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.result-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.res-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

.res-val {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 800;
    color: var(--text-main);
}

.text-recovered {
    color: var(--success);
}

.results-charts {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: var(--space-3);
    align-items: center;
    margin: var(--space-3) 0;
}

.chart-wrapper {
    display: flex;
    justify-content: center;
}

/* Terminal Console Modal (Root System Gate) */
.terminal-modal-card {
    background: #040810;
    border: 1px solid rgba(0, 255, 102, 0.35);
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.18);
    font-family: var(--font-mono);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 102, 0.2);
    padding-bottom: var(--space-2);
}

.terminal-header h2 {
    color: #00ff66;
    font-size: var(--text-sm);
    font-family: var(--font-mono);
}

.terminal-close {
    background: transparent;
    border: none;
    color: #00ff66;
    font-size: 18px;
    cursor: pointer;
}

.terminal-input {
    background: #020408;
    border: 1px solid rgba(0, 255, 102, 0.3);
    color: #00ff66;
    padding: 8px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    width: 100%;
    outline: none;
}

.terminal-btn {
    background: rgba(0, 255, 102, 0.12);
    border: 1px solid #00ff66;
    color: #00ff66;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-weight: 600;
}

.terminal-btn:hover {
    background: #00ff66;
    color: #000000;
}

.terminal-log-pane {
    background: #020408;
    border: 1px solid rgba(0, 255, 102, 0.2);
    color: #00ff66;
    padding: 8px;
    border-radius: var(--radius-xs);
    font-size: var(--text-3xs);
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   15. FLOATING SHORTCUT PILL & TOAST SYSTEM
   -------------------------------------------------------------------------- */
.keyboard-helper-pill {
    position: fixed;
    bottom: 18px;
    right: 20px;
    background: rgba(13, 18, 30, 0.9);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-muted);
    font-size: var(--text-2xs);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: var(--z-helper);
    transition: var(--transition);
}

.keyboard-helper-pill:hover {
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.keyboard-helper-pill strong {
    color: var(--accent-glow);
}

/* Toast System (Raycast Style Notification) */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(13, 18, 30, 0.95);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(20px);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { border-color: var(--success); }
.toast.danger { border-color: var(--danger); }
.toast.info { border-color: var(--primary); }

/* --------------------------------------------------------------------------
   16. RESPONSIVE MEDIA QUERIES (PERFECT FIT ON EVERY SCREEN)
   -------------------------------------------------------------------------- */

/* Large Desktops (1440px+) */
@media (min-width: 1440px) {
    .dashboard-container {
        grid-template-columns: 245px minmax(0, 1fr);
    }
    .workspace-grid-three {
        grid-template-columns: 240px minmax(0, 1fr) 330px;
        gap: var(--space-4);
    }
    .main-content {
        padding: var(--space-5) var(--space-6);
    }
}

/* Standard Laptops & Landscape Tablets (1024px - 1280px) */
@media (max-width: 1280px) {
    .dashboard-container {
        grid-template-columns: 215px minmax(0, 1fr);
    }
    .workspace-grid-three {
        grid-template-columns: 200px minmax(0, 1fr) 280px;
        gap: var(--space-2);
    }
    .metric-value {
        font-size: var(--text-lg);
    }
    .main-content {
        padding: var(--space-3) var(--space-4);
    }
}

/* ============================================================
   MOBILE TOPBAR & DRAWER SYSTEM
   ============================================================ */

/* Hidden on desktop, visible only on mobile */
.mobile-topbar {
    display: none;
}

.mobile-drawer-backdrop {
    display: none;
}

.mobile-drawer {
    display: none;
}

/* ============================================================
   TABLETS & SMALL LANDSCAPE (768px – 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 10px var(--space-4);
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .logo-area {
        margin-bottom: 0;
    }
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .sidebar-footer {
        display: none;
    }
    .unified-command-center {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
    }
    .workspace-grid-three {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
    .col-pipelines {
        grid-column: 1 / -1;
        order: 1;
    }
    .col-noc {
        order: 2;
    }
    .col-audit {
        order: 3;
    }
}

/* ============================================================
   MOBILE SCREENS (≤ 768px) — Full Mobile Overhaul
   ============================================================ */
@media (max-width: 768px) {

    /* ── 1. Layout: Hide desktop sidebar, show mobile topbar ── */
    .sidebar {
        display: none !important;
    }

    .dashboard-container {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .main-content {
        padding: 12px;
        gap: 10px;
        padding-top: calc(56px + 12px); /* Offset for sticky topbar */
    }

    /* ── 2. Mobile Sticky Top-Bar ── */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        z-index: 900;
        background: rgba(8, 11, 17, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-subtle);
        padding: 0 16px;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    }

    .mobile-topbar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-topbar-brand .logo-icon {
        width: 22px;
        height: 22px;
        filter: drop-shadow(0 0 6px var(--primary-glow));
    }

    .mobile-brand-name {
        font-family: var(--font-display);
        font-size: 14px;
        font-weight: 800;
        background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        letter-spacing: -0.02em;
    }

    .mobile-brand-sub {
        display: block;
        font-family: var(--font-mono);
        font-size: 9px;
        color: var(--accent-glow);
        letter-spacing: 1px;
        text-transform: uppercase;
        font-weight: 700;
        margin-top: 1px;
        line-height: 1;
    }

    /* ── 3. Hamburger Button ── */
    .mobile-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        cursor: pointer;
        padding: 8px 9px;
        transition: var(--transition-fast);
    }

    .mobile-hamburger:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--border-hover);
    }

    .mobile-hamburger.open .hamburger-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-hamburger.open .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .mobile-hamburger.open .hamburger-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hamburger-line {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-muted);
        border-radius: 2px;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: center;
    }

    /* ── 4. Drawer Backdrop ── */
    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(4, 7, 12, 0.72);
        backdrop-filter: blur(4px);
        z-index: 950;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

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

    /* ── 5. Mobile Slide-In Nav Drawer ── */
    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: min(80vw, 300px);
        height: 100vh;
        background: rgba(9, 13, 22, 0.98);
        border-right: 1px solid var(--border-card);
        backdrop-filter: blur(32px);
        -webkit-backdrop-filter: blur(32px);
        z-index: 960;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        padding: 0;
    }

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

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px 12px;
        border-bottom: 1px solid var(--border-subtle);
        background: rgba(255, 255, 255, 0.02);
    }

    .mobile-drawer-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-drawer-brand .logo-icon {
        width: 22px;
        height: 22px;
        filter: drop-shadow(0 0 6px var(--primary-glow));
    }

    .mobile-drawer-close {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        font-size: 18px;
        cursor: pointer;
        transition: var(--transition-fast);
        line-height: 1;
    }

    .mobile-drawer-close:hover {
        color: var(--text-main);
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--border-hover);
    }

    .mobile-drawer-nav {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 12px 10px;
    }

    .mobile-drawer-nav .nav-item {
        font-size: 13.5px;
        padding: 11px 14px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-drawer-footer {
        padding: 12px 14px;
        border-top: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* ── 6. Header Bar ── */
    .header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-container {
        max-width: 100%;
    }

    .global-search-input {
        font-size: 13px;
        padding: 10px 88px 10px 36px;
    }

    .suggested-tags {
        overflow-x: auto;
        padding-bottom: 2px;
        flex-wrap: nowrap;
    }

    .user-profile-controls {
        justify-content: flex-end;
    }

    /* ── 7. KPI Cards — 2-column grid on mobile ── */
    .unified-command-center {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .metric-card {
        padding: 12px;
        min-height: 90px;
    }

    .metric-value {
        font-size: var(--text-xl) !important;
        line-height: 1.15;
    }

    .metric-label {
        font-size: var(--text-2xs);
    }

    .badge {
        font-size: 8.5px;
        padding: 1px 5px;
    }

    /* ── 8. Ticker Bar ── */
    .live-ops-ticker-bar {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 8px 10px;
        min-height: 36px;
    }

    .ticker-badge {
        padding: 2px 6px;
        flex-shrink: 0;
    }

    .ticker-title {
        display: none; /* hide label text, keep dot */
    }

    .ticker-message-container {
        flex: 1;
        min-width: 0;
    }

    .ticker-message {
        font-size: 10.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ticker-controls {
        gap: 4px;
        flex-shrink: 0;
    }

    .btn-ticker {
        font-size: 9.5px;
        padding: 3px 6px;
        gap: 3px;
    }

    /* ── 9. Workspace Grid — Single Column Strictly Constrained ── */
    .workspace-grid-three {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .col-pipelines {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .col-noc {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .col-audit {
        order: 3 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .grid-col {
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* ── 10. NOC Map — Fits 100% within mobile viewport ── */
    .noc-network-map {
        height: 220px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        position: relative !important;
        overflow: hidden !important;
        margin: 6px 0 !important;
        box-sizing: border-box !important;
    }

    .noc-nodes-column {
        flex-shrink: 0 !important;
        z-index: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        width: auto !important;
    }

    .node-bank {
        padding: 6px 9px !important;
        font-size: 11px !important;
        gap: 5px !important;
        border-radius: var(--radius-xs) !important;
    }

    .noc-status-column {
        flex-shrink: 0 !important;
        z-index: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        align-items: flex-end !important;
        width: auto !important;
    }

    .health-target {
        padding: 3px 6px !important;
        font-size: 9.5px !important;
        gap: 4px !important;
        white-space: nowrap !important;
    }

    .noc-svg-wires {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }

    .noc-footer-simulation {
        flex-wrap: wrap !important;
        gap: 8px !important;
        font-size: 11px !important;
        padding-top: 8px !important;
    }

    /* ── 11. Pipeline Table ── */
    .pipeline-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .pipeline-card-header .tabs {
        width: 100% !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .pipeline-card-header .tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .mobile-table-hint {
        display: flex !important;
        align-items: center;
        gap: 6px;
        font-size: 10px;
        color: var(--accent-glow);
        background: rgba(0, 210, 255, 0.08);
        border: 1px solid rgba(0, 210, 255, 0.2);
        border-radius: var(--radius-xs);
        padding: 5px 8px;
        margin-bottom: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .pipelines-table-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: 340px !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-subtle);
        background: rgba(6, 9, 15, 0.5);
        box-sizing: border-box !important;
    }

    .pipeline-table-v3 {
        min-width: 540px !important;
        width: 100% !important;
    }

    .pipeline-table-v3 th,
    .pipeline-table-v3 td {
        padding: 7px 6px !important;
        font-size: 10.5px !important;
    }

    .pipeline-table-v3 th {
        font-size: 9px !important;
        letter-spacing: 0.3px !important;
    }

    .pipeline-table-v3 td:nth-child(1) {
        min-width: 110px;
        white-space: normal !important;
    }
    .pipeline-table-v3 td:nth-child(2) {
        min-width: 65px;
        white-space: nowrap !important;
        font-weight: 700;
        font-family: var(--font-mono);
    }
    .pipeline-table-v3 td:nth-child(3) {
        min-width: 130px;
        max-width: 170px;
        white-space: normal !important;
        line-height: 1.25;
    }
    .pipeline-table-v3 td:nth-child(4) {
        min-width: 45px;
        text-align: center !important;
        white-space: nowrap !important;
    }
    .pipeline-table-v3 td:nth-child(5) {
        min-width: 80px;
        text-align: center !important;
        white-space: nowrap !important;
    }
    .pipeline-table-v3 td:nth-child(6) {
        min-width: 45px;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* ── 12. Simulation Control Buttons ── */
    .simulation-control-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .simulation-btn-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .btn-step-sim,
    .btn-full-sim {
        width: 100% !important;
        justify-content: center !important;
        font-size: 11.5px !important;
        padding: 9px 8px !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .override-selector-pane {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        width: 100% !important;
        margin-top: 6px !important;
    }

    .override-selector-pane label {
        font-size: 11px !important;
        color: var(--text-muted);
    }

    .override-selector-pane select {
        font-size: 13px !important;
        padding: 8px 10px !important;
        width: 100% !important;
        background: var(--bg-input) !important;
        color: var(--text-main) !important;
        border: 1px solid var(--border-card) !important;
        border-radius: var(--radius-sm) !important;
        box-sizing: border-box !important;
    }

    /* ── 13. Scorecard ── */
    .scorecard-bottom-panel {
        padding-top: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .scorecard-metrics-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .scorecard-charts {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 75px !important;
        position: relative !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    #scorecardLineChart {
        width: 100% !important;
        max-width: 100% !important;
        height: 75px !important;
        display: block !important;
    }

    /* ── 14. Modals — full-mobile sizing ── */
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .modal-card {
        padding: 14px;
        max-height: 92vh;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-bottom: 0;
    }

    .modal-header h2 {
        font-size: 13.5px;
    }

    .modal-body {
        gap: 10px !important;
    }

    /* ── 15. Batch Results Grid ── */
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .results-charts {
        grid-template-columns: 1fr;
    }

    .roi-results-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── 16. Keyboard Helper Pill ── */
    .keyboard-helper-pill {
        bottom: 12px;
        right: 12px;
        font-size: 10px;
        padding: 5px 10px;
    }

    /* ── 17. Certificate modal code block ── */
    .modal-body code {
        font-size: 8px;
        word-break: break-all;
    }
}

/* --------------------------------------------------------------------------
   17. ACCESSIBILITY & REDUCED MOTION PREFERENCES (WCAG 2.2 AA)
   -------------------------------------------------------------------------- */
@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;
    }
    .pulsing-radar-dot, .step-node.current .step-circle {
        animation: none !important;
    }
    #bg-canvas {
        display: none !important;
    }
}
