/* Admin Panel Styles */
:root {
    /* Premium Color Palette - Sophisticated Indigo & Slate */
    --admin-primary: #6366f1;
    --admin-primary-dark: #4f46e5;
    --admin-primary-light: #818cf8;
    --admin-secondary: #0ea5e9;
    --admin-accent: #f43f5e;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-error: #ef4444;
    --admin-info: #06b6d4;

    /* Elegant Backgrounds */
    --admin-bg-primary: #ffffff;
    --admin-bg-secondary: #f4f7fa;
    /* Slightly warmer gray */
    --admin-bg-sidebar: #0f172a;
    --admin-bg-glass: rgba(255, 255, 255, 0.7);
    --admin-bg-sidebar-active: rgba(255, 255, 255, 0.08);

    /* Professional Typography */
    --admin-text-primary: #1e293b;
    --admin-text-secondary: #64748b;
    --admin-text-light: #94a3b8;
    --admin-text-white: #ffffff;

    /* Borders & Shadows - Soft & Deep */
    --admin-border: #e2e8f0;
    --admin-border-light: #f1f5f9;
    --admin-glass-border: rgba(255, 255, 255, 0.1);

    --admin-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --admin-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --admin-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -8px rgba(0, 0, 0, 0.04);
    --admin-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Radii - Modern & Smooth */
    --admin-radius-sm: 0.5rem;
    --admin-radius-md: 0.75rem;
    --admin-radius-lg: 1.25rem;
    --admin-radius-xl: 1.75rem;

    --admin-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--admin-bg-secondary);
    color: var(--admin-text-primary);
    line-height: 1.6;
}

/* ========================================
   Sidebar - Modern, Clean & Professional Design
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0f172a;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.15) 0, transparent 50%);
    color: #ffffff;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

.sidebar.collapsed {
    width: 80px;
}

/* Sidebar Header - Clean & Compact */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 72px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.sidebar-logo i {
    font-size: 1.375rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

/* Sidebar Navigation - Organized & Clean */
.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    margin: 0;
    padding: 0;
}

/* Group items with subtle spacing */
.nav-item:not(:first-child) {
    margin-top: 0.125rem;
}

/* Nav Link - Professional Style */
.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--admin-text-light);
    text-decoration: none;
    transition: var(--admin-transition);
    position: relative;
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: var(--admin-bg-sidebar-active);
    color: var(--admin-text-white);
    padding-left: 1.75rem;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    color: #ffffff;
    font-weight: 600;
    border-left-color: var(--admin-primary);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.25s ease;
}

.nav-link:hover i,
.nav-link.active i {
    opacity: 1;
}

.nav-link span {
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* Logout Link - Special Styling */
.nav-link.logout {
    color: #f87171;
    margin-top: 0.5rem;
}

.nav-link.logout:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border-left-color: rgba(248, 113, 113, 0.5);
}

.nav-link.logout i {
    color: #f87171;
}

/* Nav Separator - Subtle & Clean */
.nav-separator {
    margin: 0.75rem 0;
    padding: 0;
}

.nav-separator hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 0 1.5rem;
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
    margin: 0;
    border-left: none;
    border-radius: 8px;
    margin: 0.125rem 0.75rem;
}

.sidebar.collapsed .nav-link.active::before {
    display: none;
}

.sidebar.collapsed .nav-link.active {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
}

