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

:root {
  --orange: #FF6B2B;
  --orange-dim: #cc5520;
  --blue: #3D8EFF;
  --dark:  #080909;
  --dark2: #0f1010;
  --dark3: #161818;
  --dark4: #1e2020;
  --card:  #1a1c1c;
  --border: #2a2e2e;
  --text:  #e8edea;
  --muted: #6b7570;
  --muted2: #3d4440;
  --success: #22c55e;
  --radius: 10px;
  --player-h: 76px;
  --sidebar-w: 220px;
  --panel-w: 320px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--dark); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, select { font-family: inherit; }
img { display: block; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }

/* ══════════════════════════════
   LOGIN PAGE
══════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark);
  background-image: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255,107,43,0.15), transparent);
  padding: 24px;
}
.login-box { width: 100%; max-width: 400px; background: var(--dark2); border: 1px solid var(--border); border-radius: 18px; padding: 48px 40px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 36px; }
.login-logo .wordmark { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 700; }
.login-logo .wordmark span { color: var(--orange); }
.login-logo .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.form-group input { background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; color: var(--text); font-size: 14px; transition: border-color 0.2s; outline: none; }
.form-group input:focus { border-color: var(--orange); }
.btn-primary { width: 100%; padding: 13px; background: var(--orange); color: #fff; font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; border-radius: 8px; margin-top: 8px; transition: background 0.2s, transform 0.1s; }
.btn-primary:hover { background: var(--orange-dim); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error { display: none; margin-top: 14px; padding: 10px 14px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; color: #f87171; font-size: 13px; text-align: center; }

/* ══════════════════════════════
   APP LAYOUT — 3 columns
══════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--panel-w);
  grid-template-rows: 1fr var(--player-h);
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  grid-row: 1 / 2; grid-column: 1 / 2;
  background: var(--dark2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto;
}
.sidebar-logo { padding: 0 16px 20px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sidebar-logo .wordmark { font-family: 'Unbounded', sans-serif; font-size: 14px; font-weight: 700; }
.sidebar-logo .wordmark span { color: var(--orange); }
.sidebar-logo .sub { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--muted); font-size: 13px; font-weight: 500; transition: color 0.15s, background 0.15s; cursor: pointer; width: 100%; text-align: left; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--dark3); }
.nav-item.active { color: var(--orange); }
.nav-item .pl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-section-title { padding: 14px 16px 4px; font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar-local { margin-top: auto; padding: 14px 16px 0; border-top: 1px solid var(--border); }
.sidebar-local .local-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-local .local-type { font-size: 11px; color: var(--muted); margin-top: 2px; }
.btn-logout { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); transition: color 0.15s; }
.btn-logout:hover { color: #f87171; }
.btn-logout svg { width: 14px; height: 14px; }

/* ── Main ── */
.main { grid-row: 1/2; grid-column: 2/3; overflow-y: auto; background: var(--dark); display: flex; flex-direction: column; }
.main-header { position: sticky; top: 0; z-index: 10; background: var(--dark); padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.search-wrap { flex: 1; position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
#search-input { width: 100%; background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 34px; color: var(--text); font-size: 13px; outline: none; transition: border-color 0.2s; }
#search-input:focus { border-color: var(--orange); }
#search-input::placeholder { color: var(--muted); }
.header-btn { display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; font-size: 12px; font-weight: 500; background: var(--dark3); border: 1px solid var(--border); color: var(--muted); transition: all 0.15s; }
.header-btn:hover { border-color: var(--orange); color: var(--orange); }
.header-btn.active { border-color: var(--orange); color: var(--orange); background: rgba(255,107,43,0.08); }
.header-btn svg { width: 14px; height: 14px; }

/* Filter bar — sticky below main-header */
.filter-bar { position: sticky; top: 57px; z-index: 9; background: var(--dark); display: flex; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
.filter-btn { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; background: transparent; border: 1px solid transparent; color: var(--muted); transition: all 0.15s; white-space: nowrap; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--text); color: var(--dark); border-color: var(--text); font-weight: 600; }

/* Genre filter chips */
.genre-chips { display: flex; gap: 6px; padding: 10px 20px 6px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.genre-chips::-webkit-scrollbar { display: none; }
.genre-chip { padding: 4px 12px; border-radius: 16px; font-size: 11px; font-weight: 500; background: var(--dark3); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.genre-chip:hover { color: var(--text); }
.genre-chip.active { background: rgba(255,107,43,0.12); border-color: var(--orange); color: var(--orange); }

/* Floating add-to-playlist menu */
.add-menu { position: fixed; background: var(--dark2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); overflow: hidden; z-index: 1000; min-width: 200px; }
.add-menu-title { padding: 10px 14px 7px; font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid var(--border); }
.add-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 14px; font-size: 13px; color: var(--text); transition: background 0.12s; }
.add-menu-item:hover { background: var(--dark3); }
.add-menu-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.add-menu-sep { height: 1px; background: var(--border); }
.add-menu-new { color: var(--orange); font-weight: 500; }

/* ── Track list ── */
.tracks-section { padding: 16px 20px; flex: 1; }
.tracks-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.tracks-header { display: grid; grid-template-columns: 28px 1fr 160px 100px 36px; gap: 10px; padding: 0 10px 8px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.track-row { display: grid; grid-template-columns: 28px 1fr 160px 100px 36px; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.track-row:hover { background: var(--dark3); }
.track-row.active { background: rgba(255,107,43,0.08); }
.track-row.active .track-title { color: var(--orange); }
.track-row.dragging { opacity: 0.4; }
.track-num { font-size: 12px; color: var(--muted); text-align: center; }
.track-row.active .track-num { color: var(--orange); }
.track-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-thumb { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; flex-shrink: 0; background: var(--dark4); }
.track-texts { min-width: 0; }
.track-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-genre { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-tag { display: inline-block; padding: 2px 8px; border-radius: 12px; background: var(--dark4); border: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.btn-add-track { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); transition: all 0.15s; }
.btn-add-track:hover { background: rgba(255,107,43,0.12); color: var(--orange); }
.btn-add-track svg { width: 16px; height: 16px; }
.track-action-btn { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 5px; color: var(--muted); transition: all 0.15s; flex-shrink: 0; }
.track-action-btn:hover { background: rgba(255,107,43,0.12); color: var(--orange); }
.track-action-btn svg { width: 14px; height: 14px; }
.playlist-card-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.playlist-card-icon svg { width: 24px; height: 24px; }

/* Drag source highlight */
.track-row[draggable="true"] { cursor: grab; }
.track-row[draggable="true"]:active { cursor: grabbing; }

/* ══════════════════════════════
   PLAYLIST PANEL (right column)
══════════════════════════════ */
.playlist-panel {
  grid-row: 1/2; grid-column: 3/4;
  background: var(--dark2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  min-width: 0; /* collapse to 0 when panel is closed */
}

/* Video area at top of panel */
.panel-video {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-bottom: 1px solid var(--border);
}
.panel-video #yt-player { width: 100%; height: 100%; }
.panel-video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted2); pointer-events: none;
}
.panel-video-placeholder svg { width: 32px; height: 32px; opacity: 0.4; }
.panel-video-placeholder span { font-size: 11px; opacity: 0.5; }
.btn-fullscreen-video {
  position: absolute; bottom: 8px; right: 8px; z-index: 20;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); border-radius: 5px; color: #fff; transition: background 0.15s;
}
.btn-fullscreen-video:hover { background: rgba(255,107,43,0.8); }
.btn-fullscreen-video svg { width: 14px; height: 14px; }

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.panel-select {
  flex: 1;
  background: var(--dark3); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 12px; font-weight: 500;
  outline: none; cursor: pointer;
}
.panel-select option { background: var(--dark2); }

.btn-new-panel {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--dark3); border: 1px solid var(--border);
  color: var(--muted); transition: all 0.15s;
}
.btn-new-panel:hover { border-color: var(--orange); color: var(--orange); }
.btn-new-panel svg { width: 16px; height: 16px; }

.panel-meta {
  padding: 8px 16px;
  font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.panel-actions { display: flex; gap: 6px; }

.btn-panel-action {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: var(--dark3); border: 1px solid var(--border); color: var(--muted);
  transition: all 0.15s;
}
.btn-panel-action:hover { color: var(--text); }
.btn-panel-action.active { border-color: var(--orange); color: var(--orange); }
.btn-panel-action svg { width: 12px; height: 12px; }

/* Drop zone */
.panel-drop-zone {
  flex: 1; overflow-y: auto;
  min-height: 100px;
  transition: background 0.15s;
}

.panel-drop-zone.drag-over {
  background: rgba(255, 107, 43, 0.05);
  outline: 2px dashed var(--orange);
  outline-offset: -8px;
}

.panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; color: var(--muted); text-align: center; padding: 20px;
}
.panel-empty svg { width: 36px; height: 36px; opacity: 0.3; margin-bottom: 12px; }
.panel-empty p { font-size: 12px; line-height: 1.5; }

/* Panel track rows */
.panel-track {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  transition: background 0.12s; cursor: default;
}
.panel-track:hover { background: var(--dark3); }
.panel-track.drag-over-top { border-top: 2px solid var(--orange); }
.panel-track.drag-over-bottom { border-bottom: 2px solid var(--orange); }

.drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 18px; flex-shrink: 0; color: var(--muted2); cursor: grab;
  transition: color 0.15s;
}
.drag-handle:hover { color: var(--muted); }
.drag-handle svg { width: 14px; height: 14px; }
.drag-handle:active { cursor: grabbing; }

.panel-track-num { font-size: 11px; color: var(--muted); width: 18px; text-align: center; flex-shrink: 0; }

.panel-track-info { flex: 1; min-width: 0; cursor: pointer; }
.panel-track-title { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-track-artist { font-size: 11px; color: var(--muted); }

.btn-remove-track {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  color: var(--muted2); transition: all 0.15s;
}
.btn-remove-track:hover { background: rgba(239,68,68,0.12); color: #f87171; }
.btn-remove-track svg { width: 12px; height: 12px; }

/* Panel toggle button in header */
.btn-panel-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;
  background: var(--dark3); border: 1px solid var(--border); color: var(--muted);
  transition: all 0.15s; white-space: nowrap;
}
.btn-panel-toggle:hover { border-color: var(--orange); color: var(--orange); }
.btn-panel-toggle.active { border-color: var(--orange); color: var(--orange); background: rgba(255,107,43,0.08); }
.btn-panel-toggle svg { width: 14px; height: 14px; }

/* ══════════════════════════════
   ARTISTS VIEW
══════════════════════════════ */
.artists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; padding: 16px 20px; }
.artist-card { background: var(--dark2); border: 1px solid var(--border); border-radius: 10px; padding: 18px 14px; cursor: pointer; transition: all 0.15s; text-align: center; }
.artist-card:hover { background: var(--dark3); border-color: var(--muted2); transform: translateY(-2px); }
.artist-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--dark4); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--orange); margin: 0 auto 10px; font-family: 'Unbounded', sans-serif; }
.artist-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.artist-count { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════
   PLAYLISTS VIEW
══════════════════════════════ */
.playlists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; padding: 16px 20px; }
.playlist-card { background: var(--dark2); border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; cursor: pointer; transition: all 0.15s; position: relative; }
.playlist-card:hover { background: var(--dark3); border-color: var(--muted2); transform: translateY(-2px); }
.playlist-card-color { width: 32px; height: 32px; border-radius: 8px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; }
.playlist-card-color svg { width: 18px; height: 18px; color: #fff; }
.playlist-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.playlist-card-meta { font-size: 11px; color: var(--muted); }
.playlist-card-bar { height: 3px; border-radius: 2px; margin-top: 14px; }
.playlist-card .btn-delete { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.15); color: #f87171; font-size: 13px; display: none; align-items: center; justify-content: center; }
.playlist-card:hover .btn-delete { display: flex; }
.section-label { padding: 8px 20px 4px; font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.1em; }
.btn-new-playlist { display: flex; align-items: center; gap: 10px; background: var(--dark2); border: 1px dashed var(--border); border-radius: 10px; padding: 18px 16px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; transition: all 0.15s; width: 100%; text-align: left; }
.btn-new-playlist:hover { border-color: var(--orange); color: var(--orange); }
.btn-new-playlist svg { width: 20px; height: 20px; }

/* Playlist detail */
.playlist-detail-header { display: flex; align-items: center; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border); }
.playlist-detail-icon { width: 72px; height: 72px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.playlist-detail-icon svg { width: 36px; height: 36px; color: #fff; }
.playlist-detail-type { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.playlist-detail-name { font-family: 'Unbounded', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 3px; }
.playlist-detail-meta { font-size: 12px; color: var(--muted); }
/* Playlist detail actions — horizontal row */
.playlist-actions { display: flex; flex-direction: row; border-bottom: 1px solid var(--border); }
.btn-play-all, .btn-shuffle, .btn-back-list {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px; color: var(--muted); font-size: 12px; font-weight: 500;
  transition: color 0.15s, background 0.15s; cursor: pointer;
  border-right: 1px solid var(--border);
}
.btn-shuffle { border-right: none; }
.btn-play-all:hover, .btn-shuffle:hover, .btn-back-list:hover { color: var(--text); background: var(--dark3); }
.btn-shuffle.active { color: var(--orange); }
.btn-play-all svg, .btn-shuffle svg, .btn-back-list svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Playlist card cover image */
.playlist-card-cover { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: var(--dark4); }
.playlist-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Inline video section in main column */
.video-section { position: relative; flex-shrink: 0; background: #000; aspect-ratio: 16/9; width: 100%; border-bottom: 1px solid var(--border); }
.video-section #yt-player { width: 100%; height: 100%; }
.btn-close-video { position: absolute; top: 10px; right: 10px; z-index: 20; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.65); border-radius: 50%; color: #fff; transition: background 0.15s; }
.btn-close-video:hover { background: rgba(255,107,43,0.8); }
.btn-close-video svg { width: 14px; height: 14px; }
.video-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted2); pointer-events: none; }
.video-placeholder svg { width: 36px; height: 36px; opacity: 0.3; }
.video-placeholder span { font-size: 11px; opacity: 0.5; }

/* Playlist color swatches in edit modal */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform 0.1s, border-color 0.1s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; transform: scale(1.15); }

/* Reco panel */
.reco-panel { background: var(--dark2); border-top: 1px solid var(--border); padding: 14px 20px; }
.reco-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
.reco-tracks { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.reco-track { flex-shrink: 0; width: 130px; background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; transition: all 0.15s; }
.reco-track:hover { border-color: var(--orange); }
.reco-track img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; margin-bottom: 6px; background: var(--dark4); }
.reco-track-title { font-size: 11px; font-weight: 500; color: var(--text); line-height: 1.3; }
.reco-track-artist { font-size: 10px; color: var(--muted); margin-top: 2px; }
.reco-track-add { margin-top: 5px; font-size: 10px; color: var(--orange); font-weight: 600; }

/* ══════════════════════════════
   PLAYER BAR
══════════════════════════════ */
.player-bar {
  grid-row: 2/3; grid-column: 1/-1;
  background: var(--dark2); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 18px; height: var(--player-h);
}
.player-now { display: flex; align-items: center; gap: 10px; width: 220px; flex-shrink: 0; }
#np-thumb { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; background: var(--dark4); display: none; }
.np-texts { min-width: 0; }
#np-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#np-artist { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-idle { font-size: 12px; color: var(--muted); }
.player-controls { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.controls-btns { display: flex; align-items: center; gap: 14px; }
.ctrl-btn { display: flex; align-items: center; justify-content: center; color: var(--muted); transition: color 0.15s; }
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn.active { color: var(--orange); }
.ctrl-btn svg { width: 17px; height: 17px; }
#btn-play { width: 34px; height: 34px; background: var(--orange); border-radius: 50%; color: #fff; transition: background 0.15s, transform 0.1s; }
#btn-play:hover { background: var(--orange-dim); }
#btn-play:active { transform: scale(0.94); }
#btn-play svg { width: 15px; height: 15px; }
.progress-row { display: flex; align-items: center; gap: 9px; width: 100%; max-width: 560px; }
.time { font-size: 11px; color: var(--muted); min-width: 32px; }
#time-current { text-align: right; }
.progress-track { flex: 1; height: 4px; background: var(--dark4); border-radius: 2px; cursor: pointer; }
#progress-bar { height: 4px; background: var(--orange); border-radius: 2px; width: 0%; transition: width 0.5s linear; pointer-events: none; }
.player-right { display: flex; align-items: center; gap: 10px; }
.vol-wrap { display: flex; align-items: center; gap: 7px; }
.vol-wrap svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.vol-track { width: 72px; height: 4px; background: var(--dark4); border-radius: 2px; cursor: pointer; }
#vol-fill { height: 4px; width: 80%; background: var(--muted); border-radius: 2px; pointer-events: none; }

/* YouTube overlays */
/* yt-player lives inside .panel-video (see panel CSS above) */

/* ══════════════════════════════
   DASHBOARD PAGE
══════════════════════════════ */
.dash-main { overflow-y: auto; background: var(--dark); }
.dash-content { padding: 24px; max-width: 1100px; }
.dash-title { font-family: 'Unbounded', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.dash-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.dash-filters { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.dash-filters input[type="date"], .dash-filters select { background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: 13px; outline: none; transition: border-color 0.2s; }
.dash-filters input[type="date"]:focus { border-color: var(--orange); }
.btn-filter { padding: 7px 16px; background: var(--orange); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; transition: background 0.2s; }
.btn-filter:hover { background: var(--orange-dim); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 28px; }
.kpi-card { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.kpi-value { font-family: 'Unbounded', sans-serif; font-size: 26px; font-weight: 700; color: var(--text); }
.kpi-value.green { color: var(--success); }
.kpi-value.orange { color: var(--orange); }
.kpi-value.blue { color: var(--blue); }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.plays-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plays-table th { text-align: left; padding: 7px 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
.plays-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.plays-table tr:last-child td { border-bottom: none; }
.plays-table tr:hover td { background: var(--dark3); }
.badge-cpm { display: inline-flex; padding: 2px 8px; background: rgba(34,197,94,0.12); color: var(--success); border-radius: 20px; font-size: 10px; font-weight: 600; }
.badge-stat { display: inline-flex; padding: 2px 8px; background: var(--dark4); color: var(--muted); border-radius: 20px; font-size: 10px; font-weight: 600; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 14px; opacity: 0.3; }
.loading-spinner { text-align: center; padding: 40px; color: var(--muted); font-size: 13px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--dark2); border: 1px solid var(--border); border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; }
.modal-title { font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.modal-box input { width: 100%; background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 13px; font-family: 'Outfit', sans-serif; outline: none; margin-bottom: 14px; transition: border-color 0.2s; }
.modal-box input:focus { border-color: var(--orange); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-cancel { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; background: var(--dark3); border: 1px solid var(--border); color: var(--muted); transition: all 0.15s; }
.btn-cancel:hover { color: var(--text); }
.btn-confirm { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--orange); color: #fff; transition: background 0.15s; }
.btn-confirm:hover { background: var(--orange-dim); }

/* ══════════════════════════════
   UTILITIES
══════════════════════════════ */
.hidden { display: none !important; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { grid-column: 1/-1; }
  .tracks-header, .tracks-header { display: none; }
  .track-row { grid-template-columns: 1fr 36px; }
  .track-num, .track-genre { display: none; }
  .player-now { flex: 1; width: auto; }
  .player-right { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
