/* Camelot Beleggersclub — Caleb stijl (CAMELOT-DESIGN-SYSTEM-V3.md)
   Navy sidebar #0a1929 · witte cards radius 16px · coral #e28374 als ENIGE accent
   Cormorant Garamond voor display-headings · Inter voor body/UI */

:root {
  --c-ink: #0d1929;
  --c-sidebar: #0a1929;
  --c-accent-red: #e28374;
  --c-accent-hover: #d06b5c;
  --c-peach: #FFE5E0;
  --c-body: #f6f5f3;
  --fg-muted: #7d8186;
  --border-subtle: rgba(13, 23, 41, 0.06);
  --border-default: rgba(13, 23, 41, 0.10);
  --radius-md: 16px;
  --shadow-card: 0 1px 3px rgba(13, 23, 41, 0.05), 0 8px 24px rgba(13, 23, 41, 0.04);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--c-ink);
  background: var(--c-body);
  background-image:
    radial-gradient(ellipse at 12% -8%, rgba(226, 131, 116, 0.06), transparent 52%),
    radial-gradient(ellipse at 96% 108%, rgba(10, 25, 41, 0.06), transparent 55%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(13, 23, 41, 0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(13, 23, 41, 0.28); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--c-ink); }

/* ══ Login ═════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-body);
  background-image:
    radial-gradient(ellipse at 14% -10%, rgba(226, 131, 116, 0.10), transparent 55%),
    radial-gradient(ellipse at 90% 110%, rgba(10, 25, 41, 0.10), transparent 52%);
  padding: 24px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(13, 23, 41, 0.05), 0 40px 90px -30px rgba(13, 23, 41, 0.28);
  padding: 48px 44px;
  width: 100%; max-width: 420px;
  text-align: center;
}
.login-crest {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(160deg, #14304a, #0a1929);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px rgba(226, 131, 116, 0.22), 0 12px 26px rgba(13, 23, 41, 0.30);
}
.login-crest svg { width: 30px; height: 30px; }
.login-title {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 700; line-height: 1.15;
}
.login-title span { color: var(--c-accent-red); }
.login-sub { color: var(--fg-muted); margin: 8px 0 28px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  margin-bottom: 14px;
  outline: none;
}
.login-card input:focus {
  border-color: var(--c-accent-red);
  box-shadow: 0 0 0 3px rgba(226, 131, 116, 0.18);
}
.login-error { color: var(--c-accent-hover); margin-top: 12px; font-size: 13px; }

.cb-btn-primary {
  width: 100%;
  background: var(--c-accent-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(226, 131, 116, 0.30);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.cb-btn-primary:hover {
  background: var(--c-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(226, 131, 116, 0.38);
}

/* ══ App-shell ═════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #0e2438 0%, #0a1929 42%, #071220 100%);
  color: rgba(255, 255, 255, 0.7);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sb-crest {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(226, 131, 116, 0.45);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.sb-crest svg { width: 19px; height: 19px; }
.sb-brand-name {
  font-family: var(--font-display);
  color: #fff; font-size: 20px; font-weight: 700; line-height: 1.1;
}
.sb-brand-sub { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.5); }

.sb-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sb-section {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: 16px 20px 6px;
}
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 20px;
  border-left: 3px solid transparent;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sb-item:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.95); }
.sb-item.active {
  color: #fff;
  border-left-color: var(--c-accent-red);
  background: linear-gradient(90deg, rgba(226, 131, 116, 0.16), rgba(255, 255, 255, 0.03) 70%);
}
.sb-ico, .search-ico { display: inline-flex; width: 17px; height: 17px; }
.sb-ext { margin-left: auto; color: rgba(255, 255, 255, 0.35); font-size: 12px; }
.sb-ico svg, .search-ico svg { width: 100%; height: 100%; }

.sb-footer { padding: 16px 20px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sb-addr { font-size: 11.5px; color: rgba(255, 255, 255, 0.45); margin-bottom: 10px; word-break: break-all; }
.sb-logout {
  background: none; border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px; padding: 6px 16px; font-size: 12.5px;
}
.sb-logout:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 12px 32px;
}
.topbar-search {
  display: flex; align-items: center; gap: 10px;
  flex: 1; max-width: 520px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--fg-muted);
}
.topbar-search:focus-within {
  border-color: var(--c-accent-red);
  box-shadow: 0 0 0 3px rgba(226, 131, 116, 0.18);
}
.topbar-search input { flex: 1; border: none; outline: none; background: none; }
.topbar-club { font-family: var(--font-display); font-size: 17px; font-weight: 600; }

.content { padding: 32px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ══ Page header (cb-page-hd patroon) ══════════════ */
.cb-page-greeting { font-size: 14px; color: var(--fg-muted); }
.cb-accent { color: var(--c-accent-red); font-weight: 600; }
.cb-page-h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  margin: 2px 0 22px;
}
.cb-page-h1::after {
  content: '';
  display: block;
  width: 36px; height: 3px;
  background: var(--c-accent-red);
  border-radius: 2px;
  margin-top: 7px;
}
.cb-page-h1 span { color: var(--c-accent-red); }
.greeting-date { color: var(--fg-muted); font-weight: 400; }

