:root {
  --bg: #0f1220;
  --bg-2: #171b2e;
  --panel: #1c2138;
  --panel-2: #232a45;
  --border: #2c3352;
  --text: #e8ebf5;
  --muted: #98a0bd;
  --accent: #6c5ce7;
  --accent-2: #00c2a8;
  --hot: #ff6b6b;
  --warn: #ffb020;
  --ok: #34d399;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
#app { display: flex; flex-direction: column; height: 100vh; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.brand .logo { margin-right: 4px; }
.brand-sub { color: var(--accent); font-weight: 600; }
.stats { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.stats .stat { color: var(--muted); font-size: 12px; }
.stats .stat b { color: var(--text); font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { color: var(--muted); font-size: 12px; }
.whoami select, .filter, .search {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none;
}
.btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: .15s;
}
.btn:hover { background: var(--panel-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { color: var(--hot); border-color: var(--hot); background: transparent; }
.btn.spin { opacity: .6; pointer-events: none; }

/* Toolbar */
.toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  border-bottom: 1px solid var(--border); background: var(--bg-2); flex-wrap: wrap;
}
.search { flex: 1; min-width: 220px; }
.chk { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.run-info { color: var(--muted); font-size: 11px; margin-left: auto; }

/* Board */
.board {
  display: flex; gap: 14px; padding: 16px 18px; overflow-x: auto; flex: 1; align-items: flex-start;
}
.col {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 280px; width: 280px; max-height: 100%; display: flex; flex-direction: column;
}
.col.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.col-head {
  padding: 10px 12px; font-weight: 700; font-size: 13px; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
/* Ingeklapte (lege) kolom */
.col.collapsed { min-width: 46px; width: 46px; cursor: pointer; }
.col.collapsed:hover { border-color: var(--accent); }
.col.collapsed .collapsed-head {
  flex-direction: column; height: 260px; padding: 14px 6px; gap: 12px;
  justify-content: flex-start; align-items: center; border-bottom: none;
}
.col-label-v { writing-mode: vertical-rl; white-space: nowrap; color: var(--muted); font-size: 12px; }
.col-title { display: inline-flex; align-items: center; }
.col-sum { color: var(--ok); font-weight: 800; margin-left: 8px; font-size: 12px; }
.col-head .count { background: var(--panel-2); color: var(--muted); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.col[data-stage="nieuw"] .col-head { color: var(--accent-2); }
.col-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

/* Card */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; cursor: grab; position: relative; transition: .12s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card.gone { opacity: .5; }
.card.alert-due { border-left: 3px solid var(--warn); }
.card.priority { border-color: var(--hot); box-shadow: 0 0 0 1px var(--hot), 0 4px 14px rgba(255,107,107,.20); }
.tag.prio { background: var(--hot); color: #2b0808; border-color: transparent; font-weight: 800; letter-spacing: .4px; }
.card .co { font-weight: 700; font-size: 13px; }
.card .ti { color: var(--text); font-size: 13px; margin: 3px 0 6px; line-height: 1.3; }
.card .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 20px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--border);
}
.tag.loc { color: var(--text); }
.tag.days { color: var(--warn); }
.tag.hot { background: rgba(255,107,107,.15); color: var(--hot); border-color: transparent; }
.tag.stack { background: rgba(108,92,231,.18); color: #b8aef7; border-color: transparent; }
.tag.deal { background: rgba(52,211,153,.16); color: var(--ok); border-color: transparent; font-weight: 700; }
.badges-top { margin-bottom: 6px; gap: 6px; }
.tag.remote-badge { background: var(--accent); color: #fff; border-color: transparent; font-weight: 800; letter-spacing: .4px; }
.card.remote-top { border-color: var(--accent); }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.owner-badge {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; color: #fff;
}
.owner-Jesse { background: #e17055; }
.owner-Jesper { background: #0984e3; }
.owner-none { background: var(--border); color: var(--muted); }
.card .alert-dot { color: var(--warn); font-size: 11px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
  background: var(--panel); border-left: 1px solid var(--border); z-index: 50;
  box-shadow: var(--shadow); overflow-y: auto; padding: 20px 22px;
}
.drawer h2 { margin: 0 0 2px; font-size: 17px; }
.drawer .d-co { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.drawer .field { margin-bottom: 14px; }
.drawer label.lb { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.drawer select, .drawer input, .drawer textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none; font-family: inherit;
}
.drawer textarea { min-height: 90px; resize: vertical; }
.drawer .row2 { display: flex; gap: 10px; }
.drawer .row2 > * { flex: 1; }
.drawer .close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.d-link { display: inline-block; margin-bottom: 14px; color: var(--accent-2); text-decoration: none; font-size: 13px; }
.d-link:hover { text-decoration: underline; }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.saved-flash { color: var(--ok); font-size: 11px; margin-left: 8px; opacity: 0; transition: .2s; }
.saved-flash.on { opacity: 1; }

/* Alerts */
.alert-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.alert-item { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.alert-item.due { border-color: var(--warn); }
.alert-item .ad { color: var(--warn); font-weight: 700; white-space: nowrap; }
.alert-item .an { flex: 1; color: var(--muted); }
.alert-item button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.alert-add { display: flex; gap: 8px; }
.alert-add input[type=date] { flex: 0 0 140px; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.d-actions { display: flex; justify-content: space-between; margin-top: 18px; }

/* Toast */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; z-index: 60; box-shadow: var(--shadow); max-width: 80vw; font-size: 13px;
}
.empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 8px; }

/* Login */
.login-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(9,11,20,.82); backdrop-filter: blur(3px);
}
.login-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 26px; width: 340px; max-width: 90vw; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.login-brand { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.login-brand span { color: var(--accent); }
.login-box .lb { margin-top: 6px; }
.login-box input {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none;
}
.login-err, .login-box .login-err { color: var(--hot); font-size: 12px; min-height: 16px; }

/* Modal (gebruikersbeheer) */
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  z-index: 50; box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.modal .close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal input { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none; }
.users-list { display: flex; flex-direction: column; gap: 7px; }
.user-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
