/* =============================================
   EMMTify — Dark Music App CSS
   Aesthetic: Deep dark, emerald accents, editorial
   Fonts: Syne (display) + DM Sans (body)
============================================= */

:root {
  --bg:        #080b10;
  --bg-2:      #0e1219;
  --bg-3:      #141922;
  --bg-4:      #1c2333;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --text:      #e8edf5;
  --text-2:    #8b95a8;
  --text-3:    #556070;
  --accent:    #6EE7B7;
  --accent-2:  #34d399;
  --accent-dim:#1a4a3a;
  --danger:    #f87171;
  --warn:      #fbbf24;
  --blue:      #60a5fa;
  --purple:    #a78bfa;
  --player-h:  76px;
  --sidebar-w: 240px;
  --radius:    10px;
  --radius-lg: 16px;
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* =================== APP LAYOUT =================== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas: "sidebar main" "sidebar player";
  height: 100vh;
  overflow: hidden;
}

/* =================== SIDEBAR =================== */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar__title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar__nav {
  padding: 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar__link:hover { background: var(--bg-3); color: var(--text); }
.sidebar__link.active { background: var(--accent-dim); color: var(--accent); }
.sidebar__link.active svg { stroke: var(--accent); }
.sidebar__link--admin { color: var(--purple) !important; }
.sidebar__link--admin.active { background: rgba(167,139,250,0.15); }
.sidebar__divider { height: 1px; background: var(--border); margin: 8px 0; }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar__avatar {
  width: 34px; height: 34px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__username { display: block; font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__role { font-size: 0.75rem; color: var(--text-3); }

.sidebar__logout {
  color: var(--text-3);
  text-decoration: none;
  padding: 5px;
  border-radius: 6px;
  transition: color 0.15s;
}
.sidebar__logout:hover { color: var(--danger); }

/* =================== MOBILE HEADER =================== */
.mobile-header { display: none; }

/* =================== MAIN CONTENT =================== */
.main-content {
  grid-area: main;
  overflow-y: auto;
  background: var(--bg);
}

/* =================== PAGE =================== */
.page { padding: 32px 36px; max-width: 1100px; }
.page--narrow { max-width: 540px; }

.page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page__title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page__subtitle { color: var(--text-2); font-size: 0.9rem; margin-top: 4px; }

/* =================== PLAYER =================== */
.player {
  grid-area: player;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
}

.player__track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
  flex-shrink: 0;
}

.player__thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-4);
  flex-shrink: 0;
}

.player__title {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__artist { display: block; font-size: 0.78rem; color: var(--text-2); }

.player__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player__btn {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.player__btn:hover { color: var(--text); background: var(--bg-3); }
.player__btn--play {
  width: 40px; height: 40px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
}
.player__btn--play:hover { background: var(--accent-2); }
.player__btn--sm { padding: 6px; }

.player__progress-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player__time { font-size: 0.75rem; color: var(--text-3); width: 32px; text-align: center; flex-shrink: 0; }

.player__progress {
  flex: 1;
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.player__progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}
.player__progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, left 0.1s linear;
}
.player__progress:hover .player__progress-thumb { opacity: 1; }

.player__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.player__volume { display: flex; align-items: center; gap: 6px; }
.player__vol-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--bg-4);
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn--primary { background: var(--accent); color: #000; }
.btn--primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.btn--ghost:hover { border-color: var(--text-2); color: var(--text); }
.btn--full { width: 100%; justify-content: center; }
.btn--danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.btn--danger:hover { background: rgba(248,113,113,0.25); }

/* =================== FORMS =================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; color: var(--text-2); margin-bottom: 6px; font-weight: 500; letter-spacing: 0.02em; }
.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,231,183,0.1); }
.form-input::placeholder { color: var(--text-3); }

.input-with-icon { position: relative; }
.input-with-icon .form-input { padding-right: 42px; }
.input-icon-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3);
  display: flex; align-items: center;
}
.input-icon-btn:hover { color: var(--text-2); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: 20px;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--accent); }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-2);
}
.toggle-input { display: none; }
.toggle-switch {
  width: 38px; height: 22px;
  background: var(--bg-4);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: var(--text-3);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: all 0.2s;
}
.toggle-input:checked + .toggle-switch { background: var(--accent-dim); }
.toggle-input:checked + .toggle-switch::after { background: var(--accent); left: 19px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* =================== SEARCH BAR =================== */
.search-bar-wrap { margin-bottom: 24px; }
.search-bar-wrap--sm .search-bar { max-width: 480px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,231,183,0.08); }
.search-bar svg { color: var(--text-3); flex-shrink: 0; }
.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 14px 0;
}
.search-bar__input::placeholder { color: var(--text-3); }
.search-bar__clear {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 1.3rem; padding: 4px; line-height: 1;
}
.search-bar__clear:hover { color: var(--text); }

