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

:root {
  --black:   #141414;
  --white:   #fffffd;
  --red:     #e50247;
  --red-h:   #c8013e;
  --warm:    #faebe3;
  --warm-2:  #f2ddd4;
  --bg:      #f5f0ec;
  --border:  #e8e0d8;
  --text:    #141414;
  --text-2:  #758696;
  --success: #1c3533;
  --radius:  10px;
  --shadow:  0 1px 3px rgba(20,20,20,.07), 0 1px 2px rgba(20,20,20,.05);
}

body { font-family: 'Satoshi', 'Helvetica Neue', Helvetica, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Login ─────────────────────────────────────────────────────────── */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); }
.login-box { background: var(--white); border-radius: 16px; padding: 48px 44px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 28px; }
.login-input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); margin-bottom: 12px; }
.login-input:focus { outline: none; border-color: var(--red); }
.login-btn { width: 100%; padding: 13px; font-size: 15px; }
.login-error { margin-top: 10px; font-size: 13px; color: var(--red); min-height: 18px; }

/* ── Layout ────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
/* Sticky op schermhoogte: "Actieve klant" onderin blijft altijd zichtbaar,
   ook als de pagina-inhoud (bv. lange tabbladen) scrollt */
.sidebar { width: 230px; background: var(--black); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 26px 22px 22px; border-bottom: 1px solid #2a2a2a; }
.brand-logo { background: var(--red); color: var(--white); font-size: 13px; font-weight: 700; letter-spacing: .5px; padding: 5px 9px; border-radius: 6px; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--white); letter-spacing: -.2px; }

