/* ═══════════════════════════════════════════════════════════════════════════
   styles.css — UPPER Design System + Chat-tool
   Zelfde kleuren, fonts en componenten als klanten-tool
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  --blue:    #144391;
  --blue2:   #128ACB;
  --pink:    #E72775;
  --green:   #0EA86B;
  --red:     #E8334A;
  --bg:      #F2F4F8;
  --surface: #ffffff;
  --surface2:#EEF1F8;
  --surface3:#E4E9F4;
  --border:  #E2E7F2;
  --border2: #CDD4E8;
  --text:    #0D1B38;
  --text2:   #4A5578;
  --text3:   #8A93B0;

  --blue-grad:    linear-gradient(135deg, #144391 0%, #1a56b8 100%);
  --shadow-sm:    0 1px 4px rgba(13,27,56,.08);
  --shadow-md:    0 4px 16px rgba(13,27,56,.10);
  --shadow-lg:    0 8px 32px rgba(13,27,56,.14);
  --radius-sm:    7px;
  --radius-md:    10px;
  --radius-lg:    14px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Keyframes ──────────────────────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: .4; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes msgIn   { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════════════════════ */
#loginScreen, #setPasswordScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #0d1b38 0%, #1a3070 50%, #144391 100%);
  padding: 20px;
  animation: fadeIn .3s ease;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}

.login-beeldmerk-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.beeldmerk-svg {
  width: 64px;
  height: 58px;
  filter: drop-shadow(0 2px 8px rgba(20,67,145,.2));
}

.login-wordmark {
  text-align: center;
  margin-bottom: 20px;
}
.login-wordmark-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .04em;
}
.login-wordmark-text span { color: var(--blue); }
.login-wordmark-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.login-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 22px;
}
.login-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.login-sub {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 20px;
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--blue-grad);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 3px 10px rgba(20,67,145,.3);
  margin-top: 4px;
}
.login-btn:hover  { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(20,67,145,.4); }
.login-btn:active { transform: translateY(0); }
.login-err {
  color: var(--red);
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
  line-height: 1.4;
  text-align: center;
}

/* Wachtwoord-checklist */
.spw-check { color: var(--text3); transition: color .15s; }
.spw-check.ok { color: var(--green); }
.spw-icon { font-variant-numeric: tabular-nums; width: 14px; display: inline-block; }

/* ══════════════════════════════════════════════════════════════════════════════
   FORMS & BUTTONS (gedeeld)
   ══════════════════════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: all .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,67,145,.08);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  padding: 9px 18px;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--blue-grad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(20,67,145,.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20,67,145,.35); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--border2); }
.btn-danger { background: #FFF0F2; color: var(--red); border: 1.5px solid #FECDD3; }
.btn-danger:hover { background: #FFE4E8; }
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: 7px; }

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-sm.dark {
  border-color: var(--border);
  border-top-color: var(--blue);
}

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  min-width: 260px;
  max-width: 400px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--green);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 99998;
  animation: slideUp .2s ease;
}
.toast.error  { border-left-color: var(--red); }
.toast.warn   { border-left-color: #F59E0B; }
.toast-msg    { flex: 1; font-size: 12.5px; color: var(--text); font-weight: 500; }
.toast-close  { background: none; border: none; font-size: 18px; color: var(--text3); cursor: pointer; line-height: 1; padding: 0; }
.toast-close:hover { color: var(--text); }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,56,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .18s ease;
}
.modal-lg {
  width: min(800px, calc(100vw - 40px));
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-lg .modal-body { flex: 1; overflow-y: auto; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.close-btn   { background: none; border: none; font-size: 22px; color: var(--text3); cursor: pointer; line-height: 1; padding: 0; flex-shrink: 0; }
.close-btn:hover { color: var(--text); }
.modal-body  { padding: 20px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0 0; border-top: 1px solid var(--border); margin-top: 20px; }

/* ── Session warning ─────────────────────────────────────────────────────────── */
#_sessionWarn {
  position: fixed; inset: 0;
  background: rgba(13,27,56,.55);
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.session-warn-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.session-warn-icon  { font-size: 36px; margin-bottom: 12px; }
.session-warn-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.session-warn-msg   { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════════════════════════════════════ */
#app {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header bar ─────────────────────────────────────────────────────────────── */
.app-header {
  height: 52px;
  background: var(--blue-grad);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13,27,56,.2);
  z-index: 100;
}
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.app-header-title { font-size: 14px; font-weight: 800; color: #fff; letter-spacing: .03em; }
.app-header-sub   { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.55); letter-spacing: .1em; text-transform: uppercase; }
.app-header-spacer { flex: 1; }
#appVersion { font-size: 10px; color: rgba(255,255,255,.4); font-weight: 500; }

.app-header-user {
  position: relative;
  display: flex;
  align-items: center;
}
.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}
.header-user-btn:hover { background: rgba(255,255,255,.18); }
.header-user-chevron { font-size: 10px; color: rgba(255,255,255,.5); }

