/* ============================================================
   RoomInPMS — Unified design system
   Чёрная тема, sidebar nav, chips, tooltips, smooth animations
   ============================================================ */

:root {
    /* Палитра */
    --bg-0:           #050505;          /* основной фон */
    --bg-1:           #0a0a0a;          /* поверхность */
    --bg-2:           #111111;          /* приподнятая поверхность */
    --bg-3:           #181818;          /* hover */
    --line:           rgba(255,255,255,0.06);
    --line-strong:    rgba(255,255,255,0.12);

    --text-0:         rgba(255,255,255,0.95);
    --text-1:         rgba(255,255,255,0.7);
    --text-2:         rgba(255,255,255,0.45);
    --text-3:         rgba(255,255,255,0.28);

    --gold:           #c9a24e;
    --gold-soft:      rgba(201,162,78,0.7);
    --gold-bg:        rgba(201,162,78,0.10);

    --accent:         #e2b35a;
    --success:        #10b981;
    --warn:           #f59e0b;
    --danger:         #ef4444;
    --info:           #60a5fa;

    /* Радиусы */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-pill: 999px;

    /* Тени */
    --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-2: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-3: 0 16px 48px rgba(0,0,0,0.55);

    /* Сетка */
    --sidebar-w: 260px;
    --sidebar-w-mini: 72px;
    --topbar-h: 56px;

    /* Тайминги анимаций */
    --t-fast: 0.15s;
    --t-base: 0.25s;
    --t-slow: 0.4s;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── App shell ─────────────────────────────────────────── */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    background: var(--bg-0);
    color: var(--text-0);
}

.app-shell[data-collapsed="true"] {
    grid-template-columns: var(--sidebar-w-mini) 1fr;
}

/* ─── Sidebar ───────────────────────────────────────────── */

.app-sidebar {
    grid-column: 1;
    grid-row: 1 / -1;
    border-right: 1px solid var(--line);
    background: var(--bg-1);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 50;
    transition: width var(--t-base) var(--ease);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 0 20px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.sidebar-brand-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: opacity var(--t-fast) var(--ease);
}

.sidebar-brand-badge {
    flex-shrink: 0;
}

/* Кнопка collapse в шапке sidebar (рядом с лого) */
.sidebar-toggle-brand {
    margin-left: 4px;
}

.app-shell[data-collapsed="true"] .sidebar-brand-text,
.app-shell[data-collapsed="true"] .sidebar-section-label,
.app-shell[data-collapsed="true"] .sidebar-link-text,
.app-shell[data-collapsed="true"] .sidebar-link-badge,
.app-shell[data-collapsed="true"] .sidebar-user-info,
.app-shell[data-collapsed="true"] .sidebar-brand-badge {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.app-shell[data-collapsed="true"] .sidebar-brand {
    padding: 0 8px;
    gap: 4px;
    justify-content: space-between;
}

.app-shell[data-collapsed="true"] .sidebar-toggle-brand {
    margin-left: 0;
}

.app-shell[data-collapsed="true"] .sidebar-user-avatar {
    margin: 0 auto;
}

.app-shell[data-collapsed="true"] .sidebar-footer {
    padding: 10px 8px;
    justify-content: center;
}

.app-shell[data-collapsed="true"] .sidebar-link {
    justify-content: center;
    padding: 9px;
}

.app-shell[data-collapsed="true"] .sidebar-link-icon {
    margin: 0;
}

.app-shell[data-collapsed="true"] .sidebar-section-label {
    height: 0;
    padding: 0;
}

/* Стрелка collapse-btn поворачивается, когда sidebar свёрнут */
.sidebar-toggle svg {
    transition: transform var(--t-base) var(--ease);
}

.app-shell[data-collapsed="true"] .sidebar-toggle-brand svg {
    transform: rotate(180deg);
}

/* Гарантия: collapse-btn всегда видна и кликабельна */
.sidebar-toggle {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-section-label {
    display: block;
    padding: 8px 14px 6px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    font-weight: 600;
    transition: opacity var(--t-fast) var(--ease);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: var(--r-md);
    color: var(--text-1);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    position: relative;
}

.sidebar-link:hover {
    background: var(--bg-3);
    color: var(--text-0);
}

.sidebar-link.active {
    background: var(--bg-3);
    color: var(--accent);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
}

.sidebar-link-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.7;
}

.sidebar-link-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--t-fast) var(--ease);
}

