/* Ubrainit Servicedesk — huisstijl: paars, geel voor de hoofdactie, rustige lichte basis. */

:root {
  --ink: #1A1530;
  --muted: #5E5A6E;
  --ground: #F6F5FA;
  --surface: #FFFFFF;
  --line: #E6E3EF;
  --line-soft: #EFEDF5;
  --field: #D9D4E6;
  --brand: #5B12E6;
  --brand-dark: #3D0A9E;
  --brand-soft: #F0EBFF;
  --brand-tint: #E4DAFF;
  --cta: #FFC94D;
  --cta-hover: #F5BB2E;
  --gradient: linear-gradient(110deg, #2E00B8 0%, #6A08F0 62%, #A510FF 100%);
  --p1: #C2362B;
  --p2: #D98A00;
  --p3: var(--brand);
  --p4: #9A95AA;
  --radius: 16px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Topbalk ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { min-height: 68px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--brand); }
.brand strong { font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.brand span { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { padding: 9px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--ground); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.account { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.account form { margin: 0; }
.linkbtn { border: 0; background: none; padding: 6px 0; font: inherit; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

.topbar--admin { background: var(--gradient); border-bottom: 0; color: #fff; }
.topbar--admin .brand, .topbar--admin .brand span { color: #fff; }
.topbar--admin .brand span { color: #E9E2FF; }
.topbar--admin .nav a { color: #E9E2FF; }
.topbar--admin .nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.topbar--admin .nav a.active { background: rgba(255, 255, 255, 0.2); color: #fff; }
.topbar--admin .account, .topbar--admin .linkbtn { color: #E9E2FF; }
.topbar--admin .avatar { background: var(--cta); color: var(--ink); }

/* ---------- Layout ---------- */
.wrap { max-width: 1220px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main.wrap { padding-top: 36px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { min-width: 0; }
.grow { flex: 1 1 460px; }
.side { flex: 1 1 300px; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split > aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card--flush { padding: 0; overflow: hidden; }
.card--gradient { background: var(--gradient); color: #fff; border: 0; }
.card--gradient a { color: #fff; font-weight: 700; }
.card--gradient .muted { color: #E9E2FF; }

/* ---------- Knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent; font: 700 15px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--cta); color: var(--ink); }
.btn-primary:hover { background: var(--cta-hover); color: var(--ink); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-quiet { background: var(--surface); border-color: var(--field); color: var(--ink); }
.btn-quiet:hover { border-color: var(--muted); color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Kerncijfers & grafieken ---------- */
.kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { flex: 1 1 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .note { font-size: 13px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .bar { width: 100%; max-width: 44px; border-radius: 8px 8px 0 0; background: var(--brand); min-height: 2px; }
.bars .bar.current { background: #D6C8FB; }
.bars .num { font-size: 12px; color: var(--muted); }
.bar-labels { display: flex; gap: 14px; margin-top: -8px; }
.bar-labels span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--muted); }

.hbar { display: flex; flex-direction: column; gap: 6px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 14px; }
.hbar .track { height: 8px; background: var(--line-soft); border-radius: 4px; }
.hbar .fill { height: 8px; border-radius: 4px; background: var(--brand); }

.hotspots { display: flex; flex-wrap: wrap; gap: 12px; }
.hotspot { flex: 1 1 300px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.hotspot .icon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.hotspot .icon svg { width: 20px; height: 20px; }
.hotspot strong { display: block; font-size: 15px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFAFE; }
.table .ref { color: var(--muted); white-space: nowrap; }
.table .title { font-weight: 600; color: var(--ink); }
.table .title:hover { color: var(--brand); }
.table .sub { display: block; font-size: 12px; color: var(--muted); }
.table--wide { min-width: 960px; }
.table--mid { min-width: 720px; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-nieuw { background: var(--brand-soft); color: var(--brand-dark); }
.status-in-behandeling { background: #FFF1CC; color: #6B4A00; }
.status-wacht-op-klant { background: #E6EDF5; color: #2E4A66; }
.status-opgelost { background: #E3F1E8; color: #22583A; }
.status-gesloten { background: #EEEDF1; color: #4E4A5C; }

.prio { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.prio::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--p4); }
.prio-1::before { background: var(--p1); }
.prio-2::before { background: var(--p2); }
.prio-3::before { background: var(--p3); }

.sla { white-space: nowrap; }
.sla-risk { color: var(--p1); font-weight: 700; }
.sla-warn { color: #8A5A00; font-weight: 700; }
.sla-paused { color: var(--muted); font-style: italic; }
.sla-done { color: #22583A; }

/* ---------- Filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip .count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: #3E3A4E; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active .count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.toolbar form { margin-left: auto; display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; flex-wrap: wrap; }
.toolbar input, .toolbar select { min-height: 40px; border-radius: 999px; }
.toolbar input[type=search] { flex: 1 1 200px; max-width: 320px; }

/* ---------- Formulieren ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .legend { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--field); border-radius: 12px;
  font: 400 15px var(--font); color: var(--ink); background: var(--surface);
}
textarea { padding: 12px 16px; line-height: 1.5; resize: vertical; min-height: 120px; }
select { padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-tint); outline-offset: 1px; border-color: var(--brand); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: 10px; }
.fields-2 { display: flex; flex-wrap: wrap; gap: 16px; }
.fields-2 > * { flex: 1 1 240px; }

.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option { flex: 1 1 160px; position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: flex; flex-direction: column; justify-content: center; min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--field); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; }
.option small { font-weight: 400; color: var(--muted); font-size: 13px; }
.option input:checked + span { border: 1.5px solid var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.options--cards .option span { border-radius: 14px; text-align: left; min-height: 64px; align-items: flex-start; }
.options--auto .option { flex: 0 1 auto; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; border: 1.5px dashed #CFC6EA; border-radius: 14px; color: var(--muted); font-size: 14px; cursor: pointer; padding: 12px; text-align: center; }
.dropzone:hover { border-color: var(--brand); color: var(--brand-dark); }
.dropzone input { display: none; }
.dropzone svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ---------- Meldingen ---------- */
.flash { border-radius: 14px; padding: 14px 18px; background: #E3F1E8; color: #22583A; font-weight: 600; font-size: 14px; }
.errors { border-radius: 14px; padding: 14px 18px; background: #FBE6E3; color: #8E2A20; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Tijdlijn ---------- */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.msg header { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.msg header strong { color: var(--ink); font-size: 14px; }
.msg .body { white-space: pre-line; overflow-wrap: anywhere; }
.msg--staff { background: #FBFAFF; border-color: #DDD3FA; }
.msg--internal { background: #FFF8E6; border-color: #F5DFA0; }
.msg--system { border: 0; background: none; padding: 0 4px; flex-direction: row; gap: 10px; font-size: 13px; color: var(--muted); }
.msg--system::before { content: ''; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--field); flex: none; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ground); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.file:hover { border-color: var(--brand); }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

.prio-preview { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.prio-preview i { width: 10px; height: 10px; border-radius: 50%; background: var(--p3); }

.empty { padding: 40px 24px; text-align: center; color: var(--muted); }

/* ---------- Paginering ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px 0; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: var(--field); }

/* ---------- Inloggen ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-brand { flex: 1 1 420px; min-height: 300px; background: var(--gradient); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-brand strong { font-weight: 800; font-size: 26px; letter-spacing: 0.02em; }
.auth-brand h1 { font-size: 40px; line-height: 1.1; }
.auth-brand p { color: #E9E2FF; font-size: 16px; line-height: 1.6; max-width: 440px; }
.auth-brand a { color: #fff; font-weight: 600; }
.auth-form { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-form .inner { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main.wrap { padding-top: 24px; }
  h1 { font-size: 26px; }
  .card { padding: 18px; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand h1 { font-size: 32px; }
  .account .who { display: none; }
}