.header-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  animation: slideUp .15s ease;
}
.header-user-dropdown.open { display: block; }

.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text2);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: background .1s;
}
.header-dropdown-item:hover { background: var(--surface2); color: var(--text); }
.header-dropdown-item.danger { color: var(--red); }
.header-dropdown-item.danger:hover { background: #FFF0F2; }
.header-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   CHAT LAYOUT — drie kolommen
   ══════════════════════════════════════════════════════════════════════════════ */
#chatLayout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Linkerkolom (sidebar) ───────────────────────────────────────────────────── */
.chat-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 10px;
}
.sidebar-section label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 5px;
  margin-top: 12px;
}
.sidebar-section select {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.sidebar-section select:focus { border-color: var(--blue); }

.sidebar-divider { height: 1px; background: var(--border); margin: 12px 0; flex-shrink: 0; }

.sidebar-conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
  flex-shrink: 0;
}
.sidebar-conv-header span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.new-conv-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background .1s;
}
.new-conv-btn:hover { background: var(--surface2); }

.sidebar-convs {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
  min-height: 0;
}

.conv-item {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .1s;
}
.conv-item:hover   { background: var(--surface2); }
.conv-item.active  { background: #EBF0FB; }
.conv-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.conv-item.active .conv-item-title { color: var(--blue); font-weight: 600; }
.conv-item-date { font-size: 10.5px; color: var(--text3); margin-top: 2px; }
.conv-empty { padding: 12px 10px; font-size: 12px; color: var(--text3); font-style: italic; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  transition: all .1s;
}
.nav-link:hover  { background: var(--surface2); color: var(--text); }
.nav-link.active { background: #EBF0FB; color: var(--blue); font-weight: 600; }
.nav-link-icon   { font-size: 14px; width: 18px; text-align: center; }

/* ── Middelste kolom (chat) ──────────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

.chat-main-header {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.chat-client-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-badge {
  display: none;
  padding: 3px 10px;
  background: #EBF0FB;
  color: var(--blue);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid #D1DBEE;
}

.type-badge {
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: lowercase;
  margin-left: 4px;
  vertical-align: middle;
}
.type-camping     { background: #E8F5E9; color: #2E7D32; }
.type-campinggroep{ background: #E3F2FD; color: #1565C0; }
.type-overig      { background: var(--surface2); color: var(--text3); }

/* Berichten */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}
.message-in { animation: msgIn .2s ease; }

.message-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.message-user .message-bubble {
  background: var(--blue);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-assistant {
  align-self: flex-start;
}
.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 1px 4px rgba(20,67,145,.2);
}
.message-bubble {
  padding: 11px 14px;
  border-radius: 4px 16px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
  word-break: break-word;
  min-width: 40px;
}

/* Markdown inhoud in berichten */
.message-bubble p      { margin: 0 0 10px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble h1,
.message-bubble h2,
.message-bubble h3     { font-size: 14px; font-weight: 700; margin: 12px 0 6px; color: var(--text); }
.message-bubble h1 { font-size: 15px; }
.message-bubble ul,
.message-bubble ol     { padding-left: 20px; margin: 8px 0; }
.message-bubble li     { margin-bottom: 4px; }
.message-bubble code   { background: var(--surface2); padding: 2px 5px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.message-bubble pre    { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 10px 0; }
.message-bubble pre code { background: none; padding: 0; }
.message-bubble strong { font-weight: 700; color: var(--text); }
.message-bubble em     { font-style: italic; }
.message-bubble hr     { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.message-bubble blockquote { border-left: 3px solid var(--blue2); padding-left: 12px; color: var(--text2); font-style: italic; margin: 8px 0; }
.message-bubble table  { border-collapse: collapse; width: 100%; font-size: 12px; margin: 10px 0; }
.message-bubble th,
.message-bubble td     { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.message-bubble th     { background: var(--surface2); font-weight: 600; }

/* Typing indicator */
.typing-bubble { display: flex; align-items: center; gap: 5px; padding: 14px 18px; }
.typing-dot {
  width: 7px; height: 7px;
  background: var(--text3);
  border-radius: 50%;
  animation: pulse 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }

.messages-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text3);
  font-size: 13px;
  padding: 20px;
}
.messages-loading .spinner-sm { border-color: var(--border); border-top-color: var(--blue); }

/* Welkomstscherm */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 12px;
}
.welcome-logo svg {
  width: 52px;
  height: 47px;
  filter: drop-shadow(0 2px 8px rgba(20,67,145,.15));
}
.welcome-title { font-size: 18px; font-weight: 800; color: var(--text); }
.welcome-sub   { font-size: 13px; color: var(--text2); max-width: 360px; }
.welcome-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}
.suggestion-btn {
  padding: 10px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  color: var(--text2);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.suggestion-btn:hover {
  background: #EBF0FB;
  border-color: #D1DBEE;
  color: var(--blue);
}

/* Input area */
.chat-input-area {
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
  transition: border-color .15s;
}
.chat-input-row:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,67,145,.08);
}
#chatInput {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--text);
  resize: none;
  outline: none;
  min-height: 22px;
  max-height: 160px;
  line-height: 1.55;
  padding: 2px 0;
}
#chatInput::placeholder { color: var(--text3); }
#sendBtn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--blue-grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: all .15s;
  box-shadow: 0 2px 6px rgba(20,67,145,.3);
}
#sendBtn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(20,67,145,.4); }
#sendBtn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
#sendBtn .spinner-sm { width: 14px; height: 14px; }

