/* MI REGISTRO – MATCH (V920) · estilos aislados bajo #matchApp.
 *
 * Identidad: la de SINERGIA. Los colores son alias semánticos (--match-*)
 * de los tokens oficiales Día/Noche de sinergia-theme-v900.css (--sg-*); el
 * valor tras la coma solo es el mismo valor oficial de día, para que el
 * módulo se vea igual si la hoja de tema aún no cargó. Los degradados, que no
 * tienen token, copian los valores de las reglas SINERGIA que los definen
 * (se indica la fuente en cada uno). Sin reglas globales ni !important.
 */
#matchApp,
.mx-dialog-backdrop {
  /* Superficies y texto (V900) */
  --match-bg: var(--sg-bg, var(--sg-bg));
  --match-card: var(--sg-surface, #fff);
  --match-card-alt: var(--sg-surface-alt, #f7f9fc);
  --match-border: var(--sg-border, var(--sg-border));
  --match-text: var(--sg-text, var(--sg-text));
  --match-text-2: var(--sg-text-secondary, var(--sg-text-secondary));
  --match-muted: var(--sg-text-muted, var(--sg-text-muted));
  --match-hover: var(--sg-hover, var(--sg-hover));
  --match-row-alt: var(--sg-table-row-alt, #f7f9fc);
  --match-disabled-bg: var(--sg-disabled-bg, var(--sg-disabled-bg));
  --match-disabled-text: var(--sg-disabled-text, var(--sg-disabled-text));
  --match-shadow: var(--sg-shadow, 0 8px 22px rgba(25, 48, 78, .08));
  /* Semánticos (V900) */
  --match-primary: var(--sg-primary, #3f648f);
  --match-accent: var(--sg-accent, #16a79c);
  --match-focus: var(--sg-focus, #28b8ad);
  --match-success: var(--sg-success, #14805e);
  --match-warning: var(--sg-warning, #b7791f);
  --match-danger: var(--sg-danger, #be3652);
  --match-info: var(--sg-info, var(--sg-info));
  --match-selected-bg: var(--sg-selected-bg, #e9f8f6);
  --match-selected-text: var(--sg-selected-text, #145e59);
  /* Degradados institucionales */
  --match-grad-primary: linear-gradient(135deg,#7cc4ee,#4aa8d8);      /* Alertas · "Actualizar alertas" y mes activo */
  --match-grad-secondary: linear-gradient(135deg, #87a6c9, #3f648f);    /* Alertas · "Generar reporte institucional" */
  --match-grad-brand: linear-gradient(135deg,#3a78c9,#7cc4ee);        /* cabecera de tablas institucionales (día) */
  --match-grad-active-month: linear-gradient(135deg,#7cc4ee,#4aa8d8); /* Alertas · mes activo (día) */
  --match-grad-excel: linear-gradient(135deg, #28a66f, #147a50);        /* Panel de control · Excel */
  --match-grad-png: linear-gradient(135deg, #27c9bc, #138e86);          /* Panel de control · PNG */
  --match-grad-pdf: linear-gradient(135deg, #df5265, #b82742);          /* Panel de control · PDF */
  --match-action-shadow: 0 8px 18px rgba(63,100,143, .15);            /* sombra de acciones de Alertas */
  --match-export-shadow: 0 5px 12px rgba(34,53,75, .12);             /* sombra de exportación del Panel de control */
  /* Meses (Alertas · botón de mes inactivo) */
  --match-month-bg: #f7fbff;
  --match-month-border: #c9dcf2;
  --match-month-text: #3f648f;
  /* KPI (Alertas · tarjeta KPI) */
  --match-kpi-line: #1fd6c8;
  /* Radios reales de SINERGIA */
  --match-r-card: 16px;      /* tarjetas KPI de Alertas */
  --match-r-control: 10px;   /* meses y botones de filtro */
  --match-r-action: 12px;    /* botones de acción de Alertas */
  --match-r-banner: 14px;    /* aviso "Atención" de Alertas */
  --match-r-pill: 999px;
  --match-r-modal: 24px;     /* modal institucional mpCardV016 */
  /* Movimiento: duraciones y curva más usadas en SINERGIA */
  --match-dur: .16s;
  --match-ease: ease;
  --match-dur-ring: .7s;
  --match-anim-shimmer: mxShimmer;
  --match-anim-rowin: mxRowIn;
  --match-anim-dialog: mxDialogIn;
  /* Barra de trabajo fija bajo el topbar (62 px) */
  --match-sticky-top: 70px;
}
html.darkModeV667 :is(#matchApp, .mx-dialog-backdrop) {
  --match-grad-brand: linear-gradient(100deg,#2d5f9e,#4aa8d8);        /* theme-contrast-v826 · cabecera de tabla (noche) */
  --match-grad-active-month: linear-gradient(135deg, #436791, #168f86); /* Alertas · mes activo (noche) */
  --match-month-bg: #22334b;
  --match-month-border: #48607e;
  --match-month-text: #dce7f4;
  --match-kpi-line: var(--sg-border, var(--sg-border));
}

#matchApp {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--match-text);
  font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  min-width: 0;
  container: matchapp / inline-size;
  /* Alto reservado fuera del área de filas: barra superior + barra de
     trabajo fija + herramientas y pie de la tabla. Así, al final del
     desplazamiento, la barra con GUARDAR sigue fija y la cabecera visible. */
  --match-table-reserve: 310px;
}
#matchApp:has([data-mx-notice] .mx-notice) { --match-notice-reserve: 56px; }
#matchApp *, #matchApp *::before, #matchApp *::after { box-sizing: border-box; }
#matchApp button { font: inherit; cursor: pointer; }
#matchApp button:disabled { cursor: not-allowed; }
#matchApp :focus-visible { outline: 3px solid color-mix(in srgb, var(--match-focus) 45%, transparent); outline-offset: 2px; }
#matchApp .mx-card {
  background: var(--match-card);
  border: 1px solid var(--match-border);
  border-radius: var(--match-r-card);
  box-shadow: var(--match-shadow);
}
#matchApp .mx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#matchApp .mx-ico { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Cabecera: año, meses y progresos ---------- */
#matchApp .mx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
#matchApp .mx-period { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-width: 0; }
#matchApp .mx-year { display: flex; flex-direction: column; gap: 4px; padding-right: 14px; border-right: 1px solid var(--match-border); white-space: nowrap; }
#matchApp .mx-year-label { font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--match-muted); text-transform: uppercase; }
#matchApp .mx-year strong { font-size: 24px; font-weight: 700; line-height: 1; color: var(--match-text); }
#matchApp .mx-year-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--match-r-pill);
  font-size: 9.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  color: var(--match-selected-text); background: var(--match-selected-bg); border: 1px solid color-mix(in srgb, var(--match-accent) 35%, transparent);
}
#matchApp .mx-year-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--match-accent); }
#matchApp .mx-year-chip[hidden] { display: none; }
#matchApp .mx-months { display: grid; grid-template-columns: repeat(12, minmax(48px, 1fr)); gap: 6px; flex: 1; min-width: 0; }
#matchApp .mx-month {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 46px; padding: 5px 2px; border-radius: var(--match-r-control);
  border: 1px solid var(--match-month-border); background: var(--match-month-bg); color: var(--match-month-text);
  transition: transform var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease),
    border-color var(--match-dur) var(--match-ease), background var(--match-dur) var(--match-ease);
}
#matchApp .mx-month b { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
#matchApp .mx-month small { font-size: 9px; font-weight: 500; white-space: nowrap; opacity: .85; }
#matchApp .mx-month[data-state="closed_future"] { opacity: .55; }
#matchApp .mx-month[data-state="open"] { border-color: color-mix(in srgb, var(--match-accent) 60%, var(--match-month-border)); }
#matchApp .mx-month:hover { transform: translateY(-1px); }
#matchApp .mx-month:hover:not([aria-pressed="true"]) { border-color: var(--match-accent); }
#matchApp .mx-month[aria-pressed="true"] {
  opacity: 1; background: var(--match-grad-active-month); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(31, 214, 200, .22);
}
#matchApp .mx-month[aria-pressed="true"] small { opacity: .95; }
#matchApp .mx-rings { display: flex; gap: 8px; padding: 10px 12px; }
#matchApp .mx-ring { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 96px; }
#matchApp .mx-ring-title { font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--match-text-2); }
#matchApp .mx-ring svg { width: 60px; height: 60px; display: block; }
#matchApp .mx-ring .mx-ring-track { stroke: color-mix(in srgb, var(--match-border) 80%, transparent); }
#matchApp .mx-ring .mx-ring-bar { stroke: var(--match-accent); transition: stroke-dashoffset var(--match-dur-ring) ease-out; }
#matchApp .mx-ring[data-ring="ceplan"] .mx-ring-bar { stroke: var(--match-primary); }
#matchApp .mx-ring[data-ring="integrado"] .mx-ring-bar { stroke: url(#mxRingGradIntegrado); }
#matchApp .mx-ring-grad-a { stop-color: var(--match-primary); }
#matchApp .mx-ring-grad-b { stop-color: var(--match-accent); }
#matchApp .mx-ring text { font-size: 13px; font-weight: 700; fill: var(--match-text); }
#matchApp .mx-ring-detail { font-size: 10px; font-weight: 400; color: var(--match-muted); white-space: nowrap; }

/* ---------- Estados como KPI operativos (tarjeta KPI de Alertas) ---------- */
#matchApp .mx-status { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
#matchApp .mx-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  padding: 11px 13px 10px; text-align: left; border-radius: var(--match-r-card);
  background: var(--match-card); color: var(--match-text);
  border: 1px solid var(--match-border); border-bottom: 3px solid var(--match-kpi-line);
  transition: transform var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease), border-color var(--match-dur) var(--match-ease);
}
#matchApp .mx-stat span { font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--match-muted); text-transform: uppercase; }
#matchApp .mx-stat strong { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#matchApp .mx-stat:hover { transform: translateY(-2px); box-shadow: var(--match-shadow); }
#matchApp .mx-stat[aria-pressed="true"] {
  background: var(--match-grad-brand); color: #fff; border-color: transparent; border-bottom-color: rgba(255, 255, 255, .55);
  box-shadow: var(--match-action-shadow);
}
#matchApp .mx-stat[aria-pressed="true"] span { color: rgba(255, 255, 255, .88); }

/* ---------- Filtros: un único bloque, siete filas siempre visibles ---------- */
#matchApp .mx-filters { padding: 4px 16px; }
#matchApp .mx-fhead { display: flex; align-items: center; gap: 8px; padding: 10px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--match-text-2); text-transform: uppercase; }
#matchApp .mx-fhead .mx-ico { color: var(--match-primary); }
#matchApp .mx-frow { display: grid; grid-template-columns: 196px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 44px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--match-border) 70%, transparent); }
#matchApp .mx-flabel { display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 600; letter-spacing: .4px; color: var(--match-text); }
#matchApp .mx-flabel .mx-ico { width: 17px; height: 17px; color: var(--match-accent); }
#matchApp .mx-fbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Una sola fila por filtro: las opciones se recorren con desplazamiento
   horizontal (mismo criterio en SEGUIMIENTO Y EVALUACIÓN). */
#matchApp .mx-opts {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; min-height: 36px; padding: 3px 1px 5px;
  overflow: auto; white-space: nowrap;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--match-accent) 55%, var(--match-border)) transparent;
}
#matchApp .mx-opt {
  flex: 0 0 auto; min-width: 56px; min-height: 30px; padding: 5px 13px; border-radius: var(--match-r-pill);
  border: 1px solid var(--match-border); background: var(--match-card-alt); color: var(--match-text);
  font-size: 11.5px; font-weight: 500; line-height: 1.2; text-align: center;
  transition: transform var(--match-dur) var(--match-ease), background var(--match-dur) var(--match-ease),
    border-color var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease), color var(--match-dur) var(--match-ease);
}
#matchApp .mx-opt:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--match-accent); background: var(--match-hover); transform: translateY(-1px); }
#matchApp .mx-opt[aria-pressed="true"]:hover { transform: translateY(-1px); }
#matchApp .mx-opt[aria-pressed="true"] {
  background: var(--match-grad-brand); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(63,100,143, .22);
}
#matchApp .mx-opt:disabled { opacity: .5; }
#matchApp .mx-context { padding: 0 1px 3px; font-size: 11.5px; font-weight: 400; color: var(--match-text-2); overflow-wrap: anywhere; }
#matchApp .mx-empty-opts { font-size: 11.5px; color: var(--match-muted); font-weight: 400; font-style: italic; }

/* ---------- Barra de trabajo: buscar, limpiar y guardar (fija) ---------- */
#matchApp .mx-toolbar {
  position: sticky; top: var(--match-sticky-top); z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 14px;
}
#matchApp .mx-searchbox { position: relative; display: flex; align-items: center; min-width: 0; }
#matchApp .mx-searchbox .mx-ico { position: absolute; left: 12px; color: var(--match-muted); pointer-events: none; }
/* Los <input> conservan el aspecto global de SINERGIA (reglas legacy con
   !important de padding, borde, fondo y sombra): el hueco del ícono se abre
   con text-indent y los estados del físico se marcan con outline. */
#matchApp .mx-searchbox input {
  width: 100%; min-height: 38px; padding: 8px 12px; text-indent: 26px; border-radius: var(--match-r-control);
  border: 1px solid var(--match-border); background: var(--match-card-alt); color: var(--match-text); font: inherit; font-weight: 400;
  transition: border-color var(--match-dur) var(--match-ease), background var(--match-dur) var(--match-ease);
}
#matchApp .mx-searchbox input:focus { border-color: var(--match-accent); background: var(--match-card); }
#matchApp :is(.mx-clear, .mx-save) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px;
  padding: 8px 18px; border-radius: var(--match-r-action); border: 0; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .4px;
  box-shadow: var(--match-action-shadow); white-space: nowrap;
  transition: transform var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease), filter var(--match-dur) var(--match-ease);
}
#matchApp :is(.mx-clear, .mx-save) .mx-ico { width: 16px; height: 16px; }
#matchApp .mx-clear { background: var(--match-grad-secondary); }
#matchApp .mx-save { background: var(--match-grad-primary); }
#matchApp :is(.mx-clear, .mx-save):hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
#matchApp :is(.mx-clear, .mx-save):active:not(:disabled) { transform: translateY(0) scale(.99); }
#matchApp .mx-save:disabled { box-shadow: none; }
#matchApp .mx-save .mx-badge {
  display: inline-flex; min-width: 22px; padding: 1px 7px; border-radius: var(--match-r-pill); justify-content: center;
  background: rgba(255, 255, 255, .24); color: #fff; font-size: 11px; font-weight: 600;
}
/* El contador solo aparece cuando hay cambios. */
#matchApp .mx-save[data-count="0"] .mx-badge { display: none; }
#matchApp .mx-invalid-help {
  grid-column: 1 / -1; justify-self: end; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--match-r-pill); font-size: 11.5px; font-weight: 500;
  color: var(--match-danger); background: color-mix(in srgb, var(--match-danger) 9%, var(--match-card));
  border: 1px solid color-mix(in srgb, var(--match-danger) 28%, transparent);
}
#matchApp .mx-invalid-help:empty { display: none; }

