/* =========================================================
   Lustrumradar: Vermey Music Group
   Same tokens as the label dashboard and ProducerNotes
   (dark, purple accent, Manrope + DM Mono for dates and numbers).
   ========================================================= */
:root {
  --bg: #0A0A0D;
  --surface: #121217;
  --surface-2: #191921;
  --sunken: #1F1F29;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --line-hover: rgba(255, 255, 255, .28);
  --text: #F4F4F5;
  --text-2: #A1A1AA;
  --text-3: #8A8A96;
  --placeholder: #6E6E7A;
  --accent: #A855F7;
  --accent-strong: #C084FC;
  --accent-hover: #9333EA;
  --accent-soft: rgba(168, 85, 247, .16);
  --accent-soft-hover: rgba(168, 85, 247, .26);
  --brand: linear-gradient(135deg, #8B5CF6, #3B82F6);
  --blue: #60A5FA;
  --yellow: #FACC15;
  --yellow-line: rgba(250, 204, 21, .45);
  --green: #4ADE80;
  --green-soft: rgba(34, 197, 94, .14);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, .12);
  --bar-later: rgba(255, 255, 255, .14);
  --backdrop: rgba(0, 0, 0, .62);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, .6);
  --on-accent: #FFFFFF;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", monospace;
  --radius: 18px;
  --radius-sm: 12px;
  --fs-h1: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  --fs-h2: clamp(1.05rem, .98rem + .4vw, 1.25rem);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent-strong); }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- controls ---------- */
