/* ==============================================================================
   ZENMOD APEX // NEXT-GENERATION UI/UX DESIGN SYSTEM
   Modern Dark Glassmorphism, Cyber-Indigo Accents, Precision Typography
   Strict Mobile Responsiveness & Container Boundary Containment
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    /* Color Palette */
    --zen-bg-base: #07090E;
    --zen-bg-surface: #0C111C;
    --zen-bg-elevated: #111827;
    --zen-bg-glass: rgba(15, 23, 42, 0.72);
    --zen-bg-glass-hover: rgba(26, 38, 66, 0.85);
    --zen-bg-card: #0C111C;
    --zen-card-bg: #0C111C;
    --zen-bg-input: rgba(10, 15, 29, 0.85);
    --zen-bg-sidebar: rgba(10, 15, 28, 0.95);
    --zen-bg-header: rgba(7, 9, 14, 0.85);

    /* Borders */
    --zen-border: rgba(255, 255, 255, 0.08);
    --zen-border-hover: rgba(99, 102, 241, 0.35);
    --zen-border-focus: rgba(99, 102, 241, 0.65);
    --zen-border-glass: rgba(255, 255, 255, 0.06);

    /* Gradients & Accents */
    --zen-primary: #6366F1;
    --zen-primary-hover: #4F46E5;
    --zen-primary-glow: 0 0 20px rgba(99, 102, 241, 0.35);
    --zen-primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --zen-secondary-gradient: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    --zen-accent-gradient: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --zen-success-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    
    --zen-indigo: #6366F1;
    --zen-purple: #8B5CF6;
    --zen-cyan: #06B6D4;
    --zen-emerald: #10B981;
    --zen-amber: #F59E0B;
    --zen-rose: #F43F5E;
    --zen-blue: #3B82F6;

    /* Text */
    --zen-text-main: #F8FAFC;
    --zen-text-dim: #94A3B8;
    --zen-text-muted: #64748B;
    --zen-text-light: #CBD5E1;

    /* Fonts */
    --zen-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --zen-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Elevation & Shadows */
    --zen-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --zen-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --zen-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --zen-shadow-glow: 0 0 28px rgba(99, 102, 241, 0.2);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 68px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

/* ==============================================================================
   UNIVERSAL BOX MODEL & BOUNDARY ENFORCEMENT
   ============================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) rgba(12, 17, 28, 0.6);
}

.min-w-0 {
    min-width: 0 !important;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--zen-bg-base);
    color: var(--zen-text-main);
    font-family: var(--zen-font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

/* Strict text wrapping & breaking rules */
p, span, div, h1, h2, h3, h4, h5, h6, label, a, button, td, th, li, code, pre, small {
    overflow-wrap: break-word;
    word-break: normal;
}

.text-break {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

.text-break-all {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

.text-break-force {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

.font-mono {
    font-family: var(--zen-font-mono) !important;
    overflow-wrap: anywhere;
}

/* ==============================================================================
   UNIVERSAL CUSTOM SCROLLBAR SYSTEM
   ============================================================================== */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: rgba(12, 17, 28, 0.7);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.38);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.75);
    border-color: rgba(99, 102, 241, 0.85);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

::-webkit-scrollbar-thumb:active {
    background: rgba(129, 140, 248, 0.95);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Modal, Diagnostics, and Panel Specific Scrollbars */
.modal-body,
.modal-dialog-scrollable .modal-body,
.apex-cmd-list,
.table-responsive,
.apex-nav-scroll,
pre,
code,
textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.45) rgba(10, 15, 29, 0.8);
}

.modal-body::-webkit-scrollbar,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar,
.apex-cmd-list::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.apex-nav-scroll::-webkit-scrollbar,
pre::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal-body::-webkit-scrollbar-track,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-track,
.apex-cmd-list::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.apex-nav-scroll::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: rgba(10, 15, 29, 0.8);
    border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb,
.apex-cmd-list::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.apex-nav-scroll::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.42);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb:hover,
.apex-cmd-list::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.apex-nav-scroll::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.85);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* Ambient glow backdrop */
body::before {
    content: "";
    position: fixed;
    top: -200px;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.04) 45%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    bottom: -150px;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, rgba(59, 130, 246, 0.03) 50%, transparent 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: -1;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
    color: var(--zen-text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
}

