/* IJAN Beheer — stijl. Licht thema alleen, huisstijl van demo.ijan.be / ijan.be. */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/schibsted-var.woff2') format('woff2-variations'), url('fonts/schibsted-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrumentserif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}

:root {
  --bg:#FFFFFF; --surface:#FFFFFF; --surface-2:#F4F7F5;
  --ink:#14181A; --ink-soft:#4C5553; --muted:#97A09D; --line:#E8EBE9;
  --accent:#0D6B45; --on-accent:#FFFFFF; --accent-soft:#D9ECE2;
  --btn:#14181A; --on-btn:#FFFFFF;
  --ok:#0D6B45; --warn:#A66A00; --danger:#B3382E;
  --ok-soft:#D9ECE2; --warn-soft:#F5EBDA; --danger-soft:#F6E4E2;
  --shadow:0 1px 2px rgba(20,24,26,.05);
  --shadow-lg:0 10px 40px rgba(20,24,26,.16);
  --radius:12px;
  --sidebar-w:220px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Schibsted Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ── Login ──────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}
#login-box {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 40px 36px;
}
#login-logo { margin-bottom: 28px; }
#login-logo .logo-text { font-family: 'Instrument Serif', serif; font-size: 32px; color: var(--ink); }
#login-logo .logo-tagline { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 2px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.login-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); color: var(--ink);
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#login-btn {
  width: 100%; margin-top: 8px; padding: 11px; border: none; border-radius: 999px;
  background: var(--btn); color: var(--on-btn); font-weight: 600; font-size: 14px;
}
#login-btn[disabled] { opacity: .6; cursor: not-allowed; }
#login-error {
  background: var(--danger-soft); color: var(--danger); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 16px;
}

/* ── App-skelet ─────────────────────────────────────────── */
#app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

#sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 22px; }
.brand-name { font-family: 'Instrument Serif', serif; font-size: 22px; }
.brand-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 999px;
  border: none; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 600;
  text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item svg { flex: 0 0 auto; }

#sidebar-footer { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
#sidebar-user { padding: 6px 10px 10px; }
#sidebar-user .naam { font-size: 13px; font-weight: 600; }
#sidebar-user .rol { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.lang-switch { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 2px; margin: 8px 10px; }
.lang-btn { flex: 1; padding: 5px 0; font-size: 11px; font-weight: 700; border-radius: 999px; background: transparent; border: none; color: var(--ink-soft); }
.lang-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#logout-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 999px;
  border: none; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 600;
}
#logout-btn:hover { background: var(--surface-2); color: var(--danger); }

#main { padding: 28px 36px 60px; min-width: 0; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 2px; }
.page-title { font-family: 'Instrument Serif', serif; font-size: 30px; font-weight: 400; color: var(--ink); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Kaarten en tegels ──────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.tile-value { font-family: 'Instrument Serif', serif; font-size: 30px; margin-top: 6px; color: var(--ink); }
.tile-value.danger { color: var(--danger); }
.tile-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.tile.clickable { cursor: pointer; transition: border-color .12s ease; }
.tile.clickable:hover { border-color: var(--accent); }

/* ── Knoppen ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 9px 16px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--line); cursor: pointer;
  white-space: nowrap; background: var(--surface); color: var(--ink);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--btn); color: var(--on-btn); border-color: var(--btn); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.accent:hover { filter: brightness(1.08); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── Pills / chips ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
  background: var(--surface); color: var(--ink-soft); border-color: var(--line);
}
.pill.active { background: var(--ink); color: var(--on-btn); border-color: var(--ink); }
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; border: none; }
button.chip { cursor: pointer; }
.chip-neutral { background: var(--surface-2); color: var(--ink-soft); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }

/* ── Formulieren ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 11px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input, select.input, textarea.input {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 9px 11px; width: 100%;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.input { resize: vertical; min-height: 70px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 9px 12px; font-size: 13px; }

/* ── Zoekveld ───────────────────────────────────────────── */
.search-box { position: relative; min-width: 220px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 32px; }

/* ── Tabel ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.subtext { color: var(--muted); font-size: 12px; }

/* ── Lege staten ────────────────────────────────────────── */
.empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); }
.empty .empty-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty .empty-sub { font-size: 13px; color: var(--muted); }
.loading { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Subtab-pills ───────────────────────────────────────── */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }

/* ── Fiche ──────────────────────────────────────────────── */
.fiche-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.fiche-titel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fiche-titel h1 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 28px; }
.fiche-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; border: none; background: none; padding: 0 0 10px; }
.fiche-back:hover { color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .two-col { grid-template-columns: 1fr; } }
.ov-meta { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.ov-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ov-row:last-child { border-bottom: none; }
.ov-row .label { color: var(--muted); }
.card-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 16px 20px 4px; }
.card-body { padding: 8px 20px 18px; }

/* ── Tijdlijn ───────────────────────────────────────────── */
.tijdlijn { display: flex; flex-direction: column; }
.tijdlijn-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.tijdlijn-item:last-child { border-bottom: none; }
.tijdlijn-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.tijdlijn-body { flex: 1; min-width: 0; }
.tijdlijn-titel { font-weight: 600; font-size: 13px; }
.tijdlijn-inhoud { font-size: 13px; color: var(--ink-soft); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tijdlijn-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }
.tijdlijn-del { flex: 0 0 auto; }

/* ── Documenten ─────────────────────────────────────────── */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: none; }
.doc-icon { flex: 0 0 auto; color: var(--ink-soft); }
.doc-info { flex: 1; min-width: 0; }
.doc-naam { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.doc-actions { flex: 0 0 auto; display: flex; gap: 6px; }

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-scrim { position: fixed; inset: 0; background: rgba(20,24,26,.28); opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 50; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .22s ease; z-index: 51;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.drawer-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.drawer-title { font-size: 17px; font-weight: 700; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }

/* ── Kanban ─────────────────────────────────────────────── */
.kanban-wrap { overflow-x: auto; padding-bottom: 10px; }
.kanban-board { display: flex; gap: 12px; min-width: min(100%, max-content); align-items: flex-start; }
/* Zes kolommen passen naast elkaar op een gewoon scherm; onder 1300 px scrolt het bord horizontaal. */
.kanban-col { width: 250px; flex: 1 1 0; min-width: 160px; max-width: 260px; background: var(--surface-2); border-radius: var(--radius); padding: 10px; border-top: 3px solid var(--line); }
.kanban-col.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kanban-col-head .titel { font-size: 13px; font-weight: 700; }
.kanban-col-head .aantal { font-size: 12px; color: var(--ink-soft); }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; cursor: grab; box-shadow: var(--shadow); }
.kanban-card.dragging { opacity: .4; }
.kanban-card .naam { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.kanban-card .contact { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.kanban-card .dagen { font-size: 11px; color: var(--muted); }

/* ── Toast ──────────────────────────────────────────────── */
#toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px;
  font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  min-width: 240px; max-width: 360px; animation: toast-in .18s ease;
}
.toast.ok { border-color: var(--ok-soft); color: var(--ok); }
.toast.err { border-color: var(--danger-soft); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Sidebar-scrim (mobiel) ─────────────────────────────── */
/* Altijd position:fixed, ook op desktop: anders is dit een gewoon blok-element dat als
   grid-item van #app een kolom/rij opeist en de lay-out van sidebar/main verschuift. */
#sidebar-scrim { position: fixed; inset: 0; background: rgba(20,24,26,.28); z-index: 59; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
#sidebar-scrim.open { opacity: 1; pointer-events: auto; }

/* ── Topbalk (mobiel) ───────────────────────────────────── */
#topbar { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
#topbar .brand-name { font-family: 'Instrument Serif', serif; font-size: 19px; }
#menu-toggle { border: none; background: none; padding: 6px; color: var(--ink); }

/* ── Responsief ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  #app { grid-template-columns: 1fr; }
  #topbar { display: flex; }
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 240px;
    transform: translateX(-100%); transition: transform .18s ease; box-shadow: none;
  }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #main { padding: 20px 16px 48px; }
  .field-row { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}
