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

:root {
    --bg: #0f0f14;
    --surface: #1a1a24;
    --surface2: #24243a;
    --accent: #7c5cfc;
    --accent-hover: #9b7fff;
    --text: #e8e8f0;
    --text-dim: #8888a0;
    --success: #4ade80;
    --error: #f87171;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Layout */
.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    margin-bottom: 40px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-row > div:first-child { text-align: center; flex: 1; }

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #ff6bca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-dim);
    margin-top: 6px;
}

/* ─── Auth Screen ──────────────────────────────────────────────────────────── */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #ff6bca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.auth-form .generate-btn { width: 100%; margin-top: 8px; }

.auth-error {
    color: var(--error);
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 4px;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }

/* ─── User Menu ────────────────────────────────────────────────────────────── */

.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--surface2);
    background: var(--surface2);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
    padding: 0;
}

.user-avatar-btn:hover { border-color: var(--accent); }

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-initial {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background: var(--surface);
    border: 1px solid var(--surface2);
    border-radius: var(--radius);
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 100;
    overflow: hidden;
}

.user-dropdown.visible { display: block; }

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--surface2);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-header strong { font-size: 0.95rem; }
.user-dropdown-header .text-dim { font-size: 0.8rem; color: var(--text-dim); }

.user-dropdown button {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.user-dropdown button:hover { background: var(--surface2); }
.user-dropdown button:last-child:hover { color: var(--error); }

/* ─── Profile Modal extras ─────────────────────────────────────────────────── */

.profile-avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface2);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img-lg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-initial-lg {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-divider {
    border: none;
    border-top: 1px solid var(--surface2);
    margin: 24px 0;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

input[type="password"]:focus { border-color: var(--accent); }
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

input[type="email"]:focus { border-color: var(--accent); }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tab.active {
    background: var(--accent);
    color: white;
}

/* Form */
.form-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="text"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

input[type="text"]:focus, textarea:focus {
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.field { margin-bottom: 16px; }

.row {
    display: flex;
    gap: 16px;
}

.row .field { flex: 1; }

/* Duration selector */
.duration-options {
    display: flex;
    gap: 8px;
}

.duration-btn {
    flex: 1;
    padding: 10px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.duration-btn.active {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.15);
}

/* Radio group (vocal gender) */
.radio-group {
    display: flex;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.radio-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.15);
}

.radio-option input[type="radio"] { margin: 0; cursor: pointer; }
.radio-option span { font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* Checkbox (instrumental) */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.15);
}

.checkbox-label input[type="checkbox"] { margin: 0; cursor: pointer; width: 16px; height: 16px; }
.checkbox-label span { font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* Disabled gender field (when instrumental is checked) */
.field.disabled { opacity: 0.35; pointer-events: none; }

/* Genre picker */
.genre-picker {
    max-height: 340px;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.genre-picker::-webkit-scrollbar { width: 6px; }
.genre-picker::-webkit-scrollbar-track { background: transparent; }
.genre-picker::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

.genre-category { border-bottom: 1px solid var(--surface2); padding-bottom: 8px; }
.genre-category:last-child { border-bottom: none; padding-bottom: 0; }

.genre-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.genre-category-title:hover { color: var(--text); }

.genre-toggle {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.genre-category.collapsed .genre-chips { display: none; }
.genre-category.collapsed .genre-toggle { transform: rotate(-90deg); }

.genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 8px;
}

.genre-chip {
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--surface2);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.genre-chip:hover {
    border-color: var(--accent);
    color: var(--text);
}

.genre-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* Generate button */
.generate-btn {
    flex: 1;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #9b5cfc);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.generate-btn:hover { opacity: 0.9; }
.generate-btn:active { transform: scale(0.98); }
.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Clear button */
.clear-btn {
    padding: 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
}

/* Progress */
.progress-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: none;
}

.progress-section.visible { display: block; }

.progress-bar-track {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6bca);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s;
}

.progress-bar-fill.indeterminate {
    width: 40%;
    animation: slide 1.5s ease-in-out infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.progress-message {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Player */
.player-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: none;
}

.player-section.visible { display: block; }

.player-section audio {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 8px;
}

.download-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.download-btn:hover {
    background: var(--accent);
    color: white;
}

/* Lyrics preview */
.lyrics-preview {
    background: var(--surface2);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    white-space: pre-wrap;
    font-size: 0.85rem;
    color: var(--text-dim);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.lyrics-preview.visible { display: block; }

/* Song history */
.history-section {
    margin-top: 40px;
}

.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.song-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.song-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

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

.edit-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0;
}

.song-card:hover .edit-btn { opacity: 1; }
.edit-btn:hover { color: var(--accent); background: var(--surface2); }

.song-title-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.title-input {
    flex: 1;
    padding: 4px 8px;
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.edit-save-btn, .edit-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.edit-save-btn { color: var(--success); }
.edit-save-btn:hover { background: rgba(74, 222, 128, 0.15); }
.edit-cancel-btn { color: var(--error); }
.edit-cancel-btn:hover { background: rgba(248, 113, 113, 0.15); }

.song-info .prompt-text {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info .meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.song-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    border: none;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
    text-decoration: none;
}

.icon-btn:hover { background: var(--accent); }
.icon-btn.delete-btn:hover { background: var(--error); }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.visible { display: flex; }

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--surface2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover { background: var(--surface2); color: var(--text); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cancel-btn {
    flex: 1;
    padding: 14px;
    background: var(--surface2);
    border: 1px solid var(--text-dim);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover { border-color: var(--text); }

/* Lyrics modal */
.lyrics-tags {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--surface2);
}

.lyrics-text {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
}

/* ─── Playlists ─────────────────────────────────────────────────────────────── */

.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.playlists-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

.create-playlist-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent), #9b5cfc);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.create-playlist-btn:hover { opacity: 0.9; }

.playlists-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playlist-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.playlist-card:hover {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.08);
}

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

.playlist-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.playlist-description {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.playlist-arrow {
    font-size: 1.6rem;
    color: var(--text-dim);
    margin-left: 16px;
}

/* Playlist detail */
.playlist-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.playlist-detail-actions {
    display: flex;
    gap: 8px;
}

.back-btn {
    padding: 10px 16px;
    background: var(--surface);
    border: none;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover { background: var(--accent); }

.playlist-detail-info {
    margin-bottom: 24px;
}

.playlist-detail-info h3 {
    font-size: 1.6rem;
    margin: 0 0 8px 0;
}

.playlist-songs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-song-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.playlist-song-card.now-playing {
    background: var(--surface2);
    border-color: var(--accent);
}

.playlist-song-card.now-playing .song-position {
    color: var(--accent);
}

.song-position {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 24px;
    text-align: center;
}

/* Add to playlist modal */
.add-to-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-option {
    width: 100%;
    padding: 16px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    font-family: inherit;
}

.playlist-option:hover {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.1);
}

.playlist-option-name { font-weight: 600; font-size: 1rem; }
.playlist-option-count { font-size: 0.85rem; color: var(--text-dim); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.complete { background: rgba(74, 222, 128, 0.2); color: var(--success); }
.status-badge.failed { background: rgba(248, 113, 113, 0.2); color: var(--error); }
.status-badge.pending { background: rgba(124, 92, 252, 0.2); color: var(--accent); }

/* ─── Suspended Banner ────────────────────────────────────────────────────── */

.suspended-banner {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    color: var(--error);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

/* ─── Admin Section ───────────────────────────────────────────────────────── */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-user-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.admin-user-card.suspended {
    opacity: 0.6;
    border-color: var(--error);
}

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

.admin-user-name {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(124, 92, 252, 0.2);
    color: var(--accent);
}

.suspended-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
}

.admin-user-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
    align-items: center;
}

.admin-action-btn {
    padding: 6px 14px;
    border: 1px solid var(--text-dim);
    border-radius: 6px;
    background: none;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.admin-action-btn.suspend:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
}

.admin-action-btn.unsuspend:hover {
    border-color: var(--success);
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

.admin-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
    cursor: pointer;
}

.admin-select:focus { border-color: var(--accent); }

/* ─── Primary Admin Badge ─────────────────────────────────────────────────── */

.primary-admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

/* ─── Genre badges & Primary genre chip ───────────────────────────────────── */

.genre-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.genre-chip.primary-genre {
    background: linear-gradient(135deg, #ff6bca, #ff9f43);
    border-color: #ff6bca;
    color: #fff;
}

.genre-chips-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.required-star {
    color: var(--error);
    font-weight: 700;
}

/* ─── Unpublish toggle ────────────────────────────────────────────────────── */

.icon-btn.unpublished {
    opacity: 0.4;
}

/* ─── Browse Section ──────────────────────────────────────────────────────── */

.browse-header {
    margin-bottom: 24px;
}

.browse-header h2 {
    font-size: 1.4rem;
    margin: 0 0 4px 0;
}

.browse-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 0;
}

.browse-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.browse-genre-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.browse-genre-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    margin: 0;
}

.browse-songs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.browse-song-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
    border: 1px solid transparent;
}

.browse-song-card:hover {
    border-color: var(--surface2);
}

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

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

.browse-song-creator {
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 2px;
}

/* ─── Admin Sub-Tabs ─────────────────────────────────────────────────────── */

.admin-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--surface);
    border-radius: 8px;
    padding: 4px;
}

