/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --transition-speed: 0.3s;
    
    /* Light Theme Colors */
    --sidebar-bg: #ffffff;
    --sidebar-text: #495057;
    --sidebar-text-hover: #0d6efd;
    --sidebar-item-hover: rgba(13, 110, 253, 0.1);
    --sidebar-item-active: #0d6efd;
    --sidebar-border: #e9ecef;
    --submenu-bg: #f8f9fa;
    
    --navbar-bg: #ffffff;
    --navbar-text: #495057;
    --navbar-border: #e9ecef;
    
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
}

/* ============================================
   DARK MODE VARIABLES - SIDEBAR ONLY
   ============================================ */
body.dark-mode {
    --sidebar-bg: #1a1d29;
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --sidebar-text-hover: #ffffff;
    --sidebar-item-hover: rgba(255, 255, 255, 0.1);
    --sidebar-item-active: #0d6efd;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --submenu-bg: rgba(0, 0, 0, 0.2);
}

/* ============================================
   GENERAL STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background: var(--body-bg);
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: width var(--transition-speed) ease, background-color var(--transition-speed);
    z-index: 1040;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    z-index: 10;
    transition: background-color var(--transition-speed);
}

.sidebar-brand {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: all var(--transition-speed) ease;
}

.sidebar-brand:hover {
    color: var(--primary-color);
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--primary-color);
    transition: margin var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-brand i {
    margin-right: 0;
}

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

/* Scrollable Navigation */
.sidebar-nav-wrapper {
    height: calc(100vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

.sidebar-nav-wrapper::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-wrapper::-webkit-scrollbar-track {
    background: var(--submenu-bg);
}

.sidebar-nav-wrapper::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 3px;
}

.sidebar-nav-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.sidebar-nav {
    padding: 1rem 0;
}

/* Navigation Items */
.nav-item {
    margin: 0.25rem 0.75rem;
    position: relative;
}

.nav-link {
    color: var(--sidebar-text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: var(--sidebar-item-hover);
    color: var(--sidebar-text-hover);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--sidebar-item-active);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    transition: all var(--transition-speed) ease;
}

.nav-link .badge {
    margin-left: auto;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.5rem 0;
}

/* Collapsed State */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

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

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-link .badge,
.sidebar.collapsed .nav-link .fa-chevron-down {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Submenu */
.submenu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background: var(--submenu-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: background-color var(--transition-speed);
}

.submenu:not(.show) {
    display: none;
}

.submenu.show {
    display: block;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.submenu .nav-link i {
    font-size: 0.85rem;
    width: 18px;
}

.sidebar.collapsed .submenu {
    display: none !important;
}

.nav-link .fa-chevron-down {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    z-index: 10;
    transition: background-color var(--transition-speed);
}

.user-info {
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-info:hover {
    background: var(--sidebar-item-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all var(--transition-speed) ease;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

.user-info-text {
    transition: opacity var(--transition-speed) ease;
    white-space: nowrap;
    overflow: hidden;
    color: var(--sidebar-text);
}

.sidebar.collapsed .user-info-text {
    opacity: 0;
    width: 0;
}

/* ============================================
   MAIN CONTENT & NAVBAR (ALWAYS LIGHT)
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    background: var(--body-bg);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

.content-area {
    padding: 1.5rem;
}

/* Top Navbar */
.top-navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.top-navbar h5 {
    color: var(--text-primary);
}

.top-navbar small {
    color: var(--text-secondary);
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--navbar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: rgba(13, 110, 253, 0.1);
    transform: scale(1.1);
}

/* Navbar Navigation */
.navbar-nav .nav-link {
    color: var(--navbar-text);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
}

.navbar-nav .nav-link .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

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

/* Navbar Search */
.navbar-search {
    max-width: 300px;
}

.navbar-search .form-control {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #212529;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.navbar-search .form-control:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

/* ============================================
   CARDS, FORMS, TABLES (ALWAYS LIGHT)
   ============================================ */
.card {
    background: var(--card-bg);
    border: 1px solid #e9ecef;
    color: var(--text-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid #e9ecef;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-primary);
}

.form-control,
.form-select {
    background: var(--card-bg);
    border: 1px solid #e9ecef;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-label {
    color: var(--text-primary);
}

.table {
    color: var(--text-primary);
}

.table-light {
    background: #f8f9fa;
    color: var(--text-primary);
}

.table-hover tbody tr:hover {
    background: rgba(13, 110, 253, 0.05);
}

.table thead th {
    border-bottom: 2px solid #e9ecef;
    color: var(--text-primary);
}

.table td,
.table th {
    border-color: #e9ecef;
}

/* ============================================
   DROPDOWNS (ALWAYS LIGHT)
   ============================================ */
.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    animation: slideDown 0.2s ease;
    min-width: 250px;
}

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

.dropdown-item:hover {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-item.active {
    background: #e7f1ff;
    color: var(--primary-color);
}

.dropdown-header-custom {
    font-weight: 600;
    padding: 0.75rem 1rem;
    color: #495057;
}

.dropdown-header-user {
    background: linear-gradient(45deg, #0d6efd, #6610f2);
    color: white;
    padding: 1rem;
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.user-dropdown-menu {
    min-width: 280px;
}

/* Shortcuts Menu */
.shortcuts-menu {
    min-width: 320px;
    padding: 1rem;
    background: var(--card-bg);
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.shortcut-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shortcut-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.shortcut-text {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

/* Notifications Menu */
.notifications-menu {
    min-width: 360px;
    max-height: 450px;
    background: var(--card-bg);
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e7f1ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    animation: slideDownAlert 0.3s ease;
}

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

/* ============================================
   SIDEBAR OVERLAY (MOBILE)
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

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

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

    .navbar-search {
        display: none;
    }
    
    .top-navbar {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-menu {
        min-width: 280px !important;
    }
    
    .shortcuts-menu,
    .notifications-menu {
        min-width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .top-navbar,
    .toggle-btn,
    .sidebar-overlay {
        display: none;
    }

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

/* ============================================
   DASHBOARD SPECIFIC STYLES
   ============================================ */
.stats-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-sm {
    width: 35px;
    height: 35px;
    font-size: 0.875rem;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}


.notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.notification-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
    transform: translateX(2px);
}

.notification-count {
    font-size: 0.65rem;
    padding: 0.25rem 0.45rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.dropdown-header-custom {
    background-color: #f8f9fa;
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: contain;
}

