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

: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-контейнер */
.rlv-app-bg {
    min-height: calc(100vh - var(--rlv-header-h));
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ===== 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: 4px 6px;
    transition: background var(--rlv-fast);
}

.rlv-brand-click:hover,
.rlv-brand-click:focus-visible {
    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;
}

/* ===== 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 ===== */

.body-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
}

.main-content {
    flex: 1 1 auto;
    padding: 20px;
}

/* сам футер — прижат к низу,
   скруглённый и без белой линии */
.rlv-footer {
    padding: 10px 16px;
    background: var(--rlv-surface-2);
    border-top: none;
    color: var(--rlv-text-soft);
    font-size: .9rem;
    margin-top: auto;

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

    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .12);

    position: relative; /* чтобы птичка могла к нему прижаться */
}

/* ПТИЧКА — привязана к футеру (только в светлой теме) */
.rlv-footer::after {
    content: "";
    position: absolute;
    right: 18px;
    top: -210px; /* над футером, визуально примерно как раньше */

    width: 380px;
    height: 226px;
    background-image: url("/images/association/bird.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    opacity: 0.9;
    mix-blend-mode: multiply;

    pointer-events: none;
    z-index: 0;
}

/* В тёмной теме птичку убираем */
:root[data-theme="dark"] .rlv-footer::after {
    display: none;
}

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

.rlv-footer a {
    color: var(--rlv-primary);
    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-sidebar {
        width: 86vw;
        max-width: 320px;
    }

    /* птичка на мобилках: прижата к футеру в правом нижнем углу, чуть поменьше */
    .rlv-footer::after {
        right: 18px;
        top: -160px;
        width: 260px;
        height: 155px;
    }
}
