/* Ferreira Seguros · Otimify — sistema visual
   Mundo heredado del sitio de la marca: rojo #D71920, negro #181818, Poppins + Inter.
   Estrategia de color: contenida — neutros + un acento. El rojo se reserva para
   urgencia y acción primaria; los estados usan tintes apagados para no competir. */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;450;500;600;700&display=swap');

:root {
  /* superficie */
  --papel:      #F4F4F6;
  --superficie: #FFFFFF;
  --superficie-2:#FAFAFB;
  --hundido:    #EDEDF0;

  /* tinta */
  --tinta:      #181818;
  --tinta-2:    #55555C;
  --tinta-3:    #7E7E87;
  --tinta-4:    #A5A5AE;

  /* líneas */
  --linea:      #E3E3E7;
  --linea-2:    #D0D0D6;
  --linea-3:    #B9B9C1;

  /* marca */
  --rojo:       #D71920;
  --rojo-hover: #B8141A;
  --rojo-prof:  #A90707;
  --rojo-tinte: #FFF3F3;
  --rojo-borde: #FFD9D9;

  /* estados funcionales (apagados a propósito: el rojo manda) */
  --ok:         #14713C;
  --ok-tinte:   #E6F4EC;
  --ok-borde:   #C3E5D2;
  --alerta:     #92590A;
  --alerta-tinte:#FDF4E3;
  --alerta-borde:#F0DCB4;
  --info:       #1F4F8F;
  --info-tinte: #EAF1FA;
  --info-borde: #C9DBF1;
  --verde-wa:   #25D366;

  /* profundidad */
  --sombra-1: 0 1px 2px rgba(24,24,28,.07), 0 1px 1px rgba(24,24,28,.04);
  --sombra-2: 0 2px 4px rgba(24,24,28,.07), 0 4px 12px rgba(24,24,28,.06);
  --sombra-3: 0 8px 16px rgba(24,24,28,.10), 0 24px 48px rgba(24,24,28,.14);

  --r-chico: 4px;
  --r: 7px;
  --r-grande: 11px;

  --rail: 236px;
  --barra: 60px;

  --fuente: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Poppins', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'cv05' 1, 'cv08' 1;
  -webkit-font-smoothing: antialiased;
}

/* superficies del navegador que igual son parte del diseño */
::selection { background: var(--rojo-borde); color: var(--rojo-prof); }
:focus-visible {
  outline: 2px solid var(--rojo);
  outline-offset: 2px;
  border-radius: var(--r-chico);
}
* { scrollbar-width: thin; scrollbar-color: var(--linea-3) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--linea-2);
  border-radius: 99px;
  border: 3px solid var(--papel);
}
*::-webkit-scrollbar-thumb:hover { background: var(--linea-3); }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--rojo); }

h1,h2,h3,h4 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* ─────────────────────────────  armazón  ───────────────────────────── */

.barra {
  position: fixed; inset: 0 0 auto 0; height: var(--barra); z-index: 60;
  background: var(--superficie);
  border-bottom: 1px solid var(--linea);
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px;
}
.barra__logo { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.barra__logo img { height: 27px; width: auto; display: block; }
.barra__marca { display: flex; flex-direction: column; line-height: 1; }
.barra__marca b { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--rojo-prof); }
.barra__marca span { font-size: 8.5px; font-weight: 650; letter-spacing: .26em; color: var(--tinta-3); margin-top: 2px; }
.barra__sep { width: 1px; height: 24px; background: var(--linea); flex-shrink: 0; }
.barra__ctx { display: flex; flex-direction: column; line-height: 1.15; flex-shrink: 0; }
.barra__ctx b { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.barra__ctx span { font-size: 11px; color: var(--tinta-3); }

.buscador { position: relative; flex: 1; max-width: 460px; }
.buscador svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--tinta-4); pointer-events: none; }
.buscador input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  background: var(--hundido); border: 1px solid transparent; border-radius: var(--r);
  font-size: 13.5px; transition: background .13s, border-color .13s, box-shadow .13s;
}
.buscador input::placeholder { color: var(--tinta-3); }
.buscador input:focus {
  background: var(--superficie); border-color: var(--linea-2);
  box-shadow: 0 0 0 3px rgba(215,25,32,.10); outline: none;
}
.buscador__resultados {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70;
  background: var(--superficie); border: 1px solid var(--linea-2); border-radius: var(--r-grande);
  box-shadow: var(--sombra-3); overflow: hidden; max-height: 62vh; overflow-y: auto;
}
.buscador__item {
  display: flex; align-items: center; gap: 11px; padding: 9px 13px; cursor: pointer;
  border-bottom: 1px solid var(--linea); background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left;
}
.buscador__item:last-child { border-bottom: 0; }
.buscador__item:hover, .buscador__item[aria-selected="true"] { background: var(--rojo-tinte); }
.buscador__item b { font-weight: 600; font-size: 13.5px; }
.buscador__item span { font-size: 12px; color: var(--tinta-3); }
.buscador__vacio { padding: 15px 13px; font-size: 13px; color: var(--tinta-3); }

