/**
 * Todo el Día — modo oscuro (html[data-theme="dark"]).
 * Carga después de las hojas de página; complementa variables en estilos_globales.css.
 */

html[data-theme="dark"] .td-app-main {
    background: var(--td-page-bg) !important;
}

/* --- Tarjetas compartidas (rutas / panel salud / home) --- */
html[data-theme="dark"] .rutas-prox-sc__card {
    background: linear-gradient(135deg, #1e293b 0%, #172033 55%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .rutas-prox-sc__title {
    color: #f1f5f9;
}

html[data-theme="dark"] .rutas-prox-sc__kicker {
    color: #fb923c;
}

html[data-theme="dark"] .rutas-prox-sc__badge {
    background: #334155;
    border-color: #475569;
    color: #fdba74;
}

html[data-theme="dark"] .rutas-prox-sc__deco {
    color: rgba(251, 146, 60, 0.12);
}

html[data-theme="dark"] .panel-salud-sc__card {
    background: linear-gradient(145deg, #1e293b 0%, #172033 45%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .panel-salud-sc__title {
    color: #e2e8f0;
}

html[data-theme="dark"] .panel-salud-sc__kicker {
    color: #94a3b8;
}

html[data-theme="dark"] .farm-sc-page {
    background: var(--td-page-bg);
}

html[data-theme="dark"] .farm-sc-lead,
html[data-theme="dark"] .farm-sc-lead--muted {
    color: #94a3b8;
}

html[data-theme="dark"] .col-sc-ambient {
    opacity: 0.22;
}

html[data-theme="dark"] .rutas-prox-sc[data-col-hero="1"] .rutas-prox-sc__card {
    background: linear-gradient(150deg, #1e293b 0%, #172033 62%, #0f172a 100%);
    border-color: #475569;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .rutas-prox-sc[data-col-hero="1"] .rutas-prox-sc__kicker {
    color: #fb923c;
}

html[data-theme="dark"] .rutas-prox-sc[data-col-hero="1"] .rutas-prox-sc__badge {
    background: #334155;
    border-color: #64748b;
    color: #fdba74;
}

/* --- noticias_flash (home) --- */
html[data-theme="dark"] .flash-sc__card {
    background: linear-gradient(135deg, #1e293b 0%, #172033 55%, #0f172a 100%);
    border-color: #334155;
}

html[data-theme="dark"] .flash-sc__titulo {
    color: #f1f5f9;
}

html[data-theme="dark"] .flash-sc__item {
    border-top-color: #334155;
}

html[data-theme="dark"] .flash-sc__thumb img {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .flash-sc__kicker {
    color: #94a3b8;
}

html[data-theme="dark"] .flash-sc__admin-panel,
html[data-theme="dark"] .flash-sc__edit {
    background: rgba(30, 41, 59, 0.92);
    border-color: #475569;
    color: #fdba74;
}

html[data-theme="dark"] .flash-sc__admin-inline {
    color: #fdba74;
}

/* --- proximos_eventos / muni / funebres / emergencias (home) --- */
html[data-theme="dark"] .proximos-ev-sc__card,
html[data-theme="dark"] .muni-svc-sc__card,
html[data-theme="dark"] .funer-sc__card,
html[data-theme="dark"] .central-em-sc__card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

html[data-theme="dark"] .proximos-ev-sc__title,
html[data-theme="dark"] .muni-svc-sc__title,
html[data-theme="dark"] .funer-sc__title,
html[data-theme="dark"] .central-em-sc__title {
    color: #f1f5f9;
}

html[data-theme="dark"] .proximos-ev-sc__kicker {
    color: #7dd3fc;
}

html[data-theme="dark"] .muni-svc-sc__kicker,
html[data-theme="dark"] .funer-sc__kicker,
html[data-theme="dark"] .central-em-sc__kicker {
    color: #94a3b8;
}

html[data-theme="dark"] .muni-svc-sc__svc-name,
html[data-theme="dark"] .funer-sc__item {
    color: #cbd5e1;
}

/* Próximos eventos: jerarquía y contraste en oscuro */
html[data-theme="dark"] .proximos-ev-sc__nombre {
    color: #f8fafc !important;
}

html[data-theme="dark"] .proximos-ev-sc__item:not(.proximos-ev-sc__item--hoy) .proximos-ev-sc__nombre {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .proximos-ev-sc__meta {
    color: #bae6fd !important;
}

html[data-theme="dark"] .proximos-ev-sc__item:not(.proximos-ev-sc__item--hoy) .proximos-ev-sc__meta {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .proximos-ev-sc__meta i {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .proximos-ev-sc__item:not(.proximos-ev-sc__item--hoy) .proximos-ev-sc__meta i {
    color: #64748b !important;
}

html[data-theme="dark"] .proximos-ev-sc__item {
    border-top-color: rgba(56, 189, 248, 0.22) !important;
}

html[data-theme="dark"] .proximos-ev-sc__item--hoy {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12) inset;
}

html[data-theme="dark"] .proximos-ev-sc__datebox {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: none;
}

html[data-theme="dark"] .proximos-ev-sc__datebox-d {
    color: #e0f2fe !important;
}

html[data-theme="dark"] .proximos-ev-sc__datebox-m {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .proximos-ev-sc__chev {
    color: rgba(56, 189, 248, 0.38);
}

html[data-theme="dark"] .proximos-ev-sc__cta {
    color: #7dd3fc !important;
    border-top-color: rgba(56, 189, 248, 0.28) !important;
}

html[data-theme="dark"] .proximos-ev-sc__cta i {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .proximos-ev-sc__empty-msg {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .proximos-ev-sc__rango-fechas,
html[data-theme="dark"] .proximos-ev-sc__fecha-tag {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .proximos-ev-sc__item:not(.proximos-ev-sc__item--hoy) .proximos-ev-sc__rango-fechas {
    color: #93c5fd !important;
}

html[data-theme="dark"] .proximos-ev-sc__sep {
    color: #64748b !important;
}

html[data-theme="dark"] .proximos-ev-sc__card::before {
    opacity: 0.78;
}

html[data-theme="dark"] .proximos-ev-sc__pill {
    background: #0369a1;
    color: #f0f9ff;
}

/* Movilidad / ofertas (home) */
html[data-theme="dark"] .mov-of-sc {
    color: #e2e8f0;
}

html[data-theme="dark"] .mov-of-sc__kicker {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .mov-of-sc__title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .mov-of-sc__label {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .mov-of-sc__meta {
    color: #94a3b8 !important;
}

/* Central emergencias: números y etiquetas legibles sobre fondo oscuro */
html[data-theme="dark"] .central-em-sc__tile-num {
    color: #f8fafc !important;
}

html[data-theme="dark"] .central-em-sc__tile-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .central-em-sc__tile-call {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* --- ver_noticias --- */
html[data-theme="dark"] .card-noticia.standard {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .card-noticia.standard .titulo {
    color: #f1f5f9;
}

html[data-theme="dark"] .card-noticia.standard .extracto {
    color: #94a3b8;
}

html[data-theme="dark"] .section-title h3 {
    color: #f1f5f9;
}

/* --- transporte_ver --- */
html[data-theme="dark"] .next-box,
html[data-theme="dark"] .search-card,
html[data-theme="dark"] .share-card,
html[data-theme="dark"] .ticket,
html[data-theme="dark"] .day-accordion {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .brand-header h1,
html[data-theme="dark"] .brand-header p,
html[data-theme="dark"] .next-route,
html[data-theme="dark"] .next-title {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .brand-header h1 span {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .next-item {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .search-input-wrap {
    border-color: #334155 !important;
}

html[data-theme="dark"] .search-input-wrap input {
    color: #f1f5f9 !important;
    background: transparent !important;
}

html[data-theme="dark"] .search-input-wrap:first-child {
    border-bottom-color: #334155 !important;
}

/* --- listado servicios --- */
html[data-theme="dark"] .svc-list-page {
    background: var(--td-page-bg);
}

html[data-theme="dark"] .svc-list-card {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .svc-list-card__name {
    color: #f1f5f9;
}

html[data-theme="dark"] .svc-list-card__prof {
    color: #94a3b8;
}

html[data-theme="dark"] .svc-list-hero__title {
    color: #f1f5f9;
}

html[data-theme="dark"] .svc-list-hero__lead,
html[data-theme="dark"] .svc-list-hero__kicker {
    color: #94a3b8;
}

html[data-theme="dark"] .svc-list-page .svc-list-search {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .svc-list-search__icon {
    color: #38bdf8;
}

html[data-theme="dark"] .svc-list-search__input {
    color: #f1f5f9;
}

html[data-theme="dark"] .svc-list-search__input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .svc-list-tip {
    background: linear-gradient(145deg, #1e293b 0%, #172033 100%);
    border-color: #334155;
}

html[data-theme="dark"] .svc-list-tip__txt {
    color: #cbd5e1;
}

html[data-theme="dark"] .svc-list-tip__icon-wrap {
    color: #38bdf8;
}

html[data-theme="dark"] .svc-list-tip__accent {
    color: #7dd3fc;
}

/* --- Necrológicas --- */
html[data-theme="dark"] .nec-sc-ambient {
    opacity: 0.18;
}

html[data-theme="dark"] .nec-sc-card {
    background: linear-gradient(165deg, #1e293b 0%, #172033 55%, #0f172a 100%);
    border-color: #334155;
}

html[data-theme="dark"] .nec-sc-card__name,
html[data-theme="dark"] .nec-sc-hero__title {
    color: #f1f5f9;
}

html[data-theme="dark"] .nec-sc-hero__kicker,
html[data-theme="dark"] .nec-sc-hero__lead {
    color: #94a3b8;
}

html[data-theme="dark"] .nec-sc-row {
    color: #cbd5e1;
}

/* --- Agenda (página) --- */
html[data-theme="dark"] .agenda-sc-ambient {
    opacity: 0.15;
}

html[data-theme="dark"] .agenda-sc-page .proximos-ev-sc__card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

html[data-theme="dark"] .agenda-sc-page-h1 {
    color: #f1f5f9;
}

html[data-theme="dark"] .agenda-sc-page-lead {
    color: #94a3b8;
}

html[data-theme="dark"] .agenda-sc-page-lead strong {
    color: #cbd5e1;
}

html[data-theme="dark"] .agenda-sc-eyebrow {
    color: #bae6fd;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.38) 0%, rgba(15, 23, 42, 0.92) 100%);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.22);
}

html[data-theme="dark"] .agenda-sc-head-meta {
    color: #94a3b8;
}

html[data-theme="dark"] .agenda-sc-head-meta .bi {
    color: #38bdf8;
}

html[data-theme="dark"] .agenda-ev-slot:not(.agenda-ev-slot--past) {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(56, 189, 248, 0.22);
}

html[data-theme="dark"] .agenda-ev-slot__fecha {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .agenda-ev-slot__hora {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .agenda-ev-slot__lug,
html[data-theme="dark"] .agenda-ev-slot__det {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .proximos-ev-sc__item--hoy .agenda-ev-slot:not(.agenda-ev-slot--past) {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(56, 189, 248, 0.35);
}

html[data-theme="dark"] .agenda-sc-hero-title,
html[data-theme="dark"] .agenda-sc-hero-sub {
    color: #e2e8f0;
}

html[data-theme="dark"] .agenda-ev-desc {
    color: #94a3b8;
}

html[data-theme="dark"] .agenda-ev-past-label span {
    background: rgba(30, 41, 59, 0.9);
    border-color: #475569;
    color: #94a3b8;
}

html[data-theme="dark"] .agenda-ev-slot.agenda-ev-slot--past {
    background: rgba(15, 23, 42, 0.75);
    border-color: #334155;
}

html[data-theme="dark"] .agenda-ev-slot__badge-realizado {
    background: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .agenda-ev-slot--past .agenda-ev-slot__hora,
html[data-theme="dark"] .agenda-ev-slot--past .agenda-ev-slot__fecha {
    color: #94a3b8;
}

/* --- Cronograma municipal --- */
html[data-theme="dark"] .muni-svc-page {
    background: var(--td-page-bg);
}

html[data-theme="dark"] .muni-svc-sc--detail .muni-svc-sc__card {
    background: linear-gradient(165deg, #1e293b 0%, #172033 42%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .muni-svc-sc--detail .muni-svc-sc__deco {
    color: rgba(148, 163, 184, 0.08);
}

/* --- Clima --- */
html[data-theme="dark"] body.clima-page {
    background: var(--td-page-bg) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.clima-page .bloque-dia-completo,
html[data-theme="dark"] body.clima-page .card-pronostico,
html[data-theme="dark"] body.clima-page .pronostico-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.clima-page .clima-section-head {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.clima-page .btn-share-weather {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body.clima-page .resumen-texto-integrado,
html[data-theme="dark"] body.clima-page .frase-clima {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.clima-page .pron-tmax {
    color: #f1f5f9 !important;
}

/* --- Detalle noticia --- */
html[data-theme="dark"] .article-content {
    background: var(--td-page-bg);
    color: #e2e8f0;
}

html[data-theme="dark"] .article-content .texto-principal,
html[data-theme="dark"] .article-content .extracto-box,
html[data-theme="dark"] .article-content p {
    color: #cbd5e1;
}

html[data-theme="dark"] .article-content h1 {
    color: #f1f5f9;
}

html[data-theme="dark"] .rel-section {
    background: #0f172a;
}

html[data-theme="dark"] .rel-item {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .btn-volver-flotante {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #f1f5f9 !important;
}

/* --- Novedades urgentes --- */
html[data-theme="dark"] .novedad-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .main-header h1 {
    color: #f1f5f9 !important;
}

/* --- Perfil profesional --- */
html[data-theme="dark"] .card-header {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .info-top h1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .prof-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .seccion {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .text-sec {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .bloque-ayuda {
    background: #0f172a !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .btn-volver-atras {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .central-em-sc__tile {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
}

/* --- Login admin (sin cabecera con interruptor) --- */
html[data-theme="dark"] .login-card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* --- Guía comercial --- */
html[data-theme="dark"] .td-com-hero__title,
html[data-theme="dark"] .td-com-card__name,
html[data-theme="dark"] .td-com-detail__title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .td-com-hero__lead,
html[data-theme="dark"] .td-com-card__meta,
html[data-theme="dark"] .td-com-detail__desc {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .td-com-card,
html[data-theme="dark"] .td-com-chip {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .td-com-card--destacado {
    background: linear-gradient(155deg, #1e293b 0%, #1e1b4b 55%, #312e81 100%) !important;
    border-color: #4338ca !important;
}

html[data-theme="dark"] .td-com-filters {
    background: linear-gradient(145deg, #1e293b 0%, #1e1b4b 100%) !important;
    border-color: #4338ca !important;
}

html[data-theme="dark"] .td-com-filters input[type="search"],
html[data-theme="dark"] .td-com-filters select {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .td-com-empty {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .td-com-back {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
