/* =========================================================================
   PowerNutri — Dark theme global (overrides)
   Se activa con body.pn-theme-dark (toggle del sidebar concept).
   Cubre superficies principales de la app: Bootstrap 3, componentes pn-,
   plugins (select2, datetimepicker, jquery-ui). El sidebar concept tiene
   su propio tema y NO se toca acá.
   Nota: estilos inline (style="...") no se pueden sobrescribir con CSS.
   ========================================================================= */

body.pn-theme-dark {
    --d-bg: #0e1714;
    --d-surface: #16211d;
    --d-surface-2: #1d2b26;
    --d-elevated: #223129;
    --d-line: rgba(194, 255, 221, .12);
    --d-text: #e8f3ed;
    --d-muted: #9fb3aa;
    --d-green: #72ffb8;
    --d-accent: #4abe80;

    background: var(--d-bg) !important;
    color: var(--d-text);
}

/* ---- Estructura general ---- */
body.pn-theme-dark .body-content { background-color: var(--d-bg) !important; }
body.pn-theme-dark .main-content-with-sidebar { color: var(--d-text); }

body.pn-theme-dark .main-content-with-sidebar h1,
body.pn-theme-dark .main-content-with-sidebar h2,
body.pn-theme-dark .main-content-with-sidebar h3,
body.pn-theme-dark .main-content-with-sidebar h4,
body.pn-theme-dark .main-content-with-sidebar h5,
body.pn-theme-dark .main-content-with-sidebar h6,
body.pn-theme-dark .main-content-with-sidebar label,
body.pn-theme-dark .main-content-with-sidebar p,
body.pn-theme-dark .main-content-with-sidebar span,
body.pn-theme-dark .main-content-with-sidebar li,
body.pn-theme-dark .main-content-with-sidebar dt,
body.pn-theme-dark .main-content-with-sidebar dd { color: var(--d-text); }

body.pn-theme-dark .main-content-with-sidebar a { color: var(--d-green); }

/* Títulos de ABM */
body.pn-theme-dark .titulo-ABM,
body.pn-theme-dark .titulo-ABM-2 { color: var(--d-green) !important; background-color: transparent !important; }

/* ---- Cards / paneles Bootstrap 3 ---- */
body.pn-theme-dark .panel,
body.pn-theme-dark .panel-default,
body.pn-theme-dark .well,
body.pn-theme-dark .card {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text);
}
body.pn-theme-dark .panel-heading {
    background-color: var(--d-elevated) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .panel-body,
body.pn-theme-dark .panel-footer { background-color: var(--d-surface) !important; color: var(--d-text); }

/* ---- Componentes pn- ---- */
body.pn-theme-dark .pn-card,
body.pn-theme-dark .pn-filter-bar {
    background: var(--d-surface) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35) !important;
    color: var(--d-text);
}
body.pn-theme-dark .pn-card-title { color: var(--d-text) !important; border-bottom-color: var(--d-line) !important; }
body.pn-theme-dark .pn-page-header-title h1 { color: var(--d-text) !important; }
body.pn-theme-dark .pn-empty-state,
body.pn-theme-dark .pn-empty-state h3,
body.pn-theme-dark .pn-empty-state p { color: var(--d-muted) !important; }
body.pn-theme-dark .pn-filter-group label { color: var(--d-muted) !important; }

/* ---- Tablas ---- */
body.pn-theme-dark .table,
body.pn-theme-dark table { color: var(--d-text); }
body.pn-theme-dark .table > thead > tr > th,
body.pn-theme-dark .table > tbody > tr > th,
body.pn-theme-dark .table > tfoot > tr > th,
body.pn-theme-dark .table > thead > tr > td,
body.pn-theme-dark .table > tbody > tr > td,
body.pn-theme-dark .table > tfoot > tr > td {
    border-color: var(--d-line) !important;
    color: var(--d-text);
}
body.pn-theme-dark .table > thead > tr > th { background-color: var(--d-elevated) !important; }
body.pn-theme-dark .table-striped > tbody > tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, .03) !important; }
body.pn-theme-dark .table-hover > tbody > tr:hover { background-color: rgba(114, 255, 184, .06) !important; }
body.pn-theme-dark .table-bordered,
body.pn-theme-dark .table-bordered > tbody > tr > td,
body.pn-theme-dark .table-bordered > thead > tr > th { border-color: var(--d-line) !important; }