/* ══ Cards & grids ═════════════════════════════════ */
.cm-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
/* ══ Dashboard ═════════════════════════════════════ */
.dash-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.dash-hero .cb-page-h1::after { display: none; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-actions a { display: inline-flex; }

.stat-link { text-decoration: none; color: inherit; transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease; }
.stat-link:hover { transform: translateY(-2px); border-color: rgba(226, 131, 116, 0.5); box-shadow: 0 6px 14px rgba(13, 23, 41, 0.07), 0 20px 40px rgba(13, 23, 41, 0.08); }

.source-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.source-chip {
  display: flex; align-items: center; gap: 11px;
  background: #fff; border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 11px 15px;
  box-shadow: var(--shadow-card);
}
.source-ico {
  width: 32px; height: 32px; min-width: 32px; border-radius: 9px;
  background: rgba(13, 23, 41, 0.05); color: var(--c-ink);
  display: flex; align-items: center; justify-content: center;
}
.source-ico svg { width: 16px; height: 16px; }
.source-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.source-label { font-weight: 600; font-size: 13px; }
.source-detail { font-size: 11.5px; color: var(--fg-muted); }
.source-dot { width: 9px; height: 9px; border-radius: 50%; }
.source-dot.ok { background: #4caf7e; box-shadow: 0 0 0 3px rgba(76, 175, 126, 0.16); }
.source-dot.warn { background: var(--c-accent-red); box-shadow: 0 0 0 3px rgba(226, 131, 116, 0.18); }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.dash-grid > * { min-width: 0; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title-row .card-title { margin-bottom: 0; }
.card-link { font-size: 12.5px; font-weight: 500; color: var(--c-accent-hover); }
.card-link:hover { text-decoration: underline; }
.title-count {
  display: inline-block; background: var(--c-accent-red); color: #fff;
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin-left: 2px;
}
.card-alert { border-color: rgba(226, 131, 116, 0.4); }

.dash-task-list { display: flex; flex-direction: column; }
.dash-task {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--border-subtle);
}
.dash-task:first-child { border-top: none; }
.dash-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-task-title { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-task-meta { font-size: 12px; color: var(--fg-muted); }
.dash-task:hover .dash-task-title { color: var(--c-accent-hover); }

.functie-list { display: flex; flex-direction: column; }
.functie-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--border-subtle); font-size: 13px;
}
.functie-row:first-child { border-top: none; }
.functie-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.functie-role { font-size: 11.5px; color: var(--c-accent-hover); font-weight: 500; white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 12px; color: var(--fg-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-hint { font-size: 12px; color: var(--fg-muted); }
.stat-ico {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 11px;
  background: rgba(226, 131, 116, 0.13);
  color: var(--c-accent-hover);
  display: flex; align-items: center; justify-content: center;
}
.stat-ico svg { width: 17px; height: 17px; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.card-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 14px; }

/* ══ Item-lijst ════════════════════════════════════ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.pill-tabs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--border-subtle); border-radius: 999px; padding: 4px; }
.pill-tab {
  border: none; background: none; border-radius: 999px;
  padding: 6px 15px; font-weight: 500; color: var(--fg-muted);
  transition: background 0.14s ease, color 0.14s ease;
}
.pill-tab:hover { color: var(--c-ink); }
.pill-tab.active { background: var(--c-sidebar); color: #fff; box-shadow: 0 2px 6px rgba(13, 23, 41, 0.22); }
.filter-bar select, .filter-bar input[type="date"] {
  background: #fff; border: 1px solid var(--border-default);
  border-radius: 999px; padding: 7px 13px; outline: none; color: var(--c-ink);
}
.filter-bar select:focus, .filter-bar input[type="date"]:focus { border-color: var(--c-accent-red); }
.filter-clear { background: none; border: none; color: var(--c-accent-red); font-weight: 500; }

.result-count { color: var(--fg-muted); font-size: 13px; margin-bottom: 10px; }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: flex; align-items: center; gap: 16px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 15px 20px;
  transition: border-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}
.item-row:hover {
  border-color: rgba(226, 131, 116, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 23, 41, 0.06), 0 16px 34px rgba(13, 23, 41, 0.09);
}
.item-ico {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 23, 41, 0.05);
  color: var(--c-ink);
}
.item-ico svg { width: 18px; height: 18px; }
.item-ico.dir-in { background: rgba(226, 131, 116, 0.14); color: var(--c-accent-hover); }
.item-ico.dir-out { background: var(--c-sidebar); color: #fff; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-side { text-align: right; min-width: 110px; }
.item-date { font-size: 12.5px; color: var(--fg-muted); }
.badges { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  border-radius: 999px; padding: 2px 9px;
  background: rgba(13, 23, 41, 0.06); color: var(--c-ink);
}
.badge.b-in { background: rgba(226, 131, 116, 0.16); color: var(--c-accent-hover); }
.badge.b-out { background: var(--c-sidebar); color: #fff; }
.badge.b-cat { background: var(--c-peach); color: var(--c-accent-hover); }
.badge.b-label { background: rgba(74, 52, 112, 0.09); color: #4A3470; }

.month-header {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--fg-muted);
  padding: 14px 4px 2px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.month-header::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-accent-red);
  margin-right: 9px;
  vertical-align: 2px;
}
.month-header:first-child { padding-top: 0; }
.thread-count {
  display: inline-block;
  background: var(--c-accent-red); color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 999px; padding: 1px 8px;
  vertical-align: 2px; margin-left: 6px;
}
.year-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); font-weight: 600; }

/* Selectie + bulk-acties */
.item-row.selectable { padding: 0 10px 0 14px; }
.item-row.selectable .item-link {
  display: flex; align-items: center; gap: 16px;
  flex: 1; min-width: 0;
  padding: 15px 6px 15px 12px;
}
.row-check { width: 16px; height: 16px; min-width: 16px; accent-color: var(--c-accent-red); cursor: pointer; }
.row-task {
  background: none; border: 1px solid var(--border-default); border-radius: 999px;
  width: 28px; height: 28px; min-width: 28px;
  color: var(--fg-muted); font-size: 16px; line-height: 1;
}
.row-task:hover { border-color: var(--c-accent-red); color: var(--c-accent-hover); }
.bulk-bar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--c-sidebar); color: #fff;
  border-radius: 999px; padding: 10px 12px 10px 20px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 8px 30px rgba(13, 23, 41, 0.35);
  z-index: 60; white-space: nowrap;
}
.bulk-bar span { font-size: 13.5px; font-weight: 500; }
.bulk-btn {
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: none; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 500;
}
.bulk-btn:hover { background: rgba(255, 255, 255, 0.24); }
.bulk-btn.danger { background: var(--c-accent-red); }
.bulk-btn.danger:hover { background: var(--c-accent-hover); }
.quick-task {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  z-index: 59;
  box-shadow: 0 12px 40px rgba(13, 23, 41, 0.25);
}

.empty-state {
  text-align: center; padding: 56px 20px; color: var(--fg-muted);
  background: #fff; border: 1px dashed var(--border-default); border-radius: var(--radius-md);
}
.empty-state .empty-title { font-family: var(--font-display); font-size: 21px; color: var(--c-ink); margin-bottom: 6px; }

.load-more { display: block; margin: 18px auto 0; background: none; border: 1px solid var(--border-default); border-radius: 999px; padding: 8px 22px; font-weight: 500; }
.load-more:hover { border-color: var(--c-accent-red); color: var(--c-accent-hover); }

/* ══ Detail ════════════════════════════════════════ */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); font-weight: 500; margin-bottom: 14px; }
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--c-accent-hover); }

