:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #fcfcfd;
    --text: #1f2937;
    --text-soft: #6b7280;
    --border: #e9edf5;
    --mint: #dff7f2;
    --peach: #ffe8dc;
    --soft-blue: #e6f0ff;
    --soft-pink: #ffe3ec;
    --blue: #4f7cff;
    --blue-dark: #3d68eb;
    --red: #e45b5b;
    --shadow-sm: 0 4px 14px rgba(31, 41, 55, 0.05);
    --shadow-md: 0 10px 30px rgba(31, 41, 55, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 18px 24px 12px;
    background: rgba(247, 248, 251, 0.88);
    backdrop-filter: blur(14px);
}

.site-header__shell {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    gap: 12px;
    padding: 14px 18px 16px;
    background:
        radial-gradient(circle at top left, rgba(223, 247, 242, 0.92), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 253, 0.96) 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 30px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.site-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.site-brand__icon {
    width: 156px;
    height: 54px;
    display: block;
}

.site-brand__logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.site-header__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-nav {
    display: flex;
    justify-content: center;
}

.site-nav__list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
    background: rgba(248, 250, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.95);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    background: #ffffff;
    border-color: rgba(79, 124, 255, 0.24);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.site-nav__link--accent {
    background: rgba(255, 232, 220, 0.9);
    border-color: rgba(244, 163, 64, 0.26);
}

.site-nav__link--accent:hover,
.site-nav__link--accent:focus-visible {
    border-color: rgba(228, 91, 91, 0.32);
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    background: rgba(248, 250, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.header-user:hover,
.header-user:focus-visible {
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    outline: none;
}

.header-user__avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--soft-blue), var(--soft-pink));
    font-weight: 800;
    color: var(--text);
    flex-shrink: 0;
}

.header-user__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.header-user__name {
    font-size: 0.92rem;
    font-weight: 700;
}

.header-user__role {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.site-auth-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.site-button--ghost {
    color: var(--text);
    border: 1px solid var(--border);
    background: transparent;
}

.site-button--ghost:hover,
.site-button--ghost:focus-visible {
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    outline: none;
}

.site-button--primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #3d68eb);
    border: 1px solid transparent;
    box-shadow: 0 10px 24px rgba(79, 124, 255, 0.22);
}

.site-button--primary:hover,
.site-button--primary:focus-visible {
    filter: brightness(1.03);
    transform: translateY(-1px);
    outline: none;
}

.site-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 14px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.site-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 999px;
}

.site-flash-stack {
    position: fixed;
    top: 126px;
    right: 24px;
    z-index: 180;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.site-flash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid transparent;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.16);
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-flash--success {
    background: #ecfdf3;
    border-color: #a7f3d0;
    color: #166534;
}

.site-flash--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.site-flash--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.site-flash--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.site-flash__content {
    min-width: 0;
}

.site-flash__eyebrow {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.site-flash__message {
    margin: 6px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: pre-line;
}

.site-flash__close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    color: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-flash__close:hover,
.site-flash__close:focus-visible {
    background: rgba(255, 255, 255, 0.75);
    transform: scale(1.04);
    outline: none;
}

.site-footer {
    padding: 22px 24px 32px;
}

.site-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.site-footer__copy {
    margin: 0;
}

.site-footer__nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer__nav a {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 600;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
    color: var(--text);
    text-decoration: underline;
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1080px) {
    .site-header {
        padding: 16px 18px 10px;
    }

    .site-header__shell {
        gap: 0;
        padding: 12px;
        border-radius: 26px;
        position: relative;
    }

    .site-header__top {
        gap: 12px;
    }

    .site-brand__icon {
        width: 144px;
        height: 52px;
    }

    .site-nav-toggle {
        display: inline-block;
        flex-shrink: 0;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        display: block;
        padding: 12px;
        background: rgba(255, 255, 255, 0.99);
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 24px;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
        z-index: 20;
    }

    .site-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .site-nav__link,
    .site-nav__link--accent {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
        background: #f8fbff;
    }

    .site-nav__link:hover,
    .site-nav__link:focus-visible {
        background: #eef5ff;
        box-shadow: none;
        transform: none;
    }

    .site-nav-toggle span {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .site-nav-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .site-nav-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .site-nav-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .site-flash-stack {
        top: 112px;
        right: 16px;
    }
}

@media (max-width: 720px) {
    .site-header {
        padding: 12px 12px 8px;
    }

    .site-header__shell {
        padding: 10px;
        border-radius: 22px;
    }

    .site-header__top {
        align-items: center;
    }

    .site-brand__icon {
        width: 122px;
        height: 44px;
    }

    .site-header__controls {
        gap: 8px;
    }

    .header-user {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .header-user__meta {
        display: none;
    }

    .header-user__avatar {
        width: 40px;
        height: 40px;
    }

    .site-auth-links {
        gap: 8px;
    }

    .site-button {
        padding: 9px 12px;
        font-size: 0.84rem;
    }

    .site-nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .site-nav {
        top: calc(100% + 8px);
        padding: 10px;
        border-radius: 20px;
    }

    .site-nav__link,
    .site-nav__link--accent {
        padding: 13px 14px;
        font-size: 0.92rem;
    }

    .site-flash-stack {
        top: 92px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .site-flash {
        padding: 15px 16px;
        border-radius: 18px;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 4px;
    }
}
