*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-w: 200px;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warn: #d97706;
    --warn-light: #fef3c7;
    --ok: #16a34a;
    --ok-light: #dcfce7;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --radius: 6px;
}

body { font-family: system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }

.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; }
.logo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.logo-icon { font-size: 22px; background: var(--accent); color: #fff; width: 34px; height: 34px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-title { font-size: 14px; font-weight: 600; }
.logo-sub { font-size: 11px; color: var(--muted); }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: 14px 14px 4px; }
.nav-item { display: block; padding: 9px 14px; font-size: 13px; color: var(--muted); text-decoration: none; border-radius: var(--radius); margin: 1px 6px; transition: all .12s; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.nav-bottom { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); }
.nav-user { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.btn-logout { font-size: 12px; color: var(--danger); text-decoration: none; }
.btn-logout:hover { text-decoration: underline; }

/* MAIN */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 24px; flex: 1; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none; font-family: inherit; transition: all .12s; white-space: nowrap; min-height: 40px; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.btn-icon { padding: 8px; min-width: 40px; justify-content: center; }

/* STATS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-val { font-size: 30px; font-weight: 600; }
.stat-val.red { color: var(--danger); }
.stat-val.amber { color: var(--warn); }
.stat-val.green { color: var(--ok); }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-critical { background: var(--danger-light); color: var(--danger); }
.badge-blokkerend { background: #fce7f3; color: #9d174d; }
.badge-open { background: var(--warn-light); color: var(--warn); }
.badge-afgewerkt { background: var(--ok-light); color: var(--ok); }
.badge-normaal { background: #f1f5f9; color: var(--muted); }
.badge-hoog { background: var(--warn-light); color: var(--warn); }
.badge-kritisch { background: var(--danger-light); color: var(--danger); }
.badge-beheerder { background: var(--accent-light); color: var(--accent); }
.badge-aanpassen { background: var(--ok-light); color: var(--ok); }
.badge-lezen { background: #f1f5f9; color: var(--muted); }

/* TABLE */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.table-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-header h2 { font-size: 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg); padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th a { color: var(--muted); text-decoration: none; }
thead th a:hover { color: var(--text); }
tbody td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }
.row-link { cursor: pointer; }
.mono { font-family: monospace; font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.td-actions { display: flex; gap: 4px; }

/* FORMS */
.form-wrap { max-width: 580px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text);
    transition: border-color .12s; min-height: 42px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-section { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 24px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

/* PHOTO UPLOAD */
.photo-upload { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; transition: all .15s; background: var(--bg); }
.photo-upload:hover { border-color: var(--accent); background: var(--accent-light); }
.photo-upload input { display: none; }
.photo-upload-icon { font-size: 28px; margin-bottom: 6px; }
.photo-upload p { font-size: 13px; color: var(--muted); }
.photo-preview { max-width: 100%; max-height: 240px; border-radius: var(--radius); margin-top: 10px; display: none; }

/* DETAIL */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.detail-photo { border-radius: var(--radius); overflow: hidden; background: var(--bg); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-photo .no-photo { font-size: 40px; color: #cbd5e1; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.detail-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border: none; }
.detail-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.detail-val { font-size: 14px; }

/* ALERT */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--ok-light); color: var(--ok); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-warn { background: var(--warn-light); color: var(--warn); border: 1px solid #fde68a; }
.alert-info { background: var(--accent-light); color: var(--accent); border: 1px solid #bfdbfe; }

/* FILTER BAR */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 13px; background: var(--surface); color: var(--text); min-height: 38px; }

/* CONTACT CARDS */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.contact-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contact-company { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.contact-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.contact-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }

/* THUMB */
.issue-thumb { width: 38px; height: 38px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); }
.issue-thumb-placeholder { width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 16px; color: #cbd5e1; flex-shrink: 0; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
    .main { margin-left: 0; }
    .detail-grid, .form-row { grid-template-columns: 1fr; }
}

/* EMPTY */
.empty-state { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* CRITICAL ROW — stijl verwijderd */

/* CHECK toggle */
.check-form { display: inline; }
.check-btn { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; font-size: 14px; }
.check-btn:hover { border-color: var(--ok); background: var(--ok-light); }
.check-btn.checked { border-color: var(--ok); background: var(--ok); color: #fff; }

/* TANG BUTTON */
.tang-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; padding: 0; flex-shrink: 0; }
.tang-btn:hover { border-color: var(--ok); background: var(--ok-light); }
.tang-btn.checked { border-color: var(--ok); background: var(--ok); }
.tang-btn.checked .tang-svg { filter: brightness(0) invert(1); }
.tang-svg { width: 20px; height: 13px; display: block; }

/* LOGO grootte fix */
.logo-img { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; display: block; }

/* TOPBAR links: titel + projectnaam naast elkaar */
.topbar-left { display: flex; align-items: baseline; gap: 10px; }
.topbar-project { font-size: 14px; color: var(--muted); font-weight: 400; }
.topbar-project::before { content: '—'; margin-right: 10px; color: var(--border); }

/* TANG icoon in knop (wit op blauw) */
.btn-tang-icon { width: 18px; height: 12px; display: inline-block; vertical-align: middle; margin-right: 2px; }
