:root {
    --bg-dark: #010517;
    --bg-sidebar: #010517;
    --bg-card: #050E22;
    --bg-card-hover: #273449;
    --border: #171D36;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --accent-purple: #a855f7;
    --sidebar-width: 260px;
    --nav-accent: #c48eff;
    --nav-accent-from: #d442f5;
    --nav-accent-to: #3a21d1;
    --nav-active-bg: #0d0b21;
    --table-row-stripe: rgba(255, 255, 255, .03);
}

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

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

a { color: var(--primary-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b1120 0%, #1e1b4b 50%, #0b1120 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.app-logo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.app-logo--login {
    max-height: 72px;
}

.sidebar-logo a {
    display: block;
    text-decoration: none;
}

.sidebar-logo .app-logo {
    max-height: 44px;
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    margin-bottom: .25rem;
    color: var(--text-muted);
    border-radius: 12px;
    transition: color .2s, background .2s, box-shadow .2s;
    text-decoration: none;
}

.nav-item > * {
    position: relative;
    z-index: 1;
}

.nav-item:hover,
.nav-item.active {
    color: var(--nav-accent);
    background: var(--nav-active-bg);
    text-decoration: none;
    box-shadow:
        0 0 14px rgba(212, 66, 245, .22),
        0 0 6px rgba(58, 33, 209, .18);
}

.nav-item:hover::before,
.nav-item.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--nav-accent-from) 0%, var(--nav-accent-to) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.nav-item:hover::after,
.nav-item.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at center, rgba(212, 66, 245, .1) 0%, transparent 70%);
    pointer-events: none;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(196, 142, 255, .35));
}

.nav-item:hover svg,
.nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(212, 66, 245, .45));
}

.sidebar-footer {
    padding: 1rem .75rem;
    border-top: 1px solid var(--border);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: .5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}

.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .9rem;
    line-height: 1;
    color: #fff;
    flex-shrink: 0;
}

.user-details .name { font-weight: 600; font-size: .9rem; }
.user-details .role { font-size: .75rem; color: var(--text-muted); }

.page-content { padding: 1.5rem; flex: 1; }

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

.page-header h1 { font-size: 1.5rem; font-weight: 600; }

/* Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.kpi-card .label { color: var(--text-muted); font-size: .85rem; margin-bottom: .5rem; }
.kpi-card .value { font-size: 1.75rem; font-weight: 700; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 1rem; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .875rem;
    color: var(--text-muted);
}

.form-control, .form-select {
    width: 100%;
    padding: .6rem .85rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: .9rem;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.form-check { display: flex; align-items: center; gap: .5rem; }

.song-auto-artist-check {
    margin-top: .65rem;
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }
.btn-warning { background: var(--warning); color: #1a1200; }
.btn-warning:hover { background: #d97706; color: #1a1200; text-decoration: none; }

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* Tables */
.table-responsive { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

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

table th {
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

table tbody tr:nth-child(even) {
    background: var(--table-row-stripe);
}

table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-row-clickable {
    cursor: pointer;
}

.song-allowed-row {
    cursor: pointer;
}

.table-link {
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: 500;
}

.table-link:hover {
    text-decoration: underline;
}

.table-filter-link {
    color: var(--text-muted);
    text-decoration: none;
}

.table-filter-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.table-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.table-filters .form-group {
    flex: 1 1 180px;
    min-width: 180px;
    margin-bottom: 0;
}

.table-filters__actions {
    flex: 0 0 auto;
    min-width: auto;
}

.table-filters__buttons {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap;
    min-height: 42px;
}

.table-filters__buttons .btn {
    white-space: nowrap;
}

.songs-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.songs-bulk-check-cell {
    vertical-align: middle;
    text-align: center;
}

.songs-bulk-check-cell input[type="checkbox"],
#selectAllSongs {
    width: 1.05rem;
    height: 1.05rem;
    cursor: pointer;
}

.song-upload-log {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    max-height: 220px;
    overflow-y: auto;
}

.song-upload-log:empty {
    display: none;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.song-upload-log__item {
    margin: 0 0 .4rem;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.song-upload-log__item--error {
    color: #e74c3c;
}

.song-upload-log__item--success {
    color: #27ae60;
}

.song-upload-log__item--info {
    color: #3498db;
}

.allowed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .5rem 1rem;
}

.allowed-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
    font-size: .9rem;
    cursor: pointer;
}

.allowed-item input {
    flex-shrink: 0;
}

.allowed-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.song-player {
    width: 100%;
    max-width: 520px;
}

.song-player-bar {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .25);
}

