/* Samurai Store V1.45.11 · Proveedores / cuentas pagadas en móvil
   Convierte únicamente la tabla "Cuentas pagadas a proveedores" en tarjetas verticales.
   Desktop conserva la tabla existente y toda la lógica sigue en admin.js. */

@media (max-width: 760px) {
  #suppliersSection .supplier-accounts-panel {
    padding: 14px;
    overflow: visible;
  }

  #suppliersSection .supplier-accounts-panel .supplier-panel-head {
    align-items: flex-start;
    gap: 12px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-panel-head h3 {
    font-size: 21px;
    line-height: 1.15;
  }

  #suppliersSection .supplier-accounts-panel .supplier-panel-head p {
    font-size: 12px;
    line-height: 1.45;
  }

  #suppliersSection .supplier-accounts-panel .supplier-head-actions {
    width: 100%;
  }

  #suppliersSection .supplier-accounts-panel #supplierPaySelectedBtn {
    width: 100%;
    min-height: 46px;
    white-space: normal;
    font-size: 13px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-toolbar input,
  #suppliersSection .supplier-accounts-panel .supplier-toolbar select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 14px;
  }

  #suppliersSection .supplier-accounts-panel .table-wrap {
    overflow: visible !important;
    border: 0;
    background: transparent;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table {
    min-width: 0 !important;
    width: 100%;
    display: block;
    border-collapse: separate;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table thead {
    display: none;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table tbody {
    display: grid;
    width: 100%;
    gap: 13px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    padding: 15px;
    border: 1px solid #26354c;
    border-radius: 16px;
    background: linear-gradient(145deg, #111b2b, #0b1422);
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    overflow: hidden;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table tbody td {
    display: grid;
    grid-template-columns: minmax(112px, .8fr) minmax(0, 1.2fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid rgba(151,171,203,.13);
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table tbody td::before {
    color: #91a4c2;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .055em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  /* Checkbox de selección: arriba a la derecha de cada tarjeta. */
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(1) {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    width: auto;
    padding: 0;
    border: 0;
    display: block;
  }
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(1)::before {
    display: none;
  }
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(1) input {
    width: 22px;
    height: 22px;
  }

  /* Cuenta: encabezado principal de la tarjeta. */
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(2) {
    display: block;
    padding: 0 42px 12px 0;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(151,171,203,.2);
  }
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(2)::before {
    display: block;
    content: "Cuenta";
    margin-bottom: 5px;
  }
  #suppliersSection .supplier-accounts-panel .supplier-account-main b {
    font-size: 16px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  #suppliersSection .supplier-accounts-panel .supplier-account-main span {
    font-size: 11px;
    margin-top: 4px;
  }

  #supplierAccountsTbody td:nth-child(3)::before { content: "Producto"; }
  #supplierAccountsTbody td:nth-child(4)::before { content: "Proveedor"; }
  #supplierAccountsTbody td:nth-child(5)::before { content: "Costo / margen"; }
  #supplierAccountsTbody td:nth-child(6)::before { content: "Vence proveedor"; }
  #supplierAccountsTbody td:nth-child(7)::before { content: "Uso"; }
  #supplierAccountsTbody td:nth-child(8)::before { content: "Prioridad / oferta"; }
  #supplierAccountsTbody td:nth-child(9)::before { content: "Acciones"; }

  #suppliersSection .supplier-accounts-panel .supplier-cost-main {
    font-size: 15px;
    line-height: 1.3;
  }
  #suppliersSection .supplier-accounts-panel .supplier-cost-sub,
  #suppliersSection .supplier-accounts-panel .supplier-cost-current {
    font-size: 11px;
    line-height: 1.45;
  }

  #suppliersSection .supplier-accounts-panel .supplier-due b,
  #suppliersSection .supplier-accounts-panel .supplier-usage b {
    font-size: 15px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-usage {
    min-width: 0;
    width: 100%;
  }
  #suppliersSection .supplier-accounts-panel .supplier-usage-bar {
    width: 100%;
    max-width: 210px;
    height: 7px;
  }
  #suppliersSection .supplier-accounts-panel .supplier-usage small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
  }

  #suppliersSection .supplier-accounts-panel .account-chip {
    margin: 0 5px 5px 0;
    font-size: 10px;
    white-space: normal;
  }

  #suppliersSection .supplier-accounts-panel .supplier-table tbody td:nth-child(9) {
    grid-template-columns: 1fr;
    border-bottom: 0;
    padding-bottom: 0;
  }
  #suppliersSection .supplier-accounts-panel .supplier-action-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  #suppliersSection .supplier-accounts-panel .supplier-action-group button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
  }

  #suppliersSection .supplier-accounts-panel #supplierAccountsPagination {
    margin-top: 14px;
  }
}

@media (max-width: 430px) {
  #suppliersSection .supplier-accounts-panel .supplier-table tbody td {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 8px;
  }

  #suppliersSection .supplier-accounts-panel .supplier-action-group {
    grid-template-columns: 1fr 1fr;
  }
}

/* V1.45.12 · detalle del precio sugerido */
.supplier-offer-hint{
  display:block;
  margin-top:6px;
  line-height:1.35;
  opacity:.88;
}
@media (max-width: 760px){
  .supplier-offer-hint{
    width:100%;
    font-size:12px;
    margin-top:8px;
  }
}


/* V1.45.13 · ahorro visible en oferta sugerida */
.supplier-offer-saving{
  display:inline-block;
  margin-top:3px;
  font-weight:800;
}
