:root {
    --bg: #0b0e1a;
    --card: #131729;
    --card-2: #171c33;
    --border: #232a45;
    --text: #e8eaf5;
    --text-dim: #8b90ab;
    --accent: #5b6bf0;
    --accent-2: #7c8bff;
    --live: #3ddc84;
    --danger: #ef5b5b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card h1 { margin: 0 0 8px; font-size: 22px; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.login-card input {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 15px;
}
.login-card button {
    margin-top: 8px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
}
.login-card button:hover { background: var(--accent-2); }

.topnav {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.topnav-left { display: flex; align-items: center; gap: 28px; }
.topnav-brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
.topnav-links { display: flex; gap: 20px; }
.topnav-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 600; }
.topnav-links a.active, .topnav-links a:hover { color: var(--accent-2); }
.topnav-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }
.btn-logout { color: var(--danger); text-decoration: none; font-weight: 600; }

.topnav-status {
    display: flex;
    align-items: center;
    gap: 26px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.container { max-width: 1100px; margin: 0 auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.container-full { width: 100%; padding: 24px 32px; display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}
.card h3 { margin-top: 0; }

.grid-main { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }

.status-row { display: flex; gap: 10px; margin-bottom: 16px; }
.badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-live { background: rgba(61, 220, 132, 0.15); color: var(--live); }
.badge-off { background: rgba(139, 144, 171, 0.15); color: var(--text-dim); }
.badge-mic { background: rgba(91, 107, 240, 0.15); color: var(--accent-2); }

.now-playing-body { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.cover-art { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; background: var(--card-2); }
.now-playing-body h2 { margin: 0 0 4px; font-size: 22px; }
.now-playing-body p { margin: 0; color: var(--text-dim); }
.np-time { margin-top: 6px; font-size: 13px; }

.actions-row .btn { width: 100%; }

.stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.stat-list li { display: flex; justify-content: space-between; font-size: 14px; }
.stat-list span { color: var(--text-dim); }

.btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { background: var(--accent-2); }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #ff7a7a; }

.queue-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.queue-table th { text-align: left; color: var(--text-dim); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); }
.queue-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }

.empty-state { color: var(--text-dim); font-size: 14px; }

.upload-form { display: flex; gap: 12px; align-items: center; }
.hint { color: var(--text-dim); font-size: 13px; margin-top: 10px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
}

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

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.alert-error { background: rgba(239, 91, 91, 0.15); color: var(--danger); }
.alert-success { background: rgba(61, 220, 132, 0.15); color: var(--live); }

@media (max-width: 800px) {
    .grid-main { grid-template-columns: 1fr; }
}

/* ================= Nouveau layout façon maquette ================= */

.onair-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(139, 144, 171, 0.12);
    color: var(--text-dim);
    white-space: nowrap;
}
.onair-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.onair-pill.is-live { background: rgba(91, 107, 240, 0.18); color: var(--accent-2); }
.onair-pill.is-live .dot { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.onair-pill.is-off .dot { background: var(--text-dim); }

.onair-clock { font-size: 20px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.onair-clock small { display: block; font-size: 11px; font-weight: 400; color: var(--text-dim); }

.status-badges { display: flex; gap: 22px; flex-wrap: wrap; }
.status-badge { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.sb-icon {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--card-2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.status-badge .sb-text { display: flex; flex-direction: column; gap: 1px; }
.status-badge .sb-label { color: var(--text-dim); letter-spacing: 0.03em; }
.status-badge strong { font-size: 14px; }
.sb-good { color: var(--live); }
.sb-bad { color: var(--danger); }
.sb-dim { color: var(--text-dim); }

.onair-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 22px;
}
.onair-tag.is-live { background: rgba(61, 220, 132, 0.15); color: var(--live); }
.onair-tag.is-off { background: rgba(139, 144, 171, 0.15); color: var(--text-dim); }

.np-flex { display: flex; align-items: center; gap: 28px; margin-bottom: 6px; }
.np-flex .cover-art { width: 150px; height: 150px; border-radius: 14px; flex-shrink: 0; }
.np-info { flex: 1; min-width: 0; }
.np-info h1 { font-size: 30px; margin: 0 0 8px; line-height: 1.25; }
.np-info p { margin: 0; color: var(--text-dim); font-size: 16px; }
.np-info .tags { margin-top: 12px; display: flex; gap: 8px; }
.np-info .tag { background: var(--card-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 11px; color: var(--text-dim); }

.timer-circle {
    --pct: 0;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    flex-shrink: 0;
    background:
        repeating-conic-gradient(var(--card) 0deg 3deg, transparent 3deg 9deg),
        conic-gradient(var(--accent-2) calc(var(--pct) * 1%), var(--card-2) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.timer-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.tc-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.05em; }
.tc-time { font-size: 26px; font-weight: 700; }
.tc-total { font-size: 11px; color: var(--text-dim); }

.waveform { display: flex; align-items: flex-end; gap: 2px; height: 80px; margin: 22px 0 12px; opacity: 0.55; }
.waveform span { flex: 1; background: var(--accent); border-radius: 2px; min-height: 4px; }

.scrub-row { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-dim); margin-bottom: 24px; }
.scrub-bar { flex: 1; height: 4px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.scrub-fill { height: 100%; background: var(--accent-2); }

.bottom-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-block { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.stat-icon {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: rgba(91, 107, 240, 0.15);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.stat-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-body .stat-label { font-size: 11px; color: var(--text-dim); letter-spacing: 0.03em; }
.stat-body strong { font-size: 15px; }
.stat-body small { font-size: 11px; color: var(--text-dim); }

.notify-bar { display: flex; gap: 14px; align-items: flex-start; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.notify-icon { font-size: 22px; }
.notify-bar p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }

.side-col { display: flex; flex-direction: column; gap: 20px; }
.side-col .card h3 { font-size: 13px; letter-spacing: 0.02em; margin-bottom: 14px; }

.next-body { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.next-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.next-body > div:nth-child(2) { flex: 1; min-width: 0; }
.next-body p { margin: 2px 0 0; color: var(--text-dim); font-size: 12px; }
.next-time { font-size: 12px; color: var(--text-dim); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.toggle-state { color: var(--live); font-weight: 700; }

.empty-box { text-align: center; padding: 30px 10px; color: var(--text-dim); }
.empty-icon { font-size: 26px; margin-bottom: 8px; }
.empty-box strong { display: block; color: var(--text); margin-bottom: 4px; }
.empty-box p { margin: 0; font-size: 12px; }

.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.queue-list li { display: flex; justify-content: space-between; align-items: center; background: var(--card-2); border-radius: 8px; padding: 10px 12px; }
.queue-list li strong { display: block; font-size: 13px; }
.queue-list li span { font-size: 11px; color: var(--text-dim); }

.card-remote-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pill-inactive { font-size: 10px; font-weight: 700; color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.remote-body { display: flex; align-items: center; gap: 12px; }
.remote-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); display: flex; align-items: center; justify-content: center; }
.remote-body p { margin: 2px 0 0; color: var(--text-dim); font-size: 12px; }
.card-remote .hint { margin-top: 12px; margin-bottom: 0; }

@media (max-width: 1100px) {
    .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .np-flex { flex-wrap: wrap; }
    .bottom-stats { grid-template-columns: repeat(2, 1fr); }
    .topnav-status { justify-content: flex-start; }
}
