:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #000000;
    --bg-card: rgba(20, 20, 20, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --accent: #f59e0b;
    --glass-border: rgba(255, 255, 255, 0.08);
    --info: #3498db;
    --sidebar-bg: #000000;
    --header-bg: rgba(0, 0, 0, 0.5);
    --table-username: #ffffff;
    --table-password: #ffffff;
    --status-success: #22c55e;
    --status-danger: #ef4444;
    --stat-label-color: var(--text-muted);
}

body.light-mode {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #000000;
    --text-muted: #1e293b;
    --glass-border: rgba(0, 0, 0, 0.15);
    --sidebar-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.9);
    --primary: #4f46e5;
    --table-username: #000000;
    --table-password: #000000;
    --stat-label-color: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.3s ease, color 0.3s ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    animation: slideUp 0.6s ease-out;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

th, td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
    vertical-align: middle;
    color: var(--text-main);
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto;
    display: block;
}

.table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
    margin-bottom: 0;
}

th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding-bottom: 0.8rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* --- Sidebar Navigation (Desktop) --- */
.sidebar {
    width: 250px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    background: var(--sidebar-bg);
    flex-shrink: 0;
}

/* Base Nav Styles */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item, .nav-parent {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    justify-content: flex-start;
}

.nav-parent {
    justify-content: space-between;
}

