/* ═══════════════════════════════════════════
   Tesla Video Player — Modern Dark UI
   Glassmorphism + Gradient Accents
   Tesla touchscreen optimized
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #06060b;
  --bg-secondary: #0d0d14;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-solid: #14141e;
  --bg-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --text-primary: #eeeef3;
  --text-secondary: #6b6b82;
  --text-tertiary: #44445a;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.25);
  --accent-subtle: rgba(139, 92, 246, 0.08);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #6366f1);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --highlight-bg: rgba(139, 92, 246, 0.2);
  --highlight-text: #c4b5fd;
  --error: #f43f5e;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(139, 92, 246, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99, 102, 241, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

/* ─── Layout ────────────────────────────── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Header ────────────────────────────── */
.app-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 8px 0;
}

.app-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ─── Search Box ────────────────────────── */
.search-box {
  position: relative;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input-wrapper:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  width: 100%;
  padding: 16px 50px 16px 52px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 400;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.search-input:focus {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08), var(--shadow-md);
  background: rgba(255, 255, 255, 0.06);
}

.search-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.search-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 50%;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.search-clear:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ─── Search Dropdown ───────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface-solid);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  animation: dropdownIn 0.2s var(--transition-fast);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--bg-hover);
}

.search-result-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  border-radius: 0 2px 2px 0;
}

