/* Claire van HR — huisstijl (officiële Kleuren slide)
   Purple #6b48be · purple-dark #41219f · purple-light #a6a6ff · ink #14004d · blue-light #eef8ff
   Amber #fca636 · amber-light #fdce90 · amber-dark #ca852b · gradient #8469ff→#6a46ba
   Body: Parkinsans · Display: TRICK */
@font-face {
  font-family: "Parkinsans";
  src: url("fonts/Parkinsans-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "TRICK";
  src: url("fonts/TRICK-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  /* Officiële merkkleuren (Kleuren slide) */
  --purple: #6b48be;
  --purple-dark: #41219f;
  --purple-light: #a6a6ff;
  --ink: #14004d;
  --blue-light: #eef8ff;
  --amber: #fca636;
  --amber-light: #fdce90;
  --amber-dark: #ca852b;
  --gradient-start: #8469ff;
  --gradient-end: #6a46ba;

  --bg-app: #f8f1ff;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f8f1ff;
  --bg-elevated: #ffffff;
  --bg-hover: rgba(107, 72, 190, .07);
  --surface-glow: rgba(166, 166, 255, .30);
  --border-primary: #d9d4e6;
  --border-secondary: #ece8f4;
  --border-lilac: #f3e8ff;
  --text-primary: #2e2e2e;
  --text-secondary: #56525f;
  --text-tertiary: #797586;
  --text-muted: #9b97a8;
  --heading: var(--purple-dark);
  --accent: var(--purple);
  --accent-hover: var(--purple-dark);
  --accent-soft: rgba(107, 72, 190, .10);
  --cta: var(--amber);
  --cta-hover: var(--amber-dark);
  --cta-ink: var(--ink);
  --green: #05df72;
  --green-soft: rgba(5, 223, 114, .14);
  --orange: var(--amber);
  --red: #e0556a;
  --shadow: 0 18px 34px -14px rgba(65, 33, 159, .22);
  --shadow-preview: 0 18px 23px -5px rgba(243, 232, 255, .55), 0 7px 9px -5px rgba(243, 232, 255, .55);
  --radius: 22px;
  --radius-input: 11px;
  --radius-pill: 999px;
  --gradient-purple: linear-gradient(127deg, var(--gradient-start) .4%, var(--gradient-end) 98.65%);
  --gradient-purple-blue: linear-gradient(160deg, #eef8ff 5%, #a6a6ff 117%);
  --font-sans: "Parkinsans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "TRICK", "Parkinsans", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #14004d;
  --bg-primary: #1c0a5e;
  --bg-secondary: #241170;
  --bg-tertiary: #2d1a7d;
  --bg-elevated: #2a1568;
  --bg-hover: rgba(166, 166, 255, .12);
  --surface-glow: rgba(132, 105, 255, .24);
  --border-primary: rgba(166, 166, 255, .22);
  --border-secondary: rgba(166, 166, 255, .12);
  --border-lilac: rgba(166, 166, 255, .18);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, .86);
  --text-tertiary: rgba(255, 255, 255, .66);
  --text-muted: rgba(255, 255, 255, .46);
  --heading: #ffffff;
  --accent: #a6a6ff;
  --accent-hover: #8469ff;
  --accent-soft: rgba(166, 166, 255, .16);
  --cta: var(--amber);
  --cta-hover: var(--amber-dark);
  --cta-ink: var(--ink);
  --green: #37c991;
  --green-soft: rgba(55, 201, 145, .14);
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --shadow-preview: 0 24px 60px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg-app); color: var(--text-primary); font: 15px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, .topbar h1, .welcome h2, .drawer-header h2, .auth-card h2 { font-family: var(--font-display); color: var(--heading); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
button.menu-toggle { display: none; }

.app-shell { height: 100dvh; display: grid; grid-template-columns: 280px minmax(0, 1fr); transition: grid-template-columns .22s ease; background: radial-gradient(circle at 72% -4%, var(--surface-glow), transparent 44%), var(--bg-primary); }
.app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { min-width: 0; padding: 18px 14px 14px; background: var(--bg-secondary); border-right: 1px solid var(--border-primary); display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overflow-x: hidden; z-index: 55; transition: padding .22s ease, border-color .22s ease; }
.sidebar > * { flex: 0 0 auto; opacity: 1; transition: opacity .15s ease; }
.sidebar > .sidebar-section--grow { flex: 1 1 auto; }
.app-shell.sidebar-collapsed .sidebar { padding-left: 0; padding-right: 0; border-right-color: transparent; }
.app-shell.sidebar-collapsed .sidebar > * { opacity: 0; pointer-events: none; transition: opacity .1s ease; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 11px; min-height: 48px; padding: 2px 5px; }
.sidebar-collapse-button { flex: 0 0 auto; }
.brand__logo { height: 30px; width: auto; display: block; }
.brand__logo--dark { display: none; }
html[data-theme="dark"] .brand__logo--light { display: none; }
html[data-theme="dark"] .brand__logo--dark { display: block; }
.brand__mark { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--gradient-purple); box-shadow: 0 8px 22px rgba(107, 72, 190, .30); flex: 0 0 auto; }
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__mark svg { width: 27px; fill: none; stroke: white; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand span { color: var(--accent); font-size: 11px; margin-top: 1px; font-weight: 600; }

.primary-action, .secondary-action { width: 100%; min-height: 44px; border-radius: var(--radius-pill); border: 0; cursor: pointer; transition: .2s ease; font-weight: 600; font-family: inherit; }
.primary-action { background: var(--cta); color: var(--cta-ink); box-shadow: 0 10px 26px -6px rgba(252, 166, 54, .48); }
.primary-action:hover { background: var(--cta-hover); transform: translateY(-1px); }
.primary-action:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-action { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.secondary-action:hover { background: var(--accent-soft); }
.sidebar > .primary-action { display: flex; gap: 8px; align-items: center; justify-content: center; }

.sidebar-section { display: flex; flex-direction: column; gap: 5px; }
.sidebar-section--grow { flex: 1; }
.section-heading { padding: 4px 7px; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 700; }
.prompt-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item, .prompt-item { width: 100%; min-height: 38px; border: 0; background: transparent; border-radius: 8px; padding: 8px 9px; color: var(--text-tertiary); display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; text-decoration: none; transition: .15s ease; }
.nav-item:hover, .prompt-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.prompt-item span:last-child, .nav-item span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prompt-item__star { margin-left: auto; color: var(--orange); }
.sidebar-footer { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-secondary); padding-top: 12px; }
.connection-card { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; padding: 7px 9px 10px; }
.connection-card strong, .connection-card span { display: block; }
.connection-card strong { font-size: 12px; }
.connection-card span { font-size: 10px; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); flex: 0 0 auto; }
.status-dot--warning { background: var(--orange); box-shadow: 0 0 0 4px rgba(252, 166, 54, .14); }
.status-dot--error { background: var(--red); box-shadow: 0 0 0 4px rgba(243,111,122,.12); }

.main-panel { min-width: 0; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.topbar { min-height: 68px; padding: 10px 20px; border-bottom: 1px solid var(--border-primary); background: color-mix(in srgb, var(--bg-secondary) 90%, transparent); display: flex; align-items: center; gap: 12px; backdrop-filter: blur(14px); }
.topbar__title { min-width: 0; }
.topbar h1 { margin: 0; font-size: 16px; line-height: 1.2; }
.live-status { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; margin-top: 4px; }
.live-status .status-dot { width: 6px; height: 6px; box-shadow: none; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.app-shell.sidebar-collapsed .menu-toggle { display: grid; }
.icon-button, .avatar-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-tertiary); cursor: pointer; transition: .15s ease; }
.icon-button:hover, .avatar-button:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-button--small { width: 26px; height: 26px; }
.avatar-button { background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 11px; }
.brand__mark, .welcome__icon, .message--assistant .message__avatar, .auth-card__icon { position: relative; }

.conversation { min-height: 0; overflow-y: auto; scroll-behavior: smooth; padding: 34px clamp(18px, 5vw, 70px); }
.welcome { max-width: 850px; margin: min(8vh, 70px) auto 0; text-align: center; animation: rise .35s ease both; }
.welcome__icon { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; margin: 0 auto 18px; background: var(--gradient-purple); color: white; font-size: 26px; box-shadow: 0 14px 34px rgba(107, 72, 190, .28); }
.welcome__icon img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; font-weight: 800; }
.welcome h2 { margin: 5px 0 9px; font-size: clamp(26px, 4vw, 40px); line-height: 1.14; letter-spacing: -.025em; color: var(--accent-hover); }
.welcome > p:not(.eyebrow) { max-width: 650px; margin: 0 auto; color: var(--text-tertiary); }
.suggestion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.suggestion-card { padding: 22px; min-height: 140px; border: 1px solid var(--border-lilac); border-radius: var(--radius); background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary)); text-align: left; color: inherit; cursor: pointer; transition: .2s ease; }
.suggestion-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-preview); }
.suggestion-card__icon, .suggestion-card strong, .suggestion-card span { display: block; }
.suggestion-card__icon { font-size: 22px; margin-bottom: 12px; }
.suggestion-card strong { font-size: 14px; margin-bottom: 4px; }
.suggestion-card span:last-child { color: var(--text-tertiary); font-size: 12px; }
.messages { max-width: 920px; margin: 0 auto; }

