/* ===== БАЗА / ВЫСОТА ===== */

:root {
    --rlv-header-h: 56px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* пусть скролл остаётся у body */
body {
    overflow-x: hidden;
}

/* корневой RadzenLayout */
.rlv-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Radzen body не резервирует место под сайдбар */
.rlv-layout .rz-body {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* RadzenBody, на котором класс rlv-app-bg:
   фон + нормальная высота, сам flex-контейнер.
   В RlvShell футер вынесен на уровень RadzenLayout, поэтому body растёт через flex,
   а min-height задаёт нижний предел для коротких страниц. */
.rlv-app-bg {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== BASE PAGE LAYOUT ===== */

.rlv-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(12px, 2vw, 20px);
    position: relative;
    z-index: 1; /* контент поверх фона/птички */
}

/* ===== HEADER ===== */

.rlv-header {
    background: var(--rlv-primary);
    color: var(--rlv-text-inv);
    border-bottom: 0;
}

.rlv-header-stack {
    padding: 8px 12px;
    min-height: var(--rlv-header-h);
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 10px;
}

.rlv-header-left {
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.rlv-header-right {
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* одинаковая высота кнопок в хедере */
.rlv-header-right .rz-button {
    height: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Brand clickable */

.rlv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 4px;
    flex: 0 0 auto;
}

.rlv-brand-click {
    cursor: pointer;
    border-radius: 12px;
    padding: 6px 10px;
    min-height: 44px;            /* touch-friendly */
    -webkit-tap-highlight-color: transparent;
    transition: background var(--rlv-fast);
}

.rlv-brand-click:hover,
.rlv-brand-click:focus-visible,
.rlv-brand-click:active {
    background: rgba(255, 255, 255, .12);
    outline: none;
}

.rlv-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: var(--rlv-shadow-sm);
}

.rlv-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.rlv-brand-title {
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    white-space: nowrap;
}

.rlv-brand-sub {
    font-size: .82rem;
    color: #d9def3;
    white-space: nowrap;
}

.rlv-greet {
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34vw;
}

.role-label {
    color: #D1C4E9;
    font-weight: 500;
    font-size: 16px;
    padding-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ===== SIDEBAR ПОД ХЕДЕРОМ ===== */

.rlv-sidebar {
    background-color: var(--rlv-primary);
    border-inline-end: none !important;

    position: fixed !important;
    left: 0;
    top: var(--rlv-header-h);
    height: calc(100vh - var(--rlv-header-h));
    width: 300px;
    z-index: 1000;

    padding: 10px 8px 12px;
    overflow: auto;

    transform: translateX(-105%);
    transition: transform var(--rlv-fast) ease;
    will-change: transform;

    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Radzen в разных версиях ставит один из двух классов */
.rlv-sidebar.rz-sidebar-expanded,
.rlv-sidebar.rz-sidebar-responsive-expanded {
    transform: translateX(0) !important;
}

/* ===== NAVMENU BEAUTY ===== */

.rlv-sidebar .rz-panel-menu {
    background: transparent;
    padding: 4px;
    font-size: 0.98rem;
}

.rlv-sidebar .rz-navigation-item {
    margin: 6px 0;
    border-radius: 14px;
    overflow: hidden;
    border: none;
}

.rlv-sidebar .rz-navigation-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;

    color: #eef1ff;
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.04);
    transition: background var(--rlv-fast), transform var(--rlv-fast);
}

.rlv-sidebar .rz-navigation-item-link:hover {
    background: rgba(255, 255, 255, .12);
    transform: translateX(2px);
}

.rlv-sidebar .rz-navigation-item-icon {
    color: #fff;
    font-size: 1.35rem;
    margin: 0;
    width: 22px;
    display: inline-flex;
    justify-content: center;
}

/* активный пункт */
.rlv-sidebar .rz-navigation-item-active,
.rlv-sidebar .rz-navigation-item-wrapper-active {
    background: rgba(255, 255, 255, .18);
}

.rlv-sidebar .rz-navigation-item-active:before,
.rlv-sidebar .rz-navigation-item-wrapper-active:before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 999px;
    background: #ffffff;
    opacity: .95;
}

/* вложенные пункты */
.rlv-sidebar .rz-navigation-item .rz-navigation-item {
    margin-left: 8px;
}

.rlv-sidebar .rz-navigation-item .rz-navigation-item-link {
    background: transparent;
    padding-left: 34px;
    font-size: .95rem;
    opacity: .92;
}

/* стрелка раскрытия */
.rlv-sidebar .rz-navigation-item-wrapper .rz-menu-toggle {
    margin-left: auto;
    opacity: .9;
}

/* ===== MAIN / FOOTER ===== */

/* main-content внутри RadzenBody — растёт и забирает свободное место */
.main-content {
    flex: 1 1 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Футер — прижатая ко дну полоса на уровне RadzenLayout.
   Поскольку RadzenLayout = flex column min-height 100vh, последний flex-элемент (footer)
   всегда оказывается у нижнего края viewport, а body растягивается через flex:1. */
.rlv-footer {
    flex: 0 0 auto;
    padding: 14px 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, var(--rlv-surface-2) 100%);
    border-top: 1px solid rgba(148, 163, 184, .25);
    color: var(--rlv-text-soft);
    font-size: .88rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    box-shadow: 0 -2px 14px rgba(15, 23, 42, .06);

    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .rlv-footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, .55) 0%, rgba(11, 16, 32, .9) 100%);
    border-top-color: rgba(148, 163, 184, .14);
    color: rgba(255, 255, 255, .72);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .45);
}

