/* Luc & Roel — Overzicht
   Tim redesign: TWBA-stijl, tegel-navigatie (geen sidebar) */

/* === LANDING PAGINA (tegels) === */

.landing {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--content-padding) var(--space-lg);
}

.landing-header {
    margin-bottom: var(--space-xl);
}

.landing-header h1 {
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
}

.tile-section-label {
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tekst-tertiair);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

.tile-section-label:first-child {
    margin-top: 0;
}

/* Hero tegel (KPI's) — hele breedte */
.tile-hero {
    margin-bottom: var(--space-lg);
    padding: var(--space-xl) var(--space-lg);
}

.tile-hero .tile-name {
    font-size: 1rem;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-kaart);
    border: 1px solid var(--border-licht);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--tekst);
    transition: border-color var(--transitie);
    cursor: pointer;
}

.tile:hover {
    border-color: var(--border-sterk);
}

.tile:active {
    background: var(--bg-hover);
}

.tile-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
    opacity: 0.45;
    transition: opacity var(--transitie);
}

.tile:hover .tile-icon {
    opacity: 0.7;
}

.tile-name {
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
}

/* Projecttegels: compact, kleiner */
.tile-grid-compact {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.tile-grid-compact .tile {
    padding: 12px var(--space-sm);
}

.tile-grid-compact .tile-name {
    font-size: 0.8rem;
}

/* === DETAIL PAGINA === */

.detail-page {
    max-width: var(--max-breedte);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.back-link {
    position: fixed;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tekst);
    text-decoration: none;
    z-index: 100;
    cursor: pointer;
    transition: color var(--transitie);
}

.back-link:hover {
    color: var(--tekst-secundair);
}

/* Verberg "← Home" als detail-page zichtbaar is */
.detail-page:not(.hidden) ~ script + .lr-terug,
body:has(.detail-page:not(.hidden)) .lr-terug {
    display: none;
}

/* === MODULE CONTENT === */

.loading {
    color: var(--tekst-tertiair);
    padding: var(--space-xl);
    font-size: 0.9rem;
}

/* Metrics grid */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.metric-card {
    background: var(--bg-kaart);
    border: 1px solid var(--border-licht);
    border-radius: var(--radius);
    padding: var(--space-lg);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--tekst-tertiair);
    letter-spacing: 0.04em;
    margin-bottom: var(--space-sm);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--tekst);
}

.metric-value.positief { color: var(--groen); }
.metric-value.negatief { color: var(--rood); }
.metric-value.waarschuwing { color: var(--oranje); }

.metric-sub {
    font-size: 0.75rem;
    color: var(--tekst-tertiair);
    margin-top: var(--space-xs);
}

/* Alerts */
.alerts {
    margin-bottom: var(--space-lg);
}

.alert {
    display: flex;
    align-items: center;
    padding: 10px var(--space-md);
    border-radius: var(--radius);
    margin-bottom: var(--space-sm);
    font-size: 0.85rem;
}

.alert-waarschuwing {
    background: var(--oranje-bg);
    border: 1px solid var(--oranje);
    color: var(--oranje);
}

.alert-kritiek {
    background: var(--rood-bg);
    border: 1px solid var(--rood);
    color: var(--rood);
}

.alert-info {
    background: var(--blauw-bg);
    border: 1px solid var(--blauw);
    color: var(--blauw);
}

.alert-icon { margin-right: 10px; font-size: 14px; }

/* Tabellen */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: var(--font-weight-medium);
    color: var(--tekst-tertiair);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-licht);
}

.data-table tr:hover { background: var(--bg-hover); }

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .code {
    font-weight: var(--font-weight-bold);
}

.data-table .positief { color: var(--groen); }
.data-table .negatief { color: var(--rood); }

/* Progress bar */
.progress-cel { width: 110px; }

.progress-bar {
    width: 100px;
    height: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
}

.progress-fill.alert { background: var(--oranje); }
.progress-fill.over { background: var(--rood); }

.groep-header td {
    font-weight: var(--font-weight-bold);
    font-size: 0.8rem;
    padding-top: 20px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--border);
    color: var(--tekst-secundair);
    letter-spacing: 0.04em;
}

.groep-header:first-child td {
    padding-top: 4px !important;
}

