/* ============================================================
   Deemix Plus — Design System
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --bg:        #0c0d11;
  --surface:   #141620;
  --surface-2: #1c1f2c;
  --surface-3: #252a3a;
  --border:    #252939;
  --border-2:  #333849;

  --text:   #ecedf5;
  --text-2: #8791a8;
  --text-3: #44506a;

  --purple:      #8b5cf6;
  --purple-dark: #7c3aed;
  --purple-glow: rgba(139, 92, 246, 0.22);

  --blue:     #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.16);

  --green:     #10b981;
  --green-dim: rgba(16, 185, 129, 0.14);

  --red:     #f43f5e;
  --red-dim: rgba(244, 63, 94, 0.12);

  --orange: #f59e0b;

  --r-xs:   4px;
  --r-sm:   6px;
  --r:      10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-pill: 100px;

  --sh-sm: 0 1px 4px rgba(0, 0, 0, 0.45);
  --sh:    0 4px 16px rgba(0, 0, 0, 0.5);
  --sh-lg: 0 8px 32px rgba(0, 0, 0, 0.65);
}

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

/* ── Base ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color .15s, opacity .15s;
}
a:hover { text-decoration: underline; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 56px;
  background: rgba(12, 13, 17, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-left .logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(130deg, #a78bfa 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-left .logo:hover { text-decoration: none; opacity: .82; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#user-info {
  font-size: .82rem;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Buttons ── */
button, .btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-size: .83rem;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
button:hover, .btn-back:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
}
button:active { transform: scale(.96); }
button:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}
.btn-back { text-decoration: none; }

/* Download (green) */
.btn-download {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, .28);
}
.btn-download:hover {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, .38);
}

/* Download all (purple) */
.btn-download-all {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--purple-glow);
}
.btn-download-all:hover {
  background: linear-gradient(135deg, var(--purple) 0%, #a78bfa 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--purple-glow);
}

/* Back nav button */
.btn-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: .82rem;
  cursor: pointer;
  margin-bottom: 14px;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.btn-back-nav:hover { background: var(--surface-3); color: var(--text); }

/* ── Main ── */
.main {
  flex: 1;
  max-width: 1040px;
  width: 100%;
  margin: 28px auto;
  padding: 0 20px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 14px;
  color: var(--text-3);
  font-size: .76rem;
  border-top: 1px solid var(--border);
}

/* ── Auth ── */
.auth-gate {
  text-align: center;
  padding: 80px 20px;
  font-size: 1.05rem;
  color: var(--text-2);
}

.auth-container {
  max-width: 380px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--sh-lg);
}
.auth-container h1 {
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-2);
}
.auth-form input, .auth-form select {
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: .93rem;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.auth-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.auth-form button {
  margin-top: 8px;
  padding: 11px 14px;
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  font-size: .93rem;
  border-radius: var(--r);
  box-shadow: 0 2px 10px var(--purple-glow);
}
.auth-form button:hover {
  background: linear-gradient(135deg, var(--purple) 0%, #a78bfa 100%);
  box-shadow: 0 4px 16px var(--purple-glow);
}

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, .28);
  border-radius: var(--r);
  color: var(--red);
  font-size: .87rem;
}
.msg {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: .85rem;
}
.msg.success {
  background: var(--green-dim);
  border: 1px solid rgba(16, 185, 129, .28);
  color: var(--green);
}
.msg.error {
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, .28);
  color: var(--red);
}

/* ── Search ── */
.search-section { margin-bottom: 28px; }

.search-bar {
  display: flex;
  gap: 10px;
}
.search-bar input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-bar input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.search-bar input::placeholder { color: var(--text-3); }

.search-bar button {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  border-radius: var(--r-pill);
  font-size: .93rem;
  box-shadow: 0 2px 10px var(--purple-glow);
}
.search-bar button:hover {
  background: linear-gradient(135deg, var(--purple) 0%, #a78bfa 100%);
  box-shadow: 0 4px 18px var(--purple-glow);
}

.search-status {
  margin-top: 10px;
  color: var(--text-2);
  font-size: .86rem;
}

/* ── Results ── */
.results-section { margin-bottom: 36px; }
.results-section h2 {
  margin-bottom: 14px;
  font-size: 1rem;
  color: var(--text-2);
}
.results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Result card */
.result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  gap: 12px;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .12s;
}
.result-card:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  box-shadow: var(--sh);
  transform: translateY(-1px);
}

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

/* Cover images */
.cover {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.cover-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

/* Cover wrapper (preview) */
.cover-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
}
.cover-wrapper .cover { width: 100%; height: 100%; }

.cover-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  font-size: 1rem;
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.cover-wrapper:hover .cover-play-overlay { opacity: 1; }
.cover-wrapper.playing .cover-play-overlay {
  opacity: 1;
  background: rgba(139, 92, 246, .35);
}