.sidebar.collapsed .nav-separator hr {
    margin: 0 0.75rem;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.25rem;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Mobile: Hide desktop burger, show mobile burger */
    .desktop-burger-toggle {
        display: none !important;
    }

    .mobile-burger-toggle {
        display: flex !important;
    }

    /* Mobile sidebar behavior */
    .sidebar {
        width: 100% !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar.collapsed {
        width: 100% !important;
        transform: translateX(-100%) !important;
    }

    .sidebar.collapsed.open {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    /* Mobile overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        display: none;
        backdrop-filter: blur(4px);
    }

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

@media (max-width: 480px) {
    .user-role {
        display: none;
    }
}

@media (min-width: 769px) {

    /* Desktop: Hide mobile burger, show desktop burger */
    .mobile-burger-toggle {
        display: none;
    }

    .desktop-burger-toggle {
        display: flex;
    }

    /* Desktop sidebar behavior */
    .sidebar {
        width: 280px;
        transform: translateX(0);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.collapsed {
        width: 80px;
    }

    .main-content {
        margin-left: 280px;
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .main-content.expanded {
        margin-left: 80px;
    }

    /* Hide overlay on desktop */
    .sidebar-overlay {
        display: none !important;
    }
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-left: 80px;
}

/* Top Bar */
.topbar {
    background: var(--admin-bg-primary);
    border-bottom: 1px solid var(--admin-border-light);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    min-height: 72px;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* Mobile Burger Button (Fixed Position - HP) */
.mobile-burger-toggle {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 1001 !important;
    display: none;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    border: none !important;
    font-size: 1rem !important;
    color: #ffffff !important;
    cursor: pointer !important;
    padding: 0.75rem !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    width: 48px !important;
    height: 48px !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4) !important;
    backdrop-filter: blur(10px) !important;
}

.mobile-burger-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Desktop Burger Button (In Header - PC) */
.desktop-burger-toggle {
    display: flex;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border);
    font-size: 1rem;
    color: var(--admin-text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--admin-transition);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.desktop-burger-toggle:hover {
    background: var(--admin-border-light);
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--admin-primary);
    color: var(--admin-text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: none;
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .topbar {
        padding: 0.75rem;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .topbar-title {
        font-size: 1.125rem;
    }

    .user-details {
        display: none;
    }
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-xl);
    cursor: pointer;
    transition: var(--admin-transition);
}

.user-menu:hover {
    background: var(--admin-bg-primary);
    border-color: var(--admin-primary-light);
    box-shadow: var(--admin-shadow-sm);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

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

.user-role {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--admin-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text-white);
    font-size: 0.95rem;
}

/* Page Content */
.page-content {
    padding: 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 2rem;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--admin-radius-md);
    margin-bottom: 1rem;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--admin-success);
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--admin-error);
}

.flash-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--admin-warning);
}

.flash-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--admin-info);
}

.flash-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--admin-transition);
}

.flash-close:hover {
    opacity: 1;
}

/* Cards */
.card {
    background: var(--admin-bg-primary);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-lg);
    border: 1px solid var(--admin-border);
    overflow: hidden;
    transition: var(--admin-transition);
}

.card:hover {
    box-shadow: var(--admin-shadow-xl);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-light);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--admin-bg-secondary);
    border-top: 1px solid var(--admin-border);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--admin-radius-lg);
    border: 1px solid var(--admin-border);
    background: var(--admin-bg-primary);
    box-shadow: var(--admin-shadow-sm);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: #f8fafc;
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-secondary);
    border-bottom: 2px solid var(--admin-border-light);
    text-align: left;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--admin-border-light);
    color: var(--admin-text-primary);
    font-size: 0.9375rem;
    transition: var(--admin-transition);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: var(--admin-bg-secondary);
    color: var(--admin-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--admin-radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--admin-transition);
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
    color: var(--admin-text-white);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--admin-primary-light) 0%, var(--admin-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

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

.btn-secondary:hover {
    background: var(--admin-bg-secondary);
    border-color: var(--admin-primary-light);
    color: var(--admin-primary);
}

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

.btn-success {
    background: var(--admin-success);
    color: var(--admin-text-white);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--admin-shadow-md);
}

.btn-warning {
    background: var(--admin-warning);
    color: var(--admin-text-white);
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: var(--admin-shadow-md);
}

.btn-error {
    background: var(--admin-error);
    color: var(--admin-text-white);
}

.btn-error:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--admin-shadow-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

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

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--admin-text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    font-size: 0.875rem;
    transition: var(--admin-transition);
    background: var(--admin-bg-primary);
    color: var(--admin-text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--admin-bg-primary);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--admin-shadow-lg);
    border: 1px solid var(--admin-border-light);
    position: relative;
    overflow: hidden;
    transition: var(--admin-transition);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--admin-shadow-xl);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    transition: var(--admin-transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-icon.primary {
    background: var(--admin-primary);
}

.stat-icon.success {
    background: var(--admin-success);
}

.stat-icon.warning {
    background: var(--admin-warning);
}

.stat-icon.error {
    background: var(--admin-error);
}

.stat-icon.info {
    background: var(--admin-info);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--admin-success);
}