.detail-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.2; }

.meta-grid { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 13.5px; margin-bottom: 4px; }
.meta-grid dt { color: var(--fg-muted); }
.meta-grid dd { word-break: break-word; }

.mail-body-frame { width: 100%; min-height: 420px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #fff; margin-top: 14px; }
.mail-body-text { white-space: pre-wrap; font-size: 13.5px; background: rgba(13,23,41,0.03); border-radius: 12px; padding: 18px; margin-top: 14px; overflow-x: auto; }

.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 14px; }
.att-name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: var(--fg-muted); font-size: 12.5px; }
.att-dl {
  background: var(--c-sidebar); color: #fff; border: none;
  border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 500;
  transition: background 0.15s ease, transform 0.12s ease;
}
.att-dl:hover { background: #14304a; transform: translateY(-1px); }

.thread-list { display: flex; flex-direction: column; gap: 6px; }
.thread-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.thread-item:hover { background: rgba(13, 23, 41, 0.04); }

.detail-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

/* ══ Formulieren (import / edit) ═══════════════════ */
.form-grid { display: grid; gap: 12px; }
.form-grid label { font-size: 12.5px; font-weight: 500; color: var(--fg-muted); display: block; margin-bottom: 4px; }
.form-grid input[type="text"], .form-grid input[type="date"], .form-grid textarea, .form-grid select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-default); border-radius: 10px; outline: none; background: #fff;
}
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--c-accent-red); box-shadow: 0 0 0 3px rgba(226,131,116,0.18); }

