:root{
  --primario:#2563eb;
  --secundario:#1f2933;
  --fondo:hwb(0 100% 0%);
  --blanco:#fff;
  --rojo:#dc2626;
  --gris:#e5e7eb;
}
*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:'Times New Roman', Times, serif;
  background:var(--fondo);
  display:flex;
  height:100vh;
}

/* LOGIN */
#login{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: var(--secundario);
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center; /* 👈 esto centra horizontalmente */
}

.sidebar h2{ text-align:center; margin-bottom:30px; }

.sidebar button{
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s;
  display: flex;              /* 👈 */
  justify-content: center;    /* 👈 centra contenido */
  gap: 8px;                   /* espacio entre icono y texto */
  height: 35px;
}

/* 🔥 Hover */
.sidebar button:hover {
  background: linear-gradient(90deg, #2563eb, #1e40af);
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

/* 🎯 Botón activo (sección actual) */
.sidebar button.active-btn {
  background: #2563eb;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37,99,235,0.5);
}

/* MAIN */
.main{
  flex:1;
  padding:30px;
  overflow-y:auto;
}

.section {
  display: none;
}

.section.active {
  display: block;
}


/* TARJETAS */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:20px;
  margin-top:20px;
}

.producto {
  background: white;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.producto:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.producto h4 {
  font-size: 14px;
  margin: 0;
}

.producto p {
  font-weight: bold;
  color: #2c7a4b; /* verde negocio */
  margin: 0;
}

.pedido-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.pedido-item span {
  font-weight: 500;
}

.card{
  background:white;
  padding:30px;
  border-radius:20px;
  box-shadow:0 10px 30px rgba(0,0,0,0.05);
  transition:all 0.3s ease;
  border:1px solid #f1f5f9;
}

.card:hover{
  transform:translateY(-8px);
  box-shadow:0 20px 40px rgba(0,0,0,0.08);
}

.caja-producto{
  cursor:pointer;
  text-align:center;
  font-size:18px;
  transition:0.2s;
}

.caja-producto:hover{
  transform:scale(1.03);
  background:#e0f2fe;
}
/* FORM */
input, select{
  width:100%;
  padding:10px;
  margin-bottom:8px;
  border-radius:8px;
  border:1px solid #ccc;
}

.btn{
  padding:10px 14px;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

.btn-primary{ 
  background:var(--primario); 
  color:white; 
  transition:0.2s;
}

.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 15px rgba(37,99,235,0.4);
}

.btn-danger{ background:var(--rojo); color:white; }

/* TABLAS */
table{
  width:100%;
  margin-top:15px;
  border-collapse:collapse;
  background:white;
  border-radius:10px;
  overflow:hidden;
}

th,td{
  padding:12px;
  border-bottom:1px solid var(--gris);
}

th{ background:#f1f5f9; text-align:left; }

.btn-caja{
  font-size:15px;
  padding:14px;
  margin-right:10px;
}

.sin-stock {
  opacity: 0.5;
  pointer-events: none;
}

.caja-producto {
  background: white;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.caja-producto:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

#totalCaja {
  font-size: 32px;
  font-weight: bold;
  color: #2563eb;
}

.total-container {
  background: #f1f5ff;
  padding: 20px;
  border-radius: 14px;
  margin-top: 20px;
  text-align: center;
}

.btn-cobrar {
  background: #16a34a;
  color: white;
  font-weight: bold;
  padding: 14px;
  border-radius: 12px;
  width: 100%;
  font-size: 18px;
  transition: 0.2s;
}

.btn-cobrar:hover {
  background: #15803d;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 4px;
}

.tagline {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 20px;
}

.bienvenida {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.btn-actualizar-pro-inicio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #facc15;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.btn-actualizar-pro-inicio:hover {
  transform: translateY(-1px);
}

.banner-free{
  background:linear-gradient(135deg,#facc15,#f59e0b);
  border-radius:20px;
  padding:25px;
  font-weight:600;
  display:flex;
  justify-content:space-between;
  align-items:center;
  box-shadow:0 10px 30px rgba(0,0,0,0.05);
}

.banner-free button {
  background: black;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.limites-free {
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
}

.modal-pro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 14px;
  text-align: center;
  width: 300px;
}

/* ===== BOTTOM NAV MOBILE ===== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  display: none;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.bottom-nav button {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: flex;
  }

  .main {
    padding-bottom: 70px;
  }

}

#productosCaja {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.logo-img {
  width: 200px;
  margin-bottom: 20px;
  display: block;
}


.sidebar button.active-btn{
  background:var(--primario);
}

.caja-producto{
  border:1px solid #e2e8f0;
}

.caja-producto:hover{
  background:#f0f9ff;
}

/* ================= SECCIONES ================= */

.section {
  animation: fade 0.2s ease-in-out;
}

@keyframes fade {
  from { 
    opacity: 0; 
    transform: translateY(5px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

@keyframes fade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1{
  font-size:32px;
  margin-bottom:10px;
}

.bloque-pro {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  padding: 25px;
  border-radius: 14px;
  text-align: center;
  margin-top: 20px;
}

.bloque-pro button {
  margin-top: 12px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #facc15;
  font-weight: bold;
  cursor: pointer;
}

.modal-upgrade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.upgrade-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 320px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.btn-pro {
  background: linear-gradient(135deg,#facc15,#f59e0b);
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: bold;
  width: 100%;
  cursor: pointer;
  margin-top: 10px;
}

.btn-cerrar {
  background: #e5e7eb;
  border: none;
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
}

.badge-pro {
  background: linear-gradient(135deg,#facc15,#f59e0b);
  color: black;
  font-weight: bold;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: none;
}

.caja-layout {
  display: flex;
  gap: 20px;
}

.caja-productos {
  flex: 2;
}

.caja-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.caja-resumen {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 10px;
}

#pagoCliente {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-size: 16px;
}

@media (max-width: 768px) {
  .caja-layout {
    flex-direction: column;
  }
}

.caja-productos,
.caja-panel {
  background: #ffffff;
  padding: 15px;
  border-radius: 10px;
}
.caja-producto:active {
  transform: scale(0.95);
  background: #dbeafe;
}

.caja-resumen h2 {
  font-size: 28px;
  font-weight: bold;
  color: #16a34a;
}

/* CAJA PRO */
.caja-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.caja-productos {
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
}

.caja-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.caja-pedido {
  background: #fff;
  padding: 15px;
  border-radius: 12px;
}

.caja-resumen {
  background: #111827;
  color: white;
  padding: 20px;
  border-radius: 12px;
}

.btn-cobrar {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  background: #22c55e;
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
}

.btn-cobrar:hover {
  background: #16a34a;
}

/* CANTIDAD */
.cantidad-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-cant {
  background: #2563eb;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* PRODUCTOS */
.caja-producto {
  cursor: pointer;
  transition: 0.2s;
}

.caja-producto:hover {
  transform: scale(1.03);
  background: #e0f2fe;
}

/* BUSCADOR */
#buscadorCaja {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.flash {
  background: #d1fae5;
}

/* 📊 CAJA DEL DÍA */

.caja-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.caja-card {
  padding: 15px;
  border-radius: 12px;
  color: #fff;
  text-align: center;
  transition: transform 0.2s;
}

.caja-card:hover {
  transform: scale(1.05);
}

.caja-card h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.caja-card p {
  font-size: 22px;
  font-weight: bold;
}

/* 🎨 COLORES */

.caja-card.total {
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.caja-card.efectivo {
  background: linear-gradient(135deg, #16a34a, #166534);
}

.caja-card.qr {
  background: linear-gradient(135deg, #9333ea, #6b21a8);
}

.caja-card.tarjeta {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

/* 📱 MOBILE CAJA */

@media (max-width: 768px) {

  .caja-layout {
    flex-direction: column;
  }

  .caja-productos {
    order: 2;
  }

  .caja-panel {
    order: 1;
  }

  .caja-productos .cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

}

@media (max-width: 768px) {

  button {
    padding: 12px;
    font-size: 16px;
  }

  .btn-cobrar {
    width: 100%;
    font-size: 18px;
  }

}

@media (max-width: 768px) {

  input, select {
    padding: 12px;
    font-size: 16px;
    width: 100%;
  }

}

.caja-producto {
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}

.caja-producto h3 {
  font-size: 14px;
}

.caja-producto p {
  font-size: 16px;
  font-weight: bold;
}

.caja-pedido button {
  padding: 6px 10px;
  font-size: 16px;
}

@media (max-width: 768px) {

  .caja-resumen {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px;
    border-top: 2px solid #ddd;
  }

}

#login {
  max-width: 350px;
  margin: auto;
  margin-top: 100px;
}

#login input {
  width: 100%;
  padding: 10px;
}

#login button {
  width: 100%;
}



body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #f5f7fb;
}

/* ===== LAYOUT PRO (RESPONSIVE REAL) ===== */

#sistema {
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 220px;
  background: var(--secundario);
  color: white;
  flex-shrink: 0;
}


/* 📱 MOBILE */
@media (max-width: 768px) {



  .sidebar {
    display: none;
  }

  .main {
    padding: 15px;
  }

  .bottom-nav {
    display: flex;
  }
}

.main {
  flex: 1;
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.main {
  flex: 1;
  padding: 30px;
  max-width: 1200px;
  margin-left: 40px;
}

/* 📱 MOBILE */
@media (max-width: 768px) {

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
  }

  .main {
    margin-left: 0;
    padding: 15px;
  }

  .cards {
    flex-direction: column;
  }

  .caja-layout {
    flex-direction: column;
  }

  .caja-productos,
  .caja-panel {
    width: 100%;
  }

  table {
    font-size: 12px;
  }

  h1, h2, h3 {
    font-size: 18px;
  }
}

@media (max-width: 768px) {

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: flex;
  }

}

#sistema {
  flex-direction: row;
  width: 100%;
}

/* ===== FIX DEFINITIVO PC ===== */



@media (min-width: 769px) {

  #sistema:not(.oculto) {
    display: flex;
    flex-direction: row;
  }


  .sidebar {
    width: 240px !important;
    min-height: 100vh;
  }

  .main {
    flex: 1 !important;
    width: auto !important;
  }

}

.oculto {
  display: none !important;
}



/* ===== CAJA: PRODUCTOS DESPLEGABLES ===== */
.buscador-productos-caja{position:relative;width:100%;z-index:50}
.productos-dropdown-caja{
  position:absolute;top:calc(100% - 8px);left:0;width:100%;
  max-height:360px;overflow-y:auto;background:#fff;
  border:1px solid #dbe3ee;border-radius:0 0 12px 12px;
  box-shadow:0 12px 30px rgba(15,23,42,.15);
  display:none;padding:6px;
}
.productos-dropdown-caja.abierto{display:block}
.item-producto-caja{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:12px 14px;border-radius:9px;cursor:pointer;
  background:#fff;border-bottom:1px solid #eef2f7;
}
.item-producto-caja:hover{background:#eff6ff}
.item-producto-caja:last-child{border-bottom:0}
.producto-caja-info{min-width:0;text-align:left}
.producto-caja-info strong{display:block;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.producto-caja-info small{color:#64748b}
.producto-caja-precio{white-space:nowrap;font-weight:700;color:#2563eb}
.lista-productos-vacia{padding:18px;text-align:center;color:#64748b}

/* ===== ALERTA GRANDE DE SALDO ===== */
.alerta-saldo-modal{
  position:fixed;inset:0;display:none;align-items:center;justify-content:center;
  padding:20px;background:rgba(15,23,42,.78);backdrop-filter:blur(3px);z-index:99999;
}
.alerta-saldo-modal.abierto{display:flex}
.alerta-saldo-modal .alerta-saldo-contenido{
  width:min(520px,94vw);background:#fff;border-radius:22px;padding:36px 30px;
  text-align:center;box-shadow:0 25px 70px rgba(0,0,0,.3);
}
.alerta-saldo-icono{
  width:82px;height:82px;margin:0 auto 16px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;background:#fee2e2;font-size:44px;
}
.alerta-saldo-modal h2{margin:0 0 14px;font-size:30px;color:#991b1b}
.alerta-saldo-modal p{margin:0;font-size:19px;line-height:1.8;color:#334155}
.btn-alerta-saldo{
  margin-top:25px;min-width:190px;padding:14px 24px;border:0;border-radius:10px;
  background:#2563eb;color:#fff;font-size:17px;font-weight:700;cursor:pointer;
}
@media(max-width:768px){.productos-dropdown-caja{max-height:300px}.alerta-saldo-modal .alerta-saldo-contenido{padding:30px 22px}.alerta-saldo-modal h2{font-size:24px}}

/* ===== INGRESOS DE MERCADERIA ===== */
.ingreso-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.ingreso-datos label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}
.ingreso-linea {
  display: grid;
  grid-template-columns: 2fr 100px 150px 140px 45px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ingreso-linea .subtotal-ingreso {
  font-weight: bold;
  text-align: right;
}
.ingreso-total {
  margin: 20px 0;
  padding: 15px;
  background: #f1f5f9;
  border-radius: 10px;
  text-align: right;
  font-size: 20px;
}
.ingresos-filtros {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 10px;
  align-items: center;
}
.detalle-ingreso-vista {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .ingreso-linea { grid-template-columns: 1fr 90px 120px 100px 40px; }
  .ingresos-filtros { grid-template-columns: 1fr; }
}

/* ===== CIERRE DE CAJA ===== */
#cierreCaja .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:15px;margin:20px 0}
#cierreCaja .card{padding:18px}
#cierreCaja .card h3{margin-top:0}
#cierreCaja .card p{font-size:1.15rem;font-weight:600}

.sidebar-separator {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 10px;
}

/* ===== RENTABILIDAD ===== */
#rentabilidad .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:15px;margin:20px 0}
#rentabilidad .card{padding:18px}
#rentabilidad .card h3{margin-top:0}
#rentabilidad .card p{font-size:1.15rem;font-weight:600}

/* ===== ANCHO COMPLETO: CAJA Y RENTABILIDAD ===== */
#cierreCaja,
#rentabilidad {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

#cierreCaja > .card,
#cierreCaja #panelCajaAbierta > .card,
#rentabilidad > .card,
#rentabilidad > table {
  width: 100%;
}

/* Las tarjetas de indicadores aprovechan todo el ancho disponible. */
#cierreCaja .cards,
#rentabilidad .cards {
  width: 100%;
}

/* En rentabilidad, las dos últimas tarjetas también ocupan todo el ancho disponible
   de su fila, sin dejar un hueco innecesario. */
#rentabilidad .cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
#rentabilidad .cards .card {
  grid-column: span 2;
}
#rentabilidad .cards .card:nth-child(4) {
  grid-column: 1 / span 3;
}
#rentabilidad .cards .card:nth-child(5) {
  grid-column: 4 / span 3;
}

@media (max-width: 900px) {
  #rentabilidad .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #rentabilidad .cards .card,
  #rentabilidad .cards .card:nth-child(4),
  #rentabilidad .cards .card:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  #cierreCaja .cards,
  #rentabilidad .cards {
    grid-template-columns: 1fr;
  }
}

/* ===== SIDEBAR: CONFIGURACIÓN AL FINAL ===== */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar-config {
  margin-top: auto;
  padding-top: 10px;
}

.sidebar-separator {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0 0 10px;
  padding: 0;
}

/* ===== SIDEBAR FINAL: MENU Y CONFIGURACIÓN SIN SUPERPOSICIONES ===== */
.sidebar {
  height: 100vh;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-menu {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-config {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  background: var(--secundario);
}

.sidebar-separator {
  margin: 0 0 8px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 0;
}

.sidebar-config button {
  margin-bottom: 0;
}

/* ===== FUNCIONES PRO ===== */
#btnCierreCaja,
#btnRentabilidad {
  position: relative;
}

/* ===== CONTROL DE STOCK ===== */
.stock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.stock-header h1 { margin-bottom: 6px; }
.stock-header p { margin-top: 0; color: #64748b; }

.stock-filtros {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
}

.stock-filtros input,
.stock-filtros select { margin-bottom: 0; }

.stock-tabla-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.stock-tabla-header h2 { margin: 0; }
.stock-tabla-header span { color: #64748b; font-size: 13px; }

.tabla-scroll { overflow-x: auto; }

.stock-entrada { color: #15803d; }
.stock-salida { color: #b91c1c; }

@media (max-width: 900px) {
  .stock-header { flex-direction: column; }
  .stock-filtros { grid-template-columns: 1fr; }
}

/* ===== LAYOUT FINAL: CONTENIDO A ANCHO COMPLETO ===== */
@media (min-width: 769px) {
  #sistema:not(.oculto) {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  #sistema:not(.oculto) > .main {
    flex: 1 1 auto !important;
    width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 30px !important;
    min-width: 0;
  }

  #sistema:not(.oculto) > .main > .section {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #cierreCaja,
  #rentabilidad {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
\n\n/* ===== RENTABILIDAD V2 ===== */\n.rentabilidad-cards {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));\n  gap: 16px;\n}\n\n.rentabilidad-cards .card {\n  min-height: 110px;\n}\n\n.texto-ayuda-rentabilidad {\n  margin: 6px 0 0;\n  color: #64748b;\n  font-size: 13px;\n}\n\n#rentabilidad .ingresos-filtros {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: end;\n  gap: 12px;\n  margin: 18px 0;\n}\n\n#rentabilidad .ingresos-filtros label {\n  display: flex;\n  flex-direction: column;\n  gap: 5px;\n  font-weight: 600;\n}\n\n#rentabilidad table {\n  width: 100%;\n}\n\n#rentabilidad table th,\n#rentabilidad table td {\n  white-space: nowrap;\n}\n\n@media (max-width: 900px) {\n  .rentabilidad-cards {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n  }\n}\n\n@media (max-width: 600px) {\n  .rentabilidad-cards {\n    grid-template-columns: 1fr;\n  }\n}\n