/* ═══════════════════════════════════════════════
   CALIFY — Spotify-inspired Dark Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg-base: #0a0a0a;
  --bg-elevated: #121212;
  --bg-highlight: #1a1a1a;
  --bg-press: #282828;
  --bg-card: #181818;
  --bg-card-hover: #282828;

  --green: #1DB954;
  --green-hover: #1ed760;
  --green-dim: rgba(29, 185, 84, 0.15);

  --text-base: #ffffff;
  --text-subdued: #b3b3b3;
  --text-muted: #6a6a6a;

  --border: rgba(255,255,255,0.06);
  --border-bright: rgba(255,255,255,0.12);

  --sidebar-width: 280px;
  --player-height: 90px;
  --topbar-height: 64px;

  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.7);

  --font: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}


/* ═══════════════════════════════════════════
   CALIFY THEMES — only accent color changes
   ═══════════════════════════════════════════ */

/* Theme 1: Green (default) */
[data-theme="green"], :root {
  --green: #1DB954;
  --green-hover: #1ed760;
  --green-dim: rgba(29,185,84,0.15);
}

/* Theme 2: Purple */
[data-theme="purple"] {
  --green: #9c42f5;
  --green-hover: #ad5ff7;
  --green-dim: rgba(156,66,245,0.15);
  --green-rgb: 156,66,245;
}

/* Theme 3: Orange */
[data-theme="orange"] {
  --green: #f5a623;
  --green-hover: #f7b84e;
  --green-dim: rgba(245,166,35,0.15);
  --green-rgb: 245,166,35;
}

/* Theme 4: Blue */
[data-theme="blue"] {
  --green: #42c8f5;
  --green-hover: #6dd4f7;
  --green-dim: rgba(66,200,245,0.15);
  --green-rgb: 66,200,245;
}

/* Theme 5: Red */
[data-theme="red"] {
  --green: #f54242;
  --green-hover: #f76666;
  --green-dim: rgba(245,66,66,0.15);
  --green-rgb: 245,66,66;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-base);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  display: flex;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  background: var(--bg-press);
  border: 1px solid var(--border-bright);
  color: var(--text-base);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
img { max-width: 100%; display: block; object-fit: cover; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ─── Sidebar ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - var(--player-height));
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-logo {
  padding: 24px 20px 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 12px rgba(var(--green-rgb),0.5));
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-subdued);
  font-weight: 600;
  font-size: 14px;
  transition: color var(--transition), background var(--transition);
}

.nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }

.nav-item:hover { color: var(--text-base); background: var(--bg-highlight); }
.nav-item.active { color: var(--text-base); }
.nav-item.active svg path { fill: var(--green); }

/* Library */
.sidebar-library {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  color: var(--text-subdued);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-subdued);
  transition: color var(--transition), background var(--transition);
}
.add-btn svg { width: 18px; height: 18px; }
.add-btn:hover { color: var(--text-base); background: var(--bg-highlight); }

.library-playlists {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.library-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.library-item:hover { background: var(--bg-highlight); }

.lib-cover {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-press);
}

.lib-cover-default {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #333, #1a1a1a);
}
.lib-cover-default svg { width: 20px; height: 20px; color: var(--text-muted); }

.lib-info { flex: 1; min-width: 0; }
.lib-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.lib-meta {
  font-size: 11px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Admin link */
.sidebar-admin {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.admin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-subdued);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  background: rgba(var(--green-rgb),0.05);
}
.admin-link svg { width: 18px; height: 18px; }
.admin-link:hover { color: var(--green); background: var(--green-dim); }

