:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color:#1f2937; background:#f4f6f8; }
*{box-sizing:border-box} body{margin:0} button,input,select,textarea{font:inherit} button{border:0;border-radius:8px;padding:10px 14px;background:#111827;color:white;cursor:pointer} button:hover{opacity:.9} button.secondary{background:#e5e7eb;color:#111827} button.small{padding:6px 10px;font-size:12px}.topbar{height:82px;background:white;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;justify-content:space-between;padding:0 24px}.topbar h1{font-size:22px;margin:0}.topbar p{margin:3px 0 0;color:#6b7280;font-size:13px}.layout{display:grid;grid-template-columns:190px minmax(0,1fr);min-height:calc(100vh - 82px)}.sidebar{padding:20px 12px;border-right:1px solid #e5e7eb;background:#fff;min-width:0}.nav-btn{width:100%;text-align:left;margin-bottom:6px;background:transparent;color:#374151;overflow:hidden;text-overflow:ellipsis}.nav-btn.active{background:#111827;color:white}.content{padding:24px;min-width:0}.content-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px}.content-head h2{margin:0}.content-head p{margin:4px 0 0;color:#6b7280}.grid{display:grid;grid-template-columns:minmax(310px,440px) minmax(0,1fr);gap:18px;align-items:start}.card{background:white;border:1px solid #e5e7eb;border-radius:12px;padding:18px;box-shadow:0 1px 2px rgba(0,0,0,.03)}.card h3{margin:0 0 16px;font-size:16px}.card-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}label{display:block;margin-bottom:12px;font-size:13px;font-weight:600}input,select,textarea{width:100%;margin-top:6px;padding:10px 11px;border:1px solid #d1d5db;border-radius:8px;background:white;color:#111827}textarea{min-height:90px;resize:vertical}.actions{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}.actions.end{justify-content:flex-end}.table-wrap{overflow:auto;max-height:70vh}table{width:100%;border-collapse:collapse;font-size:13px}th,td{text-align:left;border-bottom:1px solid #edf0f2;padding:10px;vertical-align:top;white-space:nowrap}th{position:sticky;top:0;background:white;color:#6b7280;font-weight:600;z-index:1}tr.editing{background:#fffbeb}.pill{background:#eef2f7;border-radius:999px;padding:4px 9px;font-size:12px}.status{margin-bottom:14px;border-radius:9px;padding:11px 13px;font-size:13px}.status.ok{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}.status.error{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}.hidden{display:none!important}dialog{border:0;border-radius:12px;padding:0;width:min(650px,92vw);box-shadow:0 20px 60px rgba(0,0,0,.22)}dialog::backdrop{background:rgba(17,24,39,.4)}.dialog-card{padding:20px}.dialog-card h2{margin:0}.icon-btn{padding:4px 10px;background:transparent;color:#374151;font-size:28px;line-height:1}.hint{color:#6b7280;font-size:12px}.row-actions{display:flex;gap:6px}.boolean-true{color:#047857}.boolean-false{color:#9ca3af}.topbar-actions{display:flex;align-items:center;gap:12px}.account{display:flex;align-items:center;gap:10px}.account-name{font-size:13px;color:#374151;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.login-gate{display:flex;justify-content:center;padding:60px 20px}.login-gate .card{width:min(430px,100%)}
@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{display:flex;overflow:auto;border-right:0;border-bottom:1px solid #e5e7eb}.nav-btn{width:auto;white-space:nowrap;margin:0 6px 0 0}.grid{grid-template-columns:1fr}.content{padding:16px}.topbar{padding:0 16px}}

/* --- Bedrijfscontext & bedrijvenbeheer --- */
.tenant-box{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;font-weight:600;color:#6b7280}
.tenant-box select{margin:0;min-width:220px;max-width:280px;padding:8px 10px;font-weight:600;color:#111827;border-color:#111827}
.tenant-name{font-size:13px;font-weight:600;color:#111827;background:#eef2f7;border-radius:999px;padding:6px 12px}
.nav-group{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#9ca3af;font-weight:700;margin:14px 10px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-group:first-child{margin-top:0}
.nav-btn:disabled{opacity:.4;cursor:not-allowed}
.actions.tight{margin-top:0}
button.danger{background:#b91c1c}
button:disabled{opacity:.6;cursor:progress}
.status button{margin-left:10px}
tr.current{background:#f0f7ff}
.badge{display:inline-block;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:600}
.badge.on{background:#ecfdf5;color:#047857}.badge.off{background:#f3f4f6;color:#6b7280}
.logo-thumb{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:#eef2f7;color:#4b5563;font-size:12px;font-weight:700;overflow:hidden}
.logo-thumb img,.logo-preview img{width:100%;height:100%;object-fit:contain;background:#fff}
.company-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start}
.company-main{display:grid;gap:18px;min-width:0}
.company-side{display:grid;gap:14px;position:sticky;top:16px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:14px}
.form-grid label{grid-column:1/-1}
.form-grid label.half{grid-column:auto}
.req{color:#b91c1c}
label .hint{display:block;font-weight:400;margin-top:4px}
.field-error{display:block;color:#b91c1c;font-size:12px;font-weight:500;margin-top:4px}
.field-error:empty{display:none}
input[aria-invalid="true"]{border-color:#dc2626;background:#fff7f7}
input:focus,select:focus,textarea:focus{outline:2px solid #2563eb;outline-offset:1px;border-color:#2563eb}
.logo-preview{height:140px;border:1px solid #e5e7eb;border-radius:10px;display:flex;align-items:center;justify-content:center;background:#f9fafb;color:#9ca3af;font-size:34px;font-weight:700;margin-bottom:12px;overflow:hidden;padding:8px}
.file-drop{display:flex;flex-direction:column;align-items:center;gap:2px;border:1.5px dashed #cbd5e1;border-radius:10px;padding:14px;text-align:center;cursor:pointer;font-weight:600}
.file-drop.over,.file-drop:hover{border-color:#2563eb;background:#eff6ff}
.file-drop input{position:absolute;width:1px;height:1px;opacity:0}
.file-drop:focus-within{outline:2px solid #2563eb;outline-offset:2px}
.confirm{margin-top:4px;border:1px solid #fecaca;background:#fef2f2;border-radius:10px;padding:12px}
.confirm p{margin:0 0 10px;font-size:13px;color:#7f1d1d}
.sticky-actions button{flex:1}
@media(max-width:900px){.tenant-box select{min-width:0;max-width:170px}.company-layout{grid-template-columns:1fr}.company-side{position:static}.topbar{height:auto;min-height:82px;flex-wrap:wrap;gap:10px;padding:12px 16px}.topbar-actions{flex-wrap:wrap}}
@media(max-width:560px){.form-grid{grid-template-columns:1fr}.form-grid label.half{grid-column:1/-1}.account-name{display:none}}
@media(max-width:900px){.layout{align-content:start}.sidebar{align-items:center}.nav-group{display:none}.sidebar .nav-btn{flex:0 0 auto}.content-head{flex-wrap:wrap}}

/* --- Facturatie & boekhoudkoppeling --- */
.badge.warn{background:#fffbeb;color:#92400e}.badge.err{background:#fef2f2;color:#b91c1c}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
td.wrap{white-space:normal;min-width:260px}
tfoot th{position:static;color:#111827;border-top:2px solid #e5e7eb}
.inline-filter{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:12px}
.inline-filter select{margin:0;width:auto;padding:6px 8px}
