:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --sidebar-bg: #e0f2fe;
    --sidebar-active: #3b82f6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
}

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

.nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.nav-link.active i {
    color: white;
}

.nav-divider {
    height: 1px;
    background: rgba(59, 130, 246, 0.1);
    margin: 0.75rem 0;
}

.logout-link {
    color: var(--danger-color);
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Main Content Wrapper */
.main-content-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: white;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-support {
    background: #f97316;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-support:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(249, 115, 22, 0.3);
}

/* Notification Dropdown */
.notification-dropdown {
    position: relative;
}

.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.notification-icon:hover {
    background: var(--light-color);
    color: var(--text-primary);
}

.notification-icon i {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-menu {
    min-width: 320px;
    max-width: 400px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.notification-menu .dropdown-header {
    padding: 1rem;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.notification-menu .dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--light-color);
}

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

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.notification-text {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.notification-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* User Profile Dropdown */
.user-dropdown {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
    background: transparent;
    border: none;
    color: var(--text-primary);
}

.user-profile:hover {
    background: var(--light-color);
}

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

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

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

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.user-dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu {
    min-width: 240px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.user-menu .dropdown-header {
    padding: 1rem;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-menu {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.user-name-menu {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.user-email-menu {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.user-menu .dropdown-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.user-menu .dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.user-menu .dropdown-item:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.user-menu .dropdown-item:hover i {
    color: var(--primary-color);
}

.user-menu .logout-item {
    color: var(--danger-color);
}

.user-menu .logout-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.user-menu .logout-item:hover i {
    color: var(--danger-color);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
}

.messages-container {
    margin-bottom: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

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

.stat-card:hover::before {
    width: 6px;
}

.stat-card.primary::before { background: var(--primary-color); }
.stat-card.success::before { background: var(--success-color); }
.stat-card.danger::before { background: var(--danger-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.info::before { background: var(--info-color); }

.stat-card .d-flex {
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.15;
    color: var(--primary-color);
}

.stat-card.primary .stat-icon { color: var(--primary-color); }
.stat-card.success .stat-icon { color: var(--success-color); }
.stat-card.danger .stat-icon { color: var(--danger-color); }
.stat-card.warning .stat-icon { color: var(--warning-color); }
.stat-card.info .stat-icon { color: var(--info-color); }

/* Page Header */
.page-header {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

/* Filter Card */
.filter-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* Badge Custom */
.badge-custom {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow-hover);
    color: white;
}

.welcome-content {
    flex: 1;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

.welcome-actions {
    display: flex;
    gap: 1rem;
}

.welcome-actions .btn {
    background: white;
    color: var(--primary-color);
    border: none;
}

.welcome-actions .btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Filter Card Enhancements */
.filter-header {
    margin-bottom: 1rem;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.stat-trend i {
    font-size: 0.875rem;
}

/* Bootstrap Dropdown Overrides */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--light-color);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ensure dropdowns are visible */
.dropdown-menu.show {
    display: block;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.sidebar-toggle.active {
    background: var(--danger-color);
}

.sidebar-toggle.active i::before {
    content: "\F62A"; /* X icon */
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
    }
    
    .top-header {
        padding: 1rem;
        padding-left: 5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}

