:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1a1d21;
    --muted: #6b7280;
    --border: #dfe3e8;
    --accent: #003e7d;
    --accent-hover: #0051a4;
    --error-bg: #fdecec;
    --error-text: #9b1c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

main { max-width: 960px; margin: 0 auto; padding: 32px 16px; }

h1 { font-size: 1.5rem; margin: 0 0 16px; }

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; color: var(--accent); text-decoration: none; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: var(--text); text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}
.narrow { max-width: 380px; margin: 64px auto 0; }

label { display: block; margin: 16px 0 4px; font-weight: 600; }
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

button {
    margin-top: 20px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button.link {
    margin: 0;
    padding: 0;
    background: none;
    color: var(--accent);
    font-weight: 400;
    text-decoration: underline;
}

.alert { padding: 10px 12px; border-radius: 6px; margin: 0 0 8px; }
.alert.error { background: var(--error-bg); color: var(--error-text); }

.muted { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
a { color: var(--accent); }
code { background: #eef1f4; padding: 1px 4px; border-radius: 4px; font-size: 0.9em; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 16px;
}
.page-head h1 { margin: 0; }
.page-head:first-child { margin-top: 0; }

a.button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
a.button:hover { background: var(--accent-hover); }
button.secondary {
    margin: 0;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
}
button.secondary:hover { background: var(--bg); }

.form { max-width: none; }
.form select, .form textarea, .form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
.form input.short { max-width: 90px; }
.form textarea { resize: vertical; }
.mono, .prompt { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9rem; }
.form fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 20px 0 0; padding: 4px 16px 16px; }
.form legend { font-weight: 600; padding: 0 6px; }
.form input:disabled { background: var(--bg); color: var(--muted); }

.columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; }
.variables { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.variables label { margin-top: 10px; font-weight: 500; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }
.variables .wide { grid-column: 1 / -1; }
input.missing, textarea.missing { border-color: #c2410c; background: #fff7ed; }

.hint { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.field-error { color: var(--error-text); font-size: 0.9rem; margin: 4px 0 0; }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.actions button { margin-top: 0; }
form.inline { display: inline; margin: 0; }

.alert.info { background: #eaf2fb; color: #123a66; }
.alert.warning { background: #fff7ed; color: #9a3412; }
.alert.success { background: #ecfdf3; color: #166534; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--text); border-bottom: 2px solid transparent; }
.tabs a.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }

.list li { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list li form.inline { margin-left: auto; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.preview { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 4px; }
.prompt {
    background: #f3f5f7;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 520px;
    overflow: auto;
    margin: 0;
}
.badge { font-size: 0.75rem; background: #e5e7eb; color: #374151; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.card + .card, .card + form.card { margin-top: 16px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge.error { background: var(--error-bg); color: var(--error-text); }
h2.section { margin: 24px 0 12px; }
.prompt.output { background: var(--surface); max-height: none; }
details.card { margin-top: 16px; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card .prompt { margin-top: 12px; }

.card h2 { margin-bottom: 12px; }
form.inline-block { display: inline-block; margin: 12px 0 0; }
form.inline-block button { margin-top: 0; }

progress { width: 100%; height: 14px; margin: 12px 0; accent-color: var(--accent); }
label.choice { display: flex; align-items: baseline; gap: 8px; font-weight: 400; margin: 10px 0 2px; }
label.choice input { flex: none; }
.form input[type="file"] { display: block; margin-top: 6px; font: inherit; }
a.button.secondary-link { background: var(--surface); color: var(--accent); border: 1px solid var(--border); font-weight: 600; }
a.button.secondary-link:hover { background: var(--bg); }
.table.rows { margin-top: 16px; font-size: 0.92rem; }
.table.rows td.url { max-width: 260px; overflow-wrap: anywhere; color: var(--muted); }
#job-progress { margin-top: 16px; }

/* Snel genereren */
.picker-row { display: flex; gap: 12px; align-items: center; }
.picker-row select { flex: 1; }
.picker-row button { margin-top: 0; }
.required { color: var(--error-text); font-weight: 700; }
.optional { font-weight: 400; }
.form + .card, .card.result { margin-top: 16px; }
details.prompt-preview { margin-top: 20px; }
details.prompt-preview summary { cursor: pointer; font-weight: 600; }
.result .page-head { margin: 0 0 12px; }
.result-actions { display: flex; align-items: center; gap: 8px; }
.result-actions button { margin-top: 0; }
.copy-status { margin: 0 0 8px; min-height: 1.5em; }
.result-facts { margin-top: 16px; }
.row-actions { margin-left: auto; display: flex; gap: 12px; }
.list li .row-actions form.inline { margin-left: 0; }
.offscreen { position: fixed; left: -9999px; top: 0; }
