/*
 * VIGYANMEV JAYATE - Premium Admin Dashboard System
 * Designed with a Sleek, Modern Glassmorphism & High-Fidelity UI System
 * Supports Dynamic Light Mode (Default with White Sidebar) & Dark Mode Toggle
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- LIGHT MODE VARIABLES (DEFAULT) --- */
    --primary-color: #1e3a8a;       /* Bright Indigo Navy */
    --primary-light: #3b82f6;
    --accent-color: #f97316;        /* Bright Orange / Saffron */
    --accent-gold: #eab308;         /* Yellow / Gold details */
    
    --sidebar-bg: #e2e8f0;          /* Distinct Cool Grey Sidebar */
    --sidebar-border: #cbd5e1;      /* Darker border for higher contrast */
    --sidebar-text: #1e293b;        /* High contrast slate text for sidebar */
    --sidebar-hover: #cbd5e1;       /* Darker hover background for sidebar */
    --sidebar-hover-text: #090d16;  /* Deep dark hover text */
    
    --body-bg: #f1f5f9;             /* Slightly darker slate body background */
    --card-bg: #ffffff;
    --text-dark: #090d16;           /* Solid bold black for readable content */
    --text-muted: #475569;          /* Dark slate-gray for subtext instead of light slate */
    --border-color: #cbd5e1;        /* Highly visible border line colors */
    --table-header-bg: #e2e8f0;     /* Stronger table headers */
    --table-row-hover: #e2e8f0;
    
    /* Premium Shadows & Elevation */
    --elevation-low: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --elevation-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    --elevation-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.08);
    --elevation-glow: 0 0 20px rgba(249, 115, 22, 0.08);
    
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme {
    /* --- DARK MODE VARIABLES --- */
    --primary-color: #3b82f6;       /* Bright Neon Blue */
    --primary-light: #60a5fa;
    --accent-color: #f97316;        /* Orange Saffron */
    --accent-gold: #facc15;         /* Gold details */
    
    --sidebar-bg: #0f172a;          /* Dark Charcoal Sidebar */
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-hover-text: #ffffff;
    
    --body-bg: #030712;             /* Obsidian Dark */
    --card-bg: #0f172a;             /* Dark Slate Card */
    --text-dark: #f8fafc;           /* Light text */
    --text-muted: #64748b;
    --border-color: #1e293b;
    --table-header-bg: #1e293b;
    --table-row-hover: #1e293b;
    
    /* Dark Theme Elevation & Glow */
    --elevation-low: 0 4px 6px rgba(0, 0, 0, 0.2);
    --elevation-md: 0 10px 15px rgba(0, 0, 0, 0.35);
    --elevation-lg: 0 20px 25px rgba(0, 0, 0, 0.45);
    --elevation-glow: 0 0 20px rgba(59, 130, 246, 0.25);
}

/* Base resets & typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* --- Admin Panel Layout --- */
.admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed sidebar state */
html.sidebar-collapsed .admin-layout {
    grid-template-columns: 70px minmax(0, 1fr);
}

/* --- Modern Glassmorphism Sidebar --- */
.admin-sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    box-shadow: 4px 0 30px rgba(30, 41, 59, 0.03);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
}

body.dark-theme .admin-sidebar {
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.45);
}

html.sidebar-collapsed .admin-sidebar {
    width: 70px;
}

/* Sidebar header with logo + toggle button */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.sidebar-logo {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sidebar-title-text {
    transition: opacity 0.2s ease, width 0.3s ease;
    opacity: 1;
}

html.sidebar-collapsed .sidebar-title-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle-btn {
    background: var(--sidebar-hover);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

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

.admin-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 4px;
}

.admin-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    color: var(--sidebar-text);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.nav-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.nav-label {
    flex: 1;
    transition: opacity 0.2s ease;
    opacity: 1;
}

html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .sidebar-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip on collapsed hover */
html.sidebar-collapsed .admin-nav-item a {
    justify-content: center;
    padding: 11px 0;
}

html.sidebar-collapsed .admin-nav-item {
    position: relative;
}

html.sidebar-collapsed .admin-nav-item:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 78px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--elevation-md);
    pointer-events: none;
}

