/* Spotify Scraper Admin Panel - Main Stylesheet */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --bg-input: #16161f;
    --border-color: #2a2a3a;
    --border-light: #333345;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent: #00d4aa;
    --accent-hover: #00b894;
    --accent-light: rgba(0, 212, 170, 0.15);
    --success: #00d68f;
    --warning: #ffaa00;
    --danger: #ff3d71;
    --info: #0095ff;
    --sidebar-width: 72px;
    --sidebar-expanded: 240px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #12121a 50%, #0d1f1a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 149, 255, 0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #0095ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder { color: var(--text-muted); }

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control { padding-left: 44px; }

.input-icon-wrapper .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
}

.alert.show { display: block; }
.alert-error { background: rgba(255, 61, 113, 0.15); color: var(--danger); border: 1px solid rgba(255, 61, 113, 0.3); }
.alert-success { background: rgba(0, 214, 143, 0.15); color: var(--success); border: 1px solid rgba(0, 214, 143, 0.3); }

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.expanded { width: var(--sidebar-expanded); }

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    overflow: hidden;
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #0095ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    opacity: 0;
    transition: var(--transition);
}

.sidebar.expanded .sidebar-logo span { opacity: 1; }

.sidebar-logo .logo-mini {
    font-size: 22px;
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font);
    font-size: 14px;
    text-decoration: none;
    position: relative;
}

.nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }

.nav-item.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item i { font-size: 20px; min-width: 24px; text-align: center; }

.nav-item span {
    white-space: nowrap;
    opacity: 0;
    transition: var(--transition);
}

.sidebar.expanded .nav-item span { opacity: 1; }

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 20px;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar.expanded ~ .main-wrapper { margin-left: var(--sidebar-expanded); }

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover { color: var(--text-primary); background: var(--bg-card); }

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition);
}

.header-btn:hover { color: var(--text-primary); background: var(--bg-card); }
.header-btn.active { color: var(--accent); background: var(--accent-light); }

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 8px;
    height: 8px;
    padding: 0 4px;
    background: var(--danger);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
    font-size: 0;
}

.notification-dot.has-count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 2px;
    right: 2px;
}

/* Header dropdowns */
.header-dropdown-wrap {
    position: relative;
}

.header-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    overflow: hidden;
}

.header-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-dropdown-user {
    width: 280px;
}

.header-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.header-dropdown-head h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    padding: 0;
}

.link-btn:hover { color: var(--accent-hover); }

.header-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
}

.header-dropdown-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.header-dropdown-foot a {
    font-size: 13px;
    font-weight: 500;
}

.header-dropdown-loading,
.header-dropdown-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.header-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: var(--bg-card-hover); }

.notif-item.unread { background: rgba(0, 212, 170, 0.05); }

.notif-item.unread:hover { background: rgba(0, 212, 170, 0.08); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notif-content { flex: 1; min-width: 0; }

.notif-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notif-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.user-menu-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.user-menu-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #0095ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.user-menu-name {
    font-size: 15px;
    font-weight: 600;
}

.user-menu-email {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font);
    cursor: pointer;
    text-align: left;
}

.header-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.header-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.header-dropdown-item.danger { color: var(--danger); }
.header-dropdown-item.danger i { color: var(--danger); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #0095ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    position: relative;
    border: none;
    font-family: var(--font);
    padding: 0;
}

.user-avatar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.user-avatar .status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* Content Area */
.content {
    flex: 1;
    padding: 24px;
}

