:root {
    --dark-bg: #1a1d2e;
    --darker-bg: #141729;
    --sidebar-bg: #6B46C1;
    --sidebar-hover: #7c3aed;
    --card-bg: #252942;
    --card-border: #323756;
    --purple-primary: #8b5cf6;
    --purple-light: #a78bfa;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
}

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

body {
    background: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Admin Wrapper Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #6B46C1 0%, #553C9A 100%);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: #fff;
}

.sidebar-header h5 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #fff;
    padding-left: 1.5rem;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left-color: #fff;
    font-weight: 600;
}

.sidebar-link.text-danger {
    color: #fca5a5 !important;
}

.sidebar-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fee2e2 !important;
}

.sidebar-divider {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.sidebar-divider:empty {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.25rem;
    padding: 0;
}

/* Main Content */
.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 2rem;
    background: var(--dark-bg);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 i {
    color: var(--purple-light);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.card-header {
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid var(--card-border);
    color: var(--purple-light);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid var(--card-border);
    color: var(--purple-light);
    font-weight: 700;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
}

.table tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Forms */
.form-label {
    color: var(--purple-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control,
.form-select,
textarea.form-control {
    background: var(--darker-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background: var(--darker-bg);
    border-color: var(--purple-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
    color: white;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

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

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

/* Alerts */
.alert {
    border-radius: 0.75rem;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-left: 4px solid #10b981;
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    color: #f87171;
}

.alert-info {
    background: rgba(139, 92, 246, 0.15);
    border-left: 4px solid var(--purple-primary);
    color: var(--purple-light);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid #f59e0b;
    color: #fbbf24;
}

/* Text Colors */
.text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
}

code {
    background: var(--darker-bg);
    color: var(--purple-light);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Utility Classes */
.opacity-50 {
    opacity: 0.5;
}

.fw-bold {
    font-weight: 700 !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Dashboard Gradient Cards - Keep existing styles */
.card.text-white {
    border: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.card.text-white .card-body {
    position: relative;
    overflow: hidden;
}

.card.text-white i {
    opacity: 0.3;
    font-size: 3rem;
}

/* Smooth scrollbar for sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===================================
   LIGHT MODE THEME
   =================================== */
html[data-admin-theme="light"] {
    --dark-bg: #f3f4f6;
    --darker-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
}

html[data-admin-theme="light"] body {
    background: var(--dark-bg);
    color: var(--text-primary);
}

html[data-admin-theme="light"] .admin-content {
    background: #f9fafb;
}

html[data-admin-theme="light"] .card {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

html[data-admin-theme="light"] .card-header {
    background: #f9fafb;
    border-bottom-color: var(--card-border);
    color: var(--text-primary);
}

html[data-admin-theme="light"] .table {
    color: var(--text-primary);
}

html[data-admin-theme="light"] .table thead {
    background: #f9fafb;
    color: var(--text-primary);
}

html[data-admin-theme="light"] .form-control,
html[data-admin-theme="light"] .form-select {
    background: #ffffff;
    border-color: #d1d5db;
    color: var(--text-primary);
}

html[data-admin-theme="light"] .form-control:focus,
html[data-admin-theme="light"] .form-select:focus {
    background: #ffffff;
    border-color: var(--purple-primary);
    color: var(--text-primary);
}

html[data-admin-theme="light"] .alert {
    color: var(--text-primary);
}

html[data-admin-theme="light"] .text-muted {
    color: var(--text-secondary) !important;
}

html[data-admin-theme="light"] .modal-content {
    background: #ffffff;
    color: var(--text-primary);
}

html[data-admin-theme="light"] .modal-header {
    border-bottom-color: var(--card-border);
}

html[data-admin-theme="light"] .modal-footer {
    border-top-color: var(--card-border);
}

/* Modern Stat Cards */
.stat-card {
    position: relative;
    border-radius: 1.25rem;
    padding: 1.75rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.9;
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card-gradient-1 {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
}

.stat-card-gradient-2 {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.stat-card-gradient-3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-gradient-4 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
    background: rgba(255, 255, 255, 0.3);
}

.stat-icon i {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stat-value {
    color: white;
    font-weight: 800;
    font-size: 2.25rem;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.stat-card:hover .stat-card-glow {
    opacity: 1;
}

/* Additional vibrant gradients for top row cards */
.stat-card-gradient-5 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-gradient-6 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-gradient-7 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card-gradient-8 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Responsive adjustments for stat cards */
@media (max-width: 768px) {
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
    }
    
    .stat-icon i {
        font-size: 1.75rem;
    }
    
    .stat-value {
        font-size: 1.875rem;
    }
    
    .stat-card-body {
        gap: 1rem;
    }
}

/* Modern Cards with Classic Layout - Vibrant Gradients */
.modern-card {
    border-radius: 1rem;
    border: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.modern-card .card-body {
    padding: 1.5rem;
}

.modern-card-label {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modern-card-value {
    color: white;
    font-weight: 800;
    font-size: 2rem;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modern-card-icon {
    opacity: 0.25;
    transition: all 0.3s ease;
}

.modern-card:hover .modern-card-icon {
    opacity: 0.35;
    transform: scale(1.05) rotate(-5deg);
}

.modern-card-icon i {
    color: white;
}

/* Vibrant Gradient Colors for Perfect Text Visibility */
.modern-card-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modern-card-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.modern-card-cyan {
    background: linear-gradient(135deg, #4facfe 0%, #00a8e8 100%);
}

.modern-card-green {
    background: linear-gradient(135deg, #43e97b 0%, #38c770 100%);
}

.modern-card-orange {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
}

.modern-card-teal {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.modern-card-indigo {
    background: linear-gradient(135deg, #5f72bd 0%, #9921e8 100%);
}

.modern-card-rose {
    background: linear-gradient(135deg, #ff6a88 0%, #ff4757 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-card-value {
        font-size: 1.75rem;
    }
    
    .modern-card-label {
        font-size: 0.75rem;
    }
    
    .modern-card-icon i {
        font-size: 2rem !important;
    }
}
