/* Панель управления и страницы входа — те же токены, что в style.css (:root)
   Верстка входа/регистрации: split-screen как в ремейке (левая колонка — бренд, правая — форма). */

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background: #fdf7fa;
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 520px);
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 900px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-split__hero {
        display: none;
    }
}

.auth-split__hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 6vw, 72px);
    color: var(--color-text-white);
    overflow: hidden;
}

.auth-split__hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 20% 25%, rgba(235, 127, 177, 0.55), transparent 52%),
        radial-gradient(ellipse 70% 55% at 85% 75%, rgba(251, 227, 238, 0.22), transparent 48%),
        linear-gradient(165deg, #190009 0%, #2d121c 38%, #6b2f4d 72%, #b85280 100%);
}

.auth-split__hero-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-split__brand {
    display: block;
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 20px;
}

.auth-split__headline {
    margin: 0 0 16px;
    font-family: var(--font-accent);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.auth-split__sub {
    margin: 0;
    font-size: clamp(15px, 2vw, 17px);
    line-height: 1.55;
    opacity: 0.88;
    font-weight: 400;
}

.auth-split__panel {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(235, 127, 177, 0.18), transparent 52%),
        linear-gradient(180deg, #ffffff 0%, #fdf7fa 100%);
    border-left: 1px solid rgba(235, 127, 177, 0.14);
}

@media (max-width: 900px) {
    .auth-split__panel {
        border-left: none;
    }
}

.auth-split__panel-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(20px, 5vw, 48px) clamp(18px, 4vw, 40px);
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-split__top {
    margin-bottom: clamp(20px, 4vw, 36px);
}

.auth-split__logo-link {
    display: inline-flex;
    align-items: center;
}

.auth-split__logo {
    height: clamp(32px, 7vw, 42px);
    width: auto;
}

.auth-split__footer {
    margin-top: auto;
    padding-top: 28px;
    text-align: center;
    font-size: 14px;
}

.auth-split__footer a {
    color: var(--color-primary);
    font-family: var(--font-accent);
    font-weight: 500;
    text-decoration: none;
}

.auth-split__footer a:hover {
    text-decoration: underline;
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: clamp(22px, 5vw, 34px);
    box-shadow:
        0 12px 48px rgba(25, 0, 9, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(235, 127, 177, 0.16);
}

.auth-card__title {
    font-family: var(--font-accent);
    font-size: clamp(1.35rem, 3.5vw, 1.65rem);
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: var(--color-text-dark);
}

@media (min-width: 901px) {
    .auth-split .auth-card > .auth-card__title {
        display: none;
    }
}

.auth-card__hint {
    font-size: 14px;
    opacity: 0.78;
    margin: 0 0 22px;
    line-height: 1.45;
}

.auth-card__switch {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.auth-card__switch a {
    color: var(--color-primary);
    font-family: var(--font-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-card__switch a:hover {
    text-decoration: underline;
}

.auth-form .dash-field {
    margin-bottom: 14px;
}

.auth-form .dash-field--recaptcha .g-recaptcha {
    display: inline-block;
}

.auth-form .dash-label {
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.85;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="tel"],
.auth-form input[type="email"] {
    max-width: none;
    border-radius: 16px;
    border: 1px solid rgba(25, 0, 9, 0.1);
    padding: 14px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(235, 127, 177, 0.65);
    box-shadow: 0 0 0 3px rgba(235, 127, 177, 0.2);
}

.dash-btn--auth-submit {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
    border-radius: 999px;
}

.auth-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.auth-message {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.auth-message--success {
    background: rgba(235, 127, 177, 0.15);
    color: var(--color-text-dark);
}

.auth-message--error {
    background: rgba(200, 60, 90, 0.12);
}

/* === Dashboard layout === */

.dash-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #fdf7fa 0%, #fff 40%, #fbe3ee 100%);
    font-family: var(--font-body);
    color: var(--color-text-dark);
}

/* Как главная страница: перелом 1200px, выезжающее меню и overlay из style.css (.header-overlay) */
.dash-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1201px) {
    .dash-app {
        display: grid;
        grid-template-columns: minmax(220px, 280px) 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "side head"
            "side main";
        min-height: 100vh;
    }

    .dash-app > .header-overlay.dash-nav-overlay {
        display: none !important;
        visibility: hidden;
        pointer-events: none;
    }

    /* Ряд с бургером (класс как у шапки сайта из style.css) — только ≤1200 */
    .dash-app .dash-header-burger.header-burger {
        display: none !important;
    }

    .dash-sidebar {
        grid-area: side;
        position: static !important;
        width: auto;
        height: auto;
        min-height: 0;
        transform: none !important;
        box-shadow: 4px 0 32px rgba(25, 0, 9, 0.12);
    }

    .dash-topbar {
        grid-area: head;
    }

    .dash-main {
        grid-area: main;
        min-height: 0;
    }
}

@media (max-width: 1200px) {
    /* Высота шапки mobile: drawer начинается под топбаром (тот выше по z-index) */
    .dash-app {
        --dash-topbar-h: calc(env(safe-area-inset-top, 0px) + clamp(3.5rem, 10vw, 4.75rem));
        position: relative;
        z-index: 1000;
    }

    .dash-app > .header-overlay.dash-nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 40;
    }

    /* Правая панель: по умолчанию за экраном и недоступна для взаимодействия / отрисовки */
    .dash-sidebar {
        position: fixed !important;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: min(100%, 360px);
        max-width: 100%;
        height: 100%;
        min-height: 100dvh;
        margin: 0;
        z-index: 1;
        padding: 4.5rem 24px 2rem 24px;
        padding-top: max(4.5rem, calc(env(safe-area-inset-top, 0px) + 3.5rem));
        background: rgba(235, 127, 177, 0.97);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: -6px 0 28px rgba(25, 0, 9, 0.15);
        transform: translateX(100%);
        transition:
            transform 0.3s ease,
            visibility 0s linear 0.3s;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-sizing: border-box;
        visibility: hidden;
        pointer-events: none;
    }

    body.header--nav-open .dash-sidebar,
    body.dash-body.header--nav-open .dash-sidebar {
        top: var(--dash-topbar-h);
        bottom: 0;
        height: auto;
        min-height: 0;
        max-height: none;
        z-index: 50;
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        padding-top: clamp(1.75rem, 5vw, 2.75rem);
        padding-bottom: 2rem;
        transition:
            transform 0.3s ease,
            visibility 0s linear 0s;
    }

    .dash-main {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 10;
        isolation: isolate;
    }

    .dash-body .dash-topbar .dash-header-burger.header-burger {
        display: flex !important;
    }
}


.dash-sidebar {
    background: linear-gradient(180deg, rgba(235, 127, 177, 0.92) 0%, rgba(190, 90, 140, 0.95) 100%);
    color: var(--color-text-white);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 4px 0 32px rgba(25, 0, 9, 0.12);
}

.dash-sidebar.dash-sidebar-enter {
    opacity: 0;
    animation: lbSlideFromLeft 0.44s var(--lb-ease-out) forwards;
}

@media (max-width: 1200px) {
    .dash-sidebar.dash-sidebar-enter {
        animation: none !important;
        opacity: 1 !important;
        transform: translateX(100%) !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.header--nav-open .dash-sidebar.dash-sidebar-enter,
    body.dash-body.header--nav-open .dash-sidebar.dash-sidebar-enter {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

.dash-sidebar__brand {
    font-family: var(--font-accent);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
    margin-bottom: 12px;
}

.dash-nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition:
        background 0.2s ease,
        transform var(--lb-duration-fast, 0.22s) var(--lb-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.dash-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.dash-nav-link--active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.dash-sidebar__spacer {
    flex: 1;
}

/* Кнопка «Профиль» в нижнем блоке сайдбара — на всю ширину блока */
.dash-sidebar__profile-btn.dash-btn--ghost {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

/* Кнопка бургера на панели — стили .header-burger и крестика body.header--nav-open в style.css */

.dash-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(16px, 3vw, 32px);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(235, 127, 177, 0.15);
}

.dash-topbar__title {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin: 0;
}

.dash-topbar__meta {
    font-size: 13px;
    opacity: 0.75;
}

@media (max-width: 1200px) {
    /* Та же высота слоя, что выше (60), иначе это правило перебивает и шапка уходит под оверлей */
    .dash-body .dash-topbar {
        flex-wrap: nowrap;
        gap: 12px;
        position: relative;
        z-index: 60;
        flex-shrink: 0;
    }

    .dash-body .dash-topbar .dash-header-burger.header-burger {
        position: relative;
        z-index: 5;
        flex-shrink: 0;
    }

    .dash-body .dash-topbar__title {
        flex: 1;
        min-width: 0;
    }
}

.dash-content.dash-enter {
    opacity: 0;
    animation: lbFadeUp var(--lb-duration-enter) var(--lb-ease-soft) forwards;
    animation-delay: 0.07s;
}

.dash-content {
    padding: clamp(16px, 3vw, 32px);
    flex: 1;
}

.dash-messages {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.dash-messages li {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}

.dash-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dash-stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(235, 127, 177, 0.18);
    box-shadow: 0 6px 28px rgba(25, 0, 9, 0.06);
}

.dash-stat-card__value {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-primary);
}

.dash-stat-card__label {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.dash-table-wrap {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(235, 127, 177, 0.15);
    box-shadow: 0 8px 32px rgba(25, 0, 9, 0.06);
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dash-table th,
.dash-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(25, 0, 9, 0.06);
}

.dash-table th {
    font-family: var(--font-accent);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.dash-help {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-muted, #75656b);
    margin: 4px 0 8px;
}

.dash-form--top-gap {
    margin-top: 20px;
}

.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    font-family: var(--font-accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition:
        transform var(--lb-duration-fast, 0.22s) var(--lb-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
        box-shadow 0.25s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        opacity 0.2s ease;
}

.dash-btn--primary {
    background: var(--color-primary);
    color: var(--color-text-white);
    box-shadow: 0 6px 24px rgba(235, 127, 177, 0.45);
}

.dash-btn--primary:hover,
.dash-btn--primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(235, 127, 177, 0.5);
}

.dash-btn--ghost {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
    border: 1px solid rgba(235, 127, 177, 0.45);
}

.dash-btn--ghost:hover,
.dash-btn--ghost:focus-visible {
    transform: translateY(-1px);
}

.dash-btn--danger {
    background: transparent;
    color: #b83256;
    border: 1px solid rgba(184, 50, 86, 0.35);
}

.dash-form .dash-field {
    margin-bottom: 16px;
}

.dash-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    font-family: var(--font-accent);
}

.dash-field-hint {
    margin: -4px 0 8px;
    max-width: 560px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(25, 0, 9, 0.55);
}

.dash-form input[type="text"],
.dash-form input[type="email"],
.dash-form input[type="number"],
.dash-form input[type="url"],
.dash-form input[type="password"],
.dash-form textarea,
.dash-form select {
    width: 100%;
    max-width: 560px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(25, 0, 9, 0.12);
    font: inherit;
    background: rgba(255, 255, 255, 0.95);
}

.dash-form textarea {
    min-height: 120px;
    resize: vertical;
}

.dash-form ul.errorlist {
    margin: 4px 0 0;
    padding-left: 18px;
    color: #b83256;
    font-size: 13px;
}

.dash-alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.dash-alert--error {
    background: rgba(200, 60, 90, 0.1);
}

.dash-alert--info {
    background: rgba(120, 160, 220, 0.12);
    border: 1px solid rgba(120, 160, 220, 0.35);
}

.dash-muted {
    font-size: 13px;
    opacity: 0.72;
}

.dash-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
}

/* Вход / регистрация — мягкое появление колонок */
@media (min-width: 901px) {
    .auth-split__hero-inner {
        opacity: 0;
        animation: lbFadeUp 0.52s var(--lb-ease-out) forwards;
    }
}

.auth-split__panel-scroll {
    opacity: 0;
    animation: lbFadeUp calc(var(--lb-duration-enter) + 0.04s) var(--lb-ease-soft) forwards;
    animation-delay: 0.08s;
}

@media (max-width: 900px) {
    .auth-split__panel-scroll {
        animation-delay: 0;
    }
}

.dash-user-role-form {
    display: inline-block;
    margin: 0;
}

.dash-user-role-form__select {
    max-width: 140px;
    font-size: 13px;
    padding: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-split__hero-inner,
    .auth-split__panel-scroll {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .dash-content.dash-enter {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Колонка меню только на широком экране; на узком drawer остаётся за кадром (translateX) */
    @media (min-width: 1201px) {
        .dash-sidebar.dash-sidebar-enter {
            animation: none !important;
            opacity: 1 !important;
            transform: none !important;
        }
    }

    .dash-sidebar {
        transition: none !important;
    }

    @media (max-width: 1200px) {
        .dash-sidebar.dash-sidebar-enter {
            animation: none !important;
            opacity: 1 !important;
            transform: translateX(100%) !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        body.header--nav-open .dash-sidebar.dash-sidebar-enter,
        body.dash-body.header--nav-open .dash-sidebar.dash-sidebar-enter {
            transform: translateX(0) !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }
    }

    .header-burger__line {
        transition: none !important;
    }

    .dash-nav-link:hover {
        transform: none !important;
    }

    .dash-btn--primary:hover,
    .dash-btn--primary:focus-visible,
    .dash-btn--ghost:hover,
    .dash-btn--ghost:focus-visible {
        transform: none !important;
    }
}
