/* BECOSA Unidad 4 | v1.9.2 | Tema claro corporativo.
   UNA SOLA CAPA, cargada después de todos los estilos heredados.
   EXCLUSIVAMENTE html[data-u4-theme="light"]: modo oscuro inalterado.
   Sin transformaciones de datos, KPI, Gantt, estado ni semántica financiera. */
:root[data-u4-theme="light"] {
  color-scheme:light;
  --u4l-forest:#064a43;
  --u4l-petrol:#1b515e;
  --u4l-brand:#338275;
  --u4l-sage:#88b990;
  --u4l-soft:#abcd9e;
  --u4l-paper:#fff;
  --u4l-bg:#f5f8f7;
  --u4l-veil:#eef5f0;
  --u4l-mint:#e4f2e9;
  --u4l-ink:#172b3b;
  --u4l-muted:#536b71;
  --u4l-line:#cfded8;
  --u4l-hover:#e3f1e9;
  --u4l-red:#b53449;
  --v170-bg:var(--u4l-bg);
  --v170-canvas:var(--u4l-bg);
  --v170-surface:var(--u4l-paper);
  --v170-panel:var(--u4l-paper);
  --v170-shade:var(--u4l-veil);
  --v170-border:var(--u4l-line);
  --v170-brand-soft:var(--u4l-mint);
  --v170-ink:var(--u4l-ink);
  --v170-ink-strong:var(--u4l-ink);
  --v170-muted:var(--u4l-muted);
  --u4-surface:var(--u4l-paper);
  --u4-canvas:var(--u4l-bg);
  --u4-line:var(--u4l-line);
  --u4-ink:var(--u4l-ink);
  --u4-muted:var(--u4l-muted);
  --u4v164-wash:var(--u4l-bg);
  --u4v164-elev:var(--u4l-paper);
  --u4v164-stroke:var(--u4l-line);
  --u4v164-stroke-soft:#e5eee9;
  --u4v164-top:#fff;
  --u4v164-hover:var(--u4l-hover);
  --u4v164-cell-alt:#f3f8f5;
  --u4v164-mute-input:#f9fcfa;
}
/* 01 - Contenedor y lienzo: contraste real entre fondo y superficie. */
html[data-u4-theme="light"] body,
html[data-u4-theme="light"] body .app-frame .shell,
html[data-u4-theme="light"] body.u4-v164-analytics .workspace,
html[data-u4-theme="light"] body.u4-v164-budget .workspace,
html[data-u4-theme="light"] body .layout .content,
html[data-u4-theme="light"] body .workspace > main {
  background:var(--u4l-bg)!important;color:var(--u4l-ink)!important;
}
html[data-u4-theme="light"] body :is(.top,.topbar) {
  background:var(--u4l-paper)!important;
  color:var(--u4l-ink)!important;
  border-color:var(--u4l-line)!important;
}
html[data-u4-theme="light"] body .page-id strong,
html[data-u4-theme="light"] body .toolbar-title strong,
html[data-u4-theme="light"] body .topbar strong{color:var(--u4l-ink)!important}
html[data-u4-theme="light"] body :is(.page-id small,.toolbar-title small,.topbar small){color:var(--u4l-muted)!important}
/* 02 - Sidebar verde petróleo: funciona en portada y páginas con sidebar compartido. */
html[data-u4-theme="light"] body .app-frame .sidebar,
html[data-u4-theme="light"] body .u4-unified-side,
html[data-u4-theme="light"] body .frame > .side,
html[data-u4-theme="light"] body .layout > .sidebar {
  background:linear-gradient(180deg,#155c51 0%,#064a43 25%,#083c39 100%)!important;
  color:#f4fffa!important;
  border-color:#276b61!important;
}
html[data-u4-theme="light"] body .sidebar :is(.side-brand,.side-caption,.side-footer),
html[data-u4-theme="light"] body .u4-unified-side :is(.brand,.u4-unified-brand,.side-heading,.side-end),
html[data-u4-theme="light"] body .side :is(.brand,.side-heading,.side-end){border-color:#44786f!important}
html[data-u4-theme="light"] body .sidebar :is(.side-caption,.side-heading),
html[data-u4-theme="light"] body .u4-unified-side .side-heading,
html[data-u4-theme="light"] body .side .side-heading {
  color:#abdec7!important;letter-spacing:.095em!important;
}
html[data-u4-theme="light"] body .sidebar :is(.side-link,.side-order,.side-create),
html[data-u4-theme="light"] body .u4-unified-side :is(.side-link,.u4-front-link),
html[data-u4-theme="light"] body .side .side-link {
  background:transparent!important;color:#f0f9f5!important;border-color:transparent!important;
  text-decoration:none!important;
}
html[data-u4-theme="light"] body .sidebar :is(.side-link,.side-order,.side-create):hover,
html[data-u4-theme="light"] body .u4-unified-side :is(.side-link,.u4-front-link):hover,
html[data-u4-theme="light"] body .side .side-link:hover {
  background:#24695b!important;color:#fff!important;border-color:#418f7a!important;
}
html[data-u4-theme="light"] body .sidebar .side-link.active,
html[data-u4-theme="light"] body .u4-unified-side .side-link.current,
html[data-u4-theme="light"] body .side .side-link.active,
html[data-u4-theme="light"] body .u4-unified-side .u4-front-link.current {
  background:#338275!important;color:#fff!important;border-color:#5caf97!important;
  border-left:3px solid #b5e3be!important;font-weight:800!important;
}
html[data-u4-theme="light"] body :is(.sidebar .side-footer,.u4-unified-side .side-end,.side .side-end,.u4-nav-loading){color:#c5ded4!important}
/* Logotipo BECOSA auténtico para modo claro (mismo PNG existente que en oscuro). */
html[data-u4-theme="light"] body :is(.side-brand .brand-icon,.u4-unified-brand .brand-b,.side .brand-b){
  background:transparent!important;box-shadow:none!important;border-radius:0!important;
  background-image:url('../becosa-symbol.png')!important;
  background-repeat:no-repeat!important;background-position:center!important;
  background-size:contain!important;
  width:42px!important;height:42px!important;min-width:42px!important;padding:0!important;
}
html[data-u4-theme="light"] body :is(.side-brand .brand-icon img,.u4-unified-brand .brand-b img,.side .brand-b img){
  display:block!important;visibility:visible!important;opacity:1!important;
  width:100%!important;height:100%!important;max-width:100%!important;
  object-fit:contain!important;filter:none!important;
}
html[data-u4-theme="light"] body :is(.side-brand strong,.u4-unified-brand strong,.side .brand strong){color:#fff!important}
html[data-u4-theme="light"] body :is(.side-brand small,.u4-unified-brand small,.side .brand small){color:#d0ebdf!important}
/* 03 - Pestañas, títulos, bloques principales y tarjetas: blanco sobre lona verde-gris suave. */
html[data-u4-theme="light"] body :is(.hero,.hero-compact,.intro,.an-title,.v173-analysis-heading,.v178-fin-title,.v183-fin-heading,.v178-fin-head){
  background:linear-gradient(110deg,#e1f0e8 0%,#f8fbf9 100%)!important;
  border-color:#c7dfd3!important;
  color:var(--u4l-ink)!important;
}
html[data-u4-theme="light"] body :is(.panel,.card,.an-card,.an-kpi:not(.highlight),.metric,.stats article,.work-card,.front-card,.gantt-full-panel,.project-clock,.clock-card,.v178-fin-kpi,.v178-fin-card,.v183-fin-card,.v178-section-card,.v170-civil-main,.v170-civil-side){
  background:#fff!important;
  color:var(--u4l-ink)!important;
  border-color:var(--u4l-line)!important;
  box-shadow:0 2px 9px rgba(20,65,50,.035)!important;
}
html[data-u4-theme="light"] body :is(.metric strong,.an-kpi strong,.v178-fin-kpi b,.stats article strong,.work-card strong,.front-card strong,.panel h2,.an-card h2){color:var(--u4l-ink)!important}
html[data-u4-theme="light"] body :is(.metric small,.an-kpi small,.an-card-heading small,.source-note,.an-source,.hint,.footnote){color:var(--u4l-muted)!important}
html[data-u4-theme="light"] body :is(.section-heading,.gantt-meta,.gantt-heading,.historical-note,.front-order-help,.submetrics,.v173-progress-panel){
  background:var(--u4l-veil)!important;border-color:var(--u4l-line)!important;
}
/* Excepción: preservar semántica de valores y KPI positivos/negativos. */
html[data-u4-theme="light"] body :is(.u4-saving,.metric .u4-saving,.an-kpi .u4-saving){color:#087759!important}
html[data-u4-theme="light"] body :is(.u4-loss,.metric .u4-loss,.an-kpi .u4-loss){color:#b53449!important}
html[data-u4-theme="light"] body :is(.an-kpi.highlight,.metric.highlight){background:#1b7164!important;color:#fff!important}
html[data-u4-theme="light"] body .an-kpi.highlight :is(small,strong){color:#fff!important}
/* 04 - Botonera, navegación, formularios y foco. No alterar ni desactivar acciones. */
html[data-u4-theme="light"] body :is(.primary,.action.primary,button.primary,.an-top-actions .primary){
  background:#178168!important;border-color:#178168!important;color:#fff!important;
  box-shadow:0 2px 5px rgba(16,106,78,.12)!important;
}
html[data-u4-theme="light"] body :is(.primary,.action.primary,button.primary):hover{background:#106a54!important;border-color:#106a54!important}
html[data-u4-theme="light"] body :is(.secondary-action,.action.subtle,.tabs button,.an-top-actions .action:not(.primary),.baseline-manage,.icon-btn,.toolbar-back,.back,.u4-theme-switch){
  background:#fff!important;border-color:#c7dad0!important;color:#24594e!important;
}
html[data-u4-theme="light"] body :is(.secondary-action,.action.subtle,.tabs button,.icon-btn,.toolbar-back,.back,.u4-theme-switch):hover{
  background:#e7f3eb!important;border-color:#87bba5!important;color:#125849!important;
}
html[data-u4-theme="light"] body :is(.tabs button.active,.tabs .active,.v178-fin-tabs button.active,.an-view-tabs .active){
  background:#d9eee3!important;color:#105d4b!important;border-color:#81b79c!important;
}
html[data-u4-theme="light"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea,.inline-cell,.cell-input,.cell-select){
  background:#fff!important;color:var(--u4l-ink)!important;border-color:#bed4c9!important;
}
html[data-u4-theme="light"] body :is(input,select,textarea,.inline-cell):focus-visible{
  outline:2px solid #338275!important;outline-offset:1px!important;
}
html[data-u4-theme="light"] body input::placeholder{color:#6c8580!important}
html[data-u4-theme="light"] body :is(.modal,.money-drawer,.drawer,.baseline-panel,.ws-editor,.trash-panel,.dep-panel){
  background:#fff!important;color:var(--u4l-ink)!important;border-color:var(--u4l-line)!important;
}
html[data-u4-theme="light"] body :is(.modal-head,.money-drawer-head,.drawer-header){
  background:#eaf5ef!important;border-color:#c6dfd2!important;
}
/* 05 - Presupuesto editable: cabezales firmes, filas alternas suaves, secciones distintas. */
html[data-u4-theme="light"] body.u4-v164-budget :is(.budget-toolbar,.u4-v164-budget-panel),
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-card,.an-kpi,.an-title),
html[data-u4-theme="light"] body .layout :is(.panel,.stats article){
  background:#fff!important;border-color:var(--u4l-line)!important;
}
html[data-u4-theme="light"] body.u4-v164-budget :is(.budget-toolbar,.budget-secondary-actions){background:#f6faf7!important}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable :is(thead,th,th .sort),
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll thead,.cut-list thead,.v178-fin-table thead,.comparison-table thead){
  background:#1b515e!important;color:#fff!important;border-color:#2d6870!important;
}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable th :is(span,button),
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll th,.cut-list th,.comparison-table th){color:#fff!important}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable tbody tr:not(.group-row) td,
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll tbody tr,.cut-list tbody tr,.comparison-table tbody tr) td{
  background:#fff!important;border-color:#e0eae4!important;color:var(--u4l-ink)!important;
}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable tbody tr:not(.group-row):nth-child(even) td,
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll tbody tr:nth-child(even),.cut-list tbody tr:nth-child(even),.comparison-table tbody tr:nth-child(even)) td{
  background:#f1f7f3!important;
}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable tbody tr.group-row td{background:#dbeee3!important;color:#163f39!important;border-color:#b9d5c5!important}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable tbody tr:hover td,
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll,.cut-list) tbody tr:hover td{background:#e6f3eb!important}
/* Los valores rojos/verdes tienen prioridad sobre el color genérico de celda. */
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable .u4-saving,
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll,.v178-fin-table) .u4-saving {color:#087759!important}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable .u4-loss,
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table-scroll,.v178-fin-table) .u4-loss {color:#b53449!important}
html[data-u4-theme="light"] body.u4-v164-budget #budgetTable .inline-cell:not(:focus){background:transparent!important;border-color:transparent!important}
/* 06 - Analítica: dona, barras, lecturas e indicadores con contraste. */
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-charts,.an-bottom,.an-bars,.an-table-scroll){color:var(--u4l-ink)!important}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-legend .dot.gray){background:#c8e3d2!important}
html[data-u4-theme="light"] body.u4-v164-analytics .an-donut::before{background:#fff!important}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-notes,.v178-fin-readout){background:#eff7f1!important;color:var(--u4l-ink)!important}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-notes h2,.v178-fin-readout h2){background:#1b7164!important;color:#fff!important}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.v178-fin-snapshot,.v183-fin-snapshot,.v178-fin-section){border-color:var(--u4l-line)!important}
/* 07 - Cronograma y frentes: conservar los colores de cada frente y fecha de corte. */
html[data-u4-theme="light"] body :is(.gantt-label,.gantt-track,.gantt-months,.gantt-heading,.timeline-scroll,.timeline-track,.timeline-name,.table-scroll){
  border-color:#d5e5dc!important;
}
html[data-u4-theme="light"] body #detail.schedule-mode .gantt-row :is(.gantt-label,.gantt-track){background-color:#fff!important;border-bottom-color:#e0ebe4!important}
html[data-u4-theme="light"] body #detail.schedule-mode .gantt-row.gantt-task:nth-child(odd) :is(.gantt-label,.gantt-track){background-color:#f4f9f5!important}
html[data-u4-theme="light"] body #detail.schedule-mode .gantt-row.gantt-section :is(.gantt-label,.gantt-track){background-color:#e1eee6!important}
html[data-u4-theme="light"] body :is(.v170-civil-pulse,.v173-analysis-summary,.v173-progress-panel,.v172-front-row){border-color:#c9dfd1!important}
/* 08 - Importador y paneles laterales compartidos. */
html[data-u4-theme="light"] body .layout :is(.intro,.panel,.stats article,.topbar){border-color:var(--u4l-line)!important}
html[data-u4-theme="light"] body .layout :is(.import-preview,.preview,.validation-row,.summary){background:#fff!important;color:var(--u4l-ink)!important}
/* 09 - Visibilidad en móvil; sin romper tamaños, sticky, scroll ni columnas existentes. */
@media(max-width:720px){
  html[data-u4-theme="light"] body .side-brand .brand-icon,
  html[data-u4-theme="light"] body .u4-unified-brand .brand-b{width:36px!important;height:36px!important;min-width:36px!important}
}
/* 10 - Contrarrestar selectores heredados de mayor especificidad en LIGHT.
   Se carga al final y NO altera los selectores de modo oscuro. */
html[data-u4-theme="light"] body.u4-v164-budget .u4-v164-frame :is(.panel,.metric,.metric-balance,.data-table,.table-scroll),
html[data-u4-theme="light"] body.u4-v164-analytics .u4-v164-frame :is(.panel,.an-card,.an-kpi:not(.highlight),.an-tile),
html[data-u4-theme="light"] body .layout :is(.panel,.stats article){
  background:#fff!important;border-color:#cfded8!important;color:#172b3b!important;
}
html[data-u4-theme="light"] body.u4-v164-analytics .u4-v164-frame .an-title,
html[data-u4-theme="light"] body.u4-v164-budget .u4-v164-frame .budget-toolbar{
  background:linear-gradient(105deg,#e4f2e9,#f7faf8)!important;border-color:#c7dfd3!important;color:#172b3b!important;
}
html[data-u4-theme="light"] body .app-frame .sidebar .side-link.active,
html[data-u4-theme="light"] body .app-frame .sidebar .side-link[aria-current="page"]{
  background:#338275!important;color:#fff!important;border-color:#6ab59d!important;
}
html[data-u4-theme="light"] body .app-frame .sidebar .side-link:hover{
  background:#24695b!important;color:#fff!important;border-color:#418f7a!important;
}
html[data-u4-theme="light"] body.u4-v164-budget .u4-v164-budget-toolbar :is(.action:not(.primary),.tabs button),
html[data-u4-theme="light"] body.u4-v164-budget .data-table :is(.sort,.code-open,.collapse,.more){
  background:#f4faf6!important;color:#24594e!important;border-color:#c7dad0!important;
}
html[data-u4-theme="light"] body.u4-v164-budget .u4-v164-budget-toolbar .tabs button.active{
  background:#d6eee1!important;color:#125849!important;border-color:#79b495!important;
}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table th,.cut-list th,.comparison-table th){
  background:#1b515e!important;color:#fff!important;border-color:#2e6971!important;
}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table td,.cut-list td,.comparison-table td){
  background:#fff!important;border-color:#dce9e2!important;color:#172b3b!important;
}
html[data-u4-theme="light"] body.u4-v164-analytics :is(.an-table tbody tr:nth-child(even) td,.cut-list tbody tr:nth-child(even) td,.comparison-table tbody tr:nth-child(even) td){background:#f1f7f3!important}
