/* ──────────────────────────────────────────────────────────────────────── */
/* Buttons                                                                  */
/* ──────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--c-surface-2); }
.btn { font-weight: 700; }
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  box-shadow: 0 6px 16px rgba(14, 42, 71, 0.18);
}
.btn--primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn--ghost {
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--navy);
}
.btn--ghost:hover { background: #FBFCFD; border-color: var(--c-border-strong); }
.btn--sm { padding: 4px 10px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.btn__icon { font-size: 13px; }

/* ──────────────────────────────────────────────────────────────────────── */
/* Fields + selects                                                         */
/* ──────────────────────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.field__label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.select {
  appearance: none;
  padding: 7px 28px 7px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%236B7280' stroke-width='1.5' d='M3 4.5l3 3 3-3'/></svg>") no-repeat right 8px center;
  color: var(--c-text);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.select:focus { border-color: var(--c-accent); }

/* ──────────────────────────────────────────────────────────────────────── */
/* Segmented control                                                        */
/* ──────────────────────────────────────────────────────────────────────── */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.segmented button {
  padding: 5px 12px;
  border-radius: calc(var(--r-md) - 2px);
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.segmented button:hover { color: var(--c-text); }
.segmented button[aria-checked="true"],
.segmented button[aria-selected="true"] {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-xs);
}

/* Stacked variant — vertical list for narrow containers (e.g. rail) */
.segmented--stacked {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
}
.segmented--stacked button {
  justify-content: flex-start;
  text-align: left;
  padding: 7px 10px;
  width: 100%;
  white-space: normal;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* Toggle                                                                   */
/* ──────────────────────────────────────────────────────────────────────── */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--c-text);
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--c-border-strong);
  border-radius: var(--r-pill);
  transition: background var(--t-med);
  flex-shrink: 0;
}
.toggle__dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-med);
  box-shadow: var(--shadow-xs);
}
.toggle input:checked ~ .toggle__track { background: var(--c-accent); }
.toggle input:checked ~ .toggle__track .toggle__dot { transform: translateX(14px); }
.toggle input:disabled ~ .toggle__track { opacity: 0.4; cursor: not-allowed; }
.toggle--disabled { opacity: 0.5; cursor: not-allowed; }

/* ──────────────────────────────────────────────────────────────────────── */
/* Multiselect dropdown                                                     */
/* ──────────────────────────────────────────────────────────────────────── */

.ms-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ms-field > .field__label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--c-text-muted);
  letter-spacing: 0.02em;
}
.multiselect {
  position: relative;
}
.multiselect--inline .ms-popover {
  left: auto;
  right: 0;
  min-width: 260px;
  max-height: min(70vh, 520px);
}
.multiselect--inline .ms-popover__actions {
  flex-wrap: wrap;
  row-gap: 2px;
}
.multiselect--inline .ms-popover__actions button { white-space: nowrap; }

.ms-trigger {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 7px 10px 7px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ms-trigger:hover { border-color: var(--c-border-strong); }
.ms-trigger[aria-expanded="true"] {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.12);
}
.ms-trigger__summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-trigger__summary--empty {
  color: var(--c-text-faint);
  font-style: italic;
}
.ms-trigger__caret {
  color: var(--c-text-faint);
  font-size: 11px;
  margin-left: auto;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.ms-trigger[aria-expanded="true"] .ms-trigger__caret { transform: rotate(180deg); }

.ms-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  outline: 1px solid rgba(14, 140, 127, 0.08);
  overflow: hidden;
  flex-direction: column;
  max-height: 320px;
  animation: ms-fade var(--t-fast);
}
.ms-popover[hidden] { display: none; }
.ms-popover:not([hidden]) { display: flex; }
@keyframes ms-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ms-popover__search {
  padding: 8px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.ms-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-family: inherit;
}
.ms-search:focus { outline: none; border-color: var(--c-accent); }

.ms-popover__actions {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.ms-popover__actions button {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  color: var(--c-accent);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast);
}
.ms-popover__actions button:hover { background: var(--c-accent-weak); }
.ms-popover__sep {
  width: 1px;
  height: 14px;
  background: var(--c-border);
}

.ms-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  min-height: 40px;
}
.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--c-text);
  user-select: none;
  transition: background var(--t-fast);
}
.ms-option:hover { background: var(--c-surface-2); }
.ms-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ms-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--c-border-strong);
  background: var(--c-surface);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.ms-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.ms-option--checked .ms-check {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.ms-option--checked .ms-check::after { opacity: 1; }
.ms-option__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-list__empty {
  padding: 14px 12px;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
}

/* ──────────────────────────────────────────────────────────────────────── */
/* Cards                                                                    */
/* ──────────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
  transition: box-shadow var(--t-med);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}
.card:hover { box-shadow: var(--shadow-md); }
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.card__title {
  font-size: var(--fs-md);          /* 15.5px: titulo-insight (5.5) */
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.card__subtitle {
  font-size: var(--fs-sm);          /* .desc 12px muted (5.5) */
  color: var(--muted);
  margin-top: 2px;
}
.card__actions { display: flex; justify-content: flex-end; gap: var(--s-2); }

/* ──────────────────────────────────────────────────────────────────────── */
/* KPI cards                                                                */
/* ──────────────────────────────────────────────────────────────────────── */

/* Tarjeta KPI (§5.4): barra degradado 3px arriba, etiqueta 11px MAYÚSCULAS,
   valor 27px/800 navy tabular-nums, sub con <b> teal. */
.kpi-card {
  padding: 16px 18px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--grad);
}