.select, .input, textarea {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; min-height: 44px; padding: 0 12px; color: var(--text);
  transition: border-color .15s; width: 100%;
}
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
.select:hover, .input:hover, textarea:hover { border-color: var(--line-hover); }
.input::placeholder, textarea::placeholder { color: var(--placeholder); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); border-radius: 10px; min-height: 44px; padding: 0 14px; font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--sunken); border-color: var(--line-hover); color: var(--text); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { color: var(--red); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; font-weight: 600; }
.error { color: var(--red); font-size: 13px; margin: 8px 0 0; min-height: 1em; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.login-side { display: none; }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 40px 16px; max-width: 440px; width: 100%; margin: 0 auto; }
.login h1 { font-size: var(--fs-h1); margin: 22px 0 6px; letter-spacing: -.03em; line-height: 1.15; }
.login p { color: var(--text-2); margin: 0 0 22px; }
.login .btn-primary { width: 100%; margin-top: 16px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.login .back { margin-top: 10px; width: 100%; }

/* ---------- header ---------- */
.app-head { display: flex; align-items: center; gap: 14px; padding: 22px 0 6px; flex-wrap: wrap; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.mark svg { width: 24px; height: 24px; }
.app-head h1 { font-size: var(--fs-h1); margin: 0; letter-spacing: -.03em; line-height: 1.1; }
.app-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.field .select { width: auto; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0 14px; }
.kpi { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; min-height: 44px; color: inherit; transition: border-color .15s, background-color .15s; }
.kpi:hover { border-color: var(--line-strong); background: var(--surface-2); }
.kpi:active { transform: scale(.99); }
.kpi[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.kpi b { display: block; font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.kpi span { color: var(--text-2); font-size: 13px; }

/* ---------- month chart ---------- */
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 10px; }
.tl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-top h2 { margin: 0; font-size: var(--fs-h2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .in { background: var(--accent); }
.legend .later { background: var(--bar-later); }
.months { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 3px; align-items: end; height: 104px; position: relative; margin-top: 22px; }
.m { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border: 0; background: transparent; padding: 0; border-radius: 6px; min-width: 0; }
.m .bar { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--bar-later); transition: background-color .15s; min-height: 3px; }
.m.in .bar { background: var(--accent); }
.m:hover .bar { background: var(--accent-strong); }
.m[aria-pressed="true"] .bar { background: var(--text); }
.m .cnt { font-family: var(--mono); font-size: 10px; color: var(--text-3); text-align: center; margin-bottom: 3px; }
.mlabels { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 3px; margin-top: 6px; }
.mlabels span { font-size: 10px; color: var(--text-3); text-align: center; overflow: hidden; white-space: nowrap; }
.mlabels span.y { color: var(--text); font-weight: 700; }
.today { position: absolute; top: -6px; bottom: 0; width: 2px; background: var(--yellow); pointer-events: none; }
.today::after { content: "vandaag"; position: absolute; top: -16px; left: 4px; font-size: 10px; color: var(--yellow); font-weight: 700; }

/* ---------- filters + table ---------- */
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 14px 0 12px; }
.active { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--text-2); }
.clear { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; min-height: 36px; padding: 0 12px; font-weight: 600; font-size: 13px; transition: background-color .15s; }
.clear:hover { background: var(--accent-soft-hover); }
.clear:active { transform: scale(.97); }
.linkish { border: 0; background: none; color: var(--accent-strong); font-weight: 600; font-size: 13px; padding: 0 4px; min-height: 36px; }
.linkish:hover { color: var(--text); text-decoration: underline; }
.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 80px; }
.thead { display: none; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); width: 100%; text-align: left; background: transparent; color: inherit; transition: background-color .12s; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row:active { background: var(--sunken); }
.row .name { font-weight: 700; display: block; }
.row .sub { color: var(--text-3); font-size: 13px; display: block; }
.row .when { text-align: right; font-size: 13px; }
.row .when b { display: block; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--text); }
.row .namecell { order: 0; min-width: 0; }
.row .when { order: 1; }
.row .stadcell { grid-column: 1 / -1; order: 2; }
.row .stadcell:empty { display: none; }
.row .tags { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; order: 3; }
.row .tags:empty { display: none; }
.row .st { grid-column: 1 / -1; order: 4; }
.empty { padding: 32px 16px; text-align: center; color: var(--text-3); margin: 0; }
.more-row { padding: 12px 16px; border-top: 1px solid var(--line); text-align: center; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-klant { background: var(--green-soft); color: var(--green); }
.chip-warm { background: var(--accent-soft); color: var(--accent-strong); }
.chip-schat { border: 1px solid var(--line-strong); color: var(--text-2); }
.chip-check { border: 1px solid var(--yellow-line); color: var(--yellow); }
.chip-bediend { background: var(--red-soft); color: var(--red); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-nieuw { color: var(--text-3); }
.st-benaderd { color: var(--blue); }
.st-gesprek { color: var(--accent-strong); }
.st-offerte { color: var(--yellow); }
.st-akkoord { color: var(--green); }
.st-nee { color: var(--red); }

/* ---------- sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow: auto; background: var(--surface); border-top: 1px solid var(--line-strong); border-radius: 22px 22px 0 0; padding: 18px 16px 32px; transform: translateY(105%); transition: transform .25s ease; box-shadow: var(--shadow-pop); visibility: hidden; }
.sheet-open .sheet-back { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; visibility: visible; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.sheet .sub { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.x { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; transition: background-color .15s; color: var(--text); }
.x:hover { background: var(--sunken); }
.x:active { transform: scale(.96); }
.sheet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 12px; }
.fact { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.fact.wide { grid-column: 1 / -1; }
.fact small { display: block; color: var(--text-3); font-size: 12px; }
.fact b { font-weight: 600; }
.sheet h4 { margin: 20px 0 8px; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.statuses button { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 999px; min-height: 44px; padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background-color .15s, color .15s, border-color .15s; }
.statuses button:hover { color: var(--text); border-color: var(--line-hover); }
.statuses button:active { transform: scale(.97); }
.statuses button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.saved { font-size: 12px; color: var(--green); margin-left: 8px; opacity: 0; transition: opacity .2s; font-weight: 600; text-transform: none; letter-spacing: 0; }
.saved.on { opacity: 1; }
.research { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.research li { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.hist { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--text-2); }
.hist li { padding: 8px 0; border-top: 1px solid var(--line); }
.hist li:first-child { border-top: 0; }
.hist b { color: var(--text); font-weight: 600; }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; }
.users { list-style: none; padding: 0; margin: 0; }
.users li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.users li:first-child { border-top: 0; }
.users .who b { display: block; font-weight: 600; }
.users .who span { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.hint { font-size: 13px; color: var(--text-3); margin-top: 14px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--sunken); border: 1px solid var(--line-strong); color: var(--text); border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--text-3); }

@media (min-width: 768px) {
  .login { grid-template-columns: 1fr 1fr; }
  .login-side { display: flex; align-items: center; justify-content: center; background: var(--surface); border-right: 1px solid var(--line); }
  .login-side .mark { width: 160px; height: 160px; border-radius: 40px; }
  .login-side .mark svg { width: 100px; height: 100px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .thead { display: grid; grid-template-columns: 2.4fr 1fr 1.3fr 1.6fr 1fr; gap: 12px; padding: 12px 16px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
  .row { grid-template-columns: 2.4fr 1fr 1.3fr 1.6fr 1fr; align-items: center; }
  .row .stadcell, .row .tags, .row .st { grid-column: auto; }
  .row .stadcell:empty { display: block; }
  .row .stadcell { order: 1; }
  .row .namecell { order: 0; }
  .row .when { order: 2; text-align: left; }
  .row .tags { order: 3; }
  .row .tags:empty { display: block; }
  .row .st { order: 4; }
  .sheet { left: auto; top: 0; bottom: 0; width: 460px; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line-strong); transform: translateX(105%); padding: 24px; }
}
@media (max-width: 767px) {
  .months { height: 84px; }
  .mlabels span:not(.y):not(.q) { visibility: hidden; }
  .head-tools { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
