/* ===== DESIGN TOKENS ===== */
:root {
  /* Backgrounds */
  --bg-base: #08080d;
  --bg-surface-1: #0e0e16;
  --bg-surface-2: #14142a;
  --bg-surface-3: #1c1c3a;
  --bg-overlay: rgba(10, 10, 18, 0.85);

  /* Borders */
  --border-subtle: rgba(255,255,255,0.05);
  --border-default: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.14);
  --border-accent: rgba(139, 92, 246, 0.35);

  /* Text */
  --text-primary: #e8eaf0;
  --text-secondary: #8890a4;
  --text-muted: #565c6e;
  --text-accent: #a78bfa;

  /* Accent */
  --accent-violet: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --accent-gradient-hover: linear-gradient(135deg, #a78bfa, #22d3ee);

  /* Status */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Cost colors */
  --cost-cheap: #22c55e;
  --cost-medium: #f59e0b;
  --cost-expensive: #ef4444;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(139,92,246,0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Layout */
  --sidebar-width: 300px;
  --header-height: 64px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ===== APP LAYOUT ===== */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* ===== HEADER ===== */
.header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.logo-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--sp-2) var(--sp-4) var(--sp-2) 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-surface-3);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-accent {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow);
}

/* ===== COLUMN MANAGER DROPDOWN ===== */
.dropdown-wrapper {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
  z-index: 100;
  display: none;
  backdrop-filter: blur(20px);
}

.dropdown-panel.open {
  display: block;
  animation: dropdown-in 0.2s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
  margin-top: var(--sp-2);
}

.dropdown-group-title:first-child {
  margin-top: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.dropdown-item input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.dropdown-item input[type="checkbox"]:checked {
  background: var(--accent-violet);
  border-color: var(--accent-violet);
}

.dropdown-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.column-presets {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-2);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-2);
}

.preset-btn {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--accent-violet);
  border-color: var(--accent-violet);
  color: #fff;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-surface-1);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform var(--transition-base);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.sidebar-header h2 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-violet);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
}

.sidebar-section {
  margin-bottom: var(--sp-4);
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-count {
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-violet);
  color: #fff;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ===== PROVIDER FILTER ===== */
.provider-search {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  margin-bottom: var(--sp-2);
  transition: border-color var(--transition-fast);
}

.provider-search:focus {
  border-color: var(--accent-violet);
}

.provider-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
}

.provider-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.provider-item input[type="checkbox"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-hover);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.provider-item input[type="checkbox"]:checked {
  background: var(--accent-violet);
  border-color: var(--accent-violet);
}

.provider-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  color: #fff;
  font-weight: 700;
}

.provider-item .provider-badge-sm {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ===== STATUS PILLS ===== */
.pill-group {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.pill {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.pill.active {
  background: var(--accent-violet);
  border-color: var(--accent-violet);
  color: #fff;
  font-weight: 600;
}

/* ===== CAPABILITY CHIPS ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.chip.active {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
}

/* ===== MODALITY CHECKBOXES ===== */
.modality-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.modality-check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.modality-check:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.modality-check.active {
  background: rgba(6,182,212,0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-1) 0;
}

.toggle-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  transition: all var(--transition-fast);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-fast);
}

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

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: #fff;
}

/* ===== RANGE SLIDERS ===== */
.range-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.range-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.range-row label {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 30px;
}

.range-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-surface-3);
  outline: none;
}

.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-violet);
  cursor: pointer;
  border: 2px solid var(--bg-surface-1);
  box-shadow: 0 0 6px rgba(139,92,246,0.4);
}

.range-value {
  font-size: 0.75rem;
  color: var(--text-accent);
  font-weight: 600;
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== CONTEXT SELECT ===== */
.select-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.context-select {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  padding-right: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.context-select:hover {
  border-color: var(--border-hover);
}

.context-select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.context-select option {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  padding: var(--sp-2);
}

.clear-filters-btn {
  width: 100%;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: var(--sp-2);
}

.clear-filters-btn:hover {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(239,68,68,0.08);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-6);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.results-count strong {
  color: var(--text-primary);
  font-weight: 700;
}

.results-count .accent {
  color: var(--text-accent);
}

/* ===== TABLE ===== */
.table-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
}

.models-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.models-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.models-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: color var(--transition-fast);
}

