:root {
    color-scheme: light;
    --page: #f5f7f6;
    --surface: #fff;
    --surface-soft: #f8faf9;
    --text: #17231e;
    --muted: #68756f;
    --line: #e1e8e4;
    --accent: #18794e;
    --accent-dark: #11613e;
    --accent-soft: #e8f4ed;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --shadow: 0 12px 34px rgb(24 44 34 / 6%);
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 76px;
    padding: 0.85rem max(1.5rem, calc((100vw - 1160px) / 2));
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 0.7rem;
    color: #fff;
    background: var(--accent);
    font-size: 1.05rem;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.site-nav a {
    padding: 0.48rem 0.68rem;
    border-radius: 0.55rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent-dark); background: var(--accent-soft); }

.page-shell { width: min(100% - 2rem, 960px); margin: 0 auto; padding: 3rem 0 4.5rem; }
.page-heading { margin-bottom: 1.6rem; }
.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1.2; letter-spacing: -0.035em; }
h2 { margin: 0 0 0.65rem; font-size: 1.15rem; line-height: 1.35; }
p { margin: 0 0 1rem; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.panel {
    padding: clamp(1.1rem, 3vw, 1.7rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.panel + .panel, .panel + .page-links { margin-top: 1rem; }
.panel-intro { margin-bottom: 1.3rem; color: var(--muted); }
.page-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.2rem; margin-top: 1.25rem; }

.form-stack { display: grid; justify-items: start; gap: 0.55rem; max-width: 30rem; }
label { color: var(--text); font-size: 0.9rem; font-weight: 650; }
input, button { font: inherit; }
input:not([type="hidden"]) {
    width: min(100%, 28rem);
    min-height: 2.9rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #cbd6d0;
    border-radius: 0.6rem;
    outline: none;
    color: var(--text);
    background: var(--surface);
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(24 121 78 / 13%); }
input::placeholder { color: #9aa59f; }
.field-hint { margin: 0.1rem 0 0.5rem; color: var(--muted); font-size: 0.85rem; }

button, .button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.58rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 0.6rem;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, transform 120ms ease;
}
button:hover, .button:hover { border-color: var(--accent-dark); color: #fff; background: var(--accent-dark); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.65; cursor: wait; }
.button-secondary { border-color: var(--line); color: var(--text); background: var(--surface); }
.button-secondary:hover { border-color: var(--line); color: var(--text); background: var(--surface-soft); }

.message, .ok, .fout, .melding-gelukt, .melding-fout {
    margin: 1rem 0 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    font-weight: 650;
}
.ok, .melding-gelukt { border-color: #bde2ca; color: #17653e; background: var(--accent-soft); }
.fout, .melding-fout { border-color: #f2c6c1; color: var(--danger); background: var(--danger-soft); }
.gedempt { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.75rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
td form { margin: 0; }
td button { min-height: 2.3rem; padding: 0.4rem 0.75rem; font-size: 0.88rem; }
.balance {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 0;
    color: var(--accent-dark);
    font-size: 1.1rem;
    font-weight: 700;
}
.balance strong { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1; letter-spacing: -0.04em; }
.balance.is-negative { color: var(--danger); }
.empty-state { padding: 1rem; border-radius: 0.7rem; color: var(--muted); background: var(--surface-soft); }
.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem max(1.5rem, calc((100vw - 1160px) / 2));
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .site-header { align-items: flex-start; flex-direction: column; gap: 0.7rem; padding: 1rem; }
    .site-nav { gap: 0.15rem; }
    .site-nav a { padding: 0.42rem 0.55rem; }
    .page-shell { width: min(100% - 1.25rem, 960px); padding-top: 2rem; }
    .site-footer { flex-direction: column; gap: 0.2rem; padding: 1rem; }
    th, td { padding: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
