.main-header {
    width: 100%;
    height: 60px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: height 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    gap: 8px;
    height: 100%;
    align-items: center;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Raleway', sans-serif;
    white-space: nowrap;
}

.header-nav a:hover {
    background-color: var(--bg-input);
    color: var(--text-primary);
    filter: none;
}

.header-nav a.active {
    background-color: var(--accent-primary);
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 200px;
    gap: 16px;
}

.btn-nav-qr {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--accent-primary);
    color: white !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
}
.btn-nav-qr:hover {
    background-color: var(--accent-hover);
    filter: none;
}

#admin-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

#admin-username {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

#admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-input);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.switcher {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.5s;
}
.switcher:hover {
    color: var(--text-primary);
}

.switcher__sun-beams { transform-origin: center; transition: transform 0.5s ease, opacity 0.2s ease; }
.switcher__sun { transform-origin: center; transition: transform 0.5s ease; }
.switcher__moon { transform-origin: center; transition: transform 0.5s ease; }
.switcher--dark .switcher__sun-beams { transform: rotate(45deg); opacity: 0; }
.switcher--dark .switcher__sun { transform: scale(0.6); }
.switcher--dark .switcher__moon { transform: translateX(-8px); }

@media (max-width: 900px) {
    .main-header {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 10px;
    }

    .header-left {
        min-width: auto;
        order: 1;
    }

    .header-right {
        min-width: auto;
        justify-content: flex-end;
        flex: 1;
        order: 2;
        gap: 10px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }

    .header-nav::-webkit-scrollbar {
        height: 0px;
        background: transparent;
    }

    #admin-username {
        display: none;
    }
    
    .btn-nav-qr span {
        display: none; 
    }
    
    .btn-nav-qr {
        padding: 8px;
    }
}