:root {
  --bg: #f3f3f4;
  --card: #ffffff;
  --ink: #1a2230;
  --muted: #7c8598;
  --line: #e3e8f0;
  --brand: #2f6bff;
  --brand-ink: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 3px 10px rgba(20, 30, 60, .05);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420; --card: #171e2c; --ink: #e7ecf5; --muted: #8a93a6;
    --line: #26303f; --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }

/* App-shell: vaste zijbalk links + brede inhoud rechts */
.app { display: flex; min-height: 100vh; align-items: stretch; }
.side {
  width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; text-decoration: none; }
.side-brand .logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-word { font-family: Manrope, Inter, sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -.02em; }
.nav-ic { width: 18px; height: 18px; flex-shrink: 0; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 15px;
}
.side-item .ic { font-size: 17px; }
.side-item:hover { background: var(--bg); }
.side-item.on { background: rgba(47,107,255,.11); color: var(--brand); }
.side-foot { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); }
.side-user { font-weight: 700; font-size: 14px; margin-bottom: 4px; }

.main { flex: 1; min-width: 0; padding: 30px 40px 70px; }
.plain { flex: 1; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side {
    width: auto; height: auto; position: static; flex-direction: row; align-items: center;
    gap: 8px; padding: 10px 14px;
  }
  .side-brand { padding: 4px 8px; font-size: 18px; }
  .side-nav { flex-direction: row; }
  .side-item { padding: 8px 12px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: none; display: flex; align-items: center; gap: 10px; }
  .side-user { margin: 0; }
  .main { padding: 20px 18px 50px; }
}

.page-title { margin: 4px 0 20px; font-size: 26px; }
.small { font-size: 13px; }

