/* ═══════════════════════════════════════════════════════════════════════════════
   VIXX Groep CRM — STROOM branding
   Fonts: Archivo Black (koppen), Inter/Helvetica (body)
   Primary: #F8611C (oranje), #46B0C9 (blauw), #022950 (donkerblauw)
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --page-w: 1320px;

    /* STROOM brand */
    --brand-primary: #F8611C;
    --brand-primary-hover: #e5550f;
    --brand-primary-light: rgba(248,97,28,.1);
    --brand-secondary: #46B0C9;
    --brand-secondary-light: rgba(70,176,201,.12);
    --brand-dark: #022950;
    --brand-burgundy: #9D0334;
    --brand-creme: #F1ECE4;
    --brand-gradient-header: linear-gradient(135deg, #F8611C 0%, #FE5442 40%, #3F43AD 100%);
    --brand-gradient-warm: linear-gradient(135deg, #FE5442 0%, #F8611C 50%, #FF8C42 100%);

    /* Surfaces (warm) */
    --bg: #f7f5f2;
    --bg-card: #ffffff;
    --bg-card-hover: #faf8f5;
    --bg-surface: #f1ece4;
    --bg-muted: #e8e2d9;
    --border: #ddd6cc;
    --border-light: #eae5dd;
    --text: #1b1b1b;
    --text-secondary: #3e3e3e;
    --text-muted: #7a7164;
    --text-faint: #a89e93;

    /* Functioneel */
    --blue: #46B0C9;
    --blue-light: rgba(70,176,201,.14);
    --purple: #3F43AD;
    --purple-light: rgba(63,67,173,.1);
    --green: #2a9d6e;
    --green-light: rgba(42,157,110,.13);
    --pink: #9D0334;
    --pink-light: rgba(157,3,52,.1);
    --red: #dc2626;
    --red-light: #fee2e2;
    --amber-light: rgba(248,97,28,.1);

    --radius: 10px;
    --radius-sm: 7px;
    --radius-xs: 5px;
    --shadow-sm: 0 1px 2px rgba(2,41,80,.06);
    --shadow: 0 1px 3px rgba(2,41,80,.08), 0 1px 2px rgba(2,41,80,.04);
    --shadow-md: 0 4px 8px rgba(2,41,80,.07), 0 2px 4px rgba(2,41,80,.04);
    --shadow-lg: 0 12px 28px rgba(2,41,80,.12), 0 4px 10px rgba(2,41,80,.06);
    --transition: .15s ease;
}

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

body {
    font-family: 'Inter', Helvetica, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { flex-shrink: 0; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */

.header {
    background: var(--brand-gradient-header);
    padding: 0 28px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(248,97,28,.15);
}

.header-inner {
    max-width: var(--page-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
}

.logo { display: flex; align-items: center; gap: 12px; color: #fff; }
.logo-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
}
.logo h1 { font-family: 'Archivo Black', Arial, sans-serif; font-size: 15px; font-weight: 400; letter-spacing: .3px; white-space: nowrap; }
.header-subtitle { font-size: 11px; color: rgba(255,255,255,.72); display: block; margin-top: -1px; font-weight: 400; }

.nav { display: flex; gap: 1px; background: rgba(255,255,255,.15); border-radius: var(--radius-sm); padding: 3px; }
.nav a {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 13px; border-radius: var(--radius-xs);
    color: rgba(255,255,255,.72); font-size: 13px; font-weight: 500;
    transition: all var(--transition);
}
.nav a:hover { color: #fff; }
.nav a.active { background: rgba(255,255,255,.22); color: #fff; }
.nav a svg { width: 15px; height: 15px; }

.header-right { display: flex; align-items: center; gap: 12px; }

.user-chip {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    padding: 4px 12px 4px 5px; border-radius: 999px;
    color: #fff; cursor: pointer; transition: background var(--transition);
}
.user-chip:hover { background: rgba(255,255,255,.24); }
.user-chip .avatar { width: 26px; height: 26px; font-size: 10px; }
.user-chip-name { font-size: 12px; font-weight: 600; line-height: 1.15; }
.user-chip-role { font-size: 10px; color: rgba(255,255,255,.72); font-weight: 400; }

.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand-dark); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */

.page { max-width: var(--page-w); margin: 0 auto; padding: 26px 28px 60px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-family: 'Archivo Black', Arial, sans-serif; font-weight: 400; font-size: 22px; letter-spacing: .2px; }
.page-head .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Knoppen ────────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: all var(--transition);
    background: var(--bg-card); color: var(--text-secondary); border-color: var(--border);
}
.btn:hover { background: var(--bg-surface); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-surface); }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ─── Kaarten & stats ────────────────────────────────────────────────────────── */

.card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.card h3 svg { width: 15px; height: 15px; color: var(--text-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 14px; height: 14px; }
.stat-value { font-family: 'Archivo Black', Arial, sans-serif; font-size: 28px; font-weight: 400; margin-top: 8px; line-height: 1; }
.stat-note { font-size: 11px; color: var(--text-muted); margin-top: 7px; }
.stat-note b { color: var(--green); font-weight: 600; }
.stat-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; padding: 3px 9px;
    border-radius: 999px; white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.b-hypotheek   { background: var(--purple-light); color: var(--purple); }
.b-planning    { background: var(--amber-light); color: var(--brand-primary); }
.b-verzekering { background: var(--blue-light); color: #23849b; }
.b-pensioen    { background: var(--pink-light); color: var(--brand-burgundy); }

.b-eigen     { background: var(--brand-primary-light); color: var(--brand-primary); }
.b-franchise { background: var(--purple-light); color: var(--purple); }
.b-label     { background: var(--blue-light); color: #23849b; }

.s-nieuw     { background: var(--blue-light); color: #23849b; }
.s-contact   { background: var(--purple-light); color: var(--purple); }
.s-afspraak  { background: var(--amber-light); color: var(--brand-primary); }
.s-voorstel  { background: rgba(2,41,80,.09); color: var(--brand-dark); }
.s-gewonnen  { background: var(--green-light); color: var(--green); }
.s-verloren  { background: var(--red-light); color: var(--red); }

/* ─── Tabellen ───────────────────────────────────────────────────────────────── */

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
    text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted); padding: 10px 14px;
    border-bottom: 1px solid var(--border); background: var(--bg-card);
    position: sticky; top: 56px;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr { cursor: pointer; transition: background var(--transition); }
table.list tbody tr:hover { background: var(--bg-card-hover); }
.td-name { font-weight: 600; }
.td-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-muted { color: var(--text-muted); font-size: 12px; }

/* ─── Filters ────────────────────────────────────────────────────────────────── */

.filterbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar select, .filterbar input[type=search], .form select, .form input, .form textarea {
    font-family: inherit; font-size: 12.5px; color: var(--text);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 7px 10px; outline: none;
    transition: border-color var(--transition);
}
.filterbar select:focus, .filterbar input:focus, .form select:focus, .form input:focus, .form textarea:focus { border-color: var(--brand-primary); }
.filterbar input[type=search] { min-width: 220px; }
.filter-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ─── Kanban / pipeline ──────────────────────────────────────────────────────── */

.board { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; align-items: start; }
.col { background: var(--bg-surface); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.col.drag-over { outline: 2px dashed var(--brand-primary); outline-offset: -2px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.col-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; }
.col-count { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: 999px; padding: 1px 8px; }
.col-sum { font-size: 10.5px; color: var(--text-faint); padding: 0 6px 8px; }

.kcard {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 8px;
    box-shadow: var(--shadow-sm); cursor: grab; display: block;
    transition: box-shadow var(--transition), transform var(--transition);
}
.kcard:hover { box-shadow: var(--shadow-md); }
.kcard.dragging { opacity: .5; }
.kcard-name { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.kcard-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kcard-value { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.kcard-org { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kcard .avatar { width: 20px; height: 20px; font-size: 8px; }

/* ─── Funnel ─────────────────────────────────────────────────────────────────── */

.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 74px; gap: 12px; align-items: center; font-size: 12px; }
.funnel-row .lbl { color: var(--text-secondary); font-weight: 500; }
.funnel-track { display: block; background: var(--bg-surface); border-radius: 999px; height: 18px; overflow: hidden; }
.funnel-bar { display: block; height: 100%; border-radius: 999px; min-width: 4px; transition: width .4s ease; }
.funnel-n { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.funnel-n b { color: var(--text); }

/* ─── Opvolglijst / taken ────────────────────────────────────────────────────── */

.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-light); }
.task-row:last-child { border-bottom: none; }
.task-when { font-size: 11px; font-weight: 600; min-width: 74px; color: var(--text-muted); }
.task-when.overdue { color: var(--red); }
.task-what { flex: 1; font-size: 12.5px; }
.task-what .who { color: var(--text-muted); font-size: 11.5px; }

/* ─── Lead detail ────────────────────────────────────────────────────────────── */

.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }

.stepper { display: flex; gap: 4px; margin-bottom: 18px; }
.step { flex: 1; text-align: center; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding-top: 8px; position: relative; }
.step::before { content: ''; display: block; height: 4px; border-radius: 999px; background: var(--bg-muted); margin-bottom: 7px; }
.step.done { color: var(--text-muted); }
.step.done::before { background: var(--brand-secondary); }
.step.current { color: var(--brand-primary); }
.step.current::before { background: var(--brand-primary); }
.step.lost { color: var(--red); }
.step.lost::before { background: var(--red); }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { font-weight: 500; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border-light); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -24px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--brand-secondary); display: flex; align-items: center; justify-content: center; }
.tl-dot svg { width: 8px; height: 8px; color: var(--brand-secondary); }
.tl-head { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.tl-head b { color: var(--text-secondary); font-weight: 600; }
.tl-body { font-size: 12.5px; line-height: 1.5; }

.note-form { display: grid; gap: 8px; margin-top: 14px; }
.note-form textarea { resize: vertical; min-height: 60px; }
.note-form-row { display: flex; gap: 8px; justify-content: space-between; }

/* ─── Vestigingen ────────────────────────────────────────────────────────────── */

.org-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.org-card { padding: 16px 18px; }
.org-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.org-name { font-size: 14px; font-weight: 700; }
.org-city { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.org-stats { display: flex; gap: 16px; border-top: 1px solid var(--border-light); padding-top: 11px; margin-top: 4px; }
.org-stat { font-size: 11px; color: var(--text-muted); }
.org-stat b { display: block; font-size: 15px; color: var(--text); font-weight: 700; margin-bottom: 1px; }
.org-users { display: flex; margin-top: 12px; }
.org-users .avatar { width: 26px; height: 26px; font-size: 9px; border: 2px solid var(--bg-card); margin-left: -6px; }
.org-users .avatar:first-child { margin-left: 0; }

/* ─── Rechten-tabel ──────────────────────────────────────────────────────────── */

.perm-note { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-primary-light); border: 1px solid rgba(248,97,28,.25); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.perm-note svg { width: 16px; height: 16px; color: var(--brand-primary); margin-top: 1px; }

/* ─── Login / rolkiezer ──────────────────────────────────────────────────────── */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand-gradient-header); padding: 30px; }
.login-card { background: var(--bg-card); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 700px; padding: 36px 40px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-brand img { height: 26px; }
.login-title { font-family: 'Archivo Black', Arial, sans-serif; font-weight: 400; font-size: 24px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin: 8px 0 26px; line-height: 1.5; }
.login-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 18px 0 8px; }
.login-users { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-user {
    display: flex; align-items: center; gap: 11px; text-align: left; width: 100%;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.login-user:hover { border-color: var(--brand-primary); background: var(--bg-card-hover); box-shadow: var(--shadow-sm); }
.login-user-name { font-size: 13px; font-weight: 600; }
.login-user-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */

.modal-back { position: fixed; inset: 0; background: rgba(2,41,80,.4); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; }
.modal-back.open { display: flex; }
.modal { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; padding: 24px 26px; }
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.form { display: grid; gap: 12px; }
.form label { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); display: grid; gap: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.empty { text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 30px 10px; }

.flash { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--brand-dark); color: #fff; font-size: 12.5px; font-weight: 500; padding: 9px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 300; animation: flash 2.6s forwards; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, 8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ─── Responsief ─────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .board { grid-template-columns: repeat(3, 1fr); }
    .grid-2, .detail-grid { grid-template-columns: 1fr; }
    .org-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
    .page { padding: 18px 16px 50px; }
    .board { grid-template-columns: 1fr; }
    .org-grid, .login-users, .form-row { grid-template-columns: 1fr; }
    .nav a span { display: none; }
    .header { padding: 0 14px; }
    .header-subtitle { display: none; }
}

/* ═══ Aanvullende componenten ═══════════════════════════════════════════════════ */

.wordmark { font-family: 'Archivo Black', Arial, sans-serif; font-size: 19px; color: #fff; letter-spacing: .2px; line-height: 1; }
.wordmark span { color: rgba(255,255,255,.55); }
.wordmark-dark { color: var(--brand-dark); font-size: 24px; }
.wordmark-dark span { color: var(--brand-primary); }
.logo-divider { width: 1px; height: 26px; background: rgba(255,255,255,.3); }
.logo h1 { line-height: 1.1; }

.nav a { position: relative; }
.nav-count { font-style: normal; font-size: 10px; font-weight: 700; background: #fff; color: var(--brand-primary); border-radius: 999px; padding: 1px 6px; margin-left: 2px; }

.scope-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: #fff; background: rgba(2,41,80,.22); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-chip > span:last-child { display: flex; flex-direction: column; }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 150; }
.user-drop a, .user-drop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; font-size: 12.5px; color: var(--text-secondary); border: none; background: none; border-radius: var(--radius-xs); cursor: pointer; text-align: left; }
.user-drop a:hover, .user-drop button:hover { background: var(--bg-surface); }

/* Login */
.login-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; background: var(--brand-primary-light); color: var(--brand-primary); padding: 3px 9px; border-radius: 999px; }
.login-title { margin-top: 18px; }
.login-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.login-user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* Kaarten extra */
.h3-sub { font-weight: 400; color: var(--text-faint); font-size: 11.5px; margin-left: auto; }
.card-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--brand-primary); margin-top: 12px; }
.card-link:hover { color: var(--brand-primary-hover); }
.card-link svg { transition: transform var(--transition); }
.card-link:hover svg { transform: translateX(2px); }
.scope-text { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
a.funnel-row { border-radius: var(--radius-xs); }
a.funnel-row:hover .lbl { color: var(--brand-primary); }
.task-row { border-radius: var(--radius-xs); transition: background var(--transition); }
a.task-row:hover { background: var(--bg-card-hover); }
.task-when { display: inline-flex; align-items: center; gap: 3px; }
.task-row .avatar { width: 24px; height: 24px; font-size: 9px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product-tile { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); transition: all var(--transition); }
.product-tile:hover { border-color: var(--border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.product-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.product-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.product-num { font-family: 'Archivo Black', Arial, sans-serif; font-size: 22px; line-height: 1.1; }
.product-num small { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.product-meta { font-size: 11px; color: var(--text-muted); }

.mini-bar { display: inline-block; width: 44px; height: 5px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 7px; }
.mini-bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.spark { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 6px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.spark-bar { width: 100%; background: var(--brand-gradient-warm); border-radius: 4px 4px 2px 2px; opacity: .85; transition: opacity var(--transition); }
.spark-col:last-child .spark-bar { background: var(--brand-dark); }
.spark-col:hover .spark-bar { opacity: 1; }
.spark-lbl { font-size: 9.5px; color: var(--text-faint); }

/* Tabellen extra */
.table-card { overflow: hidden; }
.table-card table.list th { top: 0; position: static; background: var(--bg-card-hover); }
.sort { color: inherit; }
.sort:hover, .sort.on { color: var(--brand-primary); }
.owner-cell { display: flex; align-items: center; gap: 8px; }
.owner-cell .avatar { width: 24px; height: 24px; font-size: 9px; }
.lock-ic { display: inline-flex; color: var(--text-faint); margin-right: 5px; vertical-align: -1px; }
.search-field { display: flex; align-items: center; gap: 7px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; color: var(--text-faint); }
.search-field:focus-within { border-color: var(--brand-primary); }
.search-field input[type=search] { border: none !important; padding: 7px 0 !important; min-width: 250px; }

/* Kanban extra */
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-empty { font-size: 11.5px; color: var(--text-faint); text-align: center; padding: 20px 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.kcard[draggable=false] { cursor: pointer; }
.kcard-next { font-size: 11px; color: var(--text-muted); margin-top: 7px; display: flex; align-items: center; gap: 4px; line-height: 1.3; }
.kcard-next.overdue { color: var(--red); font-weight: 600; }
.kcard-right { display: flex; align-items: center; gap: 6px; }
.kcard-org { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }

/* Lead detail extra */
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.back-link:hover { color: var(--brand-primary); }
.lead-title { display: flex; align-items: center; }
.lead-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px !important; }
form.inline { display: inline; }
.btn-win { color: var(--green); border-color: rgba(42,157,110,.35); }
.btn-win:hover { background: var(--green-light); }
.stepper-card { margin-bottom: 14px; padding-bottom: 6px; }
.stepper { margin-bottom: 10px; }
.step.won { color: var(--green); }
.step.won::before { background: var(--green); }
.lost-reason { font-size: 12px; color: var(--red); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: all var(--transition); }
.seg span:hover { background: var(--bg-surface); }
.seg input:checked + span { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.next-row label { font-weight: 600; }
.tl-call .tl-dot, .tl-meeting .tl-dot { border-color: var(--brand-primary); }
.tl-call .tl-dot svg, .tl-meeting .tl-dot svg { color: var(--brand-primary); }
.tl-stage .tl-dot { border-color: var(--green); }
.tl-stage .tl-dot svg { color: var(--green); }
.tl-assign .tl-dot, .tl-created .tl-dot { border-color: var(--border); }
.tl-assign .tl-dot svg, .tl-created .tl-dot svg { color: var(--text-muted); }
.tl-hidden { color: var(--text-faint); font-style: italic; }
.next-card { background: var(--brand-dark); color: #fff; border: none; }
.next-card .stat-label { color: rgba(255,255,255,.65); }
.next-card.is-overdue { background: var(--red); }
.next-what { font-size: 16px; font-weight: 700; margin-top: 8px; }
.next-when { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 3px; }
.link { color: var(--brand-primary); }
.link:hover { text-decoration: underline; }
.kv dd .badge { margin-left: 4px; }
.assign-form { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.assign-form select { flex: 1; font-family: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; background: var(--bg-card); }

/* Inbox */
.inbox-list { display: grid; gap: 10px; }
.inbox-item { display: flex; gap: 20px; align-items: center; padding: 16px 20px; border-left: 3px solid var(--brand-secondary); }
.inbox-main { flex: 1; min-width: 0; }
.inbox-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-need { font-size: 13px; color: var(--text-secondary); margin: 5px 0 8px; }
.inbox-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.inbox-meta span { display: inline-flex; align-items: center; gap: 5px; }
.inbox-route { display: grid; gap: 6px; min-width: 330px; }
.route-hint { font-size: 11px; font-weight: 600; color: var(--green); display: flex; align-items: center; gap: 5px; }
.route-row { display: flex; gap: 8px; }
.route-row select { flex: 1; font-family: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 8px; background: var(--bg-card); }

/* Organisatie */
.org-tree { margin-bottom: 24px; padding: 22px 24px; }
.tree-root { text-align: center; position: relative; padding-bottom: 22px; }
.tree-root::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 2px; height: 22px; background: var(--border); }
.tree-node { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); }
.tree-node small { font-weight: 500; color: var(--text-muted); font-size: 10.5px; }
.tree-node.root { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }
.tree-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tree-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border-top: 2px solid var(--border); padding-top: 18px; position: relative; }
.tree-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tree-leaves { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tree-leaf { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.tree-leaf.eigen { background: var(--brand-primary-light); color: var(--brand-primary); }
.tree-leaf.franchise { background: var(--purple-light); color: var(--purple); }
.tree-legend { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.label-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; }
.label-head h3 { font-size: 15px; font-weight: 700; }
.label-swatch { width: 12px; height: 12px; border-radius: 4px; }
a.org-card { display: block; transition: all var(--transition); }
a.org-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.org-city { display: flex; align-items: center; gap: 5px; }
.org-users { align-items: center; }
.org-team { font-size: 11px; color: var(--text-muted); margin-left: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Rechten */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.principle h4 { font-size: 14px; margin: 12px 0 6px; }
.principle p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.principle-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--brand-primary-light); color: var(--brand-primary); }
.principle:nth-child(2) .principle-ic { background: var(--purple-light); color: var(--purple); }
.principle:nth-child(3) .principle-ic { background: var(--blue-light); color: #23849b; }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; }
.matrix tbody tr { cursor: default; }
.matrix .me { background: rgba(248,97,28,.05); }
.matrix th.me { color: var(--brand-primary); }
.me-tag { display: inline-block; margin-left: 5px; font-size: 9px; background: var(--brand-primary); color: #fff; padding: 1px 6px; border-radius: 999px; letter-spacing: .04em; vertical-align: 1px; }
.scope-row td { background: var(--bg-card-hover); }
.scope-tag { font-size: 11px; color: var(--text-secondary); line-height: 1.35; display: inline-block; max-width: 150px; }
.perm { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; }
.perm.yes { background: var(--green-light); color: var(--green); }
.perm.no { color: var(--text-faint); opacity: .6; }
.foot-note { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--text-muted); margin-top: 14px; line-height: 1.5; }
.foot-note svg { margin-top: 2px; }

@media (max-width: 1100px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .principles { grid-template-columns: 1fr; }
    .scope-pill { display: none; }
    .inbox-item { flex-direction: column; align-items: stretch; }
    .inbox-route { min-width: 0; }
    .table-card { overflow-x: auto; }
}
@media (max-width: 680px) {
    .user-chip > span:last-child { display: none; }
    .user-chip { padding: 4px; }
    .logo-divider, .logo > span:last-child { display: none; }
    .tree-labels { grid-template-columns: 1fr; }
    .search-field input[type=search] { min-width: 0; }
}

/* Kanban-kaart voet */
.kcard-foot { gap: 8px; }
.kcard-org { flex: 1; }
.kcard-value { white-space: nowrap; }
.board-wide { max-width: 1560px; }

.header-subtitle, .user-chip-name, .user-chip-role { white-space: nowrap; }
@media (max-width: 1000px) {
    .user-chip > span:last-child { display: none; }
    .user-chip { padding: 4px; }
    .nav a { padding: 6px 10px; }
}

/* ═══ v0.2: fases per organisatie + leadkaart ═══════════════════════════════════ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
[hidden] { display: none !important; }

.sbadge { background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 82%, #000); }

/* Organisatie-tabs */
.org-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.org-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 999px; transition: all var(--transition); }
.org-tab:hover { border-color: var(--border); }
.org-tab.on { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.org-tab .label-swatch { width: 9px; height: 9px; border-radius: 3px; }

/* Kanban met variabel aantal kolommen */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scroll-snap-type: x proximity; }
.board .col { flex: 0 0 256px; scroll-snap-align: start; }
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-thumb { background: var(--bg-muted); border-radius: 999px; }
.col-kind { font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 0 6px 6px; }
.col-inbound { background: color-mix(in srgb, var(--brand-secondary) 7%, var(--bg-surface)); }
.col-won { background: color-mix(in srgb, var(--green) 7%, var(--bg-surface)); }
.col-lost { background: color-mix(in srgb, var(--red) 5%, var(--bg-surface)); }
.kcard-none { color: var(--brand-primary); font-weight: 500; }
.kcard-meta .badge + .badge { margin-left: 2px; }

/* Omzetten naar klant */
.modal-sub { font-size: 12.5px; color: var(--text-muted); margin: -8px 0 14px; line-height: 1.5; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-tile { position: relative; cursor: pointer; }
.check-tile input { position: absolute; opacity: 0; }
.check-tile > span { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all var(--transition); }
.check-tile .product-icon { width: 30px; height: 30px; margin: 0; border-radius: 8px; }
.check-tile:hover > span { border-color: var(--text-faint); }
.check-mark { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; color: transparent; }
.check-tile input:checked + span { border-color: var(--green); background: var(--green-light); }
.check-tile input:checked + span .check-mark { background: var(--green); border-color: var(--green); color: #fff; }
.check-tile input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.form-error { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--red); margin-top: 10px; }
.btn-win-solid { background: var(--green); border-color: var(--green); color: #fff; }
.btn-win-solid:hover { background: #238a60; border-color: #238a60; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; margin-right: auto; }
.btn-danger-ghost:hover { background: var(--red-light); }
.modal .form-foot { margin-top: 16px; }

/* Leadkop */
.lead-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.lead-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.lead-title { font-family: 'Archivo Black', Arial, sans-serif; font-weight: 400; font-size: 24px; letter-spacing: .2px; }
.lead-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.lead-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }

/* Klikbare stepper */
.stepper-card { padding: 14px 16px 10px; margin-bottom: 16px; }
.stepper-click { display: flex; gap: 4px; margin: 0; }
.stepper-click .step::before { display: none; }
.stepper-click .step { flex: 1; background: none; border: none; padding: 4px 2px 6px; cursor: pointer; border-radius: var(--radius-xs); font-family: inherit; text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); transition: background var(--transition); }
.stepper-click .step:not([disabled]):hover { background: var(--bg-surface); color: var(--text-secondary); }
.stepper-click .step[disabled] { cursor: default; }
.step-bar { display: block; height: 5px; border-radius: 999px; background: var(--bg-muted); margin-bottom: 7px; }
.stepper-click .step.done { color: var(--text-muted); }
.stepper-click .step.done .step-bar { background: var(--brand-secondary); }
.stepper-click .step.current { color: var(--brand-primary); }
.stepper-click .step.current .step-bar { background: var(--brand-primary); }
.stepper-click .step.won { color: var(--green); }
.stepper-click .step.won .step-bar { background: var(--green); }
.stepper-click .step.lost { color: var(--red); }
.stepper-click .step.lost .step-bar { background: var(--red); }
.step-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lost-reason { margin: 6px 4px 2px; }

/* Twee kolommen: dossier + activiteit */
.lead-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.lead-layout > aside { position: sticky; top: 72px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 26px; }
.card-head h3 { margin: 0; }
.count-pill { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-surface); border-radius: 999px; padding: 1px 8px; }
.warn-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--brand-primary); background: var(--brand-primary-light); border-radius: 999px; padding: 3px 9px; }

.editable .edit-only { display: none; }
.editable.is-editing .edit-only { display: grid; }
.editable.is-editing .view-only { display: none; }
.editable.is-editing { box-shadow: 0 0 0 2px var(--brand-primary-light), var(--shadow); border-color: rgba(248,97,28,.4); }
.kv { grid-template-columns: 92px 1fr; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.editable dd[data-field] { cursor: text; border-radius: 4px; margin: -2px -5px; padding: 2px 5px; transition: background var(--transition); }
.editable dd[data-field]:hover { background: var(--bg-surface); }
.empty-val { color: var(--text-faint); font-weight: 400; font-style: italic; }
.badge-list { display: flex; flex-wrap: wrap; gap: 4px; }
.form label { font-weight: 600; }
.form input, .form select, .form textarea { width: 100%; }
.lbl-hint { font-weight: 400; color: var(--text-faint); margin-left: 4px; }

.inline-select { display: flex; align-items: center; gap: 7px; }
.inline-select .avatar { width: 24px; height: 24px; font-size: 9px; }
.inline-select select { flex: 1; min-width: 0; font-family: inherit; font-size: 12.5px; font-weight: 500; border: 1px solid transparent; background: transparent; border-radius: var(--radius-xs); padding: 3px 4px; cursor: pointer; margin-left: -4px; }
.inline-select select:hover, .inline-select select:focus { border-color: var(--border); background: var(--bg-card); outline: none; }

.transfer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.transfer summary { list-style: none; width: 100%; justify-content: center; }
.transfer summary::-webkit-details-marker { display: none; }
.transfer[open] summary { background: var(--bg-surface); }
.transfer-form { margin-top: 12px; }
.hint { display: flex; gap: 6px; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.hint svg { margin-top: 2px; }

/* Composer */
.composer { overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--border-light); background: var(--bg-card-hover); }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 18px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand-primary); border-bottom-color: var(--brand-primary); background: var(--bg-card); }
.tab-pane { padding: 16px 18px; gap: 10px; }
.composer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.when-field { display: inline-flex !important; align-items: center; gap: 6px; color: var(--text-muted); grid-template-columns: none; }
.when-field input { width: auto !important; font-size: 12px !important; padding: 5px 8px !important; }
.followup { display: grid; grid-template-columns: auto 1fr 140px 96px; gap: 8px; align-items: center; background: var(--bg-card-hover); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.followup-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.followup-lbl small { font-weight: 400; color: var(--text-faint); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-row { display: grid; grid-template-columns: 150px 110px 1fr; gap: 10px; }
.quick-dates { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.chip { font-family: inherit; font-size: 11.5px; font-weight: 500; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer; transition: all var(--transition); }
.chip:hover { background: var(--bg-surface); }
.chip.on { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* Acties */
.task-list { display: grid; gap: 6px; }
.task { display: flex; align-items: flex-start; gap: 11px; padding: 10px 10px 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-card); position: relative; transition: border-color var(--transition); }
.task:hover { border-color: var(--border); }
.task.is-overdue { border-left: 3px solid var(--red); }
.task.is-today { border-left: 3px solid var(--brand-primary); }
.task-check { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-card); color: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-top: 1px; transition: all var(--transition); }
.task-check:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }
.task-check.is-static { cursor: default; }
.task-type { color: var(--text-muted); margin-top: 3px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 600; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.task-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.task-meta .avatar { width: 16px; height: 16px; font-size: 7px; }
.task.is-overdue .task-due { color: var(--red); font-weight: 600; }
.task.is-today .task-due { color: var(--brand-primary); font-weight: 600; }
.task-note { font-style: italic; }
.empty.small { padding: 14px 10px; font-size: 12px; }

.icon-btn { width: 28px; height: 28px; border-radius: var(--radius-xs); display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); background: none; border: none; cursor: pointer; list-style: none; flex-shrink: 0; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover:not([disabled]) { background: var(--bg-surface); color: var(--text-secondary); }
.icon-btn[disabled] { opacity: .3; cursor: default; }
.icon-btn.is-locked { cursor: help; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-pop, .stage-del-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; width: 380px; max-width: calc(100vw - 40px); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; }

/* Tijdlijn */
.filter-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-chips .chip { padding: 3px 9px; font-size: 11px; }
.timeline { padding-left: 26px; }
.timeline::before { left: 8px; top: 30px; }
.tl-day { position: relative; margin: 4px 0 10px -26px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); background: var(--bg-card); padding: 2px 0; }
.tl-day:not(:first-child) { margin-top: 14px; }
.tl-item { display: flex; gap: 8px; align-items: flex-start; padding-bottom: 12px; border-radius: var(--radius-xs); }
.tl-dot { left: -26px; width: 18px; height: 18px; }
.tl-dot svg { width: 10px; height: 10px; }
.tl-content { flex: 1; min-width: 0; }
.tl-head { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.tl-head b { color: var(--text); }
.tl-time { font-size: 11px; color: var(--text-faint); }
.tl-body { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); background: var(--bg-card-hover); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 8px 11px; }
.tl-item.is-system .tl-head { color: var(--text-muted); }
.tl-item.is-system .tl-head b { color: var(--text-secondary); font-weight: 600; }
.tl-item.is-system .tl-body { background: none; border: none; padding: 0; font-size: 12px; color: var(--text-muted); }
.tl-done .tl-dot { border-color: var(--green); background: var(--green); }
.tl-done .tl-dot svg { color: #fff; }
.tl-note .tl-dot { border-color: var(--purple); }
.tl-note .tl-dot svg { color: var(--purple); }
.tl-mail .tl-dot { border-color: var(--brand-secondary); }
.tl-transfer .tl-dot { border-color: var(--purple); }
.tl-transfer .tl-dot svg { color: var(--purple); }
.tl-update .tl-dot, .tl-stage .tl-dot { border-color: var(--border); }
.tl-update .tl-dot svg, .tl-stage .tl-dot svg { color: var(--text-muted); }
.tl-item .row-menu { opacity: 0; transition: opacity var(--transition); }
.tl-item:hover .row-menu, .tl-item .row-menu[open] { opacity: 1; }
.flash-target { animation: flashTarget 1.6s ease; }
@keyframes flashTarget { 0%, 40% { background: var(--brand-primary-light); } 100% { background: transparent; } }

/* Fases instellen */
.stage-preview { margin-bottom: 14px; }
.preview-row { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.preview-col { flex: 0 0 150px; background: var(--bg-surface); border-radius: var(--radius-sm); padding: 9px 11px; border-top: 3px solid var(--c); display: grid; gap: 3px; }
.preview-kind { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.preview-name { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-n { font-size: 11px; color: var(--text-muted); }
.stage-list { overflow: visible; }
.stage-row { display: grid; grid-template-columns: 96px minmax(180px, 1.3fr) 150px minmax(200px, 1.4fr) 60px 150px; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border-light); }
.stage-row:last-child { border-bottom: none; }
.stage-row-head { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); background: var(--bg-card-hover); border-radius: var(--radius) var(--radius) 0 0; }
.stage-row input:not([type=color]):not([type=checkbox]), .stage-row select { font-family: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px; background: var(--bg-card); width: 100%; min-width: 0; }
.stage-row input:focus, .stage-row select:focus { border-color: var(--brand-primary); outline: none; }
.stage-row input[disabled], .stage-row select[disabled] { background: var(--bg-card-hover); color: var(--text-secondary); border-color: var(--border-light); }
.stage-order { display: flex; align-items: center; gap: 0; }
.stage-order .icon-btn { width: 24px; height: 24px; }
.stage-pos { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-left: 6px; display: inline-flex; }
.stage-name-cell { display: flex; gap: 8px; align-items: center; }
.stage-name-cell input[type=color] { width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid var(--border); border-radius: 7px; padding: 2px; background: var(--bg-card); cursor: pointer; }
.stage-opts label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.opt-check:not([hidden]) { display: flex !important; align-items: center; gap: 7px; font-weight: 500 !important; cursor: pointer; }
.opt-check input { width: auto !important; accent-color: var(--green); }
.stage-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.stage-del { position: relative; }
.stage-del-pop { width: 260px; display: grid; gap: 10px; font-size: 12px; }
.stage-del-pop label { display: grid; gap: 5px; font-weight: 600; }
.stage-add { background: var(--bg-card-hover); border-radius: 0 0 var(--radius) var(--radius); }
.kind-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12px; color: var(--text-muted); margin: 14px 2px; }
.kind-legend > div { display: flex; align-items: center; gap: 6px; }
.kind-legend b { color: var(--text-secondary); }
.reset-form { display: flex; align-items: center; gap: 10px; font-size: 11.5px; flex-wrap: wrap; }
.stage-strip { display: flex; gap: 5px; flex-wrap: wrap; margin: -4px 0 12px; }
.stage-chip { font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, transparent); color: color-mix(in srgb, var(--c) 82%, #000); }
.label-head-btn { margin-left: auto; }

@media (max-width: 1100px) {
    .lead-layout { grid-template-columns: 1fr; }
    .lead-layout > aside { position: static; }
    .stage-row { grid-template-columns: 70px 1fr 140px; }
    .stage-row > :nth-child(n+5) { grid-column: auto; }
    .stage-row-head { display: none; }
}
@media (max-width: 680px) {
    .followup { grid-template-columns: 1fr 1fr; }
    .followup-lbl { grid-column: 1 / -1; }
    .followup input[name=next_title] { grid-column: 1 / -1; }
    .plan-row { grid-template-columns: 1fr 1fr; }
    .plan-row label:last-child { grid-column: 1 / -1; }
    .check-grid { grid-template-columns: 1fr; }
    .stepper-click { overflow-x: auto; }
    .stepper-click .step { min-width: 90px; }
    .stage-row { grid-template-columns: 1fr; }
    .tabs .tab { flex: 1; justify-content: center; padding: 11px 8px; }
}

@media (max-width: 680px) {
    .header { height: auto; padding: 8px 14px 6px; }
    .header-inner { flex-wrap: wrap; gap: 6px 10px; }
    .nav { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; }
    .nav a { flex: 1; justify-content: center; }
    .table-card table.list th { position: static; }
}
.followup > *, .plan-row > *, .form-row > *, .composer-top > * { min-width: 0; }
.followup input, .plan-row input, .plan-row select { width: 100%; min-width: 0; }
.seg input, .check-tile input { width: 1px !important; height: 1px; }
.grid-2 > *, .stack > *, .lead-layout > * { min-width: 0; }
.card:has(> table.list) { overflow-x: auto; }
@media (max-width: 680px) {
    .stat-value { font-size: 22px; }
    .stat { padding: 14px; }
}
.inbox-meta span { overflow-wrap: anywhere; min-width: 0; } .route-row select { min-width: 0; } .inbox-route, .inbox-main { min-width: 0; }
.inbox-list > * { min-width: 0; }
.inbox-route > * { min-width: 0; }

/* ═══ v0.3: login, profiel, gebruikers, mailbox ═════════════════════════════════ */

.login-narrow { max-width: 440px; }
.login-form { gap: 14px; margin-top: 4px; }
.login-form input[type=email] { font-size: 15px; padding: 11px 13px; }
.btn-lg { padding: 11px 18px; font-size: 14px; justify-content: center; }
.login-alert { display: flex; align-items: center; gap: 8px; background: var(--red-light); color: #991b1b; font-size: 12.5px; font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.code-boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.form .code-boxes input { text-align: center; font-size: 26px; font-weight: 700; padding: 12px 0; font-variant-numeric: tabular-nums; border-width: 1.5px; color: var(--brand-dark); }
.form .code-boxes input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-light); }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.link-btn { background: none; border: none; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-primary); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.demo-login { margin-top: 18px; font-size: 12px; color: var(--text-muted); }
.demo-login summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }

.imp-bar { background: var(--brand-dark); color: #fff; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; flex-wrap: wrap; text-align: center; }
.imp-bar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.imp-bar .btn:hover { background: rgba(255,255,255,.22); }
.user-drop-head { font-size: 11px; color: var(--text-faint); padding: 6px 10px 8px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.user-drop { min-width: 230px; }

.profile-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
.profile-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-name { font-size: 17px; font-weight: 700; }
.ok-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-light); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.private-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--purple); background: var(--purple-light); border-radius: 999px; padding: 3px 9px; }
.mailbox-conn { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-card-hover); border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 14px; }
.g-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check-list { list-style: none; display: grid; gap: 7px; margin: 0 0 16px; font-size: 12.5px; color: var(--text-secondary); }
.check-list li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.check-list svg { color: var(--green); margin-top: 2px; }
.mailbox-intro { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 14px; }
.mailbox-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.btn-google { background: #fff; border-color: var(--border); color: #1f1f1f; padding: 9px 16px; font-size: 13px; gap: 9px; }
.btn-google:hover { background: #f8f9fa; border-color: #c4c7c5; }
.setup-note { font-size: 12px; line-height: 1.55; color: var(--text-secondary); background: var(--amber-light); border: 1px solid rgba(248,97,28,.25); border-radius: var(--radius-sm); padding: 11px 13px; width: 100%; }
.setup-note code { font-size: 11px; background: rgba(255,255,255,.7); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

.users-table .row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.users-table tbody tr { cursor: default; }
.users-table tr.is-inactive td { opacity: .55; }
.users-table .owner-cell .avatar { width: 30px; height: 30px; font-size: 10px; }
.user-pop { width: 520px; }
.s-off { background: var(--bg-muted); color: var(--text-muted); }
.scope-hint { align-self: end; padding-bottom: 8px; font-size: 12px; }
.modal-wide { max-width: 600px; }

/* Mailbox op leadkaart */
.mailbox-empty { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; background: var(--bg-card-hover); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px; }
.mailbox-empty .btn { flex-shrink: 0; }
.mail-list { display: grid; gap: 6px; }
.mail-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.mail-row.is-linked { background: var(--bg-card-hover); }
.mail-dir { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.mail-in { background: var(--blue-light); color: #23849b; }
.mail-out { background: var(--brand-primary-light); color: var(--brand-primary); }
.mail-main { flex: 1; min-width: 0; }
.mail-top { display: flex; justify-content: space-between; gap: 10px; }
.mail-subject { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.mail-snippet { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.src-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: var(--purple); background: var(--purple-light); border-radius: 999px; padding: 1px 7px; }

@media (max-width: 900px) {
    .profile-grid { grid-template-columns: 1fr; }
    .mailbox-empty { flex-wrap: wrap; }
}