.nav-item:hover, .nav-parent:hover {
    background: var(--glass-border);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-item i, .nav-parent i:first-child {
    font-size: 1.1rem;
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.nav-submenu {
    display: flex;
    flex-direction: column;
    padding-left: 2.5rem;
    gap: 0.2rem;
    overflow: hidden;
    height: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.nav-group.open .nav-submenu {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid var(--glass-border);
}

.nav-sub-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-sub-item:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.03);
}

.nav-sub-item.active {
    color: var(--primary);
    font-weight: 500;
}

.chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-group.open .chevron {
    transform: rotate(90deg);
}

.dashboard-layout {
    display: flex !important;
    min-height: 100vh;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

.main-view {
    flex: 1 !important;
    padding: 0.75rem 1.25rem;
    background: var(--bg-dark);
    min-width: 0 !important;
    overflow-x: hidden;
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
}

/* Mobile Sidebar & Toggle */
.mobile-header {
    display: none;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1002;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.menu-toggle, .theme-toggle-btn {
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.theme-toggle-btn:active, .menu-toggle:active {
    transform: scale(0.9);
}

.theme-toggle-btn i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
        display: block !important;
    }

    .mobile-header {
        display: flex;
        height: 60px;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        z-index: 2000; /* Higher than sidebar */
        padding: 0 1rem;
        background: var(--bg-card);
        border-bottom: 1px solid var(--glass-border);
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .sidebar {
        position: fixed;
        left: -100% !important;
        top: 0;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1200;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 0;
        box-shadow: 15px 0 50px rgba(0,0,0,0.6);
        background: var(--sidebar-bg);
    }

    .sidebar.active {
        left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(4px);
        z-index: 1150;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-view {
        padding: 75px 1rem 2rem 1rem !important; /* Proper clearance for 60px header */
        min-height: 100vh;
        width: 100% !important;
        box-sizing: border-box;
    }

    .header {
        display: none !important; /* Hide redundant desktop header on mobile */
    }

    /* Fix Vertical Text and Logo Wrapping */
    .logo, .logo-mini {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        white-space: nowrap !important;
    }

    .logo h2, .logo-mini h3 {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    .logo svg, .logo-mini svg {
        flex-shrink: 0 !important;
        width: 32px !important;
        height: 32px !important;
    }

    /* Column Hiding for Mobile Tables */
    .hide-mobile { display: none !important; }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-widgets {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .action-group {
        justify-content: flex-start;
        gap: 8px;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-widgets {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Dual-Listbox (Transfer) Styles */
.dual-list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}
.list-box {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    height: 480px;
    display: flex;
    flex-direction: column;
}
.list-box h4 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.list-search {
    margin-bottom: 1rem;
}
.list-items {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid var(--glass-border);
}
.list-item {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    user-select: none;
}
.list-item:hover {
    background: rgba(255,255,255,0.05);
    padding-left: 1rem;
}
.list-item.active-select {
    background: rgba(99, 102, 241, 0.2) !important;
    border-left: 3px solid var(--primary);
}
.list-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.control-btn {
    background: #f39c12; /* Golden/Yellow as in screenshot */
    color: #000;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
.control-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: #f1c40f;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
.control-btn i {
    font-size: 1.1rem;
}

/* Modals & Overlays v12.1 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content-scroll {
    max-height: 65vh;
    overflow-y: auto;
    margin-top: 1.5rem;
    padding-right: 0.5rem;
}

/* Login Container */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent),
                radial-gradient(circle at bottom left, rgba(243, 156, 18, 0.1), transparent);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text; /* Standard */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Global Hidden Helper */
.sidebar-overlay {
    display: none;
}

/* --- Final Dashboard Polish v12.7 --- */
.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    min-width: 100px;
}

.action-btn {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    background: rgba(255,255,255,0.05) !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.action-btn:hover {
    background: var(--primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4) !important;
}

.action-btn.delete:hover {
    background: var(--danger) !important;
}

.mobile-only-flex {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only-flex {
        display: flex !important;
    }
}

.action-btn i {
    font-size: 0.8rem !important;
}

/* View Header & Search Box */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 450px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 5;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.8rem !important;
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: white !important;
    font-size: 0.9rem !important;
    transition: all 0.3s;
}

.search-box input:focus {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

/* Desktop Optimized Proportions - Collapsible Sidebar */
@media (min-width: 1200px) {
    .sidebar { 
        width: 80px !important; 
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-x: hidden;
        white-space: nowrap;
    }
    .sidebar:hover { 
        width: 280px !important; 
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 1.2rem; /* Adds beautiful consistent spacing between items */
    }
    
    /* Hide text nodes and chevrons when collapsed */
    .sidebar:not(:hover) .logo h2 span { display: none; }
    .sidebar:not(:hover) .sidebar-nav span { display: none; }
    .sidebar:not(:hover) .chevron { display: none; }
    
    /* Hide submenus cleanly when collapsed */
    .sidebar:not(:hover) .nav-submenu { opacity: 0; pointer-events: none; height: 0; padding: 0; overflow: hidden; display: none; }
    
    /* (AUTO-EXPAND 1) Show all submenus beautifully when expanded! */
    .sidebar:hover .nav-submenu {
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding-top: 0.5rem !important;
        padding-left: 2.2rem !important; /* Proper indentation relative to parent */
        overflow: visible !important;
    }
    
    /* Rotate chevrons downwards to indicate they are fully open */
    .sidebar:hover .nav-parent .chevron {
        transform: rotate(90deg);
        transition: transform 0.3s ease;
    }
    
    /* Align inner items nicely when small */
    .sidebar:not(:hover) .nav-item, 
    .sidebar:not(:hover) .nav-parent {
        justify-content: center;
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.05); /* Adds a divider line to satisfy "مقسمين" */
    }
    
    .sidebar:not(:hover) .nav-item i, 
    .sidebar:not(:hover) .nav-parent i:first-child {
        margin: 0;
        font-size: 1.4rem;
        color: var(--primary); /* Keep icons visible and vibrant */
    }

    .main-view { padding: 2rem 1.5rem !important; }
    .table td { padding: 0.8rem 1.2rem !important; vertical-align: middle !important; }
    .header h2 { font-size: 2rem; }
}

.btn-sm {
    padding: 0.5rem 1rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
}

/* ===== MOBILE CARD LAYOUT (StreamCreed Style) ===== */
.mobile-cards {
    display: none; /* Hidden on desktop */
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
}

.user-card:active {
    transform: scale(0.99);
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

.card-value {
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0.8rem;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.card-actions .action-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
}

.card-actions .action-btn i {
    font-size: 1rem !important;
}

/* Show entries dropdown */
.entries-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.entries-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.entries-select select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Status badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-info { background: rgba(52,152,219,0.15); color: var(--info); }

/* Online dot indicator */
.online-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.online-dot.on { background: var(--success); }
.online-dot.off { background: var(--danger); }

/* ===== MOBILE OVERRIDES (below 768px) ===== */
@media (max-width: 768px) {
    /* Hide desktop tables, show mobile cards */
    .table-responsive { display: none !important; }
    .mobile-cards { display: block !important; }
    
    /* Entries bar responsive */
    .entries-bar { flex-direction: column; align-items: stretch; }
    
    /* Dual list responsive */
    .dual-list { flex-direction: column; }
    .list-box { height: 250px; }
    .list-controls { flex-direction: row; justify-content: center; }
    
    /* Filter group wrap */
    .filter-group { flex-wrap: wrap; }
    .filter-group .btn { flex: 1; min-width: 60px; text-align: center; font-size: 0.75rem !important; padding: 0.4rem 0.5rem !important; }
    
    /* View header stack */
    .view-header { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
}

/* Pagination responsive */
@media (max-width: 768px) {
    .dt-pagination { gap: 2px !important; }
    .dt-pagination button { padding: 4px 8px !important; font-size: 0.75rem !important; }
}

/* ===== BULK MANAGEMENT UI ===== */
.bulk-action-bar {
    display: none; /* Shown dynamically by JS */
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: fadeInDown 0.3s ease-out;
}

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

.bulk-btn-group {
    display: flex;
    gap: 0.5rem;
}

.bulk-create-card {
    border-left: 4px solid var(--info) !important;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
}

.bulk-q-input {
    width: 60px;
    height: 32px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

.bulk-prefix-input {
    width: 100px;
    height: 32px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

.bulk-pkg-select {
    width: 140px;
    height: 32px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
}

/* === ENHANCED LINES MANAGEMENT UI === */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.table th {
    font-weight: 500;
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255,255,255,0.05) !important;
    padding: 15px 10px !important;
}

.table td {
    padding: 12px 10px !important;
    vertical-align: middle;
}

/* Force full width */
.card.glass {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-success { background: #ffffff; color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-danger { background: #ffffff; color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: #ffffff; color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.2); }
.badge-info { background: #ffffff; color: #3498db; border: 1px solid rgba(52, 152, 219, 0.2); }

@media (max-width: 1200px) {
    .view-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .mobile-only-flex {
        display: flex !important;
    }
}

/* Dashboard Modern Stats System (Classic Definitions) */
.section-title {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.stat-card {
    padding: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    border-left: 4px solid var(--primary);
}

.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-5px); }

.stat-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--stat-label-color);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-icon-bg {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.05); /* Default */
}

/* Color Palette Overrides for Stat Cards (Classic Theme) */
.stat-card.blue   { border-left-color: #3498db; background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.green  { border-left-color: #2ecc71; background: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.red    { border-left-color: #e74c3c; background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.orange { border-left-color: #f39c12; background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.purple { border-left-color: #9b59b6; background: linear-gradient(135deg, rgba(155, 89, 182, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.yellow { border-left-color: #f1c40f; background: linear-gradient(135deg, rgba(241, 196, 15, 0.1) 0%, rgba(20,20,20,0.7) 100%); }
.stat-card.cyan   { border-left-color: #1abc9c; background: linear-gradient(135deg, rgba(26, 188, 156, 0.1) 0%, rgba(20,20,20,0.7) 100%); }

.stat-card.blue .stat-icon-bg   { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.stat-card.green .stat-icon-bg  { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.stat-card.red .stat-icon-bg    { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.stat-card.orange .stat-icon-bg { background: rgba(243, 156, 18, 0.2); color: #f39c12; }
.stat-card.purple .stat-icon-bg { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.stat-card.yellow .stat-icon-bg { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.stat-card.cyan .stat-icon-bg   { background: rgba(26, 188, 156, 0.2); color: #1abc9c; }

/* Text color helpers */
.text-green  { color: #2ecc71 !important; }
.text-red    { color: #e74c3c !important; }
.text-orange { color: #f39c12 !important; }
.text-yellow { color: #f1c40f !important; }
.text-cyan   { color: #1abc9c !important; }
.text-purple { color: #9b59b6 !important; }

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