.sidebar-section-label { font-size: 10px; font-weight: 700; color: #4b5563; text-transform: uppercase; letter-spacing: 1px; padding: 20px 22px 8px; }
.sidebar-nav { padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-divider { height: 1px; background: #2a2a2a; margin: 10px 16px; }
.sidebar-nav-bottom { padding: 0 12px 4px; display: flex; flex-direction: column; gap: 2px; }

/* Directe nav-items (single-agent disciplines & Status) */
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 8px; border: none; background: transparent; color: #9ca3af; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; transition: background .15s, color .15s; font-family: inherit; }
.nav-item:hover { background: #1f1f1f; color: var(--white); }
.nav-item.active { background: var(--red); color: var(--white); }
.nav-icon { font-size: 13px; }

/* Inklapbare groep */
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-header { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 8px; border: none; background: transparent; color: #9ca3af; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; transition: background .15s, color .15s; font-family: inherit; }
.nav-group-header:hover { background: #1f1f1f; color: var(--white); }
.nav-group-header.has-active { color: var(--white); }
.nav-group-name { flex: 1; }
.nav-chevron { font-size: 11px; color: #4b5563; }

/* Lege staat */
.nav-empty { font-size: 12px; color: #6b7280; padding: 14px 16px; line-height: 1.5; font-style: italic; }

/* Sub-items */
.nav-subitems { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px 12px; }
.nav-subitem { display: flex; align-items: center; width: 100%; padding: 8px 14px; border-radius: 7px; border: none; background: transparent; color: #6b7280; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; transition: background .15s, color .15s; font-family: inherit; }
.nav-subitem:hover { background: #1f1f1f; color: var(--white); }
.nav-subitem.active { background: var(--red); color: var(--white); }

.sidebar-footer { padding: 16px; border-top: 1px solid #2a2a2a; margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.client-label { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .8px; }
.client-select { width: 100%; background: #1f1f1f; border: 1px solid #2a2a2a; color: var(--white); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit; font-weight: 500; cursor: pointer; }

/* ── Main ──────────────────────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; min-width: 0; }
.view { padding: 36px 44px; max-width: 1360px; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }

/* ── Coming soon ───────────────────────────────────────────────────── */
.coming-soon { text-align: center; padding: 40px 20px; color: var(--text-2); font-size: 14px; font-weight: 500; background: var(--bg); border-radius: 8px; border: 1.5px dashed var(--border); }

/* ── Task grid ─────────────────────────────────────────────────────── */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.task-card { background: var(--white); border: 2px solid var(--border); border-radius: var(--radius); padding: 22px; cursor: pointer; transition: all .15s; }
.task-card:hover { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229,2,71,.07); }
.task-card.selected { border-color: var(--red); background: #fff5f7; }
.task-card-name { font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.task-card-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; }

/* ── Run bar ───────────────────────────────────────────────────────── */
.run-bar { display: flex; align-items: center; justify-content: space-between; background: var(--warm); border: 1.5px solid var(--warm-2); border-radius: var(--radius); padding: 14px 22px; margin-bottom: 24px; }
.run-selected-label { font-size: 13px; color: var(--text-2); margin-right: 8px; }
.run-selected-name { font-size: 14px; font-weight: 700; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-primary { background: var(--red); color: var(--white); border: none; border-radius: 8px; padding: 11px 24px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s; font-family: inherit; letter-spacing: -.1px; }
.btn-primary:hover { background: var(--red-h); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); }
.btn-success { background: var(--success); color: var(--white); border: none; border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-danger { background: transparent; color: var(--red); border: 1.5px solid var(--red); border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-danger:hover { background: var(--red); color: var(--white); }

/* ── Result panel ──────────────────────────────────────────────────── */
.result-panel { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.result-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); background: var(--warm); }
.result-title { font-size: 14px; font-weight: 700; }
.result-body { padding: 22px; overflow-x: auto; }

.result-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-card { background: var(--bg); border-radius: 8px; padding: 14px 20px; border: 1px solid var(--border); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--red); letter-spacing: -.5px; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 3px; font-weight: 500; }

.opportunity-list, .issue-list { display: flex; flex-direction: column; gap: 10px; }
.opportunity-item, .issue-item { background: var(--bg); border-radius: 8px; padding: 16px 18px; border: 1px solid var(--border); }
.opportunity-title, .issue-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.opportunity-url { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.opportunity-tags, .issue-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag-warn  { background: var(--warm); color: #8b3a1e; }
.tag-info  { background: #e8f0fe; color: #1a3a7a; }
.tag-error { background: #fff0f3; color: var(--red); }
.tag-ok    { background: #d4ede8; color: var(--success); }

pre.raw { background: var(--bg); border-radius: 8px; padding: 18px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border); }

/* ── Status (tab in Klantbeheer) ───────────────────────────────────── */
.health-checks { display: flex; flex-direction: column; gap: 8px; max-width: 480px; }
.health-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.health-label { color: var(--text-2); }
.health-ok   { color: var(--success); font-weight: 600; }
.health-fail { color: var(--red); font-weight: 600; }
.health-var  { font-size: 11px; color: var(--text-2); background: var(--bg); padding: 2px 8px; border-radius: 4px; font-family: monospace; }

/* ── View sub-titel ────────────────────────────────────────────────── */
.view-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; font-weight: 500; }

/* ── Voorstellen ───────────────────────────────────────────────────── */
.proposals-list { display: flex; flex-direction: column; gap: 16px; }
.proposal-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.proposal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proposal-type-chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 999px; background: var(--warm); color: #8b3a1e; }
.queue-status { font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.status-pending  { background: #fff7e6; color: #8b5a1e; }
.status-approved { background: #d4ede8; color: var(--success); }
.status-rejected { background: #fff0f3; color: var(--red); }
.proposal-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.proposal-url { font-size: 12px; color: var(--text-2); text-decoration: none; word-break: break-all; }
.proposal-url:hover { color: var(--red); }
.proposal-reason { font-size: 13px; color: var(--text); background: var(--bg); padding: 10px 14px; border-radius: 8px; border-left: 3px solid var(--red); line-height: 1.5; }
.proposal-metrics { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.proposal-diff { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.diff-block { background: var(--bg); border-radius: 8px; padding: 12px 14px; border: 1px solid var(--border); }
.diff-block:last-child { background: #f5fbf8; border-color: #d4ede8; }
.diff-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin-bottom: 6px; }
.diff-current   { font-size: 13px; line-height: 1.45; color: var(--text); }
.diff-proposed  { font-size: 13px; line-height: 1.45; color: var(--text); font-weight: 500; }
.diff-empty     { color: var(--text-2); font-style: italic; }
.diff-arrow { align-self: center; color: var(--text-2); font-size: 18px; font-weight: 600; }
.proposal-explanation { font-size: 13px; color: var(--text-2); line-height: 1.5; padding: 8px 0; border-top: 1px dashed var(--border); }
.proposal-actions { display: flex; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 16px; }
.proposal-result { font-size: 13px; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--border); font-style: italic; }

/* ── Klantbeheer ───────────────────────────────────────────────────── */
/* Beheert de actieve klant (linksonder) — geen eigen klantenlijst */

/* ── Client panel ──────────────────────────────────────────────────── */
.panel-overlay { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 100; }
.client-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: var(--white); box-shadow: -4px 0 40px rgba(20,20,20,.15); z-index: 101; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.client-panel.open { transform: translateX(0); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-title { font-size: 18px; font-weight: 700; }
.panel-body { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 28px; }
.panel-footer { display: flex; align-items: center; padding: 18px 28px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ── Form ──────────────────────────────────────────────────────────── */
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-input { border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 13px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); transition: border-color .15s; width: 100%; }
.form-input:focus { outline: none; border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.cred-field-wrap { position: relative; display: flex; align-items: center; }
.cred-field-wrap .form-input { padding-right: 110px; }
.cred-status { position: absolute; right: 12px; font-size: 11px; font-weight: 600; color: var(--success); white-space: nowrap; }

/* ── Klant-editor (inline op Klantbeheer-pagina) ───────────────────── */
.client-editor { padding-bottom: 40px; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabbar { display: flex; gap: 4px; flex-wrap: wrap; background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 5px; width: fit-content; margin-bottom: 28px; box-shadow: var(--shadow); }
.tab { appearance: none; border: none; background: none; padding: 9px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border-radius: 8px; transition: all .15s; font-family: inherit; }
.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { color: var(--white); background: var(--black); }

/* Tab-panels: secties in kolommen op brede schermen, gestapeld op smal */
.tab-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px 36px; align-items: start; }
.tab-panel > .form-hint { grid-column: 1 / -1; }
.danger-zone { grid-column: 1 / -1; }

/* ── Branding / merkmateriaal ──────────────────────────────────────── */
.asset-group { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.asset-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.asset-group-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.asset-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.asset-card { position: relative; width: 120px; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.asset-thumb { width: 100%; height: 88px; background: #fff; }
img.asset-thumb { object-fit: contain; }
.asset-thumb-file { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: .04em; }
.asset-name { font-size: 11px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border); }
.asset-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.asset-del:hover { background: var(--red); }

/* ── Bedrijfsdocumenten ────────────────────────────────────────────── */
.doc-status { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--white); border: 1.5px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.doc-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.doc-del { padding: 2px 8px; line-height: 1; }

/* ── Services grid ─────────────────────────────────────────────────── */
.services-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.service-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .15s; user-select: none; }
.service-toggle input { display: none; }
.service-toggle:hover { border-color: var(--red); }
.service-toggle.active { border-color: var(--red); background: #fff5f7; }
.service-toggle-icon { font-size: 14px; }
.service-toggle-name { font-size: 13px; font-weight: 600; }

/* ── Buttons (extra) ───────────────────────────────────────────────── */
.btn-danger-ghost { background: transparent; color: var(--red); border: 1.5px solid var(--red); border-radius: 8px; padding: 10px 18px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-danger-ghost:hover { background: var(--red); color: var(--white); }

/* ── Gevarenzone (onderin Profiel-tab) ─────────────────────────────── */
.danger-zone { margin-top: 44px; }
.danger-zone .form-section-title { color: var(--red); border-bottom-color: #f3cfdb; }

/* ── Nieuwe klant wizard ───────────────────────────────────────────── */
.wizard-overlay { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.wizard { background: var(--white); border-radius: 16px; width: 620px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.wizard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px 28px 18px; border-bottom: 1px solid var(--border); }
.wizard-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wizard-step-chip { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.wizard-step-chip.active { background: var(--red); color: var(--white); border-color: var(--red); }
.wizard-step-chip.done { background: #d4ede8; color: var(--success); border-color: #d4ede8; }
.wizard-body { padding: 24px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-height: 280px; }
.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 28px; border-top: 1px solid var(--border); }
.wizard-check { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; }
.wizard-test-result { font-size: 13px; font-weight: 600; }
.wizard-scan-row { display: flex; gap: 10px; }
.wizard-scan-row .form-input { flex: 1; }
.spinner-dark { border-color: rgba(20,20,20,.2); border-top-color: var(--text-2); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .view { padding: 24px; }
  .tab-panel { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; overflow: visible; }
  .view { padding: 18px 16px; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .proposal-diff { grid-template-columns: 1fr; }
  .diff-arrow { justify-self: center; transform: rotate(90deg); }
  .wizard-overlay { padding: 0; align-items: stretch; }
  .wizard { width: 100%; max-height: 100vh; border-radius: 0; }
  .wizard-foot { flex-wrap: wrap; }
  .tabbar { width: 100%; }
}

/* ── Misc ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.coming-soon { text-align: center; padding: 40px 20px; color: var(--text-2); font-size: 14px; font-weight: 500; background: var(--bg); border-radius: 8px; border: 1.5px dashed var(--border); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: var(--white); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--black); color: var(--white); padding: 13px 22px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }
