.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(var(--backdrop-blur-chrome));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-chrome));
    border-bottom: 1px solid var(--header-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    overflow: visible;
    transition: background 0.35s ease, border-color 0.35s ease;
}

.header-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top, var(--header-glow-primary), transparent 60%),
        radial-gradient(circle at bottom, var(--header-glow-secondary), transparent 55%);
    opacity: 0.85;
    z-index: -1;
}

.header .container {
    width: 100%;
}

/* تراز با بدنه: فقط پدینگ .container (مثل landing-banner)، بدون پدینگ اضافی */
.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    max-width: var(--container-max);
    height: 100%;
    margin: 0 auto;
    gap: var(--spacing-md);
    padding: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
    justify-self: start;
}

.header-brand .logo {
    min-width: 0;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--toggle-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    padding: 0.55rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2.5px;
    border-radius: var(--radius-pill);
    background: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: var(--transition);
    flex-wrap: nowrap;
    min-height: 48px;
}

.logo a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--surface-card-hover);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(44px, 4.25vw, 72px);
    aspect-ratio: 5 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    background: rgba(139, 92, 246, 0.08);
}

.logo-icon picture,
.logo-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    background-color: transparent;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-pill);
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.2);
    transition: background 0.3s ease;
    min-height: 48px;
}

.header-badge i {
    color: var(--badge-icon);
    font-size: 1rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: center;
    justify-self: center;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    color: var(--nav-link-color);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    background: transparent;
    min-height: 48px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--nav-link-active);
    background: var(--surface-muted);
}

.nav-more {
    position: relative;
}

.nav-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    color: var(--nav-link-color);
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 48px;
}

.nav-more-btn i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.nav-more.is-open .nav-more-btn i {
    transform: rotate(180deg);
}

.nav-more-btn:hover,
.nav-more.is-open .nav-more-btn {
    color: var(--nav-link-active);
    background: var(--surface-muted);
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 220px;
    background: var(--surface-card);
    backdrop-filter: blur(var(--backdrop-blur-glass-strong));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-glass-strong));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
    z-index: 1500;
}

.nav-more.is-open .nav-more-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.nav-more-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}

.nav-more-item i {
    font-size: 1.25rem;
    color: var(--primary);
}

.nav-more-item:hover {
    background: var(--surface-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    justify-self: end;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.header-auth-mobile {
    display: none;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 48px;
}

.header-auth-mobile__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-auth-mobile__content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: flex-start;
}

.header-auth-mobile__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.header-auth-mobile__subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

.header-auth-mobile:focus-visible,
.header-auth-mobile:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.header-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    min-height: 48px;
}

.header-profile-link:hover {
    background: var(--surface-card-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.header-profile-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--surface-card);
    color: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--surface-border);
}

.header-profile-text {
    font-size: 0.95rem;
}

.header-dual-pill {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.35rem 0.4rem;
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--backdrop-blur-chrome-pill));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-chrome-pill));
}

.header-dual-pill__admin,
.header-dual-pill__user {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    min-height: 48px;
    padding: 0.55rem 1.2rem;
    flex: 0 0 auto;
}

.header-dual-pill__admin {
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary);
}

.header-dual-pill__admin:hover,
.header-dual-pill__admin:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
}

.header-dual-pill__user {
    background: var(--surface-card);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
    color: var(--text-primary);
    font-weight: 600;
    padding-inline-start: 1.35rem;
}

.header-dual-pill__user:hover,
.header-dual-pill__user:focus-visible {
    background: var(--surface-card-hover);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
    transform: translateY(-1px);
}

.header-dual-pill__icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.header-dual-pill__icon--admin {
    background: rgba(15, 23, 42, 0.2);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.header-dual-pill__icon--user {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(14, 165, 233, 0.18));
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.22);
}

.header-dual-pill__text {
    font-size: 0.95rem;
    white-space: nowrap;
}

