/* Film Scheduler - Main Styles */
:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --bg: #f3f5fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dcdde1;
    --shadow: 0 4px 14px rgba(0,0,0,0.16);
    --radius: 6px;
}

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

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

body::before {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    bottom: -60px;
    right: -40px;
    background: url('../img/favicon/favicon-512x512.png') no-repeat center / contain;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
}

/* Navigation: vaste sidebar links; op mobiel een topbalk + uitschuifmenu. */
:root { --sidebar-w: 230px; }

body.has-sidebar { padding-left: var(--sidebar-w); }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.sidebar-project {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem 0.5rem;
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sidebar-project span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-links,
.nav-global {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-global {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.nav-links a,
.nav-global a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0.65rem;
    font-size: 0.88rem;
    border-radius: 7px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a i,
.nav-global a i {
    width: 1.15rem;
    text-align: center;
    flex: 0 0 1.15rem;
}

.nav-links a:hover,
.nav-global a:hover {
    color: var(--primary);
    background: var(--bg);
}

.nav-links a.active,
.nav-global a.active {
    color: var(--accent-hover);
    background: rgba(52, 152, 219, 0.1);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-foot {
    border-top: 1px solid var(--border);
    padding: 0.6rem 0.75rem 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
}
.user-info strong {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-info small { color: var(--text-light); font-size: 0.72rem; }

/* Mobiele topbalk (op desktop verborgen) */
.topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 150;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 1rem;
    font-size: 0.8rem;
}

.lang-active {
    font-weight: 700;
    color: var(--primary);
    padding: 0.2rem 0.4rem;
    background: var(--bg);
    border-radius: 3px;
}

.lang-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: all 0.2s;
}

.lang-link:hover {
    color: var(--primary);
    background: var(--bg);
}

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

/* Wide pages (large tables): use the full screen width. */
.container-wide {
    max-width: none;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Full-width tinted bar: cancel the card's 1.5rem padding on top/sides. */
    margin: -1.5rem -1.5rem 1rem;
    padding: 0.85rem 1.5rem;
    background: #e9eef7;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header h2 {
    font-size: 1.2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover { background: #219a52; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: #c0392b; }

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Compact icon-only button (add a title attribute for the tooltip). */
.btn-icon {
    padding: 0.35rem 0.5rem;
    line-height: 1;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    background: var(--bg);
}

/* Scenes list: compact rows; keep the (icon-only) action buttons on one line
   so the table never overflows its card. */
#scenesTable th,
#scenesTable td {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}
#scenesTable td:last-child { white-space: nowrap; }

.table tr:hover td {
    background: #f8f9fa;
}

/* Flash Messages */
.flash {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
}

.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.flash-warning { background: #fff3cd; color: #856404; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-int { background: #e8f4fd; color: #2980b9; }
.badge-ext { background: #fdebd0; color: #e67e22; }
.badge-day { background: #fef9e7; color: #f39c12; }
.badge-night { background: #2c3e50; color: #ecf0f1; }
.badge-dawn { background: #fadbd8; color: #e74c3c; }
.badge-dusk { background: #d5d8dc; color: #2c3e50; }

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Project dashboard: two columns of cards at half the screen width on large
   screens (Bootstrap-like row/col-6); on tablet/mobile the columns stack. */
.dashboard-grid .project-card { margin-bottom: 1.5rem; }
@media (min-width: 1025px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 1.5rem;
        align-items: start;
    }
}

/* Project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.project-card h3 { margin-bottom: 0.5rem; }
.project-card .meta { color: var(--text-light); font-size: 0.85rem; }

/* Schedule Board */
.schedule-board {
    display: flex;
    gap: 0.6rem;
    overflow: auto;
    padding-bottom: 1rem;
    min-height: 500px;
}

/* Desktop: het bord is zelf de verticale scrollcontainer (past binnen het
   scherm onder de sticky kop), zodat de dagkoppen hieronder kunnen
   vastplakken terwijl je door de scènes scrolt. */
@media (min-width: 769px) {
    .schedule-board {
        max-height: calc(100vh - var(--nav-h, 64px) - var(--list-head-h, 96px) - 1.5rem);
    }
}

.schedule-column {
    min-width: 215px;
    max-width: 245px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.schedule-column.unscheduled {
    border-color: var(--warning);
    min-width: 230px;
}

/* Lege "Niet ingepland"-kolom: heel smal, blijft wel droptarget om scènes
   uit een dag te kunnen slepen. */
.schedule-column.unscheduled.is-empty {
    min-width: 90px;
    max-width: 110px;
}
.schedule-column.unscheduled.is-empty .column-header {
    white-space: normal;
}

.column-header {
    padding: 0.45rem 0.6rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Blijft bovenin staan terwijl het bord verticaal scrolt. */
    position: sticky;
    top: 0;
    z-index: 5;
}

.column-body {
    padding: 0.35rem;
    flex: 1;
    min-height: 100px;
}

.column-body.drag-over {
    background: rgba(52, 152, 219, 0.1);
    border: 2px dashed var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Scene Cards (draggable) */
.scene-card {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: grab;
    border-left: 3px solid var(--accent);
    font-size: 0.76rem;
    line-height: 1.35;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
}

.scene-card:active { cursor: grabbing; }

.scene-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.scene-card .scene-number {
    font-weight: 700;
    margin-right: 0.5rem;
}

.scene-card .scene-meta {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.scene-card .scene-pages {
    color: var(--text-light);
    font-size: 0.7rem;
}

.scene-card .scene-chars {
    color: var(--text-light);
    font-size: 0.7rem;
}

.scene-card .badge {
    padding: 0.05rem 0.35rem;
    font-size: 0.62rem;
}

.scene-card.conflict {
    border-left-color: var(--danger);
    background: #fff5f5;
}

/* Day totals */
.day-total {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Conflict warnings */
.conflict-list {
    list-style: none;
}

.conflict-item {
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--danger);
    background: #fff5f5;
    margin-bottom: 0.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.85rem;
}

/* Stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 1rem;
}

/* Reports */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.report-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.report-card h3 { margin-bottom: 0.5rem; }
.report-card p { color: var(--text-light); font-size: 0.85rem; margin-bottom: 1rem; }

/* DOOD Table */
.dood-table {
    overflow-x: auto;
}

.dood-table table {
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dood-table th,
.dood-table td {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.dood-table .work-day { background: #d4edda; }
.dood-table .travel-day { background: #fff3cd; }
.dood-table .unavailable { background: #f8d7da; }

/* Upload area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Inline form */
.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.inline-form .form-control {
    flex: 1;
}

/* Breakdown add form */
.breakdown-add-form {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.breakdown-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.breakdown-add-row .form-control {
    flex: 1;
    min-width: 100px;
}

.breakdown-add-row select.form-control {
    flex: 0 0 140px;
    max-width: 140px;
}

.breakdown-add-row .btn {
    flex: 0 0 auto;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print styles */
/* Budget */
.budget-total-row td {
    background: var(--bg);
    font-weight: 700;
}

.source-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #eee;
    color: var(--text-light);
    margin-left: 0.3rem;
    vertical-align: middle;
}

.inline-edit-row td {
    background: #f8f9fa;
    padding: 0.75rem;
}

/* Crew */
.crew-dept-header {
    background: var(--bg);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.75rem !important;
}

.hod-badge {
    display: inline-block;
    background: var(--warning);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    body.has-sidebar { padding-left: 0; }
    .container { max-width: 100%; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .callsheet-print { page-break-inside: avoid; }
    .cs-section-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .cs-day-number { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Nav toggle (hamburger) - alleen zichtbaar in de mobiele topbalk */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Responsive - Mobile: sidebar wordt een uitschuifmenu achter de topbalk. */
@media (max-width: 768px) {
    body.has-sidebar { padding-left: 0; }
    .topbar { display: flex; }
    .nav-toggle { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 200;
        box-shadow: none;
    }
    body.sidebar-open .sidebar {
        transform: none;
        box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-brand { display: none; }
    .container {
        padding: 1rem;
    }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .page-header h1 {
        font-size: 1.25rem;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .actions {
        flex-wrap: wrap;
    }
    .schedule-board { flex-direction: column; }
    .schedule-column { min-width: 100%; max-width: 100%; }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    .section-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .section-tabs a {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .modal {
        width: 95%;
        padding: 1rem;
    }
    .report-grid {
        grid-template-columns: 1fr;
    }
    /* Tables: horizontal scroll wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    .table {
        min-width: 600px;
    }
    .project-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .breakdown-add-row {
        flex-direction: column;
        align-items: stretch;
    }
    .breakdown-add-row select.form-control {
        flex: 1 1 auto;
        max-width: 100%;
    }
    .upload-area {
        padding: 1.5rem 1rem;
    }
    body::before {
        width: 250px;
        height: 250px;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Tab-like section switcher */
.section-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.section-tabs a {
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
}

.section-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* AI suggestion box */
.ai-suggestion {
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem;
    background: #f0f8ff;
    margin-bottom: 1rem;
}

.ai-suggestion h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

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

/* Sticky lijstkop: paginakop + filterbalk + tabelkop blijven zichtbaar onder
   de (eveneens sticky) hoofdnavigatie. De hoogtes worden per pagina via JS in
   --nav-h en --list-head-h gezet. */
.sticky-list-head {
    position: sticky;
    top: var(--nav-h, 0px);
    z-index: 90;
    background: var(--bg);
    padding: 0.5rem 0 1px; /* voorkomt margin-collapse; maskeert doorscrollende inhoud */
}

/* Losse sticky filterbalk (voor pagina's waar tussen kop en tabel nog andere
   content staat die wél mag wegscrollen, zoals een toevoegen-formulier).
   De hoogte komt via JS in --filter-h. */
.sticky-filter {
    position: sticky;
    top: calc(var(--nav-h, 0px) + var(--list-head-h, 0px));
    z-index: 85;
    background: var(--bg);
    padding-bottom: 1px; /* voorkomt margin-collapse; maskeert doorscrollende inhoud */
}

/* Variant binnen een kaart (bv. Cast): volle kaartbreedte, kaartachtergrond. */
.card > .sticky-filter {
    background: var(--card-bg);
    margin: 0 -1.5rem;
    padding: 0.5rem 1.5rem 1rem;
}

.sticky-table thead th {
    position: sticky;
    top: calc(var(--nav-h, 0px) + var(--list-head-h, 0px) + var(--filter-h, 0px));
    z-index: 80;
    /* collapsed borders scrollen niet mee met een sticky th; schaduw als randvervanger */
    box-shadow: 0 1px 0 var(--border);
}

@media (max-width: 768px) {
    .sticky-list-head { position: static; }
    .sticky-filter { position: static; }
    .sticky-table thead th { position: static; }
}

/* Filter & Search bars */
.filter-bar {
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row .form-control {
    flex: 1;
    min-width: 150px;
}

.filter-row .form-control:first-child {
    flex: 2;
    min-width: 250px;
}

.filter-select {
    max-width: 180px !important;
    flex: 0 1 180px !important;
}

.filter-bar-compact {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.filter-bar-compact .form-control {
    flex: 1;
    min-width: 120px;
}

.filter-bar-compact .form-control:first-child {
    flex: 2;
}

.filter-bar-compact .filter-select {
    max-width: 160px !important;
    flex: 0 1 160px !important;
}

/* Count badge in headers */
.count-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 0.3rem;
    font-weight: 600;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.2rem !important;
}

.sortable:hover {
    background: #ebedef;
}

.sortable::after {
    content: '\2195';
    position: absolute;
    right: 0.3rem;
    color: var(--text-light);
    font-size: 0.7rem;
}

.sortable.sort-asc::after {
    content: '\2191';
    color: var(--accent);
}

.sortable.sort-desc::after {
    content: '\2193';
    color: var(--accent);
}

@media print {
    .filter-bar, .filter-bar-compact, .filter-row { display: none !important; }
}

@media (max-width: 768px) {
    .filter-row { flex-direction: column; }
    .filter-row .form-control,
    .filter-row .form-control:first-child,
    .filter-row .filter-select,
    .filter-bar-compact .form-control,
    .filter-bar-compact .form-control:first-child,
    .filter-bar-compact .filter-select {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }
    .filter-bar-compact {
        flex-direction: column;
    }
}

/* === Background-job nav indicator + toast notifications === */
.job-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent, #2980b9);
    color: #fff !important;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    margin: 0 0.5rem;
}
.job-pill:hover { background: var(--accent-hover, #1f6391); }
.job-pill i { font-size: 0.85rem; }

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    font-size: 0.9rem;
    line-height: 1.4;
    color: #fff;
    position: relative;
    animation: toast-in 0.25s ease-out;
}
.toast-success { background: #2e7d32; }
.toast-error   { background: #c62828; }
.toast-info    { background: #1976d2; }
.toast-leaving { animation: toast-out 0.25s ease-in forwards; }
.toast-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.85);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}
.toast-close:hover { color: #fff; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }

/* AI document analysis (project create form) */
.ai-analyze-card { border-left: 3px solid var(--accent, #6c5ce7); }
.ai-analyze-status {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.ai-status-info    { background: #eef2ff; color: #3730a3; }
.ai-status-success { background: #ecfdf5; color: #065f46; }
.ai-status-error   { background: #fef2f2; color: #991b1b; }
.form-control.ai-filled {
    background: #f5fbff;
    border-color: #93c5fd;
    transition: background 0.4s ease;
}

/* Background jobs status page */
.jobs-table td { vertical-align: middle; font-size: 0.9rem; }
.job-row-failed { background: #fff7f7; }
.job-row-done   { background: #f6fffb; }
.job-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.job-pending { background: #fef3c7; color: #92400e; }
.job-running { background: #dbeafe; color: #1e40af; }
.job-done    { background: #d1fae5; color: #065f46; }
.job-failed  { background: #fee2e2; color: #991b1b; }
.progress-bar {
    background: #e5e7eb; border-radius: 999px; height: 8px; width: 100%; overflow: hidden; margin-bottom: 3px;
}
.progress-fill {
    background: var(--accent, #6c5ce7); height: 100%; border-radius: 999px; transition: width 0.4s ease;
}
.job-error { color: #b91c1c; font-size: 0.82rem; cursor: help; }

/* ---- Authentication (login/register + nav logout) ---- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 4rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 26rem;
}
.auth-card form {
    padding: 0 1.25rem 1.25rem;
}
.auth-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}
.auth-alt {
    text-align: center;
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
.nav-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
}
.nav-logout {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: var(--text-light);
    padding: 0.45rem 0.55rem;
    font-size: 0.95rem;
    border-radius: 7px;
    transition: all 0.2s;
}
.nav-logout:hover {
    color: var(--danger);
    background: var(--bg);
}

/* Locaties: folderstructuur (hoofdlocaties met sublocaties eronder) */
#locsTable tr.loc-sub td:first-child {
    padding-left: 2.25rem;
}
#locsTable .loc-num {
    display: inline-block;
    min-width: 1.9rem;
    color: var(--text-light);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
#locsTable .loc-num-sub {
    min-width: 2.4rem;
}
#locsTable .loc-child-count {
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 400;
    margin-left: 0.5rem;
}
#locsTable tr.loc-context {
    opacity: 0.55;
}

/* ---- Scenario-editor (Final Draft-stijl) ---- */
.script-help { color: var(--text-light); font-size: 0.85rem; margin: -0.5rem 0 1rem; }
.script-save-status { font-size: 0.8rem; white-space: nowrap; }
.script-save-status.is-saved { color: #16a34a; }
.script-save-status.is-dirty { color: #d97706; }
.script-save-status.is-saving { color: var(--text-light); }
.script-save-status.is-error { color: var(--danger); }

.screenplay-wrap { display: flex; justify-content: center; }
.screenplay-page {
    background: #fff;
    width: 8.5in;
    max-width: 100%;
    min-height: 11in;
    padding: 1in 1in 1in 1.5in;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12pt;
    line-height: 1.15;
    color: #111;
    box-shadow: var(--shadow);
    border-radius: 2px;
    outline: none;
}
.screenplay-page .el { min-height: 1em; white-space: pre-wrap; margin: 1em 0 0; }
.screenplay-page .el:first-child { margin-top: 0; }
.screenplay-page .el-scene-heading { text-transform: uppercase; margin-top: 2em; }
.screenplay-page .el-character { margin-left: 2.2in; text-transform: uppercase; }
.screenplay-page .el-parenthetical { margin-left: 1.6in; max-width: 2.4in; margin-top: 0; }
.screenplay-page .el-dialogue { margin-left: 1in; max-width: 3.5in; margin-top: 0; }
.screenplay-page .el-transition { text-align: right; text-transform: uppercase; }
.screenplay-page .el-current { background: rgba(52, 152, 219, 0.07); }

@media (max-width: 1024px) {
    .screenplay-page { width: 100%; min-height: 60vh; padding: 1.5rem; }
    .screenplay-page .el-character { margin-left: 30%; }
    .screenplay-page .el-parenthetical { margin-left: 22%; max-width: 50%; }
    .screenplay-page .el-dialogue { margin-left: 14%; max-width: 65%; }
}

/* Versielijst scenario-editor */
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list .version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.version-list .version-item:last-child { border-bottom: none; }
.version-list .version-info { display: flex; flex-direction: column; min-width: 0; }
.version-list .version-info small { color: var(--text-light); }
.version-list .version-empty { color: var(--text-light); padding: 0.25rem 0; }

/* SmartType-menu (scenario-editor): autocomplete + elementenmenu */
.smarttype {
    position: absolute;
    z-index: 200;
    min-width: 180px;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    overflow: hidden;
}
.smarttype-item {
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smarttype-item.active,
.smarttype-item:hover {
    background: var(--accent);
    color: #fff;
}

/* ---- Workflow-voortgang op projectdashboard ---- */
.workflow-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}
.workflow-head {
    display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem;
}
.workflow-title { font-weight: 600; font-size: 0.95rem; }
.workflow-title i { color: var(--text-light); margin-right: 0.35rem; }
.workflow-pct { font-size: 0.85rem; color: var(--text-light); font-weight: 600; }
.workflow-progress { margin-bottom: 0.9rem; }
.workflow-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0;
}
.workflow-step {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.3rem 0.6rem; border-radius: 999px;
    text-decoration: none; color: var(--text-light);
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.workflow-step:hover { background: #f1f3f9; border-color: var(--border); }
.wf-dot {
    width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    border: 1.5px solid var(--border); color: var(--text-light); background: transparent;
}
.wf-text { display: flex; flex-direction: column; line-height: 1.15; }
.wf-label { font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.wf-detail { font-size: 0.7rem; color: var(--text-light); white-space: nowrap; }
.wf-connector {
    flex: 0 0 14px; height: 1.5px; background: var(--border); margin: 0 0.1rem;
}
.workflow-step.wf-done { color: #16a34a; }
.workflow-step.wf-done .wf-dot { border-color: #16a34a; color: #16a34a; background: rgba(22, 163, 74, 0.08); }
.workflow-step.wf-done .wf-label { color: #16a34a; }
.workflow-step.wf-base { color: #2980b9; }
.workflow-step.wf-base .wf-dot { border-color: #2980b9; color: #2980b9; background: rgba(41, 128, 185, 0.08); }
.workflow-step.wf-base .wf-label { color: #2980b9; }
.workflow-step.wf-partial { color: #d97706; }
.workflow-step.wf-partial .wf-dot { border-color: #d97706; color: #d97706; background: rgba(217, 119, 6, 0.08); }
.workflow-step.wf-partial .wf-label { color: #d97706; }
@media (max-width: 900px) {
    .wf-connector { display: none; }
    .workflow-strip { gap: 0.35rem; }
}

/* ---- Draaischema-tabelweergave (schema) ---- */
/* Eigen scrollcontainer op schermhoogte: de kopregel blijft sticky in beeld
   en de horizontale scrollbalk staat altijd onderaan het zichtbare vlak. */
.sched-wrap {
    padding: 0;
    overflow: auto;
    max-height: calc(100vh - 140px);
}
/* Hele draaidag verslepen op het bord */
.column-header.day-drag { cursor: grab; }
.schedule-column.day-dragging { opacity: 0.5; }
.schedule-column.day-drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }

.sched-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.76rem;
    line-height: 1.3;
    white-space: nowrap;
}
.sched-table th, .sched-table td {
    border: 1px solid #e5e7eb;
    padding: 3px 7px;
    text-align: left;
    vertical-align: top;
}
.sched-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    vertical-align: bottom;
}
.sched-table th.st-rot {
    padding: 6px 2px;
    height: 110px;
    width: 22px;
    max-width: 22px;
}
.sched-table th.st-rot span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: inline-block;
    max-height: 100px;
    overflow: hidden;
    font-weight: 500;
    font-size: 0.7rem;
}
.sched-table .st-num { text-align: right; }
.sched-table .st-nr { font-weight: 700; }
.sched-table .st-c { text-align: center; }
.sched-table .st-wide {
    white-space: normal;
    min-width: 260px;
    max-width: 360px;
}
.sched-table .st-muted { color: var(--text-light); font-size: 0.72rem; }
.sched-table .st-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.sched-table .st-dot.st-warn { background: #d97706; }
.sched-table tr.st-day td {
    background: #eef2f7;
    font-weight: 700;
    border-top: 2px solid var(--primary);
    position: sticky; left: 0;
}
.sched-table tr.st-day .st-day-tot { color: var(--accent-hover); margin-left: 0.75rem; }
.sched-table tr.st-unscheduled td { background: #fef3c7; border-top-color: #d97706; }
.sched-table tbody tr:hover td { background: #f8fafc; }
.sched-table tr.st-day:hover td { background: #eef2f7; }
@media print {
    .sched-table { font-size: 0.6rem; }
    .navbar, .page-header .actions { display: none !important; }
}

/* ---- Constraints & prioriteit (deterministische planner) ---- */
.constraints-layout {
    display: grid;
    grid-template-columns: 1fr 1.25fr 0.9fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 1100px) {
    .constraints-layout { grid-template-columns: 1fr; }
}
.constraints-panel h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}
.constraints-panel h2 i { color: var(--text-light); margin-right: 0.35rem; }
.constraints-hint { color: var(--text-light); font-size: 0.83rem; margin: 0 0 0.75rem; }
.constraints-search { position: relative; margin-bottom: 0.75rem; }
.constraints-search i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-light); font-size: 0.8rem;
}
.constraints-search .form-control { padding-left: 2rem; }
.constraints-list { display: flex; flex-direction: column; gap: 0.4rem; }
.constraint-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.constraint-icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--primary-light);
    font-size: 0.85rem;
}
.constraint-text { flex: 1; min-width: 0; line-height: 1.25; }
.constraint-text strong { font-size: 0.88rem; }
.constraint-text small { display: block; color: var(--text-light); font-size: 0.76rem; }
.priority-row { cursor: default; }
.priority-row .drag-handle { color: #94a3b8; cursor: grab; padding: 0 0.15rem; }
.priority-row.dragging { opacity: 0.45; border-style: dashed; border-color: var(--accent); }
.priority-num {
    width: 26px; height: 26px; flex: 0 0 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 0.8rem; font-weight: 700; color: var(--primary);
    background: #fff;
}
/* Fijnzinnige outline-pills (geen zwaar gevulde badges) */
.pill {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 0.55rem;
    font-size: 0.68rem;
    font-weight: 400;
    background: transparent;
    color: var(--text-light);
    vertical-align: middle;
    white-space: nowrap;
}
.pill-hard { border-color: var(--danger); color: var(--danger); }
.pill-soft { border-color: var(--warning); color: #b45309; }
.pill-muted { border-color: var(--border); color: var(--text-light); }
/* Aan/uit-schakelaar */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.15s ease;
    cursor: pointer;
}
.switch-slider::before {
    content: '';
    position: absolute; left: 3px; top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-disabled .switch-slider { cursor: not-allowed; opacity: 0.45; }
/* Dagselectie voor de scène-PDF: eigen balkje boven de kolomkop op het
   schemabord, buiten het versleepbare gebied. */
.day-select-bar {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem; color: var(--text-light);
    border-bottom: 1px solid var(--border);
}
.day-select-bar .switch { width: 32px; height: 18px; flex: 0 0 32px; }
.day-select-bar .switch-slider::before { width: 12px; height: 12px; }
.day-select-bar .switch input:checked + .switch-slider::before { transform: translateX(14px); }
.constraints-setting { padding: 0.5rem 0; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.constraints-setting strong { font-size: 0.88rem; }
.constraints-setting strong i { color: var(--text-light); margin-right: 0.3rem; }
.constraints-setting-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.constraints-setting-row > div { flex: 1; }
.constraints-setting-row .switch { margin-top: 0.2rem; }
.constraints-infobox {
    display: flex; gap: 0.6rem; align-items: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    color: #1e40af;
    margin: 0.75rem 0;
}
.constraints-infobox i { margin-top: 0.15rem; }
.constraints-actions { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0 0.5rem; }
.constraints-actions .btn { width: 100%; }
.constraints-unsaved { color: #d97706; font-size: 0.8rem; }
.constraints-unsaved i { font-size: 0.5rem; vertical-align: middle; }

/* Beschikbaarheidsvensters: fijnzinnige outline-pills in plaats van gevulde
   badges, en een licht getinte rij voor "alleen beschikbaar" — dat is de
   uitzonderlijke soort die opvalt zonder te schreeuwen. */
.avail-pill {
    display: inline-block;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.75rem;
    line-height: 1.5;
    white-space: nowrap;
}
.avail-pill-blocked { color: #b91c1c; }
.avail-pill-only    { color: #0369a1; }
.avail-pill-free    { color: #64748b; }
.avail-row-only     { background: rgba(2, 132, 199, 0.05); }
.avail-pill-tight   { color: #b45309; }

/* Soortkeuze als klikbare pillen (radio's): altijd precies één actief. */
.kind-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.kind-pills input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.kind-pills label {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.kind-pills label:hover { border-color: currentColor; }
.kind-pills input:checked + label.kind-blocked { color: #b91c1c; border-color: #b91c1c; background: rgba(185, 28, 28, 0.08); }
.kind-pills input:checked + label.kind-only    { color: #0369a1; border-color: #0369a1; background: rgba(3, 105, 161, 0.08); }
.kind-pills input:checked + label.kind-free    { color: #64748b; border-color: #64748b; background: rgba(100, 116, 139, 0.12); }
.kind-pills input:focus-visible + label { outline: 2px solid #0369a1; outline-offset: 2px; }

/* Beschikbaarheid, "Regel toevoegen": alles op één regel (wrapt pas op smalle
   schermen); datums en zeker de tijden veel smaller dan de standaardgrid. */
.avail-form-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.avail-form-row .form-group { margin-bottom: 0; }
.avail-form-row .fg-entity { flex: 1 1 220px; min-width: 190px; }
.avail-form-row .fg-date { flex: 0 0 150px; }
.avail-form-row .fg-time { flex: 0 0 105px; }
.avail-form-row .fg-time input { padding-right: 0.25rem; }
.avail-form-row .fg-notes { flex: 1 1 170px; min-width: 150px; }
.capacity-list { list-style: none; margin: 0; padding: 0; }
.capacity-item {
    display: flex; align-items: baseline; gap: 0.6rem;
    padding: 0.4rem 0; border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}
.capacity-item:last-child { border-bottom: none; }
.capacity-onmogelijk { color: #b91c1c; }
.capacity-krap { color: #b45309; }

/* Vergrendeld shooting script: subtiele markering, geen gevulde badge. */
.script-lock-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    border: 1px solid #0369a1; color: #0369a1; background: transparent;
    border-radius: 999px; font-size: 0.75rem; font-weight: 500;
    padding: 0.2rem 0.75rem; white-space: nowrap;
}

/* ---- Revisiepagina's ("blauwtjes") ----------------------------------
   Courier 12pt is exact 10 tekens per inch; de paginator rekent in
   tekens, dus de CSS hoeft alleen de maatvoering te spiegelen. */
.rev-swatch {
    display: inline-block; width: 0.85rem; height: 0.85rem;
    border-radius: 3px; border: 1px solid #cbd5e1; vertical-align: -1px;
    margin-right: 0.25rem;
}
.rev-white     { background: #ffffff; }
.rev-blue      { background: #cfe2f3; }
.rev-pink      { background: #f9d0dd; }
.rev-yellow    { background: #fdf1a9; }
.rev-green     { background: #cfe8cf; }
.rev-goldenrod { background: #f0d98c; }

.revision-page {
    position: relative;
    width: 8.5in;
    min-height: 11in;
    padding: 1in 1in 1in 1.5in;
    margin: 0 auto 1rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font-family: 'Courier New', Courier, monospace;
    font-size: 12pt;
    line-height: 1;
    box-sizing: border-box;
}
.revision-page.tint-blue      { background: #cfe2f3; }
.revision-page.tint-pink      { background: #f9d0dd; }
.revision-page.tint-yellow    { background: #fdf1a9; }
.revision-page.tint-green     { background: #cfe8cf; }
.revision-page.tint-goldenrod { background: #f0d98c; }

.revision-page .rev-header {
    position: absolute; top: 0.5in; right: 1in;
    text-align: right; font-size: 12pt; line-height: 1.2;
}
.rev-header-color { font-size: 9pt; letter-spacing: 0.03em; }

.rev-line { white-space: pre; position: relative; min-height: 1em; }
.rev-blank { min-height: 1em; }
/* Sterretje rechts in de kantlijn — industriestandaard, niet links. */
.rev-star { position: absolute; right: -0.5in; }

.rev-scene-heading { font-weight: bold; }
.rev-character     { margin-left: 2.2in; }
.rev-parenthetical { margin-left: 1.6in; }
.rev-dialogue      { margin-left: 1in; max-width: 3.5in; }
.rev-transition    { text-align: right; }

.revision-cover h2 { margin-top: 2in; }
.revision-history { width: 100%; margin-top: 1in; font-size: 10pt; border-collapse: collapse; }
.revision-history th, .revision-history td { text-align: left; padding: 2px 6px; border-bottom: 1px solid rgba(0,0,0,0.15); }
.revision-history tr.is-current { font-weight: bold; }

@media print {
    @page { size: letter; margin: 0; }
    .revision-page {
        margin: 0; box-shadow: none;
        page-break-after: always; break-after: page;
    }
    .revision-page:last-child { page-break-after: auto; break-after: auto; }
}