.barra__der { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.hoy { font-size: 12px; color: var(--tinta-3); display: flex; align-items: center; gap: 6px; }
.hoy b { color: var(--tinta-2); font-weight: 550; }

/* rail */
.rail {
  position: fixed; top: var(--barra); bottom: 0; left: 0; width: var(--rail); z-index: 50;
  background: var(--superficie); border-right: 1px solid var(--linea);
  padding: 14px 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.rail__grupo { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-4); padding: 14px 10px 6px; }
.rail__grupo:first-child { padding-top: 2px; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r);
  text-decoration: none; color: var(--tinta-2); font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.rail a svg { color: var(--tinta-4); flex-shrink: 0; transition: color .12s; }
.rail a:hover { background: var(--hundido); color: var(--tinta); }
.rail a:hover svg { color: var(--tinta-2); }
.rail a.on { background: var(--rojo-tinte); color: var(--rojo-prof); font-weight: 600; }
.rail a.on svg { color: var(--rojo); }
.rail__pill {
  margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 99px;
  background: var(--linea); color: var(--tinta-2);
  font-size: 11px; font-weight: 650; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.rail a.on .rail__pill { background: var(--rojo); color: #fff; }
.rail__pill--urgente { background: var(--rojo); color: #fff; }

.rail__pie { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--linea); }
.rail__pie p { font-size: 11px; color: var(--tinta-4); line-height: 1.45; }
.rail__pie a { display: inline; padding: 0; font-size: 11px; color: var(--tinta-3); text-decoration: underline; text-underline-offset: 2px; }

/* lienzo */
.lienzo { margin: var(--barra) 0 0 var(--rail); padding: 24px 28px 80px; max-width: 1560px; }

.cabecera { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.cabecera h1 { font-size: 25px; font-weight: 600; letter-spacing: -0.03em; }
.cabecera p { font-size: 13.5px; color: var(--tinta-2); margin-top: 3px; max-width: 68ch; }
.cabecera__acc { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─────────────────────────────  controles  ───────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--linea-2); background: var(--superficie); color: var(--tinta);
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
  box-shadow: var(--sombra-1);
}
.btn:hover { background: var(--superficie-2); border-color: var(--linea-3); }
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }
.btn--rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn--rojo:hover { background: var(--rojo-hover); border-color: var(--rojo-hover); }
.btn--fantasma { box-shadow: none; border-color: transparent; background: transparent; }
.btn--fantasma:hover { background: var(--hundido); border-color: transparent; }
.btn--chico { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-chico); }
.btn--wa { background: var(--verde-wa); border-color: #1EB955; color: #06301A; }
.btn--wa:hover { background: #1FBF5C; border-color: #189A47; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.sel {
  height: 36px; padding: 0 30px 0 11px; border-radius: var(--r);
  border: 1px solid var(--linea-2); background: var(--superficie); box-shadow: var(--sombra-1);
  font-size: 13.5px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237E7E87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.campo {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--r);
  border: 1px solid var(--linea-2); background: var(--superficie); font-size: 13.5px;
}
.campo:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(215,25,32,.10); }
textarea.campo { height: auto; padding: 10px 11px; line-height: 1.55; resize: vertical; font-size: 13.5px; }

.segmentado { display: inline-flex; background: var(--hundido); border-radius: var(--r); padding: 3px; gap: 2px; }
.segmentado button {
  height: 30px; padding: 0 12px; border: 0; background: transparent; border-radius: var(--r-chico);
  font-size: 12.5px; font-weight: 550; color: var(--tinta-2); cursor: pointer;
  transition: background .13s, color .13s, box-shadow .13s;
}
.segmentado button:hover { color: var(--tinta); }
.segmentado button.on { background: var(--superficie); color: var(--tinta); box-shadow: var(--sombra-1); }

.interruptor { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; user-select: none; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor__pista {
  width: 36px; height: 21px; border-radius: 99px; background: var(--linea-2);
  position: relative; transition: background .18s cubic-bezier(.22,1,.36,1); flex-shrink: 0;
}
.interruptor__pista::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.22);
  transition: transform .18s cubic-bezier(.22,1,.36,1);
}
.interruptor input:checked + .interruptor__pista { background: var(--rojo); }
.interruptor input:checked + .interruptor__pista::after { transform: translateX(15px); }
.interruptor input:focus-visible + .interruptor__pista { outline: 2px solid var(--rojo); outline-offset: 2px; }