/* ─── Main Content ───────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--player-height));
  overflow: hidden;
  background: linear-gradient(180deg, #1a1a1a 0%, var(--bg-elevated) 200px);
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(18,18,18,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.topbar-nav { display: flex; gap: 8px; }
.nav-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-base);
  transition: background var(--transition);
}
.nav-arrow svg { width: 18px; height: 18px; }
.nav-arrow:hover { background: rgba(255,255,255,0.1); }

.topbar-search-mini { flex: 1; max-width: 400px; }
.topbar-search-mini input {
  width: 100%;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--bg-press);
  border: 1px solid var(--border-bright);
  font-size: 14px;
  color: var(--text-base);
}
.topbar-search-mini input::placeholder { color: var(--text-muted); }

.topbar-user { margin-left: auto; }
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 50px;
  cursor: pointer;
  background: var(--bg-press);
  transition: background var(--transition);
  user-select: none;
}
.user-menu:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #000;
}
.user-name { font-size: 13px; font-weight: 600; }
.chevron { width: 18px; height: 18px; color: var(--text-subdued); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 100;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--bg-highlight); color: var(--green); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

/* ─── Flash Messages ─────────────────────────── */
.flash-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  transition: opacity 0.5s ease;
  max-width: 380px;
}
.flash button { font-size: 18px; line-height: 1; color: inherit; opacity: 0.7; margin-left: auto; }
.flash-success { background: linear-gradient(135deg, rgba(var(--green-rgb),0.18), rgba(var(--green-rgb),0.10)); border-left: 3px solid var(--green); }
.flash-error { background: linear-gradient(135deg, #3a1a1a, #4d1e1e); border-left: 3px solid #e53e3e; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Player ─────────────────────────────────── */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: linear-gradient(180deg, rgba(18,18,18,0.95) 0%, var(--bg-elevated) 100%);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  z-index: 50;
}

.player-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.player-cover {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-press);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.player-cover img { width: 100%; height: 100%; }
.player-cover svg { width: 24px; height: 24px; color: var(--text-muted); }

.player-info { flex: 1; min-width: 0; }
.player-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.player-artist {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.player-heart {
  color: var(--text-subdued);
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition);
}
.player-heart svg { width: 20px; height: 20px; }
.player-heart:hover { color: var(--green); }
.player-heart.liked { color: var(--green); }
.player-heart.liked svg { fill: var(--green); stroke: none; }

.player-center {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 600px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subdued);
  transition: color var(--transition), background var(--transition), transform var(--transition);
}
.ctrl-btn svg { width: 20px; height: 20px; }
.ctrl-btn:hover { color: var(--text-base); transform: scale(1.05); }
.ctrl-btn.active { color: var(--green); }

.play-btn {
  width: 44px;
  height: 44px;
  background: var(--text-base);
  color: #000 !important;
  transition: transform 0.15s ease, background var(--transition) !important;
}
.play-btn:hover { background: var(--green) !important; transform: scale(1.06) !important; }
.play-btn svg { width: 22px; height: 22px; }

.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time {
  font-size: 11px;
  color: var(--text-subdued);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  font-family: var(--font-mono);
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height var(--transition);
}
.progress-bar:hover { height: 6px; }
.progress-fill {
  height: 100%;
  background: var(--text-base);
  border-radius: 2px;
  transition: width 0.1s linear;
  position: relative;
}
.progress-bar:hover .progress-fill { background: var(--green); }
.progress-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-base);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
}
.progress-bar:hover .progress-thumb { display: block; }

.player-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.volume-bar {
  width: 90px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: height var(--transition);
}
.volume-bar:hover { height: 6px; }
.volume-fill {
  height: 100%;
  background: var(--text-base);
  border-radius: 2px;
}
.volume-bar:hover .volume-fill { background: var(--green); }

/* ─── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
}
.card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }

.card-cover {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-press);
  position: relative;
}
.card-cover img { width: 100%; height: 100%; transition: transform var(--transition-slow); }
.card:hover .card-cover img { transform: scale(1.04); }
.card-cover-default {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover-default svg { width: 40%; height: 40%; color: var(--text-muted); }

.card-body { padding: 14px; }
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-play-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 8px 24px rgba(var(--green-rgb),0.5);
}
.card-play-overlay svg { width: 22px; height: 22px; color: #000; }
.card:hover .card-play-overlay { opacity: 1; transform: translateY(0); }

/* Grid layouts */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.cards-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

/* ─── Section Headers ────────────────────────── */
.section { margin-bottom: 40px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-subdued);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color var(--transition);
}
.section-link:hover { color: var(--text-base); }

/* ─── Song List / Table ───────────────────────── */
.song-list { display: flex; flex-direction: column; gap: 2px; }
.song-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
  group: true;
}
.song-row:hover { background: var(--bg-highlight); }
.song-row:hover .song-index { display: none; }
.song-row:hover .song-play-btn { display: flex; }

.song-index {
  font-size: 14px;
  color: var(--text-subdued);
  text-align: center;
  font-family: var(--font-mono);
}
.song-play-btn {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-base);
}
.song-play-btn svg { width: 18px; height: 18px; }

.song-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.song-cover-small {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-press);
  display: flex;
  align-items: center;
  justify-content: center;
}
.song-cover-small::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z'/%3E%3C/svg%3E") no-repeat center/contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z'/%3E%3C/svg%3E") no-repeat center/contain;
  flex-shrink: 0;
}
.song-cover-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.song-cover-small { position: relative; }
.song-texts { flex: 1; min-width: 0; }
.song-title-text {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist-text {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist-text a:hover { color: var(--text-base); text-decoration: underline; }

.song-album-text {
  font-size: 13px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-duration {
  font-size: 13px;
  color: var(--text-subdued);
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

/* ─── Hero Banner ────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.25) 0%, rgba(var(--green-rgb),0.08) 50%, var(--bg-elevated) 100%);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-end;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--green-rgb),0.15), transparent 70%);
  pointer-events: none;
}

.hero-cover {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  background: var(--bg-press);
}
.hero-cover img { width: 100%; height: 100%; }

.hero-info { flex: 1; }
.hero-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-subdued); margin-bottom: 8px; }
.hero-title { font-size: 48px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; margin-bottom: 12px; }
.hero-meta { font-size: 14px; color: var(--text-subdued); }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

/* ─── Buttons ────────────────────────────────── */
.btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--green);
  color: #000;
}
.btn-primary:hover { background: var(--green-hover); transform: scale(1.03); }

.btn-secondary {
  background: transparent;
  color: var(--text-base);
  border: 1px solid rgba(255,255,255,0.3);
}
.btn-secondary:hover { border-color: var(--text-base); background: rgba(255,255,255,0.05); }

.btn-ghost {
  background: transparent;
  color: var(--text-subdued);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-base); }

.btn-danger {
  background: #e53e3e;
  color: white;
}
.btn-danger:hover { background: #c53030; }

.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; }

.btn svg { width: 18px; height: 18px; }

/* Icon Button */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subdued);
  transition: all var(--transition);
  background: transparent;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text-base); background: var(--bg-highlight); }