/* ---------- Avisos (banner institucional de Alertas) ---------- */
#matchApp .mx-notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--match-r-banner);
  font-size: 12px; font-weight: 500; line-height: 1.4;
  color: var(--match-text); background: color-mix(in srgb, var(--match-info) 8%, var(--match-card));
  border: 1px solid color-mix(in srgb, var(--match-info) 26%, transparent);
}
#matchApp .mx-notice .mx-ico { color: var(--match-info); margin-top: 1px; }
#matchApp .mx-notice.mx-error {
  color: var(--match-danger); background: color-mix(in srgb, var(--match-danger) 8%, var(--match-card));
  border-color: color-mix(in srgb, var(--match-danger) 30%, transparent); font-weight: 600;
}
#matchApp .mx-notice.mx-error .mx-ico { color: var(--match-danger); }

/* ---------- Tabla ---------- */
#matchApp .mx-tablecard { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#matchApp .mx-tabletools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#matchApp .mx-summary { font-size: 12px; font-weight: 400; color: var(--match-text-2); }
#matchApp .mx-summary b { color: var(--match-text); font-weight: 600; }
#matchApp .mx-exports { display: flex; gap: 6px; margin-left: auto; }
#matchApp .mx-export {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 14px; border-radius: var(--match-r-control); border: 0;
  color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .5px; box-shadow: var(--match-export-shadow);
  transition: transform var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease), filter var(--match-dur) var(--match-ease);
}
#matchApp .mx-export .mx-ico { width: 14px; height: 14px; }
#matchApp .mx-export[data-mx-export="excel"] { background: var(--match-grad-excel); }
#matchApp .mx-export[data-mx-export="png"] { background: var(--match-grad-png); }
#matchApp .mx-export[data-mx-export="pdf"] { background: var(--match-grad-pdf); }
#matchApp .mx-export:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
#matchApp .mx-export:disabled { box-shadow: none; }
#matchApp .mx-tablewrap {
  position: relative; overflow: auto; min-height: 220px;
  max-height: calc(100vh - var(--match-table-reserve) - var(--match-notice-reserve, 0px));
  border: 1px solid var(--match-border); border-radius: 12px; background: var(--match-card);
  scrollbar-width: thin; scrollbar-color: var(--match-border) transparent;
}
/* Diez columnas con anchos fijos: la descripción recibe todo el espacio
   sobrante y nunca se comprime a favor de las columnas numéricas. */
