/* =====================================================================
   Share Reports: sistema visual del "informe de dirección"
   - Una sola familia (Archivo, eje de ancho variable): expandida para las
     cifras protagonistas, semicondensada para tablas densas.
   - Cifras siempre con números tabulares.
   - El color del semáforo se reserva para estado; el resto es tinta y papel.
   ===================================================================== */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../lib/fonts/archivo/archivo-latin-wdth-wght.woff2") format("woff2");
}

:root {
  /* Marca */
  --brand: #2B2457;
  --brand-2: #3A3270;
  --mint: #4FD1C5;

  /* Tinta y papel */
  --ink: #1C1A36;
  --ink-2: #4A4868;
  --ink-3: #6B6985; /* 4.8:1 sobre --canvas; el anterior #75738F quedaba en 4.2 */
  --rule: #E2E3EB;
  --rule-strong: #C9CAD8;
  --paper: #FFFFFF;
  --canvas: #F4F5F8;
  --hover: #F7F7FB;
  --series: #6150C8;
  --seriesLight: #9D8FE3;

  /* Estado (semáforo) */
  --pos: #1F7A55;
  --pos-bg: #E4F2EA;
  --cal: #8F5A0C;
  --cal-bg: #FBEFD6;
  --neg: #B42318;
  --neg-bg: #FBE5E2;

  /* Barra lateral */
  --side-fg: #C9C4E6;
  --side-fg-strong: #FFFFFF;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .10);

  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 6px;

  /* Bootstrap: que sus componentes hereden la tinta y la familia */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--canvas);
  --bs-border-color: var(--rule);
  --bs-link-color-rgb: 43, 36, 87;
  --bs-link-hover-color-rgb: 28, 26, 54;
}

/* 16 px también en celular: abajo de eso el texto de cuerpo cuesta trabajo leerlo en pantalla chica. */
html { font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

:focus-visible {
  /* Morado sobre papel (6:1). El menta apenas llegaba a 1.9:1 sobre blanco y no se veía el foco. */
  outline: 2px solid var(--series);
  outline-offset: 2px;
}
/* Sobre el índigo de la barra lateral el menta sí contrasta (7.5:1). */
.app-sidebar :focus-visible { outline-color: var(--mint); }

.btn:focus-visible, .form-select:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(97, 80, 200, .35);
  border-color: var(--brand-2);
}

/* Controles de Bootstrap sobre papel, con la marca en lugar del azul por defecto */
.form-select, .form-control { background-color: var(--paper); color: var(--ink); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* El rojo de Bootstrap se alinea al ladrillo del sistema */
.text-danger { color: var(--neg) !important; }
.text-warning { color: var(--cal) !important; }
.text-success { color: var(--pos) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------
   Estructura: barra lateral + columna principal
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--brand);
  display: flex;
  flex-direction: column;
  transition: margin-left .2s ease-in-out;
}