/* Card text */
.card-info { min-width: 0; }
.card-title {
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.card-subtitle {
  font-size: .79rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Navidrome badge */
.navidrome-badge {
  font-size: .76rem;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.navidrome-badge.exists {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, .24);
}
.navidrome-badge.available {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, .24);
}

/* Duration badge */
.duration-badge {
  font-size: .76rem;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Result blocks (search sections) ── */
.result-block { margin-bottom: 30px; }
.result-block-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .9px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Header row: block title on the left, "show all" button on the right */
.result-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.result-block-header .result-block-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.btn-show-all {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-show-all:hover {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(16, 185, 129, .32);
}

/* Links */
.artist-link {
  color: var(--purple);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color .13s;
}
.artist-link:hover { color: #a78bfa; text-decoration: underline; }

.album-link {
  color: var(--green);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color .13s;
}
.album-link:hover { color: #34d399; text-decoration: underline; }

/* ── Artist page ── */
.artist-section { margin-bottom: 32px; }

.artist-header-info {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh);
  margin-bottom: 20px;
}
.artist-cover-big {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--sh-lg);
  flex-shrink: 0;
  border: 3px solid var(--border-2);
}
.artist-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.artist-header-text h2 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}
.artist-header-text p {
  color: var(--text-2);
  font-size: .9rem;
}
.artist-stats {
  font-size: .86rem;
  color: var(--text-2);
  font-weight: 500;
}
.artist-header-text .btn-download-all,
.album-header-text .btn-download-all,
#album-download-btn {
  align-self: flex-start !important;
  margin-top: 4px;
  width: fit-content !important;
  max-width: max-content;
  flex: 0 0 auto !important;
}

/* Artist summary row */
#artist-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
}
#artist-header-row p {
  color: var(--text-2);
  font-size: .86rem;
  font-weight: 500;
}

/* Artist tabs */
.artist-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.artist-tab {
  padding: 9px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 500;
  font-family: inherit;
  transition: color .14s, border-color .14s;
  border-radius: 0;
  margin-bottom: -1px;
}
.artist-tab:hover { color: var(--text); background: transparent; }
.artist-tab.active {
  color: var(--text);
  border-bottom-color: var(--purple);
}
.artist-tab-content { margin-top: 0; }

/* ── Album page ── */
.album-section { margin-bottom: 32px; }
.album-header { margin-bottom: 28px; }
.album-header > .btn-back-nav {
  margin-bottom: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.album-header > .btn-back-nav:hover { background: var(--surface-3); color: var(--text); }

.album-header-info {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh);
}
.album-cover-big {
  width: 190px;
  height: 190px;
  border-radius: var(--r-lg);
  object-fit: cover;
  box-shadow: var(--sh-lg);
  flex-shrink: 0;
}
.album-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.album-header-text h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--text);
}
.album-header-text p {
  color: var(--text-2);
  font-size: .9rem;
}

/* ── Spinner ── */
.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 72px 0;
}
.spinner::after {
  content: '';
  width: 38px;
  height: 38px;
  border: 3px solid var(--border-2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Queue ── */
.queue-section { margin-bottom: 28px; }
.queue-section h2 {
  margin-bottom: 14px;
  font-size: .98rem;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 1px 9px;
  font-size: .73rem;
  font-weight: 700;
  min-width: 22px;
}
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: .84rem;
  transition: border-color .14s;
}
.queue-item:hover { border-color: var(--border-2); }

.queue-status { flex-shrink: 0; font-size: .9rem; }
.queue-title {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-artist {
  color: var(--text-2);
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}
.queue-progress {
  color: var(--blue);
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
  font-size: .82rem;
}
.queue-state {
  color: var(--text-3);
  font-style: italic;
  font-size: .76rem;
  flex-shrink: 0;
}
.empty-msg {
  color: var(--text-3);
  text-align: center;
  padding: 24px;
  font-size: .88rem;
}

/* ── Admin ── */
.admin-container h1 {
  margin-bottom: 26px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.admin-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.admin-section h2 {
  margin-bottom: 14px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-2);
}
.admin-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-2);
}
.admin-form input, .admin-form select {
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: .87rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.admin-form input:focus, .admin-form select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.admin-form button {
  background: linear-gradient(135deg, #059669 0%, var(--green) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  height: 35px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, .28);
}
.admin-form button:hover {
  background: linear-gradient(135deg, var(--green) 0%, #34d399 100%);
}

/* Users table */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.users-table th {
  color: var(--text-2);
  font-weight: 700;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover td { background: var(--surface-2); }

/* Action buttons */
.btn-delete {
  padding: 4px 10px;
  font-size: .79rem;
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, .28);
  color: var(--red);
}
.btn-delete:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-edit {
  padding: 4px 10px;
  font-size: .79rem;
  background: var(--blue-dim);
  border: 1px solid rgba(59, 130, 246, .28);
  color: var(--blue);
  margin-right: 4px;
}
.btn-edit:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text-2);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.user-actions { white-space: nowrap; }

/* Role badges */
.badge-admin {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge-user {
  background: var(--surface-2);
  color: var(--text-2);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  border: 1px solid var(--border);
}
.badge-special {
  background: linear-gradient(135deg, #b8860b, #ffcc33);
  color: #1a1a1a;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .3px;
}

/* Mini usage bar */
.mini-bar-wrap { min-width: 120px; }
.mini-bar-label { font-size: .7rem; color: var(--text-2); }
.mini-bar-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.mini-bar-fill { height: 100%; border-radius: 2px; }
.usage-admin { font-size: .7rem; color: var(--text-2); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 28px;
  min-width: 320px;
  max-width: 440px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh-lg);
}
.modal-box h3 { margin-bottom: 6px; font-size: 1.05rem; font-weight: 700; }
.modal-box label { font-size: .76rem; font-weight: 600; color: var(--text-2); }
.modal-box input, .modal-box select {
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.modal-box input:focus, .modal-box select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ── Volume control ── */
.volume-control {
  display: flex;
  align-items: center;
  gap: 5px;
}
.volume-icon {
  font-size: .95rem;
  flex-shrink: 0;
  width: 1.3em;
  text-align: center;
  cursor: pointer;
}
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 68px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-2);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--purple);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px var(--purple-glow);
}
.volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--purple);
  border: none;
  cursor: pointer;
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r-lg);
  font-size: .86rem;
  font-weight: 500;
  max-width: 380px;
  pointer-events: auto;
  animation: toast-in .22s ease, toast-out .28s ease 3.7s forwards;
  box-shadow: var(--sh-lg);
}
.toast.success {
  background: var(--surface-2);
  border: 1px solid rgba(16, 185, 129, .38);
  color: var(--green);
}
.toast.error {
  background: var(--surface-2);
  border: 1px solid rgba(244, 63, 94, .38);
  color: var(--red);
}
.toast.info {
  background: var(--surface-2);
  border: 1px solid rgba(59, 130, 246, .38);
  color: var(--blue);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Usage / Quota bar ── */
.usage-bar {
  margin: 0 0 24px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.usage-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--text-2);
  margin-bottom: 7px;
}
.usage-bar-track {
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease, background .4s ease;
}