.song-player-bar .song-player-bar__media {
    width: min(420px, 50vw);
    max-height: 120px;
}

.song-player-bar audio.song-player-bar__media {
    height: 36px;
}

.song-player-bar video.song-player-bar__video {
    height: auto;
    max-height: 120px;
    background: #000;
}

.song-player--video {
    max-width: 640px;
    width: 100%;
    background: #000;
}

.media-type-icon--video {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    margin-left: 0.35em;
    vertical-align: -0.12em;
    opacity: 0.88;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M23 7l-7 5 7 5V7z'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M23 7l-7 5 7 5V7z'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.media-type-icon--video[hidden] {
    display: none !important;
    width: 0;
    height: 0;
    margin: 0;
    mask: none;
    -webkit-mask: none;
}

.song-player-bar__label {
    flex: 1;
    color: var(--text-muted);
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-player-bar__error {
    flex: 1 1 100%;
    margin: 0;
    font-size: .82rem;
    color: var(--warning);
    line-height: 1.35;
}

.song-playback-hint {
    margin: 0 0 1rem;
    padding: .65rem .85rem;
    font-size: .85rem;
    line-height: 1.45;
    color: var(--text-muted);
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: 8px;
}

.song-playback-error {
    margin: .75rem 0 0;
    font-size: .85rem;
    color: var(--warning);
}

.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
}

.badge-success { background: rgba(34,197,94,.2); color: var(--success); }
.badge-danger { background: rgba(239,68,68,.2); color: var(--danger); }
.badge-info { background: rgba(99,102,241,.2); color: var(--primary-hover); }

/* Alerts */
.alert {
    padding: .85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .875rem;
}

.alert-success { background: rgba(34,197,94,.15); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid var(--danger); color: var(--danger); }

.text-danger { color: var(--danger); font-size: .8rem; margin-top: .25rem; }

/* Dropzone */
.dropzone.dz-clickable {
    cursor: pointer;
}

.dropzone.dz-started .dz-message {
    display: none;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-dark);
    cursor: pointer;
    transition: all .2s;
    min-height: 140px;
}

.dropzone:hover,
.dropzone.dz-drag-hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, .08);
}

.dropzone .dz-message {
    color: var(--text-muted);
    margin: 2em 0;
}

.dropzone .dz-message strong {
    color: var(--primary-hover);
}

.dropzone .dz-preview {
    display: inline-block;
    position: relative;
    margin: .5rem;
    vertical-align: top;
    min-height: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dropzone .dz-image {
    width: 120px;
    height: 120px;
    display: block;
    overflow: hidden;
    background: var(--bg-dark);
    border-radius: 8px 8px 0 0;
}

.dropzone .dz-details {
    opacity: 1;
    position: relative;
    padding: .5rem;
    background: var(--bg-card);
    color: var(--text);
    font-size: .8rem;
}

.dropzone .dz-size,
.dropzone .dz-filename span {
    background: rgba(5, 14, 34, .85);
    color: var(--text);
    padding: 0 .25rem;
    border-radius: 4px;
}

.dropzone .dz-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone .dz-progress {
    display: block;
    height: 6px;
    margin-top: .5rem;
    background: var(--border);
    border: none;
    border-radius: 999px;
    overflow: hidden;
}

.dropzone .dz-progress .dz-upload {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary);
}

