:root {
  --bg: #faf9f7; --card: #fff; --ink: #1d2330; --muted: #6b7280;
  --line: #e6e4e0; --accent: #1a3a6a; --green: #2a6b2a; --red: #9a2a2a;
  --amber: #7a5b1a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 14px 18px; position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
header h1 { font-size: 18px; margin: 0; }
.mode { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.mode.test { background: #fff3cd; color: var(--amber); }
.mode.live { background: #d3f0d3; color: var(--green); }
.stats { margin-left: auto; display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--ink); }
.wrap { max-width: 880px; margin: 0 auto; padding: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
button.act {
  padding: 8px 14px; border: 1px solid var(--accent); background: #fff;
  color: var(--accent); border-radius: 8px; cursor: pointer; font-size: 14px;
}
button.act:hover { background: var(--accent); color: #fff; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 2px; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.badge {
  display: inline-block; background: #f0efec; padding: 1px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; margin-left: 6px;
}
textarea, input[type=text] {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  font: inherit; resize: vertical;
}
textarea { min-height: 230px; white-space: pre-wrap; }
.row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
button.approve { background: var(--green); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; cursor: pointer; }
button.reject { background: #fff; color: var(--red); border: 1px solid var(--red); padding: 9px 16px; border-radius: 8px; cursor: pointer; }
button.save { background: #fff; color: var(--accent); border: 1px solid var(--accent); padding: 9px 16px; border-radius: 8px; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.score { font-weight: 700; }
.score.hi { color: var(--green); } .score.mid { color: var(--amber); } .score.lo { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* TEST/LIVE-banner */
.banner { padding: 10px 18px; font-size: 13.5px; font-weight: 600; text-align: center; }
.banner.test { background: #fff3cd; color: var(--amber); border-bottom: 1px solid #f0e3b0; }
.banner.live { background: #d3f0d3; color: var(--green); border-bottom: 1px solid #bfe3bf; }

/* taal-badge + 'waarom'-regel */
.badge.lang { background: #eef1f6; color: var(--accent); }
.why { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.why.big { font-size: 13.5px; background: #f6f5f2; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

/* klikbare bedrijfsrijen */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f5f2; }

/* detailpaneel */
.overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 34, 0.45);
  display: flex; justify-content: flex-end; z-index: 50;
}
.panel {
  background: var(--card); width: min(620px, 100%); height: 100%;
  overflow-y: auto; padding: 24px 26px; box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  position: relative;
}
.panel-close {
  position: absolute; top: 14px; right: 16px; border: none; background: none;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.panel h2 { font-size: 19px; margin: 0 0 4px; }
.panel h4 { margin: 22px 0 8px; font-size: 14px; color: var(--accent); }
table.kv { width: 100%; }
table.kv th { width: 110px; vertical-align: top; color: var(--muted); font-weight: 600; }
table.kv td, table.kv th { border-bottom: 1px solid var(--line); padding: 7px 6px; }

/* mail-/reactieblokken in het paneel */
.msg { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fdfdfc; }
.msg-head { font-size: 13px; margin-bottom: 4px; }
.msg-subj { font-weight: 600; font-size: 14px; margin: 4px 0; }
.msg-body { white-space: pre-wrap; font: inherit; font-size: 13px; color: #2a3040; margin: 6px 0 0; }

@media (max-width: 640px) {
  .panel { width: 100%; padding: 20px 16px; }
  .stats { gap: 10px; }
}
