/* Samurai Store V1.45.10 · Finanzas móvil
   Solo cambia la presentación en pantallas chicas. Desktop mantiene la tabla original. */

@media (max-width: 760px) {
  #financeSection .section-head {
    align-items: flex-start;
    gap: 12px;
  }

  #financeSection .finance-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #financeSection .finance-head-actions .btn {
    min-height: 42px;
    white-space: normal;
  }

  #financeSection .finance-periods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #financeSection .finance-period-btn {
    min-height: 40px;
    text-align: center;
  }

  #financeSection .finance-card-head h3 {
    font-size: 18px;
  }

  #financeSection .finance-card-head p {
    font-size: 12px;
    line-height: 1.5;
  }

  /* Las tablas financieras pasan a tarjetas verticales. */
  #financeSection .finance-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #financeSection .finance-table {
    min-width: 0 !important;
    width: 100%;
    display: block;
    border-collapse: separate;
  }

  #financeSection .finance-table thead {
    display: none;
  }

  #financeSection .finance-table tbody {
    display: grid;
    gap: 12px;
    width: 100%;
  }

  #financeSection .finance-table tbody tr {
    display: block;
    width: 100%;
    border: 1px solid #2b3447;
    border-radius: 16px;
    padding: 14px 15px;
    background: linear-gradient(145deg, #121b2a, #0c1421);
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
  }

  #financeSection .finance-table tbody td {
    display: grid;
    grid-template-columns: minmax(105px, .85fr) minmax(0, 1.15fr);
    gap: 12px;
    align-items: start;
    width: 100%;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid rgba(139, 162, 196, .13);
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  #financeSection .finance-table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  #financeSection .finance-table tbody td::before {
    color: #8fa2bf;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
    line-height: 1.35;
  }

  #financeSection .finance-table tbody td:first-child {
    display: block;
    padding: 0 0 13px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(139, 162, 196, .2);
  }

  #financeSection .finance-table tbody td:first-child::before {
    display: none;
  }

  #financeSection .finance-service b,
  #financeSection .finance-table tbody td:first-child b {
    font-size: 18px;
    line-height: 1.25;
  }

  #financeSection .finance-service small,
  #financeSection .finance-table tbody td:first-child small {
    font-size: 12px;
    margin-top: 4px;
  }

  /* Rentabilidad por producto */
  #financeProductTbody td:nth-child(2)::before { content: "Ventas"; }
  #financeProductTbody td:nth-child(3)::before { content: "Facturación"; }
  #financeProductTbody td:nth-child(4)::before { content: "Costo unitario"; }
  #financeProductTbody td:nth-child(5)::before { content: "Costo estimado"; }
  #financeProductTbody td:nth-child(6)::before { content: "Ganancia"; }
  #financeProductTbody td:nth-child(7)::before { content: "Margen"; }
  #financeProductTbody td:nth-child(8)::before { content: "Precio B2B"; }
  #financeProductTbody td:nth-child(9)::before { content: "Mínimo seguro"; }

  /* Rentabilidad por proveedor */
  #financeSupplierTbody td:nth-child(2)::before { content: "Cuentas"; }
  #financeSupplierTbody td:nth-child(3)::before { content: "Costo histórico"; }
  #financeSupplierTbody td:nth-child(4)::before { content: "Recuperado"; }
  #financeSupplierTbody td:nth-child(5)::before { content: "Por recuperar"; }
  #financeSupplierTbody td:nth-child(6)::before { content: "Potencial"; }
  #financeSupplierTbody td:nth-child(7)::before { content: "Ganancia potencial"; }
  #financeSupplierTbody td:nth-child(8)::before { content: "Incidencias"; }

  #financeProductTbody td:nth-child(3),
  #financeProductTbody td:nth-child(5),
  #financeProductTbody td:nth-child(6),
  #financeSupplierTbody td:nth-child(3),
  #financeSupplierTbody td:nth-child(4),
  #financeSupplierTbody td:nth-child(5),
  #financeSupplierTbody td:nth-child(6),
  #financeSupplierTbody td:nth-child(7) {
    font-weight: 800;
  }

  #financeSection .finance-chip {
    font-size: 11px;
    padding: 5px 8px;
  }
}

@media (max-width: 420px) {
  #financeSection .finance-kpis {
    grid-template-columns: 1fr;
  }

  #financeSection .finance-head-actions {
    grid-template-columns: 1fr;
  }

  #financeSection .finance-table tbody td {
    grid-template-columns: 100px minmax(0, 1fr);
    font-size: 13px;
  }
}