#matchApp .mx-table { width: 100%; min-width: 1040px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
#matchApp .mx-col-codigo { width: 116px; }
#matchApp .mx-col-descripcion { width: auto; }
#matchApp .mx-col-trazador { width: 76px; }
#matchApp .mx-col-unidad { width: 96px; }
#matchApp .mx-col-prog_mes { width: 56px; }
#matchApp .mx-col-prog_anual { width: 64px; }
#matchApp .mx-col-fisico { width: 90px; }
#matchApp .mx-col-estado { width: 118px; }
#matchApp .mx-col-avance { width: 92px; }
#matchApp .mx-col-acciones { width: 92px; }
#matchApp .mx-table th, #matchApp .mx-table td {
  padding: 8px 8px; vertical-align: middle; overflow-wrap: anywhere;
  border-bottom: 1px solid color-mix(in srgb, var(--match-border) 75%, transparent);
}
#matchApp .mx-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--match-grad-brand); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .5px; line-height: 1.25;
  text-align: center; white-space: normal; overflow-wrap: normal; border-bottom: 0;
}
#matchApp .mx-table thead th.mx-th-codigo, #matchApp .mx-table thead th.mx-th-descripcion { text-align: left; }
#matchApp .mx-th-short { display: none; }
#matchApp .mx-table td { font-size: 12.5px; font-weight: 400; color: var(--match-text); background: var(--match-card); }
#matchApp .mx-table tr.mx-row:nth-child(even of .mx-row) td { background: var(--match-row-alt); }
#matchApp .mx-table tr.mx-row td { transition: background var(--match-dur) var(--match-ease); }
#matchApp .mx-table tr.mx-row:hover td { background: var(--match-hover); }
#matchApp .mx-table tr.mx-row.mx-enter td { animation: var(--match-anim-rowin) .18s ease-out both; }
#matchApp .mx-table td.mx-num { text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Familias: Producto con acento fuerte, A.P. un nivel debajo. */
#matchApp .mx-table tr.mx-g-producto td {
  background: color-mix(in srgb, var(--match-primary) 13%, var(--match-card)); color: var(--match-text);
  font-size: 12.5px; font-weight: 600; letter-spacing: .2px; box-shadow: inset 4px 0 0 var(--match-primary);
}
#matchApp .mx-table tr.mx-g-actividad td {
  background: var(--match-card-alt); color: var(--match-text-2);
  font-size: 12px; font-weight: 500; padding-left: 22px; box-shadow: inset 3px 0 0 var(--match-accent);
}
/* El conteo va junto al título: no depende del ancho de la tabla. */
#matchApp .mx-gline { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
#matchApp .mx-gline small { font-size: 11px; font-weight: 400; white-space: nowrap; color: var(--match-muted); }
/* Código: completo, en una línea, sin etiquetas añadidas. */
#matchApp .mx-c-codigo { white-space: nowrap; overflow-wrap: normal; }
#matchApp .mx-code { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .2px; color: var(--match-primary); }
/* Descripción: columna dominante, texto completo con salto natural. */
#matchApp .mx-c-descripcion { font-weight: 500; line-height: 1.4; overflow-wrap: normal; word-break: normal; }
#matchApp .mx-c-unidad { font-size: 11.5px; font-weight: 400; color: var(--match-text-2); line-height: 1.3; }
#matchApp .mx-c-estado .mx-chip {
  white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none; line-height: 1.2; text-align: left;
  gap: 4px; padding: 3px 7px; border-radius: 10px; font-size: 9.5px; letter-spacing: .2px;
}
#matchApp .mx-nodata { color: var(--match-muted); font-weight: 400; }
#matchApp .mx-chip {
  --chip: var(--match-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 38px; padding: 3px 9px;
  border-radius: var(--match-r-pill); font-size: 10.5px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
  color: var(--chip); background: color-mix(in srgb, var(--chip) 11%, var(--match-card));
  border: 1px solid color-mix(in srgb, var(--chip) 32%, transparent);
}
#matchApp .mx-chip[data-estado]::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--chip); }
/* Trazador: SÍ con acento; NO neutro; S/C neutro diferenciado (discontinuo). */
#matchApp .mx-chip[data-traz="SI"] { --chip: var(--match-accent); }
#matchApp .mx-chip[data-traz="NO"] { --chip: var(--match-text-2); }
#matchApp .mx-chip[data-traz="SC"] { --chip: var(--match-muted); background: transparent; border-style: dashed; font-style: italic; }
/* Estados de fila: color + texto (la etiqueta la entrega el servidor). */
#matchApp .mx-chip[data-estado="SIN_SEGUIMIENTO"] { --chip: var(--match-danger); }
#matchApp .mx-chip[data-estado="REGISTRADO_SINERGIA"] { --chip: var(--match-accent); }
#matchApp .mx-chip[data-estado="PENDIENTE_APROBACION"] { --chip: var(--match-warning); }
#matchApp .mx-chip[data-estado="APROBADO_CEPLAN"] { --chip: var(--match-success); }
#matchApp .mx-chip[data-estado="DEVUELTO"],
#matchApp .mx-chip[data-estado="CORRECCION_GUARDADA"],
#matchApp .mx-chip[data-estado="REENVIADO"] { --chip: var(--match-danger); border-style: dashed; }
#matchApp .mx-chip[data-estado="REABIERTA"] { --chip: var(--match-primary); }
#matchApp .mx-chip[data-estado="PENDIENTE_NUEVA_APROBACION"] { --chip: var(--match-warning); border-style: dashed; }
#matchApp .mx-fisico {
  width: 100%; max-width: 96px; min-height: 32px; padding: 5px 8px; text-align: center; border-radius: var(--match-r-control);
  border: 1px solid var(--match-border); background: var(--match-card-alt); color: var(--match-text); font: inherit; font-weight: 500;
  transition: border-color var(--match-dur) var(--match-ease), box-shadow var(--match-dur) var(--match-ease), background var(--match-dur) var(--match-ease);
}
#matchApp .mx-fisico:focus { border-color: var(--match-accent); background: var(--match-card); }
#matchApp .mx-fisico.mx-dirty { outline: 2px solid var(--match-accent); outline-offset: 1px; }
#matchApp .mx-fisico[aria-invalid="true"] { outline: 2px solid var(--match-danger); outline-offset: 1px; }
#matchApp .mx-fisico-ro { font-weight: 600; }
#matchApp .mx-fisico-ro.mx-nodata { color: var(--match-muted); font-weight: 400; }
#matchApp .mx-hint { display: block; font-size: 10px; color: var(--match-muted); font-weight: 400; margin-top: 2px; }
/* Avance: la cifra es obligatoria; el indicador es neutro (sin umbrales
   oficiales de avance físico no se asigna semáforo). */