.dropzone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 34px 20px;
  text-align: center; color: var(--fg-muted);
  transition: border-color 0.12s ease, background 0.12s ease;
  cursor: pointer;
}
.dropzone.dragover { border-color: var(--c-accent-red); background: rgba(226, 131, 116, 0.06); }
.dropzone strong { color: var(--c-ink); }

.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.import-result { font-size: 13px; margin-top: 12px; }
.import-result .ok { color: #3d8b64; }
.import-result .dup { color: var(--fg-muted); }
.import-result .fail { color: var(--c-accent-hover); }

.btn-ghost {
  background: none; border: 1px solid var(--border-default);
  border-radius: 999px; padding: 8px 18px; font-weight: 500;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.btn-ghost:hover { border-color: var(--c-accent-red); color: var(--c-accent-hover); background: rgba(226, 131, 116, 0.05); }
.btn-danger { background: none; border: 1px solid rgba(208,107,92,0.4); color: var(--c-accent-hover); border-radius: 999px; padding: 6px 16px; font-size: 12.5px; }
.btn-danger:hover { background: rgba(226,131,116,0.08); }

.tag-chip { display: inline-block; background: rgba(13,23,41,0.06); border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; }

/* ══ Taken & opvolging ═════════════════════════════ */
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.task-row:first-child { border-top: none; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-done .task-title { text-decoration: line-through; color: var(--fg-muted); }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.task-desc { font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; }
.task-item-link { font-size: 12px; color: var(--c-accent-hover); font-weight: 500; }
.task-actions { display: flex; gap: 6px; align-items: center; }
.task-actions .task-next { padding: 4px 12px; font-size: 12px; }
.task-del { background: none; border: none; color: var(--fg-muted); font-size: 17px; line-height: 1; padding: 4px 6px; }
.task-del:hover { color: var(--c-accent-hover); }
.prio-dot { width: 9px; height: 9px; min-width: 9px; border-radius: 50%; margin-top: 6px; }
.prio-hoog { background: var(--c-accent-hover); }
.prio-normaal { background: rgba(13, 23, 41, 0.35); }
.prio-laag { background: rgba(13, 23, 41, 0.14); }
.badge.b-overdue { background: var(--c-accent-red); color: #fff; }
.overdue-toggle { border: 1px solid var(--border-default); background: #fff; }
.overdue-toggle.active { background: var(--c-accent-red); color: #fff; border-color: var(--c-accent-red); }
.task-form-row { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr; gap: 10px; }
@media (max-width: 800px) { .task-form-row { grid-template-columns: 1fr; } }
.dash-task { display: flex; gap: 9px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.dash-task:first-of-type { border-top: none; }
.dash-task-title { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-task-meta { color: var(--fg-muted); font-size: 12px; white-space: nowrap; }

/* ══ Chat (WhatsApp-groep) ═════════════════════════ */
.chat-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .chat-layout { grid-template-columns: 1fr; } }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.member-row:first-of-type { border-top: none; }
.member-avatar {
  width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
  background: var(--c-sidebar); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.member-main { flex: 1; min-width: 0; }
.member-name { font-weight: 500; line-height: 1.3; word-break: break-word; }
.member-main .badge { margin-top: 3px; }
.member-me { color: var(--fg-muted); font-weight: 400; font-size: 11.5px; }
.member-edit { background: none; border: none; color: var(--fg-muted); font-size: 13px; padding: 2px 4px; }
.member-edit:hover { color: var(--c-accent-hover); }
.chat-read { font-size: 10.5px; color: rgba(255, 255, 255, 0.6); margin-top: 2px; text-align: right; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg {
  max-width: 72%;
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 13px;
  box-shadow: 0 1px 3px rgba(13, 23, 41, 0.06);
}
.chat-msg.mine {
  align-self: flex-end;
  background: var(--c-sidebar);
  color: #fff;
  border: none;
  border-radius: 14px 14px 4px 14px;
}
.chat-sender { font-size: 12px; font-weight: 600; color: var(--c-accent-hover); margin-bottom: 2px; }
.chat-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.chat-ts { font-size: 10.5px; color: var(--fg-muted); margin-top: 3px; text-align: right; }
.chat-msg.mine .chat-ts { color: rgba(255, 255, 255, 0.55); }
.chat-img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; margin-bottom: 4px; }
.chat-doc { display: inline-block; font-size: 13px; font-weight: 500; color: var(--c-accent-hover); margin-bottom: 4px; }
.chat-msg.mine .chat-doc { color: #ffd6cd; }
.chat-doc.muted { color: var(--fg-muted); font-weight: 400; }
.chat-input-row { display: flex; gap: 10px; margin-top: 12px; position: relative; }
.chat-mention { color: var(--c-accent-hover); font-weight: 600; }
.chat-msg.mine .chat-mention { color: #ffd6cd; }
.mention-pop {
  position: absolute;
  bottom: calc(100% + 8px); left: 0;
  width: min(300px, 90%);
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(13, 23, 41, 0.18);
  max-height: 230px; overflow-y: auto;
  z-index: 30;
  padding: 5px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
}
.mention-item:hover, .mention-item.active { background: rgba(226, 131, 116, 0.10); color: var(--c-accent-hover); }
.chat-input-row input {
  flex: 1; padding: 11px 14px;
  border: 1px solid var(--border-default); border-radius: 999px; outline: none;
}
.chat-input-row input:focus { border-color: var(--c-accent-red); box-shadow: 0 0 0 3px rgba(226,131,116,0.18); }

/* ══ Status-view ═══════════════════════════════════ */
.status-ok { color: #3d8b64; font-weight: 600; }
.status-warn { color: var(--c-accent-hover); font-weight: 600; }
.log-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.log-table th {
  text-align: left; color: var(--fg-muted); font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 6px 8px; border-bottom: 1px solid var(--border-default);
}
.log-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.log-table tr:hover td { background: rgba(13, 23, 41, 0.02); }
.peach-card { background: var(--c-peach); border: none; }
.peach-card .card-title { color: var(--c-accent-hover); }

/* ══ Responsive ════════════════════════════════════ */
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: static; }
  .sb-nav { display: flex; flex-wrap: wrap; padding: 8px; }
  .sb-section { display: none; }
  .sb-item { border-left: none; border-radius: 999px; padding: 7px 14px; }
  .sb-item.active { background: rgba(255,255,255,0.12); }
  .sb-footer { display: flex; align-items: center; justify-content: space-between; }
  .content { padding: 18px 16px; }
  .topbar { padding: 10px 16px; }
  .topbar-club { display: none; }
  .item-side { display: none; }
}
