.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
}

/* ✅ Use GRID for true centering */
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

    height: 98px;

    display: grid;
    grid-template-columns: auto 1fr auto; /* left | center | right */
    align-items: center;
}

/* Left / Center / Right placement */
.header-left { justify-self: start; }
.header-center { justify-self: center; }
.header-right { justify-self: end; }

/* ✅ Correct logo selector */
.header-logo img {
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}



/* User info */
.header-user-info {
    font-size: 18px;
    color: #374151;
    white-space: nowrap;
}

.header-user-info .user-name { font-weight: 600; }
.header-user-info .divider { margin: 0 6px; color: #9ca3af; }

/* Right buttons */
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary:hover {
    background: #1e40af; /* darker blue */
}

.btn-secondary {
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
}

.btn-secondary:hover { background: #a4a4a5; }

.btn-logout {
    color: #dc2626;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
}

.btn-logout:hover { background: #fee2e2; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border-radius: 50%;
    text-decoration: none;

    font-size: 16px;
    color: #1f2937;

    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-icon:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

/* Login icon (neutral) */
.btn-icon.login {
    color: #2563eb;
}

/* Logout icon (warning) */
.btn-icon.logout {
    color: #dc2626;
}

.btn-icon.logout:hover {
    background-color: #fee2e2;
}

.btn-icon:hover {
    transform: translateY(-1px);
}

/* Hamburger button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: #1f2937;
    border-radius: 2px;
}

/* Mobile dropdown */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 10px;

    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.mobile-menu a {
    display: block;
    text-align: center;

    padding: 14px 16px;
    border-radius: 10px;

    font-weight: 600;
    text-decoration: none;
    color: #1f2937;

    background: #f3f4f6;
}

.mobile-menu a:hover {
    background: #e5e7eb;
}

/* Primary action highlight */
.mobile-menu a.primary {
    background: #2563eb;
    color: white;
}

.mobile-menu a.primary:hover {
    background: #1e40af;
}

/* Logout emphasis */
.mobile-menu a.logout {
    background: #fee2e2;
    color: #dc2626;
}

.mobile-user-info {
    text-align: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-user-info .welcome {
    font-weight: 600;
    color: #111827;
}

.mobile-user-info .credits {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* =========================
   MOBILE HEADER (≤ 768px)
========================= */
@media (max-width: 768px) {

    /* Header grid */
    .header-inner {
        grid-template-columns: auto 1fr auto;
        height: auto;
        padding: 10px 14px;
        max-width: 100%;
        margin: 0;
    }

    /* Logo */
    .header-logo img {
        height: 24px;
    }

    /* Center user info */
    .header-center {
        justify-self: center;
        text-align: center;
    }

    .header-user-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 12px;
        white-space: normal;
    }

    .header-user-info .divider {
        display: none;
    }

    .header-user-info .user-name {
        font-size: 12px;
        font-weight: 600;
    }

    .header-user-info .credits {
        font-size: 11px;
        color: #6b7280;
    }

    /* Hide desktop action buttons */
    .header-actions {
        display: none;
    }

    /* Right column stays visible for hamburger */
    .header-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* 🔒 FORCE hamburger visible (wins over style.css) */
    .site-header .header-right .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-left: auto;
    }

    /* Mobile dropdown */
    .mobile-menu {
        display: none;
        flex-direction: column;
    }

    .mobile-menu.active {
        display: flex;
    }
}




@media (max-width: 360px) {
    .header-user-info .user-name {
        display: none;
    }
}