.dropzone .dz-success-mark,
.dropzone .dz-error-mark {
    display: none;
}

.dropzone .dz-remove {
    display: block;
    margin-top: .35rem;
    color: var(--danger);
    text-decoration: none;
    font-size: .8rem;
}

.dropzone .dz-remove:hover {
    text-decoration: underline;
}

.dropzone .dz-error-message {
    display: none;
    background: rgba(239, 68, 68, .9);
    color: #fff;
    font-size: .75rem;
    padding: .35rem .5rem;
    border-radius: 4px;
    margin-top: .35rem;
}

.dropzone .dz-preview.dz-error .dz-error-message {
    display: block;
}

.dropzone.dropzone--song-list {
    padding: 1rem 1.15rem;
    text-align: left;
    min-height: 120px;
}

.dropzone.dropzone--song-list.dz-started {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: auto;
}

.dropzone.dropzone--song-list .dz-preview,
.dropzone.dropzone--song-list .song-upload-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: .65rem .85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
}

.dropzone.dropzone--song-list .song-upload-row__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.dropzone.dropzone--song-list .dz-remove:not(.song-upload-row__hide) {
    display: none !important;
}

.dropzone.dropzone--song-list .dz-image {
    display: none !important;
}

.dropzone.dropzone--song-list .song-upload-row__info {
    flex: 1;
    min-width: 0;
}

.dropzone.dropzone--song-list .song-upload-row__name {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone.dropzone--song-list .song-upload-row__size {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    color: var(--text-muted);
}

.dropzone.dropzone--song-list .song-upload-row__size span {
    background: transparent;
    padding: 0;
}

.dropzone.dropzone--song-list .song-upload-row__progress-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin-top: .5rem;
}

.dropzone.dropzone--song-list .song-upload-row__progress {
    flex: 1;
    width: 100%;
    margin: 0;
    min-width: 0;
}

.dropzone.dropzone--song-list .song-upload-row__pct {
    flex-shrink: 0;
    min-width: 2.75rem;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    text-align: right;
}

.dropzone.dropzone--song-list .dz-preview:not(.dz-processing) .song-upload-row__progress-wrap,
.dropzone.dropzone--song-list .dz-preview.dz-complete .song-upload-row__progress-wrap,
.dropzone.dropzone--song-list .dz-preview.dz-success .song-upload-row__progress-wrap {
    display: none;
}

.dropzone.dropzone--song-list .song-upload-row__hide {
    flex-shrink: 0;
    margin: 0;
    text-decoration: none;
    white-space: nowrap;
}

.dropzone.dropzone--song-list .dz-details {
    display: none;
}

.dropzone.dropzone--song-list .dz-success .song-upload-row,
.dropzone.dropzone--song-list .dz-success.dz-preview {
    border-color: rgba(39, 174, 96, .45);
}

.dropzone.dropzone--song-list .dz-error .song-upload-row,
.dropzone.dropzone--song-list .dz-error.dz-preview {
    border-color: rgba(239, 68, 68, .55);
}

/* Pagination */
.table-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-top: 1rem;
}

.table-pagination-summary {
    margin: 0;
    margin-left: auto;
    color: var(--text-muted);
    font-size: .9rem;
    text-align: right;
}

.table-pagination-bar .pagination {
    margin-top: 0;
}

.pagination {
    display: flex;
    gap: .5rem;
    list-style: none;
    margin-top: 1rem;
}

.pagination a, .pagination span {
    padding: .4rem .75rem;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .85rem;
}

.pagination .active span { background: var(--primary); border-color: var(--primary); }

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .song-player-bar { left: 0; }
}

.artist-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    background: var(--bg-card-hover);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.artist-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.artist-thumb-preview-wrap {
    margin-bottom: 0.75rem;
}