.header-dual-pill__user-text {
    font-size: 0.88rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.header-dual-pill-mobile {
    position: relative;
    display: none;
}

.header-dual-pill-mobile--desktop {
    display: inline-flex;
    align-items: center;
}

@media (min-width: 881px) {
    .header-dual-pill-mobile--desktop .header-dual-pill-mobile__toggle {
        min-width: 90px;
        height: 52px;
        padding: 0.5rem;
        box-shadow: var(--shadow-md);
    }

    .header-dual-pill-mobile--desktop .header-dual-pill-mobile__toggle-icon {
        gap: 0.4rem;
    }

    .header-dual-pill-mobile--desktop .header-dual-pill-mobile__toggle-circle {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .header-dual-pill-mobile--desktop .header-dual-pill-mobile__menu {
        inset-inline-end: 0;
        min-width: 230px;
    }
}

.header-dual-pill-mobile__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem;
    min-width: 75px;
    height: 48px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--surface-border);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.header-dual-pill-mobile__toggle:focus-visible,
.header-dual-pill-mobile__toggle:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.header-dual-pill-mobile.is-open .header-dual-pill-mobile__toggle {
    border-color: var(--primary);
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.28);
}

.header-dual-pill-mobile__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.header-dual-pill-mobile__toggle-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.header-dual-pill-mobile__toggle-circle--admin {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(59, 130, 246, 0.32);
}

.header-dual-pill-mobile__toggle-circle--user {
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2), 0 10px 18px rgba(15, 23, 42, 0.12);
}

.header-dual-pill-mobile.is-open .header-dual-pill-mobile__toggle-circle--admin {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(59, 130, 246, 0.4);
}

.header-dual-pill-mobile.is-open .header-dual-pill-mobile__toggle-circle--user {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35), 0 14px 26px rgba(15, 23, 42, 0.18);
}

/* User-only dropdown: single pill with name (like profile link) */
.header-dual-pill-mobile--user-only .header-dual-pill-mobile__toggle {
    padding: 0.5rem 1rem;
    gap: 0.65rem;
    min-width: auto;
}

.header-dual-pill-mobile--user-only .header-dual-pill-mobile__toggle-text {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 881px) {
    .header-dual-pill-mobile--user-only.header-dual-pill-mobile--desktop .header-dual-pill-mobile__toggle {
        min-width: 120px;
        height: 52px;
    }
}

.header-dual-pill-mobile__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    inset-inline-end: 0;
    min-width: 210px;
    width: min(260px, 78vw);
    background: var(--surface-card);
    border-radius: 20px;
    border: 1px solid var(--surface-border);
    padding: 0.75rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    transform: translate3d(0, -6px, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        transform var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        visibility 0s linear var(--ui-motion-duration, 250ms);
    z-index: 1400;
}

.header-dual-pill-mobile__menu[hidden] {
    display: block;
}

.header-dual-pill-mobile__menu::before {
    content: "";
    position: absolute;
    top: -10px;
    inset-inline-end: 20px;
    width: 18px;
    height: 18px;
    background: var(--surface-card);
    border-inline-start: 1px solid var(--surface-border);
    border-top: 1px solid var(--surface-border);
    transform: rotate(45deg);
}

.header-dual-pill-mobile.is-open .header-dual-pill-mobile__menu {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    transition:
        opacity var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        transform var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        visibility 0s linear 0s;
}

.header-dual-pill-mobile__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-xl);
    text-decoration: none;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-fast);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.header-dual-pill-mobile__link + .header-dual-pill-mobile__link {
    margin-top: 0.55rem;
}

.header-dual-pill-mobile__link--admin {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(14, 165, 233, 0.18));
    color: var(--primary);
}