.models-table th:hover {
  color: var(--text-primary);
}

.models-table th.sorted {
  color: var(--accent-violet);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  font-size: 0.7rem;
}

.models-table th:hover .sort-indicator {
  opacity: 0.4;
}

.models-table th.sorted .sort-indicator {
  opacity: 1;
}

.models-table th.sorted.desc .sort-indicator {
  transform: rotate(180deg);
}

.models-table td {
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.models-table tbody tr {
  transition: background var(--transition-fast);
}

.models-table tbody tr:hover {
  background: rgba(139,92,246,0.04);
}

.models-table tbody tr:hover td {
  border-bottom-color: var(--border-default);
}

/* ===== TABLE CELL TYPES ===== */

/* Provider badge */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.provider-badge .badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.provider-badge .badge-name {
  font-weight: 500;
  color: var(--text-primary);
}

/* Model name */
.model-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.model-id-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Boolean badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge.yes {
  background: rgba(34,197,94,0.12);
  color: var(--color-success);
}

.badge.no {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.stable {
  background: rgba(34,197,94,0.12);
  color: var(--color-success);
}

.status-badge.beta {
  background: rgba(59,130,246,0.12);
  color: var(--color-info);
}

.status-badge.alpha {
  background: rgba(245,158,11,0.12);
  color: var(--color-warning);
}

.status-badge.deprecated {
  background: rgba(239,68,68,0.12);
  color: var(--color-error);
}

/* Modality tags */
.modality-tags {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.modality-tag {
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 500;
  background: rgba(6,182,212,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(6,182,212,0.15);
}

/* Cost cells */
.cost-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.cost-cell.cheap {
  color: var(--cost-cheap);
}

.cost-cell.medium {
  color: var(--cost-medium);
}

.cost-cell.expensive {
  color: var(--cost-expensive);
}

/* Number cells */
.number-cell {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Date cells */
.date-cell {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* ===== LOADING ===== */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity var(--transition-slow);
}

.loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--bg-surface-3);
  border-top-color: var(--accent-violet);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  margin-top: var(--sp-4);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== NO RESULTS ===== */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-6);
  color: var(--text-muted);
  gap: var(--sp-3);
}

.no-results svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.no-results p {
  font-size: 1rem;
}

.no-results .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== MOBILE ===== */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 25;
}

@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }

  .header {
    padding: 0 var(--sp-4);
  }

  .results-bar {
    padding: var(--sp-3) var(--sp-4);
  }

  .logo {
    display: none;
  }
}

@media (max-width: 600px) {
  .search-wrapper {
    max-width: none;
  }
  .header-actions .btn span {
    display: none;
  }
}

/* ===== UTILITIES ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ===== ANIMATIONS ===== */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.models-table tbody tr {
  animation: fade-in 0.3s ease;
}

/* Active filter indicator on sidebar header */
.active-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.active-filters-badge.hidden {
  display: none;
}

/* ===== LANGUAGE SELECTOR SEGMENTED CONTROL ===== */
.lang-selector {
  position: relative;
  display: flex;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  height: 32px;
  align-items: center;
  margin-left: var(--sp-2);
  flex-shrink: 0;
}

.lang-selector-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 3px);
  background: var(--accent-gradient);
  border-radius: calc(var(--radius-md) - 2px);
  transition: transform var(--transition-base), background var(--transition-base);
  z-index: 1;
}

.lang-selector[data-active-lang="ru"] .lang-selector-indicator {
  transform: translateX(100%);
}

.lang-btn {
  position: relative;
  width: 38px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color var(--transition-fast);
  user-select: none;
  outline: none;
}

.lang-btn.active {
  color: #fff;
}

.lang-btn:not(.active):hover {
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .lang-selector {
    margin-left: 0;
  }
}