.admin-nav-item a:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-hover-text);
}

.admin-nav-item.active a {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.admin-nav-item.active a .sidebar-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.sidebar-badge {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

/* --- Admin Header & Content Wrapper --- */
.admin-main {
    padding: 24px 40px 40px;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.admin-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.admin-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    box-shadow: var(--elevation-low);
}

.profile-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* --- High-Fidelity Stats Widgets --- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-widget {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--elevation-low);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-widget:hover {
    transform: translateY(-4px);
    box-shadow: var(--elevation-md);
    border-color: var(--primary-light);
}

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

.stat-info h5 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-icon {
    height: 54px;
    width: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--elevation-low);
}

.stat-icon.blue {
    background-color: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}

.stat-icon.saffron {
    background-color: rgba(249, 115, 22, 0.08);
    color: var(--accent-color);
}

.stat-icon.gold {
    background-color: rgba(234, 179, 8, 0.08);
    color: #eab308;
}

/* Stat visual meter progress bars */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--sidebar-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 3px;
}

.progress-bar-fill.saffron {
    background: linear-gradient(90deg, var(--accent-color) 0%, #ea580c 100%);
}

.progress-bar-fill.gold {
    background: linear-gradient(90deg, #eab308 0%, #ca8a04 100%);
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.trend-up {
    color: #10b981;
}

/* --- Category activity grid / Lottery Style Grid --- */
.category-visual-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.category-visual-card {
    background-color: var(--sidebar-hover);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.category-visual-card:hover {
    transform: translateY(-2px);
    background-color: var(--card-bg);
    border-color: var(--primary-light);
    box-shadow: var(--elevation-low);
}

.category-visual-info h6 {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-weight: 600;
}

.category-visual-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.category-visual-count {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    background-color: var(--card-bg);
    height: 36px;
    min-width: 36px;
    padding: 0 8px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elevation-low);
    border: 1px solid var(--border-color);
}

/* --- Admin Card Container --- */
.admin-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--elevation-low);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    transition: var(--transition-smooth);
}

/* --- Dynamic Data Action Tables --- */
.admin-table-wrapper {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--elevation-low);
    transition: var(--transition-smooth);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: var(--table-header-bg);
    color: var(--text-dark);
    font-weight: 600;
    padding: 14px 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-dark);
}

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

.admin-table tr:hover {
    background-color: var(--table-row-hover);
}

