/* =============================================
   BALUSONG — Spotify-like CSS
   ============================================= */

:root {
  --bg: #121212;
  --bg2: #181818;
  --bg3: #282828;
  --bg4: #333;
  --cyan: #06b6d4;
  --cyan-hover: #22d3ee;
  --red: #e22134;
  --text: #ffffff;
  --text2: #b3b3b3;
  --text3: #6a6a6a;
  --border: #333;
  --player-h: 72px;
  --bnav-h: 64px;
  --sidebar-w: 240px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.15s ease;
}

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

html { height: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, button { outline: none; }

img { display: block; max-width: 100%; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-body {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #060810 0%, #0a0f18 50%, #0d1520 100%);
}

.auth-container {
  width: 100%;
  max-width: 360px;
  padding: 2rem 1.5rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-svg {
  width: 60px;
  height: 60px;
  color: var(--cyan);
  margin: 0 auto 0.75rem;
}

.logo-img {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-logo h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.auth-logo p {
  color: var(--text2);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}

.form-group input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus {
  border-color: var(--cyan);
}

.form-group input::placeholder { color: var(--text3); }

.auth-footer {
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
  margin-top: 2rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: 0.04em;
}

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

.btn-primary {
  background: var(--cyan);
  color: #000;
}
.btn-primary:hover { background: var(--cyan-hover); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg4); border-color: var(--text2); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error { background: rgba(226, 33, 52, 0.15); border: 1px solid rgba(226, 33, 52, 0.4); color: #ff6b6b; }
.alert-success { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.4); color: var(--cyan); }

/* =============================================
   APP SHELL LAYOUT
   ============================================= */
#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* =============================================
   SIDEBAR (Desktop)
   ============================================= */
#sidebar {
  display: none;
  width: var(--sidebar-w);
  background: #000;
  flex-direction: column;
  flex-shrink: 0;
  padding: 1.5rem 0.75rem;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  #sidebar { display: flex; }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 0.75rem 1.5rem;
  font-weight: 900;
  font-size: 1.25rem;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  color: var(--cyan);
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-weight: 700;
  font-size: 0.875rem;
  transition: color var(--transition);
}

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

.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-user span {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  color: var(--text2);
  transition: color var(--transition);
}
.sidebar-logout svg { width: 20px; height: 20px; }
.sidebar-logout:hover { color: var(--text); }

/* =============================================
   MAIN CONTENT
   ============================================= */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #1a1a2e 0%, var(--bg) 300px);
  padding-bottom: calc(var(--player-h) + var(--bnav-h) + 1rem);
}

@media (min-width: 768px) {
  #main-content {
    padding-bottom: calc(var(--player-h) + 1rem);
    background: linear-gradient(180deg, #1a1a2e 0%, var(--bg) 400px);
  }
}

#content-area {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg3);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* =============================================
   BOTTOM NAVIGATION (Mobile)
   ============================================= */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bnav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

@media (min-width: 768px) {
  #bottom-nav { display: none; }
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--text2);
  font-size: 0.7rem;
  font-weight: 600;
  transition: color var(--transition);
  padding: 0.25rem;
}

.bnav-item svg { width: 24px; height: 24px; }
.bnav-item.active { color: var(--text); }
.bnav-item.active svg { color: var(--cyan); }

/* =============================================
   PLAYER BAR (Mini)
   ============================================= */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bnav-h);
  height: var(--player-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.5rem;
  z-index: 99;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .player-bar {
    bottom: 0;
    left: var(--sidebar-w);
    padding: 0 1.5rem;
  }
}

.player-bar.hidden { transform: translateY(100%); }

.player-track {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  cursor: pointer;
}

.player-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}

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

.player-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.75rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls-mini {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.player-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text2);
  transition: color var(--transition);
}

.player-btn svg { width: 20px; height: 20px; }
.player-btn:hover { color: var(--text); }

.player-btn-play {
  width: 40px;
  height: 40px;
  background: var(--text);
  color: #000;
  border-radius: 50%;
}

