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

:root {
  --bg: #f9f9f9;
  --panel: #ffffff;
  --panel2: #f4f6f9;
  --border: #e6e6e6;
  --text: #262a2c;
  --muted: #6b7680;
  --primary: #195393;
  --primary-dark: #133f70;
  --accent: #f39200;
  --accent-dark: #d17000;
  --green: #95c11e;
  --danger: #d43f38;
}

body {
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(243, 146, 0, .06), transparent 60%),
    radial-gradient(900px 480px at 0% 0%, rgba(25, 83, 147, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* dunne scrollbars in panelen */
.transcript::-webkit-scrollbar, .steps::-webkit-scrollbar, .meldingen::-webkit-scrollbar, .logboek::-webkit-scrollbar, #db-table-wrap::-webkit-scrollbar, .lang-checks::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 8px; height: 8px; }
.transcript::-webkit-scrollbar-thumb, .steps::-webkit-scrollbar-thumb, .meldingen::-webkit-scrollbar-thumb, .logboek::-webkit-scrollbar-thumb, #db-table-wrap::-webkit-scrollbar-thumb, .lang-checks::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb {
  background: rgba(25, 83, 147, .18);
  border-radius: 10em;
}
.transcript::-webkit-scrollbar-thumb:hover, .steps::-webkit-scrollbar-thumb:hover, .meldingen::-webkit-scrollbar-thumb:hover { background: rgba(25, 83, 147, .35); }

header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 10px rgba(25, 83, 147, .1);
}
header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 55%, var(--green) 100%);
}

.brand { display: flex; gap: 16px; align-items: center; }

.logo-img { height: 42px; display: block; }
.brand-sep { width: 1px; height: 38px; background: var(--border); }

h1 { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: .3px; text-transform: uppercase; }
.brand p { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }

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

.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 10em;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  transition: all .3s;
}
.chip.status-idle { color: var(--muted); }
.chip.status-live { color: #fff; background: var(--green); border-color: var(--green); }
.chip.status-err { color: #fff; background: var(--danger); border-color: var(--danger); }
.hidden { display: none !important; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 28px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(25, 83, 147, .07), 0 1px 3px rgba(25, 83, 147, .05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ---- gesprek ---- */
.call-visual {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 18px 0 22px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  position: relative;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid; place-items: center;
  font-size: 42px;
  box-shadow: 0 4px 14px rgba(25, 83, 147, .25);
}
.ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
}
.avatar.speaking .ring { animation: ripple 1.6s infinite; }
.avatar.speaking .r2 { animation-delay: .4s; }
.avatar.speaking .r3 { animation-delay: .8s; }
.avatar.listening .ring { border-color: var(--primary); animation: ripple 1.6s infinite; }
.avatar.listening .r2 { animation-delay: .4s; }
.avatar.listening .r3 { animation-delay: .8s; }
@keyframes ripple {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.55); opacity: 0; }
}

.call-state { font-size: 14px; font-weight: 600; color: var(--muted); min-height: 20px; }

#waveform { width: 100%; max-width: 560px; height: 64px; }

.call-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.voice-label { font-size: 13px; font-weight: 600; color: var(--muted); }

#voice-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10em;
  padding: 9px 14px;
  cursor: pointer;
  outline-color: var(--primary);
}
#voice-select:disabled { opacity: .55; cursor: not-allowed; }