.message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; margin: 0 0 26px; animation: rise .23s ease both; }
.message__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 10px; }
.message--assistant .message__avatar { background: var(--gradient-purple); color: white; font-size: 16px; }
.message--assistant .message__avatar img { width: 100%; height: 100%; object-fit: cover; }
.message__body { min-width: 0; }
.message__bubble { width: fit-content; max-width: 100%; padding: 12px 16px; border: 1px solid var(--border-primary); border-radius: 6px 18px 18px 18px; background: var(--bg-secondary); color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.message--user .message__bubble { margin-left: auto; border-radius: 18px 6px 18px 18px; background: var(--accent); color: white; border-color: transparent; }
.message__bubble h3 { color: var(--text-primary); font-size: 15px; margin: 4px 0 10px; }
.message__bubble p { margin: 0 0 10px; }
.message__bubble p:last-child { margin-bottom: 0; }
.message__body time { display: block; font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.message--user time { text-align: right; }
.message__actions { margin-top: 5px; display: flex; gap: 4px; opacity: 0; transition: .15s ease; }
.message:hover .message__actions { opacity: 1; }
.message__actions button { border: 0; background: transparent; color: var(--text-muted); font-size: 10px; cursor: pointer; padding: 4px 6px; border-radius: 5px; }
.message__actions button:hover { color: var(--text-primary); background: var(--bg-hover); }
.streaming-cursor::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s infinite; }

.tool-activity { margin-bottom: 8px; border: 1px solid var(--accent-soft); background: var(--accent-soft); border-radius: 14px; overflow: hidden; }
.tool-activity__header { padding: 9px 11px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.tool-activity__item { padding: 7px 11px; border-top: 1px solid var(--border-secondary); color: var(--text-tertiary); font-size: 11px; display: flex; gap: 8px; align-items: center; }
.tool-activity__item.is-done { color: var(--green); }
.spinner { width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

.data-card, .chart-card { margin: 12px 0 3px; border: 1px solid var(--border-lilac); border-radius: var(--radius); overflow: hidden; background: var(--bg-primary); box-shadow: var(--shadow-preview); }
.data-card__header, .chart-card__header { padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); }
.data-card__header strong, .chart-card__header strong { font-size: 12px; }
.download-group { display: flex; gap: 4px; }
.download-group button { border: 1px solid var(--border-primary); border-radius: 6px; background: transparent; color: var(--text-tertiary); font-size: 10px; padding: 4px 7px; cursor: pointer; }
.download-group button:hover { color: var(--text-primary); background: var(--bg-hover); }
.table-scroll { overflow: auto; max-height: 300px; }
table { width: 100%; border-collapse: collapse; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border-secondary); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--bg-secondary); color: var(--text-primary); }
td { color: var(--text-tertiary); }
tbody tr:hover { background: var(--bg-hover); }
.data-card__footer { padding: 7px 10px; color: var(--text-muted); background: var(--bg-tertiary); font-size: 10px; }
.chart-card__body { position: relative; padding: 18px 14px 12px; height: 230px; }