.sidebar-link-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    background: var(--gold-bg);
    color: var(--gold-soft);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar-link-badge.danger {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    background: var(--bg-1);
    /* footer "упирается" в nav, не сдвигает его — за счёт flex-shrink:0
       и того, что .sidebar-nav имеет flex:1 + min-height:0 */
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-3);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.78rem;
    color: var(--text-0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 0.65rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text-2);
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast) var(--ease);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: var(--text-0);
    border-color: var(--gold-soft);
}

/* ─── Main column ───────────────────────────────────────── */

.app-main {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-2);
    flex: 1;
    min-width: 0;
}

.topbar-breadcrumb a {
    color: var(--text-1);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

.topbar-breadcrumb a:hover {
    color: var(--text-0);
}

.topbar-breadcrumb .bc-sep {
    color: var(--text-3);
    font-size: 0.7rem;
}

.topbar-breadcrumb .bc-current {
    color: var(--accent);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-content {
    padding: 28px 28px 64px;
    flex: 1;
    min-width: 0;
    animation: fade-up var(--t-slow) var(--ease) both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page header ───────────────────────────────────────── */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--text-0);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.5;
    max-width: 60ch;
}

/* ─── Chip tabs ─────────────────────────────────────────── */

.chip-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    width: max-content;
    max-width: 100%;
}

.chip-tabs::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    color: var(--text-2);
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--t-fast) var(--ease);
}

.chip:hover {
    color: var(--text-0);
    background: var(--bg-3);
}

.chip.active {
    background: var(--gold-bg);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--gold-soft);
}

.chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.chip-count {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    background: rgba(255,255,255,0.08);
    color: var(--text-1);
    font-weight: 700;
}

.chip.active .chip-count {
    background: rgba(201,162,78,0.2);
    color: var(--accent);
}

/* ─── Filter chips (выбор без active "только один") ───── */

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text-1);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    font-family: inherit;
}

.filter-chip:hover {
    background: var(--bg-3);
    color: var(--text-0);
}

.filter-chip.active {
    background: var(--gold-bg);
    border-color: var(--gold-soft);
    color: var(--accent);
}

/* ─── Metric cards (KPI) ────────────────────────────────── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px 18px 16px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.kpi-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.kpi-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.kpi-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kpi-card-value {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-0);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    transition: opacity var(--t-base) var(--ease);
}

.kpi-card-value.loading {
    color: var(--text-3);
}

.kpi-card-value.value-flash {
    animation: value-flash 0.6s var(--ease);
}

@keyframes value-flash {
    0% { color: var(--accent); }
    100% { color: var(--text-0); }
}

.kpi-card-delta {
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-card-delta.up    { color: var(--success); }
.kpi-card-delta.down  { color: var(--danger); }
.kpi-card-delta.flat  { color: var(--text-3); }

.kpi-card-spark {
    position: absolute;
    right: 14px;
    bottom: 12px;
    width: 80px;
    height: 24px;
    opacity: 0.55;
}

/* ─── Info icon (tooltip trigger) ───────────────────────── */

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    color: var(--text-3);
    cursor: help;
    background: transparent;
    border: none;
    padding: 0;
    transition: color var(--t-fast) var(--ease);
    flex-shrink: 0;
}

.info-icon:hover, .info-icon:focus {
    color: var(--accent);
    outline: none;
}

.info-icon svg {
    width: 13px;
    height: 13px;
}

/* ─── Tooltip popover ───────────────────────────────────── */

.tt-pop {
    position: fixed;
    z-index: 9999;
    max-width: 320px;
    background: #1a1a1a;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    padding: 12px 14px;
    color: var(--text-0);
    font-size: 0.78rem;
    line-height: 1.5;
    box-shadow: var(--shadow-3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.tt-pop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tt-pop-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.tt-pop-desc {
    color: var(--text-1);
    margin-bottom: 8px;
}

.tt-pop-formula {
    display: block;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 6px 8px;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 0.73rem;
    color: var(--gold-soft);
    margin-top: 4px;
    word-break: break-word;
}

.tt-pop-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #1a1a1a;
    border: 1px solid var(--line-strong);
    transform: rotate(45deg);
    border-right: none;
    border-bottom: none;
}

/* ─── Live indicator (polling state) ────────────────────── */

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: var(--bg-2);
    border: 1px solid var(--line);
    font-size: 0.7rem;
    color: var(--text-2);
    font-weight: 500;
}