.stat-change.negative {
    color: var(--admin-error);
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-burger-toggle {
        display: flex !important;
    }

    .desktop-burger-toggle {
        display: none;
    }

    .page-content {
        padding: 1.5rem 1rem;
    }

    .topbar {
        padding: 1rem 1.5rem;
        padding-left: 5rem;
    }

    .card {
        border-radius: var(--admin-radius-md);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .table-container {
        font-size: 0.875rem;
        border-radius: var(--admin-radius-md);
    }

    .table th {
        padding: 1rem 0.75rem;
        font-size: 0.7rem;
    }

    .table td {
        padding: 0.875rem 0.75rem;
        font-size: 0.875rem;
    }

    .card-header {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }

    .btn-sm {
        padding: 0.4rem 0.875rem;
        font-size: 0.7rem;
    }

    .topbar {
        padding: 0.875rem 1rem;
        padding-left: 4.5rem;
        min-height: 64px;
    }

    .topbar-title {
        font-size: 1.125rem;
    }

    .user-details {
        display: none;
    }

    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .mobile-burger-toggle {
        top: 0.75rem !important;
        left: 0.75rem !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 0.9rem !important;
    }

    .topbar {
        padding: 0.75rem;
        padding-left: 4rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    position: relative;
    cursor: pointer;
    flex: 1;
}

.nav-dropdown-toggle .nav-dropdown-icon {
    position: absolute;
    right: 1.5rem;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
    margin-left: auto;
}

.nav-dropdown.active .nav-dropdown-toggle .nav-dropdown-icon {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown-toggle:hover .nav-dropdown-icon {
    opacity: 1;
}

.nav-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid transparent;
}

.nav-dropdown.active .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    border-left: 4px solid var(--admin-primary);
}

.nav-dropdown.active .nav-dropdown-menu {
    max-height: 500px;
    padding: 0.5rem 0;
}

.nav-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    position: relative;
}

.nav-dropdown-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-dropdown-link.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--admin-primary);
    padding-left: calc(3.5rem + 1rem - 4px);
}

.nav-dropdown-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--admin-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 10px var(--admin-primary);
}

.nav-dropdown-link i {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-dropdown-link:hover i,
.nav-dropdown-link.active i {
    opacity: 1;
}

.nav-dropdown-link span {
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Collapsed Sidebar Dropdown Styles */
.sidebar.collapsed .nav-dropdown-toggle .nav-dropdown-icon {
    display: none;
}

.sidebar.collapsed .nav-dropdown-menu {
    display: none;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-menu {
    display: block;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    margin-left: 0.5rem;
    padding: 0.5rem 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-link {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-link:hover {
    padding-left: 1.5rem;
}

.sidebar.collapsed .nav-dropdown.active .nav-dropdown-link.active {
    padding-left: calc(1.5rem - 3px);
}

/* Utilities */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.2);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

/* ========================================
   TinyMCE Fixes - Fullscreen & Modals
   ======================================== */
/* Ensure TinyMCE fullscreen mode covers everything (Sidebar, Topbar) */
.tox-tinymce--fullscreen {
    z-index: 5000 !important;
}

/* Ensure TinyMCE helper wrapper (if used) is high enough */
.editor-wrapper.fullscreen {
    z-index: 4999 !important;
}

/* Ensure TinyMCE Dialogs, Popups and Tooltips are on top of everything */
.tox-tinymce-aux,
.tox-source-code {
    z-index: 6000 !important;
}

/* Fix for TinyMCE 6+ specific UI elements */
.tox-editor-header {
    z-index: 1 !important;
}

/* When TinyMCE is fullscreen, ensure no admin elements overlap */
body.tox-fullscreen .sidebar,
body.tox-fullscreen .topbar,
body.tox-fullscreen .mobile-burger-toggle {
    display: none !important;
}
body.tox-fullscreen .card:hover { transform: none !important; box-shadow: none !important; }
.editor-wrapper.fullscreen { transform: none !important; }