.notice { padding: 8px 16px; text-align: center; background: rgba(252, 166, 54, .12); border-top: 1px solid rgba(252, 166, 54, .25); color: var(--amber-dark); font-size: 12px; }
.composer-area { padding: 12px clamp(18px, 5vw, 70px) 14px; border-top: 1px solid var(--border-primary); background: var(--bg-secondary); }
.composer { max-width: 920px; margin: 0 auto; display: flex; align-items: flex-end; gap: 7px; }
.composer textarea { flex: 1; min-height: 46px; max-height: 170px; resize: none; padding: 12px 15px; border: 1px solid var(--border-lilac); border-radius: var(--radius-input); background: var(--bg-tertiary); color: var(--text-primary); outline: none; }
.composer textarea::placeholder { color: var(--text-muted); }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer__tool, .send-button, .stop-button { width: 46px; height: 46px; flex: 0 0 auto; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.composer__tool { background: transparent; color: var(--text-muted); }
.composer__tool:hover { background: var(--bg-hover); color: var(--text-primary); }
.send-button { background: var(--cta); color: var(--cta-ink); }
.send-button:hover { background: var(--cta-hover); }
.send-button:disabled { opacity: .45; cursor: not-allowed; }
.send-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stop-button { background: var(--red); color: white; }
.composer-hint { max-width: 920px; margin: 7px auto 0; color: var(--text-muted); font-size: 10px; text-align: center; }

.backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .56); backdrop-filter: blur(2px); z-index: 50; }
.settings-drawer { position: fixed; top: 0; right: 0; width: min(430px, 100%); height: 100dvh; padding: 22px; background: var(--bg-elevated); border-left: 1px solid var(--border-primary); box-shadow: var(--shadow); z-index: 60; transform: translateX(105%); transition: transform .23s ease; overflow: auto; }
.settings-drawer.is-open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.drawer-header h2 { margin: 0; font-size: 20px; }
.settings-form, .form-stack { display: flex; flex-direction: column; gap: 15px; }
.settings-form label, .auth-card label { display: flex; flex-direction: column; gap: 6px; color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
.settings-form input, .settings-form select, .auth-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-input); background: var(--bg-secondary); color: var(--text-primary); outline: none; }
.settings-form input:focus, .settings-form select:focus, .auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.checkbox-row input { width: auto !important; accent-color: var(--accent); }
.info-box { padding: 13px; border: 1px solid var(--border-primary); border-radius: 9px; background: var(--bg-secondary); }
.info-box strong { font-size: 12px; }
.info-box p { margin: 4px 0 0; color: var(--text-tertiary); font-size: 11px; }

