:root {
    --primary: #16227a;
    --primary-dark: #0d144a;
    --primary-soft: rgba(22, 34, 122, 0.05);
    --accent: #d4281d;
    --accent-hover: #b91f16;
    --spring-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --smooth-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --text-main: #1f2937;
    --text-muted: #64748b;
    --bg-surface: #ffffff;
    --border-color: #e2e8f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.no-scroll {
    overflow: hidden;
}

.site-header {
    background-color: #ffffff;
    height: auto;
    flex-direction: column;
    width: 100%;
    position: fixed;
    top: 0;
    display: flex;
    align-items: center;
    z-index: 10000;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: -1;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 20, 74, 0.4);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.header-container {
    width: 100%;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo-wrapper {
    width: 20%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1002;
}

.logo-wrapper a {
    transition: opacity 0.3s var(--smooth-easing);
}

.logo-wrapper a:hover {
    opacity: 0.8;
}

.logo-wrapper img {
    height: 42px;
    width: auto;
    object-fit: contain;
    margin-bottom: -10px;
}

.nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: center;
}

.nav-link {
    position: relative;
    text-decoration: none;
    padding: 8px 0;
    color: var(--primary);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    transition: color 0.4s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-item-icon,
.nav-icon-text {
    display: none;
}

.nav-link::before {
    display: block;
    content: attr(data-text);
    height: 0;
    visibility: hidden;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
}

.nav-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--accent);
    transition: all 0.4s var(--smooth-easing);
    transform: translateX(-50%);
    border-radius: 4px 4px 0 0;
    opacity: 0;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover .nav-line {
    width: 100%;
    opacity: 1;
}

.user-module-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.3s var(--smooth-easing);
    text-decoration: none;
    cursor: pointer;
    background: var(--primary-soft);
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
}

.nav-icon svg {
    margin-right: 8px;
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.nav-icon-text {
    display: inline-block;
}

.nav-icon:hover {
    background: #ffffff;
    border-color: rgba(22, 34, 122, 0.15);
    box-shadow: 0 4px 12px rgba(22, 34, 122, 0.08);
    transform: translateY(-1px);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 6px 16px 6px 6px;
    border-radius: 40px;
    transition: all 0.3s var(--smooth-easing);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    width: auto;
}

.user-profile-btn:hover {
    border-color: rgba(22, 34, 122, 0.2);
    box-shadow: 0 6px 16px rgba(22, 34, 122, 0.08);
    transform: translateY(-1px);
}

.user-avatar-generic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(22, 34, 122, 0.1);
}

.user-avatar-generic svg {
    width: 18px;
    height: 18px;
}

.user-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-name {
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.user-more-icon {
    display: none;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 50px);
    left: 50%;
    right: auto;
    background: #f8fafc;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    width: 680px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s var(--spring-easing);
    transform: translate(-50%, -10px);
    padding: 24px;
    z-index: 1005;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
}

.mega-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mega-header {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.mega-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #ffffff;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.mega-card:hover {
    border-color: rgba(22, 34, 122, 0.15);
    box-shadow: 0 8px 20px rgba(22, 34, 122, 0.06);
    transform: translateY(-2px);
}

.mega-icon-box {
    background: #f1f5f9;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.mega-icon-box svg {
    width: 20px;
    height: 20px;
}

.mega-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mega-text h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 700;
}

.mega-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.mega-link-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mega-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mega-link svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    opacity: 0.8;
    transition: transform 0.2s;
}