/* =================== TRACK CARDS =================== */
.tracks-grid { display: flex; flex-direction: column; gap: 2px; }

.track-card {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  group: true;
}
.track-card:hover { background: var(--bg-2); }
.track-card.playing { background: rgba(110,231,183,0.06); }

.track-card__thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-4);
  flex-shrink: 0;
}

.track-card__info { min-width: 0; }
.track-card__title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.track-card.playing .track-card__title { color: var(--accent); }
.track-card__artist { font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }
.track-card__dur { font-size: 0.8rem; color: var(--text-3); flex-shrink: 0; min-width: 36px; text-align: right; }
.track-card__owner { font-size: 0.78rem; color: var(--text-3); white-space: nowrap; }

.track-card__actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.track-card:hover .track-card__actions { opacity: 1; }

.track-action-btn {
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.track-action-btn:hover { background: var(--bg-3); color: var(--text); }
.track-action-btn.active { color: var(--accent); }
.track-action-btn.danger:hover { color: var(--danger); }

/* =================== SEARCH RESULTS =================== */
.search-results { display: flex; flex-direction: column; gap: 3px; }

.search-result {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.1s;
}
.search-result:hover { background: var(--bg-2); }

.search-result__thumb {
  width: 60px; height: 42px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-4);
}

.search-result__info { min-width: 0; }
.search-result__title { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result__meta { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }

.search-result__add {
  background: var(--accent-dim);
  border: none;
  color: var(--accent);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-result__add:hover { background: var(--accent); color: #000; }
.search-result__add:disabled { opacity: 0.5; cursor: not-allowed; }
.search-result__add.done { background: rgba(52,211,153,0.1); color: var(--text-3); }

/* =================== EMPTY/LOADING STATES =================== */
.loading-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty-state__icon {
  width: 64px; height: 64px;
  background: var(--bg-3);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-3);
}
.empty-state h3 { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; color: var(--text-3); }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== LIBRARY STATS =================== */
.library-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-pill {
  padding: 5px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-2);
}
.stat-pill strong { color: var(--text); }

/* =================== FILTER BTNS =================== */
.track-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
#localSearch { flex: 1; max-width: 280px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; color: var(--text); font-size: 0.875rem; outline: none; transition: border-color 0.15s; }
#localSearch:focus { border-color: var(--accent); }
.filter-btns { display: flex; gap: 4px; }
.filter-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 14px; color: var(--text-2); font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
.filter-btn.active, .filter-btn:hover { background: var(--bg-3); border-color: var(--border-2); color: var(--text); }
.filter-btn.active { border-color: var(--accent); color: var(--accent); }

/* =================== MODAL =================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 480px;
  animation: slideUp 0.2s ease;
}
.modal--sm { max-width: 360px; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal__title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; }
.modal__close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 4px; }
.modal__close:hover { color: var(--text); }
.modal__body { padding: 20px 24px; }
.modal__body--center { text-align: center; }
.modal__footer { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 20px; }

.convert-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-3);
  border-radius: 8px;
  margin-bottom: 16px;
}
.convert-preview img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; }
.convert-preview__title { font-size: 0.85rem; color: var(--text-2); }

/* =================== PROGRESS RING =================== */
.convert-progress { padding: 20px 0; }
.progress-ring { position: relative; width: 80px; height: 80px; margin: 0 auto 20px; }
.progress-ring__icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.progress-label { font-weight: 500; margin-bottom: 4px; }
.progress-sub { font-size: 0.82rem; color: var(--text-3); }

@keyframes rotateRing {
  0% { stroke-dashoffset: 213.6; }
  50% { stroke-dashoffset: 53; }
  100% { stroke-dashoffset: 213.6; }
}
#progressCircle { animation: rotateRing 2s ease-in-out infinite; }

/* =================== ADMIN STATS =================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 28px; }

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card__icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon--blue { background: rgba(96,165,250,0.15); color: var(--blue); }
.stat-card__icon--green { background: rgba(110,231,183,0.15); color: var(--accent); }
.stat-card__icon--purple { background: rgba(167,139,250,0.15); color: var(--purple); }
.stat-card__icon--orange { background: rgba(251,191,36,0.15); color: var(--warn); }
.stat-card__num { display: block; font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-card__label { font-size: 0.8rem; color: var(--text-2); margin-top: 3px; }

/* =================== ADMIN TABLES =================== */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-section { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-section__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.admin-section__header h3 { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; }
.admin-section__link { font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.admin-section__link:hover { color: var(--accent-2); }
.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table--full { min-width: 680px; }
.admin-table th { padding: 11px 14px; text-align: left; color: var(--text-3); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg-3); }

.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell__avatar { width: 28px; height: 28px; background: var(--bg-4); color: var(--text-2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.user-cell__avatar--admin { background: var(--accent-dim); color: var(--accent); }
.track-cell { display: flex; align-items: center; gap: 8px; }
.track-cell__thumb { width: 32px; height: 24px; border-radius: 3px; object-fit: cover; background: var(--bg-4); flex-shrink: 0; }

.text-muted { color: var(--text-2); }

/* =================== BADGES =================== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge--active { background: rgba(110,231,183,0.15); color: var(--accent); }
.badge--inactive { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge--admin { background: rgba(167,139,250,0.15); color: var(--purple); }
.badge--user { background: var(--bg-4); color: var(--text-2); }
.badge--public { background: rgba(96,165,250,0.15); color: var(--blue); }
.badge--private { background: var(--bg-4); color: var(--text-3); }

/* =================== ACTION BUTTONS =================== */
.action-btns { display: flex; gap: 4px; }
.action-btn {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  padding: 6px;
  border-radius: 5px;
  display: flex; align-items: center;
  transition: all 0.15s;
}
.action-btn--toggle:hover { background: rgba(110,231,183,0.1); color: var(--accent); }
.action-btn--delete:hover { background: rgba(248,113,113,0.1); color: var(--danger); }

/* =================== PAGINATION =================== */
.pagination { display: flex; gap: 5px; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.page-btn.active, .page-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.page-ellipsis { padding: 7px 8px; color: var(--text-3); font-size: 0.85rem; }

/* =================== FLASH MESSAGES =================== */
.flash-container {
  position: fixed;
  bottom: calc(var(--player-h) + 12px);
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  font-size: 0.875rem;
  animation: slideUp 0.2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.flash--success { border-left: 3px solid var(--accent); }
.flash--error { border-left: 3px solid var(--danger); }
.flash--info { border-left: 3px solid var(--blue); }
.flash__icon { font-weight: 700; flex-shrink: 0; }
.flash--success .flash__icon { color: var(--accent); }
.flash--error .flash__icon { color: var(--danger); }
.flash__msg { flex: 1; }
.flash__close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px; margin-left: auto; }

/* =================== AUTH PAGE =================== */
.auth-page {
  background: var(--bg);
}

.auth-container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-deco {
  background: linear-gradient(135deg, #080b10 0%, #0a1628 60%, #0d2320 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-deco__circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110,231,183,0.08) 0%, transparent 70%);
}
.auth-deco__circle--1 { width: 500px; height: 500px; top: -100px; right: -100px; }
.auth-deco__circle--2 { width: 300px; height: 300px; bottom: -50px; left: -80px; }

.auth-brand { text-align: center; z-index: 1; }
.auth-brand__logo { margin-bottom: 16px; }
.auth-brand__name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  letter-spacing: -0.04em;
  color: var(--text);
}
.auth-brand__tagline { color: var(--text-3); font-size: 1rem; margin-top: 6px; }

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  max-width: 440px;
  margin: auto;
  width: 100%;
}
.auth-card__title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth-card__sub { color: var(--text-3); font-size: 0.9rem; margin-bottom: 32px; }
.auth-card__footer { text-align: center; color: var(--text-3); font-size: 0.875rem; margin-top: 20px; }
.auth-card__footer a { color: var(--accent); text-decoration: none; }
.auth-card__footer a:hover { color: var(--accent-2); }

.auth-form .btn--primary { margin-top: 4px; font-size: 0.95rem; padding: 12px; }

/* =================== TOAST (JS-triggered) =================== */
.toast-container {
  position: fixed;
  bottom: calc(var(--player-h) + 12px);
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .auth-container { grid-template-columns: 1fr; }
  .auth-deco { display: none; }
  .auth-card { padding: 40px 28px; max-width: 100%; }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr var(--player-h);
    grid-template-areas: "header" "main" "player";
  }
  .sidebar { display: none; position: fixed; left: 0; top: 56px; bottom: var(--player-h); width: 260px; z-index: 500; }
  .sidebar.open { display: flex; }
  .mobile-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
  }
  .mobile-menu-btn {
    background: none; border: none;
    display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px;
  }
  .mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.2s; }
  .mobile-brand { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; }
  .mobile-avatar { width: 30px; height: 30px; background: var(--accent-dim); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
  .page { padding: 20px 16px; }
  .player { padding: 0 12px; gap: 10px; }
  .player__track { width: auto; flex: 1; min-width: 0; }
  .player__right { display: none; }
  .player__progress-area { display: none; }
  .player__meta { min-width: 0; }
  .page__title { font-size: 1.5rem; }
}
