/* Bestand: app.css
   Datum: 2026-07-19 15:35 CEST
   Versie: 1.3.0 */

:root {
    --outer-bg: #dfe4e8;
    --bg: #f3f5f7;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #66727d;
    --border: #d7dde3;
    --header: #eef1f4;
    --primary: #16618f;
    --primary-dark: #0f4c72;
    --green: #3b8d5a;
    --orange: #c88322;
    --red: #b74b4b;
    --warning-bg: #fff5dc;
    --error-bg: #fdecec;
    --success-bg: #e9f6ed;
    --shadow: 0 2px 10px rgba(23, 37, 49, 0.10);
    --content-max: 1320px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--outer-bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
}
a { color: var(--primary); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.topbar {
    background: var(--outer-bg);
    border-bottom: 1px solid #cbd2d8;
}
.topbar-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
    align-items: center;
    gap: 18px;
    width: min(var(--content-max), 100%);
    min-height: 78px;
    margin: 0 auto;
    padding: 3px 20px;
    background: var(--header);
    box-shadow: -1px 0 0 rgba(23, 37, 49, 0.07), 1px 0 0 rgba(23, 37, 49, 0.07), 0 1px 4px rgba(23, 37, 49, 0.08);
}
.customer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}
.customer-logo {
    display: block;
    max-width: 200px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}
.customer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
}
.main-nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    align-self: stretch;
}
.main-nav a {
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: #35414b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-dark);
    background: rgba(255,255,255,0.55);
    border-bottom-color: var(--primary);
}
.user-area {
    justify-self: end;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 7px;
    min-width: 250px;
}
.user-menu { position: relative; }
.user-menu summary {
    list-style: none;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary::after { content: " ▾"; font-size: 12px; }
.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    min-width: 190px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.user-menu-panel a,
.menu-button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: 0;
    color: var(--text);
    text-align: left;
    text-decoration: none;
}
.user-menu-panel a:hover,
.menu-button:hover { background: #eef3f6; }
.customer-selector-form select,
.single-customer {
    min-width: 250px;
    max-width: 360px;
}
.single-customer {
    color: var(--muted);
    text-align: right;
}

.page-shell {
    width: min(var(--content-max), 100%);
    min-height: calc(100vh - 79px);
    margin: 0 auto;
    padding: 18px 20px 40px;
    background: var(--bg);
    box-shadow: -1px 0 0 rgba(23, 37, 49, 0.07), 1px 0 0 rgba(23, 37, 49, 0.07);
}
.page-heading,
.heading-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}
h1, h2, h3 { margin-top: 0; }
.page-heading h1 { margin-bottom: 4px; }
.page-heading p, .intro-card p, .simple-card p { color: var(--muted); }

.intro-card,
.simple-card,
.form-card,
.filter-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.intro-card, .simple-card, .form-card { padding: 22px; }
.intro-card { width: 100%; }
.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin-top: 20px;
}
.portal-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.portal-tile strong { color: var(--primary-dark); font-size: 21px; }
.portal-tile span { color: var(--muted); }
.portal-tile:hover { border-color: #aebac4; }

.filter-card { padding: 16px; margin-bottom: 14px; }
.filter-grid {
    display: grid;
    gap: 12px;
    align-items: end;
}
.reservations-filter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.reservations-filter-grid .filter-wide { grid-column: span 2; }
.logs-filter-grid { grid-template-columns: minmax(340px, 2fr) repeat(3, minmax(180px, 1fr)); }
.filter-wide { min-width: 0; }
label > span,
.page-size-form label > span {
    display: block;
    margin-bottom: 5px;
    color: #495660;
    font-size: 13px;
    font-weight: 700;
}
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="datetime-local"], select {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #bfc8cf;
    border-radius: 5px;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus {
    outline: 2px solid rgba(22, 97, 143, 0.18);
    border-color: var(--primary);
}
.filter-actions, .form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.filter-checkbox { margin-right: auto; }
.filter-checkbox span { display: inline; margin-bottom: 0; }
.primary-button, .secondary-button, .text-button {
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: 600;
}
.primary-button {
    min-height: 38px;
    padding: 8px 15px;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.primary-button:hover { background: var(--primary-dark); }
.secondary-button {
    min-height: 38px;
    padding: 8px 15px;
    background: #fff;
    border-color: #aeb8c1;
    color: #35414b;
}
.text-button {
    padding: 5px 8px;
    background: #f5f7f8;
    border-color: #c7d0d7;
    color: var(--primary-dark);
}
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    color: var(--muted);
}
.page-size-form label {
    display: flex;
    align-items: center;
    gap: 7px;
}
.page-size-form label > span { margin: 0; }
.page-size-form select { width: 95px; min-height: 34px; }
.table-wrap {
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: var(--shadow);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: normal;
}
.data-table th,
.data-table td {
    padding: 10px 11px;
    border-bottom: 1px solid #e1e5e9;
    text-align: left;
    vertical-align: top;
}
.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e9edf0;
    color: #35414b;
    font-size: 13px;
    white-space: nowrap;
}
.data-table th a { color: inherit; text-decoration: none; }
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: #f0f5f8; }
.status-cell { width: 38px; text-align: center !important; }
.status-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}
button.status-dot { cursor: pointer; }
.status-active { background: var(--green); }
.status-suspended { background: var(--orange); }
.status-rejected { background: var(--red); }