.icon-btn.active { color: var(--green); }

/* ─── Forms ──────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-subdued);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-press);
  border: 1px solid var(--border-bright);
  transition: border-color var(--transition);
}
.form-check:hover { border-color: var(--green); }
.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}
.form-check-label { font-size: 14px; font-weight: 500; flex: 1; }
.form-check-desc { font-size: 12px; color: var(--text-subdued); }

/* File upload */
.file-upload {
  display: block;
  width: 100%;
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: var(--bg-press);
  box-sizing: border-box;
}
.file-upload:hover { border-color: var(--green); background: var(--green-dim); }
.file-upload.has-file { border-color: var(--green); border-style: solid; background: var(--green-dim); }
.file-upload-icon { display: block; margin-bottom: 12px; }
.file-upload-icon svg { width: 40px; height: 40px; color: var(--text-muted); display: block; margin: 0 auto; }
.file-upload-text { font-size: 14px; color: var(--text-subdued); display: block; }
.file-upload-text strong { color: var(--green); }
.file-upload input[type="file"] { display: none; }

/* ─── Auth Pages ─────────────────────────────── */
.auth-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(var(--green-rgb),0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(var(--green-rgb),0.05) 0%, transparent 50%),
              var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo svg { width: 56px; height: 56px; margin: 0 auto 12px; filter: drop-shadow(0 0 16px rgba(var(--green-rgb),0.5)); }
.auth-logo-text {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-subdued);
  text-align: center;
  margin-bottom: 32px;
}
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-subdued);
}
.auth-footer a { color: var(--text-base); font-weight: 600; }
.auth-footer a:hover { color: var(--green); }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-bright);
}
.auth-divider span { background: var(--bg-elevated); padding: 0 12px; position: relative; }

/* ─── Admin ──────────────────────────────────── */
.admin-layout {
  display: flex;
  height: calc(100vh - var(--player-height));
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--green); background: var(--bg-card-hover); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.stat-icon svg { width: 24px; height: 24px; color: var(--green); }
.stat-value { font-size: 32px; font-weight: 800; font-family: var(--font-mono); }
.stat-label { font-size: 13px; color: var(--text-subdued); margin-top: 4px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subdued);
  font-weight: 600;
}
.admin-table td { font-size: 14px; }
.admin-table tr:hover td { background: var(--bg-highlight); }
.admin-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-gray { background: rgba(255,255,255,0.08); color: var(--text-subdued); }
.badge-red { background: rgba(229,62,62,0.15); color: #fc8181; }

/* ─── Misc ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-subdued);
}
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 20px; opacity: 0.4; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text-base); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-size: 28px; font-weight: 800; }
.page-subtitle { font-size: 14px; color: var(--text-subdued); margin-top: 4px; }

/* Context menu */
.context-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 6px 0;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
}
.context-menu.show { display: block; }
.context-menu-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition);
}
.context-menu-item:hover { background: var(--bg-highlight); }
.context-menu-item svg { width: 18px; height: 18px; color: var(--text-subdued); }
.context-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Tooltip */
[title] { position: relative; }

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Playing animation */
.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.playing-bars span {
  width: 3px;
  background: var(--green);
  border-radius: 1px;
  animation: bars 0.8s ease infinite alternate;
}
.playing-bars span:nth-child(2) { animation-delay: 0.15s; height: 60%; }
.playing-bars span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bars {
  from { height: 20%; }
  to { height: 100%; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  border: 1px solid var(--border-bright);
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-subdued); transition: all var(--transition); }
.modal-close:hover { background: var(--bg-highlight); color: var(--text-base); }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar .logo-text, .sidebar .nav-item span, .sidebar .library-header, .sidebar .lib-info, .sidebar .admin-link span { display: none; }
  .sidebar-library { overflow: visible; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero-title { font-size: 28px; }
  .hero-cover { width: 120px; height: 120px; }
  .player-left, .player-right { display: none; }
  .player-center { max-width: 100%; }
}
