/* =============================================
   ADMIN DASHBOARD - PROFESSIONAL EDITION
   Modern, Clean, Enterprise-Grade
   ============================================= */

/* ---------------------------------------------
   IMPORTS & RESET
   --------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    /* Brand Colors */
    --brand-primary: #6C63FF;
    --brand-primary-dark: #5B52D9;
    --brand-primary-light: #8B84FF;
    --brand-secondary: #9B59B6;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    --brand-gradient-hover: linear-gradient(135deg, var(--brand-primary-dark) 0%, #8E44AD 100%);
    
    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    
    /* Theme Colors */
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F3F4F6;
    --bg-sidebar: #111827;
    --bg-sidebar-hover: #1F2937;
    --bg-sidebar-active: #312E81;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-inverse: #FFFFFF;
    --text-sidebar: #9CA3AF;
    --text-sidebar-hover: #FFFFFF;
    
    /* Border Colors */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-dark: #9CA3AF;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* =============================================
   SIDEBAR STYLES
   ============================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    transition: transform var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: -0.3px;
}

.sidebar-brand-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 8px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 16px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 12px;
    margin-bottom: 12px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-hover);
}

.nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-hover);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--brand-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

/* Top Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-title span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-left: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.notification-btn:hover {
    background: var(--bg-tertiary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.user-menu:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Page Container */
.page-container {
    padding: 32px;
}

/* Page Visibility */
.page {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.page.active {
    display: block;
}

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

/* Page Header */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =============================================
   STATS CARDS
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary { background: #EEF2FF; color: var(--brand-primary); }
.stat-icon.success { background: #D1FAE5; color: var(--success); }
.stat-icon.warning { background: #FEF3C7; color: var(--warning); }
.stat-icon.danger { background: #FEE2E2; color: var(--danger); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* =============================================
   CHARTS SECTION
   ============================================= */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 24px;
    transition: box-shadow var(--transition-base);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 4px 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-btn.active,
.chart-btn:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.chart-container {
    height: 300px;
    position: relative;
}

/* =============================================
   TABLES
   ============================================= */
.table-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 16px;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-tools {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    width: 240px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-tertiary);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.data-table tbody tr:hover td {
    background: rgba(108, 99, 255, 0.02);
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

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

.user-name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.user-email-cell {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active { background: #D1FAE5; color: #065F46; }
.status-badge.active::before { background: var(--success); }

.status-badge.inactive { background: #FEE2E2; color: #991B1B; }
.status-badge.inactive::before { background: var(--danger); }

.status-badge.pending { background: #FEF3C7; color: #92400E; }
.status-badge.pending::before { background: var(--warning); }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 16px;
}

.action-btn.edit:hover { background: #DBEAFE; color: var(--info); }
.action-btn.delete:hover { background: #FEE2E2; color: var(--danger); }
.action-btn.view:hover { background: #D1FAE5; color: var(--success); }

/* =============================================
   FORMS & MODALS
   ============================================= */
.form-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 28px;
    margin-bottom: 24px;
}

.form-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

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

select.form-control {
    cursor: pointer;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--brand-primary);
    background: rgba(108, 99, 255, 0.02);
}

.file-upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-upload-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-danger:hover {
    background: #DC2626;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-md);
}

/* =============================================
   REPORTS SECTION
   ============================================= */
.report-filters {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 16px;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary);
}

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 24px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 14px;
    color: var(--text-primary);
}

.settings-value {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-medium);
    transition: var(--transition-fast);
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--brand-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* =============================================
   EMPTY STATES
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast-warning { border-left-color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =============================================
   LOADING STATES
   ============================================= */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .page-container {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-tools {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody td {
        display: block;
        padding: 12px;
        text-align: right;
        position: relative;
        border-bottom: 1px solid var(--border-light);
    }
    
    .data-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        font-weight: 600;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 22px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .report-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .toast {
        min-width: auto;
        width: calc(100vw - 40px);
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Dark Mode Styles */
body.dark-mode {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --border-light: #374151;
}

body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .table-card,
body.dark-mode .form-card,
body.dark-mode .settings-card {
    background: var(--bg-secondary);
}

body.dark-mode .data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .search-input,
body.dark-mode .form-control {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

/* Batch Upload Styles */
.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-tertiary);
}

.file-drop-zone:hover {
    border-color: var(--accent);
    background: rgba(108,138,255,0.05);
}

.file-drop-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.file-drop-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.file-drop-hint {
    font-size: 12px;
    color: var(--text-tertiary);
}

.selected-files-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
}

.file-name {
    font-size: 13px;
    font-family: monospace;
}

.file-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
}

.progress-bar {
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    width: 0%;
    transition: width 0.3s;
    border-radius: 10px;
}

.upload-status {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.success-item {
    color: var(--success);
}

.failed-item {
    color: var(--danger);
}

/* ============================================
   ADMIN DASHBOARD - MOBILE FIXES
   ============================================ */

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        display: none;
    }
    
    .admin-sidebar.active {
        display: block;
    }
    
    .admin-main {
        padding: 16px;
        width: 100%;
        overflow-x: hidden;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    /* Batch upload fixes */
    .file-drop-zone {
        padding: 20px;
    }
    
    .file-drop-icon {
        font-size: 32px;
    }
    
    .file-drop-text {
        font-size: 12px;
    }
    
    .manual-note-input {
        padding: 12px !important;
    }
    
    .manual-note-input h4 {
        font-size: 0.9rem;
    }
    
    .selected-files-list {
        max-height: 150px;
    }
    
    .file-item {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* Form fixes on mobile */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-card {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .report-filters {
        flex-direction: column;
    }
    
    .report-filters .filter-group {
        width: 100%;
    }
    
    .report-filters button {
        width: 100%;
    }
}