/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f6f9;
  min-height: 100vh;
  margin: 0;
}

main {
  max-width: 1400px;
  width: 100%;
  padding: 40px 20px;
}

/* Contenedor principal */
.container, .admin-container {
  
  background: white;
  width: 100%;
  max-width: 1200px;
  padding: 3rem 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin: 0 auto;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.admin-container {
  background: #f5f5f5;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.admin-buttons button {
  background-color: #0061a8;
  color: #fff;
  font-weight: 400;
  transition: background-color 0.3s ease;
  margin-top: 1rem
}

.admin-buttons button:hover {
  background-color: #004c87;
}

button.volver-btn {
  background-color: #6c757d;
}

button.volver-btn:hover {
  background-color: #5a6268;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 600px;
  margin: 0.5rem auto;
}

/* Botones admin */
.admin-buttons {
  display: block;
  width: 70%;
  padding: 1rem;
  margin: 0.5rem auto; 
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  background-color: #ffffff;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Formularios */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 35px;
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

input, select, textarea {
  width: 100%;
  max-width: 600px;
  padding: 12px;
  font-size: 16px;
  margin: 0.5rem auto;
  border-radius: 8px;
  border: 1px solid #ccc;
  display: block;
}

button {
  display: block;
  width: 100%;
  max-width: 600px;
  padding: 12px;
  font-size: 16px;
  margin: 0.5rem auto;
  border-radius: 8px;
  background-color: #007acc;
  color: white;
  border: none;
  cursor: pointer;
  text-align: center;
}


.comprarbutton{
  width: 100%;
  max-width: 220px;
  align-content: center;
  background-color: #48a512c5;
  
}

.comprarrbutton:hover {
  background-color: #48a51299;
}


button.volver-btn {
  background-color: #6c757d;
}

button.volver-btn:hover {
  background-color: #5a6268;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #00aaff;
}

/* Botones generales */

button:hover {
  background-color: #005f99;
}

/* Botón volver */
.volver-btn {
  background-color: #888;
}

.volver-btn:hover {
  background-color: #666;
}

/* Textos */
h1, h2 {
  font-size: 2rem;
  color: #2c3e50;
  border-bottom: 2px solid #ccc;
  padding-bottom: 10px;
  margin-bottom: 1.5rem;
}

#message {
  margin-top: 1rem;
  color: green;
  font-weight: bold;
}

/* Grilla responsive */
.container-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 30px auto;
  padding: 30px;
}

@media screen and (max-width: 768px) {
  .container-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .container {
    padding: 1.5rem 1rem;
  }
  .admin-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .admin-buttons button {
    width: 100%;
    max-width: 100%;
    margin: 0.4rem 0;
    font-size: 1rem;
  }
}

/* Tarjetas */
.card-producto {
  width: 100%;
  max-width: 280px;
  min-width: 200px;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 12px;
  margin: 0 auto; /* ✅ centra cada tarjeta */
  background: white;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}



.cards-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 5rem;
  justify-content: center; 
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }
  #productosContainer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.5rem !important;
  }

  .card-producto {
    width: 90% !important;
    max-width: 320px !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
  }
}




/* Tabla de productos */
.productos-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.productos-tabla th,
.productos-tabla td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

.productos-tabla th {
  background-color: #f5f5f5;
}

.productos-tabla img {
  max-width: 80px;
  border-radius: 6px;
}

/* Items producto */
.producto-item {
  background-color: #f5f9fa;
  border-left: 5px solid #007faa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

/* Pedidos */
.pedido-box {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-left: 5px solid #0077b6;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  text-align: center;
}

.pedido-box h3 {
  margin-top: 0;
  color: #023e8a;
}

.pedido-box ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 0;
}

.pedido-box li {
  margin-bottom: 4px;
}

.container form,
.container button {
  margin-left: auto;
  margin-right: auto;
}

/* Ajustes móviles */
@media screen and (max-width: 602px) {
  .card-producto,
  .pedido-box {
    width: 100%;
    margin: 0 auto 1rem;
  }

  body {
    padding: 10px;
    justify-content: flex-start;
  }

  .admin-container {
    padding: 1rem;
  }

  button {
    font-size: 1rem;
  }
    input, select, textarea, button {
    width: 100%;
  }

}




#productosContainer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  display: flex;
  justify-content: center; /* ✅ centra .cards-grid */
}

.fila-producto {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 0.5rem;
}

.fila-producto .info {
  flex: 1;
}

.fila-producto .cantidad input {
  width: 90px;
  padding: 6px;
}

#totalContainer {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.tabla-pedidos {
  width: 100%;
  max-width: 1100px;
  margin: 1rem auto;
  border-collapse: collapse;
  background-color: #fff;
  border: 1px solid #ccc;
}

.tabla-pedidos th, .tabla-pedidos td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.pedido-row {
  cursor: pointer;
  background-color: #f9f9f9;
}

.pedido-row:hover {
  background-color: #e0f7fa;
}

.detalle-row td {
  background-color: #f0f8ff;
}

.pedido-row:hover {
  background-color: #eef;
}


.toggle-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.toggle-btn:hover {
  color: #ffffff;
}


.toggle-btn:active {
  background-color: #ddd;
}
.detalle-row {
  background-color: #f9f9f9;
}

/* Estilo profesional para formCategoria */
#formCategoria, #formSubcategoria, #formProducto {
  background-color: #ffffff;
  padding: 2.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 500px;
  margin: 0.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#formCategoria input, #formSubcategoria input, #formProducto input {
  padding: 14px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  transition: border-color 0.2s ease;
}

#formCategoria input:focus, #formSubcategoria input:focus, #formProducto input:focus {
  border-color: #007acc;
  outline: none;
}

#formCategoria button, #formSubcategoria button, #formProducto button {
  background-color: #007acc;
  color: white;
  font-weight: 400;
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#formCategoria button:hover, #formSubcategoria button:hover, #formProducto button:hover {
  background-color: #005f99;
}

#formCategoria #mensaje, #formSubcategoria #mensaje, #formProducto #mensaje {
  text-align: center;
  font-weight: bold;
  margin-top: 10px;
}

/* Header general */
/* Header horizontal profesional */
.main-header {
  width: 100%;
  background-color: #0977c1;
  color: white;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; /* asegura ancho total */
  position: relative;
}


.logo {
  font-size: 1.6rem;
  font-weight: 600;
  color: white;
  margin: 0;
  margin-right:0rem;
  text-align: center;
  flex: 1;
  border-bottom: none !important;
}

/* Botón hamburguesa */
.hamburger {
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  display: none;
  margin-right: 2rem;
}

/* Navegación en desktop */
#navMenu {
  display: flex;
  gap: 1.5rem;
}

.soloMovil{
  display: none;
}


#navMenu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

#navMenu a:hover {
  color: #e0f7ff;
}

.user-info {
  color: white;
  font-weight: 500;
  font-size: 0.95rem;
  margin-right: 1rem;
}


body.admin-protegido {
  display: none;
}

.distribuidor-bloque {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.distribuidor-bloque h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}


table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  background-color: white;
}

th {
  background-color: #1c2acca5;
  color: white;
  text-align: center;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 16px;
}

td {
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 15px;
}

tr:last-child td {
  border-bottom: 1px solid #e0e0e0;
}

select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  font-size: 14px;
  transition: border 0.2s ease-in-out;
}

select:focus {
  border-color: #007bff;
  outline: none;
  background-color: #fff;
}

.boton-rojo {
  background-color: #d9534f; /* rojo bootstrap */
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 5px;
}

.boton-rojo:hover {
  background-color: #c9302c;
}

.boton-azul {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 5px;
}

.boton-azul:hover {
  background-color: #0056b3;
}

.boton-azul,
.boton-rojo {
  display: block;
  width: 40%;
  margin-bottom: 6px; /* espacio entre botones */
}

.boton-azul {
  margin-right: 10px;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 5px;
  gap:5px;
}



/* Estilos responsive */
@media screen and (max-width: 768px) {

  .soloMovil{
  display: block;
}

  .user-name {
    display: none;
  }

  .toggle-btn {
    font-size: 1.4rem;
    width: 2.4rem;
    height: 2.4rem;
    line-height: 2.2rem;
  }
  .user-info {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .logo {
    flex: 1 1 200rem;
    text-align: center;
    margin-top: 0.5rem;
    margin-right: 2rem;
  }

  .logo-img {
margin-right: 5rem;
margin-left: 0.6rem
}

  #navMenu {
    display: none;
    flex-direction: column;
    background-color: #007acc;
    padding: 1rem;
    position: absolute;
    top: 100%; /* Aparece justo debajo del header-content */
    left: 0;
    right: 0;
    z-index: 9;
  }

  #navMenu.show {
    display: flex;
  }

  #navMenu a {
    padding: 0.5rem 0;
    font-size: 1.1rem;
  }

.main-header {
  padding: 0.1rem 1rem; /* más bajo y angosto */
}

  .tabla-pedidos thead {
    display: none;
  }

  .tabla-pedidos tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.5rem;
  }

  .tabla-pedidos td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .tabla-pedidos td::before {
    content: attr(data-label);
    font-weight: bold;
  }

  .tabla-pedidos td:last-child {
    border-bottom: none;
  }
  .acciones {
    display: flex;
    flex-direction: row; /* importante: horizontal */
    justify-content: center;
    gap: 10px;
  }

  .acciones .boton-azul,
  .acciones .boton-rojo {
    width: auto;
    min-width: 70%;
    flex: 1;
    margin-right:5rem;
    margin-left:5rem;

  }
}


table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  background-color: white;
}

th {
  background-color: #1c2acca5;
  color: white;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 16px;
}

td {
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 15px;
}

tr:last-child td {
  border-bottom: 1px solid #e0e0e0;
}

#tablaVendedores{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  background-color: white;
}



#tablaVendedores th{
  background-color: #1c2acca5;
  color: white;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
}

#tablaVendedores td {
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 15px;
}


/* Contenedor de tarjetas */
.cards-container {
  display: none;
  gap: 1rem;
  flex-direction: column;
}

/* Tarjeta individual */
.card-vendedor {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  background: #fff;
}

/* Responsive: ocultar tabla en móvil, mostrar tarjetas */
@media (max-width: 768px) {
  #tablaVendedores {
    display: none;
  }

  .cards-container {
    display: flex;
  }
}


/* Tabla de escritorio */
.tabla-asignaciones {
  width: 110%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  background-color: white;
}

.tabla-asignaciones th{
  background-color: #1c2acca5;
  color: white;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 16px;
}


.tabla-asignaciones td {
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 15px;
}

.tabla-asignaciones td:nth-child(2),
.tabla-asignaciones th:nth-child(2) {
  width: 40%;
}

/* Tarjetas para móviles */

.filtros-superiores {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.grupo-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grupo-filtros input,
.grupo-filtros select {
  padding: 6px;
  font-size: 14px;
  width: 140px;
  box-sizing: border-box;
}

.boton-excel {
  display: flex;
  align-items: center;
}

#btnExportarExcel {
  padding: 6px 14px;
  font-size: 14px;
  height: 34px;
  white-space: nowrap;
  margin-left:1rem;
  font-weight: 400;
}