#matchApp .mx-c-avance { text-align: center; }
#matchApp .mx-progress { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
#matchApp .mx-progress b { text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
#matchApp .mx-progress .mx-bar { flex: 0 0 4px; height: 4px; }
#matchApp .mx-bar { height: 4px; border-radius: var(--match-r-pill); background: color-mix(in srgb, var(--match-border) 80%, transparent); overflow: hidden; }
#matchApp .mx-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--match-primary) 70%, var(--match-card)); border-radius: var(--match-r-pill); }
#matchApp .mx-actions { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
#matchApp .mx-act {
  --act: var(--match-primary);
  min-height: 28px; padding: 4px 10px; border-radius: var(--match-r-control); font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
  border: 1px solid color-mix(in srgb, var(--act) 55%, transparent); background: var(--match-card); color: var(--act);
  transition: background var(--match-dur) var(--match-ease), border-color var(--match-dur) var(--match-ease), transform var(--match-dur) var(--match-ease);
}
#matchApp .mx-act[data-act="corregir"], #matchApp .mx-act[data-act="devolver"] { --act: var(--match-warning); }
#matchApp .mx-act[data-act="aceptar"] { --act: var(--match-success); }
#matchApp .mx-act:hover:not(:disabled) { background: color-mix(in srgb, var(--act) 10%, var(--match-card)); border-color: var(--act); transform: translateY(-1px); }
#matchApp .mx-noact { font-size: 11px; color: var(--match-muted); font-weight: 400; }