.text-main { color: var(--zen-text-main) !important; }
.text-light { color: var(--zen-text-light) !important; }
.text-dim { color: var(--zen-text-dim) !important; }
.text-muted { color: var(--zen-text-muted) !important; }
.text-indigo { color: var(--zen-indigo) !important; }
.text-purple { color: var(--zen-purple) !important; }
.text-cyan { color: var(--zen-cyan) !important; }
.text-emerald { color: var(--zen-emerald) !important; }
.text-amber { color: var(--zen-amber) !important; }
.text-rose { color: var(--zen-rose) !important; }

/* Main Application Layout Structure */
.apex-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    position: relative;
    overflow-x: hidden;
    z-index: auto;
}

/* Sidebar Navigation */
.apex-sidebar {
    width: var(--sidebar-width);
    background: var(--zen-bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--zen-border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 85vw;
}

.apex-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--zen-border);
    text-decoration: none;
    flex-shrink: 0;
}

.apex-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--zen-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: var(--zen-primary-glow);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.apex-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #FFFFFF 30%, #CBD5E1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.apex-brand-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    color: var(--zen-indigo);
    border: 1px solid rgba(99, 102, 241, 0.35);
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.apex-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.85rem;
}

.apex-nav-scroll::-webkit-scrollbar {
    width: 4px;
}
.apex-nav-scroll::-webkit-scrollbar-thumb {
    background: var(--zen-border);
    border-radius: 4px;
}

.apex-nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--zen-text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.5rem;
}

.apex-nav-item {
    margin-bottom: 3px;
}

.apex-nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: var(--zen-text-dim);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
    min-height: 40px;
}

.apex-nav-link i {
    font-size: 1.15rem;
    margin-right: 0.85rem;
    width: 20px;
    text-align: center;
    color: var(--zen-text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.apex-nav-link:hover {
    color: var(--zen-text-main);
    background: rgba(255, 255, 255, 0.04);
}

.apex-nav-link:hover i {
    color: var(--zen-indigo);
    transform: scale(1.1);
}

.apex-nav-link.active {
    color: #FFFFFF;
    background: rgba(99, 102, 241, 0.14);
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.28);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
}

.apex-nav-link.active i {
    color: var(--zen-indigo);
}

.apex-nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--zen-text-light);
}

/* Sidebar user card & wallet */
.apex-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--zen-border);
    background: rgba(10, 14, 26, 0.7);
    flex-shrink: 0;
}

.apex-wallet-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.apex-wallet-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--zen-text-dim);
}

.apex-wallet-amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

/* Main Container Area */
.apex-main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    width: 100%;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Topbar Header */
.apex-header {
    height: var(--header-height);
    background: var(--zen-bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--zen-border);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(0.75rem, 2vw, 1.75rem);
    width: 100%;
    max-width: 100%;
}

.apex-header-search-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--zen-border);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    color: var(--zen-text-dim);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apex-header-search-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--zen-border-hover);
    color: var(--zen-text-main);
}

.apex-kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-family: var(--zen-font-mono);
    color: var(--zen-text-light);
}

.apex-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--zen-emerald);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.apex-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--zen-emerald);
    box-shadow: 0 0 8px var(--zen-emerald);
    animation: pulseGlow 2s infinite;
    flex-shrink: 0;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--zen-emerald); }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* User Avatar Dropdown */
.apex-user-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--zen-border);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: var(--zen-text-main);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
}

.apex-user-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--zen-border-hover);
    color: #FFFFFF;
}

.apex-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--zen-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #FFFFFF;
    flex-shrink: 0;
}