@media (max-width: 768px) {
  .tabla-asignaciones {
    display: none;
  }

  .cards-asignaciones {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .card-asignacion {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  }

  .card-asignacion select {
    width: 100%;
    margin-top: 0.5rem;
  }

  .info-externo {
    font-style: italic;
    color: #007bff;
    margin-top: 0.5rem;
  }

  .filtros-superiores {
    flex-direction: column;
    align-items: center;
  }

  .grupo-filtros {
    justify-content: center;
  }  

  .boton-excel {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    margin-left:-1rem;
  }
}


.filtros-superiores {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.grupo-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.boton-excel {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;

}

@media (max-width: 768px) {
  .filtros-superiores {
    flex-direction: column;
    align-items: center;
  }

  .grupo-filtros {
    justify-content: center;
  }

  .boton-excel {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    font-weight: 400;
  }
}




.filtros-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  max-width: 900px; /* igual al ancho de tu tabla */
  margin-left: auto;
  margin-right: auto;
}

.filtros-container input,
.filtros-container select {
  flex: 1 1 120px;
  max-width: 140px;
  min-width: 100px;
  padding: 8px;
}

.filtros-container button {
  flex: 1 1 120px;
  max-width: 140px;
  padding: 10px 14px;
}

.cards-container {
  display: none;
  width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
}

.card-vendedor,
.card-distribuidor {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  margin: 0 auto 16px auto;
  background-color: #f9f9f9;

  width: 100%;
  max-width: 600px; /* ← más anchas que antes */
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  table {
    display: none;
  }

  .cards-container {
    display: block;
  }
}


.pedido-box {
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-left: 5px solid #007acc;
  padding: 1.2rem;
  margin: 0 auto 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 600px;
}


@media screen and (max-width: 768px) {
  .tabla-pedidos {
    display: none !important;
  }

  #cardsPedidos.cards-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}


.filtros-superiores1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem auto;
  max-width: 900px;
}

.filtros-superiores1 input,
.filtros-superiores1 select {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 8px;
  font-size: 14px;
}


  .producto-edit {
    border: 1px solid #ddd;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .producto-edit img {
    border: 1px solid #ccc;
    max-height: 120px;
    object-fit: contain;
  }

.filtros-linea-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.filtros-linea-horizontal .grupo {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.filtros-linea-horizontal select,
.filtros-linea-horizontal button {
  width: 100%;
  font-size: 15px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.filtros-linea-horizontal button {
  background-color: #007acc;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.filtros-linea-horizontal button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .filtros-linea-horizontal {
    flex-direction: column;
    align-items: stretch;
  }
}


.popup-confirmacion {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.popup-content p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
}

.popup-content button {
  background-color: #007acc;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.popup-content button:hover {
  background-color: #005f99;
}


.logo-img {
  height: 60px; /* ajustalo según el tamaño del header */
  max-width: 160px;
  object-fit: contain;
}


  #tablaAsignaciones {
    width: 70%;
    margin: 2rem auto;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  #tablaAsignaciones th,
  #tablaAsignaciones td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ccc;
  }

  #tablaAsignaciones th {
    background-color: #000000;
    color: white;
    text-align: center;
  }

  #tablaAsignaciones select {
    width: 100%;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }

  @media (max-width: 768px) {
    #tablaAsignaciones,
    #tablaAsignaciones thead,
    #tablaAsignaciones tbody,
    #tablaAsignaciones tr,
    #tablaAsignaciones td {
      display: block;
      width: 100%;
    }

    #tablaAsignaciones thead {
      display: none;
    }

    #tablaAsignaciones tr {
      margin-bottom: 1.5rem;
      background: #fff;
      border: 1px solid #ddd;
      border-radius: 8px;
      padding: 1rem;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    #tablaAsignaciones td {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border: none;
      border-bottom: 1px solid #eee;
    }

    #tablaAsignaciones td:last-child {
      border-bottom: none;
    }

    #tablaAsignaciones td::before {
      content: attr(data-label);
      font-weight: bold;
      color: #555;
    }
  }

#tablaListas{
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#tablaListas th, td{
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

#tablaListasVisual {
  max-width: 800px; /* Ajustá a gusto: 600px, 700px, etc. */
  margin: 2rem auto; /* Centrado horizontal y algo de espacio vertical */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;

}

#tablaListasVisual button {
  padding: 6px 12px;
  font-size: 0.9rem;
  min-width: unset; /* Anula cualquier min-width heredado */
  width: auto;
}

#tablaListasVisual th {
  text-align: center;
}

#tablaListasVisual th, 
#tablaListasVisual td {
  padding: 6px 8px; /* menos espacio vertical y horizontal */
  text-align: center;
  border: 1px solid #ccc;
}

.btn-link {
  background-color: white;
  border: none;
  padding: 0;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

/* Botón "Editar" como link azul */
.btn-editar {
  color: #007bff; /* azul */
}

/* Botón "Eliminar" como link rojo */
.btn-eliminar {
  color: #dc3545; /* rojo */
}
.btn-eliminar:hover {
  background-color: #c8c7c7;
}
.btn-editar:hover {
  background-color: #c8c7c7;
}


.guardar-btn {
  padding: 8px 20px;        /* controla tamaño sin usar width fija */
  width: fit-content;       /* ajusta el ancho al contenido */
  margin: 1rem auto;        /* centra el botón horizontalmente */
  display: block;           /* necesario para centrar con margin auto */
  font-size: 1rem;
  background-color: #22561a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: 400;
}

.guardar-btn:hover {
  background-color: #10380f;
}


.popup-overlay {
  display: none; /* ❗️Solo esto */
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
}


.popup-contenido {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  width: 300px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}


.filtros-flex {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin: 1.5rem 0;
  flex-wrap: wrap; /* Opcional: para que no se rompa en pantallas chicas */
}

.filtro {
  display: flex;
  flex-direction: column;
}

.filtro select, .filtro button {
  min-width: 180px;
}


#guardarCambios {
  padding: 0.4rem 1.2rem;
  font-size: 0.95rem;
  width: fit-content;
  margin-top: 1rem;
}

#mostrarProductos {
  padding: 0.4rem 1.2rem;
  font-size: 0.95rem;
  height: auto;
}

.volver-container {
  text-align: center;
}

.volverbutton {
  all: unset;
  cursor: pointer;
  color: #007bff;
  text-decoration: underline;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.volverbutton:hover {
  color: white;
  background-color: #007bff;
  text-decoration: none;
}

#tablaDistribuidores th{
  text-align: center;
  background-color: #000 !important;
}

.boton-verde {
  background-color: #14742b !important;
  color: white !important;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.boton-verde:hover {
  background-color: #105d22 !important;
}

.boton-verde:disabled {
  background-color: #a5d6a7; /* verde apagado */
  cursor: not-allowed;
}

.boton-azul:disabled {
  background-color: #90caf9; /* azul claro */
  cursor: not-allowed;
}

.boton-rojo:disabled {
  background-color: #ef9a9a; /* rojo claro */
  cursor: not-allowed;
}


/* ===== Tabla compacta y 2 columnas de acciones ===== */
.levels-table{
  width:100%;
  border-collapse: collapse;   /* celdas finas */
  table-layout: fixed;
  margin-top:16px;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 4px 10px rgba(0,0,0,.05);
}

.levels-table th,
.levels-table td{
  padding:6px 8px;            /* compacto */
  border:1px solid #e5e7eb;
  vertical-align:middle;
  font-size:14px;
  line-height:1.2;            /* reduce altura */
}

.levels-table thead th{
  background:#0b6fb8;
  color:#fff;
  font-weight:600;
}

.levels-table tbody tr:nth-child(odd){ background:#fafbfc; }
.levels-table tbody tr:hover{ background:#f2f7fb; }

/* Inputs más bajos y sin márgenes raros */
.levels-table input[type="text"].input-row{
  width:100%;
  padding:6px 8px;
  height:32px;                /* fuerza altura */
  border:1px solid #cfd6e4;
  border-radius:8px;
  font-size:14px;
  line-height:1;              /* evita crecer */
  box-sizing:border-box;
}

/* Botones compactos, sin márgenes verticales grandes */
.levels-table .btn-xs{
  display:block;
  width:100%;
  padding:6px 10px;
  line-height:1;              /* clave para altura */
  border-radius:8px;
  border:none;
  cursor:pointer;
  margin:0;                   /* elimina márgenes globales */
  text-align:center;
  font-size:13px;
}
.levels-table .btn-save{ background:#0b6fb8; color:#fff; }
.levels-table .btn-save:hover{ background:#095e9b; }
.levels-table .btn-delete{ background:#e35757; color:#fff; }
.levels-table .btn-delete:hover{ background:#cc4949; }

/* Anchos de columnas (ajusta a gusto) */
.levels-table .col-nombre  { width:38%; }
.levels-table .col-columna { width:32%; }
.levels-table .col-guardar { width:15%; }
.levels-table .col-eliminar{ width:15%; }

/* Mobile */
@media (max-width: 768px){
  .levels-table th, .levels-table td{ font-size:13px; padding:6px; }
}


/* ==== FIX: Ignorar estilos globales dentro del formulario nuevo ==== */
#formProducto {
  display: block !important;     /* anula form { display:flex } global */
  width: 100% !important;
  max-width: 900px !important;    /* tarjeta más ancha */
  margin: 0 auto !important;
  padding: 20px !important;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6edf7;
  box-shadow: 0 12px 30px rgba(16,24,40,.06);
}

/* anula input/select/textarea globales dentro del form */
#formProducto input,
#formProducto select,
#formProducto textarea,
#formProducto button {
  max-width: none !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* ===== Layout interno (labels + inputs en línea) ===== */
#formProducto .form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columnas */
  gap: 12px 18px;
}
@media (max-width: 820px){
  #formProducto .form-grid{ grid-template-columns: 1fr; }
}

#formProducto .field{
  display: grid;
  grid-template-columns: 160px 1fr;  /* label | input */
  align-items: center;
  gap: 8px;
}
#formProducto .field--full{ grid-column: 1 / -1; }

#formProducto .field label{
  font-weight: 600;
  color: #344256;
  white-space: nowrap;
}
#formProducto .field input[type="text"],
#formProducto .field input[type="number"],
#formProducto .field textarea{
  padding: 10px 12px;
  border: 1px solid #cfd6e4;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
#formProducto .field textarea{ min-height: 90px; resize: vertical; }

/* ===== Imagen con preview ===== */
#formProducto .image-box{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px; align-items: center;
}
#formProducto .image-input{ display:flex; flex-direction:column; gap:8px; }
#formProducto .image-preview{
  grid-column: 1 / -1;
  height: 180px;
  border: 1px dashed #d7deea;
  border-radius: 12px;
  background: #f7f9fc;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  color:#94a3b8;
}
#formProducto .image-preview img{ max-height:100%; max-width:100%; object-fit:contain; }

/* ===== Dinámicos (categorías) ===== */
#formProducto #categorias-container{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
#formProducto #categorias-container .field{
  grid-template-columns: 160px 1fr;
}
@media (max-width: 820px){
  #formProducto #categorias-container{ grid-template-columns: 1fr; }
}

/* ===== Acciones ===== */
#formProducto .form-actions{
  display:flex; gap:12px; justify-content:flex-end;
  margin-top: 8px;
}
#formProducto .btn{
  border:0; border-radius:10px; padding:10px 16px;
  font-weight:600; cursor:pointer;
}
#formProducto .btn.btn-primary{ background:#0b6fb8; color:#fff; }
#formProducto .btn.btn-primary:hover{ background:#095e9b; }

@media (max-width: 768px) {
  #filtros-dinamicos {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra horizontalmente */
  }

  #filtros-dinamicos .grupo {
    width: 90%; /* Para que no queden muy anchos en móviles */
    max-width: 400px;
    text-align: center; /* Centra etiquetas y selects */
  }

  #filtros-dinamicos label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
  }

  #filtros-dinamicos input,
  #filtros-dinamicos select {
    width: 100%;
  }
}

/* ===========================
   Admin Panel – UI Pro (solo esta vista)
   =========================== */
:root{
  --bg:#f6f7f9;
  --surface:#ffffff;
  --ink:#0b0b0b;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#111;            /* acento oscuro sobrio */
  --brand-ghost:#11111110;
  --radius-lg:22px;
  --radius-md:14px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --shadow-md:0 10px 30px rgba(0,0,0,.08);
}

body{ background:var(--bg); color:var(--ink); }

/* Header limpio, blanco, con línea sutil */
.main-header{
  background:#fff !important;
  color:var(--ink) !important;
  border-bottom:1px solid var(--line);
  box-shadow:none !important;
}
#navMenu a{ color:var(--ink); font-weight:600; }
#navMenu a:hover{ color:#000; }

/* ===========================
   Card principal y título
   =========================== */
.container{
  max-width: 920px !important;
  text-align:left !important;
  align-items:stretch !important;
  padding: clamp(18px, 3vw, 32px) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid #f1f5f9;
}
.container h1{
  margin: 4px 0 18px;
  border: 0 !important;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  letter-spacing:-0.02em;
  position: relative;
}
.container h1::after{
  content:"";
  display:block;
  width:72px; height:4px;
  background: var(--ink);
  border-radius: 999px;
  margin-top:12px;
}

/* ===========================
   Grid de acciones (tus <button>)
   =========================== */
.container{
  display:grid !important;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 880px){
  .container{ grid-template-columns: 1fr 1fr; }
  .container h1{ grid-column:1 / -1; }
  .container .volverbutton{ grid-column:1 / -1; }
}

/* Botón–tarjeta: aplica a todos salvo “Cerrar sesión” */
.container > button:not(.volverbutton){
  width:100% !important;
  margin:0 !important;
  text-align:left !important;
  background:#fff !important;
  color:var(--ink) !important;
  border:1px solid var(--line) !important;
  border-radius:16px !important;
  padding:16px 18px !important;
  font-weight:700 !important;
  font-size:16px !important;
  box-shadow: var(--shadow-sm) !important;
  display:flex !important;
  align-items:center;
  gap:12px;
  position:relative;
  transition: transform .05s ease, box-shadow .2s ease, border-color .2s ease;
}
.container > button:not(.volverbutton)::after{
  content:"›";
  position:absolute; right:16px; top:50%; transform:translateY(-50%);
  font-size:22px; opacity:.5;
}
.container > button:not(.volverbutton):hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-md) !important;
  border-color:#dbe3ef !important;
  background: #fff;
}

/* Chip de “acción recomendada” (opcional) */
.container > button.is-primary{
  outline: 3px solid var(--brand-ghost);
}

/* “Cerrar sesión” como enlace secundario centrado */
.volverbutton,
.container > .volverbutton{
  all: unset;
  justify-self:center;
  cursor:pointer;
  color: var(--muted);
  font-weight:600;
  padding:8px 10px;
  border-radius:8px;
}
.volverbutton:hover{
  color:#000;
  background:#f3f4f6;
}