/* ---------- Estados vacíos ---------- */
#matchApp .mx-empty { padding: 38px 16px; text-align: center; color: var(--match-muted); }
#matchApp .mx-empty-box { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; max-width: 460px; }
#matchApp .mx-empty-box .mx-ico { width: 30px; height: 30px; stroke-width: 1.6; color: var(--match-primary); opacity: .75; }
#matchApp .mx-empty-box strong { font-size: 13.5px; font-weight: 600; color: var(--match-text); }
#matchApp .mx-empty-box span { font-size: 12px; font-weight: 400; line-height: 1.45; }

/* ---------- Esqueleto de carga (brillo de Seguimiento V2, solo al cargar) ---------- */
#matchApp .mx-skel {
  display: block; border-radius: 8px;
  background: linear-gradient(100deg, var(--match-card-alt) 30%, var(--match-hover) 50%, var(--match-card-alt) 70%);
  background-size: 200% 100%; animation: var(--match-anim-shimmer) 1.6s ease-in-out infinite;
}
#matchApp .mx-skel-line { height: 12px; margin: 4px 0; }
#matchApp .mx-skel-pill { display: inline-block; width: 64px; height: 28px; border-radius: var(--match-r-pill); }
#matchApp .mx-skel-stat { height: 68px; border-radius: var(--match-r-card); }
#matchApp .mx-skel-row td { padding: 12px 8px; }
#matchApp[aria-busy="true"] .mx-tablewrap { opacity: .72; transition: opacity var(--match-dur) var(--match-ease); }