.header-dual-pill-mobile__link--user {
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.header-dual-pill-mobile__link:hover,
.header-dual-pill-mobile__link:focus-visible {
    transform: translateY(-1px);
}

.header-dual-pill-mobile__link--admin:hover,
.header-dual-pill-mobile__link--admin:focus-visible {
    box-shadow: 0 18px 36px rgba(59, 130, 246, 0.28);
}

.header-dual-pill-mobile__link--user:hover,
.header-dual-pill-mobile__link--user:focus-visible {
    border-color: var(--primary-light);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    background: var(--surface-card);
}

.header-dual-pill-mobile__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: var(--surface-card);
    color: var(--primary);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.header-dual-pill-mobile__link--admin .header-dual-pill-mobile__icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.35);
}

.header-dual-pill-mobile__link--user .header-dual-pill-mobile__icon {
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.header-dual-pill-mobile__link--wallet {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.14));
    border: 1px solid rgba(34, 197, 94, 0.25);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.header-dual-pill-mobile__link--wallet:hover,
.header-dual-pill-mobile__link--wallet:focus-visible {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 14px 28px rgba(34, 197, 94, 0.12);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(22, 163, 74, 0.18));
}

.header-dual-pill-mobile__icon--wallet {
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.35);
}

.header-dual-pill-mobile__wallet-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    unicode-bidi: embed;
}

.header-dual-pill-mobile__link--logout {
    border-top: 1px solid var(--surface-border);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    background: rgba(185, 28, 28, 0.06);
}

.header-dual-pill-mobile__link--logout .header-dual-pill-mobile__icon--logout,
.header-dual-pill-mobile__link--logout .header-dual-pill-mobile__title {
    color: #b91c1c;
}

.header-dual-pill-mobile__link--logout .header-dual-pill-mobile__subtitle {
    color: rgba(185, 28, 28, 0.75);
}

.header-dual-pill-mobile__link--logout:hover,
.header-dual-pill-mobile__link--logout:focus-visible {
    background: rgba(185, 28, 28, 0.12);
    border-color: rgba(185, 28, 28, 0.25);
}

.header-dual-pill-mobile__link--logout:hover .header-dual-pill-mobile__icon--logout,
.header-dual-pill-mobile__link--logout:hover .header-dual-pill-mobile__title,
.header-dual-pill-mobile__link--logout:focus-visible .header-dual-pill-mobile__icon--logout,
.header-dual-pill-mobile__link--logout:focus-visible .header-dual-pill-mobile__title {
    color: #991b1b;
}

.header-dual-pill-mobile__icon--logout {
    font-size: 1.1rem;
    opacity: 0.95;
}

.header-dual-pill-mobile__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: right;
}

.header-dual-pill-mobile__title {
    font-size: 0.95rem;
    font-weight: 700;
}

.header-dual-pill-mobile__subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 14px 32px rgba(59, 130, 246, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.header-admin-link .header-admin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.22);
    color: inherit;
    font-size: 1.15rem;
}

.header-admin-link .header-admin-text {
    font-size: 0.95rem;
    color: inherit;
}

.header-admin-link:hover,
.header-admin-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.38);
    color: #fff;
    outline: none;
}

.header-link {
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-pill);
    transition: color 0.2s ease;
}

.header-link:hover {
    color: var(--nav-link-active);
}

.header-cta {
    box-shadow: 0 12px 30px rgba(147, 51, 234, 0.25);
}

.header-profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        visibility 0s linear var(--ui-motion-duration, 250ms);
}

.header-profile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity var(--ui-motion-duration, 250ms) var(--ui-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)),
        visibility 0s linear 0s;
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 24, 0.75);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1100;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(340px, 85vw);
    background: var(--bg-primary);
    border-left: 1px solid var(--surface-border);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    display: flex;
    box-shadow: -18px 0 45px rgba(12, 10, 24, 0.35);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--spacing-lg);
    gap: var(--spacing-lg);
    overflow-y: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--surface-border);
}

.mobile-nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.mobile-nav-logo .logo-icon {
    width: 54px;
    max-width: 54px;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.2);
}

.mobile-nav-logo .logo-text {
    font-size: 1.1rem;
}