.chat-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px 0;
}
.chat-input-hint { font-size: 10.5px; color: var(--text3); }
#tokenDisplay   { font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; }

/* ── Rechterkolom (context) ──────────────────────────────────────────────────── */
.chat-context {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#contextEmpty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: var(--text3);
  font-size: 12.5px;
  gap: 10px;
}
#contextEmpty .empty-icon { font-size: 28px; }

#contextLoaded {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ctx-section {}
.ctx-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.ctx-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
}
.ctx-chevron { font-size: 11px; color: var(--text3); }

.ctx-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  font-size: 12px;
}
.ctx-label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.ctx-val   { color: var(--text2); line-height: 1.45; }
.ctx-link  { color: var(--blue2); text-decoration: none; font-size: 12px; }
.ctx-link:hover { text-decoration: underline; }
.ctx-empty-note   { font-size: 11.5px; color: var(--text3); font-style: italic; padding: 2px 0; }
.ctx-instructions {
  font-size: 12px;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SKILLS PAGINA
   ══════════════════════════════════════════════════════════════════════════════ */
#skillsPage, #tokenPage {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.page-header {
  padding: 20px 28px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.page-header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .1s;
}
.page-header-back:hover { background: var(--surface2); color: var(--text2); }
.page-title { font-size: 16px; font-weight: 700; color: var(--text); }
.page-header-actions { margin-left: auto; }

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.page-loading, .page-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
}
.page-loading .spinner-sm { border-color: var(--border); border-top-color: var(--blue); }

.skills-list { display: flex; flex-direction: column; gap: 12px; }

.skill-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color .15s;
}
.skill-card:hover { border-color: var(--border2); }
.skill-inactive { opacity: .6; }

.skill-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.skill-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.skill-card-desc {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}
.skill-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.skill-prompt-preview {
  font-size: 11.5px;
  color: var(--text3);
  background: var(--surface2);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: monospace;
  line-height: 1.5;
  word-break: break-word;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  width: 36px; height: 20px;
  background: var(--border2);
  border-radius: 20px;
  transition: background .2s;
  position: relative;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(16px); }

/* ══════════════════════════════════════════════════════════════════════════════
   TOKEN STATISTIEKEN PAGINA
   ══════════════════════════════════════════════════════════════════════════════ */
.token-month { margin-bottom: 32px; }
.token-month-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}
.token-month-header h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.token-month-total { font-size: 12px; color: var(--text3); font-weight: 500; }

.token-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.token-table th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.token-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
.token-table tbody tr:last-child td { border-bottom: none; }
.token-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.token-totals-row td { background: var(--surface2); border-top: 2px solid var(--border); color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ══════════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ══════════════════════════════════════════════════════════════════════════════
   BESTANDSUPLOAD
   ══════════════════════════════════════════════════════════════════════════════ */
.attach-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  flex-shrink: 0;
  transition: all .15s;
  margin-bottom: 2px;
}
.attach-btn:hover { background: var(--surface2); color: var(--text2); }

#attachmentPreview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px 0;
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #EBF0FB;
  border: 1px solid #D1DBEE;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--blue);
  max-width: 220px;
}
.attachment-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-chip-img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.attachment-chip-remove {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: .6;
  flex-shrink: 0;
}
.attachment-chip-remove:hover { opacity: 1; }

/* Bijlage-indicator in berichten */
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.message-attachment-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.message-attachment-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text2);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════════
   GESPREK HERNOEMEN
   ══════════════════════════════════════════════════════════════════════════════ */
.conv-item {
  position: relative;
}
.conv-item-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.conv-item-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.conv-rename-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: all .1s;
}
.conv-item:hover .conv-rename-btn { display: flex; }
.conv-rename-btn:hover { background: var(--surface3); color: var(--text2); }

.conv-rename-input {
  width: 100%;
  padding: 3px 6px;
  border: 1.5px solid var(--blue);
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(20,67,145,.1);
}

/* ══════════════════════════════════════════════════════════════════════════════
   SKILL SUGGESTIEVRAGEN MODAL
   ══════════════════════════════════════════════════════════════════════════════ */
.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.suggestion-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.suggestion-input-row .suggestion-num {
  width: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
  text-align: center;
}
.suggestion-input-row input {
  flex: 1;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  outline: none;
}
.suggestion-input-row input:focus {
  border-color: var(--blue);
  background: #fff;
}