.call-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 36px;
  border-radius: 10em;
  border: none;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(243, 146, 0, .35);
  transition: transform .15s, background .15s;
}
.call-btn:hover { transform: translateY(-1px); background: var(--accent-dark); }
.call-btn.hangup { background: var(--danger); box-shadow: 0 3px 10px rgba(212, 63, 56, .3); }
.call-btn.hangup:hover { background: #b3322c; }

.settings-btn {
  margin-top: 14px;
  align-self: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10em;
  padding: 9px 22px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.settings-btn:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(25, 83, 147, .15); }

/* ---- instellingen-modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(19, 63, 112, .45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeUp .2s ease;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(19, 63, 112, .35);
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
}
.modal-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: 1px;
}
.modal-close {
  border: none; background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.modal-close:hover { color: var(--danger); background: rgba(212, 63, 56, .08); }
.modal-close .icon { width: 16px; height: 16px; }
.modal-body { overflow-y: auto; background: var(--panel2); }

.settings-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 14px;
  padding: 16px 20px;
  align-items: start;
}
.settings-grid > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 8px;
}

.settings-grid select, .settings-grid textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  outline-color: var(--primary);
}
.settings-grid textarea {
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}
.settings-grid select:disabled, .settings-grid textarea:disabled, .lang-checks input:disabled { opacity: .55; cursor: not-allowed; }

.lang-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px 12px;
  padding: 11px 13px;
  max-height: 200px;
  min-height: 0;
  overflow: hidden auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.lang-checks label {
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-checks input { accent-color: var(--primary); }
.flag { width: 18px; height: 13.5px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); object-fit: cover; }

.help {
  display: inline-grid;
  place-items: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: rgba(25, 83, 147, .12);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  cursor: help;
  position: relative;
  vertical-align: 1px;
}
.help:hover { background: var(--primary); color: #fff; }
.help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: 240px;
  background: #133f70;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(19, 63, 112, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  white-space: normal;
  z-index: 10;
}
.help:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.audio-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.slider-row {
  display: grid;
  grid-template-columns: 170px 1fr 70px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.slider-row span { font-weight: 600; color: var(--muted); }
.slider-row output { font-family: Consolas, monospace; font-size: 12px; color: var(--text); text-align: right; }
.slider-row input[type="range"] { accent-color: var(--primary); width: 100%; }
.slider-row select {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  grid-column: 2 / 4;
}
.mic-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 2px;
}
.mic-checks label {
  font-size: 12.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  cursor: pointer;
}
.mic-checks input { accent-color: var(--primary); }

.transcript-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin: 14px 0 8px;
}

.transcript {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  min-height: 160px;
  max-height: 42vh;
}

.bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  animation: fadeUp .25s ease;
}
.bubble.caller {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.bubble.caller .who { color: rgba(255, 255, 255, .75); }
.bubble.agent {
  align-self: flex-start;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}
.bubble .who {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 3px;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- stappen (fancy timeline) ---- */
.steps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  padding: 6px 4px 6px 44px;
}
.steps::before {
  content: '';
  position: absolute;
  left: 16px; top: 12px; bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 70%, var(--border) 100%);
}
.steps-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.step {
  position: relative;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 11px 14px;
  box-shadow: 0 2px 8px rgba(25, 83, 147, .07);
  animation: stepIn .45s cubic-bezier(.2, .9, .3, 1.15);
  transition: box-shadow .2s, transform .2s;
}
.step:hover { box-shadow: 0 6px 18px rgba(25, 83, 147, .14); transform: translateY(-1px); }
.step.tool { border-left-color: var(--accent); }
.step.warn { border-left-color: var(--accent-dark); }
.step.error { border-left-color: var(--danger); }
@keyframes stepIn {
  from { opacity: 0; transform: translateX(-16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.step .step-icon {
  position: absolute;
  left: -44px; top: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, var(--panel2));
  border: 2px solid var(--primary);
  display: grid; place-items: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(25, 83, 147, .2);
  z-index: 1;
}
.step.tool .step-icon { border-color: var(--accent); box-shadow: 0 2px 8px rgba(243, 146, 0, .25); }
.step.warn .step-icon { border-color: var(--accent-dark); }
.step.error .step-icon { border-color: var(--danger); box-shadow: 0 2px 8px rgba(212, 63, 56, .25); }
.step.newest .step-icon { animation: iconPulse 1.6s ease-out infinite; }
@keyframes iconPulse {
  0% { box-shadow: 0 0 0 0 rgba(243, 146, 0, .5); }
  100% { box-shadow: 0 0 0 14px rgba(243, 146, 0, 0); }
}

.step .head {
  display: flex; align-items: baseline; gap: 8px;
}
.step .head .title { font-size: 13.5px; font-weight: 700; letter-spacing: .2px; }
.step .head .time {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-weight: 500;
  white-space: nowrap;
}
.step .detail { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.step .kv {
  margin-top: 9px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 16px;
  font-size: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
.step .kv .k { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .6px; padding-top: 1px; }
.step .kv .v { color: var(--text); font-family: Consolas, monospace; }

.step .result-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 13px;
  border-radius: 10em;
  background: rgba(149, 193, 30, .12);
  color: #6f9900;
  border: 1px solid rgba(149, 193, 30, .5);
}
.step .result-tag.done { animation: tagPop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes tagPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.step .result-tag.pending {
  background: rgba(243, 146, 0, .08);
  color: var(--accent-dark);
  border-color: rgba(243, 146, 0, .45);
}
.spinner {
  width: 10px; height: 10px;
  border: 2px solid rgba(243, 146, 0, .25);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- caller-ID kiezer ---- */
#caller-input {
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10em;
  padding: 9px 14px;
  width: 190px;
  outline-color: var(--primary);
}
#caller-input:disabled { opacity: .55; cursor: not-allowed; }

/* ---- tabs rechterpaneel ---- */
.panel-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 12px 10px;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); }

.badge {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 10em;
  background: var(--accent);
  color: #fff;
}

/* ---- tools-beheer ---- */
.tools-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-bottom: 8px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tool-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 3px 6px;
  border-radius: 6px;
}
.tool-row:hover { background: var(--panel2); }
.tool-row label {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-family: Consolas, monospace;
  flex: 1;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-row input { accent-color: var(--primary); }
.tool-tag {
  font-size: 10px; font-weight: 700;
  padding: 1px 8px;
  border-radius: 10em;
  background: rgba(243, 146, 0, .12);
  color: var(--accent-dark);
  border: 1px solid rgba(243, 146, 0, .45);
}
.tool-del {
  border: none; background: none;
  color: var(--danger);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}

.new-tool {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
}
.new-tool summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  user-select: none;
}
.new-tool-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
}
.new-tool-row { display: flex; gap: 8px; }
.new-tool-row #nt-icon { width: 64px; text-align: center; }
.new-tool-row #nt-label { flex: 1; }
.new-tool-grid input, .new-tool-grid textarea {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  outline-color: var(--primary);
}
.new-tool-grid textarea { font-family: Consolas, monospace; font-size: 12px; resize: vertical; }
#nt-add {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10em;
  padding: 8px 18px;
  cursor: pointer;
  align-self: flex-start;
}
#nt-add:hover { background: var(--primary-dark); }

