/* ============================================
   GLOBAL DASHBOARD STYLES
   ============================================ */

:root {
    --primary: #E13939;
    --primary-dark: #b71c1c;
    --primary-light: #fff0f0;
    --success: #2E7D32;
    --warning: #F57C00;
    --error: #D32F2F;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #eaeaea;
    --border-dark: #dddddd;
    --bg-light: #f8f9fa;
    --bg-sidebar: #ffffff;  /* Changed to white */
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR - WHITE PROFESSIONAL ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-primary);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.8rem;
}

.sidebar.collapsed .badge {
    display: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

/* ===== LOGO - TEXT ONLY WITH PRIMARY COLOR ===== */
.logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo a {
    text-decoration: none;
    color: var(--primary);
}

.logo a:hover {
    color: var(--primary-dark);
}

.logo-text {
    color: var(--primary);
}

.logo-text span {
    color: var(--text-primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.3rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* ===== USER INFO - WHITE STYLES ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.user-avatar i {
    font-size: 2.5rem;
    color: var(--primary);
}

.user-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.user-role {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ===== NAVIGATION - WHITE STYLES ===== */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link i {
    width: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.nav-link:hover i {
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--primary);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

.logout {
    color: var(--error);
}

.logout i {
    color: var(--error);
}

.logout:hover {
    background: #ffebee;
    color: var(--error);
}

.logout:hover i {
    color: var(--error);
}

.bottom-nav {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    background: var(--bg-light);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.page-content {
    min-height: 100vh;
    background: var(--bg-light);
    padding: 2rem;
}

/* ===== LOADING STATES ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    background: var(--text-primary);
    color: white;
    font-size: 0.85rem;
    z-index: 1100;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast.info {
    background: var(--primary);
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 100;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.mobile-menu-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        left: -280px;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .sidebar.open {
        left: 0;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== IMPERSONATION INDICATOR ===== */
.impersonation-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    margin-top: 4px;
}

.impersonation-indicator i {
    font-size: 0.7rem;
}