/* ============================================
   КУХНИ НА ПАНИНА — SaaS Components
   Premium UI: Stripe / Linear уровень
   ============================================ */

/* ========== ТОКЕНЫ ========== */
:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --layer-1: 0 1px 2px rgba(0,0,0,0.04);
    --layer-2: 0 4px 12px rgba(0,0,0,0.06);
    --layer-3: 0 10px 30px rgba(0,0,0,0.08);
}

.dark {
    --layer-1: 0 1px 2px rgba(0,0,0,0.3);
    --layer-2: 0 4px 12px rgba(0,0,0,0.4);
    --layer-3: 0 10px 30px rgba(0,0,0,0.5);
}

/* ========== КАРТОЧКИ ========== */
.card { background: var(--bg-surface); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--layer-2); transition: all 0.25s ease; }
.card:hover { box-shadow: var(--shadow-lg); }
.card-hover:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--layer-3); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.card-title i { width: 16px; height: 16px; opacity: 0.7; }
.card-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }

/* ========== KPI КАРТОЧКИ ========== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi-card { background: var(--bg-surface); border-radius: var(--radius-xl); padding: 20px 24px; box-shadow: var(--layer-2); transition: all var(--transition-normal); display: flex; justify-content: space-between; align-items: flex-start; position: relative; overflow: hidden; }
.kpi-card::after { 
    content: ""; 
    position: absolute; 
    inset: 0; 
    background: radial-gradient(circle at top right, rgba(59,130,246,0.08), transparent 60%); 
    opacity: 0; 
    transition: opacity 0.3s ease; 
    pointer-events: none;
}
.kpi-card:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--layer-3); }
.kpi-card:hover::after { opacity: 1; }
.dark .kpi-card::after { 
    background: radial-gradient(circle at top right, rgba(96,165,250,0.10), transparent 60%); 
    pointer-events: none;
}
.dark .kpi-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.kpi-card-body { width: 100%; }
.kpi-icon { font-size: 24px; opacity: 0.7; }
.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; opacity: 0.7; display: flex; align-items: center; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-top: 4px; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.kpi-value-sm { font-size: 24px; }
.kpi-trend { font-size: 12px; margin-top: 4px; }
.kpi-trend.up { color: var(--accent-green); }
.kpi-trend.down { color: var(--accent-red); }

/* ========== ИКОНКИ ========== */
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; }