.kpi-card__label {
  font-size: 11px;
  color: var(--slate);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kpi-card__value {
  font-size: var(--fs-xl);          /* 27px */
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--navy);
}
.kpi-card__sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.kpi-card__sub b { color: var(--teal); font-weight: 700; }

/* ──────────────────────────────────────────────────────────────────────── */
/* Chart card                                                               */
/* ──────────────────────────────────────────────────────────────────────── */

.chart-card { position: relative; }
.chart-surface { min-height: clamp(520px, 62vh, 780px); position: relative; }
.chart-surface[aria-busy="true"]::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.6s linear infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.chip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-1) 0;
}
.chip-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}
.chip-legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
}
/* Ingreso/Promoción no son caja: swatch tipo bigote (línea + caps, como en el chart) */
.chip-legend__swatch--bigotes {
  width: 16px;
  height: 10px;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(var(--chart-context), var(--chart-context)) left center / 2px 100% no-repeat,
    linear-gradient(var(--chart-context), var(--chart-context)) center center / 100% 2px no-repeat,
    linear-gradient(var(--chart-context), var(--chart-context)) right center / 2px 100% no-repeat;
}
.chip-legend__swatch--crecimiento { background: #DDE5EC; border-color: transparent; }
.chip-legend__swatch--mercado     { background: var(--teal-soft-2); border-color: transparent; }
.chip-legend__swatch--madurez     { background: #DDE5EC; border-color: transparent; }
.chip-legend__swatch--p50         { background: var(--navy); height: 3px; width: 16px; border: none; border-radius: 0; }
.chip-legend__swatch--p25-75      { background: repeating-linear-gradient(90deg, var(--chart-context) 0 4px, transparent 4px 7px); height: 2px; width: 16px; border: none; border-radius: 0; }
.chip-legend__swatch--employee {
  background: var(--teal);
  opacity: 0.75;
  transform: rotate(45deg) scale(0.8);
  border: none;
}
.chip-legend__swatch--convencionado {
  background: var(--navy);
  transform: rotate(45deg) scale(0.8);
  border: none;
}
.chip-legend__swatch--outlier {
  background: var(--coral);
  opacity: 0.85;
  transform: rotate(45deg) scale(0.8);
  border: none;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* Tables                                                                   */
/* ──────────────────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table thead th {
  position: sticky;
  top: 0;
  background: var(--navy);          /* 5.11 */
  font-weight: 600;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--navy);
  white-space: nowrap;
}
.table thead th:first-child { text-align: left; }
.table tbody td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  white-space: nowrap;
}
.table tbody td:first-child { text-align: left; font-weight: 500; }
.table tbody tr:nth-child(even) { background: var(--bg); }   /* zebra 5.11 */
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--teal-soft); }
.table tbody td b { color: var(--teal); font-weight: 700; }
.table tbody tr.tbl-total-row {
  background: var(--c-surface-2);
  border-top: 2px solid var(--c-border);
}
.table tbody tr.tbl-total-row:hover { background: var(--c-surface-2); }
.table tbody tr.tbl-total-row td { font-weight: 600; }

.table--compact thead th { padding: 8px 10px; }
.table--compact tbody td { padding: 7px 10px; }

/* Sortable column headers */
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { background: var(--navy-2); }
.th-sortable__arrow {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  vertical-align: baseline;
}
.th-sortable[aria-sort="ascending"] .th-sortable__arrow,
.th-sortable[aria-sort="descending"] .th-sortable__arrow {
  color: var(--mint);
}

/* Empleados card header: title + subtitle + search stacked; actions on the right */
.empleados-header__titles {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.empleados-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.empleados-search {
  margin-top: var(--s-1);
  width: 100%;
  max-width: 320px;
}

/* Zone chips inside resumen table */
.zchip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
}
.zchip--muted { color: var(--c-text-faint); background: transparent; }

/* Tabs numerados 5.3: small 10px arriba, subrayado 3px teal, sin cajas */
.tabs {
  display: inline-flex;
  gap: var(--s-5);
}
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 2px 2px 7px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--slate);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs button small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.tabs button:hover:not(:disabled) { color: var(--navy); }
.tabs button[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--teal);
}
.tabs button[aria-selected="true"] small { color: var(--teal); }
.tabs button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ──────────────────────────────────────────────────────────────────────── */
/* Info bar + empty states                                                  */
/* ──────────────────────────────────────────────────────────────────────── */

