:root {
    --portal-navy: #102f49;
    --portal-navy-deep: #0b253a;
    --portal-blue: #078ccb;
    --portal-blue-dark: #0577ad;
    --portal-canvas: #f3f7fb;
    --portal-card: #fff;
    --portal-line: #d9e4ee;
    --portal-text: #08233f;
    --portal-muted: #73899e;
    --portal-success: #17c77a;
    --portal-danger: #df3d49;
    --portal-shadow: 0 20px 48px rgba(25, 55, 82, .08);
}

*, *::before, *::after {
    box-sizing: border-box;
}
html { min-height: 100%; font-size: 16px; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--portal-text);
    background: var(--portal-canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.admin-body { overflow-x: hidden; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: #fff;
    background: linear-gradient(180deg, var(--portal-navy), var(--portal-navy-deep));
    box-shadow: 12px 0 34px rgba(16, 47, 73, .09);
    z-index: 20;
}
.portal-brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; color: #fff; }
.portal-brand__mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #19a8e8, #047eb9);
    box-shadow: 0 12px 28px rgba(0, 153, 219, .25);
    font-size: 21px;
    font-weight: 900;
}
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: 20px; line-height: 1; letter-spacing: .04em; }
.portal-brand small { margin-top: 5px; color: #8eb3ce; font-size: 10px; letter-spacing: .17em; }
.admin-nav { display: grid; gap: 8px; margin-top: 58px; }
.admin-nav__label { margin: 22px 14px 5px; color: #6f97b3; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.admin-nav__item {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #a9bfd0;
    font-size: 14px;
    font-weight: 750;
    transition: color 160ms, background 160ms, transform 160ms;
}
.admin-nav__item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.admin-nav__item.is-active { color: #fff; background: var(--portal-blue); box-shadow: 0 12px 28px rgba(0,139,203,.23); }
.admin-nav__icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    color: #8fd7f6;
    background: rgba(16,123,174,.2);
}
.admin-nav__item.is-active .admin-nav__icon { color: #fff; background: rgba(255,255,255,.14); }
.admin-nav__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.admin-sidebar__status { display: flex; align-items: flex-start; gap: 11px; margin: auto -18px -20px; padding: 22px 26px; border-top: 1px solid rgba(255,255,255,.08); }
.status-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--portal-success); box-shadow: 0 0 0 5px rgba(23,199,122,.1); }
.admin-sidebar__status strong, .admin-sidebar__status small { display: block; }
.admin-sidebar__status strong { color: #d8e6ef; font-size: 12px; }
.admin-sidebar__status small { margin-top: 5px; color: #6f97b3; font-size: 10px; }
.admin-workspace { min-width: 0; }
.admin-topbar {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 15px clamp(24px, 3.5vw, 54px);
    border-bottom: 1px solid #e2eaf1;
    background: rgba(255,255,255,.96);
}
.admin-topbar > div:first-child strong, .admin-topbar > div:first-child span, .admin-account strong, .admin-account small { display: block; }
.admin-topbar > div:first-child strong { font-size: 16px; }
.admin-topbar > div:first-child span, .admin-account small { margin-top: 4px; color: var(--portal-muted); font-size: 12px; }
.admin-account { display: flex; align-items: center; gap: 11px; }
.admin-account-wrap { display: flex; align-items: center; gap: 14px; }
.admin-account-wrap form { margin: 0; }
.admin-logout { padding: 8px 11px; border: 1px solid #cbd9e3; border-radius: 8px; color: #526e82; background: #f7fafc; font-size: 11px; font-weight: 750; cursor: pointer; }
.admin-logout:hover { border-color: #e3b5b7; color: #b52b31; background: #fff5f5; }
.admin-account__avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #007db9; background: #e1f3fc; font-weight: 900; }
.admin-account strong { font-size: 13px; }
.admin-content { min-height: calc(100vh - 86px); padding: clamp(28px, 3.5vw, 54px); }
.site-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px clamp(20px,5vw,80px); background: var(--portal-navy); }
.site-header__nav, .site-header__nav .navbar-nav { display: flex; align-items: center; gap: 18px; margin: 0; padding: 0; list-style: none; }
.site-header__nav a, .site-header__nav button { color: #c7d8e4 !important; font-size: 13px; }
.site-header__nav form { margin: 0; }
.site-header__nav button { padding: 0; border: 0; background: none; cursor: pointer; }
.site-content { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0; }

@media (max-width: 850px) {
    .admin-shell { grid-template-columns: 78px minmax(0,1fr); }
    .admin-sidebar { align-items: center; padding-inline: 12px; }
    .portal-brand > span:last-child, .admin-nav__label, .admin-nav__item > span:last-child, .admin-sidebar__status > div { display: none; }
    .admin-nav__item { justify-content: center; padding: 8px; }
    .admin-sidebar__status { justify-content: center; width: calc(100% + 24px); margin-inline: -12px; padding-inline: 12px; }
}

@media (min-width: 851px) {
    .admin-shell {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .admin-sidebar {
        padding: 23px 14px 18px;
    }

    .admin-sidebar .portal-brand {
        margin-left: 4px;
    }

    .admin-sidebar .portal-brand__mark {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 18px;
    }

    .admin-sidebar .portal-brand strong {
        font-size: 17px;
    }

    .admin-nav {
        margin-top: 38px;
    }

    .admin-nav__label {
        margin-top: 14px;
    }

    .admin-nav__item {
        min-height: 44px;
        padding: 7px 10px;
        border-radius: 10px;
        font-size: 12px;
    }

    .admin-nav__icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .admin-sidebar__status {
        margin: auto -14px -18px;
        padding: 17px 20px;
    }

    .admin-topbar {
        min-height: 74px;
        padding: 12px clamp(24px, 2.7vw, 40px);
    }

    .admin-account__avatar {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .admin-content {
        min-height: calc(100vh - 74px);
        padding: clamp(24px, 2.7vw, 40px);
    }
}
@media (max-width: 580px) {
    .admin-shell { display: block; }
    .admin-sidebar { position: relative; width: 100%; height: auto; min-height: 68px; flex-direction: row; justify-content: space-between; padding: 11px 16px; }
    .admin-nav { display: flex; margin: 0; }
    .admin-nav__item { min-height: 44px; }
    .admin-sidebar__status, .admin-nav__label { display: none; }
    .admin-topbar { min-height: 72px; padding: 12px 16px; }
    .admin-account > div { display: none; }
    .admin-content { padding: 22px 14px 34px; }
    .site-header__nav { display: none; }
}

/* Centered admin workspace with a softer canvas */
.admin-workspace {
    background:
        radial-gradient(circle at 88% 10%, rgba(24, 145, 196, .1), transparent 26%),
        linear-gradient(145deg, #ccd9e3, #e4ebf0 52%, #d5e1e9);
}

.admin-topbar {
    border-bottom-color: #c8d5df;
    background: rgba(225, 234, 240, .94);
    backdrop-filter: blur(12px);
}

.admin-account__avatar {
    background: #cfe7f2;
}

@media (min-width: 581px) {
    .admin-content {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
.legal-page {
    width: min(760px, calc(100% - 32px));
    margin: 48px auto;
}

.legal-card {
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid rgba(118, 147, 171, .2);
    border-radius: 26px;
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 24px 70px rgba(18, 48, 69, .09);
}

.legal-card h1 {
    margin: 4px 0 20px;
}

.legal-card h2 {
    margin: 28px 0 8px;
    font-size: 1.05rem;
}

.legal-card p {
    color: var(--muted, #61778a);
    line-height: 1.75;
}

.legal-card a {
    color: #076fa6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-languages {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.legal-languages a[aria-current="page"] {
    color: var(--portal-text);
    font-weight: 750;
    text-decoration: none;
}

/* Unified compact admin navigation */
@media (max-width: 580px) {
    .admin-body,
    .admin-shell,
    .admin-workspace,
    .admin-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 100;
        min-height: 64px;
        gap: 8px;
        padding: 10px 12px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .admin-sidebar .portal-brand__mark {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 18px;
    }

    .admin-nav {
        flex: 0 0 auto;
        gap: 4px;
    }

    .admin-nav__item {
        width: 42px;
        min-height: 42px;
        padding: 5px;
        border-radius: 10px;
    }

    .admin-nav__icon {
        width: 30px;
        height: 30px;
    }

    .admin-topbar {
        min-height: 64px;
        gap: 10px;
        padding: 10px 13px;
    }

    .admin-topbar > div:first-child {
        min-width: 0;
    }

    .admin-topbar > div:first-child strong {
        overflow: hidden;
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-topbar > div:first-child span,
    .admin-account__avatar {
        display: none;
    }

    .admin-account-wrap {
        flex: 0 0 auto;
        gap: 7px;
    }

    .admin-logout {
        min-height: 40px;
        padding: 8px 10px;
    }

    .admin-content {
        display: block;
        min-height: calc(100svh - 128px);
        padding: 14px 10px 28px;
    }
}

@media (max-width: 380px) {
    .admin-sidebar {
        padding-inline: 9px;
    }

    .admin-sidebar .portal-brand__mark {
        width: 38px;
        height: 38px;
    }

    .admin-nav__item {
        width: 39px;
        min-height: 39px;
    }
}
