:root {
  --bg: #ffffff;
  --side: #fbfbfc;
  --line: #ececf0;
  --text: #1b1b22;
  --muted: #7b7b88;
  --hover: #f4f4f7;
  --primary: #5b4cf5;
  --primary-dark: #4a3be0;
  --good: #1f9d55;
  --bad: #e5484d;
  --test: #b7791f;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--primary); text-decoration: none; }
small, .muted { color: var(--muted); }
code { background: var(--hover); border-radius: 5px; padding: 1px 5px; font-size: 13px; }

/* Indeling */
.shell { display: flex; min-height: 100vh; }
.side { width: 250px; flex: none; background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px; }
.main { flex: 1; min-width: 0; padding: 18px 24px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.me-name { font-weight: 600; }
.me-name small { display: block; font-weight: 400; }
nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
nav a:hover { background: var(--hover); }
nav a.on { background: #efeff3; font-weight: 500; }
nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-h { margin: 22px 10px 6px; font-size: 13px; color: var(--muted); }
.side-list { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.doc { display: inline-block; font-size: 10px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 4px;
  padding: 2px 4px; margin-right: 8px; vertical-align: 1px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.dot.ok { background: var(--good); }
.dot.off { background: #c9c9d2; }
.test-badge { margin: 18px 6px 0; padding: 8px 10px; border-radius: 8px; background: #fff7e6; color: var(--test); font-size: 13px; }
.logout { margin-top: auto; padding: 8px 10px; color: var(--muted); font-size: 14px; }

/* Bovenbalk + tabs */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 7px 11px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.tab span { color: var(--muted); margin-left: 4px; }
.tab.on { background: #efeff3; font-weight: 500; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 9px; padding: 8px 14px;
  font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary b { font-weight: 500; margin-right: 4px; }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; color: var(--primary); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.link.danger { color: var(--bad); }

/* Lijst */
.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 10px 12px; }
.list td { padding: 11px 12px; border-top: 1px solid transparent; vertical-align: middle; }
.list tbody tr:hover td { background: var(--hover); }
.list tbody tr td:first-child { border-radius: 8px 0 0 8px; }
.list tbody tr td:last-child { border-radius: 0 8px 8px 0; }
.list .empty td { color: var(--muted); padding: 40px 12px; text-align: center; }
.list.small td { padding: 8px 6px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #e8e6fd; color: var(--primary); font-weight: 600; font-size: 13px; margin-right: 10px; vertical-align: middle; }
.me-av { width: 32px; height: 32px; margin: 0; }
.chan { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 13px; margin-right: 4px; }
.st { font-size: 14px; margin-right: 10px; white-space: nowrap; }
.hot { display: inline-block; background: #fff4cc; color: #8a6400; border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 600; }
.seen { display: inline-block; background: #e7f5ec; color: var(--good); border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.peek { font-size: 12px; margin-left: 6px; }
.plan { display: inline-block; background: #eef3f6; color: #0b405f; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.warn { margin: 0; font-size: 13px; color: #b7791f; }
.st.good { color: var(--good); }
.st.bad { color: var(--bad); }
.st.test { color: var(--test); }

/* Paneel */
.drawer-bg { position: fixed; inset: 0; background: rgba(20, 20, 30, .25); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: #fff; z-index: 11;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .12); display: flex; flex-direction: column; overflow-y: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; }
.drawer-head h2 { margin: 0; font-size: 19px; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.step { padding: 12px 22px; display: flex; flex-direction: column; gap: 8px; }
.lbl { font-weight: 600; font-size: 14px; color: var(--text); display: flex; flex-direction: row;
  justify-content: space-between; align-items: baseline; gap: 8px; }
.lbl small { font-weight: 400; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); border: 1px solid #dcdce3; border-radius: 9px;
  padding: 9px 11px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d9d4ff; border-color: var(--primary); }
textarea { resize: vertical; line-height: 1.45; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .full { grid-column: 1 / -1; }
.grid2 input { color: var(--text); }
.results { list-style: none; margin: 0; padding: 0; border-radius: 9px; overflow: hidden; }
.results li { padding: 9px 11px; cursor: pointer; border: 1px solid var(--line); border-top: 0; display: flex; justify-content: space-between; gap: 10px; }
.results li:first-child { border-top: 1px solid var(--line); border-radius: 9px 9px 0 0; }
.results li:last-child { border-radius: 0 0 9px 9px; }
.results li:only-child { border-radius: 9px; }
.results li:hover, .results li.sel { background: #f1efff; }
.results .r-sub { color: var(--muted); font-size: 13px; text-align: right; }
.chips { display: flex; gap: 8px; }
.chip { flex-direction: row; align-items: center; gap: 8px; border: 1px solid #dcdce3; border-radius: 9px; padding: 8px 14px;
  color: var(--text); font-size: 15px; cursor: pointer; }
.chip input { width: auto; margin: 0; accent-color: var(--primary); }
.chip:has(input:checked) { border-color: var(--primary); background: #f1efff; }
.drawer-foot { margin-top: auto; padding: 14px 22px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.msg { margin: 0 0 10px; font-size: 14px; min-height: 1em; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }

/* Instellingen */
.page { max-width: 760px; }
.page h1 { font-size: 22px; margin: 4px 0 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font-size: 17px; }
.card p { margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 160px; }
.ok { color: var(--good); }
.err { color: var(--bad); }

/* Inloggen */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--side); }
.login { width: min(360px, calc(100% - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0 0 6px; font-size: 21px; }
.login h1 span { color: var(--primary); }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; }
  .side-h, .side-list, .test-badge { display: none; }
  .logout { margin: 0 0 0 auto; }
  .main { padding: 14px 16px; overflow-x: auto; }
  .list th:nth-child(4), .list td:nth-child(4), .list th:nth-child(2), .list td:nth-child(2) { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