/* Callout (5.7): teal-soft con borde izquierdo 3px teal */
.info-bar {
  padding: var(--s-3) var(--s-4);
  background: var(--teal-soft);
  color: var(--ink);
  border: none;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}
.info-bar--danger {
  background: var(--coral-soft);
  color: var(--coral);
  border-left-color: var(--coral);
}

.empty {
  padding: var(--s-8);
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  text-align: center;
  color: var(--c-text-muted);
}
.empty[hidden] { display: none; }
.empty:not([hidden]) { display: flex; }
.empty__title {
  font-size: var(--fs-md);
  color: var(--navy);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: var(--navy);
  color: white;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  animation: toastIn var(--t-med);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ──────────────────────────────────────────────────────────────────────── */
/* Drawer (§5.8): desliza desde la derecha, overlay navy translúcido        */
/* ──────────────────────────────────────────────────────────────────────── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 42, 71, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 80;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(14, 42, 71, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 81;
  display: flex;
  flex-direction: column;
}
.drawer--open .drawer { transform: translateX(0); }
.drawer--open .drawer-overlay { opacity: 1; pointer-events: auto; }

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-6) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.drawer__title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--navy);
}
.drawer__sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.drawer__close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
}
.drawer__close:hover { background: var(--bg); color: var(--navy); }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s-5) var(--s-6); }
.drawer__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.drawer__foot-derecha { display: flex; gap: var(--s-2); }

/* Formulario del drawer */
.form-seccion { margin-bottom: var(--s-5); }
.form-seccion > h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--s-3);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3) var(--s-4);
}
.form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field > label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--slate);
}
.form-field input, .form-field select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-family: inherit;
  min-width: 0;
}
.form-field input:focus, .form-field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.12);
}
.form-field input[aria-invalid="true"] { border-color: var(--coral); }

/* ──────────────────────────────────────────────────────────────────────── */
/* Página admin: barra de filtros, paginación                               */
/* ──────────────────────────────────────────────────────────────────────── */

.filtros-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: flex-end;
}
.filtros-bar .field { min-width: 130px; flex: 0 1 auto; }
.filtros-bar .field--buscar { flex: 1 1 220px; }
.filtros-bar .field--buscar input {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-family: inherit;
  width: 100%;
}
.filtros-bar .field--buscar input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.12);
}
.filtros-bar__acciones { margin-left: auto; display: flex; gap: var(--s-2); }

.paginacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--slate);
}
.paginacion__botones { display: flex; gap: var(--s-2); }

.fila-clickable { cursor: pointer; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Dropzone del cargue masivo */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-8) var(--s-5);
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-md);
  color: var(--slate);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  text-align: center;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone--activa {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--ink);
}
.dropzone--con-archivo { border-style: solid; border-color: var(--teal); }
.dropzone__icono { font-size: 22px; color: var(--teal); }

/* Reporte de cargue */
.reporte-resumen { margin-bottom: var(--s-3); }
.reporte-tabla { max-height: 280px; overflow-y: auto; }
.form-grid--p5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid--p5 input { padding: 6px 6px; font-size: 12px; }

/* ── Tab 04 Bandas ─────────────────────────────────────────────────────── */

.bandas-controles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  align-items: flex-end;
}
.bandas-controles .field { min-width: 0; }

.tabla-bandas tbody td { padding: 5px 8px; }
.tabla-bandas input[type="number"] {
  width: 92px;
  padding: 5px 7px;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tabla-bandas input[type="number"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.12);
}
.tabla-bandas input[type="number"][aria-invalid="true"] {
  border-color: var(--coral);
  background: var(--coral-soft);
}
.tabla-bandas input[type="number"]:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

/* Percentil de comparación junto a la referencia (P60, P50…) */
.bandas-ref-p {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

/* Punto teal junto al grado cuando la fila tiene cambios sin guardar */
.bandas-fila--dirty td:first-child::after {
  content: "●";
  color: var(--teal);
  font-size: 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.bandas-acciones {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.bandas-dirty {
  margin-right: auto;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.bandas-dirty--on { color: var(--teal); font-weight: 700; }

/* Chips de leyenda propios de la gráfica de impacto */
.chip-legend__swatch--fantasma {
  background: transparent;
  border: 1.5px dashed var(--navy);
  opacity: 0.5;
}
.chip-legend__swatch--emp-igual {
  background: var(--chart-context);
  opacity: 0.9;
  transform: rotate(45deg) scale(0.8);
  border: none;
}
.chip-legend__swatch--emp-cambia {
  background: var(--teal);
  opacity: 0.9;
  transform: rotate(45deg) scale(0.8);
  border: none;
}