.auth-dialog { border: 0; padding: 0; background: transparent; color: inherit; }
.auth-dialog::backdrop { background: rgba(2,6,23,.7); backdrop-filter: blur(4px); }
.auth-card { position: relative; width: min(400px, calc(100vw - 32px)); padding: 30px; border: 1px solid var(--border-primary); border-radius: 24px; background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--shadow); text-align: center; }
.auth-card h2 { margin: 8px 0 3px; font-size: 21px; }
.auth-card > p { margin: 0 0 20px; color: var(--text-tertiary); }
.auth-card__icon { width: 58px; height: 58px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--gradient-purple); color: white; font-size: 22px; }
.auth-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.auth-card label { text-align: left; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-muted); font-size: 22px; cursor: pointer; }
.otp-input { text-align: center; letter-spacing: .35em; font-size: 20px; font-weight: 700; }
.form-hint { color: var(--text-tertiary); font-size: 12px; }
.alert { padding: 10px 12px; margin: 12px 0; border-radius: 7px; background: rgba(243,111,122,.1); color: var(--red); border: 1px solid rgba(243,111,122,.22); font-size: 12px; text-align: left; }
.alert.is-success { color: var(--green); background: var(--green-soft); border-color: rgba(55,201,145,.24); }
.text-button { border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; }

.popover { position: fixed; left: 292px; bottom: 84px; width: min(340px, calc(100vw - 32px)); background: var(--bg-elevated); border: 1px solid var(--border-primary); border-radius: 18px; box-shadow: var(--shadow); z-index: 45; overflow: hidden; }
.popover__header { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-primary); }
.popover__content { max-height: 310px; overflow: auto; padding: 7px; }
.empty-state { color: var(--text-muted); padding: 16px 10px; font-size: 12px; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .suggestion-grid { grid-template-columns: 1fr; }
  .suggestion-card { min-height: 105px; }
  .popover { left: 250px; }
}

@media (max-width: 720px) {
  .menu-toggle { display: grid !important; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(292px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .main-panel { width: 100%; }
  .topbar { min-height: 60px; padding: 8px 12px; }
  .conversation { padding: 22px 14px; }
  .welcome { margin-top: 24px; }
  .welcome h2 { font-size: 28px; }
  .composer-area { padding: 10px 10px 12px; }
  .composer__tool { display: none; }
  .composer-hint { display: none; }
  .message { grid-template-columns: 30px minmax(0,1fr); gap: 8px; }
  .message__avatar { width: 29px; height: 29px; border-radius: 8px; }
  .popover { left: 12px; bottom: 76px; }
  .message__actions { opacity: 1; }
}