.mega-link:hover {
    background-color: #ffffff;
    color: var(--primary);
    border-color: var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.mega-link:hover svg {
    transform: scale(1.1);
    opacity: 1;
}

.mega-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.mega-footer-text {
    color: var(--text-muted);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.logout-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: var(--accent);
}

.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 20, 74, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.login-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.login-modal-box {
    background: var(--bg-surface);
    padding: 32px 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s var(--spring-easing);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-modal-overlay.show .login-modal-box {
    transform: translateY(0) scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: rotate(90deg);
}

.login-modal-box h2 {
    margin: 0 0 8px 0;
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: 800;
}

.login-modal-box p {
    margin: 0 0 30px 0;
    color: var(--accent);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(22, 34, 122, 0.1);
}

.submit-login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(22, 34, 122, 0.2);
}

.submit-login-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.error-msg {
    background: #fef2f2;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #fee2e2;
    margin-bottom: 15px;
    display: none;
    text-align: center;
}

.header-actions {
    width: 20%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1002;
}

.lang-actions {
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-icon {
    color: var(--text-muted);
}

.hidden-checkbox {
    display: none;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    position: relative;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 4px;
    cursor: pointer;
}

.lang-opt {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1;
}

.lang-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.4s var(--spring-easing);
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.lang-opt:nth-of-type(1) {
    color: var(--primary);
}

.hidden-checkbox:checked~.lang-slider {
    transform: translateX(32px);
}

.hidden-checkbox:checked~.lang-opt:nth-of-type(1) {
    color: #94a3b8;
}

.hidden-checkbox:checked~.lang-opt:nth-of-type(2) {
    color: var(--primary);
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--primary);
    border-radius: 3px;
    transition: transform 0.4s var(--spring-easing), opacity 0.3s ease;
}

.ticker-toggle-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ticker-toggle-btn:hover {
    background: #ffffff;
    color: var(--primary);
}

.ticker-toggle-btn.active {
    color: var(--accent);
    border-color: rgba(212, 40, 29, 0.2);
    background: #fef2f2;
}

.ticker-wrap {
    width: 100%;
    background-color: var(--primary-dark);
    height: 38px;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ticker-wrap.hidden {
    height: 0;
    opacity: 0;
    border-bottom: none;
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 40px;
    gap: 12px;
    color: #f8fafc;
    font-size: 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-label {
    color: #94a3b8;
    font-weight: 600;
}

.ticker-value {
    font-weight: 700;
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ticker-change {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 65px;
    font-variant-numeric: tabular-nums;
    padding: 2px 6px;
    border-radius: 4px;
}

.ticker-change.up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.ticker-change.down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 1180px) {
    .header-actions {
        width: auto;
        gap: 15px;
    }

    .hamburger-btn {
        display: flex;
    }

    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .menu-overlay {
        top: 64px;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        max-width: none;
        height: calc(100vh - 64px);
        background-color: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 24px 20px 120px;
        box-sizing: border-box;
        gap: 6px;
        z-index: 1001;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.4s var(--smooth-easing);
        transform: translateX(-100%);
        box-shadow: none;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-menu.active {
        transform: translateX(0);
        box-shadow: none;
    }

    .nav-link {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
        font-size: 1rem;
        font-weight: 500;
        color: var(--primary);
        border-radius: 12px;
    }

    .nav-link::before {
        display: none;
    }

    .nav-line {
        display: none;
    }

    .nav-item-icon {
        display: block;
        width: 22px;
        height: 22px;
        margin-right: 16px;
        color: inherit;
        transition: none;
    }

    .nav-link:hover,
    .nav-link:active {
        background-color: #f8fafc;
        color: var(--primary);
    }

    .user-module-container {
        margin-left: 0;
        margin-top: auto;
        width: 100%;
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 10px 0 0 0;
    }

    .user-profile-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 10px;
        border-radius: 100px;
        background: #ffffff;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        cursor: default;
    }

    .user-profile-btn:hover {
        background: #f8fafc;
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    }

    .user-avatar-generic {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .user-info {
        margin-left: 8px;
        flex-grow: 1;
        overflow: hidden;
        min-width: 0;
    }

    .user-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .user-role {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .user-more-icon {
        display: none !important;
    }

    .nav-icon {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        padding: 14px 0;
        font-weight: 600;
        color: var(--primary);
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: 100px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    }

    .nav-icon svg {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        color: var(--accent);
    }

    .nav-icon-text {
        display: block;
    }

    .user-dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        background: transparent;
        gap: 0;

        display: flex !important;
        flex-direction: column;
        opacity: 1 !important;
        visibility: visible !important;
        animation: none !important;
        pointer-events: auto !important;
    }

    .mega-menu-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .mega-column {
        gap: 0;
    }

    .mega-header {
        display: block;
        padding: 20px 16px 12px;
        font-size: 0.7rem;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-top: 1px solid var(--border-color);
        margin-bottom: 0;
    }

    .mega-column:first-child .mega-header {
        border-top: none;
        padding-top: 10px;
    }

    .mega-card {
        padding: 12px 16px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mega-card:hover {
        background-color: #f8fafc;
        box-shadow: none;
        transform: none;
    }

    .mega-icon-box {
        width: auto;
        height: auto;
        background: transparent;
        color: var(--accent);
        padding: 0;
        border-radius: 0;
    }

    .mega-icon-box svg {
        width: 18px;
        height: 18px;
        margin-right: 0;
    }

    .mega-text {
        gap: 0;
    }

    .mega-text p {
        display: none;
    }

    .mega-text h4 {
        font-weight: 500;
        color: var(--accent);
        margin: 0;
    }

    .mega-card:hover .mega-text h4,
    .mega-card:hover .mega-icon-box {
        color: var(--primary);
    }

    @media (min-width: 1025px) {
        .user-dropdown-menu.role-2 {
            width: 380px;
        }

        .user-dropdown-menu.role-2 .mega-menu-grid {
            grid-template-columns: 1fr;
        }
    }

    .mega-link-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mega-footer {
        padding: 0;
        border-top: none;
        margin-top: 0;
    }

    .mega-footer-text {
        display: none;
    }

    .logout-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        background: transparent;
        border: none;
        box-shadow: none;
        color: var(--text-muted);
        font-weight: 500;
        border-radius: 0;
        gap: 12px;
        margin-top: 4px;
        border-top: 1px solid var(--border-color);
        display: flex;
        align-items: center;
    }

    .logout-btn svg {
        width: 18px;
        height: 18px;
        color: var(--accent);
    }

    .logout-btn:hover {
        background: #fef2f2;
        color: var(--accent-hover);
        border-color: var(--border-color);
    }

    .login-modal-box {
        padding: 35px 25px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 20px;
    }

    .nav-menu {
        padding: 24px 15px 120px;
    }
}