/* Beheerpagina */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 4px; font-size: 18px; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.row-form input, .row-form select, .add-member select {
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit;
}
.row-form input[type="email"], .row-form input[type="text"] { flex: 1; min-width: 140px; }
form.inline { display: inline; margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.inactive { opacity: .5; }
.admin-table select { padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.right { text-align: right; }

.pillbtn { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pillbtn.on { background: #e2f7ea; color: #147a3d; border-color: transparent; }
.pillbtn.off { background: #eceef2; color: #66707f; border-color: transparent; }
@media (prefers-color-scheme: dark) { .pillbtn.on { background: #16351f; color: #7fdfa0; } .pillbtn.off { background: #232a36; color: #9aa4b3; } }

.group-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.member { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; }
.member-x, .del { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.member-x:hover, .del:hover { color: #c0271e; background: #fdecec; }
@media (prefers-color-scheme: dark) { .member-x:hover, .del:hover { color: #ff9c93; background: #3a1d1d; } }
.add-member { display: flex; gap: 8px; }
.add-member select { flex: 1; }

.tag-group { background: #eef2ff; border-color: #d6e0ff; color: #3550b8; }
.tag-person { background: #eafaf0; border-color: #c7ecd5; color: #147a3d; }
@media (prefers-color-scheme: dark) {
  .tag-group { background: #20264a; border-color: #313a6b; color: #aeb9ff; }
  .tag-person { background: #16351f; border-color: #285f38; color: #7fdfa0; }
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 22px 60px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-weight: 600;
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.05); }
.close-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.close-actions .btn { width: 100%; }
.btn-close { background: #147a3d; color: #fff; border-color: #147a3d; }
.btn-close:hover { filter: brightness(1.07); }
.closed-note { margin-top: 12px; font-size: 13px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.btn-danger { color: #c0271e; border-color: #f0c4c0; background: transparent; }
.btn-danger:hover { background: #fdecec; border-color: #c0271e; }
@media (prefers-color-scheme: dark) {
  .btn-danger { color: #ff9c93; border-color: #5b2a2a; }
  .btn-danger:hover { background: #3a1d1d; border-color: #ff9c93; }
}

/* Verwijderknop per rij in de ticketlijst */
.rowaction { width: 40px; text-align: center; }
.rowaction form { margin: 0; }
.del {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 6px 8px; border-radius: 6px;
}
.del:hover { color: #c0271e; background: #fdecec; }
@media (prefers-color-scheme: dark) { .del:hover { color: #ff9c93; background: #3a1d1d; } }

/* Login */
.login-card {
  max-width: 420px; margin: 8vh auto; background: var(--card); padding: 36px 32px;
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: center;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo .logo-mark { width: 60px; height: 60px; }
.login-title { margin: 0 0 6px; font-family: Manrope, Inter, sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-card h1 { margin: 0 0 6px; }
.login-buttons { display: grid; gap: 12px; margin-top: 26px; }
.btn-ms { border-color: #2f2f2f; }
.ms-logo { width: 16px; height: 16px; display: inline-block;
  background:
    linear-gradient(#f25022 0 0) 0 0/7px 7px no-repeat,
    linear-gradient(#7fba00 0 0) 9px 0/7px 7px no-repeat,
    linear-gradient(#00a4ef 0 0) 0 9px/7px 7px no-repeat,
    linear-gradient(#ffb900 0 0) 9px 9px/7px 7px no-repeat; }
.g-logo { font-weight: 800; color: #4285f4; }
.alert { background: #fdecec; color: #b3261e; border: 1px solid #f6c5c1; padding: 10px 12px; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .alert { background: #3a1d1d; color: #ff9a92; border-color: #5b2a2a; } }

/* Toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 auto 18px; max-width: 1500px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font-size: 14.5px; font-weight: 600;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip .count { opacity: .7; font-weight: 700; margin-left: 4px; }
.search input {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); min-width: 240px; font: inherit;
}

/* Filterbalk: behandelaar + groep */
.filterbar { max-width: 1500px; margin: 0 auto 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filterbar-form { display: flex; gap: 14px; flex-wrap: wrap; }
.fbl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fbl select {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
}
.clearfilters { font-size: 13px; font-weight: 600; color: var(--muted); }
.clearfilters:hover { color: var(--brand); }

/* Ticketlijst als losse kaarten (Freshdesk-stijl) */
.ticket-list { display: flex; flex-direction: column; gap: 12px; max-width: 1500px; margin: 0 auto; }
.ticket-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line);
  border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(20,30,60,.10), 0 12px 30px rgba(20,30,60,.12);
  /* Alleen boven/rechts/onder subtiel grijs; de statuskleur links blijft. */
  border-top-color: #cfd6e2; border-right-color: #cfd6e2; border-bottom-color: #cfd6e2;
}
@media (prefers-color-scheme: dark) {
  .ticket-card:hover { border-top-color: #37425a; border-right-color: #37425a; border-bottom-color: #37425a; }
}
.tc-main { flex: 1; min-width: 0; }
.tc-top { display: flex; align-items: baseline; gap: 10px; }
.tc-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.tc-subject {
  margin: 0; font-size: 18.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.tc-from { font-weight: 600; color: var(--ink); }
.tc-msgs { font-variant-numeric: tabular-nums; }

.tc-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tc-del { display: inline-flex; }
.tc-del form { margin: 0; }

/* Gekleurde prioriteitsrand links, zodat urgentie meteen opvalt */
.prio-accent-urgent  { border-left-color: #d64545; }
.prio-accent-hoog    { border-left-color: #e0a02f; }
.prio-accent-normaal { border-left-color: #4a7bff; }
.prio-accent-laag    { border-left-color: #c3cad6; }

/* Randkleur + subtiele achtergrond per status (de "stand van zaken") */
.status-card-nieuw    { border-left-color: #4a7bff; }
.status-card-bezig    { border-left-color: #e0a02f; }
.status-card-wachten  { border-left-color: #7c5cff; background: linear-gradient(0deg, rgba(124,92,255,.05), rgba(124,92,255,.05)), var(--card); }
.status-card-opgelost { border-left-color: #2e9e5b; background: linear-gradient(0deg, rgba(46,158,91,.06), rgba(46,158,91,.06)), var(--card); }
/* Gesloten: gedempt en grijs */
.status-card-gesloten { border-left-color: #b6bcc6; background: var(--bg); opacity: .62; }
.status-card-gesloten:hover { opacity: 1; }

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

/* Badges */
.tag { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.status, .prio { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status.big { font-size: 14px; padding: 6px 14px; }
.status-nieuw { background: #e7f0ff; color: #1b52d1; }
.status-bezig { background: #fff3d6; color: #9a6b00; }
.status-wachten { background: #ede7ff; color: #5b34cc; }
.status-opgelost { background: #e2f7ea; color: #147a3d; }
.status-gesloten { background: #eceef2; color: #66707f; }
.prio-laag { background: #eceef2; color: #66707f; }
.prio-normaal { background: #e7f0ff; color: #1b52d1; }
.prio-hoog { background: #fff3d6; color: #9a6b00; }
.prio-urgent { background: #fde0e0; color: #c0271e; }
@media (prefers-color-scheme: dark) {
  .status-nieuw { background: #1a2c52; color: #9dbcff; }
  .status-bezig { background: #3a2f14; color: #ffcf70; }
  .status-wachten { background: #2b2350; color: #b9a3ff; }
  .status-opgelost { background: #16351f; color: #7fdfa0; }
  .status-gesloten { background: #232a36; color: #9aa4b3; }
  .prio-laag { background: #232a36; color: #9aa4b3; }
  .prio-normaal { background: #1a2c52; color: #9dbcff; }
  .prio-hoog { background: #3a2f14; color: #ffcf70; }
  .prio-urgent { background: #3d1c1c; color: #ff9c93; }
}

/* Ticket detail */
.back { display: inline-block; margin-bottom: 14px; }
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.ticket-head h1 { margin: 0 0 4px; font-size: 22px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 800px) { .columns { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 24px; }

.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.msg-in { border-left: 3px solid var(--muted); }
.msg-out { border-left: 3px solid var(--brand); background: linear-gradient(0deg, rgba(47,107,255,.04), rgba(47,107,255,.04)), var(--card); }
.msg-note { border-left: 3px solid #e0a02f; background: linear-gradient(0deg, rgba(224,160,47,.09), rgba(224,160,47,.09)), var(--card); }

/* Bijlagen */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attach {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); font-size: 13.5px; font-weight: 600;
}
.attach:hover { border-color: var(--brand); }
.attach-size { color: var(--muted); font-weight: 500; font-size: 12px; }

/* Notitie-vak */
.note-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border-left: 3px solid #e0a02f; }
.note-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.note-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; resize: vertical;
}
.msg-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; font-size: 13px; }
.msg-body { font-size: 14.5px; max-width: 1150px; word-break: break-word; overflow-wrap: anywhere; }
.msg-body img { max-width: 100%; height: auto; }

.reply { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.reply label { display: block; font-weight: 600; margin-bottom: 8px; }
.reply textarea, .sidebar select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; resize: vertical;
}
.reply-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); }

.sidebar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sidebar label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.sidebar label:first-child { margin-top: 0; }

/* ---- Animaties ---------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop   { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.side       { animation: fadeIn .45s ease both; }
.main       { animation: fadeUp .40s cubic-bezier(.2,.7,.2,1) both; }
.login-card { animation: pop .45s cubic-bezier(.2,.8,.2,1) both; }
.login-logo .logo-mark { animation: pop .5s .05s cubic-bezier(.2,.8,.2,1) both; }

/* Ticketkaarten komen na elkaar in beeld (vertraging per kaart via inline style) */
.ticket-card { animation: fadeUp .34s ease both; }

/* Knoppen en menu-items voelen levendiger aan */
.btn, .side-item, .chip, .ticket-card { transition: transform .08s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease, color .12s ease; }
.btn:active { transform: translateY(1px); }

/* Respecteer de systeemvoorkeur "minder beweging" */
@media (prefers-reduced-motion: reduce) {
  .side, .main, .login-card, .login-logo .logo-mark, .ticket-card { animation: none; }
  .ticket-card:hover { transform: none; }
}

/* ---- Bestandsknop bij een antwoord ------------------------------------- */
.filepick { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer; }
.filepick input[type="file"] { display: none; }
.filehint { color: var(--muted); font-weight: 500; font-size: 13px; }

/* ---- Profielpagina ----------------------------------------------------- */
.profile-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }
.fld { display: block; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.fld input, .fld textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; resize: vertical;
}
.fld input:disabled { color: var(--muted); }
.fld .small { display: block; margin-top: 6px; font-weight: 500; }
.preview-panel h2 { margin: 0 0 4px; font-size: 16px; }
.sig-preview { margin-top: 12px; border: 1px dashed var(--line); border-radius: 10px; padding: 14px; background: var(--bg); }
.sig-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; font-size: 13px; color: var(--muted); }
.notice-ok { background: #e2f7ea; color: #147a3d; border: 1px solid #c7ecd5; padding: 10px 12px; border-radius: 9px; }
@media (prefers-color-scheme: dark) { .notice-ok { background: #16351f; color: #7fdfa0; border-color: #285f38; } }

/* ---- Plakken/uploaden van bijlagen bij een antwoord -------------------- */
.reply-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.paste-hint { color: var(--muted); font-size: 13px; }
.paste-hint kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: var(--bg);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px;
}
.attach-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.attach-previews:empty { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; max-width: 240px;
}
.attach-chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.attach-chip-ic { width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; background: var(--card); border-radius: 6px; }
.attach-chip-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-chip-x { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 4px; border-radius: 6px; flex-shrink: 0; }
.attach-chip-x:hover { color: #c0271e; background: #fdecec; }
@media (prefers-color-scheme: dark) { .attach-chip-x:hover { color: #ff9c93; background: #3a1d1d; } }

/* Auto-bewaar-indicator in de ticket-zijbalk */
.autosave-status { margin-top: 14px; font-size: 12.5px; color: var(--muted); transition: color .2s; }
.autosave-status.saved { color: #147a3d; font-weight: 700; }
.autosave-status.err { color: #c0271e; font-weight: 700; }
@media (prefers-color-scheme: dark) { .autosave-status.saved { color: #7fdfa0; } .autosave-status.err { color: #ff9c93; } }

/* ---- Desk-label in de zijbalk ------------------------------------------ */
.brand-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.desk-label { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); margin-top: 2px; }
.desk-label.inline { display: inline-block; margin: 0 0 0 8px; padding: 2px 8px; background: rgba(47,107,255,.1); border-radius: 999px; }

/* ---- Strakke bovenbalk voor indieners (geen zijbalk) ------------------- */
.plainbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; background: var(--card); border-bottom: 1px solid var(--line); }
.plainbar-brand { display: inline-flex; align-items: center; gap: 10px; }
.plainbar-brand .logo-mark { width: 28px; height: 28px; }
.plainbar-brand .brand-word { font-family: Manrope, Inter, sans-serif; font-size: 18px; }
.plainbar-right { display: inline-flex; align-items: center; gap: 14px; }
.plainbar-right .who { color: var(--muted); font-size: 14px; }

/* ---- Meldformulier ----------------------------------------------------- */
.form-wrap { max-width: 720px; margin: 30px auto; padding: 0 18px; }
.melden-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px 32px; box-shadow: var(--shadow); }
.melden-card h1 { font-family: Manrope, Inter, sans-serif; margin: 0 0 6px; font-size: 24px; }
.melden-card form { margin-top: 18px; }
.req { color: #c0271e; font-weight: 700; }
.melden-actions { margin-top: 8px; }
.melden-card.ok { text-align: center; }
.melden-check { width: 56px; height: 56px; margin: 4px auto 14px; display: grid; place-items: center; font-size: 28px; color: #147a3d; background: #e2f7ea; border-radius: 50%; }
@media (prefers-color-scheme: dark) { .melden-check { background: #16351f; color: #7fdfa0; } }

/* ---- Extra velden op het ticket ---------------------------------------- */
.extra-fields { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.xf { display: inline-flex; align-items: baseline; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 13px; }
.xf-label { color: var(--muted); font-weight: 600; }
.xf-value { font-weight: 700; }

/* ---- Zoekbare keuzelijst (combobox) ------------------------------------ */
.combo { position: relative; margin-top: 6px; }
.combo .combo-input { margin-top: 0; padding-right: 34px; }
.combo-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; margin: 0; padding: 5px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.combo-list[hidden] { display: none; }
.combo-opt { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.combo-opt[hidden] { display: none; }
.combo-opt:hover, .combo-opt.active { background: rgba(47,107,255,.1); color: var(--brand); }

/* ---- Desk-schakelaar in de zijbalk ------------------------------------- */
.desk-switch { margin: -4px 10px 14px; }
.desk-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 6px 3px; }
.desk-chip { display: block; padding: 8px 11px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); margin-bottom: 6px; }
.desk-chip:hover { border-color: var(--brand); }
.desk-chip.on { background: rgba(47,107,255,.11); color: var(--brand); border-color: transparent; }
.desk-single { padding: 4px 11px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }

/* ---- Keuzescherm (welke helpdesk) -------------------------------------- */
.chooser { max-width: 760px; margin: 20px auto; }
.chooser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 22px; }
.chooser-card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); transition: transform .1s ease, border-color .12s ease; }
.chooser-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.chooser-name { font-family: Manrope, Inter, sans-serif; font-size: 20px; font-weight: 800; color: var(--ink); }
.chooser-meta { font-size: 13px; color: var(--muted); }

/* ---- Desk-toewijzing in beheer ----------------------------------------- */
.desk-assign { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.deskcheck { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }

/* ---- Openbaar startscherm (helpdesk kiezen vóór login) ----------------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.landing-inner { text-align: center; max-width: 720px; width: 100%; }
.landing-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.landing-logo .logo-mark { width: 56px; height: 56px; }
.landing-title { font-family: Manrope, Inter, sans-serif; font-size: 30px; font-weight: 800; margin: 0 0 6px; }
.mutedlink { color: var(--muted); font-size: 13px; }
.mutedlink:hover { color: var(--brand); }

/* ---- Twee-paneel ticketweergave (lijst links, ticket rechts) ----------- */
.ticket-split { display: flex; gap: 20px; align-items: flex-start; }
.ts-list {
  width: 340px; flex-shrink: 0; position: sticky; top: 20px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding-right: 2px;
}
.ts-back { display: block; font-weight: 600; font-size: 13px; color: var(--muted); padding: 2px 6px 6px; }
.ts-back:hover { color: var(--brand); }
.ts-item {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px; padding: 12px 14px;
  color: var(--ink); box-shadow: var(--shadow);
}
.ts-item:hover { border-color: var(--brand); }
.ts-item.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: rgba(47,107,255,.05); }
.ts-item-top { display: flex; align-items: baseline; gap: 6px; }
.ts-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.ts-subj { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.ts-from { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-detail { flex: 1; min-width: 0; }
.ts-detail .ticket-head h1 { font-size: 20px; }
.ts-detail .columns { grid-template-columns: minmax(0, 1fr) 300px; }

.ts-item.status-accent-nieuw { border-left-color: #4a7bff; }
.ts-item.status-accent-bezig { border-left-color: #e0a02f; }
.ts-item.status-accent-wachten { border-left-color: #7c5cff; }
.ts-item.status-accent-opgelost { border-left-color: #2e9e5b; }
.ts-item.status-accent-gesloten { border-left-color: #b6bcc6; }

@media (max-width: 900px) {
  .ticket-split { flex-direction: column; }
  .ts-list { width: 100%; position: static; max-height: 320px; }
}

/* ---- Twee-kolommen ticketpagina (lijst links ~half, detail rechts) ----- */
.tickets-2col { display: flex; gap: 18px; align-items: flex-start; }
.list-pane {
  width: 42%; flex-shrink: 0;
  position: sticky; top: 20px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
}
.list-pane .toolbar, .list-pane .filterbar { max-width: none; margin-left: 0; margin-right: 0; }
.list-pane .toolbar { margin-bottom: 10px; }
.list-pane .filterbar { margin-bottom: 12px; }
.list-pane .search input { min-width: 0; width: 150px; }
.list-pane .ticket-list { max-width: none; margin: 0; overflow-y: auto; flex: 1; padding-right: 4px; }
.detail-pane { flex: 1; min-width: 0; }
.detail-pane .columns { grid-template-columns: minmax(0, 1fr) 280px; }
.detail-pane .ticket-head h1 { font-size: 20px; }
.ticket-card.selected { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.detail-empty {
  display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line); border-radius: 14px;
}
.detail-empty .ic { font-size: 34px; display: block; margin-bottom: 10px; }
@media (max-width: 1000px) {
  .tickets-2col { flex-direction: column; }
  .list-pane { width: 100%; position: static; max-height: none; }
  .list-pane .ticket-list { max-height: 360px; }
}

/* ---- Nette keuzelijsten in formulieren (Preventie, Prioriteit…) -------- */
.fld select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 36px 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background-color: var(--bg);
  color: var(--ink); font: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8598' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.fld select:focus { outline: none; border-color: var(--brand); }

/* ---- Nette bestandsknop -------------------------------------------------- */
.filefield { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.filebtn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.filebtn:hover { border-color: var(--brand); color: var(--brand); }
.filebtn input[type="file"] { display: none; }
.filenames { color: var(--muted); font-size: 13px; }