/* Dropdown styling */
.dropdown-menu {
    --bs-dropdown-color: var(--zen-text-main);
    --bs-dropdown-bg: var(--zen-bg-surface);
    --bs-dropdown-border-color: var(--zen-border-hover);
    --bs-dropdown-link-color: var(--zen-text-dim);
    --bs-dropdown-link-hover-color: #FFFFFF;
    --bs-dropdown-link-hover-bg: rgba(99, 102, 241, 0.12);
    --bs-dropdown-divider-bg: var(--zen-border);
    background: var(--zen-bg-surface) !important;
    color: var(--zen-text-main) !important;
    border: 1px solid var(--zen-border-hover) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--zen-shadow-lg) !important;
    padding: 0.5rem;
    backdrop-filter: blur(20px);
    max-width: calc(100vw - 20px) !important;
}

.dropdown-item {
    color: var(--zen-text-dim) !important;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    overflow-wrap: break-word;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #FFFFFF !important;
}

.dropdown-item i {
    font-size: 1rem;
    margin-right: 0.65rem;
}

.dropdown-divider {
    border-color: var(--zen-border) !important;
    margin: 0.35rem 0;
}

/* Modal and Backdrop Isolation */
.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px);
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1055 !important;
    max-width: 95vw;
}

.modal-content {
    background: var(--zen-bg-surface) !important;
    border: 1px solid var(--zen-border-hover) !important;
    box-shadow: var(--zen-shadow-lg) !important;
    color: var(--zen-text-main) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    max-width: 100%;
}

/* SweetAlert2 Toast Custom Theme */
.swal2-toast.apex-swal-toast {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--zen-border-hover) !important;
    box-shadow: var(--zen-shadow-lg), var(--zen-shadow-glow) !important;
    border-radius: var(--radius-md) !important;
    color: var(--zen-text-main) !important;
    max-width: calc(100vw - 2rem) !important;
}

.swal2-toast .swal2-title {
    color: var(--zen-text-main) !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    overflow-wrap: break-word;
}

.swal2-popup {
    max-width: min(540px, calc(100vw - 1.5rem)) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--zen-border-hover) !important;
    background: var(--zen-bg-surface) !important;
    color: var(--zen-text-main) !important;
}

/* Content Viewport */
.apex-content-body {
    flex: 1;
    padding: clamp(0.85rem, 2.5vw, 1.75rem);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Glass Cards & Panels */
.apex-card {
    background: var(--zen-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--zen-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--zen-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

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

.apex-card-header {
    padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
    border-bottom: 1px solid var(--zen-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.apex-card-title {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 700;
    color: var(--zen-text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
}

.apex-card-body {
    padding: clamp(0.85rem, 2.5vw, 1.5rem);
    max-width: 100%;
}

.apex-card-body.p-0 {
    padding: 0 !important;
}

/* Stat & Metric Cards */
.apex-metric-card {
    background: var(--zen-bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--zen-border);
    border-radius: var(--radius-lg);
    padding: clamp(0.85rem, 2vw, 1.35rem);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.25s ease;
    min-width: 0;
    max-width: 100%;
}

.apex-metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--zen-border-hover);
    box-shadow: var(--zen-shadow-md), var(--zen-shadow-glow);
}

.apex-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.apex-metric-icon.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--zen-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.apex-metric-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--zen-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.apex-metric-icon.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--zen-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.apex-metric-icon.amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--zen-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.apex-metric-value {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-top: 0.35rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.apex-metric-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--zen-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    word-break: break-word;
}

/* Modern Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.15rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    max-width: 100%;
}

.btn-primary {
    background: var(--zen-primary-gradient);
    border: none;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--zen-border);
    color: var(--zen-text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--zen-border-hover);
    color: #FFFFFF;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--zen-indigo);
}

.btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--zen-indigo);
    color: #FFFFFF;
}

.btn-success {
    background: var(--zen-success-gradient);
    border: none;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
    border: none;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* Form Controls */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--zen-text-dim);
    margin-bottom: 0.4rem;
    overflow-wrap: break-word;
}

.form-control, .form-select {
    background-color: var(--zen-bg-input);
    border: 1px solid var(--zen-border);
    border-radius: var(--radius-sm);
    color: var(--zen-text-main);
    font-size: 0.88rem;
    padding: 0.6rem 0.9rem;
    transition: all 0.2s ease;
    max-width: 100%;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(14, 21, 38, 0.95);
    border-color: var(--zen-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: #FFFFFF;
}

.form-control::placeholder {
    color: var(--zen-text-muted);
}

.input-group {
    flex-wrap: nowrap;
    max-width: 100%;
}

.input-group-text {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--zen-border);
    color: var(--zen-text-dim);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Custom Checkbox & Switch */
.form-check-input {
    background-color: var(--zen-bg-input);
    border: 1px solid var(--zen-border);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--zen-indigo);
    border-color: var(--zen-indigo);
}

select option {
    background-color: #0C111C !important;
    color: #F8FAFC !important;
}

/* ==============================================================================
   UNIVERSAL TABLE & DATATABLES DARK THEME
   ============================================================================== */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0 !important;
    border: none;
    position: relative;
}

table, .table, table.dataTable {
    --bs-table-color: #F8FAFC !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: rgba(255, 255, 255, 0.08) !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-color: #F8FAFC !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-active-color: #F8FAFC !important;
    --bs-table-active-bg: rgba(255, 255, 255, 0.04) !important;
    --bs-table-hover-color: #FFFFFF !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04) !important;
    color: #F8FAFC !important;
    background-color: transparent !important;
    border-color: var(--zen-border) !important;
    margin-bottom: 0 !important;
    font-size: 0.85rem;
    width: 100% !important;
}

table th, table td,
table.dataTable th, table.dataTable td,
.table > :not(caption) > * > * {
    color: #F8FAFC !important;
    background-color: transparent !important;
    border-bottom: 1px solid var(--zen-border) !important;
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
}

table thead th, table.dataTable thead th {
    background-color: rgba(12, 17, 28, 0.95) !important;
    color: #94A3B8 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--zen-border) !important;
    white-space: nowrap;
}

table tbody tr:hover, table.dataTable tbody tr:hover,
table.table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #FFFFFF !important;
}