/* Accesibilidad: foco visible */
.container > button:focus-visible{
  outline:3px solid #000; outline-offset:2px;
  border-color:#000;
}

/* Logo un poco más compacto en desktop */
.logo-img{ height:54px; }

/* Modo oscuro opcional (si algún día lo activas en <html data-theme="dark">) */
html[data-theme="dark"]{
  --bg:#0b0e13; --surface:#12161c; --ink:#f1f5f9; --muted:#9aa4b2; --line:#202632; --brand:#fff;
}
html[data-theme="dark"] body{ background:var(--bg); color:var(--ink); }
html[data-theme="dark"] .main-header{ background:var(--surface)!important; border-color:var(--line); }
html[data-theme="dark"] .container{ background:var(--surface)!important; border-color:var(--line); box-shadow:none; }
html[data-theme="dark"] .container > button:not(.volverbutton){
  background: #151a22 !important; border-color: var(--line) !important; color:var(--ink)!important;
}
html[data-theme="dark"] .volverbutton:hover{ background:#1b2230; }


/* ===== Menú Distribuidor – fix desktop layout sin tocar HTML ===== */

/* Meta del distribuidor */
#distribuidorInfo{
  color:#6b7280;
  font-size:16px;
  margin: 6px 0 18px;
}

/* Contenedor: ancho y grilla específicos para esta vista */
.container{
  max-width: 1100px !important;
}

/* Desktop: título y meta en ancho completo; 2 botones en 2 columnas */
@media (min-width: 880px){
  /* Aplica cuando hay al menos 2 botones de acción en la container */
  .container:has(> button:nth-of-type(2)){
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
    align-items: start;
  }
  .container:has(> button:nth-of-type(2)) > h1,
  .container:has(> button:nth-of-type(2)) > #distribuidorInfo{
    grid-column: 1 / -1;
  }
  /* Colocar "Cerrar sesión" como enlace alineado a la derecha */
  .container:has(> .volverbutton) > .volverbutton{
    grid-column: 2 / 3;
    justify-self: end;
    margin-top: 8px;
  }
}

/* Botones-tarjeta (solo los de acción) */
.container > button:not(.volverbutton){
  width:100% !important;
  margin:0 !important;
  text-align:left !important;
  background:#fff !important;
  color:#0b0b0b !important;
  border:1px solid #e5e7eb !important;
  border-radius:16px !important;
  padding:18px 20px !important;
  font-weight:700 !important;
  font-size:16px !important;
  line-height:1.2;
  min-height:64px;
  box-shadow:0 1px 2px rgba(0,0,0,.06) !important;
  display:flex !important;
  align-items:center;
  gap:12px;
  position:relative;
  transition: transform .05s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.container > button:not(.volverbutton)::after{
  content:"›";
  position:absolute; right:16px; top:50%; transform:translateY(-50%);
  font-size:22px; opacity:.45;
}
.container > button:not(.volverbutton):hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0,0,0,.08) !important;
  border-color:#dbe3ef !important;
  background:#fff;
}

/* “Cerrar sesión” como enlace discreto */
.volverbutton{
  all: unset;
  cursor:pointer;
  color:#6b7280;
  font-weight:600;
  padding:8px 10px;
  border-radius:8px;
}
.volverbutton:hover{ color:#000; background:#f3f4f6; }

/* Título con subrayado corto (como el mock) */
.container h1{
  border:0 !important;
  margin: 4px 0 10px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  letter-spacing:-0.02em;
}
.container h1::after{
  content:"";
  display:block; width:72px; height:4px;
  background:#0b0b0b; border-radius:999px; margin-top:12px;
}

/* Header limpio */
.main-header{
  background:#fff !important;
  color:#0b0b0b !important;
  border-bottom:1px solid #e5e7eb;
  box-shadow:none !important;
}
#navMenu a{ color:#0b0b0b; font-weight:600; }
#navMenu a:hover{ color:#000; }

/* Ajustes responsivos */
@media (max-width: 879px){
  .container{ display:flex !important; flex-direction:column; gap:12px; }
  .volverbutton{ align-self:center; }
}
/* === FIX: limitar el grid de .container sólo a páginas tipo “menú” === */
/* 1) Vuelve a columna única por defecto */
.container{
  display:block !important;             /* fuera el grid global */
  max-width: 1100px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:left !important;
}

/* 2) Usa grid SOLO cuando haya al menos dos botones de acción principales */
@media (min-width: 880px){
  .container:has(> button:not(.volverbutton) + button:not(.volverbutton)){
    display:grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
    align-items:start;
  }
  .container:has(> button:not(.volverbutton) + button:not(.volverbutton)) > h1,
  .container:has(> button:not(.volverbutton) + button:not(.volverbutton)) > #distribuidorInfo{
    grid-column: 1 / -1;
  }
  .container:has(> button.volverbutton){
    /* si hay “Cerrar sesión” en ese layout */
    grid-auto-rows: minmax(0, auto);
  }
}

/* 3) Formularios anchos centrados (Nuevo Producto, etc.) */
.container:has(#formProducto){
  display:block !important;            /* columna única */
  max-width: 980px !important;         /* cómodo y centrado */
}
.container:has(#formProducto) > h1{
  margin-bottom: 14px;
}

/* 4) Tabla de niveles: columna única también (ya lo usamos arriba pero refuerzo) */
.container:has(#tablaLevels){
  display:block !important;
  max-width: 1100px !important;
}

/* 5) Botones–tarjeta: aplícalo sólo a containers “de menú” */
.container:has(> button:not(.volverbutton) + button:not(.volverbutton)) > button:not(.volverbutton){
  width:100% !important;
  margin:0 !important;
  text-align:left !important;
  background:#fff !important;
  color:#0b0b0b !important;
  border:1px solid #e5e7eb !important;
  border-radius:16px !important;
  padding:18px 20px !important;
  font-weight:700 !important;
  min-height:64px;
  box-shadow:0 1px 2px rgba(0,0,0,.06) !important;
  display:flex !important;
  align-items:center;
  gap:12px;
  position:relative;
}
.container:has(> button:not(.volverbutton) + button:not(.volverbutton)) 
  > button:not(.volverbutton)::after{
  content:"›";
  position:absolute; right:16px; top:50%; transform:translateY(-50%);
  font-size:22px; opacity:.45;
}

/* 6) Mantén el margen uniforme bajo el header (16px aprox.) */
:root{ --header-gap:16px; }
.main-header + .container,
.main-header + .admin-container{
  margin-top: var(--header-gap) !important;
}
.container > :first-child{ margin-top:0 !important; }

/* === Mobile: separaciones entre botones (todas las vistas) === */
/* === Mobile: separaciones universales dentro de .container === */
/* === Móvil: separar SIEMPRE los hijos de .container === */
@media (max-width: 879px){
  /* 1) Columna con gap universal (funciona mejor que márgenes sueltos) */
  .container{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;            /* <-- el espacio entre TODOS los hijos */
  }

  /* 2) Anula márgenes que pegaban los botones o los dejaban en 0 */
  .container > button,
  .container > .volverbutton,
  .container > *{
    margin: 0 !important;
  }

  /* 3) Fallback por si algún navegador no soporta flex gap */
  .container > * + *{
    margin-top: 12px !important;
  }
}

/* === Móvil: menú hamburguesa compacto y más angosto === */
@media (max-width: 768px){
  .header-content{ position: relative; } /* ancla para el panel */

  /* Panel: deja de ocupar todo el ancho, se vuelve una cajita a la derecha */
  #navMenu{
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 8px !important;
    left: auto !important;               /* ← cancela el full-width */
    width: min(78vw, 320px) !important;  /* ← más angosto */
    max-height: 70vh;                     /* scroll si se pasa */
    overflow-y: auto;
    padding: 6px !important;              /* menos relleno */
    gap: 4px !important;                  /* menos separación entre links */
    background-color: #0977c1 !important; /* tu color de marca */
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
    border: 1px solid rgba(255,255,255,.15);
    z-index: 20;
  }

  /* Ítems: tipografía más chica y padding reducido */
  #navMenu a{
    font-size: 0.95rem !important;        /* antes 1.1rem */
    line-height: 1.2 !important;
    padding: 8px 10px !important;         /* antes 0.5rem 0 (muy alto) */
    border-radius: 8px;
  }

  /* Hover/active sutiles */
  #navMenu a:hover{
    background: rgba(255,255,255,.12);
  }

  /* Asegura que al abrir se muestre con flex (tu JS ya pone .show) */
  #navMenu.show{ display: flex !important; }

  /* Por si el botón hamburguesa queda tapado */
  .hamburger{ z-index: 21; }
}
@media (max-width: 768px){
  /* Menú compacto alineado a la izquierda */
  #navMenu{
    left: -1rem !important;
    right: auto !important;
  }
}

.container h1 {
  font-size: 1.8rem; /* antes probablemente 2rem o más */
}

@media (max-width: 768px) {
  .container h1 {
    font-size: 1.5rem;
  }
}

/* ===== Nuevo Pedido (layout específico, sin :has) ===== */
.container.pedido-layout{
  display: grid !important;
  grid-template-columns: 300px minmax(0, 1fr) !important; /* filtros | grilla */
  grid-template-rows: auto 1fr !important;                 /* total arriba */
  grid-template-areas:
    "filters total"
    "filters content" !important;
  gap: 20px !important;
  align-items: start !important;
  max-width: 1200px !important;
}

/* Sidebar filtros (columna izquierda) */
.container.pedido-layout #filtros-dinamicos{
  grid-area: filters !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  background: #fff !important;
  border: 1px solid #e6edf7 !important;
  border-radius: 14px !important;
  padding: 16px !important;
  box-shadow: 0 6px 18px rgba(16,24,40,.06) !important;
  position: sticky !important;
  top: 76px !important;       /* debajo del header */
  z-index: 1 !important;
  width: 100% !important;
  max-width: 300px !important;
}

/* Total (arriba, derecha) */
.container.pedido-layout > #totalContainer{
  grid-area: total !important;
  margin: 0 !important;
  align-self: end !important;
}

/* El form (con los productos) ocupa la derecha */
.container.pedido-layout > form#pedidoForm{
  grid-area: content !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Grilla de productos (anula cualquier flex previo) */
.container.pedido-layout #pedidoForm #productosContainer{
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(220px, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  justify-content: initial !important;
  align-items: stretch !important;
}

/* Tarjetas de producto */
.container.pedido-layout #pedidoForm #productosContainer > *{
  margin: 0 !important;
  background: #fff !important;
  border: 1px solid #eef2f7 !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
.container.pedido-layout #pedidoForm #productosContainer img{
  width: 100% !important;
  height: 160px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
}

/* Inputs/botones dentro de cada tarjeta */
.container.pedido-layout #pedidoForm #productosContainer input[type="number"],
.container.pedido-layout #pedidoForm #productosContainer input[type="text"]{
  padding: 10px 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  width: 100% !important;
}
.container.pedido-layout #pedidoForm #productosContainer button{
  width: 100% !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: #111 !important;
  color: #fff !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

/* Botones principales del form */
.container.pedido-layout #pedidoForm .comprarbutton,
.container.pedido-layout #pedidoForm .volverbutton{
  margin-top: 12px !important;
  width: fit-content !important;
}

/* Responsive */
@media (max-width: 1200px){
  .container.pedido-layout #pedidoForm #productosContainer{
    grid-template-columns: repeat(2, minmax(200px, 1fr)) !important;
  }
}
@media (max-width: 768px){
  .container.pedido-layout{
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }
  .container.pedido-layout #filtros-dinamicos{
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-width: none !important;
  }
  .container.pedido-layout #pedidoForm #productosContainer{
    grid-template-columns: 1fr !important;
  }
}
/* ===== Layout de 2 columnas: filtros izquierda + productos derecha ===== */
.container.pedido {
  align-items: stretch;          /* no centrar todo verticalmente */
  text-align: initial;           /* texto normal */
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
  width: 100%;
  align-items: start;
}

/* Sidebar fija (opcional) */
.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
}

/* Reutilizo tu estilo de filtros, pero en columna angosta */
.sidebar .filtros-linea-horizontal {
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
}
.sidebar .filtros-linea-horizontal .grupo {
  min-width: auto;
}

/* Zona de productos */
.main-content {
  width: 100%;
}

/* El contenedor de productos debe expandirse y no quedar centrado rígido */
#productosContainer {
  width: 100%;
  max-width: none;
  margin: 0 0 2rem 0;
  display: block;                /* dejá que la grilla interna maneje el layout */
}

/* Grilla de tarjetas más fluida: llena el ancho disponible */
.cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  justify-items: center;
}

/* Tarjetas coherentes con la nueva grilla */
.card-producto {
  width: 100%;
  max-width: 320px;
}

/* Responsive: en móviles se apila (filtros arriba, productos abajo) */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
}

