.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 24px;
    height: 100vh;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: var(--white);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
}

.sidebar-brand img {
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
}

.sidebar-brand span,
.sidebar-brand strong {
    display: block;
}

.sidebar-brand span {
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-brand strong {
    font-size: 1.45rem;
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0 14px;
    color: var(--text);
    background: transparent;
    font-weight: 750;
    text-align: left;
}

.nav-link:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.nav-link.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    box-shadow: 0 10px 22px rgba(18, 60, 105, 0.18);
}

.sidebar-mobile-footer {
    display: none;
}

[data-admin-only].hidden {
    display: none !important;
}

.sidebar-backdrop {
    display: none;
}

.app-main {
    display: grid;
    grid-template-rows: var(--topbar-height) minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.topbar-title {
    min-width: 0;
}

.topbar-title p {
    margin: 0 0 2px;
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.topbar-title h1 {
    margin: 0;
    overflow: hidden;
    font-size: 1.35rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions,
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions {
    justify-content: flex-end;
}

.topbar-actions:empty {
    display: none;
}

.user-menu {
    justify-self: end;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: linear-gradient(145deg, var(--brand-dark), var(--brand));
    font-weight: 850;
}

.user-copy strong,
.user-copy span {
    display: block;
}

.user-copy span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.content-area {
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: auto;
    padding: 28px;
}

.page {
    display: grid;
    gap: 18px;
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
}

.stack {
    display: grid;
    gap: 14px;
}