.details-cell {
    width: 78px;
    text-align: right !important;
    white-space: nowrap;
}
.subtle-detail-button {
    padding: 4px 8px;
    font-size: 13px;
    background: transparent;
}
.subtle-detail-button:hover { background: #eef3f6; }
.reservations-table { min-width: 1280px; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.badge-active { background: #e6f3ea; border-color: #a8ceb4; color: #286a42; }
.badge-suspended { background: #fff1dc; border-color: #e4c089; color: #8a5813; }
.badge-vip { background: #e8eef7; border-color: #b8c7dc; color: #385473; }
.badge-plate { background: #eef2f5; border-color: #c5ced5; color: #46545f; }
.badge-qr { background: #eee9f7; border-color: #cbbde2; color: #60487c; }
.value-with-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.mono { font-family: Consolas, "Courier New", monospace; }
.nowrap { white-space: nowrap; }
.empty-state { padding: 28px !important; text-align: center !important; color: var(--muted); }
.subtle, .field-help, small { color: var(--muted); font-size: 13px; }
.actions-cell { display: flex; gap: 7px; align-items: center; }
.actions-cell form { margin: 0; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 16px;
}
.pagination a, .pagination span {
    min-width: 34px;
    padding: 7px 9px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    text-decoration: none;
}
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled, .pagination .ellipsis { color: #9aa4ac; background: transparent; }

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: #e9edf0;
}
.login-card {
    width: min(420px, 100%);
    padding: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; font-size: 24px; }
.login-logo {
    display: block;
    max-width: 190px;
    max-height: 90px;
    margin: 0 auto 18px;
    object-fit: contain;
}
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.forgot-link { display: block; margin-top: 16px; text-align: center; }
.narrow-card { max-width: 620px; }
.wide-form-card { max-width: 980px; }
.two-column-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-line input { width: auto; }
.customer-access-list {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.customer-access-list legend { padding: 0 7px; font-weight: 700; }
.customer-permissions-header,
.customer-permissions-row {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(120px, 1fr));
    gap: 12px;
    align-items: center;
}
.customer-permissions-header {
    padding: 0 8px 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.customer-permissions-row {
    padding: 10px 8px;
    border-top: 1px solid var(--border);
}
.customer-access-checkbox { font-weight: 700; }
.module-permission-checkbox span { display: none; }

.alert {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 5px;
}
.alert-warning { background: var(--warning-bg); border-color: #e2c57e; }
.alert-error { background: var(--error-bg); border-color: #dea4a4; }
.alert-success { background: var(--success-bg); border-color: #9bc8a9; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 35, 0.52); }
.modal-panel {
    position: relative;
    z-index: 1;
    width: min(1050px, calc(100% - 36px));
    max-height: calc(100vh - 36px);
    margin: 18px auto;
    overflow: auto;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.28);
}
.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #edf1f4;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; overflow-wrap: anywhere; }
.icon-button {
    border: 0;
    background: transparent;
    color: #35414b;
    font-size: 28px;
    line-height: 1;
}
.modal-content { padding: 18px; }
.detail-section + .detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.detail-grid {
    display: grid;
    grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.detail-grid dt, .detail-grid dd { margin: 0; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.detail-grid dt { background: #f0f3f5; font-weight: 700; }
.detail-grid dd { overflow-wrap: anywhere; }
.payload-block { margin-top: 18px; }
.payload-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.payload-header h3 { margin: 0; }
.payload-block pre {
    margin: 0;
    padding: 13px;
    overflow: auto;
    background: #1f252a;
    color: #edf3f7;
    border-radius: 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
body.modal-open { overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1200px) {
    .topbar-inner { grid-template-columns: 1fr; gap: 7px; width: 100%; padding: 6px 12px; }
    .main-nav { order: 3; justify-content: center; min-height: 45px; }
    .user-area { position: absolute; right: 12px; top: 10px; }
    .filter-grid, .reservations-filter-grid, .logs-filter-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .filter-wide, .reservations-filter-grid .filter-wide { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .page-shell { width: 100%; padding: 14px 8px 32px; }
    .topbar-inner { width: 100%; }
    .customer-name { font-size: 15px; }
    .customer-logo { max-width: 130px; max-height: 58px; }
    .user-area { position: static; justify-self: stretch; align-items: stretch; }
    .customer-selector-form select, .single-customer { min-width: 0; width: 100%; max-width: none; text-align: left; }
    .main-nav { overflow-x: auto; justify-content: flex-start; }
    .main-nav a { padding: 0 11px; }
    .tile-grid, .two-column-form, .filter-grid, .logs-filter-grid { grid-template-columns: 1fr; }
    .customer-permissions-header { display: none; }
    .customer-permissions-row { grid-template-columns: 1fr; gap: 8px; }
    .module-permission-checkbox { padding-left: 28px; }
    .module-permission-checkbox span { display: inline; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid dt { border-bottom: 0; }
}