/* =========================
   Estilo sobrio/profesional
   ========================= */
:root{
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0b6fb8;
  --brand-700:#095e9b;
  --success:#1f8a3a;
}

body{ background: var(--bg); color: var(--ink); }

/* container general del pedido */
.container.pedido{
  max-width: 1280px;
  border-radius: 18px;
  padding: 2.25rem;
  box-shadow: 0 8px 24px rgba(16,24,40,.06);
  text-align: initial;
}

/* título más sobrio */
.container.pedido h1{
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  border: none;
  margin-bottom: 1rem;
}
.container.pedido h1 + hr,
.container.pedido h1::after{
  content:"";
  display:block;
  width: 44px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  margin-top:.5rem;
}

/* layout 2 columnas */
.layout{
  display:grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 2rem;
  margin-top: .75rem;
}

/* sidebar con panel sobrio */
.sidebar{
  position: sticky; top: 1rem;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.sidebar label{ 
  font-size:.95rem; 
  font-weight:600; 
  color:#0f172a; 
  margin-bottom:.35rem;
}

.sidebar .filtros-linea-horizontal{
  display: grid;
  gap: .85rem;
}
.sidebar .grupo{ min-width: auto; }

/* inputs/selects más profesionales */
.sidebar select,
input, select, textarea{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sidebar select:focus,
input:focus, textarea:focus, select:focus{
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,111,184,.12);
}

/* botón principal sobrio */
button{
  border-radius: 10px;
  font-weight: 600;
  letter-spacing:.2px;
  background: var(--brand);
}
button:hover{ background: var(--brand-700); }
.comprarbutton{ background: var(--success); }
.comprarbutton:hover{ filter: brightness(.95); }

/* barra del total arriba a la derecha */
#totalContainer{
  margin: 0 0 1rem 0;
  text-align: right;
  font-size: 1.1rem;
  color:#0f172a;
}
#totalContainer strong{ font-weight:700; }

/* zona principal */
.main-content{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
}

/* cards de producto sobrias */
.cards-grid{
  display:grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  justify-items: stretch;
}