.result-thumb {
  width: 110px;
  height: 62px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.search-result-item:hover .result-thumb {
  opacity: 0.9;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  color: var(--text-primary);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.result-meta > span:not(:last-child)::after {
  content: '\00b7';
  margin-left: 6px;
  color: var(--text-tertiary);
}

.result-channel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.result-duration {
  white-space: nowrap;
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.result-views {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ─── Search Highlight ──────────────────── */
.search-result-item mark {
  background: var(--highlight-bg);
  color: var(--highlight-text);
  border-radius: 3px;
  padding: 1px 3px;
}

.search-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─── Video Player Section ──────────────── */
.player-section {
  margin-top: 32px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: playerIn 0.4s var(--transition-base);
}

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

.player-wrapper {
  position: relative;
  background: #000;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #000;
}

.player-canvas-wrapper video,
.player-canvas-wrapper ogvjs,
.player-canvas-wrapper canvas {
  width: 100% !important;
  max-height: 70vh;
  display: block;
}

/* ─── Fullscreen Mode ──────────────────── */
.player-section:fullscreen,
.player-section:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  background: #000;
  border: none;
  border-radius: 0;
}

.player-section:fullscreen .player-wrapper,
.player-section:-webkit-full-screen .player-wrapper {
  flex: 1;
  min-height: 0;
}

.player-section:fullscreen .player-canvas-wrapper,
.player-section:-webkit-full-screen .player-canvas-wrapper {
  width: 100%;
  height: 100%;
  align-items: center;
}

.player-section:fullscreen .player-canvas-wrapper video,
.player-section:fullscreen .player-canvas-wrapper ogvjs,
.player-section:fullscreen .player-canvas-wrapper canvas,
.player-section:-webkit-full-screen .player-canvas-wrapper video,
.player-section:-webkit-full-screen .player-canvas-wrapper ogvjs,
.player-section:-webkit-full-screen .player-canvas-wrapper canvas {
  max-height: 100% !important;
  height: 100%;
  object-fit: contain;
}

.player-section:fullscreen .player-controls,
.player-section:-webkit-full-screen .player-controls {
  padding: 8px 16px;
  background: rgba(13, 13, 20, 0.92);
  backdrop-filter: blur(16px);
  border-top: none;
  flex-shrink: 0;
}

.player-section:fullscreen .player-info,
.player-section:-webkit-full-screen .player-info {
  padding: 6px 20px 8px;
  background: rgba(13, 13, 20, 0.92);
  flex-shrink: 0;
}

.player-section:fullscreen .player-title,
.player-section:-webkit-full-screen .player-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-section:fullscreen .player-channel,
.player-section:-webkit-full-screen .player-channel {
  font-size: 12px;
  margin-top: 2px;
}

/* ─── Player Loading ────────────────────── */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.player-loading span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--error);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.player-error span {
  font-size: 14px;
  font-weight: 500;
}

.btn-retry {
  padding: 10px 28px;
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-retry:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-retry:active {
  transform: translateY(0);
}

/* ─── Player Controls ───────────────────── */
.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface-solid);
  border-top: 1px solid var(--border);
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  min-width: 40px;
  min-height: 40px;
}

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

.ctrl-btn:active {
  transform: scale(0.92);
}

.iptv-ctrl-fav.fav-active { color: #f43f5e; }
.iptv-ctrl-fav:hover { color: #f43f5e; }

.ctrl-time {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.ctrl-progress-wrapper {
  flex: 1;
  padding: 0 4px;
}

.ctrl-progress {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: height var(--transition-fast);
}

.ctrl-progress:hover {
  height: 6px;
}

.ctrl-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
  transition: transform var(--transition-fast);
}

.ctrl-progress:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

.ctrl-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.ctrl-quality {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

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

.ctrl-quality option {
  background: var(--bg-surface-solid);
  color: var(--text-primary);
}

/* ─── Player Info ───────────────────────── */
.player-info {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
}

.player-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.player-channel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ─── Scrollbar ─────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Selection ─────────────────────────── */
::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* ─── Responsive ────────────────────────── */
@media (max-width: 600px) {
  .app-container {
    padding: 20px 14px;
  }

  .app-header {
    margin-bottom: 28px;
  }

  .app-logo {
    font-size: 20px;
  }

  .search-input {
    font-size: 16px;
    padding: 14px 46px;
  }

  .result-thumb {
    width: 90px;
    height: 51px;
  }

  .result-meta > span:not(:last-child)::after {
    display: none;
  }

  .result-meta {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .player-controls {
    gap: 6px;
    padding: 8px 12px;
  }

  .ctrl-time {
    font-size: 11px;
    min-width: 75px;
  }

  .player-title {
    font-size: 15px;
  }

  .app-tab {
    padding: 10px 16px;
    font-size: 13px;
  }

  .iptv-m3u-input-wrapper {
    flex-direction: column;
  }

  .iptv-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .iptv-dropdown-trigger {
    max-width: 100%;
  }

  .iptv-channel-list {
    max-height: 300px;
  }

  .iptv-channel-logo-wrapper {
    width: 32px;
    height: 32px;
  }
}

/* ─── Navigation Tabs ──────────────────── */
.app-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}

.app-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.app-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.app-tab.active {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.app-tab svg {
  flex-shrink: 0;
}

/* ─── IPTV M3U Section (Collapsible) ───── */
.iptv-channel-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.iptv-m3u-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.iptv-m3u-section.expanded {
  border-color: var(--border-hover);
}

.iptv-m3u-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition-fast);
  user-select: none;
}

.iptv-m3u-header:hover {
  color: var(--text-primary);
}

.iptv-m3u-chevron {
  margin-left: auto;
  transition: transform var(--transition-base);
}

.iptv-m3u-section.expanded .iptv-m3u-chevron {
  transform: rotate(180deg);
}

.iptv-m3u-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iptv-m3u-body.hidden {
  display: none;
}

.iptv-m3u-input-wrapper {
  display: flex;
  gap: 8px;
}

.iptv-m3u-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base);
}

.iptv-m3u-input:focus {
  border-color: var(--accent);
}

.iptv-m3u-input::placeholder {
  color: var(--text-tertiary);
}

.iptv-m3u-load-btn {
  padding: 12px 24px;
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.iptv-m3u-load-btn:hover {
  opacity: 0.9;
}

.iptv-m3u-load-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.iptv-m3u-status {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
}

.iptv-status-loading {
  color: var(--accent);
  background: var(--accent-subtle);
}

.iptv-status-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.iptv-status-error {
  color: var(--error);
  background: rgba(244, 63, 94, 0.1);
}

/* ─── IPTV Channel Browser (Accordion) ──── */
.iptv-browser {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.iptv-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.iptv-browser-header:hover {
  background: var(--bg-hover);
}

.iptv-browser-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
}

.iptv-browser-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iptv-browser-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.iptv-browser.collapsed .iptv-browser-chevron {
  transform: rotate(-90deg);
}

.iptv-browser-body {
  border-top: 1px solid var(--border);
  transition: max-height 0.3s ease;
}

.iptv-browser.collapsed .iptv-browser-body {
  display: none;
}

/* ─── IPTV Toolbar (Filter + Search) ───── */
.iptv-toolbar {
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iptv-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Custom Category Dropdown ─────────── */
.iptv-dropdown {
  position: relative;
  flex-shrink: 0;
}

.iptv-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  transition: border-color var(--transition-fast);
}

.iptv-dropdown-trigger:hover {
  border-color: var(--border-hover);
}

.iptv-dropdown-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.iptv-dropdown-trigger svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.iptv-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 100;
  overflow: hidden;
}

.iptv-dropdown-panel.hidden {
  display: none;
}

.iptv-dropdown-search {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  outline: none;
}

.iptv-dropdown-search::placeholder {
  color: var(--text-tertiary);
}

.iptv-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.iptv-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.iptv-dropdown-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.iptv-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

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

.iptv-dropdown-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 500;
}

.iptv-dropdown-item .iptv-cat-count {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.iptv-dropdown-item.active .iptv-cat-count {
  color: var(--accent);
  opacity: 0.7;
}

.iptv-search-input-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
}

.iptv-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.iptv-channel-search {
  width: 100%;
  padding: 11px 16px 11px 40px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base);
}