/* Modern Pill Badges */
.badge-published {
    background-color: #dcfce7;
    color: #15803d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

body.dark-theme .badge-published {
    background-color: rgba(21, 128, 61, 0.15);
    color: #34d399;
}

.badge-draft {
    background-color: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

body.dark-theme .badge-draft {
    background-color: #1e293b;
    color: #94a3b8;
}

.badge-locale {
    background-color: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
}

/* Action Buttons */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-edit {
    background-color: rgba(3, 105, 161, 0.08);
    color: #0369a1;
    border-color: rgba(3, 105, 161, 0.1);
}

.btn-edit:hover {
    background-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-delete {
    background-color: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.1);
}

.btn-delete:hover {
    background-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* --- Form Fields & Inputs --- */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-theme .form-group label {
    color: var(--primary-light);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background-color: var(--card-bg);
    color: var(--text-dark);
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

body.dark-theme select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

/* File Input Dropzone Styling */
input[type="file"].form-control {
    padding: 10px;
    cursor: pointer;
    background-color: var(--body-bg);
    border-style: dashed;
    border-color: #94a3b8;
}

input[type="file"].form-control::file-selector-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: var(--transition-smooth);
}

input[type="file"].form-control::file-selector-button:hover {
    background-color: var(--primary-light);
}

/* Primary Action Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ea580c 100%);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

/* Cancel Action Buttons */
.btn-cancel {
    background-color: var(--sidebar-hover);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.btn-cancel:hover {
    background-color: var(--border-color);
}

/* --- High-Density Lottery Board Countdown & Ledgers --- */
.draw-board {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--elevation-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}
body.dark-theme .draw-board {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: rgba(255, 255, 255, 0.05);
}
.draw-board-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.draw-board-pool {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 15px;
}
.draw-countdown-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.countdown-box {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 45px;
    text-align: center;
    box-shadow: var(--elevation-low);
}
.countdown-sep {
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

/* Slide Up Fade Entry Animation (equivalent to initial y: 20 -> y: 0, duration: 0.4s) */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-file-upload {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 24px;
    background-color: var(--body-bg);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-smooth);
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animated-file-upload:hover {
    border-color: var(--primary-light);
    background-color: rgba(59, 130, 246, 0.04);
}

.animated-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.file-upload-placeholder .upload-icon {
    font-size: 2.2rem;
    color: var(--primary-light);
    transition: var(--transition-smooth);
}

.animated-file-upload:hover .file-upload-placeholder .upload-icon {
    transform: scale(1.1);
}

.file-upload-placeholder .upload-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.file-upload-placeholder .upload-info {
    font-size: 0.75rem;
}

/* Fix massive Laravel pagination arrows & style paginator */
nav[role="navigation"] svg {
    width: 18px !important;
    height: 18px !important;
    display: inline-block;
    vertical-align: middle;
}

nav[role="navigation"] .flex {
    display: flex;
    align-items: center;
    gap: 15px;
}

nav[role="navigation"] p {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

nav[role="navigation"] a,
nav[role="navigation"] span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-dark);
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

nav[role="navigation"] a:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

nav[role="navigation"] span[aria-current="page"] {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}

/* ========================================================
   ADMIN RESPONSIVE LAYOUT (≤ 1024px)
   ======================================================== */
@media (max-width: 1024px) {
    /* Main Layout Grid */
    .admin-layout {
        grid-template-columns: 1fr !important;
    }

    /* Sidebar Drawer Mode */
    .admin-sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px !important;
        transform: translateX(-100%);
        z-index: 1050;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.25) !important;
    }

    /* When Sidebar is Opened on Mobile */
    html.mobile-sidebar-open .admin-sidebar {
        transform: translateX(0) !important;
    }

    /* Override collapsed settings inside drawer on mobile */
    html.mobile-sidebar-open .nav-label,
    html.mobile-sidebar-open .sidebar-badge {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
    }

    /* Hide the default collapse toggle inside sidebar header on mobile */
    .sidebar-toggle-btn {
        display: none !important;
    }

    /* Show hamburger button in header */
    .mobile-nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Main Area padding adjustment */
    .admin-main {
        padding: 16px 16px 30px !important;
    }

    /* Header formatting */
    .admin-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .admin-header > div:first-child {
        width: 100% !important;
        justify-content: space-between !important;
        display: flex !important;
    }

    .admin-header > div:last-child {
        width: 100% !important;
        justify-content: space-between !important;
        display: flex !important;
    }

    /* Collapse stats widgets to single column */
    .dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Collapse category visual cards to 2 columns on mobile */
    .category-visual-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Collapse all inline grid layouts dynamically to prevent page blowouts */
    div[style*="display: grid"],
    div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Make flex tabs wrap cleanly */
    div[style*="display: flex"][style*="gap: 4px"],
    div[style*="display:flex"][style*="gap:4px"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Wrap flex rows like list headers */
    div[style*="display: flex"][style*="justify-content: space-between"],
    div[style*="display:flex"][style*="justify-content:space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    /* Wrap form button footer bars */
    div[style*="display: flex"][style*="justify-content: flex-end"],
    div[style*="display:flex"][style*="justify-content:flex-end"] {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .admin-card {
        padding: 20px !important;
        margin-bottom: 25px !important;
    }
}

/* For very small devices (≤ 480px) */
@media (max-width: 480px) {
    .category-visual-grid {
        grid-template-columns: 1fr !important;
    }

    .login-card {
        padding: 24px !important;
        margin: 15px !important;
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
    }

    .admin-header > div:last-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
}

