/* ============================================================
   Testbatches — rustig, Apple-achtig: veel witruimte, grote cijfers,
   weinig lijnen. Gebruikt de kleurtokens van TradeOS, dus werkt in
   donker én licht thema.
   ============================================================ */
.tb, .tb-wissel, .tb-modal {
  --tb-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "Inter", system-ui, sans-serif;
  --tb-lijn: color-mix(in srgb, var(--border) 70%, transparent);
  --tb-kaart: color-mix(in srgb, var(--surface) 88%, var(--bg));
  --tb-r: 20px;
}
.tb { font-family: var(--tb-font); max-width: 1180px; margin: 0 auto; padding: 8px 4px 64px; color: var(--text); }
.tb .pos { color: var(--green); }
.tb .neg { color: var(--red); }
.tb-zacht { color: var(--text-faint); font-weight: 400; }

/* wissel bovenaan Review */
.tb-wissel { display: flex; justify-content: center; gap: 2px; width: max-content; margin: 4px auto 22px;
  padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--tb-lijn); font-family: var(--tb-font); }
.tb-wissel button { border: 0; background: none; color: var(--text-soft); font: 500 0.86rem var(--tb-font);
  padding: 6px 18px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.tb-wissel button.actief { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* kop */
.tb-kop { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.tb-kop h1 { font-size: 2.1rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.tb-kop p { color: var(--text-soft); margin-top: 6px; font-size: 0.98rem; }

/* knoppen */
.tb-knop { font: 500 0.86rem var(--tb-font); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  border: 1px solid var(--tb-lijn); background: transparent; color: var(--text); transition: background .15s, border-color .15s; }
.tb-knop:hover { background: var(--surface-2); }
.tb-knop-hoofd { background: var(--text); color: var(--bg); border-color: transparent; }
.tb-knop-hoofd:hover { background: var(--text); opacity: .88; }

/* batchkiezer */
.tb-kiezer { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-kiezer button { display: inline-flex; align-items: center; gap: 8px; font: 500 0.88rem var(--tb-font);
  color: var(--text-soft); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 7px 15px; cursor: pointer; }
.tb-kiezer button:hover { color: var(--text); }
.tb-kiezer button.actief { color: var(--text); background: var(--surface-2); border-color: var(--tb-lijn); }
.tb-stip { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* kaarten */
.tb-kaart { background: var(--tb-kaart); border: 1px solid var(--tb-lijn); border-radius: var(--tb-r); padding: 26px 28px; }
.tb-kaart-kop { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.tb-kaart-kop h3, .tb-sectie { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.tb-sectie { margin: 38px 0 14px; }
.tb-label { font-size: 0.74rem; font-weight: 500; color: var(--text-faint); letter-spacing: 0.02em; }

/* held */
.tb-held { padding: 30px 34px 26px; }
.tb-held-kop { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.tb-held h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.tb-meta { color: var(--text-soft); font-size: 0.9rem; margin-top: 4px; }
.tb-acties { display: flex; gap: 8px; flex: none; }
.tb-cijfers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 34px 0 26px; }
.tb-cijfer { display: flex; flex-direction: column; gap: 6px; padding: 0 24px; border-left: 1px solid var(--tb-lijn); }
.tb-cijfer:first-child { padding-left: 0; border-left: 0; }
.tb-cijfer b { font-size: 2.7rem; font-weight: 500; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.tb-cijfer b small { font-size: 1.3rem; color: var(--text-faint); font-weight: 400; letter-spacing: -0.02em; }
.tb-sub { font-size: 0.8rem; color: var(--text-soft); }

/* winrate vs. break-even */
.tb-meter { margin-top: 4px; }
.tb-meter-baan { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); }
.tb-meter-vul { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--text-soft); transition: width .4s ease; }
.tb-meter.pos .tb-meter-vul { background: var(--green); }
.tb-meter.neg .tb-meter-vul { background: var(--red); }
.tb-meter.mid .tb-meter-vul { background: var(--amber); }
.tb-meter-zone { position: absolute; top: -3px; bottom: -3px; background: color-mix(in srgb, var(--text) 10%, transparent); border-radius: 3px; }
.tb-meter-tik { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; }
.tb-meter-leg { position: relative; display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-faint); margin-top: 9px; height: 1em; }
.tb-meter-leg span[style] { position: absolute; transform: translateX(-50%); color: var(--text-soft); white-space: nowrap; }
.tb-oordeel { margin-top: 18px; color: var(--text-soft); font-size: 0.88rem; }

/* per instrument */
.tb-instrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tb-instr { background: var(--tb-kaart); border: 1px solid var(--tb-lijn); border-radius: var(--tb-r); padding: 22px 24px; }
.tb-instr-kop { display: flex; justify-content: space-between; align-items: center; }
.tb-instr-naam { font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em; }
.tb-instr-n { margin: 14px 0 10px; font-variant-numeric: tabular-nums; }
.tb-instr-n b { font-size: 2rem; font-weight: 500; letter-spacing: -0.04em; }
.tb-instr-n span { color: var(--text-faint); font-size: 1rem; }
.tb-voortgang { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tb-voortgang span { display: block; height: 100%; background: var(--text-soft); border-radius: 99px; }
.tb-instr-cijfers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.tb-instr-cijfers dt, .tb-mini dt { font-size: 0.72rem; color: var(--text-faint); }
.tb-instr-cijfers dd, .tb-mini dd { font-size: 1.02rem; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tb-chip { font-size: 0.7rem; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--text-soft); }
.tb-chip.boven { background: var(--green-soft); color: var(--green); }
.tb-chip.onder { background: var(--red-soft); color: var(--red); }
.tb-chip.grens { background: var(--amber-soft); color: var(--amber); }
.tb-noot { font-size: 0.8rem; color: var(--text-faint); margin-top: 12px; }

/* curve + vergelijken */
.tb-duo { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; margin-top: 38px; }
.tb-curve { width: 100%; height: 130px; display: block; }
.tb-nul { stroke: var(--tb-lijn); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.tb-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--tb-lijn); }
.tb-leeg { color: var(--text-faint); font-size: 0.86rem; padding: 40px 0; text-align: center; }
.tb-tabel { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.tb-tabel th { text-align: right; font-weight: 500; font-size: 0.72rem; color: var(--text-faint); padding: 0 8px 10px; }
.tb-tabel td { text-align: right; padding: 12px 8px; border-top: 1px solid var(--tb-lijn); }
.tb-tabel th:first-child, .tb-tabel td:first-child { text-align: left; padding-left: 0; }
.tb-tabel tbody tr { cursor: pointer; transition: background .12s; }
.tb-tabel tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tb-tabel tr.gekozen .tb-tabel-naam { color: var(--text); font-weight: 600; }
.tb-tabel-naam { display: block; color: var(--text-soft); font-weight: 500; }
.tb-tabel-meta { display: block; font-size: 0.74rem; color: var(--text-faint); margin-top: 1px; }

/* formulier */
.tb-modal .modal-panel { max-width: 560px; border-radius: 22px; }
.tb-modal .modal-head h2 { font-family: var(--tb-font); font-weight: 600; letter-spacing: -0.02em; }
.tb-form { display: flex; flex-direction: column; gap: 18px; font-family: var(--tb-font); }
.tb-rij { display: flex; gap: 12px; }
.tb-rij > * { flex: 1; }
.tb-rij > .tb-breed { flex: 2.2; }
.tb-veld { display: flex; flex-direction: column; gap: 7px; }
.tb-veld > span { font-size: 0.76rem; color: var(--text-soft); font-weight: 500; }
.tb-veld small { font-size: 0.74rem; color: var(--text-faint); }
.tb-form input:not([type=checkbox]) { font: 0.92rem var(--tb-font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--tb-lijn); border-radius: 11px; padding: 9px 12px; width: 100%; outline: none; }
.tb-form input:focus { border-color: var(--text-soft); }
.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chips button, .tb-seg button { font: 500 0.84rem var(--tb-font); color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--tb-lijn); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.tb-chips button.aan, .tb-seg button.aan { background: var(--text); color: var(--bg); border-color: transparent; }
.tb-seg { display: flex; gap: 6px; align-items: center; }
.tb-seg input { width: 76px !important; }
.tb-hint { font-size: 0.82rem; color: var(--text-soft); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.tb-hint:empty { display: none; }
.tb-vink { display: flex; gap: 9px; align-items: center; font-size: 0.86rem; color: var(--text-soft); }
.tb-form-voet { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* batchnaam in de kop van het backtestformulier */
.tb-kopbatch { margin-left: 10px; font-size: 0.72rem; font-weight: 500; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; vertical-align: middle; }

@media (max-width: 900px) {
  .tb-cijfers { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .tb-cijfer:nth-child(3) { padding-left: 0; border-left: 0; }
  .tb-duo { grid-template-columns: 1fr; }
  .tb-kop { flex-direction: column; align-items: flex-start; }
}

/* filters binnen een batch */
.tb-filters { background: var(--tb-kaart); border: 1px solid var(--tb-lijn); border-radius: 18px; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.tb-frij { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.tb-fgroep { display: flex; flex-direction: column; gap: 7px; }
.tb-fgroep > span { font-size: 0.74rem; color: var(--text-faint); font-weight: 500; }
.tb-fgroep > div { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tb-pil { font: 500 0.84rem var(--tb-font); color: var(--text-soft); background: transparent; border: 1px solid transparent;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.tb-pil:hover { color: var(--text); }
.tb-pil.aan { color: var(--text); background: var(--surface-2); border-color: var(--tb-lijn); }
.tb-datum { display: inline-flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-faint); margin-left: 6px; }
.tb-filters input[type=date], .tb-filters select { font: 0.86rem var(--tb-font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--tb-lijn); border-radius: 10px; padding: 6px 9px; color-scheme: dark light; }
.tb-fstand { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 0.82rem; color: var(--text-soft); }

/* tradelijst */
.tb-trades { margin-top: 14px; }
.tb-scroll { overflow-x: auto; }
.tb-tradetabel { min-width: 760px; }
.tb-tradetabel th, .tb-tradetabel td { text-align: left; }
.tb-tradetabel th:last-child { text-align: right; }
.tb-tradetabel td { padding: 9px 8px; }
.tb-actie { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tb-actie .tb-knop { padding: 5px 12px; font-size: 0.8rem; }
.tb-melding { background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 10px 14px; font-size: 0.86rem; margin-bottom: 10px; }
