/* Huisstijl scooterrent.nl: groen en antraciet uit het logo, Roboto + Roboto Slab (zelf gehost). */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/roboto-latin.woff2) format('woff2'); }
@font-face { font-family: 'Roboto Slab'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/roboto-slab-latin.woff2) format('woff2'); }

:root {
    --green: #94bc1c;        /* logo */
    --green-hover: #a3c93a;  /* hover: lichter, tekst blijft donker */
    --green-text: #56700f;   /* groene tekst op wit (contrast > 4.5:1) */
    --green-soft: #f3f8e6;
    --green-softer: #e8f1cc;
    --ink: #2b2b2b;          /* logo antraciet */
    --navy: #16163f;         /* website */
    --text: #2d3748;
    --muted: #718096;
    --border: #e2e8f0;
    --bg: #f5f7f2;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 'Roboto', system-ui, sans-serif; color: var(--text); background: var(--bg); }
h1, h2, h3 { font-family: 'Roboto Slab', Georgia, serif; color: var(--ink); }
h2 { font-weight: 700; }
a { color: var(--green-text); }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 24px; background: #fff; border-bottom: 4px solid var(--green); box-shadow: 0 1px 6px rgba(22, 22, 63, .06); }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { height: 48px; width: auto; display: block; }
.brand span { font-family: 'Roboto Slab', Georgia, serif; font-weight: 600; font-size: 17px; color: var(--ink); padding-left: 16px; border-left: 2px solid var(--border); }
main { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(22, 22, 63, .04); }
.login { max-width: 380px; margin: 64px auto; border-top: 4px solid var(--green); }
@media (max-width: 560px) {
    header { padding: 8px 16px; }
    .brand img { height: 36px; }
    .brand span { display: none; }
}
label { display: block; margin: 12px 0 4px; }
input[type=text], input[type=password] { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
button { margin-top: 16px; padding: 9px 18px; border: 0; border-radius: 6px; background: var(--green); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: var(--green-hover); }
.link, .link:hover { background: none; color: var(--muted); margin: 0; padding: 0; font-weight: 500; }
.link:hover { color: var(--ink); }
.error { color: #b00020; }
.muted { color: var(--muted); }
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filter label { margin: 0; }
.filter input { padding: 6px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.filter button { margin: 0; }
.quick-links { display: flex; gap: 12px; align-self: center; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
th { font-weight: 500; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
main:has(.layout.has-detail), main:has(.dashboard), main:has(.contract-preview), main:has(.detail-grid) { max-width: 1500px; }
.layout { display: grid; gap: 16px; align-items: start; }
.layout > * { min-width: 0; }   /* grid-kolom mag smaller worden dan de tabel; de tabel scrollt dan zelf */
.layout.has-detail { grid-template-columns: minmax(300px, 2fr) minmax(300px, 3fr); }

/* Eén aanvraag als hele pagina: gegevens links, huurovereenkomst rechts (op smalle schermen eronder). */
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 840px); gap: 16px; align-items: start; }
.detail-grid > * { min-width: 0; }
.contract-panel { position: sticky; top: 16px; }
.contract-panel .contract-frame { height: calc(100vh - 140px); min-height: 500px; margin-top: 4px; }
.form-page .detail { max-width: 900px; }
@media (max-width: 1250px) {
    .detail-grid { grid-template-columns: 1fr; }
    .contract-panel { position: static; }
    .contract-panel .contract-frame { height: 80vh; }
}
.layout .detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.detail h2 { margin: 0 0 4px; }
.detail h3 { margin: 20px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--green); padding-bottom: 4px; }
.detail dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.detail .notes { margin: 0; white-space: normal; }
.detail .close { float: right; font-size: 22px; line-height: 1; color: var(--muted); text-decoration: none; }
.vehicles { list-style: none; margin: 0 0 8px; padding: 0; }
.vehicles li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-weight: 600; }
.vehicles li .muted { font-weight: 400; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--green); color: var(--ink); font-size: 12px; vertical-align: middle; text-transform: capitalize; }
.small { font-size: 13px; }
.button { display: inline-block; margin-top: 16px; padding: 9px 18px; border-radius: 6px; background: var(--green); color: var(--ink); font-weight: 700; text-decoration: none; }
.button:hover { background: var(--green-hover); }
.bookings tbody tr { cursor: pointer; }
.bookings tbody tr:hover { background: var(--green-soft); }
.bookings tbody tr.selected { background: var(--green-softer); box-shadow: inset 3px 0 0 var(--green); }
@media (max-width: 800px) {
    .layout.has-detail { grid-template-columns: 1fr; }
    .layout .detail { position: static; max-height: none; }
    .bookings { display: block; overflow-x: auto; }
    .filter label { max-width: 100%; }
    .filter input, .filter select { max-width: 100%; }
    .card { padding: 16px; }
}
.nowrap { white-space: nowrap; }
.filter select { padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status-nieuw       { background: #e8f0fe; color: #1a56b8; border-color: #c4d7f8; }
.status-bevestigd   { background: var(--green-soft); color: #4d6410; border-color: #d4e5a4; }
.status-check_in    { background: #fff4d6; color: #8a5a00; border-color: #f1dc9f; }
.status-actief      { background: var(--green); color: var(--ink); }
.status-check_out   { background: #e6f3f7; color: #1f6577; border-color: #bfdfe8; }
.status-afgerond    { background: #eceff1; color: #455a64; border-color: #d5dbdf; }
.status-geannuleerd { background: #fdecea; color: #a12a1e; border-color: #f5c6c0; }
.status-no_show     { background: #fbe9f3; color: #8e2463; border-color: #f0c4dc; }
.status-overige     { background: #eef0f7; color: #45496e; border-color: #d6d9e8; }
.status-archief     { background: #f4f4f4; color: #888; border-color: #e2e2e2; }
.warn-icon { margin-left: 4px; cursor: help; }
.status-box { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbf7; }
.status-now .status { font-size: 14px; padding: 4px 12px; }
.warning { margin: 8px 0 0; color: #8a5a00; font-size: 13px; }
.status-form, .note-form { margin-top: 12px; }
.status-form label, .note-form label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.inline-field { display: flex; gap: 6px; }
.inline-field select { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; }
.inline-field button { margin: 0; white-space: nowrap; }
.note-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 14px; resize: vertical; }
.note-form button { margin-top: 6px; padding: 6px 12px; font-size: 13px; }
.note-form .secondary { background: #fff; color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.note-form .secondary:hover { background: #f1f1f1; color: var(--ink); }
.note-label { font-style: italic; }
.history { list-style: none; margin: 12px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--border); font-size: 13px; }
.history li { padding: 2px 0; overflow-wrap: anywhere; word-break: break-word; }
.warning, .history li .muted { overflow-wrap: anywhere; word-break: break-word; }
.attachments { list-style: none; margin: 0; padding: 0; }
.attachments li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.attachments form { margin-left: auto; }
.attachments .link { font-size: 20px; line-height: 1; padding: 0 4px; }
.attachments .link:hover { color: #b00020; }
.attachment-preview { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fafbfa; text-decoration: none; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-icon { font-size: 11px; font-weight: 600; color: var(--muted); }
.attachment-info { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.attachment-info a { color: var(--text); overflow-wrap: anywhere; }
.upload-form { margin-top: 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 6px; }
.upload-form input[type=file] { width: 100%; font-size: 13px; }
.upload-form button { margin-top: 8px; padding: 6px 12px; font-size: 13px; }
.upload-form .secondary { background: #fff; color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.upload-form .secondary:hover { background: #f1f1f1; color: var(--ink); }
.upload-form p { margin: 6px 0 0; }

/* Navigatie */
header { flex-wrap: wrap; }
.main-nav { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.main-nav a { padding: 8px 14px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.main-nav a:hover { background: var(--green-soft); }
.main-nav a.active { background: var(--green-softer); color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--green); }
@media (max-width: 800px) { .main-nav { order: 3; width: 100%; margin: 4px 0 0; overflow-x: auto; } }

/* Kop van een kaart met knoppen */
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h1, .card-head h2 { margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-actions .button, .card-actions button { margin: 0; }
.button.secondary, button.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.button.secondary:hover, button.secondary:hover { background: #f1f1f1; color: var(--ink); }
.flash { padding: 8px 12px; border-radius: 6px; background: var(--green-soft); color: var(--ink); }
.filter input[type=search] { min-width: 220px; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--ink); text-decoration: underline; }
th[aria-sort] { color: var(--ink); }
.sort-arrow { color: var(--green-text); }

/* Formulieren in het detailpaneel */
.booking-form input[type=text], .booking-form input[type=email], .booking-form input[type=tel], .booking-form input[type=date],
.booking-form input[type=datetime-local], .booking-form select, .booking-form textarea, .handover-form input[type=text], .handover-form select,
.note-input, .upload-form select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 14px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid label { margin: 8px 0 0; font-size: 13px; font-weight: 500; }
.form-grid label input, .form-grid label select { margin-top: 4px; }
.form-grid .wide { grid-column: 1 / -1; }
.block-label { margin: 12px 0 4px; font-size: 13px; font-weight: 500; }
.vehicle-select { margin-bottom: 6px; }
.form-buttons { display: flex; align-items: center; gap: 16px; }
.note-input { margin-top: 8px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Beschikbaarheid, uitgifte, inname, afronden */
.availability { list-style: none; margin: 0; padding: 0; }
.availability li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.availability .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.availability .ok .mark { background: var(--green-soft); color: var(--green-text); }
.availability .short .mark { background: #fdecea; color: #a12a1e; }
.short-text { color: #a12a1e; }
.handover-form { margin-top: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbf7; }
.handover-form > p:first-of-type { margin-top: 0; }
.handover-line { margin-bottom: 10px; }
.handover-line label, .deposit-fields label, .settle-grid label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.handover-form .inline-field input.km { flex: none; width: 110px; }
.handover-form .inline-field input.amount { flex: none; width: 90px; }
.euro { align-self: center; color: var(--muted); }
.deposit-fields { margin-top: 12px; }
.settle-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.settle-grid label { margin: 0; }
.issued { list-style: none; margin: 0; padding: 0; }
.issued li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.plate { display: inline-block; padding: 0 6px; border-radius: 3px; background: #f7d117; color: #1a1a1a; font-weight: 700; font-size: 12px; letter-spacing: .05em; }
.deposit-line { margin: 8px 0 0; }
.badge-open { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #fff4d6; color: #8a5a00; font-size: 12px; font-weight: 600; }

/* Bijlagen: soort, camera */
.upload-form label[for=context] { margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.upload-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.upload-buttons .button { margin: 0; cursor: pointer; position: relative; overflow: hidden; }
.upload-buttons input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 0; }
.upload-form.busy { opacity: .6; pointer-events: none; }
.upload-form.busy::after { content: 'Bezig met uploaden…'; display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.context-label { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 8px; background: #eef0f7; color: #45496e; font-size: 11px; font-weight: 600; }
.contract-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Overeenkomst bekijken */
.contract-frame { display: block; width: 100%; height: calc(100vh - 220px); min-height: 600px; margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; background: #e9ecef; }

/* Voertuigen */
.status-v-beschikbaar    { background: var(--green-soft); color: #4d6410; border-color: #d4e5a4; }
.status-v-verhuurd       { background: #e8f0fe; color: #1a56b8; border-color: #c4d7f8; }
.status-v-te_controleren { background: #fff4d6; color: #8a5a00; border-color: #f1dc9f; }
.status-v-onderhoud      { background: #fdecea; color: #a12a1e; border-color: #f5c6c0; }
.status-v-uit_dienst     { background: #eceff1; color: #455a64; border-color: #d5dbdf; }
.vehicle-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.vehicle-counts a { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: 16px; color: var(--text); text-decoration: none; font-size: 13px; }
.vehicle-counts a.active, .vehicle-counts a:hover { border-color: var(--green); background: var(--green-soft); }

/* Dagoverzicht */
.dashboard > .card-head { margin-bottom: 16px; }
.today-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.count-tile { display: block; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.count-tile strong { display: block; font-family: 'Roboto Slab', Georgia, serif; font-size: 28px; line-height: 1.1; color: var(--ink); }
.count-tile.alert { border-left-color: #d9480f; }
.count-tile.alert strong { color: #b33a0b; }
.count-tile:hover { background: var(--green-soft); }
.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-section { margin-bottom: 16px; }
.dash-section h2 { margin: 0 0 4px; }
.dash-section h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--green); padding-bottom: 4px; }
.dash-section.attention { border-left: 4px solid #d9480f; }
.dash-section.attention h3 { border-bottom-color: #f1c4ad; }
.day-list { list-style: none; margin: 0; padding: 0; }
.day-list li { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); cursor: pointer; }
.day-list li:hover { background: var(--green-soft); }
.day-list .when { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 14px; }
.day-list .who { display: flex; flex-direction: column; min-width: 0; }
.day-list .who a { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 4px 0; }
@media (max-width: 900px) { .dash-columns { grid-template-columns: 1fr; } }

.print-button { margin: 0; }
.print-button.busy, [data-print].busy { opacity: .6; cursor: progress; }
/* Downloadknoppen in de kleur van het bestandstype (witte tekst, contrast > 4.5:1). */
.button-excel { background: #1d6f42; color: #fff; }
.button-excel:hover { background: #185c37; color: #fff; }
.button-pdf { background: #b3261e; color: #fff; }
.button-pdf:hover { background: #941f19; color: #fff; }

/* Accounts: wie deed wat in de geschiedenis, en wie is ingelogd */
.history .by { display: inline-block; margin: 0 4px; padding: 0 6px; border-radius: 8px; background: #eef4dc; color: var(--ink); font-size: 12px; font-weight: 600; }
header form { display: flex; align-items: center; gap: 10px; }