/* ─────────────────────────────  piezas  ───────────────────────────── */

.tarjeta {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-grande);
  box-shadow: var(--sombra-1);
}
.tarjeta__cab {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--linea);
}
.tarjeta__cab h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.tarjeta__cab .acc { margin-left: auto; display: flex; gap: 7px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: var(--r-chico); font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--hundido); color: var(--tinta-2); border: 1px solid transparent;
}
.chip--rojo   { background: var(--rojo-tinte); color: var(--rojo-prof); border-color: var(--rojo-borde); }
.chip--ok     { background: var(--ok-tinte); color: var(--ok); border-color: var(--ok-borde); }
.chip--alerta { background: var(--alerta-tinte); color: var(--alerta); border-color: var(--alerta-borde); }
.chip--info   { background: var(--info-tinte); color: var(--info); border-color: var(--info-borde); }
.chip--linea  { background: var(--superficie); border-color: var(--linea-2); color: var(--tinta-2); font-weight: 550; }
.chip__punto { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* contadores clicables — la primera fila del inicio */
.contadores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.contador {
  display: block; text-align: left; cursor: pointer; text-decoration: none;
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-grande);
  padding: 14px 16px 13px; box-shadow: var(--sombra-1);
  transition: border-color .14s, box-shadow .14s, transform .14s cubic-bezier(.22,1,.36,1);
}
.contador:hover { border-color: var(--linea-3); box-shadow: var(--sombra-2); transform: translateY(-1px); }
.contador__fila { display: flex; align-items: baseline; gap: 9px; }
.contador__n {
  font-family: var(--display); font-size: 31px; font-weight: 650; line-height: 1;
  letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
}
.contador__et { font-size: 12.5px; color: var(--tinta-2); margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.contador__et svg { color: var(--tinta-4); }
.contador--urg .contador__n { color: var(--rojo); }
.contador--urg { border-color: var(--rojo-borde); }
.contador--urg:hover { border-color: var(--rojo); }
.contador__sub { font-size: 11.5px; color: var(--tinta-3); margin-top: 2px; }

/* tablas */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--tinta-3); padding: 9px 14px; border-bottom: 1px solid var(--linea);
  background: var(--superficie-2);
  white-space: nowrap;
}
.tabla th.der, .tabla td.der { text-align: right; }
.tabla td { padding: 11px 14px; border-bottom: 1px solid var(--linea); font-size: 13.5px; vertical-align: middle; }
.tabla tbody tr { transition: background .1s; }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover { background: var(--rojo-tinte); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla__nom { font-weight: 600; }
.tabla__sec { font-size: 12px; color: var(--tinta-3); }
.tabla-envoltorio { overflow-x: auto; }

.vacio { padding: 46px 20px; text-align: center; color: var(--tinta-3); }
.vacio svg { color: var(--linea-3); margin-bottom: 12px; }
.vacio h3 { font-size: 15px; font-weight: 600; color: var(--tinta-2); margin-bottom: 5px; }
.vacio p { font-size: 13px; max-width: 42ch; margin: 0 auto; }

.filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filtros__et { font-size: 12.5px; color: var(--tinta-3); font-weight: 550; }

/* ────────────────────────  expediente del cliente  ──────────────────────── */

.exp__volver {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tinta-2);
  text-decoration: none; margin-bottom: 14px; padding: 5px 9px 5px 6px; border-radius: var(--r-chico);
  transition: background .12s, color .12s;
}
.exp__volver:hover { background: var(--hundido); color: var(--tinta); }

