/* =================================================
   AUTH PAGES — login / reset-password
================================================= */

.login-page,
.reset-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: 1rem;
}

.login-card,
.reset-card {
    width: 100%;
    max-width: 360px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-overlay);
    overflow: hidden;
}

.reset-card { max-width: 380px; }

.login-card-header,
.reset-card-header {
    padding: 1.25rem 1.5rem 1rem;
    background: var(--color-chrome);
    border-bottom: 2px solid var(--color-border-strong);
}

.login-card-header { text-align: center; }

.login-card-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.login-card-brand span { color: var(--color-primary); }

.reset-card-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin: 0 0 0.25rem;
}

.reset-card-brand span { color: var(--color-primary); }

.reset-card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

.login-card-body,
.reset-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-error,
.reset-error {
    padding: 0.5rem 0.75rem;
    background: rgba(196, 43, 28, 0.08);
    border: 1px solid rgba(196, 43, 28, 0.3);
    border-radius: var(--radius-sm);
    color: #c42b1c;
    font-size: 13px;
}

.reset-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: -0.5rem 0 0;
}

.login-card-footer {
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-chrome);
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

.login-card-footer a {
    color: var(--color-primary);
    font-weight: 500;
}

/* =================================================
   MUSIC INDEX — album tiles
================================================= */

.music-empty { color: var(--color-text-muted); padding: 2rem 0; }
.music-empty a { color: var(--color-primary); }

.album-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

@media (max-width: 480px) {
    .album-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.album-tile {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: var(--shadow-raised);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.album-tile:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-overlay);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--color-text);
}

.album-tile-art {
    aspect-ratio: 1 / 1;
    background: var(--color-chrome);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.album-tile-art svg { width: 52px; height: 52px; }

.album-tile-info {
    padding: 0.625rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.album-tile-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-tile-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.album-tile-year::before { content: "·"; margin-right: 0.25rem; }

/* =================================================
   VIEW ALBUM — song list, file list, upload modal
================================================= */

.va-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
    overflow: hidden;
}

.va-panel-header {
    padding: 0.75rem 1rem;
    background: var(--color-chrome);
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.va-empty { color: var(--color-text-muted); font-size: 13px; padding: 1rem; margin: 0; }

.va-description {
    margin: 0 0 1.25rem;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.va-description:empty { display: none; }

.va-song-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: song-counter;
}

.va-song {
    counter-increment: song-counter;
    border-bottom: 1px solid var(--color-border);
}

.va-song:last-child { border-bottom: none; }

.va-song-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 14px;
}

.va-song-row::before {
    content: counter(song-counter);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.va-song-title  { flex: 1; font-weight: 500; }
.va-song-badges { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.va-song-genre {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 2px;
    background: var(--color-chrome);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.va-song-duration {
    font-size: 12px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

.va-upload-btn {
    font-size: 12px;
    padding: 0.2rem 0.6rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.va-song-row:hover .va-upload-btn { opacity: 1; }

@media (max-width: 480px) {
    .va-upload-btn { opacity: 1; }
    .va-song-genre { display: none; }
}

/* ── Song files ────────────────────────────────── */

.va-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.va-file {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 1rem 0.375rem 2.75rem;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.va-file:last-child { border-bottom: none; }

.va-file-type {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 2px;
    background: var(--color-primary);
    color: var(--color-primary-text);
    flex-shrink: 0;
    font-weight: 600;
}

.va-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-file-download { font-size: 11px; padding: 0.2rem 0.5rem; flex-shrink: 0; }

/* ── Upload modal ──────────────────────────────── */

dialog.va-modal {
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    padding: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-overlay);
    width: 360px;
    max-width: 92vw;
}

dialog.va-modal::backdrop { background: rgba(0, 0, 0, 0.45); }

.va-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-chrome);
    border-bottom: 1px solid var(--color-border);
}

.va-modal-title {
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.va-modal-song { font-weight: 400; color: var(--color-text-muted); }

.va-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--color-text-muted);
    padding: 0 0.25rem;
    flex-shrink: 0;
}

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

.va-modal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.va-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.va-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.va-modal-body select,
.va-modal-body input[type="text"],
.va-modal-body input[type="file"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: border-color var(--transition);
}

.va-modal-body select:focus,
.va-modal-body input[type="text"]:focus,
.va-modal-body input[type="file"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.va-modal-body select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath stroke='%23616161' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.va-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-chrome);
}

/* =================================================
   BAND MANAGE
================================================= */

.bm-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 860px) {
    .bm-layout { grid-template-columns: 1fr; }
}

.bm-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
    overflow: hidden;
}

.bm-panel-header {
    padding: 0.75rem 1rem;
    background: var(--color-chrome);
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.bm-panel-body { padding: 1rem; }

.bm-members { display: flex; flex-direction: column; }
.bm-empty { color: var(--color-text-muted); font-size: 13px; padding: 1rem; margin: 0; }

.bm-member { border-bottom: 1px solid var(--color-border); }
.bm-member:last-child { border-bottom: none; }

.bm-member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.bm-member-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.bm-member-name  { font-weight: 600; font-size: 14px; }
.bm-member-email { font-size: 12px; color: var(--color-text-muted); }
.bm-member-meta  { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.bm-role {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bm-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 2px;
}

.bm-badge.full       { background: rgba(0, 120, 212, 0.1); color: var(--color-primary); border: 1px solid rgba(0, 120, 212, 0.25); }
.bm-badge.restricted { background: rgba(196, 43, 28, 0.08); color: #c42b1c; border: 1px solid rgba(196, 43, 28, 0.25); }

.bm-permissions > summary {
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.bm-permissions > summary::after        { content: " ▸"; }
.bm-permissions[open] > summary::after  { content: " ▾"; }
.bm-permissions > summary:hover         { color: var(--color-primary); }

.bm-perm-form {
    padding: 0.875rem 1rem;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.bm-restrict-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bm-perm-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.bm-perm-group { display: flex; flex-direction: column; gap: 0.375rem; }

.bm-perm-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.125rem;
}

.bm-perm-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    cursor: pointer;
}

.bm-perm-actions { display: flex; align-items: center; gap: 0.5rem; }

.bm-add-form { display: flex; gap: 0.5rem; }

.bm-add-form input {
    flex: 1;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.bm-add-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* =================================================
   CREATE FORMS — create album / create song
================================================= */

.music-create-album,
.music-create-song {
    max-width: 640px;
}

.music-create-album h1,
.music-create-song h1 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.songs-section { margin-top: 1.5rem; }

.songs-section h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.hint {
    margin: 0 0 1rem;
    font-size: 13px;
    color: var(--color-text-muted);
}

.song-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 540px) {
    .song-row { grid-template-columns: 1fr; }
}