.iptv-channel-search:focus {
  border-color: var(--accent);
}

.iptv-channel-search::placeholder {
  color: var(--text-tertiary);
}

.iptv-channel-stats {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 4px 0 0;
}

/* ─── IPTV Channel List ────────────────── */
.iptv-channel-list {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.iptv-channel-list::-webkit-scrollbar {
  width: 4px;
}

.iptv-channel-list::-webkit-scrollbar-track {
  background: transparent;
}

.iptv-channel-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.iptv-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.iptv-channel-item:last-child {
  border-bottom: none;
}

.iptv-channel-item:hover {
  background: var(--bg-hover);
}

.iptv-channel-item.selected {
  background: var(--accent-subtle);
}

.iptv-channel-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  border-radius: 0 2px 2px 0;
}

.iptv-channel-logo-wrapper {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iptv-channel-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iptv-channel-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-subtle);
}

.iptv-channel-info {
  flex: 1;
  min-width: 0;
}

.iptv-channel-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.iptv-channel-name mark {
  background: var(--highlight-bg);
  color: var(--highlight-text);
  border-radius: 3px;
  padding: 1px 3px;
}

.iptv-channel-category {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.iptv-live-badge {
  padding: 3px 8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.iptv-channel-count {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.iptv-load-more-wrapper {
  padding: 12px 16px;
  text-align: center;
}

.iptv-load-more-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.iptv-load-more-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.iptv-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.iptv-empty-icon {
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.iptv-empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ─── IPTV Type Badges ─────────────────── */
.iptv-type-badge {
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.iptv-type-live {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.iptv-type-vod {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ─── Saved Playlists ──────────────────── */
.iptv-saved-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.iptv-saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  margin-bottom: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.iptv-saved-item:hover { background: var(--accent-subtle); }
.iptv-saved-name { font-size: 13px; color: var(--text-primary); }
.iptv-saved-del {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.iptv-saved-del:hover { color: var(--error); }
.iptv-saved-playlists { margin-bottom: 12px; }

.iptv-fav-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.iptv-fav-btn:hover { color: #f43f5e; background: rgba(244,63,94,0.1); }
.iptv-fav-btn.fav-active { color: #f43f5e; }
.iptv-fav-btn.fav-active svg { fill: #f43f5e; }

/* ─── IPTV Tap Overlays (seek + pause) ─── */
.iptv-tap-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30%;
  right: 30%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.iptv-seek-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.iptv-seek-left {
  left: 0;
}

.iptv-seek-right {
  right: 0;
}

.iptv-seek-ripple {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
}

.iptv-seek-ripple.hidden {
  display: none;
}

.iptv-seek-animate {
  animation: seekPop 0.6s ease-out forwards;
}

@keyframes seekPop {
  0% { transform: scale(0.5); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ─── IPTV Subtitle Overlay ────────────── */
.iptv-subtitle-overlay {
  position: absolute;
  bottom: 8%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  font-size: 20px;
  font-weight: 500;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.7);
  line-height: 1.5;
  padding: 0 10%;
}

.iptv-subtitle-overlay:not(:empty) span,
.iptv-subtitle-overlay:not(:empty) {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 4px 16px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ─── IPTV Tracks Panel ───────────────── */
.iptv-tracks-panel {
  background: var(--bg-surface-solid);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.iptv-tracks-panel.hidden {
  display: none;
}

.iptv-tracks-section {
  padding: 4px 0;
}

.iptv-tracks-section + .iptv-tracks-section {
  border-top: 1px solid var(--border);
}

.iptv-tracks-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.iptv-track-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.iptv-track-item.active {
  color: var(--accent);
  font-weight: 500;
}


/* ─── IPTV Volume Controls ─────────────── */
.iptv-volume-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iptv-volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.iptv-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.iptv-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
}

/* ─── IPTV Seek Bar (VOD only) ─────────── */
.iptv-seek-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-surface-solid);
  border-top: 1px solid var(--border);
}

.iptv-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.iptv-time:last-child {
  text-align: right;
}

.iptv-seek-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.iptv-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.iptv-seek-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* ─── IPTV Player ──────────────────────── */
.iptv-player-section {
  margin-top: 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: playerIn 0.4s var(--transition-base);
}

.iptv-player-wrapper {
  position: relative;
  background: #000;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iptv-canvas {
  width: 100%;
  max-height: 70vh;
  display: block;
  background: #000;
}

.iptv-watermark {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
  z-index: 5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', sans-serif;
}

.iptv-player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.iptv-player-loading span {
  font-size: 13px;
  font-weight: 500;
}

.iptv-player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--error);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.iptv-player-error span {
  font-size: 14px;
  font-weight: 500;
}

.iptv-player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-surface-solid);
  border-top: 1px solid var(--border);
}

.iptv-ctrl-spacer {
  flex: 1;
}

/* ─── Codec Overlay (FPS / Codec / Audio badges) ─── */
.iptv-codec-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.iptv-codec-badge {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.iptv-codec-badge b {
  color: #4fc3f7;
  font-weight: 700;
}

.iptv-channel-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.iptv-now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.iptv-now-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  object-fit: contain;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.iptv-now-text {
  min-width: 0;
}

.iptv-now-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.iptv-now-category {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── IPTV Player Fullscreen ───────────── */
.iptv-player-section:fullscreen,
.iptv-player-section:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  background: #000;
  border: none;
  border-radius: 0;
}

.iptv-player-section:fullscreen .iptv-player-wrapper,
.iptv-player-section:-webkit-full-screen .iptv-player-wrapper {
  flex: 1;
  min-height: 0;
}

.iptv-player-section:fullscreen .iptv-canvas,
.iptv-player-section:-webkit-full-screen .iptv-canvas {
  max-height: 100%;
  height: 100%;
  object-fit: contain;
}

.iptv-player-section:fullscreen .iptv-player-controls,
.iptv-player-section:-webkit-full-screen .iptv-player-controls {
  background: rgba(13, 13, 20, 0.92);
  backdrop-filter: blur(16px);
  border-top: none;
  flex-shrink: 0;
}

.iptv-player-section:fullscreen .iptv-channel-info-bar,
.iptv-player-section:-webkit-full-screen .iptv-channel-info-bar {
  background: rgba(13, 13, 20, 0.92);
  flex-shrink: 0;
}

/* ─── Footer ────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 32px 0 8px;
  margin-top: 48px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   Sidebar Layout
   ═══════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.app-main {
  flex: 1;
  min-width: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
}

.nav-brand { padding: 0 8px 20px; }
.nav-brand-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.nav-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-accent);
  flex-shrink: 0;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-role {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.nav-section { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); }
.nav-item.active svg { color: var(--accent); }

.nav-bottom { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }

.nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.nav-logout:hover { background: rgba(244,63,94,0.1); color: var(--error); }

/* ═══════════════════════════════════════════
   Admin Panel
   ═══════════════════════════════════════════ */
.admin-panel { padding: 8px 0; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.admin-add-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td { background: var(--bg-hover); }

.admin-role-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}
.admin-role-superadmin { background: rgba(139,92,246,0.15); color: #a78bfa; }
.admin-role-admin { background: rgba(59,130,246,0.15); color: #60a5fa; }
.admin-role-user { background: rgba(75,85,99,0.15); color: #9ca3af; }

.admin-actions-cell { white-space: nowrap; }
.admin-edit-btn, .admin-del-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
}
.admin-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-del-btn:hover { border-color: var(--error); color: var(--error); }

.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.admin-modal-card {
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 400px;
}
.admin-modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; }
.admin-field { margin-bottom: 14px; }
.admin-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.admin-field input, .admin-field select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 14px;
}
.admin-hint { font-weight: 400; color: var(--text-tertiary); font-size: 11px; }
.admin-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.admin-cancel-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}
.admin-save-btn {
  padding: 8px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.admin-form-error { color: var(--error); font-size: 12px; text-align: center; margin-top: 10px; }
.admin-empty { color: var(--text-tertiary); text-align: center; padding: 40px 0; }

/* Admin Tabs */
.admin-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.admin-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Admin Settings Form */
.admin-settings-form { max-width: 480px; }
.admin-settings-preview {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-top: 8px;
  margin-bottom: 8px;
  word-break: break-all;
  min-height: 20px;
}
.admin-settings-success {
  color: var(--success);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════
   Favorites
   ═══════════════════════════════════════════ */
.favorites-panel { padding: 8px 0; }
.favorites-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; }
.favorites-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.favorites-empty { color: var(--text-tertiary); text-align: center; padding: 60px 0; font-size: 14px; }

.fav-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.fav-card:hover { border-color: var(--accent); background: var(--accent-subtle); }
.fav-logo { width: 32px; height: 32px; border-radius: var(--radius-xs); object-fit: contain; flex-shrink: 0; }
.fav-info { flex: 1; min-width: 0; }
.fav-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}
.fav-remove:hover { background: rgba(244,63,94,0.1); color: var(--error); }

/* ─── Mobile sidebar ─────────────────────── */
@media (max-width: 768px) {
  .app-sidebar { width: 60px; }
  .nav-brand-text, .nav-user-info, .nav-item span, .nav-logout span { display: none; }
  .nav-user-card { padding: 8px; justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-logout { justify-content: center; }
  .app-main { padding: 16px 12px 0; }
}

/* ─── Large Screens ─────────────────────── */
@media (min-width: 1200px) {
  .app-main {
    max-width: 1000px;
  }
}