/* DataTables Controls & Text */
.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
}

.dataTables_wrapper,
.dataTables_wrapper label,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: #94A3B8 !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: var(--zen-bg-input) !important;
    border: 1px solid var(--zen-border) !important;
    border-radius: var(--radius-sm) !important;
    color: #F8FAFC !important;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem !important;
    color: var(--zen-text-dim) !important;
    font-size: 0.8rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--zen-border) !important;
    border-radius: 6px !important;
    color: var(--zen-text-dim) !important;
    padding: 0.3rem 0.75rem !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--zen-primary-gradient) !important;
    border-color: transparent !important;
    color: #FFFFFF !important;
}

.dataTables_wrapper .pagination .page-item .page-link {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--zen-border) !important;
    color: #94A3B8 !important;
    border-radius: 6px !important;
    margin: 0 2px;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background: var(--zen-primary-gradient) !important;
    border-color: transparent !important;
    color: #FFFFFF !important;
}

.dataTables_wrapper .pagination .page-item.disabled .page-link {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #64748B !important;
}

/* Badge System */
.badge-apex {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
    white-space: nowrap;
    max-width: 100%;
}

.badge-apex-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
}

.badge-apex-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FBBF24;
}

.badge-apex-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #FB7185;
}

.badge-apex-indigo {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818CF8;
}

.badge-apex-cyan {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22D3EE;
}

/* Interactive Duration Cards */
.duration-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.duration-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--zen-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
}

.duration-card:hover {
    border-color: var(--zen-border-hover);
    background: rgba(26, 38, 66, 0.6);
    transform: translateY(-2px);
}

.duration-card.selected {
    background: rgba(99, 102, 241, 0.15);
    border: 1.5px solid var(--zen-indigo);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.duration-card .duration-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
}

.duration-card .duration-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--zen-indigo);
}

/* Command Palette Modal */
.apex-cmd-modal .modal-content {
    background: var(--zen-bg-surface);
    backdrop-filter: blur(28px);
    border: 1px solid var(--zen-border-hover);
    border-radius: var(--radius-xl);
    box-shadow: var(--zen-shadow-lg);
    overflow: hidden;
}

.apex-cmd-input-wrap {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--zen-border);
    gap: 0.75rem;
}

.apex-cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.apex-cmd-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem;
}

