/* Auditorium Dark Mode, Time-Limit Warnings, QR Check-In, Bulk Actions & Public Search */

/* 1. Auditorium Dark Mode */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b111b;
    --side: #101827;
    --surface: #151f31;
    --subtle: #1c2940;
    --hover: #243552;
    --line: #283854;
    --side-line: #24344f;
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --brand: #3b82f6;
    --brand-dark: #60a5fa;
    --ring: #60a5fa;
    --active-surface: #1d3557;
    --active-ink: #93c5fd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .dialog-head,
html[data-theme="dark"] dialog {
    background: var(--surface);
    color: var(--ink);
}

html[data-theme="dark"] body {
    background: var(--bg);
}

html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .language,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .search,
html[data-theme="dark"] .filter select,
html[data-theme="dark"] .account-popover select,
html[data-theme="dark"] .score-card,
html[data-theme="dark"] .mark-stepper input {
    background-color: var(--subtle);
    border-color: var(--line);
    color: var(--ink);
}

html[data-theme="dark"] .field select,
html[data-theme="dark"] .filter select,
html[data-theme="dark"] .account-popover select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="dark"] th {
    background: #121b2b;
    color: #cbd5e1;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .recent-entry:hover {
    background: #1b283f;
}

html[data-theme="dark"] .list-row + .list-row {
    border-top-color: var(--line);
}

html[data-theme="dark"] .avatar,
html[data-theme="dark"] .profile .avatar {
    background: #243552;
    color: var(--ink);
}

html[data-theme="dark"] .nav-item svg,
html[data-theme="dark"] .nav-item.active svg {
    color: var(--muted);
}

html[data-theme="dark"] .nav-item.active svg {
    color: var(--active-ink);
}

html[data-theme="dark"] .tag.approved,
html[data-theme="dark"] .tag.published,
html[data-theme="dark"] .tag.complete,
html[data-theme="dark"] .tag.active,
html[data-theme="dark"] .live-pill {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

html[data-theme="dark"] .tag.submitted,
html[data-theme="dark"] .tag.verified {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

html[data-theme="dark"] .tag.under_review,
html[data-theme="dark"] .tag.pending {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

html[data-theme="dark"] .tag.rejected,
html[data-theme="dark"] .tag.withdrawn,
html[data-theme="dark"] .tag.live {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
}

html[data-theme="dark"] .stage-waveform {
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fda4af;
}

html[data-theme="dark"] .live-timer {
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(244, 63, 94, 0.38);
    color: #fda4af;
}

html[data-theme="dark"] .tile-icon.teal { background: rgba(20, 184, 166, 0.18); color: #5eead4; }
html[data-theme="dark"] .tile-icon.blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
html[data-theme="dark"] .tile-icon.amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
html[data-theme="dark"] .tile-icon.rose { background: rgba(244, 63, 94, 0.18); color: #fda4af; }

html[data-theme="dark"] .score-range,
html[data-theme="dark"][dir="rtl"] .score-range {
    --range-track: linear-gradient(to right, var(--score-color, var(--brand)) 0 var(--fill), #2b3c59 var(--fill) 100%);
}

html[data-theme="dark"] .success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

html[data-theme="dark"] .workspace .stat:hover {
    background: #1a263b;
    border-color: #364d73;
}

/* 2. Performance Time-Limit Warning & Overtime States */
.live-timer.timer-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
}

html[data-theme="dark"] .live-timer.timer-warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fcd34d;
}

.live-timer.timer-overtime {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
    animation: timer-pulse 1.1s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

/* 3. QR Code on Receipt & Fast Check-In Modal */
.receipt-qr {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-block: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.qr-svg {
    width: 112px;
    height: 112px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.fast-checkin-box {
    display: grid;
    gap: 12px;
}

.fast-checkin-row {
    display: flex;
    gap: 8px;
    align-items: end;
}

.fast-checkin-row .field {
    flex: 1;
}

.qr-scanner-wrap {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #0b111b;
}

.qr-scanner-wrap video {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.fast-checkin-feedback {
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
}

.fast-checkin-feedback:empty {
    display: none;
}

.fast-checkin-feedback.ok {
    background: #e7f7ef;
    color: #176749;
    border: 1px solid #b6e3cd;
}

.fast-checkin-feedback.err {
    background: #fce8ef;
    color: #a12b52;
    border: 1px solid #f4bfd1;
}

html[data-theme="dark"] .fast-checkin-feedback.ok {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}

html[data-theme="dark"] .fast-checkin-feedback.err {
    background: rgba(244, 63, 94, 0.16);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.35);
}

/* 4. Bulk Registration Action Bar */
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 15px;
    background: var(--active-surface);
    border-block-end: 1px solid var(--line);
    color: var(--active-ink);
}

.bulk-bar strong {
    font-size: 0.92rem;
}

.bulk-check {
    width: 17px;
    height: 17px;
    accent-color: var(--brand);
    cursor: pointer;
}

/* 5. Public Performer / School Search on /schedule */
.public-roster-panel {
    margin-block-end: 16px;
}

.roster-hit-list {
    display: grid;
    border-block-start: 1px solid var(--line);
}

.roster-hit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 12px 16px;
}

.roster-hit + .roster-hit {
    border-block-start: 1px solid var(--line);
}

.roster-hit-main {
    min-width: 0;
    flex: 1 1 200px;
}

.roster-hit-main b {
    display: block;
    font-size: 0.96rem;
}

.roster-hit-main small {
    color: var(--muted);
    font-size: 0.84rem;
}

.roster-hit-slot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 0.86rem;
}

@media (prefers-reduced-motion: reduce) {
    .live-timer.timer-overtime {
        animation: none;
    }
}
