/* Reportes (análisis y cierre): componentes sobre el sistema de app.css. */
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 4px 0 22px; }
.encabezado h1 { font-size: 40px; margin: 0; }
.encabezado .sub { color: var(--gris); margin: 8px 0 0; font-size: 15.5px; }
.encabezado .acciones { display: flex; gap: 10px; align-items: center; }

.barra-filtros { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0 12px; margin: 0 0 6px; background: linear-gradient(var(--papel) 80%, rgba(250, 248, 244, 0)); }
.segmento { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--linea-fuerte); border-radius: 999px; box-shadow: var(--sombra-suave); }
.segmento button { border: 0; background: none; min-height: 38px; padding: 7px 14px; border-radius: 999px; font-size: 14.5px; color: var(--gris); cursor: pointer; white-space: nowrap; }
.segmento button:hover { color: var(--texto); background: var(--suave); }
.segmento button.activo { background: var(--negro); color: #fff; }
.barra-filtros select.input, .barra-filtros .input.fecha { min-height: 46px; width: auto; border-radius: 999px; padding: 8px 16px; font-size: 15px; box-shadow: var(--sombra-suave); }
.rango { display: inline-flex; align-items: center; gap: 8px; }

.pestanas { display: flex; gap: 28px; border-bottom: 1px solid var(--linea-fuerte); margin: 4px 0 24px; overflow-x: auto; scrollbar-width: none; }
.pestanas button { border: 0; background: none; padding: 12px 0 13px; font-size: 16px; color: var(--gris); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pestanas button:hover { color: var(--texto); }
.pestanas button.activo { color: var(--texto); border-bottom-color: var(--negro); }

.grid-resumen { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.tarjeta.reporte-card { padding: 24px 26px; }
.tarjeta .titulo-card { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.tarjeta .titulo-card h2 { margin: 0; font-size: 18px; }
.tarjeta .titulo-card .mas { font-size: 14px; color: var(--gris); border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.etiqueta-chica { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }

.cifra-heroe { font-family: var(--display); font-size: 58px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; margin: 12px 0 14px; font-variant-numeric: tabular-nums; }
.delta-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 5px 11px; border-radius: 999px; background: var(--suave); color: var(--gris); }
.delta-chip.bien { background: #e7f2ea; color: #1f6b3a; }
.delta-chip.mal { background: #fbe9e7; color: #a3291b; }
.delta-chip .ico { width: 16px; height: 16px; }

.stats { display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.stat { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--linea); }
.stat:first-child { padding-top: 0; }
.stat:last-child { border-bottom: 0; padding-bottom: 0; }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--gris); font-size: 14px; margin-bottom: 4px; }
.stat .d { font-size: 13px; text-align: right; color: var(--gris); white-space: nowrap; }
.stat .d.bien { color: #1f6b3a; }
.stat .d.mal { color: #a3291b; }

.grafico-linea { position: relative; width: 100%; }
.grafico-linea svg { display: block; overflow: visible; }
.grafico-linea .area { fill: rgba(20, 20, 20, .055); }
.grafico-linea .linea { fill: none; stroke: var(--negro); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico-linea .linea.previa { stroke: #cdc6ba; }
.grafico-linea .grilla { stroke: var(--linea); stroke-width: 1; }
.grafico-linea .eje { fill: var(--gris-claro); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.grafico-linea .cruz { stroke: var(--gris-claro); stroke-width: 1; }
.grafico-linea .punto { fill: var(--negro); stroke: #fff; stroke-width: 2; }
.grafico-linea .columna { fill: var(--negro); }
.grafico-linea .columna.suave { fill: #cdc6ba; }
.leyenda { display: flex; gap: 18px; font-size: 13px; color: var(--gris); margin-top: 10px; flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--negro); }
.leyenda i.previa { background: #cdc6ba; }

.hallazgos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.hallazgos li { position: relative; padding: 14px 0 14px 20px; border-bottom: 1px solid var(--linea); font-size: 16px; line-height: 1.45; }
.hallazgos li::before { content: ""; position: absolute; left: 0; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--naranjo); }
.hallazgos li b { font-weight: 600; }

.ranking { display: flex; flex-direction: column; }
.rank { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.rank:last-child { border-bottom: 0; }
.rank.clic { cursor: pointer; }
.rank.clic:hover .nom { text-decoration: underline; text-underline-offset: 3px; }
.rank .n { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--gris-claro); line-height: 1; }
.rank .nom { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nom small { color: var(--gris); font-size: 13px; margin-left: 6px; }
.rank .val { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rank .val small { color: var(--gris); font-size: 12.5px; margin-left: 6px; }
.rank .pista { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: var(--suave); overflow: hidden; }
.rank .pista i { display: block; height: 100%; background: var(--negro); border-radius: 3px; }

.parte { display: flex; align-items: center; gap: 10px; min-width: 96px; }
.libro .marca-nom { min-width: 128px; } .libro .marca-nom small { white-space: nowrap; }
.parte .pista { flex: 1; height: 6px; border-radius: 3px; background: var(--suave); overflow: hidden; }
.parte .pista i { display: block; height: 100%; background: var(--negro); border-radius: 3px; }
.parte span { font-size: 13.5px; color: var(--gris); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--negro); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark line { stroke: var(--linea); stroke-width: 1; }

.consejo { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: #fff7f2; border: 1px solid #f6d9c9; color: #7a3412; font-size: 15px; margin-top: 18px; }
.consejo .ico { color: var(--naranjo); margin-top: 2px; }

.esqueleto { border-radius: 18px; background: linear-gradient(90deg, #f1ede6 0%, #f8f5f0 50%, #f1ede6 100%); background-size: 200% 100%; animation: brillo 1.2s infinite linear; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── cierre como libro contable ─────────────────────────────── */
.franja { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--linea); border-radius: 18px; box-shadow: var(--sombra-suave); margin-bottom: 22px; }
.franja > div { padding: 20px 22px; border-left: 1px solid var(--linea); min-width: 0; }
.franja > div:first-child { border-left: 0; }
.franja .v { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 6px; }
.franja .s { font-size: 13.5px; color: var(--gris); }
.franja .alerta .v { color: var(--naranjo); }
.franja a { color: inherit; }
.franja.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.progreso { height: 6px; border-radius: 3px; background: var(--suave); overflow: hidden; margin: 12px 0 6px; }
.progreso i { display: block; height: 100%; background: var(--negro); border-radius: 3px; transition: width .4s ease; }
.libro td { padding-top: 14px; padding-bottom: 14px; }
.libro .marca-nom { font-size: 16.5px; }
.libro .marca-nom small { display: block; color: var(--gris); font-size: 13px; margin-top: 2px; }
.libro .monto { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pasos-estado { display: inline-flex; align-items: center; }
.pasos-estado span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gris-claro); white-space: nowrap; }
.pasos-estado span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--linea-fuerte); background: #fff; }
.pasos-estado i { width: 16px; height: 1.5px; background: var(--linea-fuerte); margin: 0 6px; }
.pasos-estado span.hecho { color: var(--texto); }
.pasos-estado span.hecho::before { background: var(--negro); border-color: var(--negro); }
.pasos-estado i.hecho { background: var(--negro); }
.libro .acciones-fila { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }
.libro tr.abierta td { background: #fbf9f5; }
.libro tr.detalle td { padding: 0 12px 18px; background: #fbf9f5; }
.detalle-marca { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 10px 4px 0; font-size: 14.5px; }
.detalle-marca .etiqueta-chica { display: block; margin-bottom: 6px; }
.detalle-marca p { margin: 0; white-space: pre-line; }
.detalle-marca p.normal { white-space: normal; line-height: 1.7; }
.sin-ventas { margin-top: 14px; color: var(--gris); font-size: 14.5px; }
.franja .v .de { font-size: 18px; color: var(--gris-claro); font-weight: 500; letter-spacing: -0.01em; }
.mes-nav { align-items: center; flex-wrap: nowrap; }
.mes-nav span { padding: 0 8px; font-size: 14.5px; min-width: 120px; text-align: center; }
.mes-nav button { padding: 7px 10px; }
.segmento .cuenta { font-size: 12.5px; opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tarjeta.libro-caja { padding: 4px 10px; }
.libro .marca-nom small.falta { color: var(--gris-claro); font-style: italic; }
.libro small.sin-boleta { display: block; font-size: 12.5px; color: var(--naranjo-oscuro); margin-top: 2px; white-space: nowrap; }
.libro .acciones-fila { align-items: center; }
.libro .acciones-fila .estado { min-height: 44px; padding: 0 14px; }
.libro .acciones-fila .estado .ico { width: 16px; height: 16px; }
.btn.solo-icono { width: 44px; padding: 0; }
.libro .abrir { display: grid; place-items: center; width: 28px; color: var(--gris-claro); transition: transform .18s ease; }
.libro .abrir .ico { width: 18px; height: 18px; }
.libro tr.abierta .abrir { transform: rotate(90deg); color: var(--texto); }
.libro tr.abierta td { border-bottom-color: transparent; }
.libro tr.detalle td { border-bottom: 1px solid var(--linea); }
.fotos-detalle { display: flex; gap: 8px; padding: 16px 4px 0; }
.fotos-detalle img { width: 56px; height: 70px; object-fit: cover; border-radius: 6px; background: var(--suave); }
.datos-banco { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 16px 14px; }
.datos-banco p { margin: 4px 0 0; white-space: pre-line; font-size: 15.5px; }
button.enlace { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.enlace:hover { color: var(--naranjo-oscuro); }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1100px) {
  .grid-resumen { grid-template-columns: 1fr; }
  .franja { grid-template-columns: 1fr 1fr; }
  .franja > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--linea); }
  .franja > div:nth-child(4) { border-top: 1px solid var(--linea); }
}
@media (max-width: 900px) {
  .grid-2, .hallazgos { grid-template-columns: 1fr; }
  .encabezado h1 { font-size: 34px; }
  .cifra-heroe { font-size: 50px; }
  .detalle-marca { grid-template-columns: 1fr; }
  .libro .col-parte, .libro .col-prendas, .libro .col-estado { display: none; }
}
@media (max-width: 640px) {
  .barra-filtros { position: static; }
  .encabezado h1 { font-size: 30px; }
  .cifra-heroe { font-size: 42px; }
  .pestanas { gap: 20px; }
  .segmento { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .segmento::-webkit-scrollbar { display: none; }
  .segmento button { flex: none; }
  .libro .solo-icono { display: none; }
  .libro .acciones-fila .txt { display: none; }
  .libro .acciones-fila .btn { width: 44px; padding: 0; }
  .libro .acciones-fila .estado { padding: 0 12px; }
  .mes-nav span { min-width: 0; }
  .franja.tres { grid-template-columns: 1fr; }
  .franja.tres > div { border-left: 0 !important; border-top: 1px solid var(--linea) !important; }
  .franja.tres > div:first-child { border-top: 0 !important; }
  .franja > div { padding: 14px 16px; border-top: 1px solid var(--linea); }
  .franja > div:nth-child(odd) { border-left: 0 !important; }
  .franja > div:nth-child(even) { border-left: 1px solid var(--linea) !important; }
  .franja > div:nth-child(-n+2) { border-top: 0; }
  .franja .v { font-size: 21px; }
  .franja .v .de { font-size: 14px; }
  .libro td { padding-left: 8px; padding-right: 8px; }
}
@media print {
  .barra-filtros, .pestanas, .encabezado .acciones { display: none !important; }
  body { background: #fff; }
}
.barras-mes { display: block; width: 100%; height: 72px; margin-top: 22px; }
.barras-mes rect { fill: var(--negro); }
.barras-mes rect.cero { fill: var(--linea-fuerte); }
.barras-mes rect.futuro { fill: var(--linea); }

/* ── liquidación por marca (9-nov-2026) ─────────────────────── */
.desglose { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.desglose td { padding: 5px 0; border-bottom: 1px dashed var(--linea); }
.desglose td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.desglose tr.suma td { border-bottom: 0; border-top: 1.5px solid var(--negro); padding-top: 8px; font-weight: 600; }
.detalle-marca .desglose { margin: 0; }
.detalle-marca.cuatro { grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr)); }
.libro small.gris { display: block; font-size: 12.5px; color: var(--gris); margin-top: 2px; }
.libro .marca-nom small.falta-mod { color: var(--naranjo-oscuro); }
.tabla.compacta td, .tabla.compacta th { padding: 9px 8px; font-size: 14.5px; }
.tabla.compacta tfoot td { border-top: 1.5px solid var(--negro); border-bottom: 0; padding-top: 12px; }
button.enlace-chip { border: 0; cursor: pointer; font: inherit; font-size: 14px; min-height: 36px; }
button.enlace-chip .ico { width: 15px; height: 15px; }
@media (max-width: 1100px) { .detalle-marca.cuatro { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .detalle-marca.cuatro { grid-template-columns: 1fr; } }
.libro tr.detalle .desglose td { padding: 5px 0; background: none; border-bottom: 1px dashed var(--linea); font-size: 14.5px; vertical-align: baseline; }
.libro tr.detalle .desglose td:last-child { padding-left: 12px; }
.libro tr.detalle .desglose tr.suma td { border-bottom: 0; border-top: 1.5px solid var(--negro); padding-top: 8px; }