.apex-cmd-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--zen-text-dim);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.apex-cmd-item:hover, .apex-cmd-item.active {
    background: rgba(99, 102, 241, 0.14);
    color: #FFFFFF;
}

.apex-cmd-item i {
    font-size: 1.15rem;
    color: var(--zen-indigo);
    flex-shrink: 0;
}

/* Copy Toast & Notification System */
.apex-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--zen-indigo);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: var(--zen-shadow-lg), var(--zen-primary-glow);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - 2rem);
}

.apex-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==============================================================================
   RESPONSIVE OVERRIDES & MOBILE BREAKPOINTS
   ============================================================================== */

/* Tablets & Below (< 992px) */
@media (max-width: 991.98px) {
    .apex-sidebar {
        transform: translateX(-100%);
        width: min(280px, 85vw);
    }
    
    .apex-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    }
    
    .apex-main-wrapper {
        margin-left: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .apex-header {
        height: 60px;
    }
}

/* Mobile Devices (<= 767.98px) */
@media (max-width: 767.98px) {
    body {
        font-size: 13.5px;
    }

    .apex-content-body {
        padding: 1rem 0.85rem !important;
    }

    .apex-card-body {
        padding: 1.15rem 1rem !important;
    }

    .apex-card-header {
        padding: 0.9rem 1rem !important;
    }

    /* DataTables mobile layout */
    .dataTables_wrapper .row {
        margin: 0 !important;
    }
    
    .dataTables_wrapper .row > div {
        padding: 0.35rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        align-items: flex-start;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .dataTables_wrapper .dataTables_length label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        padding-top: 0.75rem !important;
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_paginate ul.pagination {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 3px;
    }

    .dataTables_wrapper .pagination .page-item .page-link {
        padding: 0.25rem 0.55rem !important;
        font-size: 0.75rem !important;
    }
}

/* Small Mobile Devices (<= 575.98px) */
@media (max-width: 575.98px) {
    .apex-content-body {
        padding: 0.85rem 0.65rem !important;
    }

    .apex-card {
        border-radius: var(--radius-md) !important;
    }

    .apex-card-body {
        padding: 1rem 0.75rem !important;
    }

    .duration-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .apex-toast {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        max-width: calc(100vw - 2rem) !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.85rem !important;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.85rem;
    }

    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100vw - 1rem) !important;
    }

    .modal-content {
        max-height: calc(100vh - 1rem) !important;
        border-radius: var(--radius-lg) !important;
    }

    .modal-body {
        padding: 1rem !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }

    .apex-metric-card {
        padding: 0.95rem 0.85rem !important;
    }

    .apex-metric-icon {
        width: 38px;
        height: 38px;
        font-size: 1.15rem;
    }
}

/* Ultra-Compact Mobile Screens (<= 375px) */
@media (max-width: 375px) {
    .apex-brand-pill {
        display: none !important;
    }
    
    .badge-apex {
        font-size: 0.68rem !important;
        padding: 0.2rem 0.45rem !important;
    }

    .apex-header {
        padding: 0 0.5rem !important;
    }
}

/* ==============================================================================
   MODAL & BACKDROP STACKING ENFORCEMENT
   ============================================================================== */
.modal {
    z-index: 1060 !important;
}

.modal-dialog {
    z-index: 1061 !important;
    position: relative !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-backdrop.show {
    opacity: 0.65 !important;
}

/* ==============================================================================
   RESPONSIVE SIZING & UTILITIES
   ============================================================================== */
@media (min-width: 576px) {
    .w-sm-auto { width: auto !important; }
    .w-sm-100 { width: 100% !important; }
    .flex-sm-grow-0 { flex-grow: 0 !important; }
    .flex-sm-grow-1 { flex-grow: 1 !important; }
}

@media (min-width: 768px) {
    .w-md-auto { width: auto !important; }
    .w-md-100 { width: 100% !important; }
    .flex-md-grow-0 { flex-grow: 0 !important; }
    .flex-md-grow-1 { flex-grow: 1 !important; }
}

@media (min-width: 992px) {
    .w-lg-auto { width: auto !important; }
    .w-lg-100 { width: 100% !important; }
}

