/* Productos ya hechos: pestañas, cajas, tablas compactas y formularios en línea. Solo usa las variables del tema. */

.pestanas { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--borde); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.pestana {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 2px solid transparent;
  color: var(--texto-suave);
  font-weight: 500;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}
.pestana:hover { color: var(--texto); }
.pestana.activa { color: var(--texto); border-bottom-color: var(--primario-claro); }

.aviso-ejemplo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--acento-fondo);
  border: 1px solid var(--acento-borde);
  color: var(--acento-texto);
  font-weight: 500;
}
.aviso {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--azul-fondo);
  border: 1px solid var(--azul-borde);
  color: var(--azul-texto);
}

.dos-columnas { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.columna { display: grid; gap: 16px; min-width: 0; }

.caja {
  min-width: 0;
  margin: 0;
  padding: 18px 20px;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}
.zona > .caja { margin-bottom: 16px; }
.caja-titulo { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 1.0625rem; font-weight: 600; }
.grupo-titulo { justify-content: space-between; }
.suave { color: var(--texto-suave); font-weight: 400; }
.malo { color: var(--mal-texto); }
.caja-vacia { margin: 0; color: var(--texto-suave); }
.caja-nota { margin: 12px 0 0; color: var(--texto-suave); font-size: 0.875rem; overflow-wrap: anywhere; }
.caja .caja-nota:first-of-type { margin-top: 0; margin-bottom: 12px; }
.caja-pie { margin: 12px 0 8px; padding-top: 12px; border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: 0.9375rem; }

.tabla-zona { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.t th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--borde);
  color: var(--texto-suave);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.t td { padding: 10px 8px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tfoot td { border-top: 1px solid var(--borde); border-bottom: 0; color: var(--texto-suave); font-weight: 600; }
.t td:first-child, .t th:first-child { padding-left: 0; }
.t td:last-child, .t th:last-child { padding-right: 0; }
.t .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-principal { display: block; font-weight: 600; }
a.t-principal:hover { color: var(--vinculo); }
.t-detalle { display: block; color: var(--texto-suave); font-size: 0.8125rem; font-weight: 400; }
.col-dia { font-weight: 600; white-space: nowrap; }
.accion { text-align: right; white-space: nowrap; }
.accion form { margin: 0; }
.botones-fila { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.boton-peligro { background: var(--mal-fondo); border: 1px solid var(--mal-borde); color: var(--mal-texto); }
button.boton-peligro { border: 1px solid var(--mal-borde); }
.boton-peligro:hover { border-color: var(--rojo); }
.boton-texto {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--vinculo);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 9px 0; border-top: 1px solid var(--borde); overflow-wrap: anywhere; }
.lista-simple li:first-child { border-top: 0; padding-top: 0; }

.ficha-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ficha-nombre { margin: 0; font-size: 1.375rem; font-weight: 600; line-height: 1.25; }
.ficha-cab p { margin: 2px 0 0; }
.cifras { display: flex; gap: 28px; margin: 0; }
.cifras dt { color: var(--texto-suave); font-size: 0.8125rem; }
.cifras dd { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }

.en-fila {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(158px, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--borde);
}
.en-fila .campo { margin: 0; }
.en-fila > .boton { min-height: 48px; margin-top: 29px; }
.campos-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.hoja-suelta { margin: 0 auto; }

.campo input[type="date"],
.campo input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--borde-fuerte);
  border-radius: 10px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
}
.campo input[type="file"] { padding: 9px 10px; font-size: 0.875rem; }

/* El formulario de gestión muestra solo los campos que corresponden a lo que se eligió. */
.si-fecha, .si-pago, .si-cheque { display: none; }
form:has(input[name="situacion"][value="prometio"]:checked) .si-fecha,
form:has(input[name="situacion"][value="pasar"]:checked) .si-fecha,
form:has(input[name="situacion"][value="pago"]:checked) .si-pago,
form:has(input[name="medio"][value="cheque"]:checked) .si-cheque { display: block; }
@supports not selector(:has(*)) {
  .si-fecha, .si-pago, .si-cheque { display: block; }
}

.vacio-botones { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.vacio .vacio-botones .boton { margin-top: 0; }

.franja-g { display: block; width: 100%; height: 18px; margin: 16px 0 12px; border-radius: 999px; overflow: hidden; }
.t-1 { fill: #16A34A; background: #16A34A; }
.t-2 { fill: var(--primario); background: var(--primario); }
.t-3 { fill: var(--acento); background: var(--acento); }
.t-4 { fill: #DC2626; background: #DC2626; }
.leyenda-g { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; font-size: 0.9375rem; }
.leyenda-g li { display: inline-flex; align-items: center; gap: 8px; }
.leyenda-g i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.leyenda-g b { font-weight: 600; font-variant-numeric: tabular-nums; }
.leyenda-suelta { padding: 0 4px; color: var(--texto-suave); }

.talonario-cuenta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; color: var(--texto-suave); }
.talonario-cuenta b { color: var(--texto); font-weight: 600; }
.talonario-cuenta .malo b { color: var(--mal-texto); }
.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); gap: 4px; }
.numeros i { display: block; aspect-ratio: 1; border-radius: 4px; }
.n-usado { background: var(--primario); }
.n-salteado { background: var(--rojo); }
.n-libre { background: var(--borde); }

.mes-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mes-titulo { margin: 0; font-size: 1.125rem; font-weight: 600; text-align: center; }

/* Productos en el panel y en la portada */
.titulo-bloque { margin: 0 0 14px; }
.productos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 36px; padding: 0; list-style: none; }
.producto { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 18px; }
.producto h3 { margin: 0; font-size: 1.1875rem; font-weight: 600; }
.producto p { margin: 0 0 10px; color: var(--texto-suave); flex: 1; }
.producto form { margin: 0; }
.producto .chip { align-self: flex-start; }
.listos { padding-bottom: clamp(56px, 8vw, 104px); }
.listos .productos { margin-bottom: 0; }

@media (max-width: 860px) {
  .dos-columnas { grid-template-columns: 1fr; }
  .en-fila { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .en-fila > .boton { margin-top: 0; grid-column: 1 / -1; }
  .productos { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .campos-2, .en-fila { grid-template-columns: 1fr; }
  .cifras { gap: 18px; }
  .cifras dd { font-size: 1.25rem; }
  .caja { padding: 16px; }
  .accion { white-space: normal; }
}

/* Teléfono: cada renglón de tabla se apila en vez de apretarse en columnas. */
@media (max-width: 560px) {
  .t, .t tbody, .t tfoot { display: block; }
  .t thead { display: none; }
  .t tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--borde); }
  .t tbody tr:last-child { border-bottom: 0; }
  .t td, .t tfoot td { padding: 0; border: 0; }
  .t td:first-child { flex: 1 1 100%; }
  .t td:empty { display: none; }
  .t td[data-t]::before { content: attr(data-t) " "; color: var(--texto-suave); font-size: 0.8125rem; font-weight: 400; }
  .t .accion { margin-left: auto; }
  .t .botones-fila { justify-content: flex-start; }
  .t-cheques td:first-child { flex: 0 0 auto; }
  .t-cheques td:nth-child(2) { flex: 1 1 55%; }
  .t tfoot tr { justify-content: space-between; border-bottom: 0; padding-bottom: 0; }
  .t tfoot td:first-child { flex: 0 1 auto; }
  .aviso-ejemplo { flex-direction: column; align-items: flex-start; }
}
