.theme-toggle{display:grid;place-items:center;position:sticky;top:8px;z-index:30;flex:0 0 46px;width:46px;height:46px;margin-left:auto;border:1px solid #c8dae3;border-radius:50%;background:#eef5f9;color:#173b52;font:800 23px/1 Arial,sans-serif;box-shadow:0 4px 12px #123a5522;cursor:pointer}.theme-toggle:active{transform:scale(.94)}
html[data-theme=dark]{color-scheme:dark;background:#0b1620}html[data-theme=dark] body,html[data-theme=dark] .phone-shell{background:#0b1620!important;color:#e8f0f4}html[data-theme=dark] header,html[data-theme=dark] nav{background:#101d29!important;border-color:#273a49!important}html[data-theme=dark] header strong,html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] b{color:#edf6f8}html[data-theme=dark] header small,html[data-theme=dark] .eyebrow,html[data-theme=dark] .login-copy,html[data-theme=dark] .empty,html[data-theme=dark] small,html[data-theme=dark] em{color:#aabcc7!important}html[data-theme=dark] .theme-toggle{border-color:#476174;background:#203545;color:#ffdc7a;box-shadow:none}html[data-theme=dark] .profile,html[data-theme=dark] .logout{border-color:#476174;background:#1a2c3a;color:#e8f0f4}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{border-color:#3b5364!important;background:#142432!important;color:#edf6f8!important}html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#8fa4b1!important}html[data-theme=dark] label{color:#bfd0d9!important}
html[data-theme=dark] .client,html[data-theme=dark] .weekly-day,html[data-theme=dark] .near,html[data-theme=dark] .cash-filters,html[data-theme=dark] .cash-date-filter,html[data-theme=dark] .settings-card,html[data-theme=dark] .client-contact-card,html[data-theme=dark] .collector-expense-card,html[data-theme=dark] .expense-hero,html[data-theme=dark] .route-item,html[data-theme=dark] .user-order-item,html[data-theme=dark] .report-detail-item,html[data-theme=dark] .renewal-client-summary{border-color:#304b5b!important;background:#142432!important;color:#e8f0f4!important;box-shadow:none!important}html[data-theme=dark] .balance{background:linear-gradient(135deg,#102b3d,#0d4c46)!important;box-shadow:none!important}html[data-theme=dark] .cards button,html[data-theme=dark] .range button,html[data-theme=dark] #close-detail,html[data-theme=dark] .client-search-button+button{border-color:#3b5364!important;background:#1b3040!important;color:#e1eef2!important;box-shadow:none!important}html[data-theme=dark] .range button.selected-list,html[data-theme=dark] .range button.selected,html[data-theme=dark] .wide,html[data-theme=dark] .login-button{background:#087c5b!important;color:#fff!important}html[data-theme=dark] .client{border-left-color:#167f61!important}html[data-theme=dark] .client strong,html[data-theme=dark] .weekly-day-toggle{color:#6be0af!important}html[data-theme=dark] .client-search-empty{color:#aabcc7!important}
html[data-theme=dark] dialog{border:1px solid #344f61!important;background:#101d29!important;color:#edf6f8!important;box-shadow:0 20px 60px #000b!important}html[data-theme=dark] dialog::backdrop{background:#000b}html[data-theme=dark] .client-contact-actions a,html[data-theme=dark] .collector-expense-edit{border-color:#3a5864!important;background:#1d3842!important;color:#81e2bb!important}html[data-theme=dark] .settings-icon,html[data-theme=dark] .expense-form-heading>span,html[data-theme=dark] .expense-list-heading span{background:#1d3e40!important;color:#77e3b5!important}html[data-theme=dark] .client-avatar{border-color:#32635b!important;background:#1c443d!important}html[data-theme=dark] nav button{color:#a9bdc7!important}html[data-theme=dark] nav button.selected{color:#61dbab!important}
html[data-theme=dark] #detail-content p{background:#142432!important;color:#e8f0f4!important;box-shadow:none!important}html[data-theme=dark] #detail-content p b{color:#6be0af!important}html[data-theme=dark] .client-identity-card{border-color:#32635b!important;background:#16352f!important;color:#e8f0f4!important}html[data-theme=dark] .client-identity-card span{color:#79e3b9!important}html[data-theme=dark] .client-identity-card b{color:#fff!important}html[data-theme=dark] #detail-dialog #close-detail{border-color:#3b5364!important;background:#1b3040!important;color:#edf6f8!important;box-shadow:none!important}html[data-theme=dark] .settings-grid .settings-card{border-color:#304b5b!important;background:#142432!important;color:#edf6f8!important;box-shadow:none!important}html[data-theme=dark] .settings-grid .settings-card small{color:#aabcc7!important}html[data-theme=dark] .payment-client-summary,html[data-theme=dark] .payment-client-details,html[data-theme=dark] .client-photo-field,html[data-theme=dark] .photo-slot,html[data-theme=dark] .photo-manager-card,html[data-theme=dark] .edit-client-photo-tools{border-color:#304b5b!important;background:#142432!important;color:#e8f0f4!important}html[data-theme=dark] .payment-client-summary small,html[data-theme=dark] .client-photo-field small,html[data-theme=dark] .photo-slot small,html[data-theme=dark] .photo-manager-card small{color:#aabcc7!important}
@media(max-width:520px){.theme-toggle{position:fixed;top:12px;right:74px;width:42px;height:42px;z-index:100;font-size:21px}.phone-shell header{padding-right:122px!important}.phone-shell header .profile{margin-left:0!important}}

/* Superficies que se agregan desde ventanas, reportes y configuraciones.
   Todas usan el mismo fondo oscuro y texto legible: ningún bloque claro
   puede conservar texto claro al activar modo noche. */
html[data-theme=dark] #detail-dialog,
html[data-theme=dark] #detail-content,
html[data-theme=dark] #installments-dialog,
html[data-theme=dark] #payment-record-dialog,
html[data-theme=dark] .close-report-dialog,
html[data-theme=dark] .route-map-dialog,
html[data-theme=dark] .micro-box,
html[data-theme=dark] .collector-close-screen,
html[data-theme=dark] .report-filter-panel,
html[data-theme=dark] .backup-download-dialog{background:#101d29!important;color:#edf6f8!important}
html[data-theme=dark] #detail-content p,
html[data-theme=dark] #payment-record-dialog article,
html[data-theme=dark] #payment-record-dialog .record-credit,
html[data-theme=dark] #route-list .route-client,
html[data-theme=dark] #user-order-list .user-order-row,
html[data-theme=dark] .closure-modes button,
html[data-theme=dark] .closure-row,
html[data-theme=dark] .report-toggle,
html[data-theme=dark] .collector-close-summary article,
html[data-theme=dark] .collector-close-details,
html[data-theme=dark] .collector-close-actions,
html[data-theme=dark] .micro-totals div,
html[data-theme=dark] .micro-box form,
html[data-theme=dark] .route-map-filters,
html[data-theme=dark] .backup-download-mode,
html[data-theme=dark] .backup-manager-list,
html[data-theme=dark] .backup-manager-choice{background:#142432!important;border-color:#304b5b!important;color:#e8f0f4!important;box-shadow:none!important}
html[data-theme=dark] #detail-content p *,
html[data-theme=dark] #payment-record-dialog article *,
html[data-theme=dark] #payment-record-dialog .record-credit *,
html[data-theme=dark] #route-list .route-client *,
html[data-theme=dark] #user-order-list .user-order-row *,
html[data-theme=dark] .closure-modes button *,
html[data-theme=dark] .closure-row *,
html[data-theme=dark] .report-toggle *,
html[data-theme=dark] .collector-close-summary article *,
html[data-theme=dark] .collector-close-details *,
html[data-theme=dark] .collector-close-actions *,
html[data-theme=dark] .micro-totals div *,
html[data-theme=dark] .micro-box form *,
html[data-theme=dark] .route-map-filters *,
html[data-theme=dark] .backup-download-dialog *,
html[data-theme=dark] .report-filter-panel *{color:inherit!important}
html[data-theme=dark] #detail-content p b,
html[data-theme=dark] .micro-box h2,
html[data-theme=dark] .micro-box h3,
html[data-theme=dark] .micro-totals strong,
html[data-theme=dark] .collector-close-details h2,
html[data-theme=dark] .collector-close-details p b{color:#74e0b4!important}
html[data-theme=dark] .installment-card{background:#162734!important;border-color:#395463!important;color:#e8f0f4!important}
html[data-theme=dark] .installment-card b,
html[data-theme=dark] .installment-card strong{color:#edf6f8!important}
html[data-theme=dark] .installment-card.paid{background:#143c34!important;border-color:#327d67!important}
html[data-theme=dark] .installment-card.pending{background:#423514!important;border-color:#917226!important}
html[data-theme=dark] .installment-card.paid span{color:#75e3b6!important}
html[data-theme=dark] .installment-card.pending span{color:#ffd275!important}
html[data-theme=dark] .installment-values{border-color:#395463!important}
html[data-theme=dark] .client-installments-shortcut{border-color:#327d67!important;background:#153e35!important;color:#75e3b6!important}
html[data-theme=dark] .client-name-action b{color:#8ce8c6!important}html[data-theme=dark] .client-name-action small{color:#bfd4ce!important}html[data-theme=dark] .client-details-shortcut{border-color:#327d67!important;background:#153e35!important;color:#8ce8c6!important}html[data-theme=dark] .installment-client-summary{background:#13332d!important;border-color:#327d67!important;color:#eefaf6!important}html[data-theme=dark] .installment-client-summary small{color:#bfd4ce!important}html[data-theme=dark] .installment-client-summary strong{color:#8ce8c6!important}html[data-theme=dark] .client-credit-selector button{border-color:#327d67!important;background:#153e35!important;color:#dff7ed!important}html[data-theme=dark] .client-credit-selector button small{color:#b7d8ca!important}html[data-theme=dark] .client-credit-selector button.selected-credit{background:#087c5b!important;color:#fff!important}html[data-theme=dark] .client-credit-selector button.selected-credit small{color:#d8f6e9!important}
html[data-theme=dark] .client-history-shortcut{border-color:#38698b!important;background:#142c3d!important;color:#98d6ff!important}
html[data-theme=dark] .installment-card.current-installment{border-color:#62dfb1!important;background:#14372f!important;box-shadow:0 0 0 3px #1a665255!important}
/* Organizar mi ruta usa estilos insertados junto con el botón. Estos colores
   específicos evitan texto claro sobre su fondo claro cuando se activa noche. */
html[data-theme=dark] .collector-route-button{border-color:#356557!important;background:linear-gradient(135deg,#153b35,#12302d)!important;color:#eefaf6!important;box-shadow:none!important}
html[data-theme=dark] .collector-route-button b{color:#f1fbf7!important}
html[data-theme=dark] .collector-route-button small{color:#bdd9cf!important}
html[data-theme=dark] .collector-route-icon{background:#16785e!important;color:#fff!important}
html[data-theme=dark] .collector-route-arrow{color:#89e8c3!important}
html[data-theme=dark] #route-dialog .route-dialog-icon{background:#16785e!important;color:#fff!important}
html[data-theme=dark] #route-dialog .route-number{background:#1b4a40!important;color:#94ecc8!important}
html[data-theme=dark] #route-dialog .route-client small{color:#bdd1c9!important}
html[data-theme=dark] #route-dialog .route-client input{border-color:#427264!important;background:#102925!important;color:#a0f0ce!important}
html[data-theme=dark] .close-report-dialog select,
html[data-theme=dark] .route-map-dialog select,
html[data-theme=dark] .report-filter-panel select,
html[data-theme=dark] #route-dialog #cancel-route-top,
html[data-theme=dark] .user-order-open{background:#1b3040!important;border-color:#3b5364!important;color:#e8f0f4!important}
html[data-theme=dark] .collector-close-screen{background:linear-gradient(160deg,#0b1620,#101d29 48%,#112c29)!important}
html[data-theme=dark] .collector-close-screen header,
html[data-theme=dark] .collector-close-summary article:last-child{background:linear-gradient(135deg,#0a344b,#08735e)!important}
html[data-theme=dark] #detail-content p button,
html[data-theme=dark] .closure-row button,
html[data-theme=dark] .report-share,
html[data-theme=dark] .micro-box button,
html[data-theme=dark] .route-map-go{color:#fff!important}

/* Microseguros y asignación de rutas se insertan desde módulos propios.
   Sus estilos claros originales deben quedar cubiertos también en modo noche. */
html[data-theme=dark] .micro-box{border-color:#31596a!important;background:linear-gradient(145deg,#102533,#142b38 55%,#12332d)!important;color:#edf6f8!important}
html[data-theme=dark] .micro-box header{border-color:#31596a!important;background:transparent!important}
html[data-theme=dark] .micro-box h2{color:#f2f8fa!important}
html[data-theme=dark] .micro-box header p,
html[data-theme=dark] .micro-box .micro-status{color:#c2d2da!important}
html[data-theme=dark] .micro-box .micro-badge{background:#1c4540!important;color:#9aefc9!important}
html[data-theme=dark] .micro-box .micro-toggle[aria-pressed=false]{border:1px solid #3b6d63!important;background:#183832!important;color:#b9ead5!important}
html[data-theme=dark] .micro-box label{color:#d7e4e9!important}
html[data-theme=dark] .micro-box select,
html[data-theme=dark] .micro-box input{border-color:#456473!important;background:#112332!important;color:#f1f7f9!important}
html[data-theme=dark] .micro-box .micro-totals div{border-color:#385b6b!important;background:#162b39!important;color:#c9d9e0!important}
html[data-theme=dark] .micro-box .micro-totals div[data-piggy]{border-color:#987c32!important;background:linear-gradient(145deg,#382f16,#302813)!important;color:#f2d983!important}
html[data-theme=dark] .micro-box .micro-totals strong{color:#7ee6bb!important}
html[data-theme=dark] .micro-box form{border-color:#385b6b!important;background:#142735!important;color:#edf6f8!important}

html[data-theme=dark] #supervisor-route-access{border-color:#31596a!important;background:#142735!important;color:#edf6f8!important}
html[data-theme=dark] #supervisor-route-access>b{color:#83e9ba!important}
html[data-theme=dark] #supervisor-route-access>small{color:#c0d1d9!important}
html[data-theme=dark] .supervisor-route-option{border-color:#385b6b!important;background:#1a3040!important;color:#edf6f8!important}
html[data-theme=dark] .supervisor-route-option b{color:#f1f7f9!important}
html[data-theme=dark] .supervisor-route-option small{color:#c0d1d9!important}

/* Historial de movimientos: las tarjetas conservaban fondo claro de su
   módulo propio, mientras los textos heredaban el color claro del modo noche. */
html[data-theme=dark] .audit-dialog{border-color:#344f61!important;background:#101d29!important;color:#edf6f8!important}
html[data-theme=dark] .audit-dialog>form>p,
html[data-theme=dark] .audit-dialog .audit-status{color:#b9cad3!important}
html[data-theme=dark] .audit-dialog .audit-toggle{border-color:#3a5d6e!important;background:#142b38!important;color:#edf6f8!important}
html[data-theme=dark] .audit-dialog .audit-toggle small{color:#b9cad3!important}
html[data-theme=dark] .audit-dialog .audit-results article{border-color:#395769!important;background:#162a38!important;color:#eef6f8!important;box-shadow:none!important}
html[data-theme=dark] .audit-dialog .audit-results article b{color:#8ee8c5!important}
html[data-theme=dark] .audit-dialog .audit-results article small{color:#c2d2db!important}
html[data-theme=dark] .audit-dialog .audit-results article span{color:#dce8ed!important}
html[data-theme=dark] .audit-dialog .audit-results article a{color:#8ad7ff!important}
html[data-theme=dark] #cash-detail-content .cash-payment-row,html[data-theme=dark] #cash-detail-content .cash-loan-row{border-color:#304b5b!important;border-left-color:#1ba97b!important;background:#142432!important;box-shadow:none!important}html[data-theme=dark] .cash-payment-summary b,html[data-theme=dark] .cash-loan-summary b{color:#eef7f9!important}html[data-theme=dark] .cash-payment-summary span,html[data-theme=dark] .cash-loan-summary span{color:#bed0d9!important}html[data-theme=dark] .cash-payment-summary strong,html[data-theme=dark] .cash-loan-summary strong{color:#70e1b2!important}html[data-theme=dark] .cash-payment-summary small,html[data-theme=dark] .cash-loan-summary small{color:#aabcc7!important}
