:root {
    --primary: #28a745;
    --primary-dark: #218838;
    --primary-soft: #e8f7ec;
    --bg: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --border: #cbd5e1;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); padding: 0; margin: 0; min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header (zelfde stijl als computerserviceroden.nl) ===== */
.csr-header { background: white; border-bottom: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.csr-header-inner { max-width: 950px; margin: 0 auto; padding: 16px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.csr-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.csr-logo { background: var(--primary); color: white; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.5px; flex-shrink: 0; }
.csr-brand strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.csr-brand small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.csr-meta { display: flex; align-items: center; gap: 16px; font-size: 0.85rem; }
.csr-meta a { color: var(--muted); text-decoration: none; }
.csr-meta a:hover { color: var(--primary); }
.csr-meta .csr-pill { background: var(--primary-soft); color: var(--primary-dark); padding: 5px 12px; border-radius: 20px; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== Footer ===== */
.csr-footer { margin-top: auto; padding: 22px 30px; text-align: center; color: var(--muted); font-size: 0.82rem; border-top: 1px solid #e2e8f0; background: white; }
.csr-footer a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
.csr-footer a:hover { text-decoration: underline; }

/* ===== Container ===== */
.container { max-width: 950px; width: 100%; margin: 20px auto; background: white; padding: 30px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
h2 { color: var(--primary); border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-top: 0; font-size: 1.5rem; }

/* ===== Voortgang stappen ===== */
.progress { display: flex; gap: 10px; margin-bottom: 25px; }
.progress .step { flex: 1; padding: 12px; text-align: center; border-radius: 6px; background: #e9ecef; color: #6c757d; font-weight: 600; font-size: 0.95em; }
.progress .step.active { background: var(--primary); color: white; }
.progress .step.done   { background: var(--primary); color: white; }

/* ===== Sections / formulieren ===== */
.section { margin-bottom: 25px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; color: #475569; text-transform: uppercase; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; box-sizing: border-box; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1); }
textarea { resize: vertical; }

/* ===== Postcode lookup blok ===== */
.pc-lookup { background: #f8fafc; padding: 15px; border-radius: 8px; margin-bottom: 18px; border: 1px dashed #c5c5c5; }
.pc-lookup-hint { color: #555; display: block; margin-bottom: 10px; font-size: 0.82rem; }
.pc-status { font-size: 0.85em; margin-top: 8px; min-height: 1.2em; font-weight: 600; }
.field-hint { font-size: 0.78em; color: #888; margin-top: 4px; font-weight: 400; text-transform: none; }

/* ===== Klant samenvatting in stap 2 ===== */
.summary { background: #f8fafc; padding: 18px; border-radius: 8px; border: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.summary-info strong { display: block; font-size: 1.1em; margin-bottom: 4px; }
.summary-info small  { color: #666; display: block; line-height: 1.5; }
.summary-edit { padding: 8px 14px; background: #6c757d; color: white; text-decoration: none; border-radius: 6px; font-size: 0.9em; white-space: nowrap; font-weight: 500; }
.summary-edit:hover { background: #5a6268; }
.vat-badge { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 4px; font-size: 0.75em; font-weight: 600; }
.vat-badge.zero   { background: #fff3cd; color: #856404; }
.vat-badge.normal { background: #d1ecf1; color: #0c5460; }

/* ===== Factuurregels tabel ===== */
.invoice-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.invoice-table th { text-align: left; background: #f8fafc; padding: 12px; font-size: 0.8rem; border-bottom: 2px solid var(--border); }
.invoice-table td { padding: 12px; border-bottom: 1px solid #edf2f7; vertical-align: top; }

/* ===== Per-regel: dropdown / vrije invoer / opmerking ===== */
.row-line { display: flex; flex-direction: column; gap: 8px; }

.custom-name-input { display: none; font-weight: 600; border-color: var(--primary) !important; background: #fbfff6; }

/* Opmerking-toggle + textarea: standaard ingeklapt, klap uit bij klik of als er tekst staat */
.comment-toggle { font-size: 0.78rem; color: var(--primary-dark); cursor: pointer; display: inline-block; margin-top: 2px; padding: 3px 0; user-select: none; font-weight: 600; }
.comment-toggle:hover { text-decoration: underline; }
.comment-wrap { display: none; }
.comment-wrap.open { display: block; }

.comment-input {
    margin-top: 4px;
    border: 1px dashed var(--border);
    padding: 8px 10px;
    background: #fcfcfd;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 38px;
    overflow: hidden; /* nodig voor autogrow */
}
.comment-input:focus { background: white; border-style: solid; }

/* ===== Knoppen ===== */
.add-row-btn { background: #64748b; color: white; border: none; padding: 12px; width: 100%; cursor: pointer; border-radius: 6px; font-weight: 600; margin-top: 10px; font-size: 0.95rem; }
.add-row-btn:hover { background: #475569; }
.submit-btn { background: var(--primary); color: white; border: none; padding: 18px; width: 100%; cursor: pointer; font-size: 1.15rem; border-radius: 8px; margin-top: 20px; font-weight: 700; transition: background 0.15s; }
.submit-btn:hover { background: var(--primary-dark); }
.btn-back { display: inline-block; background: #6c757d; color: white; text-decoration: none; text-align: center; padding: 14px 22px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 1rem; }
.btn-back:hover { background: #5a6268; }
.nav-buttons { display: flex; gap: 10px; margin-top: 10px; }

.remove-btn { color: #ef4444; border: none; background: none; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 4px 10px; border-radius: 4px; }
.remove-btn:hover { background: #fef2f2; }

#vat_status { font-size: 0.85rem; margin-top: 5px; font-weight: 600; min-height: 1.2em; }

/* ===== Status / kaarten (verwerk.php) ===== */
.card { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); text-align: center; max-width: 500px; width: 100%; margin: 40px auto; }
.btn { display: inline-block; margin-top: 20px; padding: 12px 25px; border-radius: 6px; text-decoration: none; font-weight: bold; color: white; }

/* ===== Mobiel ===== */
@media (max-width: 768px) {
    .csr-header-inner { padding: 14px 18px; }
    .container { padding: 20px; margin: 12px; }
    .invoice-table thead { display: none; }
    .invoice-table tr { display: block; border: 1px solid var(--border); margin-bottom: 15px; padding: 15px; border-radius: 8px; position: relative; }
    .invoice-table td { display: block; text-align: left; border: none; padding: 8px 0; }
    .invoice-table td::before { content: attr(data-label); display: block; font-weight: 700; color: #64748b; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 4px; }
    .remove-btn { position: absolute; top: 10px; right: 10px; }
    .nav-buttons { flex-direction: column; }
    .btn-back { width: 100%; }
}