/* ---------- Pie: paginación ---------- */
#matchApp .mx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#matchApp .mx-pager { display: flex; align-items: center; gap: 8px; }
#matchApp .mx-pager button {
  min-height: 34px; padding: 6px 16px; border-radius: var(--match-r-control); font-weight: 600; font-size: 12px;
  border: 1px solid var(--match-border); background: var(--match-card); color: var(--match-text);
  transition: border-color var(--match-dur) var(--match-ease), transform var(--match-dur) var(--match-ease);
}
#matchApp .mx-pager button:hover:not(:disabled) { border-color: var(--match-accent); transform: translateY(-1px); }
#matchApp .mx-pager span { font-size: 12px; font-weight: 500; color: var(--match-text-2); }

/* ---------- Diálogos (modal institucional mpOverlayV016 / mpCardV016) ---------- */
.mx-dialog-backdrop {
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(28,48,71, .55); backdrop-filter: blur(4px);
}
.mx-dialog {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--match-card); color: var(--match-text); border-radius: var(--match-r-modal);
  border: 2px solid color-mix(in srgb, var(--match-primary) 70%, transparent);
  box-shadow: 0 30px 90px rgba(28,48,71, .35); font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  animation: var(--match-anim-dialog) .22s ease;
}
.mx-dialog.mx-wide { width: min(880px, 100%); }
.mx-dialog .mx-dlg-head { padding: 16px 22px; background: var(--match-grad-brand); color: #fff; }
.mx-dialog .mx-dlg-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: #fff; }
.mx-dialog .mx-dlg-body { padding: 16px 22px 18px; }
.mx-dialog p { margin: 0 0 10px; font-size: 13px; color: var(--match-text-2); font-weight: 400; }
.mx-dialog label { display: block; font-size: 12px; font-weight: 600; margin: 8px 0 4px; color: var(--match-text); }
.mx-dialog textarea, .mx-dialog input {
  width: 100%; padding: 8px 10px; border-radius: var(--match-r-control); border: 1px solid var(--match-border);
  background: var(--match-card-alt); color: var(--match-text); font: inherit;
}
.mx-dialog .mx-dlg-error { color: var(--match-danger); font-size: 12px; font-weight: 500; min-height: 16px; margin-top: 4px; }
.mx-dialog .mx-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.mx-dialog .mx-dlg-actions button {
  min-height: 38px; padding: 8px 18px; border-radius: var(--match-r-action); font-weight: 600; font-size: 12px; cursor: pointer;
  border: 1px solid var(--match-border); background: var(--match-card); color: var(--match-text);
}
.mx-dialog .mx-dlg-actions button.mx-primary { background: var(--match-grad-primary); border-color: transparent; color: #fff; box-shadow: var(--match-action-shadow); }
.mx-dialog :focus-visible { outline: 3px solid color-mix(in srgb, var(--match-focus) 45%, transparent); outline-offset: 2px; }
.mx-dialog table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mx-dialog th, .mx-dialog td { padding: 6px 8px; border-bottom: 1px solid var(--match-border); text-align: center; }
.mx-dialog th { font-size: 10.5px; font-weight: 600; }
.mx-dialog td:first-child, .mx-dialog th:first-child { text-align: left; }
.mx-dialog .mx-dlg-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 14px; margin-bottom: 12px; font-size: 12px; }
.mx-dialog .mx-dlg-meta b { display: block; font-size: 10px; font-weight: 600; color: var(--match-muted); letter-spacing: .4px; }

/* ---------- Animaciones (breves; ninguna permanente) ---------- */
@keyframes mxShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }            /* = sev2Pulse */
@keyframes mxRowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes mxDialogIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } } /* = mpIn */