.player-btn-play:hover { background: var(--cyan-hover); transform: scale(1.05); }
.player-btn-play svg { width: 22px; height: 22px; }

/* =============================================
   FULL SCREEN PLAYER
   ============================================= */
.player-fullscreen {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #001a2e 0%, #121212 60%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-fullscreen.hidden {
  transform: translateY(100%);
}

.pf-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  gap: 1rem;
}

.pf-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: color var(--transition);
}
.pf-back svg { width: 24px; height: 24px; }
.pf-back:hover { color: var(--text); }

.pf-header-info {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
}

.pf-artwork {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
}

.pf-artwork img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 32px 64px rgba(0,0,0,0.6);
  background: var(--bg3);
}

.pf-song-info {
  padding: 0.75rem 1.5rem;
}

.pf-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.pf-artist {
  color: var(--text2);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.pf-progress {
  padding: 0.75rem 1.5rem;
}

.seek-bar {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.seek-bar::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  margin-top: -5px;
  cursor: pointer;
}

.seek-bar:active::-webkit-slider-thumb {
  background: var(--cyan);
  transform: scale(1.2);
}

.pf-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text2);
  margin-top: 0.5rem;
}

.pf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem 2rem;
}

.pf-btn {
  color: var(--text2);
  transition: color var(--transition);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-btn svg { width: 28px; height: 28px; }
.pf-btn:hover { color: var(--text); }

.pf-btn-play {
  width: 64px;
  height: 64px;
  background: var(--text);
  color: #000;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.pf-btn-play svg { width: 36px; height: 36px; }
.pf-btn-play:hover { background: var(--cyan-hover); transform: scale(1.04); }

/* =============================================
   PAGE HEADERS
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* =============================================
   ADD SONG BUTTON
   ============================================= */
.btn-add-song {
  width: 40px;
  height: 40px;
  background: var(--cyan);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-add-song svg { width: 24px; height: 24px; }
.btn-add-song:hover { background: var(--cyan-hover); transform: scale(1.05); }

/* =============================================
   SEARCH BAR
   ============================================= */
.search-bar {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text2);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  background: var(--bg3);
  border: none;
  border-radius: 50px;
  padding: 0.625rem 2.5rem 0.625rem 2.75rem;
  color: var(--text);
  font-size: 0.875rem;
  transition: background var(--transition);
}

.search-bar input:focus { background: var(--bg4); }
.search-bar input::placeholder { color: var(--text3); }

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition);
}
.search-clear svg { width: 18px; height: 18px; }
.search-clear:hover { color: var(--text); }

/* =============================================
   SONG LIST
   ============================================= */
.songs-count {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
  position: relative;
}

.song-item:hover { background: rgba(255,255,255,0.05); }
.song-item.playing { background: rgba(6, 182, 212, 0.1); }
.song-item.playing .song-title { color: var(--cyan); }

.song-thumb-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.song-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.song-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
}
.song-thumb-placeholder svg { width: 24px; height: 24px; }

.song-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  color: #fff;
}
.song-play-overlay svg { width: 24px; height: 24px; }

.song-item:hover .song-play-overlay { opacity: 1; }

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

.song-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.song-duration {
  font-size: 0.78rem;
  color: var(--text2);
}

.song-menu-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text2);
  opacity: 0;
  transition: all var(--transition);
}
.song-menu-btn svg { width: 20px; height: 20px; }
.song-item:hover .song-menu-btn { opacity: 1; }
.song-menu-btn:hover { color: var(--text); background: var(--bg4); }

/* Always show on mobile */
@media (max-width: 767px) {
  .song-menu-btn { opacity: 1; }
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text2);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--text3);
}

.empty-state p { font-size: 1.1rem; font-weight: 600; }
.empty-sub { font-size: 0.875rem; margin-top: 0.5rem; font-weight: 400; }

/* =============================================
   CONTEXT MENU
   ============================================= */
