/* ── Fonts ──────────────────────────────────────────── */
/* Gotham: place woff2/woff files in app/static/fonts/ */
@font-face {
    font-family: 'Gotham';
    src: url('/static/fonts/Gotham-Book.woff2') format('woff2'),
         url('/static/fonts/Gotham-Book.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gotham';
    src: url('/static/fonts/Gotham-Medium.woff2') format('woff2'),
         url('/static/fonts/Gotham-Medium.woff') format('woff');
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gotham';
    src: url('/static/fonts/Gotham-Bold.woff2') format('woff2'),
         url('/static/fonts/Gotham-Bold.woff') format('woff');
    font-weight: 700 800;
    font-style: normal;
    font-display: swap;
}
/* Montserrat fallback via Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #160B35;
    --bg-card: #22133B;
    --bg-input: #1C0F30;
    --border: #3A2560;
    --text: #F0ECF8;
    --text-muted: #9B87C0;
    --primary: #2B52DE;
    --primary-hover: #3D64F0;
    --gold: #D3AE6E;
    --gold-hover: #E0C080;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
}

body {
    font-family: 'Gotham', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Navbar ────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Nav Tabs centering ───────────────────────────── */
@media (min-width: 769px) {
    .navbar { position: sticky; top: 0; }
    .nav-tabs {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav-app-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Nav Tabs ──────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-tab {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
    letter-spacing: 0.02em;
}

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

.nav-tab.active {
    color: var(--gold);
    background: rgba(211,174,110,0.12);
    border: 1px solid rgba(211,174,110,0.3);
}

.nav-heading {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.share-btn {
    font-size: 0.78rem;
    cursor: pointer;
    vertical-align: middle;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stats-bar {
    display: flex;
    gap: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.stat-item strong { color: var(--gold); }

.btn-icon {
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    letter-spacing: 0.02em;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-input); color: var(--gold); border: 1px solid var(--gold); }
.btn-secondary:hover { background: rgba(211,174,110,0.1); }
.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.72rem; }

/* ── Container ─────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* ── Filters ───────────────────────────────────────── */
.filters-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row-top {
    display: contents;
}
.filter-toggle-btn {
    display: none;
    white-space: nowrap;
}
.filter-row {
    display: contents;
}

.search-box { flex: 0 1 220px; min-width: 150px; }

.search-box input,
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
}

.search-box input:focus,
.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-group select option { background: var(--bg-card); }
.filter-group select {
    min-width: 130px;
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}
.filter-group input[type="date"] { min-width: 140px; max-width: 100%; color-scheme: dark; }

/* ── Sync Banner ───────────────────────────────────── */
.sync-banner {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    font-weight: 500;
}

.sync-banner.running { background: #1a2550; border: 1px solid var(--primary); color: #93c5fd; }
.sync-banner.completed { background: #14532d; border: 1px solid var(--success); color: #86efac; }
.sync-banner.failed { background: #450a0a; border: 1px solid var(--danger); color: #fca5a5; }

/* ── Search Status ─────────────────────────────────── */
.search-status {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: var(--gold);
    background: rgba(211, 174, 110, 0.08);
    border: 1px solid rgba(211, 174, 110, 0.25);
}

/* ── Recordings Grid ───────────────────────────────── */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.recording-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.recording-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.card-thumbnail {
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.thumb-img { width: 100%; height: 168px; object-fit: cover; display: block; }
.thumb-initial {
    width: 100%;
    height: 168px;
    background: linear-gradient(135deg, #2B1A4A, #160B35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--gold);
    opacity: 0.5;
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: rgba(0,0,0,0.45);
    transition: opacity 0.15s;
}
.recording-card:hover .thumb-overlay { opacity: 1; }

.play-icon {
    width: 52px; height: 52px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff;
    box-shadow: 0 2px 12px rgba(43,82,222,0.6);
}

.card-status-badge {
    position: absolute; top: 0.5rem; right: 0.5rem;
    padding: 0.15rem 0.45rem; border-radius: 4px;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-pending { background: var(--bg-input); color: var(--text-muted); }
.badge-downloading { background: #1a2550; color: #93c5fd; }
.badge-failed { background: var(--danger); color: #fff; }
.badge-zoom { background: #2d8cff; color: #fff; }

.transcript-badge {
    position: absolute; bottom: 0.5rem; left: 0.5rem;
    width: 18px; height: 18px; border-radius: 3px;
    background: var(--primary); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.card-duration {
    position: absolute; bottom: 0.5rem; right: 0.5rem;
    padding: 0.15rem 0.4rem; background: rgba(0,0,0,0.75);
    border-radius: 4px; font-size: 0.7rem; color: #fff; font-weight: 600;
}

.card-body { padding: 0.85rem 1rem; }

.card-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.card-meta {
    font-size: 0.73rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-top: 0.2rem;
}

.card-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}

.tag {
    padding: 0.1rem 0.45rem;
    background: rgba(43,82,222,0.2);
    border: 1px solid rgba(43,82,222,0.4);
    border-radius: 3px;
    font-size: 0.65rem;
    color: #93c5fd;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Card selection ─────────────────────────────────── */
.recording-card.selected { border-color: var(--gold); background: #2B1A4A; }

.card-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    cursor: pointer;
}
.card-checkbox input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--gold); }

.card-admin-bar {
    padding: 0.4rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.btn-delete-card {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.72rem;
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.btn-delete-card:hover { background: rgba(239,68,68,0.1); }

/* ── Bulk Actions ───────────────────────────────────── */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Pagination ────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination button {
    padding: 0.4rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
}

.pagination button:hover { border-color: var(--gold); color: var(--gold); }
.pagination button.active { background: var(--primary); border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 0.78rem; color: var(--text-muted); }
.pagination .per-page-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.pagination .per-page-group select {
    padding: 0.3rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
}

/* ── Login ─────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container { width: 100%; max-width: 400px; padding: 1rem; }

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { color: var(--gold); font-size: 1.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

.login-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.form-group input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.9rem;
}
.form-group input:focus { outline: none; border-color: var(--gold); }

.alert-error {
    background: #450a0a;
    border: 1px solid var(--danger);
    color: #fca5a5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* ── Loading / Empty ───────────────────────────────── */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}
.empty-state h3 { color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 700; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; }

/* ── Admin Panel ────────────────────────────────────── */
.admin-panel {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem 1.5rem;
}

.admin-panel-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Accordion */
.admin-accordion {
    border-bottom: 1px solid var(--border);
}
.admin-accordion:last-child { border-bottom: none; }

.admin-accordion-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.85rem 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gold);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-accordion-btn:hover { color: var(--gold-hover); }
.accordion-arrow {
    transition: transform 0.2s;
    font-size: 0.7rem;
}
.admin-accordion.open .accordion-arrow { transform: rotate(180deg); }

.admin-accordion-body {
    padding: 0 0 1rem;
}

/* Admin fields */
.admin-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .admin-grid-2 { grid-template-columns: 1fr; }
}
.admin-field { }

.admin-input {
    padding: 0.4rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
    width: 100%;
    box-sizing: border-box;
}
.admin-input:focus { outline: none; border-color: var(--gold); }
.admin-input-sm { width: 90px; }

.admin-password-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 320px;
}

.section-hint { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.input-row input[type="text"] {
    padding: 0.35rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.82rem;
    width: 140px;
}
.input-row input[type="text"]:focus { outline: none; border-color: var(--gold); }
.input-row input[type="file"] { font-size: 0.78rem; color: var(--text-muted); }

.settings-preview-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 2px;
    background: #fff;
    display: block;
    margin-bottom: 0.4rem;
}
.settings-preview-favicon { height: 24px; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0 0.3rem 0.4rem 0;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.filter-chip button {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 1rem; line-height: 1; padding: 0;
}
.filter-chip button:hover { color: var(--danger); }
.filter-empty { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }

/* ── Recording Detail Page ──────────────────────────── */
.recording-detail-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

.recording-detail-header { margin-bottom: 1.75rem; }
.recording-detail-header h1 {
    font-size: 1.65rem;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    font-weight: 800;
    color: var(--text);
}

.recording-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.83rem;
    color: var(--text-muted);
}
.meta-sep { color: var(--border); }

.zoom-link-bar { margin-bottom: 0.75rem; }

.video-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
}
.video-wrapper video { width: 100%; display: block; max-height: 540px; }

.video-unavailable {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}
.detail-section-header h2 { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }

.summary-body {
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text);
}
.summary-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(211, 174, 110, 0.2);
}
.summary-body h3:first-child { margin-top: 0; }
.summary-body h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 1.25rem 0 0.4rem 0;
}
.summary-body p { margin-bottom: 0.6rem; }
.summary-body ul {
    margin: 0.4rem 0 0.8rem 0;
    padding-left: 1.25rem;
    list-style: none;
}
.summary-body ul li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}
.summary-body ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: 600;
}
.summary-body a {
    color: var(--primary-light, #6b8aff);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.summary-body a:hover { border-bottom-color: var(--primary-light, #6b8aff); }

.summary-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    border: none;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.88rem;
    line-height: 1.65;
    resize: vertical;
}
.summary-textarea:focus { outline: none; }

.edit-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.transcript-body {
    padding: 1.25rem;
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.86rem;
    line-height: 1.8;
    color: var(--text);
}
.transcript-body p { margin-bottom: 0.4rem; }

.section-empty {
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Debug Panel ───────────────────────────────────── */
.debug-toggle-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: 'Gotham', 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 200;
}
.debug-toggle-btn:hover { border-color: var(--primary); color: var(--text); }

.debug-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 340px;
    background: #0D0820;
    border-top: 1px solid var(--border);
    z-index: 300;
    display: flex;
    flex-direction: column;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.debug-log {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.6;
}

.debug-entry { display: flex; gap: 0.75rem; border-bottom: 1px solid #1E1040; padding: 0.15rem 0; }
.debug-ts { color: #5a4a80; flex-shrink: 0; }
.debug-source { flex-shrink: 0; width: 3.5rem; text-align: right; }
.source-zoom { color: #60a5fa; }
.source-s3   { color: var(--gold); }
.source-task { color: #c084fc; }
.source-app  { color: #94a3b8; }
.debug-msg { flex: 1; }
.debug-detail { color: #7a6a9a; margin-left: 0.5rem; }
.level-info    .debug-msg { color: #e2e8f0; }
.level-success .debug-msg { color: #86efac; }
.level-warn    .debug-msg { color: #fde68a; }
.level-error   .debug-msg { color: #fca5a5; }

/* ── Modal ─────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--border);
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1.5rem;
    background: none; border: none;
    color: #fff; font-size: 2rem;
    cursor: pointer; z-index: 10;
}
.modal-header { padding: 1rem 1.25rem 0.5rem; }
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-header p { font-size: 0.8rem; color: var(--text-muted); }
.modal-body { padding: 0 1.25rem 1.25rem; }
.modal-body video { width: 100%; border-radius: 6px; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 0.75rem; padding: 1rem; }
    .nav-tabs { width: 100%; justify-content: center; }
    .nav-tab { font-size: 0.75rem; padding: 0.35rem 0.65rem; }
    .nav-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .container { padding: 1rem; }
    .filters-panel { flex-direction: column; align-items: stretch; }
    .filter-row-top { display: flex; gap: 0.75rem; align-items: center; }
    .filter-row-top .search-box { flex: 1; min-width: 0; }
    .filter-toggle-btn { display: inline-flex; }
    .filter-row {
        flex-direction: column;
        display: none;
    }
    .filter-row.open { display: flex; }
    .search-box { min-width: 100%; }
    .filter-group { width: 100%; }
    .filter-group select,
    .filter-group input[type="date"] { min-width: 0; width: 100%; }
    .recordings-grid { grid-template-columns: 1fr; }
    .recording-detail-container { padding: 1rem; }
}
