:root {
    --brand-primary: #4338ca;
    --brand-secondary: #1e1b4b;
    --brand-accent: #10b981;
    --nav-gradient: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    --surface: rgba(255, 255, 255, 0.98);
    --surface-muted: rgba(255, 255, 255, 0.85);
    --text-primary: #1f2937;
    --text-muted: #6b7280;
    --border-soft: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(67, 56, 202, 0.12);
    --shadow-soft: 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 28px 75px rgba(17, 24, 39, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(160deg, #f5f7ff 0%, #eef2ff 50%, #dbeafe 100%);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.app-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 0.85rem 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1040;
}

.app-navbar.is-scrolled {
    box-shadow: var(--shadow-strong);
    padding: 0.6rem 0;
}

.app-navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0;
}

.app-navbar__logo {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-size: 1rem;
    box-shadow: none;
}

.app-navbar__logo-img {
    height: 40px;
    width: auto;
    display: block;
    filter: brightness(0);
}

.app-navbar__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.app-navbar__brand-text .title {
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    color: var(--brand-secondary);
}

.app-navbar__brand-text .subtitle {
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    text-transform: uppercase;
}

@media (max-width: 576px) {
    .app-navbar__brand-text .subtitle {
        display: none;
    }
}

.app-navbar__toggler {
    border: none;
    padding: 0.45rem 0.6rem;
    border-radius: 12px;
    background: rgba(67, 56, 202, 0.08);
    color: var(--brand-primary);
    box-shadow: none;
    transition: all 0.2s ease;
}

.app-navbar__toggler:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.app-navbar__toggler .fa-bars {
    font-size: 1.1rem;
}

.app-navbar__collapse {
    align-items: center;
    gap: 1rem;
}

.app-navbar__menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-navbar__menu .nav-link {
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    transition: all 0.2s ease;
}

.app-navbar__menu .nav-link:hover {
    color: var(--brand-primary);
    background: rgba(67, 56, 202, 0.08);
}

.app-navbar__menu .nav-link.active {
    color: var(--brand-primary);
    background: rgba(67, 56, 202, 0.16);
    box-shadow: 0 6px 18px rgba(67, 56, 202, 0.18);
}

.app-navbar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-navbar__support {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-accent);
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.app-navbar__support:hover {
    transform: translateY(-2px);
    background: rgba(16, 185, 129, 0.18);
    color: var(--brand-accent);
}

.app-navbar__user {
    position: relative;
}

.app-navbar__user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 0.5rem 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
}

.app-navbar__user-btn:hover {
    border-color: var(--border-strong);
    box-shadow: 0 12px 30px rgba(67, 56, 202, 0.15);
}

.app-navbar__user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--nav-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.app-navbar__user .details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.app-navbar__user .details strong {
    font-size: 0.95rem;
}

.app-navbar__user .details small {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-navbar__dropdown {
    border: none;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
    padding: 0.75rem 0;
    background: var(--surface);
    min-width: 220px;
}

.app-navbar__dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0.65rem 1.25rem;
}

.app-navbar__dropdown .dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--brand-primary);
}

.app-navbar__dropdown .dropdown-item:hover {
    background: rgba(67, 56, 202, 0.08);
    color: var(--brand-primary);
}

.app-navbar__dropdown .text-danger i {
    color: #ef4444;
}

.app-navbar__login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.35rem;
    border-radius: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-navbar__login:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 45px rgba(79, 70, 229, 0.35);
    color: #fff;
}

.main-content {
    padding-top: 96px;
    min-height: 100vh;
    transition: opacity 0.3s ease;
}

#iframeContainer {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(12px);
    z-index: 1060;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#iframeContainer.active {
    display: flex;
    opacity: 1;
}

#iframeContainer iframe {
    width: 92%;
    height: 92%;
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    background: #fff;
}

#closeIframe {
    position: absolute;
    top: 26px;
    right: 36px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

#closeIframe:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.26);
}

.scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 24px rgba(79, 70, 229, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 1030;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-4px);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.page-transition.loaded {
    opacity: 1;
}

@media (max-width: 1199px) {
    .app-navbar__actions {
        gap: 0.75rem;
    }
}

@media (max-width: 991px) {
    .app-navbar {
        padding: 1rem 0;
    }

    .app-navbar__collapse {
        align-items: flex-start;
        gap: 1.25rem;
    }

    .app-navbar__menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .app-navbar__menu .nav-link {
        width: 100%;
        padding: 0.75rem 0.95rem;
    }

    .app-navbar__actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
    }

    .app-navbar__support {
        justify-content: center;
        width: 100%;
    }

    .app-navbar__user-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .app-navbar__login {
        justify-content: center;
        width: 100%;
    }

    #iframeContainer iframe {
        width: 96%;
        height: 96%;
    }

    #closeIframe {
        top: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 576px) {
    .app-navbar__support {
        display: none;
    }

    .scroll-top {
        right: 18px;
        bottom: 18px;
    }
}
