/* ============================================
    GLOBAL RESETS & BASE STYLES
    ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    min-height: 100vh;
    padding-top: 60px; /* Space for fixed header */
}

/* ============================================
    MOBILE HEADER (Fixed Top)
    ============================================ */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.mobile-header .hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-right: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mobile-header .hamburger-btn:active {
    transform: scale(0.95);
}

.mobile-header .header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mobile-header .header-info {
    flex: 1;
    min-width: 0;
}

.mobile-header .header-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header .header-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
    DESKTOP HEADER (Fixed Top)
    ============================================ */
.desktop-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: none;
    align-items: center;
    padding: 0 2rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.desktop-header .hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-right: 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.desktop-header .hamburger-btn:hover {
    opacity: 0.8;
}

.desktop-header .header-brand {
    display: flex;
    align-items: center;
    flex: 1;
}

.desktop-header .header-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    margin-right: 1rem;
}

.desktop-header .header-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.desktop-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.desktop-header .user-info {
    text-align: right;
    margin-right: 1rem;
}

.desktop-header .user-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.desktop-header .user-role {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 0;
}

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

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

.sidebar-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-menu.active {
    left: 0;
}

/* Sidebar Header */
.sidebar-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
    float: right;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.sidebar-header .close-btn:hover {
    opacity: 1;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    clear: both;
}

.sidebar-header p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-section {
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.5rem;
    margin: 0.5rem 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--light-gray);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-item.active {
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-item i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.sidebar-item span {
    flex: 1;
}

/* Sidebar action button (for forms like logout) */
.sidebar-item.action-btn {
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 1.5rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: none !important;
    background: var(--dark-bg) !important;
    color: white !important;
    flex-shrink: 0;
}

.sidebar-footer small {
    color: white !important;
    opacity: 0.9;
}

/* ============================================
    MAIN CONTENT AREA
    ============================================ */
.main-content {
    padding: 1.5rem 1rem;
    min-height: calc(100vh - 60px);
}

/* ============================================
    RESPONSIVE BEHAVIOR
    ============================================ */

/* Mobile (default) */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .desktop-header {
        display: none;
    }
    
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
}

/* Desktop */
@media (min-width: 769px) {
    body {
        padding-top: 60px;
    }

    .mobile-header {
        display: none;
    }
    
    .desktop-header {
        display: flex;
    }

    .main-content {
        padding: 2rem;
        max-width: 1400px;
        margin: 0 auto;
    }

    .sidebar-menu {
        width: 320px;
        left: -320px;
    }
}

/* ============================================
    UTILITY CLASSES
    ============================================ */
.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    transition: all 0.2s;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Alert customization */
.alert {
    border-radius: var(--border-radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Card customization */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ============================================
    FOOTER
    ============================================ */
footer {
    background: var(--dark-bg);
    color: white;
    padding: 0;
    height: 60px;
    margin: 0 !important;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

footer p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    footer {
        height: 60px;
        margin: 0 !important;
    }
}

/* ============================================
    SCROLLBAR STYLING
    ============================================ */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}