.context-menu {
  position: fixed;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.375rem;
  z-index: 300;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: popIn 0.1s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu.hidden { display: none; }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  width: 100%;
  color: var(--text);
  transition: background var(--transition);
}
.ctx-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.ctx-item:hover { background: rgba(255,255,255,0.1); }
.ctx-delete { color: var(--red); }
.ctx-delete:hover { background: rgba(226, 33, 52, 0.1); }

/* =============================================
   MODAL
   ============================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 480px) {
  .modal { align-items: center; }
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg2);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  animation: slideUp 0.3s ease;
}

@media (min-width: 480px) {
  .modal-content {
    border-radius: 16px;
    animation: fadeIn 0.2s ease;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h2 { font-size: 1.125rem; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text2);
  transition: all var(--transition);
}
.modal-close svg { width: 20px; height: 20px; }
.modal-close:hover { color: var(--text); background: var(--bg3); }

.modal-desc {
  font-size: 0.875rem;
  color: var(--text2);
  margin-bottom: 1rem;
}

/* =============================================
   ADD SONG STATUS
   ============================================= */
#add-song-status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

#add-song-status.status-loading {
  background: var(--bg3);
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#add-song-status.status-success {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--cyan);
}

#add-song-status.status-error {
  background: rgba(226, 33, 52, 0.15);
  border: 1px solid rgba(226, 33, 52, 0.3);
  color: #ff6b6b;
}

/* =============================================
   DASHBOARD
   ============================================= */
.profile-card {
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  margin: 0 auto 0.75rem;
  color: #000;
}

.profile-name {
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.profile-role {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}

.role-admin { background: rgba(255, 176, 0, 0.2); color: #ffb000; }
.role-user  { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.stat-value { font-size: 1.5rem; font-weight: 900; }
.stat-label { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }

.settings-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
  margin-bottom: 1rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-msg {
  font-size: 0.8rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: none;
}

.form-msg.show { display: block; }
.form-msg.ok { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.form-msg.err { background: rgba(226, 33, 52, 0.15); color: #ff6b6b; }

/* =============================================
   ADMIN PANEL
   ============================================= */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border);
}

.asc-value { font-size: 1.75rem; font-weight: 900; }
.asc-label { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }

.admin-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}

.admin-section-header h3 { margin-bottom: 0; }

.invite-result {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  margin-bottom: 1rem;
}

.invite-result label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
  display: block;
  margin-bottom: 0.5rem;
}

.invite-link-box {
  display: flex;
  gap: 0.5rem;
}

.invite-link-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.8rem;
  min-width: 0;
}

.btn-copy {
  width: 40px;
  height: 40px;
  background: var(--cyan);
  color: #000;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-copy svg { width: 18px; height: 18px; }
.btn-copy:hover { background: var(--cyan-hover); }

.invites-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table th, .admin-table td {
  padding: 0.5rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.admin-table tr.row-used td { color: var(--text3); }

.token-cell { font-family: monospace; font-size: 0.75rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-active { background: rgba(6,182,212,0.2); color: var(--cyan); }
.badge-used   { background: var(--bg3); color: var(--text3); }
.badge-admin  { background: rgba(255,176,0,0.2); color: #ffb000; }
.badge-user   { background: rgba(6,182,212,0.2); color: var(--cyan); }

.user-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-sm {
  width: 24px;
  height: 24px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  flex-shrink: 0;
}

.text-muted { color: var(--text2); font-size: 0.875rem; }

/* =============================================
   SEEK BAR — Fill Track via JS
   ============================================= */
.seek-bar {
  --fill: 0%;
  background: linear-gradient(to right, var(--cyan) var(--fill), var(--bg3) var(--fill));
  border-radius: 2px;
}

/* =============================================
   RESPONSIVE — Larger screens
   ============================================= */
@media (min-width: 768px) {
  #content-area { padding: 2rem; }
  .page-header h2 { font-size: 2.25rem; }
  .pf-artwork img { max-width: 400px; }
}
