:root {
  --paper: #f6f1e7;
  --panel: #fbf7ee;
  --card: #fffdf8;
  --card-soft: #f0e9db;
  --ink: #2b2118;
  --ink-2: #4a3f30;
  --sub: #6d6049;
  --muted: #8a7c66;
  --faint: #9c8f79;
  --line: #e2d8c6;
  --line-soft: #e9e0cf;
  --dark: #2b2118;
  --dark-2: #3c2f21;
  --dark-line: #4a3b2a;
  --dark-text: #efe6d6;
  --dark-muted: #a89a83;
  --dark-faint: #8d7f68;
  --accent: #c2571f;
  --accent-dark: #a8481a;
  --accent-text: #fff7ee;
  --ok: #3f7a4e;
  --ok-bg: #e3efdf;
  --warn: #8c5a2a;
  --warn-bg: #f3e6d3;
  --err: #a03d25;
  --err-bg: #f7e3dc;
  --bol: #22688f;
  --bol-bg: #e4f1f8;
  --ai: #7b4f96;
  --ai-bg: #f7effb;
  --ai-line: #d9c4e4;
  --shadow: 0 6px 18px rgba(122, 79, 32, 0.08);
  --font-body: 'Public Sans', -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: var(--font-body); }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.standalone-empty { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; font-family: var(--font-body); background: var(--paper); }
.standalone-empty h1 { margin: 8px 0 0; font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.standalone-empty p { margin: 0; color: var(--muted); font-size: 14px; }
.connect-link { margin-top: 14px; color: var(--accent-text); background: var(--accent); border-radius: 999px; padding: 12px 20px; text-decoration: none; font-size: 14px; font-weight: 600; }
.connect-link:hover { background: var(--accent-dark); }

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(350px, 396px) minmax(540px, 1fr) 312px;
  overflow: hidden;
  background: var(--panel);
}