.app-sidebar-brand {
  padding: 1.4rem 1.5rem .2rem;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.app-sidebar-brand .brand-accent { color: var(--mint); }
a.app-sidebar-brand { text-decoration: none; padding-bottom: .45rem; }
.app-sidebar-brand img { display: block; height: 28px; width: auto; }

.app-sidebar-product {
  padding: 0 1.5rem;
  color: var(--side-fg);
  font-size: .8rem;
}

.app-sidebar-tenant {
  margin: 1rem 1.5rem .5rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: var(--side-fg);
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-nav { display: flex; flex-direction: column; padding-bottom: 2rem; }

.app-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1.5rem;
  color: var(--side-fg);
  border-left: 3px solid transparent;
  font-size: .93rem;
}
.app-sidebar-nav .nav-link:hover { color: var(--side-fg-strong); background: var(--side-hover); }
.app-sidebar-nav .nav-link.active {
  color: var(--side-fg-strong);
  background: var(--side-active);
  border-left-color: var(--mint);
}
.app-sidebar-nav .nav-link:focus-visible { outline-offset: -2px; }
.app-sidebar-nav svg { flex-shrink: 0; }

.app-sidebar-nav .nav-group-toggle { width: 100%; border: 0; background: transparent; text-align: left; }
.app-sidebar-nav .nav-group-toggle.active { border-left-color: transparent; background: transparent; color: var(--side-fg-strong); }
.app-sidebar-nav .nav-group-chevron { transition: transform .15s ease-in-out; flex-shrink: 0; opacity: .7; }
.app-sidebar-nav .nav-group-toggle[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
.app-sidebar-nav .nav-subitems { display: flex; flex-direction: column; }
.app-sidebar-nav .nav-subitems.collapse:not(.show) { display: none; }
.app-sidebar-nav .nav-subitems .nav-link { padding: .42rem 1.5rem .42rem 3.2rem; font-size: .88rem; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-navbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: .6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-navbar-toggle {
  display: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  padding: .35rem .55rem;
  min-width: 44px;
  min-height: 44px;
}

/* Selector de corte (único control de periodo del sitio) */
.period-picker { display: flex; align-items: center; gap: .5rem; margin: 0; }
.period-picker label { color: var(--ink-2); font-size: .88rem; margin: 0; }
.period-picker .form-select {
  width: auto;
  font-size: .92rem;
  font-weight: 600;
  padding: .3rem 2rem .3rem .65rem;
  border-color: var(--rule-strong);
  border-radius: 4px;
}

.app-navbar-user { display: flex; align-items: center; gap: .9rem; margin-left: auto; }
.app-navbar-user-name { font-weight: 600; font-size: .92rem; line-height: 1.2; }
.app-navbar-user-role { font-size: .8rem; color: var(--ink-3); }
.app-navbar-user .btn { border-radius: 4px; }

.app-content { flex: 1; padding: 2rem; max-width: 1440px; width: 100%; }

@media (max-width: 900px) {
  .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; margin-left: -240px; overflow-y: auto; }
  .app-shell.sidebar-open .app-sidebar { margin-left: 0; box-shadow: 0 0 0 100vmax rgba(28, 26, 54, .35); }
  .app-navbar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .app-navbar { padding: .6rem 1rem; }
  .app-content { padding: 1.25rem 1rem; }
}

/* ---------------------------------------------------------------------
   Encabezado de página
   --------------------------------------------------------------------- */
.rpt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-bottom: 1.5rem;
}
.rpt-title {
  font-size: 1.85rem;
  font-weight: 650;
  font-stretch: 108%;
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 0 0 .3rem;
}
.rpt-context { color: var(--ink-2); margin: 0; max-width: 70ch; }
.rpt-back { font-size: .9rem; color: var(--ink-2); text-decoration: none; display: inline-block; margin-bottom: .35rem; }
.rpt-back:hover { color: var(--ink); text-decoration: underline; }

.scope-tag {
  font-size: .82rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-2);
  background: var(--paper);
  white-space: nowrap;
}
.scope-tag.is-full { border-color: var(--brand); color: var(--brand); }

/* Filtros propios de una página (universo / región / desarrollo) */
.rpt-filters { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; margin-bottom: 1.75rem; }
.rpt-filters .form-label { font-size: .82rem; color: var(--ink-2); margin-bottom: .25rem; }
.rpt-filters .form-select { min-width: 13rem; font-size: .92rem; border-color: var(--rule-strong); border-radius: 4px; }

/* ---------------------------------------------------------------------
   Paneles
   --------------------------------------------------------------------- */
.rpt-panel,
.app-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.rpt-panel { padding: 1.35rem 1.5rem; margin-bottom: 1.5rem; }
.rpt-panel.is-flush { padding: 0; }
.rpt-panel.is-flush .rpt-panel-head { padding: 1.35rem 1.5rem 0; }
.rpt-panel.is-flush .rpt-foot { padding: 0 1.5rem 1.2rem; }

.rpt-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
  margin-bottom: 1rem;
}
.rpt-panel-title { font-size: 1.08rem; font-weight: 650; margin: 0; }
.rpt-panel-sub { color: var(--ink-3); font-size: .86rem; margin: .15rem 0 0; }

.rpt-foot { color: var(--ink-3); font-size: .84rem; margin: .9rem 0 0; }
.rpt-lead { font-size: 1.02rem; color: var(--ink-2); margin: 0 0 1rem; max-width: 72ch; }
.rpt-lead strong { color: var(--ink); font-weight: 650; }
.rpt-empty { color: var(--ink-3); margin: 0; }