.mobile-nav-close {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    background: var(--surface-muted);
    cursor: pointer;
    gap: 6px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.mobile-nav-close:hover {
    border-color: var(--primary);
    background: var(--surface-muted-hover, var(--surface-muted));
}

.mobile-nav-close span {
    width: 18px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--text-primary);
}

.mobile-nav-close span:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

.mobile-nav-close span:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}

.mobile-nav-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background 0.25s ease, color 0.25s ease;
}

.mobile-nav-item i {
    font-size: 1.2rem;
    color: inherit;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.mobile-nav-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--surface-border);
}

.mobile-nav-profile {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.mobile-nav-profile:hover {
    background: var(--surface-card-hover);
    border-color: var(--primary);
}

.mobile-nav-profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--surface-card);
    color: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--surface-border);
}

.mobile-nav-profile-text {
    flex: 1;
}

.mobile-nav-admin {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 16px 34px rgba(59, 130, 246, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-nav-admin i {
    font-size: 1.25rem;
}

.mobile-nav-admin:hover,
.mobile-nav-admin:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(59, 130, 246, 0.32);
    color: #fff;
    outline: none;
}

.mobile-nav-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.mobile-nav-auth:hover {
    background: var(--surface-muted);
    border-color: var(--primary);
}

.mobile-nav-cta {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1024px) {
    .header-content {
        gap: var(--spacing-sm);
    }

    .header-badge {
        font-size: 0.8rem;
        padding: 0.45rem 0.9rem;
        gap: 0.4rem;
    }

    .header-badge i {
        font-size: 0.9rem;
    }
}

@media (max-width: 880px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-sm);
    }

    .header-brand {
        flex: 1;
        gap: var(--spacing-sm);
    }

    .header-actions {
        justify-self: flex-end;
    }

    .header-actions .header-link,
    .header-actions .header-cta,
    .header-actions .header-admin-link {
        display: none;
    }

    .header-auth-mobile {
        display: inline-flex;
    }

    .header-dual-pill-mobile {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .header-content {
        padding: 0 var(--spacing-sm);
        gap: 0.5rem;
    }

    .header-badge {
        display: none;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .header-auth-mobile {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        min-height: 44px;
    }

    .header-auth-mobile__icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .header-auth-mobile__title {
        font-size: 0.8rem;
        font-weight: 600;
    }

    .header-auth-mobile__subtitle {
        display: none;
    }

    .header-dual-pill-mobile__toggle {
        min-width: 72px;
        height: 42px;
        padding: 0.35rem;
    }

    .header-dual-pill-mobile__toggle-icon {
        gap: 0.4rem;
    }

    .header-dual-pill-mobile__toggle-circle {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .header-dual-pill-mobile__menu {
        width: min(240px, 82vw);
        padding: 0.7rem;
    }

    .header-dual-pill-mobile__icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .header-dual-pill-mobile__link {
        padding: 0.55rem 0.65rem;
    }

    .logo a {
        padding: 0.35rem 0.55rem;
        gap: 0.4rem;
        min-height: 40px;
    }

    .logo-icon {
        width: 44px;
    }

    .logo-text {
        font-size: 0.88rem;
        max-width: 110px;
    }

    .mobile-menu-toggle {
        padding: 0.45rem;
    }

    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }

    .mobile-nav {
        width: min(320px, 90vw);
    }

    .mobile-nav-panel {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .mobile-nav-panel {
        padding: var(--spacing-sm);
    }

    .mobile-nav-item {
        padding: 0.75rem 0.85rem;
    }

    .logo a {
        padding: 0.3rem 0.5rem;
        gap: 0.35rem;
        max-width: 100%;
        min-height: 36px;
    }

    .header-dual-pill-mobile__menu {
        width: min(220px, 88vw);
        padding: 0.65rem;
    }

    .header-dual-pill-mobile__link {
        gap: 0.65rem;
    }

    .header-dual-pill-mobile__toggle {
        min-width: 66px;
        height: 40px;
        padding: 0.3rem;
    }

    .header-dual-pill-mobile__toggle-icon {
        gap: 0.35rem;
    }

    .header-dual-pill-mobile__toggle-circle {
        width: 24px;
        height: 24px;
        font-size: 0.95rem;
    }

    .header-dual-pill-mobile__icon {
        width: 34px;
        height: 34px;
    }

    .header-dual-pill-mobile__title {
        font-size: 0.9rem;
    }

    .header-dual-pill-mobile__subtitle {
        font-size: 0.75rem;
    }

    .header-dual-pill-mobile__wallet-amount {
        font-size: 0.75rem;
        max-width: 100px;
    }

    .logo-icon {
        width: 40px;
    }

    .mobile-nav-logo .logo-icon {
        width: 46px;
    }

    .logo-text {
        font-size: 0.85rem;
        max-width: 100px;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .header-auth-mobile {
        padding: 0.45rem 0.65rem;
        gap: 0.45rem;
        min-height: 42px;
    }

    .header-auth-mobile__icon {
        width: 30px;
        height: 30px;
        font-size: 1.15rem;
    }

    .header-auth-mobile__title {
        font-size: 0.78rem;
        font-weight: 600;
    }

    .header-auth-mobile__subtitle {
        display: none;
    }
}

@media (max-width: 420px) {
    .header-actions {
        gap: 0.3rem;
    }

    .header-auth-mobile {
        padding: 0.4rem;
        gap: 0;
        min-height: 36px;
        width: 36px;
        justify-content: center;
    }

    .header-auth-mobile__icon {
        width: 22px;
        height: 22px;
        font-size: 1.35rem;
        background: transparent;
        box-shadow: none;
    }

    .header-auth-mobile__content {
        display: none;
    }

    .logo a {
        padding: 0.28rem 0.45rem;
        gap: 0.3rem;
        min-height: 34px;
    }

    .logo-icon {
        width: 36px;
    }

    .logo-text {
        font-size: 0.8rem;
        max-width: 90px;
    }
}

@media (max-width: 375px) {
    .header-content {
        padding: 0 0.5rem;
        gap: 0.35rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .mobile-menu-toggle {
        padding: 0.4rem;
    }

    .mobile-menu-toggle span {
        width: 18px;
        height: 2px;
    }

    .logo a {
        padding: 0.25rem 0.4rem;
        min-height: 32px;
    }

    .logo-icon {
        width: 32px;
    }

    .logo-text {
        font-size: 0.75rem;
        max-width: 80px;
    }

    .mobile-nav {
        width: min(300px, 92vw);
    }
}

@media (max-width: 320px) {
    .header-content {
        padding: 0 0.4rem;
    }

    .logo a {
        padding: 0.22rem 0.35rem;
    }

    .logo-icon {
        width: 28px;
    }

    .mobile-nav-logo .logo-icon {
        width: 42px;
    }

    .logo-text {
        font-size: 0.72rem;
        max-width: 70px;
    }
}

[data-theme="light"] .logo a {
    box-shadow: 0 12px 28px rgba(148, 163, 184, 0.25);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.16));
}

[data-theme="light"] .header-dual-pill {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .header-dual-pill-mobile__toggle {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 28px rgba(148, 163, 184, 0.28);
}

[data-theme="light"] .header-dual-pill-mobile__toggle-circle--user {
    background: rgba(248, 250, 252, 0.96);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 12px 24px rgba(148, 163, 184, 0.25);
}

[data-theme="light"] .logo-icon {
    box-shadow: 0 14px 30px rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(129, 140, 248, 0.12));
}

[data-theme="light"] .mobile-nav {
    background: var(--bg-primary);
    border-left: 1px solid rgba(203, 213, 225, 0.7);
}

[data-theme="light"] .mobile-nav-overlay {
    background: rgba(15, 23, 42, 0.35);
}

[data-theme="light"] .mobile-nav-item:hover,
[data-theme="light"] .mobile-nav-item.active {
    background: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .nav-more-menu {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.6);
    box-shadow: 0 12px 40px rgba(100, 116, 139, 0.25);
}

[data-theme="light"] .nav-more-item:hover {
    background: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .header-dual-pill {
    background: var(--surface-card);
    border-color: var(--surface-border);
}

[data-theme="dark"] .header-dual-pill-mobile__toggle {
    background: var(--surface-elevated);
    border-color: var(--surface-border);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .header-dual-pill-mobile__toggle-circle--user {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--primary-light);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2), var(--shadow-sm);
}


/* ========================================
   Enhanced Login CTA Button
   ======================================== */

.header-login-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    background: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
    min-height: 48px;
}

.header-login-cta:hover,
.header-login-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.header-login-cta:active {
    transform: translateY(0);
}

.header-login-cta__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.header-login-cta:hover .header-login-cta__icon {
    transform: scale(1.1) rotate(-5deg);
}

.header-login-cta__content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
}

.header-login-cta__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.header-login-cta__subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .header-login-cta {
        padding: 0.6rem 1.1rem;
        gap: 0.65rem;
    }

    .header-login-cta__icon {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }

    .header-login-cta__title {
        font-size: 0.9rem;
    }

    .header-login-cta__subtitle {
        font-size: 0.72rem;
    }
}

@media (max-width: 880px) {
    .header-login-cta {
        display: none;
    }
}

/* ========================================
   Mobile Floating Header (Telegram-inspired)
   ======================================== */

@media (max-width: 880px) {
    .header {
        --scroll-compact: 0;
        --scroll-blur: 20;
        position: fixed;
        top: var(--mobile-header-top);
        left: var(--mobile-floating-inset-x, var(--mobile-floating-inset, 10px));
        right: var(--mobile-floating-inset-x, var(--mobile-floating-inset, 10px));
        width: auto;
        margin: 0;
        z-index: 1001;
        border-bottom: none;
        border: 1px solid var(--header-border);
        border-radius: var(--mobile-chrome-radius, var(--radius-xl));
        overflow: visible;
        background: color-mix(in srgb, var(--header-bg) var(--chrome-surface-mix), transparent);
        backdrop-filter: blur(calc(var(--scroll-blur) * 1px)) saturate(var(--backdrop-saturate-chrome-floating));
        -webkit-backdrop-filter: blur(calc(var(--scroll-blur) * 1px)) saturate(var(--backdrop-saturate-chrome-floating));
        box-shadow: var(--mobile-chrome-shadow);
        transform: translate3d(0, calc(var(--scroll-compact) * -3px), 0);
        opacity: calc(1 - var(--scroll-compact) * 0.035);
        will-change: transform, opacity;
        transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    }

    .header .container {
        height: 100%;
        display: flex;
        align-items: center;
        overflow: visible;
    }

    .header .header-content {
        width: 100%;
        overflow: visible;
        transform: scale3d(1, calc(1 - var(--scroll-compact) * 0.065), 1);
        transform-origin: center center;
        will-change: transform;
    }

    .header-actions {
        position: relative;
        z-index: 2;
        overflow: visible;
    }

    .header-dual-pill-mobile {
        overflow: visible;
    }

    .header-dual-pill-mobile.is-open {
        z-index: 3;
    }

    .header:has(.header-dual-pill-mobile.is-open) {
        z-index: 1100;
    }

    .header-dual-pill-mobile__menu {
        width: min(280px, calc(100vw - (var(--mobile-floating-inset-x, 10px) * 2) - 1.5rem));
        max-height: min(70vh, 420px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .header-glow {
        opacity: 0.55;
        border-radius: inherit;
        clip-path: inset(0 round var(--mobile-chrome-radius, var(--radius-xl)));
    }

    [data-theme="light"] .header {
        box-shadow: var(--mobile-chrome-shadow-light);
    }

    [data-theme="dark"] .header {
        box-shadow: var(--mobile-chrome-shadow);
    }
}