/* Opname calculator */
.calculator {
    background: var(--bg-kaart);
    border: 1px solid var(--border-licht);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.calculator h3 {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-md);
}

.calc-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: 12px;
    align-items: center;
}

.calc-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    width: 160px;
    background: var(--bg-kaart);
    color: var(--tekst);
}

.calc-input:focus {
    border-color: var(--accent);
    outline: none;
}

.calc-label {
    font-size: 0.85rem;
    color: var(--tekst-secundair);
    min-width: 140px;
}

.calc-result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.calc-result .big {
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
}

.calc-btn {
    padding: 8px 20px;
    background: var(--accent);
    color: var(--tekst-invert);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    font-weight: var(--font-weight-medium);
    transition: background var(--transitie);
}

.calc-btn:hover { background: var(--accent-hover); }

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: var(--space-xl);
}

/* Sectie headers */
.section-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-md);
    margin-top: var(--space-xl);
}

.section-title:first-child { margin-top: 0; }

/* Week cards (uren view) */
.week-card {
    background: var(--bg-kaart);
    border: 1px solid var(--border-licht);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: 12px;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.week-label {
    font-weight: var(--font-weight-bold);
    font-size: 0.9rem;
}

.week-meta {
    font-size: 0.75rem;
    color: var(--tekst-tertiair);
}

.week-grid {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr) 80px;
    gap: 4px;
    font-size: 0.8rem;
}

.week-grid .header {
    font-weight: var(--font-weight-medium);
    color: var(--tekst-tertiair);
    font-size: 0.7rem;
}

.week-grid .total {
    font-weight: var(--font-weight-bold);
}

/* Badge */
.badge-actief { background: var(--accent); color: var(--tekst-invert); }
.badge-gepland { background: var(--bg-hover); color: var(--tekst); }
.badge-wacht { background: var(--oranje-bg); color: var(--oranje); }
.badge-nawerk { background: var(--bg-hover); color: var(--tekst-secundair); }

/* Entries list (opnames) */
.entries-list {
    margin-top: var(--space-md);
}

.entry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-licht);
    font-size: 0.85rem;
}

.entry-datum { color: var(--tekst-tertiair); width: 100px; }
.entry-persoon { width: 60px; font-weight: var(--font-weight-medium); }
.entry-omschrijving { flex: 1; }
.entry-bedrag { width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
.entry-type {
    width: 100px;
    font-size: 0.7rem;
    color: var(--tekst-tertiair);
}

/* Rubricering view */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-lg);
    padding: 12px var(--space-md);
    background: var(--bg-kaart);
    border: 1px solid var(--border-licht);
    border-radius: var(--radius);
}

.filter-label {
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
    color: var(--tekst-secundair);
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font);
    background: var(--bg-kaart);
    color: var(--tekst);
    min-width: 200px;
}

.filter-count {
    font-size: 0.75rem;
    color: var(--tekst-tertiair);
    margin-left: auto;
}

.import-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-kaart);
    color: var(--tekst);
    cursor: pointer;
    white-space: nowrap;
}

.import-btn:hover {
    background: var(--bg-hover, #f2f2f2);
}

.import-status {
    font-size: 0.75rem;
    color: var(--tekst-secundair);
}

.rubricering-tabel {
    font-size: 0.8rem;
}

.rubricering-tabel td {
    padding: 6px 8px;
    vertical-align: middle;
}

.rubricering-tabel th {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1;
}

/* Rubriek select */
.rubriek-select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-licht);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font);
    background: var(--bg-kaart);
    color: var(--tekst);
    cursor: pointer;
}

.rubriek-select:focus {
    border-color: var(--accent);
    outline: none;
}

.project-select,
.project-input {
    width: 90px;
    padding: 4px 6px;
    border: 1px solid var(--border-licht);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font);
    background: var(--bg-kaart);
    color: var(--tekst);
    cursor: pointer;
}

.project-input {
    text-align: center;
    text-transform: uppercase;
}

.project-select:focus,
.project-input:focus {
    border-color: var(--accent);
    outline: none;
}

.rij-vraag {
    background: var(--accent-warm-bg) !important;
}

.rij-vraag:hover {
    background: var(--bg-hover) !important;
}