/* ========== ТАБЛИЦЫ ========== */
.table-container { background: var(--bg-surface); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--layer-1); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead { background: var(--bg-surface-hover); border-bottom: 1px solid var(--border-color); }
.data-table th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.04); color: var(--text-primary); vertical-align: middle; }
.dark .data-table td { border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tbody tr { position: relative; transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: rgba(59,130,246,0.03); transform: scale(1.002); }
.dark .data-table tbody tr:hover { background: rgba(59,130,246,0.06); }
.data-table tbody tr:hover::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(59,130,246,0.15); pointer-events: none; }
.dark .data-table tbody tr:hover::after { box-shadow: inset 0 0 0 1px rgba(59,130,246,0.2); pointer-events: none; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .amount { font-weight: 700; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.data-table .empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* ========== КНОПКИ ========== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; cursor: pointer; transition: all var(--transition-fast); border: none; text-decoration: none; line-height: 1.4; }
.btn:hover { transform: translateY(-1px) scale(1.01); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 6px rgba(37,99,235,0.3); }
.btn-primary:hover { background: linear-gradient(180deg, #2563eb, #1d4ed8); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 12px rgba(37,99,235,0.35); }
.dark .btn-primary { box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 6px rgba(37,99,235,0.4); }
.btn-success { background: linear-gradient(180deg, #22c55e, #16a34a); color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 6px rgba(34,197,94,0.3); }
.btn-success:hover { background: linear-gradient(180deg, #16a34a, #15803d); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 12px rgba(34,197,94,0.35); }
.dark .btn-success { box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 6px rgba(34,197,94,0.4); }
.btn-danger { background: linear-gradient(180deg, #ef4444, #dc2626); color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 6px rgba(239,68,68,0.3); }
.btn-danger:hover { background: linear-gradient(180deg, #dc2626, #b91c1c); opacity: 1; }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-surface-hover); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); background: transparent; border: none; cursor: pointer; color: var(--text-secondary); transition: all var(--transition-fast); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.btn-icon-danger { color: var(--accent-red); }
.btn-icon-danger:hover { background: rgba(239, 68, 68, 0.08); }
.actions-cell { white-space: nowrap; }

/* ========== ФОРМЫ ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select { width: 100%; padding: 10px 14px; font-size: 14px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-primary); transition: all 0.15s ease; }
.form-input:hover, .form-select:hover { border-color: rgba(59, 130, 246, 0.3); }
.form-input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }
.dark .form-input:focus { box-shadow: 0 0 0 3px rgba(59,130,246,0.15), 0 2px 6px rgba(0,0,0,0.2); }
.form-select { cursor: pointer; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* ========== СЕКЦИИ ФОРМЫ ========== */
.card-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.card-section + .card-section { padding-top: 4px; }
.card-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

/* ========== ДИЗАЙНЕРЫ (формы) ========== */
.designer-row-existing { margin-bottom: 8px; padding: 10px; background: var(--bg-surface); border-radius: 10px; align-items: center; }

/* ========== ДИЗАЙНЕРЫ (главная) ========== */
.designer-row { display: grid; grid-template-columns: 1fr 2fr 120px 60px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.designer-row:last-child { border-bottom: none; }
.designer-name-col { font-weight: 500; color: var(--text-primary); }
.designer-amount-col { text-align: right; font-weight: 600; }
.designer-percent-col { text-align: right; color: var(--text-secondary); font-size: 13px; }
@media (max-width: 768px) { .designer-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; } .designer-name-col { grid-column: span 2; } }

/* ========== КОНТЕЙНЕР ДИЗАЙНЕРОВ ========== */
#designers-container { background: var(--bg-surface-hover); border: 1px solid var(--border-light); border-radius: 12px; padding: 12px; margin-bottom: var(--space-3); }
#designers-container .form-row { margin-bottom: 8px; padding: 10px; background: var(--bg-surface); border-radius: 10px; align-items: center; }
#designers-container .form-row:last-child { margin-bottom: 0; }

/* ========== ОШИБКИ ФОРМЫ ========== */
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-top: var(--space-2); }
.form-error-danger { background: #fef2f2; color: #dc2626; }
.dark .form-error-danger { background: #450a0a; color: #ef4444; }
.form-error-success { background: #dcfce7; color: #16a34a; }
.dark .form-error-success { background: #052e16; color: #22c55e; }

/* ========== ДЕЙСТВИЯ ФОРМЫ ========== */
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light); }

/* ========== ФИЛЬТРЫ ========== */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; padding: 16px; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--layer-1); }
.filter-bar select { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; background: var(--bg-surface); color: var(--text-primary); }
.filter-bar .btn { padding: 8px 16px; }

/* ========== БЕЙДЖИ ========== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-orange { background: #fefce8; color: #ca8a04; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.dark .badge-green { background: #052e16; color: #22c55e; }
.dark .badge-red { background: #450a0a; color: #ef4444; }
.dark .badge-orange { background: #451a03; color: #f59e0b; }
.dark .badge-blue { background: #1e3a5f; color: #3b82f6; }
.dark .badge-gray { background: #1F2937; color: #9CA3AF; }

/* ========== АЛЕРТЫ ========== */
.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-warning { background: #fefce8; color: #ca8a04; border: 1px solid #fef08a; }
.alert-info { background: #dbeafe; color: #2563eb; border: 1px solid #bfdbfe; }
.dark .alert-success { background: #052e16; color: #22c55e; border-color: #166534; }
.dark .alert-danger { background: #450a0a; color: #ef4444; border-color: #991b1b; }
.dark .alert-warning { background: #451a03; color: #f59e0b; border-color: #92400e; }
.dark .alert-info { background: #1e3a5f; color: #3b82f6; border-color: #1e40af; }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.5; }
.alert-close:hover { opacity: 1; }

/* ========== ПРОГРЕСС-БАР ========== */
.progress-bar { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; position: relative; overflow: hidden; }
.progress-fill::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); animation: shimmer 2s infinite; }
@keyframes shimmer { 100% { left: 100%; } }
.progress-fill.green { background: var(--accent-green); box-shadow: 0 0 10px rgba(34,197,94,0.4); }
.progress-fill.blue { background: var(--accent-blue); box-shadow: 0 0 10px rgba(59,130,246,0.4); }
.progress-fill.orange { background: var(--accent-orange); }
.progress-fill.red { background: var(--accent-red); }
.progress-wrapper { margin-top: var(--space-3); }
.progress-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: var(--space-1); }

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal-content { background: var(--bg-floating); border-radius: var(--radius-xl); padding: 24px; max-width: 480px; width: 90%; box-shadow: var(--layer-3); transform: scale(0.95); opacity: 0; transition: all 0.2s ease; }
.modal-overlay.open .modal-content { transform: scale(1); opacity: 1; }
.modal-header { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.modal-body { margin-bottom: 20px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; }

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 16px; margin-bottom: 8px; }
.empty-state-subtext { font-size: 14px; }

/* ========== СТАТИСТИКА В КАРТОЧКЕ ========== */
.stat-row { display: flex; gap: var(--space-6); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-light); }
.stat-item { text-align: center; flex: 1; }
.stat-value { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.designer-medal { font-size: 18px; }

/* ========== КАРТОЧКА-АКЦЕНТ ========== */
.card-accent { background: linear-gradient(135deg, #1e3c72, #2a5298); color: white; border: none; }
.card-accent-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.card-accent-label { font-size: 13px; opacity: 0.8; }
.card-accent-value { font-size: 36px; font-weight: 700; margin-top: var(--space-1); }
.card-accent-sub { font-size: 14px; opacity: 0.8; margin-top: var(--space-1); }
.card-accent-percent { font-size: 32px; font-weight: 700; }
.card-accent-right { text-align: right; }

/* ========== ПАНЕЛЬ ДЕЙСТВИЙ ========== */
.action-bar { display: flex; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }

/* ========== ТИПОГРАФИКА ========== */
.text-primary { color: var(--text-primary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-medium { font-weight: 500; }

/* ========== TYPE CARD ========== */
.type-grid { display: flex; gap: var(--space-3); }
.type-card { flex: 1; text-align: center; padding: var(--space-4); border: 2px solid var(--border-color); border-radius: var(--radius-lg); cursor: pointer; transition: all 0.15s ease; background: var(--bg-surface); }
.type-card:hover { transform: translateY(-2px); border-color: var(--accent-blue); }
.type-card.active { border-color: var(--accent-blue); background: rgba(59, 130, 246, 0.06); }
.type-icon { font-size: 32px; margin-bottom: var(--space-2); }
.type-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.type-sub { font-size: 11px; color: var(--text-muted); margin-top: var(--space-1); }

/* ========== INFO BOX ========== */
.info-box { background: var(--bg-surface-hover); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-3); }
.info-box:last-child { margin-bottom: 0; }
.info-title { font-weight: 600; font-size: 13px; margin-bottom: var(--space-2); color: var(--text-primary); }
.info-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.info-list code { background: var(--bg-surface); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.info-note { font-size: 12px; color: var(--text-muted); margin-top: var(--space-2); }
.info-note code { background: var(--bg-surface); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ========== UPLOAD ZONE ========== */
.upload-zone { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); padding: var(--space-8); text-align: center; cursor: pointer; transition: all 0.15s ease; background: var(--bg-surface-hover); }
.upload-zone:hover { border-color: var(--accent-blue); background: rgba(59, 130, 246, 0.04); }
.upload-icon { font-size: 40px; margin-bottom: var(--space-2); }
.upload-text { font-size: 14px; color: var(--text-secondary); }
.upload-text strong { color: var(--text-primary); }
.upload-sub { font-size: 12px; color: var(--text-muted); margin-top: var(--space-1); }

/* ========== FILE SELECTED ========== */
.file-selected { display: none; margin-top: var(--space-3); padding: 10px 14px; background: var(--bg-surface-hover); border-radius: var(--radius-sm); font-size: 13px; justify-content: space-between; align-items: center; }
.file-selected.show { display: flex; }
.file-name { font-weight: 500; color: var(--text-primary); }

/* ========== SIDEBAR ========== */
.app-sidebar { border-right: 1px solid rgba(226, 232, 240, 0.6); box-shadow: none; }
.dark .app-sidebar { border-right-color: rgba(255, 255, 255, 0.06); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px; }
.sidebar-logo-img { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar-logo-text { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sidebar-logo-sub { font-size: 10px; color: var(--text-muted); }
.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sidebar-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 20px 8px 6px; opacity: 0.7; }
.sidebar-section-label:first-child { padding-top: 4px; }

.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 400; color: var(--text-secondary); text-decoration: none; transition: all 0.15s ease; margin-bottom: 2px; position: relative; }
.nav-link-inner { display: flex; align-items: center; gap: 10px; width: 100%; }
.nav-link i { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.65; transition: all 0.15s ease; }
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: rgba(59, 130, 246, 0.06); color: var(--text-primary); }
.nav-link:hover i { opacity: 1; }
.nav-link.active { background: rgba(59, 130, 246, 0.10); color: var(--accent-blue); font-weight: 500; box-shadow: inset 3px 0 0 var(--accent-blue); }
.nav-link.active i { opacity: 1; color: var(--accent-blue); }
.dark .nav-link:hover { background: rgba(59, 130, 246, 0.08); }
.dark .nav-link.active { background: rgba(59, 130, 246, 0.14); }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(226, 232, 240, 0.4); display: flex; flex-direction: column; gap: 4px; }
.dark .sidebar-footer { border-top-color: rgba(255, 255, 255, 0.06); }
.theme-toggle { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: none; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; transition: all 0.15s ease; width: 100%; }
.theme-toggle:hover { background: rgba(59, 130, 246, 0.06); color: var(--text-secondary); }
.theme-toggle i { width: 16px; height: 16px; opacity: 0.7; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; margin: 4px 0; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3B82F6, #2563eb); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }
.sidebar-logout { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text-muted); font-size: 13px; text-decoration: none; transition: all 0.15s ease; }
.sidebar-logout:hover { background: rgba(239, 68, 68, 0.06); color: var(--accent-red); }
.sidebar-logout i { width: 16px; height: 16px; opacity: 0.6; }

/* ========== МОБИЛЬНЫЙ SIDEBAR ========== */
@media (max-width: 1024px) {
    .app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: none; }
    .app-sidebar.open { transform: translateX(0); box-shadow: 0 0 0 1px var(--border-color), 10px 0 40px rgba(0,0,0,0.15); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 199; backdrop-filter: blur(2px); }
    .sidebar-overlay.open { display: block; }
    .mobile-only { display: flex; }
}
@media (min-width: 1025px) {
    .mobile-only { display: none; }
    .sidebar-overlay { display: none !important; }
}

/* ========== ТОПБАР: ПРАВАЯ ЧАСТЬ ========== */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ (топбар) ========== */
.theme-toggle-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.theme-toggle-topbar:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.theme-toggle-topbar i {
    width: 16px;
    height: 16px;
}

/* ========== ПОЛЬЗОВАТЕЛЬ (топбар) ========== */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.topbar-user:hover {
    background: var(--bg-surface-hover);
}

.topbar-user-info {
    text-align: left;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-user-role {
    font-size: 10px;
    color: var(--text-muted);
}

.topbar-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.topbar-user.open .topbar-chevron {
    transform: rotate(180deg);
}

/* ========== ВЫПАДАЮЩЕЕ МЕНЮ ========== */
.user-dropdown {
    display: none;
    position: absolute;
    top: 56px;
    right: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--layer-3);
    min-width: 180px;
    z-index: 150;
    padding: 4px;
}

.user-dropdown.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.1s ease;
}

.dropdown-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.dropdown-danger:hover {
    background: rgba(239, 68, 68, 0.06);
    color: var(--accent-red);
}

/* ========== СЕКЦИИ САЙДБАРА (раскрывающиеся) ========== */
.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 8px 6px;
    cursor: pointer;
    user-select: none;
}

.sidebar-section-header:first-child {
    padding-top: 4px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    opacity: 0.7;
}

.sidebar-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.4;
}

.sidebar-section-header.collapsed .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-section-items {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.sidebar-section-items.collapsed {
    max-height: 0;
    opacity: 0;
}

.section-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    opacity: 0.7;
}

.fade-in {
    animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== TOGGLE SWITCH ========== */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    width: 44px;
    height: 24px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.dark .toggle-slider {
    background: #475569;
}

.dark .toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.btn-icon i, .btn-icon svg, .btn-icon lucide-icon {
    pointer-events: none;
}