﻿#app {
    min-height: 100vh;
    background: var(--bg);
}

#sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 1000;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: 18px 0 40px rgba(2,0,53,0.12);
}

.sidebar-wrapper {
    min-height: 100vh;
    background: var(--sidebar-bg);
}

#main {
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: transparent;
    transition: margin-left var(--dur-slow) var(--ease);
}

.topbar {
    padding: 24px 30px 18px 30px;
}

.topbar-shell {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 28px;
    padding: 18px 22px;
    box-shadow: 0 16px 36px rgba(2,0,53,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 460px;
    min-width: 280px;
}

.topbar-header-icon {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg,#20409a 0%,#020035 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(32,64,154,0.25);
}

.topbar-title-group {
    min-width: 0;
}

.topbar-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7b8095;
    margin-bottom: 4px;
}

.page-title {
    margin: 0;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    color: var(--primary);
    letter-spacing: -1.5px;
}

.topbar-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex: 0 1 auto;
    min-width: 320px;
}

.topbar-right-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: flex-end;
}

.topbar-right-row-top {
    flex-wrap: nowrap;
}

.topbar-right-row-bottom {
    flex-wrap: nowrap;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f2f3f4;
    border: 1px solid #e5e8ef;
    padding: 12px 16px;
    border-radius: 18px;
    min-width: 360px;
    max-width: 420px;
    width: 100%;
}

.topbar-search-icon {
    color: #7c8297;
    display: inline-flex;
    align-items: center;
}

.topbar-search-text {
    font-size: 14px;
    color: #8a90a4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.topbar-button-secondary {
    background: #ffffff;
    border: 1px solid #e5e8ef;
    color: var(--primary);
}

.topbar-button-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(237,28,36,0.18);
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e6e9ef;
    padding: 8px 10px 8px 8px;
    border-radius: 18px;
}

.topbar-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg,#97b4de 0%,#20409a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.topbar-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.topbar-profile-role {
    font-size: 12px;
    color: #7b8095;
    margin-top: 2px;
}

.page-content {
    flex: 1 1 auto;
    padding: 0 30px 30px 30px;
}

.burger-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#20409a 0%,#020035 100%);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(32,64,154,0.22);
}

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #main {
        margin-left: 0;
    }

    .sidebar-open #sidebar {
        transform: translateX(0);
    }

    .burger-btn {
        display: inline-flex;
    }

    .topbar-search {
        min-width: 240px;
    }
}

@media (max-width: 767.98px) {
    .topbar {
        padding: 18px;
    }

    .topbar-shell {
        padding: 16px;
    }

    .page-title {
        font-size: 28px;
    }

    .page-content {
        padding: 0 18px 18px 18px;
    }

    .topbar-search {
        width: 100%;
        min-width: 0;
    }

    .topbar-right {
        width: 100%;
        min-width: 0;
        align-items: stretch;
    }

    .topbar-right-row {
        width: 100%;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .topbar-right-row-top,
    .topbar-right-row-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-button,
    .topbar-profile {
        width: 100%;
    }

    .topbar-search {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}