/* Footer */
.footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--accent); font-size: 12px; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body { padding: 24px; }

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-icon.playlists { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.stat-icon.artists { background: rgba(0, 149, 255, 0.15); color: var(--info); }
.stat-icon.emails { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.stat-icon.completed { background: rgba(0, 214, 143, 0.15); color: var(--success); }

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.charts-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.data-table .artist-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.artist-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
}

.artist-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: rgba(0, 214, 143, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 61, 113, 0.15); color: var(--danger); }
.badge-info { background: rgba(0, 149, 255, 0.15); color: var(--info); }
.badge-secondary { background: rgba(160, 160, 184, 0.15); color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

.badge .fa-spotify { margin-right: 5px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== FILTER PANEL ===== */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.filter-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.filter-header h4 { font-size: 14px; font-weight: 600; }

.filter-body {
    padding: 0 24px 24px;
    display: none;
}

.filter-body.show { display: block; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.filter-actions { display: flex; gap: 12px; }

/* ===== JOB DETAIL ===== */
.job-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.job-info-card .playlist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.playlist-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.progress-item {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #0095ff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.date-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.date-box {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.date-box label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.date-box span { font-size: 13px; font-weight: 500; }

/* Gauge Chart */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.gauge-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
}

.gauge-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.gauge-stat { text-align: center; }
.gauge-stat .value { font-size: 20px; font-weight: 600; }
.gauge-stat .label { font-size: 12px; color: var(--text-muted); }

/* Email Sources */
.source-list { list-style: none; }

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.source-item:last-child { border-bottom: none; }

.source-platform {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.source-platform i { font-size: 18px; }

.source-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.mini-ring {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
}

/* Confirm modal (SweetAlert style) */
.confirm-modal { max-width: 420px; text-align: center; }
.confirm-modal-body { padding: 40px 32px 32px; }
.confirm-icon {
    width: 72px; height: 72px; border-radius: 50%;
    border: 3px solid rgba(255, 170, 0, 0.4);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 32px; color: var(--warning);
}
.confirm-modal h3 { font-size: 24px; margin-bottom: 8px; }
.confirm-modal p { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.confirm-cancel { color: var(--danger) !important; border-color: var(--danger) !important; }
.confirm-cancel:hover { background: rgba(255, 61, 113, 0.1) !important; }

/* Collapsible sections */
.collapsible-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.collapsible-header h3 { margin: 0; flex: 1; }
.collapse-icon { font-size: 14px; transition: transform 0.25s; color: var(--text-muted); flex-shrink: 0; }
.collapse-icon.collapsed { transform: rotate(-90deg); }
.collapsible-body { display: none; }
.collapsible-body.show { display: block; }

/* CSS donut charts (no Chart.js / eval) */
.css-donut {
    --pct: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--border-color) 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
}
.css-donut-lg { max-width: 180px; max-height: 180px; margin: 0 auto; }
.css-donut-sm { max-width: 100px; max-height: 100px; margin: 0 auto; }
#emailDonut.css-donut { background: conic-gradient(#a855f7 calc(var(--pct) * 1%), var(--border-color) 0); }

/* Dashboard CSS charts */
.css-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 100%;
    min-height: 220px;
    padding-top: 8px;
}

.css-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.css-bar-track {
    flex: 1;
    width: 100%;
    max-width: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.css-bar-fill {
    width: 100%;
    min-height: 4px;
    background: #333345;
    border-radius: 6px 6px 0 0;
    transition: height 0.4s ease;
}

.css-bar-fill.active { background: #0095ff; }

.css-bar-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.css-donut-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: 100%;
    justify-content: center;
}

.css-donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.css-donut-hole {
    position: absolute;
    inset: 22%;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-legend {
    list-style: none;
    width: 100%;
    max-width: 280px;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
}

.chart-legend li strong {
    margin-left: auto;
    color: var(--text-primary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
    color: var(--text-muted);
    font-size: 13px;
}

.chart-container-donut {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Artist expand table — Liberty format */
.artist-expand-table thead th {
    font-size: 11px;
    letter-spacing: 0.6px;
}

.artist-row-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.artist-row-cell .artist-cell {
    flex: 1;
    min-width: 0;
}

.artist-row-cell .artist-name {
    font-weight: 500;
}

.expand-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.expand-toggle:hover { color: var(--accent); }

.expand-row.expanded {
    background: rgba(255, 255, 255, 0.02);
}

.expand-row.expanded td {
    border-bottom-color: transparent;
}

.primary-email-cell {
    color: var(--text-secondary);
    font-size: 13px;
}

.artist-detail-panel {
    overflow: visible;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 0;
}

.artist-detail-panel .social-detail-table td:last-child {
    overflow: visible;
    position: relative;
}

.expand-content.show .artist-detail-panel .actions-dropdown {
    z-index: 100;
}

.artist-detail-panel .expand-inner {
    padding: 20px 24px 24px 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.artist-detail-panel .social-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.social-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.social-detail-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.social-detail-table td {
    padding: 12px 12px 12px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.social-detail-table tr:last-child td {
    border-bottom: none;
}

.social-detail-table td:last-child {
    width: 40px;
    text-align: right;
    padding-right: 0;
    overflow: visible;
    position: relative;
}

.social-type-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-type-cell i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.social-type-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.social-type-link:hover {
    background: var(--bg-input);
    transform: scale(1.08);
}

.social-type-link i {
    font-size: 16px;
    width: auto;
}

.social-type-cell span {
    color: var(--text-secondary);
    font-size: 13px;
}

.expand-content {
    display: none;
    background: var(--bg-secondary);
}

.expand-content.show { display: table-row; }

.expand-content > td {
    padding: 0 !important;
    background: var(--bg-primary);
}

.expand-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .artist-detail-panel .expand-inner {
        grid-template-columns: 1fr;
        padding-left: 24px;
    }
}

/* Actions Dropdown */
.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
}

.actions-btn:hover { background: var(--bg-input); color: var(--text-primary); }

.actions-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 160px;
    box-shadow: var(--shadow);
    z-index: 50;
    display: none;
    overflow: hidden;
}

.actions-dropdown.show { display: block; }

.actions-dropdown button,
.actions-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.actions-dropdown button:hover,
.actions-dropdown a:hover { background: var(--bg-card-hover); }

.actions-dropdown .danger { color: var(--danger); }

/* Health Check */
.health-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.health-item:last-child { border-bottom: none; }

.health-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.health-status.ok { background: rgba(0, 214, 143, 0.15); color: var(--success); }
.health-status.warning { background: rgba(255, 170, 0, 0.15); color: var(--warning); }
.health-status.error { background: rgba(255, 61, 113, 0.15); color: var(--danger); }

.health-name { flex: 1; font-size: 14px; font-weight: 500; }
.health-desc { font-size: 13px; color: var(--text-secondary); }

/* Page Header Actions */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-actions h2 { font-size: 22px; font-weight: 600; }

/* Spotify Link Icon */
.spotify-link {
    color: var(--success);
    font-size: 18px;
    transition: var(--transition);
}

.spotify-link:hover { color: #1ed760; }

/* Link Icon */
.link-icon {
    color: var(--accent);
    font-size: 16px;
}

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 90;
}

.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-2px); }

/* Loading Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }

/* Pagination */
.pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-controls button {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
    user-select: none;
}

.pagination-controls button:hover:not(:disabled) { border-color: var(--accent); }
.pagination-controls button.active { background: var(--accent); color: #000; border-color: var(--accent); }
.pagination-controls button:disabled { opacity: 0.4; cursor: not-allowed; }

.page-actions-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-danger-outline {
    border-color: rgba(255, 61, 113, 0.4);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: rgba(255, 61, 113, 0.1);
    border-color: var(--danger);
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.required { color: var(--danger); }

/* Demo Banner */
.demo-banner {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.1), rgba(0, 149, 255, 0.1));
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .job-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-expanded); }
    .sidebar.mobile-open .nav-item span { opacity: 1; }
    .sidebar.mobile-open .sidebar-logo span { opacity: 1; }
    .main-wrapper { margin-left: 0 !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .charts-grid-2 { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .expand-inner { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .page-actions { flex-direction: column; gap: 12px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .login-card { padding: 32px 24px; }
    .modal { margin: 10px; }
}
