/* ─────────────────────────────────────────────────────────────────────────
   Holter Dashboard — Clinical Theme Overrides
   ───────────────────────────────────────────────────────────────────────── */

/* Compact cards */
.card-header { padding: 0.5rem 0.75rem; }
.card-body   { padding: 0.6rem 0.75rem; }

/* Summary stat cards */
.card .card-body h5 { margin-bottom: 0; font-weight: 700; }
.card .card-body .text-muted { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Tighter tab content */
.tab-content { padding-top: 0 !important; }

/* Dark log area scroll */
pre::-webkit-scrollbar       { width: 6px; }
pre::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
pre::-webkit-scrollbar-track { background: #1e1e1e; }

/* Graph cards: remove inner padding for cleaner look */
.card .js-plotly-plot { margin: 0 !important; }

/* Navbar branding */
.navbar-brand { font-weight: 600; font-size: 1.15rem; }

/* Responsive grid tweaks for small screens */
@media (max-width: 992px) {
    .card-body .row > [class*="col-"] { margin-bottom: 0.4rem; }
}

/* Progress bar thin style */
.progress { border-radius: 2px; }

/* Analysis log monospace */
#analysis-log {
    line-height: 1.45;
    word-break: break-word;
}

/* ECG strip browser slider */
.rc-slider-track { background-color: #2196F3 !important; }
.rc-slider-handle { border-color: #2196F3 !important; }

/* ── Flag panel ─────────────────────────────────────────────────────────── */
#flag-panel .offcanvas-body { padding: 0.75rem; }
#flag-list-container .list-group-item { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
#flag-list-container .list-group-item:hover { background-color: #fff8e1; }
#flag-list-container .list-group { border-radius: 4px; }

/* Flag toggle button badge */
#flag-toggle-btn .badge { font-size: 0.7rem; vertical-align: middle; }

/* ── M11.c.1 — Beats grid active-cell highlight ─────────────────────────── */
/* Active-cell visual state is toggled by a clientside callback in
   callbacks/beats_grid.py — server doesn't re-render the grid on cell
   clicks anymore. The .beats-grid-cell-active class is added to the
   clicked cell and removed from the others. */
.beats-grid-cell {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0;
    transition: border-color 80ms, box-shadow 80ms;
}
.beats-grid-cell-active {
    border: 3px solid #1565C0 !important;
    box-shadow: 0 0 0 1px #1565C0 inset !important;
}

/* ── M11.d — Beats grid brush-mode multi-select highlight ─────────────────── */
.beats-grid-cell-brushed {
    border: 2px solid #F9A825 !important;     /* amber — distinct from the */
    box-shadow: 0 0 0 1px #F9A825 inset !important;  /* blue active ring */
}
/* When in brush mode, give cells a subtle hover cue so the analyst sees */
/* the cell is clickable for selection. */
.beats-grid-brush-active .beats-grid-cell:hover {
    background: #FFF8E1;
    cursor: cell;
}

/* ── P1-3 (closed 2026-05-05) — Disabled-button cursor feedback ───────── */
/* Bootstrap's btn:disabled keeps a default cursor on the disabled state */
/* in some browsers, which makes the button feel "frozen" rather than */
/* deliberately unavailable. Force not-allowed so the analyst gets a */
/* clear visual rejection signal when they click Prev on page 1 / Next */
/* on the last page. Matches the audit's requested affordance. */
.btn[disabled],
.btn:disabled,
button[disabled] {
    cursor: not-allowed !important;
}

/* ── BUG-008 (round 7 fix, 2026-05-07) — html / body scroll viewport ─── */
/* Round-1 attempt was wrong: `html, body { height: auto !important }` */
/* made BOTH html AND body grow to content height (1604px), so they */
/* matched and produced ZERO overflow — `window.scrollTo()` was a no-op */
/* because there was no scrolling viewport. */
/* */
/* Correct fix: */
/*   html  → height 100% (locked to viewport — scrolling container) */
/*   body  → min-height 100%, height auto (grows past viewport on tall */
/*           pages, creating overflow that html scrolls) */
/* */
/* Combined with the BUG-001/002 overflowY:visible on the admin */
/* DataTable, wheel events bubble from the table to the document and */
/* the page scrolls naturally. */
html {
    height: 100% !important;
}
body {
    min-height: 100% !important;
    height: auto !important;
}

/* ── BUG-007 / BUG-011 (closed 2026-05-07) — outline-secondary contrast ─ */
/* Bootstrap's btn-outline-secondary on a white card surface reads as */
/* "disabled" — the audit reported analysts not noticing the Refresh / */
/* Refresh users / Edit / Legacy .dat buttons because they look greyed */
/* out. Bump the border + text weight on enabled outline-secondary so */
/* the affordance is visible. Disabled state still grey via Bootstrap */
/* :disabled, so the contrast between enabled and disabled is preserved. */
.btn-outline-secondary:not(:disabled):not(.disabled) {
    color: #424242;
    border-color: #757575;
    border-width: 1.5px;
    font-weight: 500;
}
.btn-outline-secondary:not(:disabled):not(.disabled):hover {
    background-color: #424242;
    border-color: #424242;
    color: white;
}

/* ── BUG-017 (closed 2026-05-07) — Events kind-row affordance ──────── */
/* Audit reported the Events tree kind-rows ("Pause", "SVE Run", etc.) */
/* rendering in light grey "disabled-looking" text so analysts couldn't */
/* tell they were clickable. The rows are dbc.Button(color="light", */
/* outline=True) — make them visibly clickable. */
[id*="events-v2-kind-row"] {
    cursor: pointer !important;
    color: #212529 !important;
    transition: background-color 80ms;
}
[id*="events-v2-kind-row"]:hover {
    background-color: #FFF8E1 !important;
}

/* ── KWP-11 (closed 2026-05-05) — Borsam ingest mode radio ─────────────── */
/* Audit reported BOTH "Folder path on SERVER" and "ZIP upload" radios */
/* appearing selected simultaneously. Native HTML radios are correctly */
/* exclusive (shared name, browser handles single-select). The visual */
/* leak is bootstrap's default form-check-inline styling not differentiating */
/* the checked label from the unchecked label hover state. */
/* Make the active radio's label visibly bold + branded so the analyst */
/* can never mistake the unchecked option for an active one. */
.ib-mode-radios .form-check-inline .form-check-label {
    color: #757575;
    font-weight: 400;
    transition: color 80ms, font-weight 80ms;
}
.ib-mode-radios .form-check-inline .form-check-input:checked ~ .form-check-label,
.ib-mode-radios .form-check-inline .form-check-input:checked + .form-check-label {
    color: #1565C0;
    font-weight: 600;
}

/* ── BUG-C-003 (closed 2026-05-05) — PageScan opacity anchor ──────────── */
/* The audit reported PageScan content rendering at ~10–20 % opacity */
/* after interacting with an event-kind row on the Events tab. The */
/* root cause was not a single bleeding rule we could trace inline, */
/* but the symptom is consistent with a parent-tree style cascade or */
/* with stale CSS state during a renderer-freeze recovery (the audit */
/* coincided with the BUG-D-004 freeze condition, now closed). */
/* */
/* Defensive anchor: PageScan's tab body and the strip-render */
/* containers are explicitly pinned to opacity: 1 so no inherited or */
/* cascaded opacity can collapse the analyst's primary reading */
/* surface. The events_tab_v2 mosaic intentionally fades unaccepted */
/* event cards via inline style="opacity: 0.55" — that's scoped to */
/* the Card element so it doesn't leak through this anchor. */
#page-scan-tab-content,
#page-scan-scroll-container,
#page-scan-window-container,
#page-scan-window-container .js-plotly-plot {
    opacity: 1 !important;
}