/* ── Zijmenu ─────────────────────────────────────────────────────────────── */
.sidebar { min-height: 100vh; background: var(--dark); color: var(--dark-text); padding: 24px 16px 18px; display: flex; flex-direction: column; }
.brand-row { display: flex; align-items: flex-start; gap: 11px; padding: 0 6px 22px; }
.brand-mark { display: none; }
.standalone-empty .brand-mark { display: grid; width: 44px; height: 44px; border-radius: 50%; background: var(--dark); color: var(--dark-text); place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 21px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.4px; }
.brand-tagline { font-size: 11px; color: var(--dark-muted); margin-top: 4px; letter-spacing: 1.6px; text-transform: uppercase; }
.compose-button { border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); width: 100%; padding: 12px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.compose-button:hover { background: var(--accent-dark); }
nav { margin-top: 22px; display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--dark-muted); font-size: 14px; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: var(--dark-2); color: var(--dark-text); }
.nav-item.active { font-weight: 600; }
.nav-icon { font-size: 13px; width: 16px; text-align: center; opacity: 0.85; }
.nav-count { margin-left: auto; background: var(--accent); color: var(--accent-text); min-width: 21px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.sidebar-section { margin-top: 26px; border-top: 1px solid var(--dark-line); padding: 16px 2px 0; }
.sidebar-section > p { color: var(--dark-faint); text-transform: uppercase; font-size: 10px; letter-spacing: 1.6px; font-weight: 700; margin: 0 0 10px 8px; }
.channel-row { border: 0; background: transparent; color: #cfc2ab; width: 100%; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; font-size: 13px; text-align: left; cursor: pointer; border-radius: 8px; }
.channel-row:hover { background: var(--dark-2); }
.channel-dot { width: 8px; height: 8px; border-radius: 50%; }
.bol-dot { background: #4fa8d8; } .web-dot { background: #9a86c9; } .mail-dot { background: #d8944f; }
.channel-row > span:last-child { color: var(--dark-faint); }
.archive-hint { margin-top: auto; margin-bottom: 8px; display: block; padding: 11px 12px; border: 1px solid #7a5a2a; border-radius: 12px; background: #33280f; color: var(--dark-text); text-decoration: none; }
.archive-hint:hover { background: #3f3114; color: var(--dark-text); }
.archive-hint strong { display: block; font-size: 12px; font-weight: 600; color: #e8c9a8; }
.archive-hint span { display: block; font-size: 10.5px; color: var(--dark-muted); margin-top: 3px; line-height: 1.4; }
.archive-hint + .notify-card { margin-top: 0; }

.notify-card { margin-top: auto; margin-bottom: 8px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--dark-line); border-radius: 12px; color: var(--dark-text); background: transparent; width: 100%; text-align: left; cursor: pointer; }
.notify-card:hover { background: var(--dark-2); }
.notify-card.on { border-color: #5c7a54; background: #26301f; }
.notify-card.blocked { border-color: #7a4a3a; }
.notify-icon { font-size: 15px; line-height: 1; filter: grayscale(1) opacity(0.6); }
.notify-card.on .notify-icon { filter: none; }
.notify-card strong, .notify-card > span > span { display: block; }
.notify-card strong { font-size: 12px; font-weight: 600; }
.notify-card > span > span { color: var(--dark-faint); font-size: 10.5px; margin-top: 2px; }
.notify-card.on > span > span { color: #9fc08f; }

.sync-card { margin-top: 0; display: grid; grid-template-columns: 12px 1fr; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--dark-line); border-radius: 12px; color: var(--dark-text); background: transparent; width: 100%; text-align: left; cursor: pointer; }
.sync-card:hover { background: var(--dark-2); }
.sync-icon { display: none; }
.sync-card strong, .sync-card span { display: block; }
.sync-card strong { font-size: 12px; font-weight: 600; }
.sync-card span { color: var(--dark-faint); font-size: 10.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { width: 8px; height: 8px; background: #6fbf8f; border-radius: 50%; }
.online-dot.offline { background: #d8944f; }
.profile-wrap { position: relative; margin-top: 14px; }
.profile-row { width: 100%; padding: 8px 6px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; background: transparent; border: 0; border-radius: 10px; text-align: left; cursor: pointer; color: var(--dark-text); }
.profile-row:hover { background: var(--dark-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--dark-text); color: var(--dark); display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.profile-row > span > strong { display: block; font-size: 12.5px; font-weight: 600; }
.profile-row > span > span { display: block; color: var(--dark-faint); font-size: 10.5px; margin-top: 2px; }
.profile-caret { color: var(--dark-faint); font-size: 12px; }
.profile-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 12px; padding: 5px; z-index: 40; box-shadow: 0 12px 30px rgba(10, 7, 4, 0.5); }
.profile-option { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--dark-text); font-size: 13px; text-align: left; cursor: pointer; }
.profile-option:hover { background: #4a3b2a; }
.profile-option .avatar { width: 26px; height: 26px; font-size: 10px; }
.profile-option .check { color: #9fc08f; font-size: 12px; }

/* ── Inbox ───────────────────────────────────────────────────────────────── */
.inbox-panel { min-height: 100vh; border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; min-width: 0; }
.inbox-header { padding: 24px 20px 0; }
.title-row { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { font-size: 10px; text-transform: uppercase; color: var(--faint); letter-spacing: 1.6px; margin: 0 0 2px; font-weight: 700; }
.title-row h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin: 0; letter-spacing: -0.5px; }
.round-button, .icon-button { border: 1px solid var(--line); background: var(--card); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--sub); }
.search-wrap { height: 42px; margin: 14px 0 0; border: 1px solid var(--line); background: var(--card); border-radius: 999px; display: flex; align-items: center; gap: 9px; padding: 0 15px; color: var(--faint); }
.search-wrap input { background: transparent; border: 0; outline: 0; min-width: 0; flex: 1; font-size: 13px; color: var(--ink); }
.search-wrap input::placeholder { color: var(--faint); }
.search-wrap kbd { font-family: inherit; font-size: 10.5px; border: 1px solid var(--line); background: var(--panel); padding: 2px 6px; border-radius: 6px; color: var(--faint); }
.filter-tabs { display: flex; gap: 14px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.filter-tabs button { padding: 0 2px 9px; font-size: 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.filter-tabs button.selected { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.inbox-summary { height: 40px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 11.5px; padding: 0 2px; }
.inbox-summary button { border: 0; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.ticket-list { flex: 1; overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 9px; }
.ticket-card { display: block; position: relative; width: 100%; text-align: left; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.ticket-card:hover { border-color: #d0c2a6; }
.ticket-card.selected-ticket { border-color: var(--accent); box-shadow: var(--shadow); }
.ticket-topline { display: flex; justify-content: space-between; align-items: center; }
.channel-badge { display: inline-grid; place-items: center; min-width: 34px; height: 21px; padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2px; }
.channel-bol { color: var(--bol); background: var(--bol-bg); }
.channel-web { color: #6a55a8; background: #ece6f5; }
.channel-mail { color: var(--warn); background: var(--warn-bg); }
.ticket-time { font-size: 11.5px; color: var(--faint); }
.ticket-sender-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.ticket-sender-row strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.ticket-card h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-card p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 3px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ticket-meta { margin-top: 9px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.category-tag, .done-tag, .queue-tag { font-size: 10.5px; padding: 3px 10px; border-radius: 999px; background: var(--card-soft); color: var(--sub); }
.tag-warning { background: var(--err-bg); color: var(--err); font-weight: 700; }
.done-tag { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.queue-tag { background: var(--bol-bg); color: var(--bol); font-weight: 700; }
.note-tag { font-size: 10.5px; padding: 3px 9px; border-radius: 999px; background: #efe7d5; color: var(--warn); font-weight: 700; }
.reopened-tag { font-size: 10.5px; padding: 3px 10px; border-radius: 999px; background: #ece4f7; color: var(--ai); font-weight: 700; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state > span { display: block; font-size: 26px; margin-bottom: 10px; }
.empty-state strong { color: var(--ink); font-size: 14px; font-family: var(--font-display); }
.empty-state p { font-size: 12px; }

/* ── Gesprek ─────────────────────────────────────────────────────────────── */
.conversation-panel { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--panel); }
.conversation-header { padding: 22px 26px 16px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 14px; }
.conversation-header .header-top { display: flex; align-items: center; gap: 16px; }
.subject-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.subject-line h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-header .header-top > div:first-child { min-width: 0; flex: 1; }
.conversation-header p { color: var(--muted); font-size: 12.5px; margin: 5px 0 0; }
.conversation-header p span { margin: 0 5px; color: var(--line); }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.status-button { border: 1px solid #d8ccb4; background: var(--card); border-radius: 999px; padding: 10px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ok); }
.status-button:hover { background: var(--ok-bg); }
.icon-button { width: 38px; height: 38px; }
.context-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.context-chips .chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.context-chips .chip strong { font-family: var(--font-mono); font-weight: 600; }
.context-chips .chip.chip-warn { background: var(--warn-bg); border-color: #e4d2b5; color: var(--warn); font-weight: 600; }
.conversation-scroll { flex: 1; overflow-y: auto; padding: 22px 26px 28px; }
.ai-alert { border: 1px solid #e4d2b5; background: var(--warn-bg); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 11px; margin-bottom: 16px; }
.spark-icon { width: 30px; height: 30px; border-radius: 50%; background: #e8d3b2; color: var(--warn); display: grid; place-items: center; }
.ai-alert strong { font-size: 13.5px; }
.ai-alert p { font-size: 12px; color: var(--warn); margin: 3px 0 0; line-height: 1.4; }
.ai-alert > span { font-size: 11px; color: var(--warn); padding: 4px 9px; background: var(--card); border: 1px solid #e4d2b5; border-radius: 999px; }
.date-divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11px; margin: 4px 0 16px; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; background: var(--line-soft); flex: 1; }
.message-card { display: grid; grid-template-columns: 36px 1fr; gap: 11px; max-width: 680px; }
.message-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: var(--dark-text); font-weight: 700; font-size: 12px; }
.message-body { background: var(--card); border: 1px solid #e6dcc8; border-radius: 4px 16px 16px 16px; padding: 15px 18px; box-shadow: 0 4px 14px rgba(122, 79, 32, 0.05); }
.message-meta { display: flex; align-items: baseline; gap: 10px; }
.message-meta strong { font-size: 13px; font-weight: 700; }
.message-meta span { font-size: 11px; color: var(--faint); }
.message-body > p { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; white-space: pre-line; margin: 9px 0 12px; }
.message-labels { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.message-labels span { font-size: 11px; color: var(--sub); background: var(--card-soft); padding: 3px 10px; border-radius: 999px; }
.message-attachments { margin: 4px 0 14px; }
.message-attachments > strong { display: block; color: var(--sub); font-size: 12px; margin-bottom: 8px; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 9px; }
.attachment-card { min-width: 0; display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; text-decoration: none; }
.attachment-card:hover { border-color: #d0c2a6; background: var(--card); }
.attachment-card img { width: 74px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--card-soft); }
.attachment-card > span:last-child { min-width: 0; }
.attachment-card strong, .attachment-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-card strong { font-size: 12px; }
.attachment-card small { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.file-icon { width: 74px; height: 58px; border-radius: 8px; display: grid; place-items: center; background: var(--card-soft); color: var(--sub); font-size: 22px; }
.outgoing-message { grid-template-columns: 1fr 36px; margin: 18px 0 0 auto; }
.outgoing-message .message-avatar { grid-column: 2; background: var(--accent); color: var(--accent-text); }
.outgoing-message .message-body { grid-column: 1; grid-row: 1; background: #f2e8d5; border-color: #e4d2b5; border-radius: 16px 4px 16px 16px; }
.outgoing-message .message-labels { border-color: #e4d2b5; }
.outgoing-message .message-labels span { background: var(--card); color: var(--warn); }

/* Geen overflow:hidden — dat knipte het menu met standaardantwoorden af. */
.reply-box { margin-top: 20px; background: var(--card); border: 1px solid #d8ccb4; border-radius: 16px; box-shadow: 0 10px 26px rgba(122, 79, 32, 0.08); }
.reply-toolbar { border-radius: 16px 16px 0 0; }
.reply-footer { border-radius: 0 0 16px 16px; }
.reply-toolbar { min-height: 42px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; padding: 0 14px; gap: 10px; }
.reply-toolbar button { border: 0; background: transparent; font-size: 12px; color: var(--sub); cursor: pointer; }
.reply-toolbar .reply-mode { color: var(--ai); font-weight: 700; background: var(--ai-bg); padding: 5px 10px; border-radius: 999px; }
.spark-small { margin-right: 3px; }
.reply-toolbar > span { font-size: 10.5px; color: var(--faint); margin-right: auto; }
.reply-box textarea { width: 100%; min-height: 150px; resize: vertical; border: 0; outline: 0; padding: 17px 19px; color: var(--ink-2); font-size: 14px; line-height: 1.65; font-family: inherit; background: transparent; }
.reply-box textarea::placeholder { color: var(--faint); }
.reply-footer { border-top: 1px solid var(--line-soft); min-height: 52px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.format-actions, .send-actions { display: flex; gap: 7px; }
.format-actions button { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.format-actions button:hover { background: var(--card-soft); }
.draft-button { border: 1px solid #d8ccb4; background: var(--panel); color: var(--sub); border-radius: 999px; padding: 9px 15px; font-size: 12.5px; cursor: pointer; }
.draft-button:hover { background: var(--card-soft); }
.draft-button:disabled { opacity: 0.5; cursor: wait; }
.replies-wrap { position: relative; }
.replies-menu { position: absolute; left: 0; bottom: calc(100% + 8px); width: 340px; max-height: min(420px, 60vh); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; z-index: 45; box-shadow: 0 16px 40px rgba(122, 79, 32, 0.22); }
.reply-option { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.reply-option:hover { background: var(--card-soft); }
.reply-option strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.reply-option span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-button { border-color: var(--ai-line); background: var(--ai-bg); color: var(--ai); }
.ai-button:hover { background: #f0e2f8; }
.send-button { border: 0; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 10px 18px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.send-button:hover { background: var(--accent-dark); }
.send-button span { margin-left: 6px; }
.send-button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Rustmoment bij een lege werkvoorraad */
.app-shell.view-zen { grid-template-columns: 236px minmax(350px, 396px) 1fr; }
.app-shell.view-zen .detail-panel { display: none; }
.app-shell.view-zen .conversation-header { border-bottom: 0; padding: 0; }
.zen { display: grid; place-items: center; text-align: center; gap: 4px; padding: 12vh 24px 0; color: var(--muted); }
.zen-enso { color: var(--accent); opacity: 0.85; transform: rotate(-18deg); animation: zenDraw 1.1s ease-out; }
.zen h2 { font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--ink); margin: 18px 0 0; letter-spacing: -0.4px; }
.zen p { font-size: 16px; margin: 8px 0 0; color: var(--sub); }
.zen-hint { font-size: 12.5px; color: var(--faint); margin-top: 22px; }
@keyframes zenDraw {
  from { stroke-dasharray: 300; stroke-dashoffset: 300; opacity: 0; }
  to { stroke-dasharray: 300; stroke-dashoffset: 0; opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) { .zen-enso { animation: none; } }

/* ── Detailpaneel ────────────────────────────────────────────────────────── */
.detail-panel { min-height: 100vh; border-left: 1px solid var(--line); background: var(--paper); overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.detail-header { display: none; }
.contact-card { text-align: center; padding: 6px 0 2px; }
.contact-avatar { margin: 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--dark); color: var(--dark-text); display: grid; place-items: center; font-size: 17px; font-weight: 700; }
.contact-card > strong { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-top: 10px; }
.contact-card > span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.contact-actions { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.contact-actions button { border: 1px solid var(--line); background: var(--card); min-width: 64px; border-radius: 10px; padding: 7px; font-size: 12px; cursor: pointer; }
.contact-actions button span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 3px; }
.detail-section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.detail-section h3 { text-transform: uppercase; letter-spacing: 1.4px; color: var(--faint); font-size: 10px; margin: 0 0 12px; font-weight: 700; }
.detail-section dl { margin: 0; display: grid; gap: 10px; }
.detail-section dl > div { display: flex; justify-content: space-between; align-items: center; }
.detail-section dt { color: var(--muted); font-size: 12.5px; }
.detail-section dd { margin: 0; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.status-pill { padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.status-done { color: var(--ok); background: var(--ok-bg); }
.detail-select { border: 0; background: transparent; padding: 0; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mini-avatar { width: 20px; height: 20px; border-radius: 50%; font-size: 8px; background: var(--dark); color: var(--dark-text); display: grid; place-items: center; font-weight: 700; }

/* Interne notities */
.notes-section { background: #fdf8ee; border-color: #e6d8bd; }
.notes-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
.note { background: var(--card); border: 1px solid #ece0c8; border-radius: 12px; padding: 10px 12px; }
.note-head { display: flex; align-items: center; gap: 7px; }
.note-head strong { font-size: 12px; font-weight: 600; }
.note-time { font-size: 10.5px; color: var(--faint); margin-left: auto; }
.note-delete { border: 0; background: transparent; color: var(--line); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.note:hover .note-delete { color: var(--muted); }
.note-delete:hover { color: var(--err); }
.note p { margin: 7px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-empty { margin: 0 0 10px; font-size: 12px; color: var(--faint); }
.note-input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; font-family: inherit; color: var(--ink); outline: 0; resize: vertical; min-height: 52px; }
.note-input:focus { border-color: var(--accent); }
.note-input::placeholder { color: var(--faint); }
.note-add { width: 100%; margin-top: 8px; border: 1px solid #d8ccb4; background: var(--panel); color: var(--sub); border-radius: 999px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.note-add:hover { background: var(--card-soft); color: var(--accent); }
.note-add:disabled { opacity: 0.6; cursor: wait; }

.bol-order-section { background: var(--dark); color: var(--dark-text); border: 0; }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-section-title h3 { margin: 0; color: var(--dark-muted); }
.source-chip { color: #e8c9a8; background: var(--dark-line); border-radius: 999px; padding: 2px 9px; font-size: 10px; font-weight: 700; }
.order-number-card { margin-bottom: 12px; }
.order-number-card > span { display: block; color: var(--dark-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; }
.order-number-row { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.order-number-row strong { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: 0.2px; }
.order-peek { margin-left: auto; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--dark-line); background: transparent; color: var(--dark-muted); display: grid; place-items: center; cursor: pointer; }
.order-peek:hover { background: var(--dark-line); color: var(--dark-text); }

/* Bestelling-modal */
.order-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.order-meta span:first-child { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.order-items { display: flex; flex-direction: column; gap: 9px; }
.order-line { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; }
.order-line img { width: 62px; height: 62px; object-fit: contain; border-radius: 10px; background: var(--card-soft); flex-shrink: 0; }
.order-line-noimg { width: 62px; height: 62px; border-radius: 10px; background: var(--card-soft); color: var(--muted); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.order-line-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.order-line-text strong { font-size: 13.5px; line-height: 1.35; }
.order-line-text .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.order-line-sub { font-size: 12px; color: var(--sub); }
.order-line-sub em { color: var(--err); font-style: normal; }
.order-line-return { flex-shrink: 0; border: 1px solid var(--line); background: var(--panel); color: var(--sub); border-radius: 999px; padding: 7px 13px; font-size: 12px; cursor: pointer; }
.order-line-return:hover { background: var(--card-soft); color: var(--accent); border-color: var(--accent); }
.order-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
.order-total strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); }
.bol-data-list { border-top: 1px solid var(--dark-line); padding-top: 11px; }
.bol-data-list > div { display: flex; justify-content: space-between; }
.bol-data-list dt { color: var(--dark-muted); font-size: 12px; }
.bol-data-list dd { font-size: 12px; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.bol-data-list .mono { font-family: var(--font-mono); }
.data-ok { color: #9fd4ae; font-weight: 600; }
.shipment-pill { color: #e8c9a8; font-weight: 600; }
.question-type { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--dark-line); }
.question-type > span { color: var(--dark-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; }
.question-type p { color: var(--dark-text); font-size: 12.5px; line-height: 1.55; margin: 5px 0 0; }
.reply-destination { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; text-align: center; }

/* Verzendlabel */
.ship-order-input { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 9px 14px; font-size: 12.5px; color: var(--ink); outline: 0; margin-bottom: 8px; font-family: var(--font-mono); }
.ship-order-input:focus { border-color: var(--accent); }
.ship-order-input::placeholder { color: var(--faint); font-family: var(--font-body); }
.ship-section .ship-types { display: flex; gap: 7px; margin-bottom: 10px; }
.ship-type { flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--sub); border-radius: 999px; padding: 9px 10px; font-size: 12.5px; cursor: pointer; }
.ship-type.selected { border-color: var(--accent); background: #faeade; color: var(--accent); font-weight: 700; }
.ship-go { width: 100%; border: 0; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 11px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.ship-go:hover { background: var(--accent-dark); }
.ship-go:disabled { opacity: 0.55; cursor: wait; }
.ship-go.armed { background: var(--err); }
.ship-status { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--sub); }
.ship-status.ok { color: var(--ok); font-weight: 600; }
.ship-status.err { color: var(--err); }
.label-link { display: block; text-align: center; border: 1px solid #d8ccb4; background: var(--panel); color: var(--ink); border-radius: 999px; padding: 10px 14px; font-size: 12.5px; font-weight: 600; text-decoration: none; margin-top: 10px; }
.label-link:hover { background: var(--card-soft); color: var(--ink); }
.ship-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }

.ai-insight { border-color: var(--ai-line); background: var(--ai-bg); }
.ai-insight h3 { color: var(--ai); }
.ai-insight p { font-size: 12px; color: #5f4a70; line-height: 1.5; margin: 0 0 12px; }
.confidence { display: flex; justify-content: space-between; font-size: 11px; color: #8a7a99; }
.confidence strong { color: var(--ai); }
.confidence-bar { height: 4px; border-radius: 2px; background: #e6dcf0; margin-top: 5px; overflow: hidden; }
.confidence-bar i { display: block; height: 100%; background: var(--ai); border-radius: 2px; }
.history-item { display: flex; gap: 9px; align-items: center; }
.history-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--card-soft); color: var(--sub); }
.history-item strong { font-size: 12.5px; }
.history-item p { font-size: 11px; color: var(--muted); margin: 3px 0 0; }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 11.5px; padding: 12px 0 0; cursor: pointer; }

.send-failed { border-color: #e6c3b8; background: var(--err-bg); }
.send-failed .spark-icon { background: #f0cabd; color: var(--err); font-weight: 700; }
.send-failed strong { color: var(--err); }
.send-failed p { color: #8a4030; }

/* ── Retouren ────────────────────────────────────────────────────────────── */
.app-shell.view-returns { grid-template-columns: 236px 1fr; }
.app-shell.view-returns .inbox-panel,
.app-shell.view-returns .conversation-panel,
.app-shell.view-returns .detail-panel { display: none; }

.returns-panel { min-height: 100vh; min-width: 0; background: var(--paper); display: flex; flex-direction: column; }
.returns-header { padding: 24px 26px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.returns-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.returns-title-row h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin: 0; letter-spacing: -0.5px; }
.returns-actions { display: flex; gap: 8px; align-items: center; }
.returns-search { max-width: 460px; margin: 14px 0 0; }
.returns-list { flex: 1; overflow-y: auto; padding: 18px 26px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 12px; align-content: start; }
.return-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.return-card.is-old { border-color: #e0b89a; }
.return-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.return-date { font-size: 11.5px; color: var(--faint); margin-left: auto; }
.age-tag { background: var(--err-bg); color: var(--err); border-radius: 999px; padding: 3px 10px; font-size: 10.5px; font-weight: 700; }
.return-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0; }
.return-lines { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--sub); }
.return-lines .row { display: flex; gap: 8px; }
.return-lines .row span:first-child { color: var(--muted); min-width: 96px; }
.return-lines .mono { font-family: var(--font-mono); }
.return-comment { background: var(--card-soft); border-radius: 12px; padding: 10px 13px; font-size: 13px; line-height: 1.55; color: var(--ink-2); font-style: italic; }
.return-actions { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 11px; }
.return-actions button { border: 1px solid var(--line); background: var(--panel); color: var(--sub); border-radius: 999px; padding: 8px 14px; font-size: 12px; cursor: pointer; }
.return-actions button:hover { background: var(--card-soft); }
.return-actions button.accept { border-color: #bcd8c4; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.return-actions button.reject { border-color: #e6c3b8; background: var(--err-bg); color: var(--err); }
.return-actions button.armed { background: var(--err); border-color: var(--err); color: #fff; font-weight: 700; }
.return-actions button:disabled { opacity: 0.5; cursor: wait; }
.return-note { font-size: 12px; color: var(--err); }
.returns-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); }
.returns-empty strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.demo-banner { background: var(--warn-bg); color: var(--warn); border: 1px solid #e4d2b5; border-radius: 999px; padding: 4px 12px; font-size: 11.5px; font-weight: 700; }

/* Ticketnummer */
.ticket-number { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--card-soft); border-radius: 6px; padding: 2px 7px; letter-spacing: 0.3px; }
.subject-line .ticket-number { font-size: 12px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(30, 22, 14, 0.45); display: grid; place-items: center; padding: 24px; }
.modal { background: var(--panel); border-radius: 18px; width: min(560px, 100%); max-height: 86vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(43, 33, 24, 0.3); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 0; }
.modal-close { border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-body label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal-input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 11px 16px; font-size: 13.5px; color: var(--ink); outline: 0; font-family: var(--font-mono); }
.modal-input:focus { border-color: var(--accent); }
.modal-row { display: flex; gap: 8px; }
.modal-row .modal-input { flex: 1; }
.order-item { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; gap: 11px; align-items: center; }
.order-item.selected { border-color: var(--accent); box-shadow: var(--shadow); }
.order-item strong { display: block; font-size: 13.5px; }
.order-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; font-family: var(--font-mono); }
.order-item .qty { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.modal-select { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 14px; font-size: 13px; color: var(--ink); }
.modal-warning { background: var(--warn-bg); border: 1px solid #e4d2b5; border-radius: 12px; padding: 11px 14px; font-size: 12.5px; color: var(--warn); line-height: 1.5; }
.modal-error { color: var(--err); font-size: 12.5px; line-height: 1.5; }
.modal-blocked { background: var(--err-bg); border: 1px solid #e6c3b8; border-radius: 12px; padding: 12px 14px; }
.modal-blocked strong { display: block; font-size: 13px; color: var(--err); margin-bottom: 6px; }
.modal-blocked p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: #8a4030; }
.modal-blocked .draft-button { background: var(--card); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--dark); color: var(--dark-text); padding: 12px 18px; border-radius: 999px; font-size: 13px; box-shadow: 0 14px 40px rgba(43, 33, 24, 0.35); animation: toastIn 0.2s ease-out; }
.mobile-menu, .mobile-close, .mobile-backdrop { display: none; }

@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 1250px) {
  .app-shell { grid-template-columns: 210px 330px minmax(500px, 1fr); }
  .detail-panel { display: none; }
  .app-shell.view-returns { grid-template-columns: 210px 1fr; }
  .returns-list { grid-template-columns: 1fr; }
}

@media (max-width: 930px) {
  .app-shell { grid-template-columns: 300px minmax(470px, 1fr); }
  .app-shell.view-returns { grid-template-columns: 1fr; }
  .returns-title-row { flex-wrap: wrap; }
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 236px; z-index: 30; transition: left 0.2s ease; box-shadow: 10px 0 35px rgba(20, 14, 8, 0.3); }
  .sidebar-open { left: 0; }
  .mobile-menu { display: grid; place-items: center; width: 36px; height: 36px; margin-right: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
  .title-row { justify-content: flex-start; }
  .title-row .round-button { margin-left: auto; }
  .mobile-close { display: block; margin-left: auto; border: 0; background: transparent; color: var(--dark-muted); font-size: 20px; cursor: pointer; }
  .mobile-backdrop { display: block; position: fixed; inset: 0; z-index: 20; border: 0; background: rgba(24, 17, 10, 0.5); }
}

@media (max-width: 680px) {
  .app-shell { display: block; min-height: 100vh; overflow: visible; }
  .inbox-panel { min-height: auto; height: auto; border-right: 0; }
  .ticket-list { max-height: 300px; }
  .conversation-panel { min-height: auto; }
  .conversation-header { padding: 16px 14px; }
  .subject-line h2 { white-space: normal; }
  .header-actions { display: none; }
  .conversation-scroll { padding: 14px; overflow: visible; }
  .ai-alert { grid-template-columns: 30px 1fr; }
  .ai-alert > span { grid-column: 2; width: max-content; }
  .reply-footer { align-items: flex-end; flex-wrap: wrap; }
  .format-actions { display: none; }
  .send-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}

/* ── Inlogscherm ─────────────────────────────────────────────────────────── */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.login-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: 0 18px 46px rgba(122, 79, 32, 0.12); display: flex; flex-direction: column; }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-mark { width: 46px; height: 46px; border-radius: 50%; background: var(--dark); color: var(--dark-text); display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.login-brand h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -0.4px; }
.login-brand p { margin: 3px 0 0; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.login-card label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-input { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 12px 16px; font-size: 14px; color: var(--ink); outline: 0; margin-bottom: 16px; font-family: inherit; }
.login-input:focus { border-color: var(--accent); }
select.login-input { appearance: none; cursor: pointer; }
.login-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sub); margin-bottom: 20px; }
.login-check input { accent-color: var(--accent); }
.login-button { border: 0; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 13px 18px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.login-button:hover { background: var(--accent-dark); }
.login-button:disabled { opacity: 0.6; cursor: wait; }
.login-error { color: var(--err); font-size: 13px; margin: 14px 0 0; text-align: center; line-height: 1.5; }
.profile-current { padding: 8px 10px 6px; font-size: 11.5px; color: var(--dark-faint); border-bottom: 1px solid var(--dark-line); margin-bottom: 4px; }
.profile-current strong { color: var(--dark-text); }
a.profile-option { text-decoration: none; }
a.profile-option:hover { color: var(--dark-text); }
