/* ───────────────────────────────────────────────────────────────
   Slack Broadcast — huisstijl in Slack "Aubergine"
   ─────────────────────────────────────────────────────────────── */
:root {
    --aubergine: #4a154b;
    --aubergine-700: #3f0e40;
    --aubergine-600: #611f69;
    --aubergine-300: #a17ba3;
    --aubergine-050: #f4ecf4;

    --slack-blue: #36c5f0;
    --slack-green: #2eb67d;
    --slack-red: #e01e5a;
    --slack-yellow: #ecb22e;

    --ink: #1d1c1d;
    --muted: #616061;
    --line: #e2dfe2;
    --bg: #f7f4f7;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(29, 28, 29, 0.08), 0 8px 24px rgba(29, 28, 29, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--aubergine-600); }

/* ─── Header ─────────────────────────────────────────────────── */
.topbar {
    background: var(--aubergine-700);
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.2px;
}
.topbar .brand .logo {
    width: 28px; height: 28px;
    display: grid; place-items: center;
}
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a {
    color: #e9d9ea;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,0.12); color: #fff; }

.user-pill {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.10);
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    font-size: 13px;
    color: #fff;
}
.user-pill img { width: 28px; height: 28px; border-radius: 6px; display: block; }

/* ─── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }
.container-narrow { max-width: 620px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card + .card { margin-top: 20px; }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.2px; }
.subtle { color: var(--muted); font-size: 14px; }
.step-label {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--aubergine); color: #fff; font-size: 12px; font-weight: 800;
    margin-right: 8px;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid transparent;
    background: var(--aubergine); color: #fff;
    font-weight: 700; font-size: 15px;
    padding: 11px 18px; border-radius: 8px;
    cursor: pointer; text-decoration: none;
    transition: filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: #fff; color: var(--aubergine); border-color: var(--line); }
.btn-ghost:hover { background: var(--aubergine-050); filter: none; }
.btn-slack { background: #fff; color: #1d1c1d; border: 1px solid #dcdcdc; font-size: 16px; padding: 13px 22px; }
.btn-slack:hover { background: #f7f7f7; filter: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ─── Form ───────────────────────────────────────────────────── */
label.field-label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px; }
textarea, input[type="text"], input[type="search"] {
    width: 100%;
    border: 1px solid #c9c6c9;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
textarea:focus, input:focus {
    outline: none;
    border-color: var(--aubergine-300);
    box-shadow: 0 0 0 3px rgba(74, 21, 75, 0.15);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }

.var-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.var-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    background: var(--aubergine-050); color: var(--aubergine-600);
    border: 1px solid #e6d7e7; border-radius: 6px;
    padding: 4px 8px; cursor: pointer;
}
.var-chip:hover { background: #ecdcee; }
.var-chip small { color: var(--muted); font-family: inherit; margin-left: 4px; }

/* ─── Opmaakbalk ─────────────────────────────────────────────── */
.format-toolbar {
    display: flex; align-items: center; gap: 2px;
    border: 1px solid #c9c6c9; border-bottom: none;
    border-radius: 8px 8px 0 0; padding: 5px 6px; background: #faf9fa;
}
.format-toolbar button {
    min-width: 30px; height: 30px; padding: 0 7px;
    border: 1px solid transparent; background: transparent; border-radius: 6px;
    cursor: pointer; color: var(--ink); font-size: 14px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.format-toolbar button:hover { background: var(--aubergine-050); border-color: #e6d7e7; }
.format-toolbar button code { font-size: 11px; }
.format-toolbar .tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.format-toolbar + textarea { border-radius: 0 0 8px 8px; }

/* ─── Bijlagen ───────────────────────────────────────────────── */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-item {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--aubergine-050); border: 1px solid #e6d7e7;
    border-radius: 8px; padding: 6px 8px 6px 10px; font-size: 13px;
}
.attach-item .fn { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .fs { color: var(--muted); font-size: 12px; }
.attach-item button {
    background: rgba(74,21,75,.12); border: none; color: var(--aubergine);
    width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 13px;
}
.attach-item button:hover { background: rgba(74,21,75,.25); }

/* ─── Inplannen ──────────────────────────────────────────────── */
.schedule-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.schedule-toggle input { width: 16px; height: 16px; accent-color: var(--aubergine); }
#schedule-fields {
    margin-top: 12px; padding: 14px; border: 1px solid var(--line);
    border-radius: 10px; background: #faf9fa;
}
.schedule-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-presets button {
    border: 1px solid #d9d2da; background: #fff; color: var(--ink);
    border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all .12s ease;
}
.schedule-presets button:hover { border-color: var(--aubergine-300); background: var(--aubergine-050); }
.schedule-presets button.active { background: var(--aubergine); border-color: var(--aubergine); color: #fff; }
.schedule-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.schedule-custom .sc-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.schedule-custom input[type="date"],
.schedule-custom input[type="time"] {
    width: auto; padding: 8px 10px; font-size: 14px; color: var(--ink);
    border: 1px solid #c9c6c9; border-radius: 8px; background: #fff;
    font-family: inherit;
}
.schedule-custom input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
.schedule-custom input:focus { outline: none; border-color: var(--aubergine-300); box-shadow: 0 0 0 3px rgba(74,21,75,.15); }
.schedule-hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.schedule-hint.warn { color: #9b1130; font-weight: 600; }

/* ─── Voorbeeld mrkdwn ───────────────────────────────────────── */
.msg-bubble code { background: rgba(29,28,29,.08); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.msg-bubble pre { background: rgba(29,28,29,.06); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 13px; margin: 4px 0; }
.msg-bubble blockquote { border-left: 3px solid var(--aubergine-300); margin: 4px 0; padding: 2px 0 2px 10px; color: #4a4a4a; }
.msg-bubble ul.mk { margin: 4px 0; padding-left: 22px; }
.msg-bubble ul.mk li { margin: 1px 0; }
.msg-bubble a { color: var(--aubergine-600); }
.preview-attach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-chip { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--muted); }

/* ─── Ontvanger-kiezer ───────────────────────────────────────── */
.picker-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.picker-tabs button {
    background: transparent; border: none; cursor: pointer;
    padding: 8px 12px; border-radius: 8px 8px 0 0;
    font-weight: 700; font-size: 14px; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.picker-tabs button.active { color: var(--aubergine); border-bottom-color: var(--aubergine); }
.picker-tabs .count { color: var(--muted); font-weight: 600; }

.guest-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    margin-top: 10px; font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600;
}
.guest-toggle input { width: 15px; height: 15px; accent-color: var(--aubergine); }

/* ─── Variabelen per persoon ─────────────────────────────────── */
.cv-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.cv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cv-table th, .cv-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0eef0; white-space: nowrap; }
.cv-table thead th { background: var(--aubergine-050); font-size: 12px; color: var(--aubergine-700); font-weight: 800; }
.cv-table thead th:first-child { border-top-left-radius: 8px; }
.cv-table tbody tr:last-child td { border-bottom: none; }
.cv-table .cv-name { font-weight: 600; }
.cv-table input { min-width: 130px; padding: 7px 9px; font-size: 13px; }
#custom-vars-desc code { background: var(--aubergine-050); color: var(--aubergine-600); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

.target-list {
    max-height: 320px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: 8px;
    margin-top: 10px;
}
.target-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid #f0eef0;
}
.target-row:last-child { border-bottom: none; }
.target-row:hover { background: var(--aubergine-050); }
.target-row .avatar {
    width: 30px; height: 30px; border-radius: 6px; flex: 0 0 auto;
    background: var(--aubergine-050); display: grid; place-items: center;
    color: var(--aubergine-600); font-weight: 800; font-size: 13px; overflow: hidden;
}
.target-row .avatar img { width: 100%; height: 100%; object-fit: cover; }
.target-row .meta { flex: 1 1 auto; min-width: 0; }
.target-row .meta .nm { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-row .meta .sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--aubergine); }
.hashtag { color: var(--aubergine-600); font-weight: 800; }
.lock { font-size: 11px; color: var(--muted); }

.selected-bar {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; min-height: 4px;
}
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--aubergine); color: #fff;
    border-radius: 999px; padding: 5px 8px 5px 12px; font-size: 13px; font-weight: 600;
}
.pill.channel { background: var(--aubergine-600); }
.pill button { background: rgba(255,255,255,.25); border: none; color: #fff; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 12px; }
.pill button:hover { background: rgba(255,255,255,.4); }

/* ─── Verzend-voortgang ──────────────────────────────────────── */
.progress-wrap { margin-top: 6px; }
.progress-track { height: 8px; background: #ece8ec; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--aubergine), var(--aubergine-600)); transition: width .3s ease; }
.progress-stats { display: flex; gap: 16px; margin-top: 10px; font-size: 14px; }
.progress-stats b { font-weight: 800; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.green { background: var(--slack-green); }
.dot.red { background: var(--slack-red); }
.dot.grey { background: #c9c6c9; }

.result-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; max-height: 360px; overflow-y: auto; }
.result-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f0eef0; font-size: 14px; }
.result-row:last-child { border-bottom: none; }
.result-row .status-icon { width: 20px; text-align: center; }
.result-row .r-name { flex: 1 1 auto; font-weight: 600; }
.result-row .r-err { color: var(--slack-red); font-size: 12.5px; }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Flash / alerts ─────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.alert-error { background: #fdecef; color: #9b1130; border: 1px solid #f6c6d3; }
.alert-success { background: #e7f6ef; color: #146c4c; border: 1px solid #bfe6d3; }
.alert-info { background: var(--aubergine-050); color: var(--aubergine-700); border: 1px solid #e6d7e7; }

/* ─── Landing ────────────────────────────────────────────────── */
.hero { text-align: center; padding: 60px 24px 30px; }
.hero .logo-badge {
    width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 22px;
    background: var(--aubergine); display: grid; place-items: center;
    box-shadow: var(--shadow);
}
.hero h1 { font-size: 40px; letter-spacing: -1px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 560px; margin: 10px auto 28px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch; gap: 16px; margin-top: 40px; }
.features .card { margin-top: 0; } /* overschrijft .card + .card zodat de rij netjes uitlijnt */
.feature { text-align: left; display: flex; flex-direction: column; height: 100%; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature .ic { font-size: 22px; margin-bottom: 8px; }
.feature h3 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ─── Tabel / history ────────────────────────────────────────── */
table.history { width: 100%; border-collapse: collapse; }
table.history th, table.history td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.history th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.green { background: #e7f6ef; color: #146c4c; }
.badge.red { background: #fdecef; color: #9b1130; }
.badge.grey { background: #eee; color: #555; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

.muted-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px; font-size: 14px; }

.msg-bubble { background: var(--aubergine-050); border: 1px solid #e6d7e7; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; margin-top: 6px; }

/* ─── Gebruikte variabelen (detail) ──────────────────────────── */
.used-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.var-token { background: var(--aubergine-050); color: var(--aubergine-600); border: 1px solid #e6d7e7; border-radius: 6px; padding: 2px 7px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rr-detail { align-items: flex-start; }
.rr-body { flex: 1 1 auto; min-width: 0; }
.rr-top { display: flex; align-items: center; gap: 10px; }
.rr-top .rr-time { font-size: 12.5px; margin-left: auto; }
.rr-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.var-val { font-size: 12.5px; color: var(--muted); background: #f6f4f6; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.var-val code { color: var(--aubergine-600); font-size: 11.5px; }

@media (max-width: 640px) {
    .topbar { padding: 0 14px; }
    .topbar .brand span.full { display: none; }
    .hero h1 { font-size: 30px; }
}