/* Library cleanup progress */
.clean-progress { margin: 12px 0 6px; }
.clean-progress .usage-bar-track { height: 8px; }
.clean-progress .usage-bar-fill { background: var(--purple, #7c5cff); }
.clean-stage {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.clean-counts {
  font-size: .8rem;
  color: var(--text-2);
  margin-top: 6px;
}
.clean-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.clean-list { margin-top: 12px; }
.clean-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.clean-table th, .clean-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.clean-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-2);
  z-index: 1;
}
.clean-table td.dim { color: var(--text-2); }
.reason-badge {
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
#delete-btn {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
#delete-btn:hover { background: linear-gradient(135deg, #e74c3c 0%, #ff6b5b 100%); }

/* Queue "Show more" */
.btn-show-more {
  display: block;
  margin: 10px auto 0;
  padding: 7px 22px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-size: .83rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, color .14s, border-color .14s;
}
.btn-show-more:hover {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(16, 185, 129, .32);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet (≤ 768px) */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .main { padding: 0 16px; margin: 20px auto; }
  .volume-slider { width: 52px; }
  .album-cover-big { width: 160px; height: 160px; }
  .album-header-info { gap: 20px; padding: 18px; }
  .album-header-text h2 { font-size: 1.45rem; }
}

/* Mobile (≤ 560px) */
@media (max-width: 560px) {
  .header {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-right { gap: 6px; }
  .volume-slider { width: 46px; }
  #user-info { font-size: .78rem; }

  .main { padding: 0 12px; margin: 14px auto; }

  /* Stacked search */
  .search-bar { flex-direction: column; gap: 8px; }
  .search-bar input { border-radius: var(--r-xl); }
  .search-bar button { width: 100%; border-radius: var(--r-xl); }

  /* Stacked cards */
  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-left { width: 100%; }
  .card-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  /* Album header stacked */
  .album-header-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px;
    gap: 14px;
  }
  .album-cover-big { width: 150px; height: 150px; }
  .album-header-text { align-items: center; }
  .album-header-text h2 { font-size: 1.25rem; }

  /* Artist header stacked */
  .artist-header-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px;
    gap: 14px;
  }
  .artist-cover-big { width: 130px; height: 130px; }
  .artist-header-text { align-items: center; }
  .artist-header-text h2 { font-size: 1.3rem; }
  #artist-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #artist-header-row .btn-download-all { width: 100%; justify-content: center; }

  .artist-tab { padding: 8px 12px; font-size: .8rem; }

  /* Admin table */
  .admin-form { flex-direction: column; }
  .admin-form label { width: 100%; }
  .users-table { font-size: .8rem; }
  .users-table th, .users-table td { padding: 8px 8px; }

  /* Modal */
  .modal-box { padding: 20px 16px; }

  /* Queue */
  .queue-artist { display: none; }

  /* Toast */
  .toast { max-width: calc(100vw - 32px); font-size: .82rem; }
  .toast-container { right: 10px; bottom: 14px; }
}

/* Small phones (≤ 380px) */
@media (max-width: 380px) {
  .volume-control { display: none; }
  #logout-btn { font-size: .76rem; padding: 4px 9px; }
  .header-left .logo { font-size: .95rem; }
}