.exp__cab {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-grande);
  box-shadow: var(--sombra-1); padding: 20px 22px; margin-bottom: 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: start;
}
.exp__id { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.exp__inicial {
  width: 50px; height: 50px; border-radius: var(--r-grande); flex-shrink: 0;
  background: var(--rojo-tinte); border: 1px solid var(--rojo-borde); color: var(--rojo-prof);
  display: grid; place-items: center; font-family: var(--display); font-size: 19px; font-weight: 650;
}
.exp__id h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.exp__id .meta { font-size: 12.5px; color: var(--tinta-3); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.exp__datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px,1fr)); gap: 13px 22px; }
.exp__dato dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tinta-4); margin-bottom: 2px; }
.exp__dato dd { margin: 0; font-size: 13.5px; font-weight: 500; }
.exp__dato dd a { color: var(--tinta); text-decoration: none; border-bottom: 1px solid var(--linea-2); }
.exp__dato dd a:hover { color: var(--rojo); border-color: var(--rojo-borde); }
.exp__resumen {
  display: flex; flex-direction: column; gap: 10px; min-width: 210px;
  padding-left: 22px; border-left: 1px solid var(--linea);
}
.exp__kpi { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.exp__kpi span { font-size: 12.5px; color: var(--tinta-2); }
.exp__kpi b { font-family: var(--display); font-size: 17px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.exp__acc { display: flex; gap: 7px; margin-top: 4px; flex-wrap: wrap; }

.exp__seccion { margin-top: 22px; }
.exp__seccion > h2 {
  font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--tinta-3); margin-bottom: 11px; display: flex; align-items: center; gap: 9px;
}
.exp__seccion > h2::after { content: ''; flex: 1; height: 1px; background: var(--linea); }

/* póliza — la unidad del expediente */
.pol {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-grande);
  box-shadow: var(--sombra-1); margin-bottom: 11px; overflow: hidden;
  transition: border-color .14s, box-shadow .14s;
}
.pol:hover { border-color: var(--linea-2); }
.pol--vence { border-color: var(--rojo-borde); }
.pol--renovada { border-color: var(--ok-borde); }
.pol__cab {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px; cursor: pointer;
  background: none; border: 0; width: 100%; text-align: left;
}
.pol__cab:hover { background: var(--superficie-2); }
.pol__ramo {
  width: 34px; height: 34px; border-radius: var(--r); flex-shrink: 0; display: grid; place-items: center;
  background: var(--hundido); color: var(--tinta-2);
}
.pol__ppal { min-width: 0; flex: 1; }
.pol__ppal h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pol__ppal .sub { font-size: 12.5px; color: var(--tinta-3); margin-top: 2px; }
.pol__vig { text-align: right; flex-shrink: 0; }
.pol__vig .et { display: block; font-size: 11px; color: var(--tinta-4); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: 1px; }
.pol__vig .val { display: block; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pol__chev { color: var(--tinta-4); transition: transform .22s cubic-bezier(.22,1,.36,1); flex-shrink: 0; }
.pol[open] .pol__chev, .pol.abierta .pol__chev { transform: rotate(180deg); }

.pol__cuerpo { border-top: 1px solid var(--linea); padding: 16px; background: var(--superficie-2); }
.pol__rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px,1fr)); gap: 14px 20px; }
.pol__campo dt { font-size: 10.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-4); margin-bottom: 3px; }
.pol__campo dd { margin: 0; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

.bloque {
  margin-top: 15px; padding: 13px 14px; background: var(--superficie);
  border: 1px solid var(--linea); border-radius: var(--r);
}
.bloque > h4 {
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.bloque > h4 svg { color: var(--tinta-4); }
.bloque > h4 .acc { margin-left: auto; display: flex; gap: 6px; }

/* cuotas */
.cuotas { display: flex; gap: 5px; flex-wrap: wrap; }
.cuota {
  min-width: 42px; padding: 5px 7px; border-radius: var(--r-chico); text-align: center;
  border: 1px solid var(--linea); background: var(--superficie-2);
  font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.3;
}
.cuota b { display: block; font-weight: 650; font-size: 12px; }
.cuota span { color: var(--tinta-4); font-size: 10px; }
.cuota--paga { background: var(--ok-tinte); border-color: var(--ok-borde); color: var(--ok); }
.cuota--impaga { background: var(--rojo-tinte); border-color: var(--rojo); color: var(--rojo-prof); font-weight: 600; }
.cuota--pendiente { color: var(--tinta-3); }

/* secuencia de renovación — el momento del producto */
.sec { display: flex; align-items: stretch; gap: 0; margin-top: 3px; }
.sec__paso { flex: 1; position: relative; padding: 0 0 0 0; min-width: 0; }
.sec__linea { height: 2px; background: var(--linea-2); position: relative; margin: 9px 0 9px; }
.sec__paso--hecho .sec__linea { background: var(--ok); }
.sec__paso--cancelado .sec__linea { background: var(--linea); }
.sec__punto {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; border-radius: 50%; background: var(--superficie);
  border: 2px solid var(--linea-2); z-index: 1; display: grid; place-items: center;
}
.sec__paso--hecho .sec__punto { border-color: var(--ok); background: var(--ok); }
.sec__paso--hoy .sec__punto { border-color: var(--rojo); background: var(--rojo); box-shadow: 0 0 0 4px var(--rojo-borde); }
.sec__paso--cancelado .sec__punto { border-color: var(--linea-2); background: var(--hundido); }
.sec__txt { padding-right: 12px; }
.sec__txt b { display: block; font-size: 12px; font-weight: 600; }
.sec__txt span { font-size: 11.5px; color: var(--tinta-3); display: block; line-height: 1.4; }
.sec__paso--cancelado .sec__txt b, .sec__paso--cancelado .sec__txt span { color: var(--tinta-4); text-decoration: line-through; text-decoration-thickness: 1px; }
.sec--cortada { opacity: .96; }
.sec__corte {
  margin-top: 11px; padding: 9px 11px; border-radius: var(--r); font-size: 12.5px;
  background: var(--ok-tinte); border: 1px solid var(--ok-borde); color: var(--ok);
  display: flex; align-items: center; gap: 8px; font-weight: 550;
}

/* ────────────────────────  siniestros: tablero  ──────────────────────── */

.tablero { display: grid; grid-template-columns: repeat(5, minmax(212px,1fr)); gap: 12px; align-items: start; }
.col {
  background: var(--hundido); border-radius: var(--r-grande); padding: 10px;
  min-height: 190px; transition: background .15s, box-shadow .15s;
}
.col.recibe { background: var(--rojo-tinte); box-shadow: inset 0 0 0 2px var(--rojo-borde); }
.col__cab { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.col__cab h3 { font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-2); }
.col__n { margin-left: auto; font-size: 11.5px; font-weight: 650; color: var(--tinta-3); font-variant-numeric: tabular-nums; }

.sin {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r);
  padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--sombra-1); cursor: grab;
  transition: box-shadow .14s, border-color .14s, transform .14s cubic-bezier(.22,1,.36,1), opacity .14s;
}
.sin:hover { box-shadow: var(--sombra-2); border-color: var(--linea-2); transform: translateY(-1px); }
.sin:active { cursor: grabbing; }
.sin.arrastrando { opacity: .38; transform: scale(.98); }
.sin--quieto { border-color: var(--rojo-borde); }
.sin__n { font-size: 11.5px; font-weight: 650; color: var(--tinta-3); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sin__bien { font-size: 13.5px; font-weight: 600; margin: 3px 0 5px; letter-spacing: -0.01em; line-height: 1.32; }
.sin__cli { font-size: 12px; color: var(--tinta-2); display: flex; align-items: center; gap: 5px; }
.sin__pol { font-size: 11.5px; color: var(--tinta-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.sin__pie { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--linea); flex-wrap: wrap; }
.sin__mover { display: flex; gap: 3px; margin-left: auto; }
.sin__mover button {
  width: 22px; height: 22px; border-radius: var(--r-chico); border: 1px solid var(--linea-2);
  background: var(--superficie); display: grid; place-items: center; cursor: pointer; color: var(--tinta-3);
  transition: background .12s, color .12s, border-color .12s;
}
.sin__mover button:hover:not(:disabled) { background: var(--rojo-tinte); color: var(--rojo); border-color: var(--rojo-borde); }
.sin__mover button:disabled { opacity: .3; cursor: not-allowed; }

/* ────────────────────────  cola de aprobación  ──────────────────────── */

.aviso {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 14px 16px; border-bottom: 1px solid var(--linea);
}
.aviso:last-child { border-bottom: 0; }
.aviso__ic {
  width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; flex-shrink: 0;
  background: var(--alerta-tinte); color: var(--alerta); border: 1px solid var(--alerta-borde);
}
.aviso__ic--ren { background: var(--rojo-tinte); color: var(--rojo); border-color: var(--rojo-borde); }
.aviso__cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.aviso__cab b { font-size: 13.5px; font-weight: 600; }
.aviso__cab .a-quien { font-size: 12.5px; color: var(--tinta-3); }
.aviso__acc { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.globo {
  background: #E7F7E4; border: 1px solid #CBE9C5; border-radius: 3px 11px 11px 11px;
  padding: 9px 12px; font-size: 13px; line-height: 1.5; max-width: 62ch;
  white-space: pre-wrap; color: #123018; position: relative;
}
.globo__pie { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: #4A6B50; }
.globo--edit { background: var(--superficie); border-color: var(--linea-2); color: var(--tinta); }

/* plantillas */
.plantilla { padding: 15px 16px; border-bottom: 1px solid var(--linea); }
.plantilla:last-child { border-bottom: 0; }
.plantilla__cab { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.plantilla__cab b { font-size: 13.5px; font-weight: 600; }
.plantilla__cab .acc { margin-left: auto; display: flex; gap: 6px; }
.vars { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; align-items: center; }
.vars__et { font-size: 11.5px; color: var(--tinta-3); }
.var {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace; font-size: 11px;
  background: var(--info-tinte); color: var(--info); border: 1px solid var(--info-borde);
  padding: 2px 6px; border-radius: var(--r-chico); cursor: pointer;
}
.var:hover { background: var(--info); color: #fff; }

/* ────────────────────────  importar  ──────────────────────── */

.zona {
  border: 2px dashed var(--linea-2); border-radius: var(--r-grande); padding: 34px 24px; text-align: center;
  background: var(--superficie-2); transition: border-color .15s, background .15s;
}
.zona.recibe { border-color: var(--rojo); background: var(--rojo-tinte); }
.zona svg { color: var(--tinta-4); margin-bottom: 12px; }
.zona h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
.zona p { font-size: 13px; color: var(--tinta-2); max-width: 46ch; margin: 0 auto 15px; }

.pasos { display: flex; gap: 0; margin-bottom: 20px; }
.paso { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.paso__n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--hundido); color: var(--tinta-3); font-size: 12px; font-weight: 650;
  border: 1px solid var(--linea-2);
}
.paso--on .paso__n { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.paso--hecho .paso__n { background: var(--ok); color: #fff; border-color: var(--ok); }
.paso b { font-size: 12.5px; font-weight: 600; color: var(--tinta-3); }
.paso--on b, .paso--hecho b { color: var(--tinta); }
.paso__barra { flex: 1; height: 1px; background: var(--linea-2); }

.mapeo { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 9px 12px; align-items: center; }
.mapeo__col { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; padding: 7px 10px; background: var(--hundido); border-radius: var(--r-chico); border: 1px solid var(--linea); }
.mapeo__fl { color: var(--tinta-4); display: grid; place-items: center; }
.mapeo__dst { font-size: 13px; padding: 7px 10px; background: var(--rojo-tinte); border: 1px solid var(--rojo-borde); border-radius: var(--r-chico); font-weight: 550; color: var(--rojo-prof); }

.barra-prog { height: 6px; background: var(--hundido); border-radius: 99px; overflow: hidden; }
.barra-prog i {
  display: block; height: 100%; width: 100%; background: var(--rojo); border-radius: 99px;
  transform-origin: left; transform: scaleX(0);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}

.pdf-lector { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.pdf-hoja {
  background: var(--superficie); border: 1px solid var(--linea-2); border-radius: var(--r);
  box-shadow: var(--sombra-2); padding: 16px 14px; font-size: 8px; line-height: 1.55; color: var(--tinta-3);
  position: relative; overflow: hidden; min-height: 300px;
}
.pdf-hoja b { color: var(--tinta-2); }
.pdf-hoja__barrido {
  position: absolute; left: 0; right: 0; height: 46px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(215,25,32,.16), transparent);
  border-top: 1px solid rgba(215,25,32,.4); border-bottom: 1px solid rgba(215,25,32,.4);
}
.pdf-campo {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: var(--r);
  border: 1px solid var(--linea); background: var(--superficie); margin-bottom: 6px;
  opacity: .32; transition: opacity .3s, border-color .3s, background .3s, transform .3s cubic-bezier(.22,1,.36,1);
  transform: translateY(3px);
}
.pdf-campo.leido { opacity: 1; border-color: var(--ok-borde); background: var(--ok-tinte); transform: none; }
.pdf-campo dt { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--tinta-4); width: 118px; flex-shrink: 0; }
.pdf-campo dd { margin: 0; font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; }
.pdf-campo .tilde { margin-left: auto; color: var(--ok); opacity: 0; transition: opacity .3s; }
.pdf-campo.leido .tilde { opacity: 1; }

/* ────────────────────────  reportes  ──────────────────────── */

.grafico { padding: 16px; }
.barras { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.barras__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; height: 100%; justify-content: flex-end; }
.barras__b {
  width: 100%; background: var(--rojo); border-radius: 3px 3px 0 0; position: relative;
  transition: background .14s, transform .14s;
  transform-origin: bottom; animation: crecer .5s cubic-bezier(.22,1,.36,1) backwards;
}
.barras__col:hover .barras__b { background: var(--rojo-hover); }
.barras__b--tenue { background: var(--linea-2); }
.barras__col:hover .barras__b--tenue { background: var(--linea-3); }
.barras__v { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.barras__e { font-size: 10.5px; color: var(--tinta-3); text-align: center; white-space: nowrap; }
@keyframes crecer { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.reparto { display: flex; flex-direction: column; gap: 11px; padding: 16px; }
.reparto__fila { display: grid; grid-template-columns: 128px 1fr 92px; gap: 12px; align-items: center; }
.reparto__et { font-size: 13px; font-weight: 550; }
.reparto__pista { height: 22px; background: var(--hundido); border-radius: var(--r-chico); overflow: hidden; }
.reparto__b { height: 100%; border-radius: var(--r-chico); animation: estirar .55s cubic-bezier(.22,1,.36,1) backwards; transform-origin: left; }
@keyframes estirar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.reparto__v { font-size: 12.5px; color: var(--tinta-2); text-align: right; font-variant-numeric: tabular-nums; }
.reparto__v b { color: var(--tinta); font-weight: 650; }

/* ────────────────────────  panel lateral / modal  ──────────────────────── */

.velo {
  position: fixed; inset: 0; z-index: 90; background: rgba(24,24,28,.42);
  backdrop-filter: blur(2px); animation: aparecer .18s ease-out;
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: fixed; z-index: 91; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(620px, calc(100vw - 40px)); max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--superficie); border-radius: var(--r-grande); box-shadow: var(--sombra-3);
  animation: subir .26s cubic-bezier(.22,1,.36,1);
}
@keyframes subir { from { opacity: 0; transform: translate(-50%,-46%) scale(.975); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.modal__cab { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--linea); position: sticky; top: 0; background: var(--superficie); z-index: 1; border-radius: var(--r-grande) var(--r-grande) 0 0; }
.modal__cab h2 { font-size: 16px; font-weight: 600; }
.modal__cerrar { margin-left: auto; }
.modal__cuerpo { padding: 18px; }
.modal__pie { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--linea); background: var(--superficie-2); border-radius: 0 0 var(--r-grande) var(--r-grande); }

/* aviso flotante */
.brindis {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 95;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.brindis__item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 99px;
  background: var(--tinta); color: #fff; box-shadow: var(--sombra-3); font-size: 13.5px; font-weight: 500;
  animation: brotar .34s cubic-bezier(.22,1,.36,1);
  pointer-events: auto; max-width: 92vw;
}
.brindis__item svg { flex-shrink: 0; }
.brindis__item--ok svg { color: #6EE7A0; }
.brindis__item--rojo { background: var(--rojo-prof); }
@keyframes brotar { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* nota de demo */
.nota-demo {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r);
  background: var(--info-tinte); border: 1px solid var(--info-borde); color: var(--info);
  font-size: 12.5px; line-height: 1.5; margin-bottom: 16px;
}
.nota-demo svg { flex-shrink: 0; margin-top: 1px; }
.nota-demo b { font-weight: 650; }

.cinta {
  position: fixed; bottom: 0; left: var(--rail); right: 0; z-index: 40;
  background: var(--tinta); color: #fff; font-size: 11.5px;
  padding: 6px 20px; display: flex; align-items: center; gap: 12px;
}
.cinta b { font-weight: 650; }
.cinta span { color: rgba(255,255,255,.62); }
.cinta .der { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.cinta a { color: rgba(255,255,255,.82); text-decoration: underline; text-underline-offset: 2px; }
.cinta a:hover { color: #fff; }

/* ────────────────────────  responsive  ──────────────────────── */

@media (max-width: 1180px) {
  .contadores { grid-template-columns: repeat(2, 1fr); }
  .exp__cab { grid-template-columns: 1fr; }
  .exp__resumen { padding-left: 0; border-left: 0; border-top: 1px solid var(--linea); padding-top: 15px; flex-direction: row; flex-wrap: wrap; gap: 22px; }
  .exp__kpi { flex-direction: column; align-items: flex-start; gap: 1px; }
  .exp__acc { width: 100%; }
  .tablero { grid-template-columns: repeat(3, minmax(200px,1fr)); }
  .pdf-lector { grid-template-columns: 1fr; }
  .pdf-hoja { max-height: 220px; }
}

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .rail {
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.22,1,.36,1);
    width: 250px; box-shadow: var(--sombra-3);
  }
  body.rail-abierto .rail { transform: none; }
  body.rail-abierto::after {
    content: ''; position: fixed; inset: var(--barra) 0 0 0; background: rgba(24,24,28,.38); z-index: 45;
  }
  .lienzo { margin-left: 0; padding: 18px 16px 90px; }
  .cinta { left: 0; }
  .menu-btn { display: inline-flex !important; }
  .barra__ctx { display: none; }
  .tablero { grid-template-columns: 1fr; }
  .col { min-height: 0; }
  .reparto__fila { grid-template-columns: 104px 1fr 78px; }
}

@media (max-width: 620px) {
  .contadores { grid-template-columns: 1fr 1fr; gap: 9px; }
  .contador { padding: 12px 13px; }
  .contador__n { font-size: 25px; }
  .cabecera h1 { font-size: 21px; }
  .barra { padding: 0 13px; gap: 11px; }
  .barra__logo img { height: 25px; }
  .hoy { display: none; }
  .exp__cab { padding: 16px; }
  .pol__vig { display: none; }
  .mapeo { grid-template-columns: 1fr; }
  .mapeo__fl { transform: rotate(90deg); }
  .aviso { grid-template-columns: 1fr; }
  .aviso__acc { justify-content: flex-start; }
  .cinta { font-size: 10.5px; padding: 5px 13px; }
  .cinta .oculta-chico { display: none; }
}

.menu-btn { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .barra, .rail, .cinta, .cabecera__acc, .btn { display: none !important; }
  .lienzo { margin: 0; padding: 0; }
}

/* columnas de importar y reportes */
@media (max-width: 1100px) {
  .importar-cols, .rep-cols { grid-template-columns: 1fr !important; }
}

/* En teléfono una tabla de 9 columnas no se lee. Cada fila pasa a ficha y la
   etiqueta de columna viaja en el data-et de cada celda. */
@media (max-width: 720px) {
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { border-bottom: 1px solid var(--linea); padding: 12px 15px; }
  .tabla tbody tr:last-child { border-bottom: 0; }
  .tabla td { border: 0; padding: 3px 0; display: flex; gap: 12px; align-items: baseline; }
  .tabla td::before {
    content: attr(data-et); flex: 0 0 96px; font-size: 10.5px; font-weight: 650;
    letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-4);
    line-height: 1.5; padding-top: 1px;
  }
  .tabla td:not([data-et])::before { display: none; }
  .tabla td.der { text-align: left; }
  .tabla td.der > div { justify-content: flex-start !important; }
  .tabla-envoltorio { overflow-x: visible; }
}

/* los pasos de importar: la barra iba arriba y el texto se partía en dos líneas */
.pasos { align-items: center; }
.paso b { white-space: nowrap; }

@media (max-width: 720px) {
  /* la nota secundaria de la cabecera de tarjeta compite con el título en pantalla chica */
  .tarjeta__cab .acc .tabla__sec { display: none; }
  .pasos { flex-wrap: wrap; gap: 10px; }
  .paso__barra { display: none; }
}