.vraag-tekst {
    font-size: 0.7rem;
    color: var(--oranje);
    margin-top: 2px;
    font-style: italic;
}

/* Splits-editor (rubricering: één bankregel over meerdere rubrieken) */
.splits-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.35;
    padding: 2px 4px;
}

.splits-btn:hover { opacity: 1; }

.rij-gesplitst .splits-btn { opacity: 0.7; }

.splits-subregel {
    font-size: 0.7rem;
    color: var(--tekst-secundair);
    margin-top: 2px;
    padding-left: 10px;
}

.splits-notitie { color: var(--tekst-tertiair); font-style: italic; }

.gesplitst-label {
    font-size: 0.75rem;
    color: var(--tekst-secundair);
    font-style: italic;
}

.splits-editor td {
    background: var(--bg-hover, #f7f7f7);
    padding: 10px 12px;
}

.splits-regel {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.splits-bedrag { width: 90px; text-align: right; }

.splits-bedrag,
.splits-rubriek,
.splits-project,
.splits-notitie-input {
    padding: 4px 6px;
    border: 1px solid var(--border-licht);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font);
    background: var(--bg-kaart);
    color: var(--tekst);
}

.splits-notitie-input { flex: 1; }

.splits-btw,
.splits-weg,
.splits-add,
.splits-annuleer,
.splits-opslaan,
.splits-opheffen {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    background: var(--bg-kaart);
    color: var(--tekst);
    cursor: pointer;
    white-space: nowrap;
}

.splits-btw { padding: 4px 6px; }
.splits-weg { border: none; background: none; opacity: 0.4; }
.splits-weg:hover { opacity: 1; }

.splits-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.splits-spacer { margin-left: auto; }

.splits-rest {
    font-size: 0.75rem;
    color: var(--oranje);
    font-weight: var(--font-weight-bold);
}

.splits-rest-ok { color: var(--groen, #2e7d32); }

.splits-opslaan:disabled { opacity: 0.4; cursor: default; }

/* Invoer view */
.invoer-week { margin-bottom: var(--space-xl); }
.invoer-persoon { margin-bottom: var(--space-md); }

.invoer-persoon-label {
    font-weight: var(--font-weight-bold);
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--tekst);
}

.invoer-tabel {
    font-size: 0.8rem;
    margin-bottom: var(--space-sm);
    table-layout: fixed;
    width: 100%;
}

.invoer-tabel th {
    padding: 4px 6px;
    font-size: 0.7rem;
}

.invoer-tabel td {
    padding: 2px 3px;
}

.invoer-tabel input[type="time"] {
    padding: 4px 2px;
    font-size: 0.75rem;
}
.invoer-tabel input[type="time"]::-webkit-calendar-picker-indicator {
    margin-left: 0;
    padding: 0;
    width: 12px;
    opacity: 0.4;
}

.invoer-rij-label {
    font-size: 0.75rem;
    color: var(--tekst-secundair);
    font-weight: var(--font-weight-medium);
    padding-left: 8px !important;
}

.invoer-sublabel {
    font-size: 0.7rem !important;
    color: var(--tekst-tertiair) !important;
    font-weight: var(--font-weight-regular) !important;
    padding-left: 16px !important;
    font-style: italic;
}

.invoer-locatie {
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    color: var(--tekst-secundair);
}

.invoer-locatie option {
    font-size: 0.8rem;
}

.invoer-cel {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-licht);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font);
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--bg-kaart);
    color: var(--tekst);
}

.invoer-cel:focus {
    border-color: var(--accent);
    outline: none;
}

.invoer-cel.onzeker {
    background: var(--accent-warm-bg);
    border-color: var(--accent-warm);
}

.invoer-cel:disabled {
    background: var(--bg);
    color: var(--tekst-tertiair);
    border-color: var(--border-licht);
}

.invoer-uren { width: 55px; }
.invoer-nieuw-project { width: 90px; text-align: left; }

.invoer-uren-pair {
    display: flex;
    gap: 2px;
    width: 100%;
    align-items: stretch;
}

.invoer-uren-pair .invoer-uu {
    flex: 1 1 50%;
    width: auto;
    padding: 4px 2px;
    min-width: 0;
}