.rpt-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
.rpt-grid > .rpt-panel { margin-bottom: 0; }
.rpt-grid + .rpt-panel, .rpt-grid + .rpt-grid { margin-top: 1.5rem; }
@media (min-width: 1100px) {
  .rpt-grid.is-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .rpt-grid.is-halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-grid.is-8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
}
.rpt-grid { margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------------
   La cuenta: directa + HCS − egresos = resultado neto
   --------------------------------------------------------------------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: .9rem;
}
.ledger-item { padding: 1.3rem 1.5rem 1.35rem; position: relative; min-width: 0; }
.ledger-item + .ledger-item { border-left: 1px solid var(--rule); }
.ledger-op {
  position: absolute;
  left: -.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
}
.ledger-label { color: var(--ink-2); font-size: .9rem; margin: 0 0 .35rem; }
.ledger-value {
  font-size: 1.55rem;
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: -.01em;
  line-height: 1.1;
  white-space: nowrap;
}
.ledger-cur { font-size: .6em; font-weight: 500; color: var(--ink-3); margin-right: .15em; vertical-align: .35em; }
.ledger-item.is-result { background: var(--brand); color: #fff; border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }
.ledger-item.is-result .ledger-label { color: #D6D1F2; }
.ledger-item.is-result .ledger-value { font-size: 2.3rem; font-weight: 650; font-stretch: 118%; }
.ledger-item.is-result .ledger-cur { color: #B9B2E6; }
.ledger-item.is-result.is-negative { background: var(--neg); }
.ledger-item.is-result.is-negative .ledger-label, .ledger-item.is-result.is-negative .ledger-cur { color: #FBD5D0; }
.ledger-note { font-size: .82rem; color: #D6D1F2; margin: .45rem 0 0; }
.ledger-item.is-result.is-negative .ledger-note { color: #FBD5D0; }

@media (max-width: 1099px) {
  .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ledger-item.is-result { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
  .ledger-item.is-result .ledger-op { left: 1.5rem; top: -.8rem; transform: none; }
}
@media (max-width: 640px) {
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger-item + .ledger-item { border-left: 0; border-top: 1px solid var(--rule); }
  .ledger-op { left: 1.5rem; top: -.8rem; transform: none; }
  .ledger-value { font-size: 1.4rem; }
  .ledger-item.is-result .ledger-value { font-size: 1.9rem; }
}

.ledger-aside { color: var(--ink-2); font-size: .92rem; margin: 0 0 2rem; }
.ledger-aside strong { color: var(--ink); font-weight: 600; }

/* Cifras sueltas (tarjetas de indicador para páginas que no son la cuenta) */
.figures { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.figure { background: var(--paper); padding: 1.15rem 1.35rem 1.2rem; min-width: 0; }
.figure-label { color: var(--ink-2); font-size: .88rem; margin: 0 0 .3rem; }
.figure-value { font-size: 1.75rem; font-weight: 600; font-stretch: 110%; line-height: 1.1; white-space: nowrap; }
.figure-unit { font-size: .55em; font-weight: 500; color: var(--ink-3); margin-left: .2em; }
.figure-note { font-size: .8rem; color: var(--ink-3); margin: .35rem 0 0; }

/* Revisión semanal: azul = se captura en la junta; rayado = sin fuente en Share. */
.figure.is-captured { background: #EEF2FB; box-shadow: inset 3px 0 0 #3B5BDB; }
.figure.is-captured .figure-label { color: #2F4AA8; }
.figure.is-nosource { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 8px, #F1F1F5 8px, #F1F1F5 16px); }
.figure.is-nosource .figure-value { color: var(--ink-3); }
.capture-block { background: #EEF2FB; border: 1px solid #C9D4F5; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.capture-block h2 { color: #2F4AA8; }

/* Revisión semanal, convención de la maqueta aprobada: gris = automático, azul (--cap) = se captura en la junta, rayado = sin fuente. */
:root { --cap: #1F4FBF; --cap-bg: #F3F7FF; --cap-rule: #A9C0EE; }
.figures.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .figures.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.figure .figure-note .strong { font-weight: 600; }
.figure.is-nosrc { background: repeating-linear-gradient(135deg, #FAFAFC 0 8px, #F4F5F8 8px 16px); }
.figure.is-nosrc .figure-value { color: var(--ink-3); font-size: 1.1rem; font-weight: 500; white-space: normal; line-height: 1.3; }
.auto-tag { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--canvas); border-radius: 3px; padding: .1rem .4rem; white-space: nowrap; }
.cap-tag { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cap); background: var(--cap-bg); border-radius: 3px; padding: .1rem .4rem; white-space: nowrap; }
.cap { color: var(--cap); }
.nosrc { border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--ink-2); background: repeating-linear-gradient(135deg, #FAFAFC 0 8px, #F4F5F8 8px 16px); }
.nosrc h3 { font-size: .95rem; font-weight: 650; margin: 0 0 .35rem; color: var(--ink); }
.nosrc p { margin: 0; font-size: .88rem; }
.spark { display: block; width: 100%; height: 64px; }
.week-selector .btn { border-radius: 4px; padding: .25rem .55rem; line-height: 1; }

/* Captura (azul) en la minuta: campos, filas y la barra de botones */
.cap-field { display: block; width: 100%; border: 1px solid var(--cap-rule); background: var(--cap-bg); color: var(--cap); border-radius: 4px; padding: .5rem .7rem; font-size: .92rem; line-height: 1.45; min-height: 2.5rem; font-family: var(--font); }
.cap-field.sm { min-height: 0; padding: .3rem .6rem; }
.cap-field.auto { width: auto; display: inline-block; }
.cap-field.is-text { white-space: pre-line; }
.cap-field:focus { outline: 2px solid var(--cap-rule); outline-offset: 1px; border-color: var(--cap); }
.cap-field.is-invalid { border-color: var(--neg); }
.cap-field::placeholder { color: #7D97D6; }
textarea.cap-field { resize: vertical; }
.cap-label { display: block; font-size: .8rem; color: var(--ink-2); margin: 0 0 .25rem; }
.cap-row { margin-bottom: .75rem; }
.cap-row:last-child { margin-bottom: 0; }
.cap-inline { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-start; }
.cap-inline > .evidencia { flex: 1 1 12rem; }
.cap-nums .cap-field { width: 8rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar .btn { border-radius: 4px; }
.status-cap { background: var(--cap-bg); color: var(--cap); }
.rpt-panel.is-cap { background: #FBFCFF; }
.rpt-table tfoot.is-actions td { border-top: 1px solid var(--rule); font-weight: 400; padding-top: .6rem; }
.rpt-table td .cap-field.sm { font-size: .88rem; }
.evidencia-off { display: none; font-size: .82rem; }
.evidencia.d-none + .evidencia-off { display: inline; }

/* Minuta: encabezado, temas (gris automático | azul capturado) y cifras clave */
.minuta-page { margin-bottom: 2rem; }
.minuta-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem 2rem; margin-bottom: 1.5rem; }
.minuta-head dt { font-size: .8rem; color: var(--ink-3); font-weight: 500; margin: 0; }
.minuta-head dt label { margin: 0; }
.minuta-head dd { margin: 0; font-weight: 600; }
.minuta-head dd .cap-field { font-weight: 500; margin-top: .15rem; }
.tema { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); margin-bottom: 1.25rem; overflow: hidden; }
@media (min-width: 1000px) { .tema { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.tema-side { padding: 1.2rem 1.5rem; min-width: 0; }
.tema-side + .tema-side { border-left: 1px solid var(--rule); }
@media (max-width: 999px) { .tema-side + .tema-side { border-left: 0; border-top: 1px solid var(--rule); } }
.tema-side.is-cap { background: #FBFCFF; }
.tema-title { font-size: 1rem; font-weight: 650; margin: 0 0 .15rem; display: flex; align-items: center; gap: .6rem; }
.tema-sub { color: var(--ink-3); font-size: .84rem; margin: 0 0 .9rem; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem 1.25rem; }
.kv div p { margin: 0; font-size: .8rem; color: var(--ink-3); }
.kv div strong { font-size: 1.25rem; font-weight: 650; font-stretch: 108%; line-height: 1.15; }
.kv div small { display: block; color: var(--ink-3); font-size: .78rem; }
.signal-attention { color: var(--neg); font-weight: 600; }
.signal-watch { color: var(--cal); font-weight: 600; }
.signal-ok { color: var(--pos); }

/* ---------------------------------------------------------------------
   Tablas
   --------------------------------------------------------------------- */
.rpt-table-wrap { overflow-x: auto; margin: 0 -1.5rem; padding: 0 1.5rem; }
.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-stretch: 92%;
  font-size: .92rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.rpt-table th {
  font-weight: 500;
  color: var(--ink-3);
  font-size: .82rem;
  text-align: left;
  padding: .45rem .6rem .5rem;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
  vertical-align: bottom;
}
.rpt-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.rpt-table th:first-child, .rpt-table td:first-child { padding-left: 0; }
.rpt-table th:last-child, .rpt-table td:last-child { padding-right: 0; }
.rpt-table tbody tr:hover > td { background: var(--hover); }
.rpt-table tbody tr:last-child > td { border-bottom: 0; }
.rpt-table .num { text-align: right; white-space: nowrap; }
.rpt-table .rank { color: var(--ink-3); width: 2rem; }
.rpt-table .muted { color: var(--ink-3); }
.rpt-table .strong { font-weight: 600; }
.rpt-table .neg { color: var(--neg); }
.rpt-table .up { color: var(--pos); }
.rpt-table .down { color: var(--neg); }
.rpt-table .col-total { border-left: 1px solid var(--rule); font-weight: 600; }
.rpt-table tfoot td { border-top: 1px solid var(--rule-strong); border-bottom: 0; font-weight: 600; padding-top: .7rem; }
.rpt-table a { color: var(--ink); text-decoration: none; font-weight: 500; }
.rpt-table a:hover { text-decoration: underline; text-underline-offset: 2px; }
.rpt-table .sub { display: block; color: var(--ink-3); font-size: .82rem; }
.rpt-table tr.is-highlight > td { background: #F1EFFB; }

/* Tablas repetidas (Tablero): mismas columnas en todas para que los periodos queden alineados */
.rpt-table.is-fixed { table-layout: fixed; min-width: 860px; }
.rpt-table.is-fixed th:first-child { width: 24%; }
.rpt-table.is-fixed th:last-child { width: 8.5rem; }
.rpt-table.is-fixed td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tira de calor: la celda de un periodo negativo toma el color del estado de su fila.
   Fila "Calendario" o "Positivo" -> ocre (no alarma); fila "Estructural" -> ladrillo. */
.rpt-table td.heat-cal { background: var(--cal-bg); color: var(--cal); }
.rpt-table td.heat-neg { background: var(--neg-bg); color: var(--neg); font-weight: 500; }
.rpt-table tbody tr:hover > td.heat-cal { background: #F6E6C3; }
.rpt-table tbody tr:hover > td.heat-neg { background: #F7D5D0; }
.rpt-table td.heat-cal, .rpt-table td.heat-neg { box-shadow: inset 0 0 0 2px var(--paper); }

/* Estado del semáforo: forma + palabra, nunca solo color */
.status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  font-stretch: 100%;
  padding: .12rem .55rem .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-mark { font-size: .7rem; line-height: 1; }
.status-pos { background: var(--pos-bg); color: var(--pos); }
.status-cal { background: var(--cal-bg); color: var(--cal); }
.status-neg { background: var(--neg-bg); color: var(--neg); }
.status-unk { background: var(--canvas); color: var(--ink-3); }

/* Barra de magnitud (participación) */
.mag { display: flex; align-items: center; gap: .6rem; min-width: 9rem; }
.mag-track { flex: 1; height: 6px; background: #ECEDF2; border-radius: 999px; overflow: hidden; }
.mag-track > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.mag-value { min-width: 3.4em; text-align: right; }

/* Etiqueta pequeña de tipo en celdas (Ranking de quejas) */
.chips { display: flex; flex-wrap: wrap; gap: .25rem .35rem; }
.mag-track.is-neg { display: flex; justify-content: flex-end; }
.mag-track.is-neg > span { background: var(--neg); }
nav.chips { margin-top: .25rem; }
nav.chips .chip { font-size: .86rem; padding: .25rem .6rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
nav.chips .chip:hover { border-color: var(--brand); }
.chip { font-size: .78rem; color: var(--ink-2); background: var(--canvas); border-radius: 4px; padding: .05rem .4rem; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Tira de estados: cuántas regiones/desarrollos hay en cada color del semáforo
   (gráfica en HTML: se imprime bien y no depende de JavaScript)
   --------------------------------------------------------------------- */
.strip-block { margin: 0 0 1.25rem; }
.strip { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--canvas); }
.strip > span { display: block; min-width: 4px; }
.strip > span:first-child { border-radius: 999px 0 0 999px; }
.strip > span:last-child { border-radius: 0 999px 999px 0; }
.strip > span:only-child { border-radius: 999px; }
.strip-pos { background: var(--pos); }
.strip-cal { background: #C98A12; }
.strip-neg { background: var(--neg); }
.strip-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: .7rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--ink-2); }
.strip-legend li { display: flex; align-items: center; gap: .5rem; }
.strip-legend strong { color: var(--ink); font-size: 1.15rem; font-weight: 650; font-stretch: 110%; }

/* Barra de composición (p. ej. cobranza directa vs. HCS) */
.split { display: flex; gap: 2px; height: 28px; border-radius: 4px; overflow: hidden; margin: .25rem 0 .75rem; }
.split > span { display: block; min-width: 4px; }
.split-a { background: var(--brand); }
.split-b { background: var(--seriesLight, #9D8FE3); }
.split-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem 1.5rem; }
.split-key { display: flex; gap: .6rem; align-items: flex-start; }
.split-swatch { width: .8rem; height: .8rem; border-radius: 2px; margin-top: .3rem; flex-shrink: 0; }
.split-key p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.split-key strong { display: block; color: var(--ink); font-size: 1.25rem; font-weight: 650; font-stretch: 110%; }

/* Antigüedad de las quejas abiertas: rampa de un solo tono que termina en alerta */
.age-strip { display: flex; gap: 2px; height: 28px; border-radius: 4px; overflow: hidden; margin: .25rem 0 .75rem; background: var(--canvas); }
.age-strip > span { display: block; min-width: 4px; }
.age-0 { background: #C9C2F0; }
.age-1 { background: #9D8FE3; }
.age-2 { background: #6150C8; }
.age-3 { background: var(--neg); }
.age-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem 1.25rem; }

/* Barra de celda: magnitud dentro de una tabla (conteos) */
.cell-bar { display: flex; align-items: center; gap: .55rem; justify-content: flex-end; }
.cell-bar .mag-track { flex: 0 0 5.5rem; }

/* ---------------------------------------------------------------------
   Nota del efecto calendario (compacta, junto al semáforo)
   --------------------------------------------------------------------- */
.cal-note {
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-top: .9rem;
  font-size: .88rem;
  color: var(--ink-2);
}
.cal-note-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: 0; }
.cal-note-legend { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.cal-note details { margin-top: .35rem; }
.cal-note summary {
  display: inline;
  cursor: pointer;
  color: var(--brand);
  font-weight: 500;
  list-style: none;
}
.cal-note summary::-webkit-details-marker { display: none; }
.cal-note summary:hover { text-decoration: underline; }
.cal-note details[open] summary { margin-bottom: .5rem; }
.cal-note details p { margin: .5rem 0 0; max-width: 78ch; line-height: 1.55; }

/* ---------------------------------------------------------------------
   Gráficas (ApexCharts)
   --------------------------------------------------------------------- */
.rpt-chart { min-height: 300px; margin: 0 -.5rem; }
.apexcharts-tooltip { font-family: var(--font) !important; border-radius: 4px !important; box-shadow: 0 4px 14px rgba(28, 26, 54, .12) !important; }
.apexcharts-text, .apexcharts-legend-text { font-family: var(--font) !important; }

/* ---------------------------------------------------------------------
   Líder de región (Distribución)
   --------------------------------------------------------------------- */
.leader-name { font-size: 1.6rem; font-weight: 650; font-stretch: 110%; line-height: 1.15; margin: 0 0 .25rem; }
.leader-share { font-size: 3rem; font-weight: 650; font-stretch: 118%; line-height: 1; color: var(--brand); margin: 1rem 0 .2rem; }
.leader-share small { font-size: .45em; font-weight: 500; color: var(--ink-3); }

/* ---------------------------------------------------------------------
   Pantallas de acceso (login / acceso denegado): panel de marca + formulario
   --------------------------------------------------------------------- */
.auth-body { background: var(--canvas); min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  color: #fff;
  padding: 3rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}
.auth-brand-logo { display: block; height: 34px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 26rem; margin-bottom: 4rem; }
.auth-brand-title {
  font-size: 2.6rem;
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: -.015em;
  line-height: 1.05;
  margin: 0 0 1rem;
}
.auth-brand-text { color: #D6D1F2; font-size: 1.05rem; line-height: 1.55; margin: 0; }
/* La "A" de la marca, grande y casi transparente, anclada a la esquina: textura, no ilustración. */
.auth-brand-mark {
  position: absolute;
  right: -7rem;
  bottom: -6rem;
  width: 30rem;
  height: auto;
  opacity: .09;
  pointer-events: none;
  user-select: none;
}

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-card {
  width: 100%;
  max-width: 25rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 2.5rem 2.25rem 2.25rem;
  box-shadow: 0 12px 32px rgba(28, 26, 54, .07);
}
.auth-logo { display: block; height: 46px; width: auto; margin: 0 auto 1.75rem; }
.auth-title { font-size: 1.5rem; font-weight: 650; font-stretch: 105%; text-align: center; margin: 0 0 .4rem; }
.auth-text { color: var(--ink-2); text-align: center; margin: 0 0 1.75rem; line-height: 1.5; }
.auth-card .form-label { font-size: .88rem; font-weight: 500; color: var(--ink-2); margin-bottom: .35rem; }
.auth-card .form-control { border-color: var(--rule-strong); border-radius: 6px; padding: .65rem .8rem; font-size: 1rem; }
.auth-card .form-control::placeholder { color: #A3A1B8; }
.auth-card .form-check-label { font-size: .92rem; color: var(--ink-2); }
.auth-card .btn-primary { background: var(--brand); border-color: var(--brand); border-radius: 6px; padding: .7rem; font-weight: 600; font-size: 1rem; }
.auth-card .btn-primary:hover, .auth-card .btn-primary:focus-visible { background: var(--brand-2); border-color: var(--brand-2); }
.auth-card .btn-outline-secondary { border-radius: 6px; padding: .65rem; }
.auth-card .alert { border-radius: 6px; }
.auth-note { color: var(--ink-3); font-size: .84rem; text-align: center; margin: 1.25rem 0 0; }
.auth-foot { color: var(--ink-3); font-size: .82rem; margin: 1.5rem 0 0; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand-panel { padding: 1.25rem 1.5rem; flex-direction: row; align-items: center; }
  .auth-brand-logo { height: 26px; }
  .auth-brand-copy { margin: 0; }
  .auth-brand-title { font-size: 1rem; font-stretch: 100%; margin: 0; }
  .auth-brand-text, .auth-brand-mark { display: none; }
  .auth-main { justify-content: flex-start; padding: 2rem 1rem; }
  .auth-card { padding: 2rem 1.5rem 1.75rem; }
}

/* Minuta: aviso de cambios sin guardar junto al botón Guardar de la barra superior. */
.minuta-dirty { color: var(--cal); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.minuta-dirty::before { content: "▲ "; font-size: .7em; vertical-align: .1em; }

/* ---------------------------------------------------------------------
   Impresión: dirección imprime los tableros para juntas
   --------------------------------------------------------------------- */
@media print {
  .app-sidebar, .app-navbar, .rpt-filters, .cal-note summary { display: none !important; }
  .app-content { padding: 0; max-width: none; }
  body { background: #fff; }
  .rpt-panel, .ledger, .figures, .tema { break-inside: avoid; }
  .cal-note details > p { display: block !important; }
  .week-selector, .minuta-actions, .breadcrumb, .toolbar { display: none !important; }
  .cap-field { background: #fff; }
  .minuta-page { break-after: page; }
  .capture-block { border: 1px solid #999; background: #fff; }
}

/* The validation summary is always rendered; with no errors it is an empty box (red with .alert). */
.validation-summary-valid { display: none; }
