/* QOF Prevalence dashboard.
 *
 * Phase 4C.46A. The monolith's `<style>` block from prevalence/dashboard.html, taken at monolith commit
 * cb02cf0 with no selector, value or colour changed. `var(--theme)` there is the monolith's site colour;
 * here it is `--pv-theme`, #0d5bb8, the value the source's own rgba() focus ring already used. The
 * additions are at the end and are listed there: they exist because the Content Security Policy admits
 * no style attribute and no inline style element, so the monolith's inline attributes became classes.
 */
:root { --pv-theme:#0d5bb8; }

.pv-wrap { max-width:none; margin:0; padding:0; }
.pv-title { font-size:26px; font-weight:800; color:#0f172a; margin:0 0 18px; }

/* --- Layout ------------------------------------------------------------ */
.prev-section-head { font-size:16px; font-weight:700; color:#111827; margin:0 0 16px; padding-bottom:12px; border-bottom:1px solid #e8edf2; }
.year-badge { display:inline-block; background:var(--pv-theme); color:#fff; font-size:11px; font-weight:700; letter-spacing:1px; text-transform:uppercase; padding:3px 10px; border-radius:4px; margin-bottom:6px; }


/* --- Practice info bar ------------------------------------------------- */
.practice-info-bar { background:#fff; border:1px solid #e8edf2; border-radius:8px; padding:16px 20px; margin-bottom:24px; display:flex; flex-wrap:wrap; gap:20px; align-items:center; }
.practice-info-bar .pi-name { font-size:16px; font-weight:700; color:#111827; flex:1; min-width:220px; }
.practice-info-bar .pi-stat { font-size:12px; color:#6b7c85; }
.practice-info-bar .pi-stat strong { color:#111827; font-size:14px; display:block; }

/* --- KPI strip --------------------------------------------------------- */
.kpi-strip { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:24px; }
.kpi-box { flex:1; min-width:160px; background:#f0f4ff; border:1px solid #c7d8f5; border-radius:8px; padding:18px 20px; text-align:center; }
.kpi-label { font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--pv-theme); font-weight:700; margin-bottom:6px; }
.kpi-value { font-size:22px; font-weight:700; color:#111827; line-height:1.15; }
.kpi-sub { font-size:11px; color:#9ca3af; margin-top:4px; }
.kpi-value.var-pos { color:#16a34a; }
.kpi-value.var-neg { color:#dc2626; }

/* --- Spotlight --------------------------------------------------------- */
.spotlight-row { background:#fffbeb; border-left:4px solid #f59e0b; border-radius:0 6px 6px 0; padding:12px 16px; margin-bottom:10px; font-size:13px; color:#111827; }
.spotlight-row .sp-indicator { font-weight:700; color:#b45309; }
.spotlight-row .sp-variance { font-weight:700; color:#d97706; }

/* --- Charts ------------------------------------------------------------ */
.chart-wrap { position:relative; min-height:240px; }
.chart-wrap.chart-wide { min-height:320px; }
.chart-wrap.chart-tall { min-height:380px; }

/* --- Domain filter bar ------------------------------------------------- */
.filter-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
#row-search { padding:8px 12px; font-size:13px; border:1px solid #d1d9e0; border-radius:6px; min-width:240px; flex:1; }
#domain-filter { padding:8px 12px; font-size:13px; border:1px solid #d1d9e0; border-radius:6px; min-width:180px; }

/* --- Data table -------------------------------------------------------- */
.detail-table-card { padding:0; }
.detail-table-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:20px 24px 14px; border-bottom:1px solid #e8edf2; }
.detail-table-title { font-size:15px; font-weight:700; color:#111827; margin:0; }
.detail-table-wrap { overflow-x:auto; padding:0 24px 24px; }
.prev-table { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; }
.prev-table th { font-size:11px; font-weight:700; color:#6b7c85; background:#fff; padding:12px; text-align:left; border-bottom:1px solid #e8edf2; white-space:nowrap; position:sticky; top:0; z-index:1; }
.prev-table td { padding:11px 12px; border-bottom:1px solid #e8edf2; vertical-align:middle; color:#4b5563; }
.prev-table tbody tr:nth-child(even) td { background:#f8fafc; }
.prev-table tbody tr:hover td { background:#f0f4ff; }
.prev-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.prev-table .indicator-cell { font-weight:700; color:#374151; letter-spacing:.3px; }
.prev-table .condition-cell { font-size:14px; color:#374151; }
.prev-table .domain-pill { display:inline-block; min-width:38px; text-align:center; padding:3px 8px; border-radius:999px; background:#f0f4ff; color:var(--pv-theme); font-size:11px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; }
.var-pos { color:#16a34a; font-weight:700; }
.var-neg { color:#dc2626; font-weight:700; }
.var-zero { color:#6b7c85; font-weight:700; }

/* --- Export buttons ---------------------------------------------------- */
.export-btn { display:inline-flex; align-items:center; gap:5px; padding:5px 12px; font-size:12px; font-weight:600; border-radius:6px; text-decoration:none; }
.export-btn-csv  { background:#0d6efd; color:#fff; }
.export-btn-pdf  { background:#dc3545; color:#fff; }
.export-btn:hover { opacity:.88; color:#fff; }

@media (max-width:767px) {
  .kpi-strip { gap:10px; }
  .kpi-box { min-width:130px; }
  .chart-wrap.chart-wide { min-height:260px; }
}

/* ---- Additions (Phase 4C.46A) -------------------------------------------------------------------
 * The monolith's inline style attributes, as classes. Each declaration is the source's.
 */
.pv-card { background:#fff; border:1px solid #e8edf2; border-radius:10px; padding:22px 24px; margin-bottom:24px; }
.pv-card-open { overflow:visible; margin-bottom:28px; }
.detail-table-card.pv-card { padding:0; }
.pv-fill { height:100%; margin-bottom:0; }
.pv-help { font-size:13px; color:#6b7c85; margin-bottom:16px; }
.pv-help-sm { font-size:12px; color:#6b7c85; margin-bottom:12px; }
.pv-search-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.pv-year-label { font-size:13px; font-weight:600; color:#111827; }
.pv-select { max-width:100%; padding:10px 12px; font-size:14px; border:1px solid #d1d9e0; border-radius:6px; background:#fff; }
.pv-select-sm { padding:7px 12px; font-size:13px; max-width:200px; }
.pv-input-sm { padding:7px 12px; font-size:13px; border:1px solid #d1d9e0; border-radius:6px; max-width:300px; }
.pv-btn { padding:10px 22px; background:var(--pv-theme); color:#fff; border:none; border-radius:6px; font-size:14px; font-weight:700; cursor:pointer; }
.pv-btn-outline { padding:6px 14px; background:#fff; color:#6c757d; border:1px solid #6c757d; border-radius:6px; font-size:13px; cursor:pointer; }
.pv-clear { font-size:13px; color:#6b7280; }
.pv-code { font-size:12px; font-weight:400; color:#9ca3af; }
.kpi-value.kpi-value-sm { font-size:17px; }
.pv-spotlight { margin-bottom:24px; }
.pv-spotlight-head { font-size:13px; font-weight:700; color:#111827; margin-bottom:10px; }
.pv-row { display:grid; gap:24px; margin-bottom:24px; }
.pv-row-8-4 { grid-template-columns:2fr 1fr; }
.pv-row-6-6 { grid-template-columns:1fr 1fr; }
.pv-row-12 { grid-template-columns:1fr; }
.pv-row > .pv-card { margin-bottom:0; min-width:0; }
@media (max-width:991px) { .pv-row-8-4, .pv-row-6-6 { grid-template-columns:1fr; } }
.chart-wrap.chart-xtall { min-height:460px; }
.chart-wrap.chart-pcn { min-height:260px; }
.pv-ind-row { margin-bottom:14px; }
.pv-ind-label { font-size:13px; font-weight:600; color:#111827; margin-right:8px; }
.pv-exports { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pv-count { font-size:12px; color:#999; }
.pv-ico { width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.pv-filterwrap { padding:14px 24px 6px; }
.pv-filter-form { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.pv-nil { color:#ccc; }
.pv-empty { background:#f8f9fa; border:1px solid #eee; border-radius:6px; text-align:center; padding:40px 24px; margin-bottom:24px; }
.pv-empty p { font-size:15px; color:#999; margin:0; }
.pv-warn { background:#fff3cd; border:1px solid #ffc107; border-radius:6px; padding:14px 18px; margin-bottom:24px; font-size:13px; color:#664d03; }
.pv-source { background:#f0f4ff; border-left:4px solid var(--pv-theme); border-radius:0 6px 6px 0; padding:14px 18px; font-size:12px; color:#4b5563; margin-top:8px; }
.pv-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.detail-table-wrap, .pv-card { position:relative; }
#pcn-chart-section[hidden] { display:none; }
.pv-basis { font-size:12px; color:#6b7c85; margin:10px 0 24px; }
.pv-basis p { margin:0; }
.pv-basis ul { margin:6px 0 0; padding-left:18px; }
.pv-basis li { margin:2px 0; }