.invoer-uren-pair .invoer-mm {
    flex: 1 1 50%;
    min-width: 0;
    padding: 4px 2px;
    border: 1px solid var(--border-licht);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font);
    text-align: center;
    background: var(--bg-kaart);
    color: var(--tekst-secundair);
    font-variant-numeric: tabular-nums;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.invoer-uren-pair.onzeker .invoer-uu,
.invoer-uren-pair.onzeker .invoer-mm {
    background: var(--accent-warm-bg);
    border-color: var(--accent-warm);
}

.vraag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--oranje);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold);
    cursor: help;
}

/* === GANTT CHART === */
.gantt-container { overflow-x: hidden; border: 1px solid var(--border-licht); border-radius: var(--radius); }
.gantt-header { display: flex; border-bottom: 1px solid var(--border-licht); background: var(--bg-kaart); position: sticky; top: 0; z-index: 2; }
.gantt-label-col { width: 220px; min-width: 220px; padding: 8px 12px; font-size: 0.7rem; font-weight: var(--font-weight-medium); color: var(--tekst-tertiair); letter-spacing: 0.04em; border-right: 1px solid var(--border-licht); }
.gantt-weeks { display: flex; flex: 1; }
.gantt-week-header { flex: 1; text-align: center; padding: 8px 2px; font-size: 0.65rem; font-weight: var(--font-weight-medium); color: var(--tekst-tertiair); border-right: 1px solid var(--border-licht); }
.gantt-week-header.current { background: var(--accent); color: var(--tekst-invert); font-weight: var(--font-weight-bold); }
.gantt-row { display: flex; border-bottom: 1px solid var(--border-licht); min-height: 40px; align-items: center; }
.gantt-row:hover { background: var(--bg-hover); }
.gantt-project-label { width: 220px; min-width: 220px; padding: 8px 12px; font-size: 0.8rem; font-weight: var(--font-weight-medium); color: var(--tekst); border-right: 1px solid var(--border-licht); display: flex; align-items: center; gap: 8px; }
.gantt-project-code { font-size: 0.65rem; font-weight: var(--font-weight-bold); color: var(--tekst-tertiair); font-family: monospace; }
.gantt-bars { display: flex; flex: 1; position: relative; height: 40px; align-items: center; }
.gantt-cell { flex: 1; height: 100%; border-right: 1px solid var(--border-licht); }
.gantt-bar { position: absolute; height: 24px; top: 8px; border-radius: var(--radius-sm); opacity: 0.85; }
.gantt-bar:hover { opacity: 1; }
.gantt-bar-label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 0.65rem; font-weight: var(--font-weight-medium); color: var(--tekst-invert); white-space: nowrap; pointer-events: none; }
.gantt-fase-voorb { background: var(--border-sterk); }
.gantt-fase-werkpl { background: var(--accent); }
.gantt-fase-plaat { background: var(--tekst-secundair); }
/* Zacht ingepland: gearceerd — claimt capaciteit, geld alleen in verwacht-lijn */
.gantt-bar.gantt-zacht { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 5px, rgba(255,255,255,0.55) 5px, rgba(255,255,255,0.55) 9px); }
.gantt-bar.gantt-zacht .gantt-bar-label { color: var(--tekst); text-shadow: 0 0 3px rgba(255,255,255,0.8); }
.gantt-legend { display: flex; gap: 20px; padding: 10px 12px; font-size: 0.7rem; color: var(--tekst-tertiair); border-top: 1px solid var(--border-licht); }
.gantt-legend-item { display: flex; align-items: center; gap: 6px; }
.gantt-legend-swatch { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }

/* === Type badges (kasboek/transacties) === */
.type-vast { background: var(--bg-hover); color: var(--tekst-secundair); }
.type-klantbetaling { background: var(--groen-bg); color: var(--groen); }
.type-materiaal { background: var(--oranje-bg); color: var(--oranje); }
.type-btw { background: var(--rood-bg); color: var(--rood); }
.type-los { background: var(--blauw-bg); color: var(--blauw); }

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .landing { padding: var(--space-lg) var(--space-md); }
    .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .detail-page { padding: var(--space-lg) var(--space-md); }
    .metrics { grid-template-columns: 1fr 1fr; }
    .week-grid { font-size: 0.7rem; }
}