/* ---- meldingen-dashboard ---- */
.meldingen {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}
.melding {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  animation: fadeUp .25s ease;
}
.melding .head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700;
}
.melding .head .time { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.melding .ticket {
  font-family: Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10em;
  background: rgba(25, 83, 147, .09);
  color: var(--primary);
  border: 1px solid rgba(25, 83, 147, .3);
}
.melding .detail { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.melding .kv {
  margin-top: 8px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.melding .kv .k { color: var(--muted); font-weight: 600; }
.melding .kv .v { color: var(--text); font-family: Consolas, monospace; }

.meldingen { min-height: 0; }

/* ---- logboek (gespreksgeschiedenis) ---- */
.logboek {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}
.log-entry {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  animation: fadeUp .25s ease;
}
.log-entry summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
}
.log-entry summary::-webkit-details-marker { display: none; }
.log-entry[open] summary { border-bottom: 1px dashed var(--border); }
.log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 700;
}
.log-head .icon { width: 14px; height: 14px; color: var(--primary); }
.log-wie { display: inline-flex; align-items: center; gap: 6px; }
.log-taal {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.log-taal .flag { width: 16px; height: 12px; border-radius: 2px; }
.log-meta {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--muted);
  font-family: Consolas, monospace;
}
.log-meta .icon { width: 12px; height: 12px; color: var(--muted); }
.log-samenvatting {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}
.log-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.log-acties { display: flex; flex-wrap: wrap; gap: 6px; }
.log-actie {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 10em;
  background: rgba(25, 83, 147, .09);
  color: var(--primary);
  border: 1px solid rgba(25, 83, 147, .3);
}
.log-actie .icon { width: 12px; height: 12px; }
.log-transcript {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-line { font-size: 12px; line-height: 1.45; }
.log-line .who {
  display: inline-block;
  min-width: 48px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-right: 6px;
}
.log-line.agent .who { color: var(--accent); }
.log-line.caller .who { color: var(--primary); }
.log-delete {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 10em;
  padding: 5px 12px;
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.log-delete:hover { color: var(--danger); border-color: var(--danger); }
.log-delete .icon { width: 12px; height: 12px; }

.meldingen-actions { padding-top: 10px; }
#clear-meldingen, #clear-logboek {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 10em;
  padding: 7px 16px;
  cursor: pointer;
}
#clear-meldingen:hover, #clear-logboek:hover { color: var(--danger); border-color: var(--danger); }

/* ---- database-tab ---- */
.database { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 10px; }
#db-table-wrap { flex: 1; overflow: auto; }

.new-record {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel2);
}
.new-record summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  user-select: none;
}
.new-record-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
}
.new-record-row { display: flex; gap: 8px; }
.new-record-row > * { flex: 1; }
.new-record-grid input, .new-record-grid select {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  outline-color: var(--primary);
  width: 100%;
}
#nr-add {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10em;
  padding: 8px 18px;
  cursor: pointer;
  align-self: flex-start;
}
#nr-add:hover { background: var(--primary-dark); }
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.db-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0;
  background: var(--panel);
}
.db-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.db-table td:first-child, .db-table td:last-child { font-family: Consolas, monospace; white-space: nowrap; }
.db-table tr.hit td {
  background: rgba(243, 146, 0, .1);
  border-bottom-color: rgba(243, 146, 0, .5);
}
.db-table tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