/* ---- Formularios ---- */
body.pn-theme-dark .main-content-with-sidebar input,
body.pn-theme-dark .main-content-with-sidebar select,
body.pn-theme-dark .main-content-with-sidebar textarea,
body.pn-theme-dark .form-control,
body.pn-theme-dark .modal input,
body.pn-theme-dark .modal select,
body.pn-theme-dark .modal textarea {
    background-color: var(--d-elevated) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .form-control::placeholder,
body.pn-theme-dark .main-content-with-sidebar input::placeholder,
body.pn-theme-dark .main-content-with-sidebar textarea::placeholder { color: var(--d-muted) !important; }
body.pn-theme-dark .form-control:focus { border-color: var(--d-accent) !important; box-shadow: 0 0 0 2px rgba(74, 190, 128, .25) !important; }
body.pn-theme-dark .input-group-addon { background-color: var(--d-elevated) !important; border-color: var(--d-line) !important; color: var(--d-muted) !important; }

/* ---- Botones genéricos ---- */
body.pn-theme-dark .btn-default {
    background-color: var(--d-elevated) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .btn-default:hover { background-color: var(--d-surface-2) !important; }
body.pn-theme-dark .btn-pn-secondary { background-color: var(--d-elevated) !important; color: var(--d-text) !important; }
body.pn-theme-dark .btn-pn-secondary:hover { background-color: var(--d-surface-2) !important; }

/* ---- Modales ---- */
body.pn-theme-dark .modal-content {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text);
}
body.pn-theme-dark .modal-header,
body.pn-theme-dark .modal-footer { border-color: var(--d-line) !important; }
body.pn-theme-dark .modal-title,
body.pn-theme-dark .pn-confirm-modal .modal-body { color: var(--d-text) !important; }
body.pn-theme-dark .close { color: var(--d-text); opacity: .8; text-shadow: none; }

/* ---- Dropdowns / nav / tabs / list-group ---- */
body.pn-theme-dark .dropdown-menu {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
}
body.pn-theme-dark .dropdown-menu > li > a { color: var(--d-text) !important; }
body.pn-theme-dark .dropdown-menu > li > a:hover { background-color: var(--d-elevated) !important; }
body.pn-theme-dark .nav-tabs { border-bottom-color: var(--d-line) !important; }
body.pn-theme-dark .nav-tabs > li > a { color: var(--d-muted) !important; }
body.pn-theme-dark .nav-tabs > li.active > a,
body.pn-theme-dark .nav-tabs > li.active > a:hover {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) var(--d-line) transparent !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .list-group-item {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text);
}

/* ---- Paginación ---- */
body.pn-theme-dark .pagination > li > a,
body.pn-theme-dark .pagination > li > span {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .pagination > .active > a,
body.pn-theme-dark .pagination > .active > span { background-color: var(--d-accent) !important; border-color: var(--d-accent) !important; color: #06241a !important; }

/* ---- Detalles con fondo claro hardcodeado ---- */
body.pn-theme-dark .detail-h3,
body.pn-theme-dark .detail-plan-h4 { background-color: var(--d-surface) !important; color: var(--d-text) !important; }

/* ============================ Plugins ============================ */
/* select2 */
body.pn-theme-dark .select2-container--default .select2-selection--single,
body.pn-theme-dark .select2-container--default .select2-selection--multiple,
body.pn-theme-dark .select2-dropdown {
    background-color: var(--d-elevated) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--d-text) !important; }
body.pn-theme-dark .select2-results__option { color: var(--d-text); }
body.pn-theme-dark .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--d-accent) !important; color: #06241a !important; }
body.pn-theme-dark .select2-search__field { background-color: var(--d-surface) !important; color: var(--d-text) !important; }