.admin-sub-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.admin-sub-tab.active {
    background: var(--surface2);
    color: var(--text);
}

.admin-sub-tab:hover:not(.active) { color: var(--text); }

.admin-panel { }

/* ─── Admin Reports ──────────────────────────────────────────────────────── */

.admin-reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-report-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.admin-report-card.upheld {
    border-color: var(--error);
    opacity: 0.7;
}

.admin-report-card.dismissed {
    opacity: 0.5;
}

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

.admin-report-song {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.admin-report-reason {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 4px;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.admin-report-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
    align-items: center;
}

.report-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.report-status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.report-status-badge.dismissed {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.report-status-badge.upheld {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
}

/* ─── Settings Form ──────────────────────────────────────────────────────── */

.settings-form {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
}

.settings-form input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

.settings-form input[type="number"]:focus { border-color: var(--accent); }

/* ─── Report Button (browse cards) ───────────────────────────────────────── */

.icon-btn.report-btn:hover {
    background: #f59e0b;
    color: #000;
}

/* ─── Report Modal ───────────────────────────────────────────────────────── */

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-reason-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface2);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-reason-option:has(input:checked) {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.report-reason-option input[type="radio"] { margin: 0; cursor: pointer; }
.report-reason-option span { font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* ─── Toast Notifications ────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    pointer-events: auto;
    animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in forwards;
    animation-delay: 0s, 2.7s;
    max-width: 360px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.toast.success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.toast.info {
    background: linear-gradient(135deg, var(--accent), #9b5cfc);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}