.rlv-footer-stack {
    width: 100%;
    gap: 12px;
}

.rlv-footer a {
    color: var(--rlv-primary-fg);
    text-decoration: underline;
    cursor: pointer;
}

.rlv-footer a:hover {
    opacity: 0.85;
}

/* ===== RESPONSIVE HEADER / SIDEBAR / BIRD ===== */

@media (max-width: 1024px) {
    .rlv-greet {
        max-width: 22vw;
    }
}

@media (max-width: 768px) {
    .rlv-greet {
        display: none;
    }

    .rlv-brand-sub {
        display: none;
    }

    .rlv-header-right .rz-button {
        min-width: 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
    }

    .role-label {
        max-width: clamp(64px, 22vw, 104px);
    }

    .rlv-sidebar {
        width: 86vw;
        max-width: 320px;
    }

}

@media (max-width: 360px) {
    .role-label {
        display: block;
        flex: 0 0 72px;
        width: 72px;
        min-width: 72px;
        max-width: 72px;
        padding-left: 0;
        font-size: 14px;
    }

    .rlv-brand-text {
        display: none;
    }

    .rlv-brand-click {
        padding-inline: 4px;
    }

    .rlv-header-stack,
    .rlv-header-left,
    .rlv-header-right {
        gap: 6px;
    }
}

/* ===== PUBLIC LAYOUT (общий стиль для PublicLayout) ===== */

.public-layout-root {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #e0f2fe 0, #bfdbfe 30%, #e9d5ff 70%, #f5f3ff 100%);
    background-size: 220% 220%;
    animation: rlvGradientShift 26s ease infinite;
}

@keyframes rlvGradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.public-header {
    background: transparent;
    box-shadow: none;
    border: none;
    padding-top: 16px;
    padding-bottom: 4px;
}

.public-header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
}

.public-logo {
    height: 32px;
    border-radius: 12px;
}

.public-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0f172a;
}

.public-brand-tagline {
    font-size: .85rem;
    color: #4b5563;
}

.public-body {
    padding: 0 0 24px;
}

.public-body-inner {
    max-width: 1040px;
    margin: 16px auto 32px;
    padding: 0 16px;
}

.public-card-glass {
    border-radius: 24px;
    padding: 20px 22px 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.public-footer {
    background: transparent;
    border: none;
    padding-bottom: 18px;
}

.public-footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
    font-size: .85rem;
    color: #4b5563;
}

@media (max-width: 640px) {
    .public-header-inner {
        justify-content: center;
    }
    .public-logo {
        height: 28px;
    }
    .public-brand-name {
        font-size: 0.95rem;
    }
    .public-brand-tagline {
        display: none;
    }
    .public-card-glass {
        border-radius: 18px;
        padding: 16px 14px 18px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    }
    .public-body-inner {
        margin: 12px auto 24px;
        padding: 0 12px;
    }
}