/* chosen */
body.pn-theme-dark .chosen-single,
body.pn-theme-dark .chosen-drop,
body.pn-theme-dark .chosen-results { background: var(--d-elevated) !important; border-color: var(--d-line) !important; color: var(--d-text) !important; }
body.pn-theme-dark .chosen-results li.highlighted { background: var(--d-accent) !important; color: #06241a !important; }

/* bootstrap-datetimepicker */
body.pn-theme-dark .bootstrap-datetimepicker-widget {
    background-color: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .bootstrap-datetimepicker-widget table td,
body.pn-theme-dark .bootstrap-datetimepicker-widget table th { color: var(--d-text) !important; }
body.pn-theme-dark .bootstrap-datetimepicker-widget table td.day:hover,
body.pn-theme-dark .bootstrap-datetimepicker-widget table td.active { background-color: var(--d-accent) !important; color: #06241a !important; }

/* jquery-ui datepicker / widgets */
body.pn-theme-dark .ui-widget-content,
body.pn-theme-dark .ui-datepicker {
    background: var(--d-surface) !important;
    border-color: var(--d-line) !important;
    color: var(--d-text) !important;
}
body.pn-theme-dark .ui-datepicker .ui-datepicker-header { background: var(--d-elevated) !important; color: var(--d-text) !important; border-color: var(--d-line) !important; }
body.pn-theme-dark .ui-state-default,
body.pn-theme-dark .ui-widget-content .ui-state-default { background: var(--d-elevated) !important; color: var(--d-text) !important; border-color: var(--d-line) !important; }
body.pn-theme-dark .ui-state-active,
body.pn-theme-dark .ui-widget-content .ui-state-active { background: var(--d-accent) !important; color: #06241a !important; }

/* ---- Spinner overlay ---- */
body.pn-theme-dark #spinner { background-color: rgba(8, 16, 13, .7) !important; }

/* ---- Scrollbars ---- */
body.pn-theme-dark ::-webkit-scrollbar-thumb { background: rgba(114, 255, 184, .2); }
body.pn-theme-dark ::-webkit-scrollbar-track { background: var(--d-bg); }

/* ============================ PowerTrack® / HabitosTracker ============================ */
body.pn-theme-dark .ht-wrap { background: var(--d-bg) !important; }

/* Topbar */
body.pn-theme-dark .ht-topbar h1 { color: var(--d-text); }
body.pn-theme-dark .ht-overline { color: var(--d-green); }

/* Buttons */
body.pn-theme-dark .ht-btn { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .ht-btn:hover { background: var(--d-surface-2); }
body.pn-theme-dark .ht-btn-primary { background: var(--d-accent); border-color: var(--d-accent); color: #06241a; }
body.pn-theme-dark .ht-btn-primary:hover { background: var(--d-green); border-color: var(--d-green); color: #06241a; }
body.pn-theme-dark .ht-btn-date span { color: var(--d-muted); }
body.pn-theme-dark .ht-btn-date strong { color: var(--d-text); }
body.pn-theme-dark .ht-autosave { color: var(--d-muted); }

/* View tabs */
body.pn-theme-dark .ht-view-tabs { border-bottom-color: var(--d-line); }
body.pn-theme-dark .ht-view-tabs button { color: var(--d-muted); }
body.pn-theme-dark .ht-view-tabs button:hover { color: var(--d-text); }
body.pn-theme-dark .ht-view-tabs button.active { color: var(--d-green); border-bottom-color: var(--d-green); }
body.pn-theme-dark .ht-view-tabs button b { background: rgba(114,255,184,.12); color: var(--d-green); }
body.pn-theme-dark .ht-view-tabs .ht-report-tab em { background: var(--d-accent); color: #06241a; }

/* Cards */
body.pn-theme-dark .ht-card { background: var(--d-surface) !important; border-color: var(--d-line) !important; }

/* Blocker alert */
body.pn-theme-dark .ht-blocker-alert { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); border-left-color: #f59e0b; }
body.pn-theme-dark .ht-blocker-alert.clear { background: rgba(114,255,184,.06); border-color: var(--d-line); border-left-color: var(--d-accent); }
body.pn-theme-dark .ht-blocker-alert > div:nth-child(2) strong { color: var(--d-text); }
body.pn-theme-dark .ht-blocker-alert > div:nth-child(2) p { color: var(--d-muted); }
body.pn-theme-dark .ht-blocker-alert > div:nth-child(2) span { color: #f59e0b; }
body.pn-theme-dark .ht-blocker-alert.clear > div:nth-child(2) span { color: var(--d-green); }
body.pn-theme-dark .ht-btn-register-blocker { border-color: rgba(245,158,11,.4) !important; color: #f59e0b !important; }
body.pn-theme-dark #htGoToBlockers { border-color: var(--d-line) !important; color: var(--d-muted) !important; }

/* Section head */
body.pn-theme-dark .ht-section-head h2 { color: var(--d-text); }

/* Filters */
body.pn-theme-dark .ht-filters button { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-muted); }
body.pn-theme-dark .ht-filters button.active { background: var(--d-accent); border-color: var(--d-accent); color: #06241a; }
body.pn-theme-dark .ht-filters button span { background: var(--d-surface-2); color: var(--d-muted); }

/* Habit list */
body.pn-theme-dark .ht-habit { background: var(--d-surface-2); border-color: var(--d-line); }
body.pn-theme-dark .ht-habit:hover { background: var(--d-elevated); border-color: rgba(114,255,184,.25); }
body.pn-theme-dark .ht-habit.done { background: rgba(114,255,184,.06); border-color: rgba(114,255,184,.2); }
body.pn-theme-dark .ht-habit h3 { color: var(--d-text); }
body.pn-theme-dark .ht-habit p  { color: var(--d-muted); }
body.pn-theme-dark .ht-check { background: var(--d-elevated); border-color: var(--d-line); }
body.pn-theme-dark .ht-habit.done .ht-check { background: var(--d-accent); border-color: var(--d-accent); }
body.pn-theme-dark .ht-habit-origin span { background: var(--d-elevated); color: var(--d-muted); border-color: var(--d-line); }
body.pn-theme-dark .ht-btn-blocker { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #f59e0b; }
body.pn-theme-dark .ht-btn-edit-habit { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-muted); }
body.pn-theme-dark .ht-habit-meta span { background: var(--d-elevated); color: var(--d-muted); }
body.pn-theme-dark .ht-habit-meta strong { color: var(--d-text); }
body.pn-theme-dark .ht-empty-state { color: var(--d-muted); }

/* Insights */
body.pn-theme-dark .ht-insight-card { background: rgba(114,255,184,.06) !important; border-color: rgba(114,255,184,.18) !important; }
body.pn-theme-dark .ht-insight-card h3 { color: var(--d-text); }
body.pn-theme-dark .ht-insight-card p  { color: var(--d-muted); }
body.pn-theme-dark .ht-next-card strong { color: var(--d-text); }
body.pn-theme-dark .ht-next-card span   { color: var(--d-muted); }
body.pn-theme-dark .ht-next-card small  { background: rgba(245,158,11,.15); color: #f59e0b; }

/* Progress card */
body.pn-theme-dark .ht-progress-copy h2 { color: var(--d-text); }
body.pn-theme-dark .ht-progress-copy h2 strong { color: var(--d-green); }
body.pn-theme-dark .ht-progress-copy p  { color: var(--d-muted); }
body.pn-theme-dark .ht-progress-ring { background: conic-gradient(var(--d-accent) calc(var(--score) * 1%), var(--d-elevated) 0%); }
body.pn-theme-dark .ht-progress-ring > div { background: var(--d-surface); }
body.pn-theme-dark .ht-progress-ring strong { color: var(--d-green); }
body.pn-theme-dark .ht-progress-ring span   { color: var(--d-muted); }
body.pn-theme-dark .ht-streak > span { color: var(--d-muted); }
body.pn-theme-dark .ht-streak strong { color: var(--d-green); }
body.pn-theme-dark .ht-streak strong small { color: var(--d-muted); }
body.pn-theme-dark .ht-streak p { color: var(--d-muted); }

/* Week card */
body.pn-theme-dark .ht-card-head h3 { color: var(--d-text); }
body.pn-theme-dark .ht-card-head strong { color: var(--d-green); }
body.pn-theme-dark .ht-week-bars i { background: rgba(114,255,184,.2); }
body.pn-theme-dark .ht-week-bars > div.today i { background: var(--d-accent); }
body.pn-theme-dark .ht-week-bars span { color: var(--d-muted); }

/* Month view */
body.pn-theme-dark .ht-month-heading h2 { color: var(--d-text); }
body.pn-theme-dark .ht-month-heading p  { color: var(--d-muted); }
body.pn-theme-dark .ht-month-legend span { color: var(--d-muted); }
body.pn-theme-dark .ht-calendar-weekdays span { color: var(--d-muted); }
body.pn-theme-dark .ht-calendar-day { background: var(--d-surface-2); border-color: var(--d-line); }
body.pn-theme-dark .ht-calendar-day span  { color: var(--d-muted); }
body.pn-theme-dark .ht-calendar-day strong{ color: var(--d-muted); }
body.pn-theme-dark .ht-calendar-day.zero  { background: var(--d-elevated); }
body.pn-theme-dark .ht-calendar-day.low   { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.3); }
body.pn-theme-dark .ht-calendar-day.low span  { color: #f59e0b; }
body.pn-theme-dark .ht-calendar-day.mid   { background: rgba(114,255,184,.12); border-color: rgba(114,255,184,.25); }
body.pn-theme-dark .ht-calendar-day.mid span  { color: var(--d-green); }
body.pn-theme-dark .ht-calendar-day.high  { background: var(--d-accent); border-color: var(--d-green); }
body.pn-theme-dark .ht-calendar-day.high span,
body.pn-theme-dark .ht-calendar-day.high strong { color: #06241a; }
body.pn-theme-dark .ht-month-metric strong { color: var(--d-green); }
body.pn-theme-dark .ht-month-metric small  { color: var(--d-muted); }
body.pn-theme-dark .ht-month-pattern h3 { color: var(--d-text); }
body.pn-theme-dark .ht-month-pattern p  { color: var(--d-muted); }

/* Report view */
body.pn-theme-dark .ht-report-toolbar h2 { color: var(--d-text); }
body.pn-theme-dark .ht-period-selector { color: var(--d-muted); }
body.pn-theme-dark .ht-period-selector select { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .ht-patient-report { background: var(--d-surface) !important; border-color: var(--d-line) !important; }
body.pn-theme-dark .ht-report-header { border-bottom-color: var(--d-line); }
body.pn-theme-dark .ht-report-header > div:last-child small  { color: var(--d-muted); }
body.pn-theme-dark .ht-report-header > div:last-child strong { color: var(--d-text); }
body.pn-theme-dark .ht-report-intro > div:first-child span  { color: var(--d-muted); }
body.pn-theme-dark .ht-report-intro > div:first-child strong{ color: var(--d-text); }
body.pn-theme-dark .ht-report-intro > div:first-child small { color: var(--d-muted); }
body.pn-theme-dark .ht-report-score strong { color: var(--d-green); }
body.pn-theme-dark .ht-report-score-label { color: var(--d-muted); }
body.pn-theme-dark .ht-report-no-blockers { color: var(--d-muted); }
body.pn-theme-dark .ht-report-risk { background: var(--d-surface-2); border-color: var(--d-line); }
body.pn-theme-dark .ht-risk-score > span { color: var(--d-muted); }
body.pn-theme-dark .ht-risk-score small   { color: var(--d-muted); }
body.pn-theme-dark #htReportRisk[data-level="bajo"]  { color: var(--d-green); }
body.pn-theme-dark #htReportRisk[data-level="medio"] { color: #f59e0b; }
body.pn-theme-dark #htReportRisk[data-level="alto"]  { color: #ef4444; }
body.pn-theme-dark .ht-risk-explanation h3 { color: var(--d-text); }
body.pn-theme-dark .ht-risk-explanation p  { color: var(--d-muted); }
body.pn-theme-dark .ht-risk-signals > span { color: var(--d-muted); }
body.pn-theme-dark .ht-risk-signals > div span { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .ht-report-kpis > div { background: var(--d-surface-2); border-color: var(--d-line); }
body.pn-theme-dark .ht-report-kpis > div span   { color: var(--d-muted); }
body.pn-theme-dark .ht-report-kpis > div strong { color: var(--d-text); }
body.pn-theme-dark .ht-report-insights-head h3 { color: var(--d-text); }
body.pn-theme-dark .ht-report-insights-head p  { color: var(--d-muted); }
body.pn-theme-dark .ht-report-number { background: rgba(114,255,184,.15); color: var(--d-green); }
body.pn-theme-dark .ht-report-insight-grid article { background: rgba(114,255,184,.06); border-color: rgba(114,255,184,.18); }
body.pn-theme-dark .ht-report-insight-grid article span  { color: var(--d-green); }
body.pn-theme-dark .ht-report-insight-grid article strong{ color: var(--d-text); }
body.pn-theme-dark .ht-report-insight-grid article p     { color: var(--d-muted); }
body.pn-theme-dark .ht-report-section { border-top-color: var(--d-line); }
body.pn-theme-dark .ht-report-section h3 { color: var(--d-text); }
body.pn-theme-dark .ht-report-section p  { color: var(--d-muted); }
body.pn-theme-dark .ht-report-next-step { background: rgba(114,255,184,.06); border-color: rgba(114,255,184,.18); }
body.pn-theme-dark .ht-report-footer { border-top-color: var(--d-line); color: var(--d-muted); }

/* Dialog */
body.pn-theme-dark .ht-dialog { background: var(--d-surface); border-color: var(--d-line); }
body.pn-theme-dark .ht-dialog::backdrop { background: rgba(0,0,0,.6); }
body.pn-theme-dark .ht-dialog h2 { color: var(--d-text); }
body.pn-theme-dark .ht-dialog-copy { color: var(--d-muted); }
body.pn-theme-dark .ht-dialog-close { color: var(--d-muted); }
body.pn-theme-dark .ht-dialog-close:hover { background: var(--d-elevated); color: var(--d-text); }
body.pn-theme-dark .ht-dialog label { color: var(--d-muted); }
body.pn-theme-dark .ht-dialog input,
body.pn-theme-dark .ht-dialog select,
body.pn-theme-dark .ht-dialog textarea { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .ht-dialog input:focus,
body.pn-theme-dark .ht-dialog select:focus,
body.pn-theme-dark .ht-dialog textarea:focus { border-color: var(--d-accent); box-shadow: 0 0 0 2px rgba(74,190,128,.25); }
body.pn-theme-dark .ht-blocker-step > span { color: var(--d-muted); }
body.pn-theme-dark .ht-blocker-groups button { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-muted); }
body.pn-theme-dark .ht-blocker-groups button:hover { background: var(--d-surface-2); border-color: rgba(114,255,184,.25); }
body.pn-theme-dark .ht-blocker-groups button.selected { background: rgba(114,255,184,.12); border-color: var(--d-accent); color: var(--d-green); }
body.pn-theme-dark .ht-blocker-options button { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-muted); }
body.pn-theme-dark .ht-blocker-options button:hover { background: var(--d-surface-2); border-color: rgba(114,255,184,.25); }
body.pn-theme-dark .ht-blocker-options button.selected { background: var(--d-accent); border-color: var(--d-accent); color: #06241a; }

/* ============================ Estadísticas de turnos (panel de decisión) ============================
   Página self-contained (prefijo est-, sin switch de tema propio) — ver EstadisticasTurnos.css.
   Reusa las variables --d-* ya definidas arriba; --est-orange/--est-red se hardcodean porque no
   hay variable de alerta/riesgo definida en el sistema (mismo criterio que .ht-blocker-alert).
   Se redefinen en body.pn-theme-dark (no en .est-wrap) porque el dialog y el toast del panel
   NO son descendientes de .est-wrap en el DOM y necesitan heredar las mismas variables. */
body.pn-theme-dark {
    --est-bg: var(--d-bg);
    --est-panel: var(--d-surface);
    --est-panel-solid: var(--d-surface-2);
    --est-line: var(--d-line);
    --est-text: var(--d-text);
    --est-muted: var(--d-muted);
    --est-green: var(--d-green);
    --est-cyan: #52dfd0;
    --est-violet: #9d78ff;
    --est-orange: #ffb86b;
    --est-red: #ff8c76;
}
body.pn-theme-dark .est-topbar select { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .est-signal-bar { background: linear-gradient(90deg, rgba(114,255,184,.1), rgba(114,255,184,.02)); border-color: rgba(114,255,184,.28); }
body.pn-theme-dark .est-signal-bar.alert { background: linear-gradient(90deg, rgba(255,184,107,.14), rgba(255,184,107,.02)); border-color: rgba(255,184,107,.32); }
body.pn-theme-dark .est-panel,
body.pn-theme-dark .est-decision-card,
body.pn-theme-dark .est-action-card,
body.pn-theme-dark .est-channel-card,
body.pn-theme-dark .est-year-card,
body.pn-theme-dark .est-action-list .item { background: var(--d-surface-2); border-color: var(--d-line); }
body.pn-theme-dark .est-risk-item { background: rgba(255,184,107,.08); border-color: rgba(255,184,107,.3); }
body.pn-theme-dark .est-table thead th,
body.pn-theme-dark .est-table tbody th { background: var(--d-elevated); }
body.pn-theme-dark .est-table td.selected { background: rgba(114,255,184,.1); }
body.pn-theme-dark .est-raw-controls button { background: var(--d-elevated); border-color: var(--d-line); color: var(--d-muted); }
body.pn-theme-dark .est-raw-controls button.active { background: var(--d-accent); color: #06241a; }
body.pn-theme-dark .est-dialog { background: var(--d-surface-2); border-color: var(--d-line); color: var(--d-text); }
body.pn-theme-dark .est-dialog::backdrop { background: rgba(2,8,6,.75); }
body.pn-theme-dark .est-toast { background: var(--d-surface-2); border-color: rgba(114,255,184,.3); color: var(--d-green); }
