
.app {
    min-height: 100vh;
    background: var(--bg);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-header-left,
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--text);
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
}

.app-brand-accent {
    color: var(--accent);
}

.app-menu-toggle {
    flex-shrink: 0;
    font-size: 19px;
}

.header-premium {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg);
    font-size: 13px;
}

.header-premium-icon {
    font-size: 16px;
}

.header-player {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.header-player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.header-player-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.header-player-info strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.header-player-info small {
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
}

.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--header-height));
    transition: grid-template-columns 0.2s ease;
}

.app-main {
    width: 100%;
    max-width: var(--content-max-width);
    min-width: 0;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    margin: 0 0 6px;
    font-size: var(--font-size-2xl);
}

.page-description {
    margin: 0;
    color: var(--text-secondary);
}

/* Свёрнутое меню */

.app.sidebar-collapsed .app-layout {
    grid-template-columns: 68px minmax(0, 1fr);
}

.app.sidebar-collapsed .app-sidebar {
    padding-left: 8px;
    padding-right: 8px;
}

.app.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 6px;
    padding-right: 6px;
}

.app.sidebar-collapsed .sidebar-link-title {
    display: none;
}

@media (max-width: 850px) {
    .app-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .app-main {
        padding: 22px 18px;
    }
}

@media (max-width: 600px) {
    .app-header {
        height: 58px;
        padding: 0 12px;
        gap: 8px;
    }

    .app-header-left,
    .app-header-actions {
        gap: 8px;
    }

    .app-brand {
        font-size: 16px;
    }

    .header-player-info {
        display: none;
    }

    .header-player-avatar {
        width: 32px;
        height: 32px;
    }

    .header-premium {
        padding: 7px;
        gap: 4px;
    }

    .header-logout {
        display: none;
    }

    .app-layout,
    .app.sidebar-collapsed .app-layout {
        display: block;
    }

    .app-main {
        padding: 18px 13px 35px;
    }
}
/* Правая боковая навигация */
@media (min-width: 851px) {
    .app-layout {
        grid-template-columns: minmax(0, 1fr) var(--sidebar-width, 240px);
    }

    .app-sidebar {
        grid-column: 2;
        grid-row: 1;
        border-right: none;
        border-left: 1px solid var(--border);
    }

    .app-main {
        grid-column: 1;
        grid-row: 1;
    }

    .app.sidebar-collapsed .app-layout {
        grid-template-columns: minmax(0, 1fr) 68px;
    }
}