/* Movimiento reducido: sin animaciones ni transiciones; los anillos
   aparecen directamente con su valor. (El modo de bajo consumo de SINERGIA,
   html.lowPowerV771, ya las anula globalmente.) */
@media (prefers-reduced-motion: reduce) {
  #matchApp, .mx-dialog-backdrop {
    --match-dur: 0s;
    --match-dur-ring: 0s;
    --match-anim-shimmer: none;
    --match-anim-rowin: none;
    --match-anim-dialog: none;
  }
}

/* ---------- Responsive ---------- */
/* Doce meses legibles + año + tres anillos necesitan ~1160 px de módulo. */
@container matchapp (max-width: 1160px) {
  #matchApp .mx-head { grid-template-columns: 1fr; }
  #matchApp .mx-rings { justify-content: space-around; }
}
@media (max-width: 1100px) {
  #matchApp .mx-status { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #matchApp .mx-frow { grid-template-columns: 160px minmax(0, 1fr); }
  #matchApp .mx-period { flex-direction: column; align-items: stretch; }
  #matchApp .mx-year { flex-direction: row; align-items: center; gap: 10px; border-right: 0; padding-right: 0; }
  #matchApp .mx-year-chip { align-self: center; }
}
@media (max-width: 900px) {
  #matchApp, .mx-dialog-backdrop { --match-sticky-top: 62px; }  /* topbar de 56 px */
  #matchApp .mx-th-full { display: none; }
  #matchApp .mx-th-short { display: inline; }
}
@media (max-width: 720px) {
  #matchApp { font-size: 12px; gap: 10px; }
  #matchApp .mx-frow { grid-template-columns: 1fr; gap: 4px; padding: 7px 0; }
  #matchApp .mx-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #matchApp .mx-status { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #matchApp .mx-stat strong { font-size: 19px; }
  #matchApp .mx-rings { gap: 2px; padding: 8px 4px; }
  #matchApp .mx-ring { min-width: 0; flex: 1; }
  #matchApp .mx-ring svg { width: 52px; height: 52px; }
  #matchApp .mx-filters { padding: 2px 12px; }
  /* Barra de trabajo: buscador a lo ancho; debajo LIMPIAR y GUARDAR. */
  #matchApp .mx-toolbar { grid-template-columns: 1fr 1fr; padding: 10px; gap: 8px; }
  #matchApp .mx-searchbox { grid-column: 1 / -1; }
  #matchApp :is(.mx-clear, .mx-save) { padding: 8px 10px; font-size: 11.5px; }
  #matchApp .mx-invalid-help { justify-self: stretch; justify-content: center; }
  #matchApp .mx-exports { margin-left: 0; width: 100%; }
  #matchApp .mx-export { flex: 1; }
  #matchApp { --match-table-reserve: 365px; }  /* barra de trabajo en dos filas */
  #matchApp .mx-tablewrap { min-height: 280px; }
  /* Solo el CÓDIGO AO queda fijo (~30% del ancho): fijar también la
     descripción ocuparía casi toda la pantalla y ocultaría las demás. */
  #matchApp .mx-table { min-width: 940px; }
  #matchApp .mx-col-codigo { width: 108px; }
  #matchApp .mx-col-descripcion { width: 210px; }
  #matchApp .mx-code { font-size: 10.5px; }
  #matchApp .mx-table tbody tr:not(.mx-g-producto):not(.mx-g-actividad) td.mx-c-codigo,
  #matchApp .mx-table thead th.mx-th-codigo { position: sticky; left: 0; }
  #matchApp .mx-table tbody td.mx-c-codigo { z-index: 2; box-shadow: 2px 0 4px rgba(28,48,71, .08); }
  #matchApp .mx-table thead th.mx-th-codigo { z-index: 4; }
  #matchApp .mx-g-producto td, #matchApp .mx-g-actividad td { font-size: 11px; }
  #matchApp .mx-foot { flex-direction: column; align-items: stretch; }
  #matchApp .mx-pager { justify-content: space-between; }
}