footer {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 12px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.footer-logo { height: 16px; opacity: .75; }

/* ---- SVG-iconen ---- */
.icon {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.avatar-svg { width: 44px; height: 44px; color: #fff; }
.avatar .avatar-icon { display: grid; place-items: center; }

.step-icon .step-svg { width: 15px; height: 15px; color: var(--primary); }
.step.tool .step-icon .step-svg { color: var(--accent-dark); }
.step.warn .step-icon .step-svg { color: var(--accent-dark); }
.step.error .step-icon .step-svg { color: var(--danger); }

.chip .chip-svg, .tag-svg { width: 12px; height: 12px; }
.chip .flag { vertical-align: -2px; }

.lang-code {
  font-size: 10px; font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(25, 83, 147, .1);
  color: var(--primary);
  letter-spacing: .5px;
}

.tool-row-icon { display: inline-flex; color: var(--primary); }
.tool-row-icon .icon { width: 14px; height: 14px; }

.melding-title { display: inline-flex; align-items: center; gap: 7px; }
.melding-title .icon { width: 15px; height: 15px; color: var(--accent-dark); }

.panel-title, .voice-label, .tab, .call-btn, .settings-btn,
.new-tool summary, .new-record summary,
#clear-meldingen, #nt-add, #nr-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.panel-title { display: flex; }
.settings-btn { justify-content: center; }
.new-tool summary, .new-record summary { display: flex; }
.call-btn .icon { width: 16px; height: 16px; }
.bubble .who { display: inline-flex; align-items: center; gap: 5px; }
.bubble .who .icon { width: 11px; height: 11px; }

@media (max-width: 1000px) {
  main { grid-template-columns: 1fr; }
}