.card-producto{
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  transition: border-color .15s ease, transform .08s ease;
  padding: 18px;
}
.card-producto:hover{
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.card-producto img{
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
}
.card-producto h4,
.card-producto .titulo{
  margin-top:.35rem;
  font-weight: 700;
  font-size: 1rem;
  color:#111827;
}
.card-producto .subtitulo,
.card-producto .marca{
  color: var(--muted);
  font-size:.9rem;
  margin-top:.15rem;
}
.card-producto .precio,
.card-producto strong{
  display:block;
  margin-top:.35rem;
  font-weight: 700;
  color:#0f172a;
}
.card-producto input[type="number"]{
  width:100%;
  margin-top:.6rem;
}

/* botones “volver / cerrar” tipo enlace discretos */
.volverbutton{
  all: unset;
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}
.volverbutton:hover{
  background: rgba(11,111,184,.08);
}

/* header más fino */
.main-header{
  background: #0b6fb8;
  padding: .4rem 1rem;
}
.logo-img{ height: 52px; }

/* responsive */
@media (max-width: 1024px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
  #totalContainer{ text-align:left; }
}
/* ================================
   Filtros más serios / enterprise
   ================================ */
.sidebar{
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1rem 1.25rem;
}

.sidebar .filtros-linea-horizontal{
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.sidebar .grupo{
  display:flex;
  flex-direction: column;
  gap: .35rem;
}

/* etiquetas sobrias (si tus labels están como texto, igual no rompe) */
.sidebar .grupo label{
  font-size: .85rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: .2px;
}

/* selects compactos, rectos y con foco sutil */
.sidebar select{
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .95rem;
  background: #fff;
}
.sidebar select:focus{
  border-color:#0b6fb8;
  box-shadow: 0 0 0 3px rgba(11,111,184,.12);
  outline: none;
}

/* separadores finos entre grupos (serio y ordenado) */
.sidebar .grupo + .grupo{
  position: relative;
  padding-top: .6rem;
}
.sidebar .grupo + .grupo::before{
  content:"";
  position:absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: #f1f5f9;
}

/* botón de filtros discreto */
.sidebar .filtros-linea-horizontal button{
  background:#0b6fb8;
  border-radius:8px;
  font-weight:600;
}
.sidebar .filtros-linea-horizontal button:hover{
  background:#095e9b;
}

/* ================================
   Tarjetas de producto más serias
   ================================ */
.cards-grid{
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 1.25rem;
}

.card-producto{
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 16px 14px;
  box-shadow: none;
  transition: border-color .15s ease, transform .06s ease;
}
.card-producto:hover{
  border-color:#cbd5e1;
  transform: translateY(-1px);
}

/* imagen “enmarcada” */
.card-producto img{
  max-height: 132px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  padding: 10px;
}

/* tipografía y jerarquía sobria debajo de la imagen */
.card-producto .titulo,
.card-producto h4{
  margin-top: .6rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.card-producto .subtitulo,
.card-producto .marca,
.card-producto p{
  margin-top: .15rem;
  color: #6b7280;
  font-size: .92rem;
}

/* línea divisoria fina antes del precio */
.card-producto .precio,
.card-producto strong{
  display:block;
  margin-top: .65rem;
  padding-top: .55rem;
  border-top: 1px dashed #e5e7eb;
  font-weight: 700;
  color: #111827;
}

/* input de cantidad: alineado y sobrio */
.card-producto input[type="number"]{
  margin-top: .5rem !important;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .95rem;
}
.card-producto input[type="number"]:focus{
  border-color:#0b6fb8;
  box-shadow: 0 0 0 3px rgba(11,111,184,.12);
  outline: none;
}

/* ficha compacta: menos aire al final */
.card-producto:last-child{ margin-bottom: 0; }

/* barra del total más integrada arriba a la derecha */
#totalContainer{
  text-align: right;
  font-size: 1rem;
  color: #0f172a;
  margin: .25rem 0 1rem;
}
#totalContainer strong{ font-weight:700; }

/* ===== 3 columnas: filtros | productos | cesta ===== */
.layout{
  display: grid;
  grid-template-columns: 320px minmax(0,1fr) 340px; /* ← tercera columna */
  gap: 2rem;
  align-items: start;
}

/* Cesta (sidebar derecha) */
.cart-sidebar{
  position: fixed;
  top: 80px;
  right: 24px;           /* separación del borde */
  width: 340px;          /* ancho real de la cesta */
  max-height: calc(100vh - 100px);
  z-index: 50;
}

.cart-header{
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom:.5rem;
}
.cart-header h3{ margin:0; font-size:1.1rem; font-weight:700; color:#0f172a; }
.cart-header small{ color:#6b7280; }

.cart-items{
  overflow:auto;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding:.5rem;
  background:#f9fbfd;
  flex:1;
}

.cart-item{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:.25rem .5rem;
  align-items:center;
  padding:.5rem .35rem;
  border-bottom:1px dashed #e5e7eb;
}
.cart-item:last-child{ border-bottom:none; }

.cart-item .name{ font-weight:600; color:#111827; }
.cart-item .meta{ color:#6b7280; font-size:.9rem; }
.cart-item .qty{
  display:flex; align-items:center; gap:.35rem;
}
.cart-item button.btn-qty{
  width:28px; height:28px; border-radius:8px; border:1px solid #d1d5db;
  background:#fff; cursor:pointer; font-weight:700;
}
.cart-item .subtotal{ font-weight:700; color:#0f172a; }

.cart-footer{
  margin-top: .75rem;
  border-top: 1px solid #e5e7eb;
  padding-top: .75rem;
}
.cart-row{ display:flex; justify-content:space-between; margin-bottom:.5rem; }
.cart-checkout{
  width:100%;
  background:#0b6fb8; color:#fff; border:none;
  padding:.75rem 1rem; border-radius:10px; font-weight:700; cursor:pointer;
}
.cart-checkout:hover{ background:#095e9b; }

/* Cards: quita inputs en la nueva versión (dejamos por si queda alguno) */
.card-producto input[type="number"]{ display:none !important; }

/* Responsive: apilar en móvil */
@media (max-width: 1100px){
  .layout{ grid-template-columns: 1fr; }
  .cart-sidebar{ position: static; max-height:none; }
}
/* Layout de 2 columnas ahora: solo filtros y productos */
.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* Cesta fuera del flujo, fija a la derecha */
.cart-sidebar {
  position: fixed;
  top: 80px; /* deja espacio para el header */
  right: 20px;
  width: 320px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 50;
}

.cart-items {
  overflow-y: auto;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: .5rem;
  background: #f9fbfd;
  flex: 1;
}

/* Ajustar cuando pantalla es chica */
@media (max-width: 1100px) {
  .cart-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 1rem;
  }
}
/* ==== Reservar espacio para la cesta fija solo en este template ==== */
/* === Cesta fija: ancho + separación coherentes === */
.cart-sidebar{
  position: fixed;
  top: 80px;
  right: 24px;           /* separación del borde */
  width: 340px;          /* ancho real de la cesta */
  max-height: calc(100vh - 100px);
  z-index: 50;
}

/* === Contenedor del template con “offset” reservado para la cesta === */
.container.pedido.with-cart{
  /* empújalo a la izquierda y, además, REDUCE su ancho si hace falta */
  margin-right: calc(340px + 48px) !important;              /* ancho cesta + gap visual */
  max-width: min(1200px, calc(100vw - 340px - 72px));
  /*             max tuyo     viewport - cesta  - margen total */
}

/* layout de filtros + productos sigue en 2 columnas */
.layout{
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* === Breakpoints: cuando no entra, la cesta baja y el offset se anula === */
@media (max-width: 1400px){
  .container.pedido.with-cart{
    margin-right: auto;                 /* vuelve a centrado normal */
    max-width: 1200px;                  /* tu valor original */
  }
  .cart-sidebar{
    position: static;                   /* deja de ser fija */
    width: 100%;
    right: auto;
    max-height: none;
    margin: 1rem auto 0;
  }
}

/* =========================
   Botones sobrios / outline
   ========================= */

/* Añadir a la cesta (en cada card) */
.btn-add{
  display:block;
  width:100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;        /* gris suave */
  border-radius: 10px;
  background: #ffffff;               /* ghost */
  color: var(--brand);               /* usa tu color de marca, pero solo en texto */
  font-weight: 600;
  letter-spacing: .1px;
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn-add:hover{
  background: #f8fafc;               /* leve */
  border-color: #94a3b8;
}
.btn-add:active{
  background: #f1f5f9;
  box-shadow: none;
}
.btn-add:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(11,111,184,.12);
}
.btn-add:disabled{
  color: #94a3b8; border-color:#e2e8f0; background:#fff; cursor:not-allowed; opacity:.8;
}

/* Enviar pedido (en la cesta) */
.cart-checkout{
  width:100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;               /* también ghost */
  color: var(--brand);
  font-weight: 700;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.cart-checkout:hover{
  background:#f8fafc;
  border-color:#94a3b8;
}
.cart-checkout:active{ background:#f1f5f9; box-shadow:none; }
.cart-checkout:focus{ outline:none; box-shadow:0 0 0 3px rgba(11,111,184,.12); }
.cart-checkout:disabled{
  color:#94a3b8; border-color:#e2e8f0; background:#fff; cursor:not-allowed; opacity:.8;
}

/* (opcional) botones +/- del carrito, unificados */
.cart-item button.btn-qty{
  border:1px solid #d1d5db; background:#fff;
}
.cart-item button.btn-qty:hover{ background:#f8fafc; border-color:#94a3b8; }
/* ===== Compacto y prolijo para ESTE template ===== */

/* Filtros (sidebar) */
.container.pedido .sidebar{
  padding: .75rem .75rem 1rem;
  border-radius: 10px;
}
.container.pedido .sidebar .filtros-linea-horizontal{ gap: .6rem; }
.container.pedido .sidebar .grupo{ gap: .25rem; }
.container.pedido .sidebar .grupo + .grupo{ padding-top: .35rem; }
.container.pedido .sidebar .grupo + .grupo::before{ opacity: .4; }

.container.pedido .sidebar label{
  font-size: .82rem;
  font-weight: 600;          /* menos negrita */
  letter-spacing: 0;
  color: #1f2937;
}
.container.pedido .sidebar select{
  font-size: .9rem;
  padding: 6px 10px;
  border-radius: 8px;
}

/* Total arriba */
.container.pedido #totalContainer{
  font-size: .95rem;
  margin: .25rem 0 .75rem;
}

/* Cards: grilla más cerrada */
.container.pedido .cards-grid{
  gap: 1rem !important;
}

/* Card compacta */
.container.pedido .card-producto{
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

/* Imagen más baja y con menos aire */
.container.pedido .card-producto img{
  max-height: 110px;
  padding: 8px;
  margin-bottom: .25rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
}

/* Tipografías más chicas y menos bold */
.container.pedido .card-producto .titulo,
.container.pedido .card-producto h4{
  margin-top: .4rem;
  font-size: .98rem;        /* antes ~1rem+ */
  font-weight: 600;         /* menos que 700 */
  line-height: 1.25;
  color: #0f172a;
}
.container.pedido .card-producto .subtitulo,
.container.pedido .card-producto .marca,
.container.pedido .card-producto p{
  font-size: .86rem;
  line-height: 1.35;
  color: #6b7280;
}

/* Precio: línea fina y tipografía más chica */
.container.pedido .card-producto .precio,
.container.pedido .card-producto strong{
  display:block;
  margin-top: .45rem;
  padding-top: .45rem;
  border-top: 1px dashed #e5e7eb;
  font-size: .92rem;
  font-weight: 600;         /* baja el bold */
  color: #111827;
}

/* Botón añadir: sobrio y compacto */
.container.pedido .btn-add{
  padding: 8px 12px;
  font-size: .95rem;
  border-radius: 8px;
  font-weight: 600;
}

/* Botón checkout sobrio y compacto */
/* pone en negro el precio cuando NO hay descuento */
.card-producto p.meta{
  color:#111827 !important;
  font-weight:600;
}

/* pone en negro el precio con descuento (pisa el inline green) */
.card-producto p.meta strong{
  color:#111827 !important;
}

/* opcional: el tachado que quede gris suave */
.card-producto p.meta span[style*="line-through"]{
  color:#94a3b8 !important;
}
/* Botones +/-/× del carrito: visibles y compactos */
.cart-item .btn-qty{
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  background: #fff !important;
  color: #0f172a !important;     /* ← que no sea blanco */
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.cart-item .btn-qty:hover{ background:#f8fafc; border-color:#94a3b8; }
.cart-item .btn-del{ color:#b91c1c !important; border-color:#f1b4b4 !important; }
.cart-item .btn-del:hover{ background:#fef2f2; border-color:#ef4444; }
/* === Cesta: tipografía más pequeña que las cards === */
.cart-sidebar{ 
  font-size: .88rem;         /* base de la cesta (cards están ~0.98rem) */
}

.cart-sidebar .cart-header h3{ 
  font-size: .95rem; 
  font-weight: 700;
}
.cart-sidebar .cart-header small{ 
  font-size: .78rem; 
  color:#6b7280;
}

.cart-sidebar .cart-items{ font-size: .86rem; }

.cart-sidebar .cart-item .name{ 
  font-size: .9rem; 
  font-weight: 600;
}
.cart-sidebar .cart-item .meta{ 
  font-size: .8rem; 
  color:#6b7280;
}
.cart-sidebar .cart-item .subtotal{ 
  font-size: .9rem; 
  font-weight: 700;
}

.cart-sidebar .qty span{ font-size: .85rem; }
.cart-sidebar .btn-qty{ font-size: .9rem; }

.cart-sidebar .cart-footer{ font-size: .9rem; }
.cart-sidebar .cart-checkout{ 
  font-size: .92rem; 
  padding: 8px 12px; 
}
/* Título con icono */
.cart-header{ display:flex; align-items:center; justify-content:space-between; }
.cart-title{ display:flex; align-items:center; gap:.5rem; color:#111827; }

.cart-icon{
  width: 18px; 
  height: 18px;
  stroke: currentColor;   /* usa el color del texto */
  fill: none;
  stroke-width: 1.8;
  opacity: .95;
}

/* si querés el icono en color marca: */
/* .cart-title{ color: var(--brand); } */

/* ===== Botonera móvil ===== */
.mobile-toolbar{
  display:none;
  gap:.5rem;
  margin:.5rem 0 1rem;
}
.toolbar-btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:8px 12px; border:1px solid #d1d5db; border-radius:10px;
  background:#fff; color:#0b6fb8; font-weight:600; width:auto; max-width:none;
}
.toolbar-btn .i{ width:18px; height:18px; }
.badge{ display:inline-block; min-width:18px; padding:1px 6px; border-radius:999px; background:#0b6fb8; color:#fff; font-size:.75rem; }

/* ===== Bottom sheet (cesta) para móvil ===== */
.sheet-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
  opacity:0; pointer-events:none; transition:opacity .2s; z-index:59;
}
.sheet-backdrop.show{ opacity:1; pointer-events:auto; }

/* desktop: como estaba */
@media (min-width: 901px){
  .cart-sidebar{ position:fixed; top:80px; right:24px; width:340px; max-height:calc(100vh - 100px); }
}

/* móvil/tablet: apilar y mostrar paneles */
@media (max-width: 900px){

  /* contenedor vuelve a ancho completo */
  .container.pedido.with-cart{ margin-right:auto; max-width: 100%; }

  .mobile-toolbar{ display:flex; }

  /* layout: solo una columna */
  .layout{ display:block; }

  /* filtros como off-canvas a la izquierda */
  .sidebar{
    position:fixed; top:64px; left:0; bottom:0; width:88vw; max-width:360px;
    background:#fff; border-right:1px solid #e5e7eb; border-radius:0;
    transform:translateX(-100%); transition:transform .25s ease; z-index:60;
    padding:1rem .85rem; overflow:auto;
  }
  .sidebar.open{ transform:translateX(0); }

  /* cesta como bottom sheet */
  .cart-sidebar{
    position:fixed; left:0; right:0; bottom:-100%;
    width:100%; max-height:70vh; overflow:auto;
    border-top-left-radius:16px; border-top-right-radius:16px;
    border:1px solid #e5e7eb; background:#fff; padding:1rem;
    box-shadow:0 -10px 30px rgba(0,0,0,.15); z-index:60;
    transition:transform .25s ease, bottom .25s ease;
  }
  .cart-sidebar.open{ bottom:0; }

  .cart-sidebar .sheet-close{
    position:absolute; top:10px; right:12px;
    width:32px; height:32px; border:1px solid #d1d5db; border-radius:8px;
    background:#fff; color:#111827;
  }

  /* grilla de productos: 2 col → 1 col */
  .cards-grid{ display:grid !important; grid-template-columns:repeat(2, minmax(0, 1fr)) !important; gap:.9rem !important; }
  @media (max-width: 480px){
    .cards-grid{ grid-template-columns:1fr !important; }
  }

  /* tipografías un pelín más chicas en móvil */
  .card-producto .titulo{ font-size:.95rem; }
  .card-producto .subtitulo{ font-size:.82rem; }
  .card-producto .precio, .card-producto strong{ font-size:.9rem; }
}

/* opcional: cuando panel abierto, evitar scroll del body */
body.noscroll{ overflow:hidden; }
/* ===== Backdrop ===== */
.sheet-backdrop{
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 59;
}
.sheet-backdrop.show{ opacity: 1; pointer-events: auto; }

/* ===== FAB carrito (solo móvil) ===== */
.cart-fab{
  position: fixed; right: 16px; bottom: 16px;
  display: none; align-items: center; gap: .5rem;
  padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 999px;
  background: #fff; color: #0b6fb8; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  z-index: 60;
}
.cart-fab .i{ width: 18px; height: 18px; }
.cart-fab .badge{ min-width: 18px; padding: 1px 6px; border-radius: 999px; background:#0b6fb8; color:#fff; font-size:.75rem; }

/* ===== Desktop intacto ===== */
@media (min-width: 901px){
  .cart-fab{ display:none; }
  /* tu cesta fija de siempre se mantiene con tus reglas actuales */
}

/* ===== Móvil/Tablet: bottom sheet ===== */
@media (max-width: 900px){
  /* no reserves espacio para la cesta en móvil */
  .container.pedido.with-cart{ margin-right: auto; max-width: 100%; }

  .cart-fab{ display: inline-flex; }

  .cart-sidebar{
    position: fixed; left: 0; right: 0; bottom: 0;
    transform: translateY(100%);               /* OCULTA por defecto */
    transition: transform .25s ease;
    width: 100%; max-height: 70vh; overflow: auto;
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    border: 1px solid #e5e7eb; background:#fff; padding: 1rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,.15);
    z-index: 60;
  }
  .cart-sidebar.open{ transform: translateY(0); } /* VISIBLE */

}

/* Botón cerrar de la cesta: reset + oculto en escritorio */
.cart-sidebar .sheet-close{
  all: unset;                    /* quita estilos globales de button */
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: none;                 /* oculto por defecto (desktop) */
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  z-index: 1;
}
.cart-sidebar .sheet-close:hover{ background:#f8fafc; border-color:#94a3b8; }

/* Solo en móvil lo mostramos (bottom sheet) */
@media (max-width: 900px){
  .cart-sidebar .sheet-close{ display: flex; }
}
/* Flecha indicadora del sheet (solo móvil) */
.sheet-arrow{
  position: absolute;
  top: 18px;                 /* debajo del “tirador” */
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  color: #6b7280;
  opacity: .9;
  display: none;             /* oculta en desktop */
  pointer-events: none;      /* no intercepta el tap */
}

/* animación suave de “nudge” */
@keyframes nudgeUp {
  0%,100% { transform: translate(-50%, 0); }
  50%     { transform: translate(-50%, -6px); }
}
.sheet-arrow.nudge{ animation: nudgeUp 1.6s ease-in-out infinite; }

/* Solo en móvil se muestra; al abrir el sheet, gira */
@media (max-width: 900px){
  .sheet-arrow{ display: block; }
  .cart-sidebar.open .sheet-arrow{
    transform: translateX(-50%) rotate(180deg);  /* ahora apunta hacia abajo */
    animation: none;                              /* deja de “hacer señas” */
    opacity: .6;
  }
}
/* Variable para la altura del sheet colapsado */
:root { --sheet-collapsed: 1rem; }

/* Reset y estilo propio del FAB de filtros (evita el botón azul global) */
.filters-fab{
  all: unset;                                     /* <- quita estilos globales del button */
  position: fixed;
  display: none;                                  /* se muestra solo en móvil */
  align-items: center;
  gap: .5rem;
  background: #fff;
  color: #0b6fb8;
  font-weight: 700;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  z-index: 80;                                    /* por encima de la cesta y backdrop */
  box-sizing: border-box;
}
.filters-fab .i{ width:18px; height:18px; flex-shrink:0; }

/* Desktop: oculto */
@media (min-width: 901px){
  .filters-fab{ display: none !important; }
}

/* Móvil: centrado y más arriba */
@media (max-width: 900px){
  .filters-fab{
    display: inline-flex;
    left: 50%;
    transform: translateX(-50%);
    /* Súbelo: por encima del sheet colapsado + margen + safe area */
    bottom: calc(var(--sheet-collapsed) + 24px + env(safe-area-inset-bottom));
    /* Evita desbordes laterales en pantallas estrechas */
    max-width: calc(100vw - 32px);
    white-space: nowrap;
  }

  /* Asegura que el sheet colapsado use la misma altura declarada */
  .cart-sidebar{
    transform: translateY(calc(100% - var(--sheet-collapsed)));
  }
}
@media (max-width: 900px){
  .cart-sidebar{
    position: fixed; left: 0; right: 0; bottom: 0;
    width: 100%; max-height: 70vh; overflow: auto;
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    border: 1px solid #e5e7eb; background:#fff; padding: 1rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,.15);
    z-index: 60;
    /* ← estado COLAPSADO: solo se ve una franja */
    transform: translateY(calc(100% - var(--sheet-collapsed)));
    transition: transform .25s ease;
  }
  .cart-sidebar.open{
    transform: translateY(0);  /* estado ABIERTO */
  }
}
@media (max-width: 900px){
  .filters-fab{
    /* centrado ya lo tienes; solo cambiamos la altura */
    bottom: calc(6rem + env(safe-area-inset-bottom)); /* súbelo o bájalo a gusto */
  }
}
.container.pedido h1{
  font-size: 1.8rem;   /* antes 2rem */
  line-height: 1.2;
  font-weight: 600;     /* menos “bold” */
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom-width: 1px; /* más sutil; quítalo si no lo querés */
}

/* Más chico aún en móvil */
@media (max-width: 900px){
  .container.pedido h1{ font-size: 1.5rem; }
}

/* helper para ocultar el FAB de filtros */
.filters-fab.hidden{ display: none !important; }
/* ocultar con clase genérica */
.hidden{ display: none !important; }

/* Tema magenta para el botón Filtros */
.filters-fab{
  color: #1b3d9c;                  /* magenta en texto */
  border-color: #241583;           /* borde suave */
}
.filters-fab .i{ color: currentColor; }
.filters-fab:hover{ background:#fff0f6; border-color:#e48ab1; }
@media (max-width: 900px){
  .header-content{
    display: grid;
    grid-template-columns: 48px 1fr 48px; /* izq / centro / der */
    align-items: center;
    min-height: 64px;
    position: relative;
  }
  .hamburger{ grid-column: 1; justify-self: start; }
  .logo-img{ grid-column: 2; justify-self: center; height: 48px; margin: 0 !important; }
  /* nav puede seguir absoluto como lo tenés; si quisieras un icono a la derecha, iría en col 3 */
}
/* ===== Título más sobrio ===== */
.container h1{
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: .75rem;
}
@media (max-width: 900px){
  .container h1{ font-size: 1.35rem; }
}

/* ===== Panel de filtros ===== */
.filtros-superiores1{
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: .8rem;
  padding: .8rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,.05);
  margin: .75rem 0 1rem;
}
.filtros-superiores1 input,
.filtros-superiores1 select{
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: .95rem;
}
@media (max-width: 1100px){
  .filtros-superiores1{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .filtros-superiores1{ grid-template-columns: 1fr; }
}

/* ===== Tabla: contenedor con scroll si hace falta ===== */
.table-wrapper{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,.05);
  background: #fff;
}


/* ===== Barra de filtros sobria arriba ===== */
.filters-bar{
  display:grid;
  grid-template-columns: repeat(4, minmax(180px,1fr));
  gap:.85rem;
  width:100%;
  max-width:1100px;
  margin: .5rem auto 0.5rem;
  padding: .7rem;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 3px 12px rgba(0,0,0,.05);
}
.filters-bar .field{ display:flex; flex-direction:column; gap:.35rem; }
.filters-bar label{ font-size:.75rem; font-weight:600; color:#111827; }
.filters-bar input, .filters-bar select{
  padding:5px 5px; border:1px solid #d1d5db; border-radius:10px; font-size:.75rem;
}
.filters-bar input:focus, .filters-bar select:focus{
  outline: none; border-color:#0b6fb8; box-shadow:0 0 0 3px rgba(11,111,184,.12);
}
@media (max-width: 1100px){ .filters-bar{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 640px){ .filters-bar{ grid-template-columns: 1fr; } }

/* ===== Contenedor de tabla con scroll si desborda ===== */
.table-wrapper{
  width:100%;
  max-width:1100px;
  margin: 0 auto 1rem;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:auto;
  box-shadow:0 3px 12px rgba(0,0,0,.05);
}

/* ===== Tabla limpia/pro ===== */
.clean-table{
  width:100%;
  border-collapse: separate;
  border-spacing:0;
}
.clean-table thead th{
  position: sticky; top:0; z-index:1;
  background:#0b6fb8;
  color:#fff;
  text-align:center;
  padding:12px 14px;
  font-weight:700;
}
.clean-table th:first-child{ text-align:center; }
.clean-table td{
  padding:12px 14px;
  border-top:1px solid #eef2f7;
  text-align:center;
  font-size:15px;
  color:#0f172a;
  background:#fff;
}
.clean-table tbody tr:nth-child(odd) td{ background:#fafbfc; }
.clean-table tbody tr:hover td{ background:#f2f7fb; }
.clean-table .th-producto{ min-width:260px; }
.clean-table td:nth-child(5){
  text-align:left;
  max-width:420px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Botón de expandir en la primera col (si usás +) */
.toggle-btn{
  padding:6px 10px; border-radius:8px; background:#0b6fb8; color:#fff; border:0; cursor:pointer;
}
.toggle-btn:hover{ filter:brightness(.95); }

/* Footer actions como enlaces discretos */
.footer-actions{
  display:flex; gap:.75rem; justify-content:center; margin-top:.25rem;
}
.footer-actions .volverbutton{
  all:unset; cursor:pointer; color:#0b6fb8; font-weight:600; padding:6px 8px; border-radius:6px;
}
.footer-actions .volverbutton:hover{ background:rgba(11,111,184,.08); }

/* Móvil: mostramos cards y ocultamos tabla (ya tenías parte de esto) */
@media (max-width: 768px){
  .table-wrapper{ display:none; }
  #cardsPedidos.cards-container{
    display:flex !important; flex-direction:column; gap:1rem; width:100%;
  }
}

/* ====== Tabla sobria/pro ====== */
.table-wrapper{
  background:#fff;
  border:1px solid #e6e8ef;
  border-radius:12px;
  overflow:auto;
  box-shadow: 0 6px 18px rgba(16,24,40,.04);
}

.clean-table{
  width:100%;
  border-collapse: separate;
  border-spacing:0;
  font-size:14.5px;
  color:#0f172a;
}

/* Encabezado: neutral y sólido */
.clean-table thead th{
  position: sticky; top:0; z-index:1;
  background:#0f172a;           /* slate muy oscuro */
  color:#ffffff;
  text-align:center;
  padding:12px 14px;
  font-weight:700;
  letter-spacing:.2px;
  border-bottom:1px solid #0b1220;
}
.clean-table thead th:first-child{ width:56px; }

/* Celdas */
.clean-table td{
  padding:10px 14px;
  border-top:1px solid #eceff3;
  background:#fff;
  vertical-align:middle;
}

/* Rayado sutil + hover elegante */
.clean-table tbody tr:nth-child(odd) td{ background:#fafbfc; }
.clean-table tbody tr:hover td{ background:#f6f8fc; }

/* Bordes redondeados reales arriba */
.clean-table thead th:first-child{ border-top-left-radius:12px; }
.clean-table thead th:last-child { border-top-right-radius:12px; }

/* Alineaciones */
.clean-table td:nth-child(5){           /* Producto */
  text-align:left;
  max-width:520px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.clean-table td:nth-child(6),           /* Cantidad */
.clean-table td:nth-child(7){           /* Total */
  text-align:right;
}
.clean-table td:nth-child(8){ text-align:center; } /* Proforma */
.clean-table td:last-child{ text-align:center; }   /* Acciones */

/* Links (Proforma) */
.clean-table a{
  color:#0b6fb8;
  text-decoration: none;
  font-weight:600;
}
.clean-table a:hover{ text-decoration: underline; }

/* Botón expandir (col 1) */
.toggle-btn{
  background:#0f172a;
  color:#fff;
  border:0;
  padding:6px 10px;
  border-radius:8px;
}
.toggle-btn:hover{ filter:brightness(.95); }

/* Acciones: estilo outline sobrio */
.acciones{
  display:flex; gap:.5rem; justify-content:center; flex-wrap:wrap;
}
.acciones .boton-azul,
.acciones .boton-rojo{
  all: unset;
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 84px;
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  border:1px solid;
}
.acciones .boton-azul{
  color:#0b6fb8; border-color:#cfe3f5; background:#ffffff;
}
.acciones .boton-azul:hover{ background:#f3f8fe; border-color:#b8d4ef; }

.acciones .boton-rojo{
  color:#b91c1c; border-color:#f2c6c6; background:#ffffff;
}
.acciones .boton-rojo:hover{ background:#fff5f5; border-color:#eca9a9; }

/* Modo compacto en pantallas angostas (mantiene sobriedad) */
@media (max-width: 1100px){
  .clean-table{ font-size:14px; }
  .clean-table td{ padding:9px 12px; }
}
/* ===== Tabla compacta/pro ===== */
.clean-table.compact{
  font-size: 14px;
  line-height: 1.2;
}

/* encabezado más bajo */
.clean-table.compact thead th{
  padding: 8px 10px;
  font-size: 14px;
}

/* celdas más bajas y densas */
.clean-table.compact td{
  padding: 6px 10px;          /* ↓ antes 10–12 */
  vertical-align: middle;
  border-top: 1px solid #eceff3;
}

/* producto: máximo 2 líneas para que no estire la fila */
.clean-table.compact td:nth-child(5){
  text-align: left;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* ← 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* números a la derecha */
.clean-table.compact td:nth-child(6),
.clean-table.compact td:nth-child(7){
  text-align: right;
}

/* link proforma más chico */
.clean-table.compact a{
  font-size: 13px;
  font-weight: 600;
}

/* botón expandir compacto */
.clean-table.compact .toggle-btn{
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* acciones: píldoras más discretas */
.clean-table.compact .acciones{
  gap: .35rem;
}
.clean-table.compact .acciones .boton-azul,
.clean-table.compact .acciones .boton-rojo{
  min-width: auto;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 999px;
}

/* zebra/hover sutiles (no suman altura) */
.clean-table.compact tbody tr:nth-child(odd) td{ background:#fafbfc; }
.clean-table.compact tbody tr:hover td{ background:#f6f8fc; }

/* Ajuste columna Producto para que se vea como las demás */
.clean-table.compact td:nth-child(5){
  text-align: left;
  white-space: nowrap;      /* todo en una línea */
  overflow: hidden;
  text-overflow: ellipsis;  /* "..." si se corta */
  display: table-cell;      /* vuelve al flujo normal */
}


/* un toque más compacto en pantallas chicas */
@media (max-width: 1100px){
  .clean-table.compact{ font-size: 13.5px; }
  .clean-table.compact td{ padding: 6px 8px; }
  .clean-table.compact thead th{ padding: 8px; }
}


/* ===== Filtros arriba (mismo estilo) ===== */
.filters-bar{
  display:grid;
  grid-template-columns: repeat(4, minmax(180px,1fr));
  gap:.85rem; width:100%; max-width:1100px;
  margin:.5rem auto 1rem; padding:.9rem;
  background:#fff; border:1px solid #e5e7eb; border-radius:12px;
  box-shadow:0 3px 12px rgba(0,0,0,.05);
}
.filters-bar .field{ display:flex; flex-direction:column; gap:.35rem; }
.filters-bar label{ font-size:.85rem; font-weight:600; color:#111827; }
.filters-bar input, .filters-bar select{
  padding:10px 12px; border:1px solid #d1d5db; border-radius:10px; font-size:.95rem;
}
.filters-bar input:focus, .filters-bar select:focus{
  outline:none; border-color:#0b6fb8; box-shadow:0 0 0 3px rgba(11,111,184,.12);
}
@media (max-width:1100px){ .filters-bar{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .filters-bar{ grid-template-columns:1fr; } }

/* ===== Tabla sobria + compacta ===== */
.table-wrapper{
  width:100%; max-width:1100px; margin:0 auto 1rem;
  background:#fff; border:1px solid #e6e8ef; border-radius:12px;
  overflow:auto; box-shadow:0 6px 18px rgba(16,24,40,.04);
}
.clean-table{ width:100%; border-collapse:separate; border-spacing:0; color:#0f172a; }
.clean-table thead th{
  position:sticky; top:0; z-index:1;
  background:#0f172a; color:#fff; text-align:center;
  padding:12px 14px; font-weight:700; letter-spacing:.2px;
  border-bottom:1px solid #0b1220;
}
.clean-table thead th:first-child{ border-top-left-radius:12px; width:56px; }
.clean-table thead th:last-child{ border-top-right-radius:12px; }

.clean-table td{
  padding:10px 14px; border-top:1px solid #eceff3; background:#fff; vertical-align:middle;
}
.clean-table tbody tr:nth-child(odd) td{ background:#fafbfc; }
.clean-table tbody tr:hover td{ background:#f6f8fc; }

/* alineaciones */
.clean-table td:nth-child(5){ text-align:left; }
.clean-table td:nth-child(6),
.clean-table td:nth-child(7){ text-align:right; }

/* compacto */
.clean-table.compact{ font-size:14px; line-height:1.2; }
.clean-table.compact thead th{ padding:8px 10px; font-size:14px; }
.clean-table.compact td{ padding:6px 10px; }
.clean-table.compact td:nth-child(5){
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:table-cell;
}

/* toggle + */
.clean-table .toggle-btn{
  width:28px; height:28px; padding:0; border-radius:8px;
  background:#0f172a; color:#fff; border:0; display:inline-flex; align-items:center; justify-content:center;
}

/* enlaces (Proforma si lo usás en esta vista) */
.clean-table a{ color:#0b6fb8; font-weight:600; text-decoration:none; }
.clean-table a:hover{ text-decoration:underline; }

/* ===== Botones por columna (Autorizar/Editar/Anular) – outline sobrio ===== */
/* Si tus JS usan .boton-verde/.boton-azul/.boton-rojo, los redefino: */
.boton-verde, .boton-azul, .boton-rojo{
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  padding:6px 12px; border-radius:999px; font-weight:700; cursor:pointer;
  border:1px solid; background:#fff;
}
.boton-verde{ color:#166534; border-color:#cde6d4; }
.boton-verde:hover{ background:#f1faf3; border-color:#b8dec2; }

.boton-azul{ color:#0b6fb8; border-color:#cfe3f5; }
.boton-azul:hover{ background:#f3f8fe; border-color:#b8d4ef; }

.boton-rojo{ color:#b91c1c; border-color:#f2c6c6; }
.boton-rojo:hover{ background:#fff5f5; border-color:#eca9a9; }

/* Fallback si vienen sin clase: aplica por columna */
.clean-table td:nth-child(8) button{ /* Autorizar */
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  padding:6px 12px; border-radius:999px; font-weight:700; cursor:pointer;
  color:#166534; border:1px solid #cde6d4; background:#fff;
}
.clean-table td{
  text-align: center !important;
}
.clean-table td:nth-child(8) button:hover{ background:#f1faf3; border-color:#b8dec2; }

.clean-table td:nth-child(9) button{ /* Editar */
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  padding:6px 12px; border-radius:999px; font-weight:700; cursor:pointer;
  color:#0b6fb8; border:1px solid #cfe3f5; background:#fff;
}
.clean-table td:nth-child(9) button:hover{ background:#f3f8fe; border-color:#b8d4ef; }

.clean-table td:nth-child(10) button{ /* Anular */
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  padding:6px 12px; border-radius:999px; font-weight:700; cursor:pointer;
  color:#b91c1c; border:1px solid #f2c6c6; background:#fff;
}
.clean-table td:nth-child(10) button:hover{ background:#fff5f5; border-color:#eca9a9; }

/* Responsive: en móvil ocultás la tabla y usás cards si ya las tenés */
@media (max-width: 768px){
  .table-wrapper{ display:none; }
  #cardsPedidos.cards-container{
    display:flex !important; flex-direction:column; gap:1rem; width:100%;
  }
}
/* Botones de acción compactos y uniformes */
.clean-table td:nth-child(8) button,
.clean-table td:nth-child(9) button,
.clean-table td:nth-child(10) button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;           /* más chico */
  min-width: 68px;             /* ancho mínimo uniforme */
  height: 26px;                /* altura fija */
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  background: #fff !important;
  box-sizing: border-box;
}

/* Autorizar */
.clean-table td:nth-child(8) button {
  color: #176e38 !important;
  border-color: #cde6d4;
}
.clean-table td:nth-child(8) button:hover {
  background: #f1faf3;
  border-color: #b8dec2;
}

/* Editar */
.clean-table td:nth-child(9) button {
  color: #0b6fb8;
  border-color: #cfe3f5;
}
.clean-table td:nth-child(9) button:hover {
  background: #f3f8fe;
  border-color: #b8d4ef;
}

/* Anular */
.clean-table td:nth-child(10) button {
  color: #b91c1c;
  border-color: #f2c6c6;
}
.clean-table td:nth-child(10) button:hover {
  background: #fff5f5;
  border-color: #eca9a9;
}




.main-header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative; /* para poder centrar el logo absoluto */
}

/* Centramos el logo de forma absoluta */
.main-header .logo-img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0; /* anulamos márgenes que lo corren */
}

/* Alineamos el usuario a la izquierda y Cerrar sesión a la derecha */
.main-header .user-name {
  margin-left: 1rem;
}
.main-header nav {
  margin-right: 1rem;
}

/* Contenedor principal del header */
.main-header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  min-height: 55px; /* altura mínima más cómoda */
  padding: 0 1rem;
}

/* Centramos el logo */
.main-header .logo-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: 50px; /* ajusta si querés que no crezca demasiado */
}

/* Izquierda y derecha alineadas */
.main-header .user-name {
  margin-left: 1rem;
}
.main-header nav {
  margin-right: 1rem;
}

@media (max-width: 768px){
  .main-header .logo-img{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* queda centrado real */
    margin: 0;                        /* que nada lo corra */
    max-height: 42px;
    z-index: 1;
  }

  .main-header .hamburger{
    position: absolute;
    left: 10px;                       /* pegado a la izquierda */
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 40px; height: 40px;        /* mejor área táctil */
    display: grid; place-items: center;
    z-index: 2;                        /* sobre el logo si se superponen */
  }

}

.cart-item .prices { margin: .25rem 0; }
.cart-item .old-price { text-decoration: line-through; color: #888; margin-right: .25rem; display:inline-block; }
.cart-item .new-price { font-weight: 700; }
.cart-item .discount { margin:.25rem 0; }
.cart-item .discount select { padding:.25rem .5rem; }


.badge-desc {
  display:inline-block;
  margin-left:.35rem;
  padding:.1rem .4rem;
  font-size:.75rem;
  border-radius:.4rem;
  background:#F1E6D6;     /* beige suave */
  color:#7A4E10;          /* marrón oscuro */
  border:1px solid #E2D2B8;
}

.old-price {
  text-decoration: line-through;
  color:#888;
  margin-right:.25rem;
}

/* Botones bloqueados (descuento solicitado) */
.btn-locked {
  opacity: .55;
  filter: grayscale(.6);
  cursor: not-allowed !important;
  box-shadow: none;
}

/* Badge en la columna Estado */
.badge-locked {
  display: inline-block;
  margin-left: .4rem;
  padding: .15rem .45rem;
  font-size: .72rem;
  border-radius: .5rem;
  background: #F1E6D6;
  color: #7A4E10;
  border: 1px solid #E2D2B8;
}
/* hace el container más ancho en desktop */
.container-xl{
  max-width: 1300px !important;      /* probá 1400–1600px según tu pantalla */
  margin-inline: auto;
  padding-inline: 24px;   /* algo de respiro a los lados */
}

/* asegura que la tabla use todo el ancho disponible */
.table-wrapper { width: 100% !important; overflow-x: auto; }
.tabla-pedidos { width: 100%; table-layout: auto; } /* o fixed si preferís */

@media (min-width: 1700px){
  .container-xl{ max-width: 90vw; } /* opcional: respira en pantallas muy grandes */
}



/* La tabla no aporta borde exterior, sólo líneas internas */
.tabla-pedidos{
  width: 100%;
  border-collapse: collapse;   /* evita dobles líneas */
  border: 0;
}

.tabla-pedidos th,
.tabla-pedidos td{
  border: 0;                   /* resetea bordes previos */
  border-bottom: 1px solid #eef0f2;  /* líneas internas */
}

/* opcional: sin línea bajo el header y al final */
.tabla-pedidos thead th{ border-bottom: 0; }
.tabla-pedidos tbody tr:last-child td{ border-bottom: 0; }

.muted { color:#6b7280; font-size:.9rem; }


/* ===== Asignar Vendedores – versión compacta ===== */

/* Panel */
#formContainer{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:16px;
  box-shadow:0 10px 24px rgba(17,24,39,.05);
}

/* Tabla compacta y sobria */
.tabla-asignaciones{
  width:150% !important;
  border-collapse:collapse;
  table-layout:fixed;                /* respeta anchos por columna */
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  margin-left:-9rem;
}

.tabla-asignaciones thead th{
  text-align: center;
  background:#0f172a;                /* header sobrio */
  color:#fff;
  font-weight:700;
  font-size:.95rem;
  padding:10px 12px;                 /* header más bajo */
  border:0;
}

.tabla-asignaciones tbody td{
  padding:8px 12px;                  /* filas finitas */
  font-size:.95rem;
  line-height:1.25;
  border-bottom:1px solid #eef2f7;   /* línea interna suave */
  vertical-align:middle;
}

.tabla-asignaciones tbody tr:hover{ background:#fafbff; }

/* Anchos por columna (ajustá si querés) */
.tabla-asignaciones thead th:nth-child(1){ width:28%; }  /* Distribuidor */
.tabla-asignaciones thead th:nth-child(2){ width:22%; }  /* Nombre */
.tabla-asignaciones thead th:nth-child(3){ width:32%; }  /* Vendedor asignado */
.tabla-asignaciones thead th:nth-child(4){ width:18%; }  /* Vendedor externo */

/* Select más bajo y compacto */
.tabla-asignaciones select{
  appearance:none;
  border:1px solid #d1d5db;
  border-radius:8px;
  padding:6px 28px 6px 10px;         /* menos alto */
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5h9.592L8 10.481 3.204 5z'/%3E%3C/svg%3E") no-repeat right 10px center/15px;
  font:inherit;
  min-height:34px;
}
.tabla-asignaciones select:focus{
  outline:none;
  border-color:#94a3b8;
  box-shadow:0 0 0 3px rgba(59,130,246,.12);
}

/* Texto secundario (Sucursal) */
.muted{ color:#6b7280; font-size:.9rem; }

/* Botón de guardar – estilo sobrio (no saturado, no full width) */
.btn-primary{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  margin:16px auto 0;
  background:#f8fafc;                /* fondo claro */
  color:#111827;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:10px 14px;                 /* más fino */
  font-weight:600;
  letter-spacing:.2px;
  box-shadow:none;
  cursor:pointer;
}
.btn-primary:hover{ background:#f1f5f9; border-color:#cbd5e1; }
.btn-primary:active{ background:#e2e8f0; }
.btn-primary:disabled{ opacity:.6; cursor:not-allowed; }

/* Opcional: si necesitás un poco más de ancho usable en desktop grande */
@media (min-width: 1280px){
  .container{ max-width: 1200px; }
}

/* ===== Panel Vendedor – estilo sobrio ===== */

.panel {
  background:#fff; border:1px solid #e5e7eb; border-radius:16px;
  padding:20px 22px; box-shadow:0 12px 28px rgba(17,24,39,.06);
}
.panel-head h1{ margin:0; font-size:1.9rem; letter-spacing:.2px; }
.panel-head h1::after{
  content:""; display:block; width:80px; height:4px; background:#0f172a;
  border-radius:999px; margin-top:10px;
}
.panel-head .meta{ margin:8px 0 0; color:#6b7280; }

/* Título sección */
.section-title{ margin:18px 0 10px; font-size:1.3rem; font-weight:700; color:#0f172a; }

/* Tabla distribuidores (reusa tu look de listas) */
.table-wrapper{ overflow-x:auto; }
#tablaDistribuidores{
  width:100%; border-collapse:collapse; border:1px solid #e5e7eb;
  border-radius:12px; overflow:hidden;
  table-layout:fixed; 
}
#tablaDistribuidores thead th{
  text-align: center !important;
  background: #000 !important; color:#fff; font-weight:700; font-size:.95rem;
  padding:5px 6px; text-align:left; border:0;
}
#tablaDistribuidores tbody td{
  padding:5px 6px; font-size:.96rem; line-height:1.25;
  border-bottom:1px solid #eef2f7; vertical-align:middle;
}
#tablaDistribuidores tbody tr:hover{ background:#fafbff; }

/* Botones */
.btn{ display:inline-flex; align-items:center; gap:.4rem;
  padding:5px 6px; border-radius:10px; font-weight:200; border:1px solid #d1d5db;
  background:#fff; color:#111827; cursor:pointer; text-decoration:none;
}
.btn:hover{ background:#f8fafc; }
.btn-primary{ background:#0b5ed7; border-color:#0b5ed7; color:#fff; }
.btn-primary:hover{ background:#0a53c1; border-color:#0a53c1; }
.btn-outline{ background:#fff; border-color:#d1d5db; color:#111827; }

/* ==== FIX tabla 'Panel del Vendedor' ==== */


/* Reparto claro de columnas */
#tablaDistribuidores thead th:nth-child(1){ width: 25%; } /* Razón Social */
#tablaDistribuidores thead th:nth-child(2){ width: 25%; } /* Sucursal */
#tablaDistribuidores thead th:nth-child(3){ width: 25%; } /* Nombre */
#tablaDistribuidores thead th:nth-child(4){ width: 25%; text-align:center; } /* Ver pedidos */

/* Evitar cortes raros y que el botón crezca a 100% */
#tablaDistribuidores td{ white-space: normal; }
#tablaDistribuidores th{ background-color:#fff !important; }
#tablaDistribuidores .btn,
#tablaDistribuidores button{ width: auto !important; }


/* === Tabla Pedidos del Distribuidor (desktop) === */
#tablaPedidosDist{
  width:100%;
  table-layout:auto;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
}
#tablaPedidosDist thead th{
  background:#0f172a;
  color:#fff;
  font-weight:700;
  font-size:.95rem;
  padding:10px 12px;
}
#tablaPedidosDist tbody td{
  padding:10px 12px;
  border-bottom:1px solid #eef2f7;
  vertical-align:middle;
}
#tablaPedidosDist tbody tr:hover{ background:#fafbff; }

.detalle-row td{
  background:#f9fafb;
  padding:12px;
  border-top:1px solid #eef2f7;
}

/* Botón sobrio */
#tablaPedidosDist .btn{ width:auto; }
/* Fila expandible sin header (grilla prolija) */
.detalle-row td{
  background:#f9fafb;
  padding:12px;
  border-top:1px solid #eef2f7;
}

.items-grid{
  display:grid;
  grid-template-columns: 1fr 80px 120px 80px 140px; /* Producto | Cant | Unit | Desc | Sub */
  column-gap:12px;
  row-gap:8px;
  align-items:center;
}

.items-grid .it{
  padding:6px 0;
  border-bottom:1px solid #eef2f7;
}

.items-grid .name{ font-weight:500; }
.items-grid .qty,
.items-grid .unit,
.items-grid .disc,
.items-grid .sub{
  text-align:right;
}
.items-grid .sub{ font-weight:600; }


/* base */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .50rem 1rem;
  border-radius: 9999px;           /* pastilla */
  font-weight: 600;
  font-size: .95rem;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color:#111827;
  cursor:pointer;
  transition: all .15s ease;
}

/* Aprobar: texto y borde verde */
.btn-approve{
  border-color:#16a34a !important;            /* verde */
  color:#16a34a !important;
  background:#fff !important;      /* fuerza outline si antes estaba relleno */
}
.btn-approve:hover{ background:#ecfdf5; }
.btn-approve:active{ background:#dcfce7; }
.btn-approve:disabled{ opacity:.6; cursor:not-allowed; }

/* Rechazar: misma forma que Aprobar pero rojo */
.btn-reject1{
  border-color:#ef4444!important;            /* rojo */
  color:#ef4444!important;
  background:#fff !important;      /* outline */
  border-radius: 45px !important;
  font-size: 12px;
}
.btn-rejec1t:hover{ background:#fef2f2; }
.btn-reject1:active{ background:#fee2e2; }
.btn-reject1:disabled{ opacity:.6; cursor:not-allowed; }

/* ===== Overrides compactos para ganar ancho y traer todo a la izquierda ===== */

/* Más ancho útil para todo el contenido */
.container.container-xl{
  max-width: 1480px !important;  /* antes ~1200–1280 */
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Sidebar más finito y con menos gap */
.admin-wrap{
  grid-template-columns: 170px minmax(0,1fr) !important;
  gap: 16px !important;
}

/* Sidebar compacto */
.admin-sidebar{
  padding: 8px !important;
  border-radius: 12px !important;
}
.side-btn{
  font-size: .7rem !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
}
.side-btn.active{
  /* mismo look activo pero compacto */
  background:#0f172a !important;
  border-color:#0f172a !important;
  color:#fff !important;
}

/* Card de contenido más “apretada” */
.admin-content{
  padding: 14px 16px !important;
  border-radius: 14px !important;
}

/* Tablas más anchas y con celdas menos altas */
.table-wrapper{ overflow-x:auto; }
table.clean-table{
  width: 100% !important;
}
table.clean-table thead th{
  padding: 8px 10px !important;
  font-size: .80rem !important;
}
table.clean-table tbody td{
  padding: 8px 10px !important;
  font-size: .75rem !important;
}

/* Columna del toggle ( + / - ) más angosta */
.toggle-col{ width: 36px !important; }
table.clean-table thead th.toggle-col{ width: 36px !important; }

/* Botones de acción más pequeños para liberar ancho */
.btn{
  padding: 6px 10px !important;
  font-size: .85rem !important;
  border-radius: 9999px !important;
}
.btn-approve{
  border-color:#16a34a !important;
  color:#166534 !important;
  background:#fff !important;
}
.btn-approve:hover{ background:#ecfdf5 !important; }
.btn-reject1{
  border-color:#ef4444 !important;
  color:#b91c1c !important;
  background:#fff !important;
}
.btn-reject1:hover{ background:#fef2f2 !important; }


#tablaPedidos .boton-verde{
  background:#fff !important; border:1px solid #16a34a !important;
  color:#16a34a !important; border-radius:9999px; padding:.45rem .9rem;
  max-width: 108px; text-align:center;
}
#tablaPedidos .boton-verde:hover{background:#ecfdf5 !important; }

#tablaPedidos .boton-azul{
  background:#fff !important; border:1px solid #2563eb !important;
  color:#2563eb !important; border-radius:9999px; padding:.45rem .9rem;
  min-width: 96px;
}
#tablaPedidos .boton-azul:hover{background:#53a9e6 !important; }



#tablaPedidos .boton-rojo{
  background:#fff !important; border:1px solid #dc2626 !important;
  color:#dc2626 !important; border-radius:9999px; padding:.34rem .7rem;
  max-width: 75px;
}
#tablaPedidos .boton-rojo:hover{background:#fef2f2 !important; }


.table-wrapper1 {
  width: 100%;
  overflow-x: auto; /* permite desplazamiento horizontal si no entra */
}

.tabla-pedidos {
  max-width: 90%; /* elimina límite de ancho */
}

/* Ensanchar solo esta página */
.container--wide {
  max-width: 1400px;   /* antes probablemente ~980-1100 */
  margin-left: auto;
  margin-right: auto;
}

/* Si tienes pantallas grandes, dale un poco más de aire */
@media (min-width: 1600px) {
  .container--wide { max-width: 1536px; } /* ~tailwind 2xl */
}

/* La tabla usa todo el ancho disponible del contenedor */
.table-wrapper {
  width: 100%;
  overflow-x: auto;     /* safety net si alguna celda se estira demasiado */
}

/* Opcional: evitar saltos de línea molestos en cabeceras y celdas cortas */
.tabla-pedidos th,
.tabla-pedidos td {
  white-space: nowrap;
}

/* Si alguna columna es muy larga (Producto), permitimos wrap solo ahí */
.tabla-pedidos .th-producto,
.tabla-pedidos td[data-label="Producto"] {
  white-space: normal;
}

/* Un pelín menos de padding para ganar espacio vertical y horizontal */
.tabla-pedidos th, .tabla-pedidos td {
  padding: 10px 12px;
}

/* En móviles, volvemos al comportamiento normal */
@media (max-width: 768px) {
  .tabla-pedidos th, .tabla-pedidos td { white-space: normal; }
}


/* Hace más ancha solo la página de Mis Pedidos */
.container.container--wide { 
  max-width: 1600px !important;           /* subí si querés: 1720 / 1800 */
}

/* El card que envuelve a la tabla y a los filtros */
.container--wide .table-wrapper,
.container--wide .filters-bar,
.container--wide .table-wrapper + .footer-actions,
.container--wide .table-wrapper:where(.card, .panel, .paper) {
  width: 100%;
  max-width: none !important;
}

/* Evita que el card “recorte” contenido */
.container--wide .table-wrapper {
  overflow-x: auto;      /* scroll si aún no entra */
}

/* Versión compacta de la barra de filtros */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columnas iguales */
  gap: 0.75rem; /* separacion entre campos */
  align-items: end;
}

/* Reducir altura de inputs y selects */
.filters-bar input,
.filters-bar select {
  padding: 6px 8px;
  font-size: 0.9rem;
}

/* Label más pequeño */
.filters-bar label {
  font-size: 0.8rem;
  margin-bottom: 2px;
  display: block;
}

/* En móviles se apilan */
@media (max-width: 768px) {
  .filters-bar {
    grid-template-columns: 1fr; /* una sola columna */
  }
}


/* Overlay */
#popupOpciones {
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

/* Tarjeta compacta */
#popupOpciones .popup-content{
  position: relative;
  width: 420px;
  max-width: 92vw;
  padding: 18px 18px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .20);
  animation: po-pop .12s ease-out;
}

/* Título */
#popupOpciones h3{
  margin: 2px 0 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

/* Contenedor de campos (lo rellenas por JS) */
#poCampos{
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
}
#poCampos label{
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
#poCampos select{
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid #cfd6e4;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
#poCampos select:focus{
  border-color: #0b6fb8;
  box-shadow: 0 0 0 3px rgba(11,111,184,.12);
}

/* Acciones */
#popupOpciones .po-actions{
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
#popupOpciones .btn{
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
#popupOpciones .btn-outline{
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
#popupOpciones .btn-outline:hover{ background:#f1f5f9; }
#popupOpciones .btn-primary{
  background: #127c3e; /* verde sobrio */
  color: #fff;
  border: 0;
}
#popupOpciones .btn-primary:hover{ background:#0e6a35; }

/* Botón X */
#popupOpciones .modal-close{
  position: absolute;
  top: 8px; right: 10px;
  width: 28px; height: 28px;
  line-height: 26px;
  text-align: center;
  font-size: 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
#popupOpciones .modal-close:hover{ background:#f8fafc; }

/* Animación sutil */
@keyframes po-pop{
  from{ transform: translateY(4px) scale(.98); opacity: 0; }
  to  { transform: translateY(0)   scale(1);   opacity: 1; }
}



/* === Modal "Valores" (gestionar-niveles) === */
/* ===== Refinado modal "Valores" ===== */

/* un poco más ancho para dar aire al input */
#modalValores .mv-card{
  width: 600px;            /* antes 520px */
}

/* Input ancho + botón fijo y más chico */
#modalValores .mv-row{
  display: grid;
  grid-template-columns: 1fr 140px;  /* input crece, botón fijo */
  gap: 8px;
}
#modalValores .mv-input{
  min-width: 0;            /* evita que el botón empuje al input */
  height: 40px;            /* un poquito más alto */
  font-size: 14px;
}
#modalValores .mv-btn-primary{
  width: 140px;
  height: 36px;            /* más bajo */
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* Botón "Cerrar" más discreto */
#modalValores .mv-actions .mv-btn-outline{
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
}

/* Chips más pequeños (sobrescribe estilos inline) */
#modalValores .mv-list{
  gap: 6px;                /* menos separación entre chips */
}

/* Como los chips vienen con estilos inline, usamos !important para compactarlos */
#modalValores .mv-list span{
  padding: 4px 8px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  gap: 6px !important;
}
#modalValores .mv-list span button{
  font-size: 14px !important;
  line-height: 1 !important;
  padding: 0 2px !important;
}

/* ===== Modal Consumidor Final: versión compacta y limpia ===== */
#popupConsumidorFinal .popup-content{
  width: 420px;           /* más chico */
  max-width: 92vw;
  padding: 16px 18px;     /* menos relleno */
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(17,24,39,.12);
}

#popupConsumidorFinal h3{
  font-size: 18px;        /* título más discreto */
  font-weight: 700;
  margin: 4px 0 10px;
  text-align: center;
  color: #0f172a;
}

#popupConsumidorFinal .grupo{
  margin: 8px 0;          /* menos separación vertical */
}

#popupConsumidorFinal label{
  display:block;
  margin-bottom: 4px;
  font-size: 12.5px;
  color:#4b5563;
  font-weight: 600;
}

#popupConsumidorFinal input{
  width: 100%;
  height: 38px;           /* inputs más bajos */
  padding: 8px 10px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background:#fff;
  font-size: 14px;
}

/* Acciones más compactas */
#popupConsumidorFinal .acciones{
  display:flex;
  gap:8px;
  margin-top: 10px;
}

#popupConsumidorFinal #cfCancelar{
  flex:1;
  height: 36px;
  border: 1px solid #d1d5db;
  background:#fff;
  color:#374151;
  border-radius:8px;
  font-weight:600;
}
#popupConsumidorFinal #cfCancelar:hover{
  background:#f3f4f6;
}

#popupConsumidorFinal #cfConfirmar{
  flex:1;
  height: 36px;
  border:0;
  background:#0b6fb8;     /* azul corporativo */
  color:#fff;
  border-radius:8px;
  font-weight:700;
}
#popupConsumidorFinal #cfConfirmar:hover{
  background:#095e9b;
}

/* Un pelín menos de opacidad al backdrop para que no “pese” */
#popupConsumidorFinal.popup-confirmacion{
  background: rgba(15, 23, 42, 0.4);
}

/* --- Fix mobile: categorías apiladas y sin solaparse --- */
@media (max-width: 768px){
  /* apila todo el formulario: label arriba, input abajo */
  #formProducto .field{
    display: block !important;
  }
  #formProducto .field label{
    display:block; 
    margin-bottom:6px;
    white-space: normal; /* deja que los labels hagan wrap */
  }

  /* apila las categorías: 1 por fila */
  #formProducto #categorias-container{
    grid-template-columns: 1fr !important;
  }

  /* cada categoría también apila su label + control */
  #formProducto #categorias-container .field{
    display:block !important;
  }

  /* por si quedó ese inline style que rompe en móvil */
  #formProducto #categorias-container{
    grid-column: auto !important;
  }

  /* la fila del checkbox (cuando el nivel es “optionable”) que usa flex */
  #formProducto #categorias-container .field div{
    flex-wrap: wrap;         /* evita pisarse en pantallas chicas */
    row-gap: 6px;
  }

  /* imagen en columna */
  #formProducto .image-box{
    grid-template-columns: 1fr !important;
  }
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Que la tabla tenga un ancho mínimo grande para obligar al scroll */
#tablaDistribuidores {
  min-width: 1400px;    /* súbelo a 1600 si aún no alcanza */
  border-collapse: collapse;
  table-layout: fixed;  /* respeta los anchos del colgroup */
}

/* No partas palabras en celdas */
#tablaDistribuidores th,
#tablaDistribuidores td {
  white-space: nowrap;
}

/* Evita que un padre la recorte */
.container { overflow: visible; }

h1 {
  font-size: 1.5rem !important; /* más chico que el default (~2rem) */
  font-weight: 600;  /* opcional: menos pesado si querés */
}


/* ==== FILTROS HORIZONTALES (solo escritorio) ==== */
@media (min-width: 901px) {
  .filtros-linea-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
  }

  .filtros-linea-horizontal .grupo {
    display: flex;
    flex-direction: column;
  }

  .filtros-linea-horizontal .grupo button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: #16a34a;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
  }

  .filtros-linea-horizontal .grupo button:hover {
    background: #15803d;
  }
}

/* ==== EN MÓVIL (vertical como antes) ==== */
@media (max-width: 900px) {
  .filtros-linea-horizontal {
    display: block;
    margin-bottom: 12px;
  }

  .filtros-linea-horizontal .grupo {
    margin-bottom: 10px;
  }
}