.live-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
    transition: background var(--t-fast) var(--ease);
}

.live-indicator[data-state="live"] .live-indicator-dot {
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
    animation: pulse-live 1.6s ease-out infinite;
}

.live-indicator[data-state="loading"] .live-indicator-dot {
    background: var(--info);
    animation: pulse-fast 1s ease-in-out infinite;
}

.live-indicator[data-state="error"] .live-indicator-dot {
    background: var(--danger);
}

@keyframes pulse-live {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

@keyframes pulse-fast {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Buttons ───────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-strong);
    background: var(--bg-2);
    color: var(--text-0);
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-3);
    border-color: var(--gold-soft);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-1);
}

.btn-ghost:hover {
    background: var(--bg-2);
    color: var(--text-0);
}

.btn-accent {
    background: var(--accent);
    color: #1a1108;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-accent:hover {
    background: #f0c46d;
    border-color: #f0c46d;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: var(--r-sm);
}

/* ─── Section / Card ────────────────────────────────────── */

.section {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    margin-bottom: 18px;
    animation: fade-up var(--t-slow) var(--ease) both;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text-0);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-icon {
    color: var(--accent);
    width: 16px;
    height: 16px;
}

/* ─── Export menu ───────────────────────────────────────── */

.export-menu-wrap {
    position: relative;
}

.export-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #1a1a1a;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    padding: 6px;
    box-shadow: var(--shadow-3);
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: all var(--t-fast) var(--ease);
}

.export-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--text-1);
    font-size: 0.8rem;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.export-menu-item:hover {
    background: var(--bg-3);
    color: var(--text-0);
}

.export-menu-item-icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.export-menu-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 0;
}

/* ─── Skeleton loader ───────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
    background-size: 200% 100%;
    animation: skeleton-shine 1.4s ease-in-out infinite;
    border-radius: var(--r-sm);
}

@keyframes skeleton-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Toast notifications ───────────────────────────────── */

.toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    max-width: calc(100vw - 40px);
}

.toast {
    background: #1a1a1a;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--info);
    border-radius: var(--r-md);
    padding: 12px 16px;
    color: var(--text-0);
    font-size: 0.85rem;
    box-shadow: var(--shadow-3);
    min-width: 240px;
    max-width: 380px;
    animation: toast-in 0.3s var(--ease);
}

.toast.success { border-left-color: var(--success); }
.toast.warn    { border-left-color: var(--warn); }
.toast.error   { border-left-color: var(--danger); }

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-desc {
    font-size: 0.78rem;
    color: var(--text-1);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }

/* ─── Mobile sidebar drawer ─────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
    opacity: 0;
    transition: opacity var(--t-fast) var(--ease);
}

.sidebar-overlay.visible {
    opacity: 1;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr !important;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform var(--t-base) var(--ease);
    }

    .app-shell[data-mobile-open="true"] .app-sidebar {
        transform: translateX(0);
    }

    .app-shell[data-mobile-open="true"] .sidebar-overlay {
        display: block;
    }

    .app-shell[data-collapsed="true"] .app-sidebar {
        width: var(--sidebar-w);
    }

    .app-shell[data-collapsed="true"] .sidebar-brand-text,
    .app-shell[data-collapsed="true"] .sidebar-link-text,
    .app-shell[data-collapsed="true"] .sidebar-section-label {
        opacity: 1;
        width: auto;
    }

    .app-content {
        padding: 16px 16px 64px;
    }

    .topbar-mobile-toggle {
        display: inline-flex !important;
    }
}

.topbar-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text-1);
    cursor: pointer;
    flex-shrink: 0;
}

/* ─── Empty / error states ──────────────────────────────── */

.empty-block {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-2);
    font-size: 0.9rem;
}

.empty-block-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.4;
    color: var(--accent);
}

/* ─── Reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
