/* Tonco — aanvulling op Bootstrap 5.3 (licht en donker) */
:root {
    --chart-pos: #2a78d6;
    --chart-neg: #e34948;
    --chart-grid: #e1e0d9;
    --chart-axis: #c3c2b7;
    --chart-tick: #898781;
    --attention-bg: rgba(250, 178, 25, .12);
}
[data-bs-theme="dark"] {
    --chart-pos: #3987e5;
    --chart-neg: #e66767;
    --chart-grid: #2c2c2a;
    --chart-axis: #383835;
    --chart-tick: #898781;
    --attention-bg: rgba(250, 178, 25, .10);
}

body { background: var(--bs-tertiary-bg); }
.app-nav { background: var(--bs-body-bg); padding-top: max(.5rem, env(safe-area-inset-top)); }
.card { border-color: var(--bs-border-color-translucent); }

.auth-card { max-width: 24rem; margin-top: 6vh; }
.auth-card-wide { max-width: 28rem; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; }

.stat .stat-label { font-size: .8rem; color: var(--bs-secondary-color); }
.stat .stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: .8rem; color: var(--bs-secondary-color); }

.plan-list li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.plan-list li span:last-child { font-weight: 600; }

/* Label/waarde-grid (contextcards) */
.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .9rem; }
.kv-grid dt { font-weight: 500; color: var(--bs-secondary-color); }
.kv-grid dd { margin: 0; font-variant-numeric: tabular-nums; }
.report-context .report-lbl { width: 45%; font-weight: 500; color: var(--bs-secondary-color); padding-right: 1rem; }

/* Aandacht: subtiel geel getint */
tr.row-attention > td { background-color: var(--attention-bg) !important; }
.monitor-card.monitor-attention { border-left: 3px solid var(--bs-warning); }

.table td, .table th { font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable[data-dir="asc"]::after { content: " ▲"; font-size: .7em; }
th.sortable[data-dir="desc"]::after { content: " ▼"; font-size: .7em; }
.table-search { max-width: 16rem; }

.legs-editor td { padding: .2rem .25rem; }
.legs-editor select, .legs-editor input { min-width: 4.2rem; }

.plan-side { top: 5rem; z-index: 1; }

/* Orderstappen */
.order-steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; counter-reset: s; }
.order-steps li { counter-increment: s; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); }
.order-steps li::before { content: counter(s) ". "; }
.order-steps li.done { border-color: var(--bs-success); color: var(--bs-success-text-emphasis); }
.order-steps li.current { border-color: var(--bs-primary); color: var(--bs-primary-text-emphasis); font-weight: 600; }

/* Grafiek */
[data-bar-chart] { position: relative; }
.chart-area { width: 100%; min-height: 240px; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-zero { stroke: var(--chart-axis); stroke-width: 1; }
.chart-tick { fill: var(--chart-tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-pos { fill: var(--chart-pos); }
.chart-neg { fill: var(--chart-neg); }
.chart-tip { position: absolute; pointer-events: none; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 6px; padding: .25rem .5rem; font-size: .8rem; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.legend-pos { background: var(--chart-pos); }
.legend-neg { background: var(--chart-neg); }

details > summary { cursor: pointer; }

@media (max-width: 575.98px) {
    main.container-xl { padding-left: 16px; padding-right: 16px; }
    .kv-grid { grid-template-columns: 1fr 1fr; }
    .table-search { max-width: none; }
}
