html {
    font-size: 15px;
}
body{
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-height: 100vh;
    font-size: 15px;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    &.modal-open {
        overflow: hidden;
    }
}
/* HEADER */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    .hdr {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 54px;
    }
    .logout-btn {
        font-size: .8125rem;
        color: var(--ink-soft);
        background: none;
        border: none;
        cursor: pointer;
        padding: .25rem .5rem;
        border-radius: 5px;
        transition: color .15s, background .15s;
        &:hover {
            color: var(--red);
            background: var(--red-light);
        }
    }
    .btn-login-hdr {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: .35rem .875rem;
        font-family: inherit;
        font-size: .8125rem;
        font-weight: 500;
        color: var(--ink-soft);
        background: none;
        border: 1.5px solid var(--border);
        border-radius: 7px;
        cursor: pointer;
        transition: all .15s;
        &:hover {
            border-color: #b5cef5;
            color: var(--accent);
        }
        & svg {
            width: 14px;
            height: 14px;
        }
    }
    .user-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: .875rem;
        font-weight: 500;
        color: var(--ink-mid);
        .uav {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--accent);
            color: #fff;
            font-size: .75rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        & a {
            color: inherit;
            text-decoration: none;
            &:hover {
                background: var(--bg);
            }
        }
    }
}
/* TOAST */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--ink);
    color: #fff;
    font-size: .8125rem;
    padding: .5rem 1.125rem;
    border-radius: 7px;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    transition: opacity .22s, transform .22s;
    &.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
/* ── БУРГЕР (мобильное меню) ── */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s;
}

.burger:hover {
    border-color: #b5cef5;
}

.burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ink-mid);
    border-radius: 2px;
    transition: transform .22s, opacity .18s;
}

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

.burger.open span:nth-child(2) {
    opacity: 0;
}

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

/* ── БУРГЕР: сворачиваем меню на узких экранах ── */
@media (max-width: 760px) {
    .burger {
        display: flex;
    }

    .hdr {
        position: relative;
        gap: .75rem;
    }

    /* меню и правый блок уезжают в выпадающую панель */
    #top-menu, #hdrRight {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--sh-md);
        z-index: 400;
    }

    .hdr.menu-open #top-menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: .5rem;
        gap: 2px;
    }

    .hdr.menu-open #hdrRight {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: .75rem 1rem;
        gap: .625rem;
        top: auto;
        border-top: 1px solid var(--border-light);
        position: static;
        box-shadow: none;
        border-bottom: none;
    }

    /* всё содержимое панели — в одном потоке */
    .hdr.menu-open #top-menu {
        top: calc(100% + 1px);
    }

    /* дропдаун администрирования внутри панели — разворачиваем на месте */
    .hdr.menu-open .nav-dd-wrap {
        position: static;
    }

    .hdr.menu-open .dd-item {
        padding: .5rem .75rem;
    }

    /* пользователь / кнопка входа в панели */
    .hdr.menu-open #hdrRight > div {
        width: 100%;
        justify-content: space-between;
    }

    .btn-login-hdr {
        justify-content: center;
    }

}