.artist-thumb-preview {
    display: block;
    max-width: 300px;
    width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 14px;
    object-fit: contain;
    background: var(--bg-card-hover);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-thumb-preview--empty {
    width: 160px;
    height: 160px;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.artist-thumb-preview--wide {
    max-width: 480px;
    max-height: 240px;
    object-fit: cover;
}

.artist-thumb-preview-wrap--wide .artist-thumb-preview--empty {
    width: 100%;
    max-width: 480px;
    height: 180px;
}

.admin-table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: var(--bg-card-hover);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-toplist-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.admin-toplist-tab {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: color 0.15s ease;
}

.admin-toplist-tab:hover {
    color: var(--text);
}

.admin-toplist-tab.is-active {
    color: var(--accent, #7c5cff);
}

.admin-toplist-tab-sep {
    color: rgba(255, 255, 255, 0.18);
    font-weight: 700;
    user-select: none;
}

.admin-toplist-range-form {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-toplist-hint {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.fetch-covers-panel {
    margin-bottom: 1rem;
}

.fetch-covers-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.fetch-covers-panel-title {
    margin: 0;
    font-size: 1rem;
}

.fetch-covers-panel-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fetch-covers-log {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ezclassic-import-options {
    margin-bottom: 1rem;
}

.ezclassic-import-folder-select {
    max-width: 28rem;
    margin-bottom: 1rem;
}

.ezclassic-import-folder-select .form-hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ezclassic-auto-remove-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    cursor: pointer;
}

.ezclassic-auto-remove-check--nested {
    margin-left: 1.75rem;
    margin-bottom: 0;
}

.ezclassic-import-panel {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ezclassic-import-progress-wrap {
    margin-bottom: 1rem;
}

.ezclassic-import-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.ezclassic-import-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--nav-accent-from), var(--nav-accent-to));
    transition: width 0.25s ease;
}

.ezclassic-import-progress-text {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ezclassic-import-kpis {
    margin-bottom: 1rem;
}

.ezclassic-import-log-wrap {
    max-height: 520px;
    overflow-y: auto;
}

.settings-page {
    max-width: 720px;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
}

.settings-tab {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.65rem 1.1rem;
    margin-bottom: -1px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.settings-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.settings-tab.is-active {
    color: var(--text);
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.12);
    border-bottom-color: transparent;
    position: relative;
    z-index: 1;
}

.settings-card {
    min-width: 0;
    position: relative;
    z-index: 0;
    margin-bottom: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.settings-tab-panel:not(.is-active) {
    display: none;
}

.settings-tab-panel.is-active {
    display: block;
}

.settings-tab-panel .card-header {
    padding-top: 0;
}

.settings-test-email-block {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-doc-intro {
    max-width: 720px;
    margin: 0 0 1.25rem;
    color: var(--text-muted);
}

.admin-doc-toc {
    max-width: 720px;
    margin-bottom: 1.25rem;
}

.admin-doc-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
}

.admin-doc-toc-list a {
    color: var(--nav-accent-from, #7c5cff);
    text-decoration: none;
    font-weight: 600;
}

.admin-doc-toc-list a:hover {
    text-decoration: underline;
}

.admin-doc-section {
    max-width: 720px;
    min-width: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    scroll-margin-top: 1rem;
}

.admin-doc-section-title {
    margin: 0;
    font-size: 1.05rem;
}

.admin-doc-lead {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.admin-doc-label {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.admin-doc-code-wrap {
    margin-bottom: 1.25rem;
    min-width: 0;
}

.admin-doc-block {
    margin-bottom: 1.35rem;
    min-width: 0;
    max-width: 100%;
}

.admin-doc-block-title {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.admin-doc-hint {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.admin-doc-hint--spaced {
    margin-top: 0.85rem;
}

.admin-doc-footer-note {
    margin: 0.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.code-block {
    max-width: 100%;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.code-block__toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.code-block__copy {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
}

.code-block__pre {
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0.85rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.code-block__code {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-primary, #e8e8ef);
    white-space: pre;
    word-break: normal;
}

