:root{--bg:#f5f7fb;--card:#fff;--ink:#17202a;--muted:#64748b;--line:#e5eaf0;--nav:#0f172a;--blue:#0ea5e9;--green:#16a34a}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Arial;background:var(--bg);color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:10px;padding:10px 14px;font-weight:800}.shell{display:flex;min-height:100vh}.side{position:fixed;inset:0 auto 0 0;width:245px;background:var(--nav);color:#fff;padding:18px 12px}.logo{font-size:24px;font-weight:950;padding:10px 12px 25px}.logo b{color:#38bdf8}.nav button{width:100%;background:transparent;color:#cbd5e1;text-align:left;margin:3px 0}.nav button.active,.nav button:hover{background:#1e293b;color:#fff}.main{margin-left:245px;width:calc(100% - 245px);padding:24px}.top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.top h1{margin:0;font-size:28px}.muted{color:var(--muted);font-size:13px}.badge{display:inline-block;padding:5px 9px;border-radius:999px;background:#e0f2fe;color:#0369a1;font-weight:800;font-size:12px}.cards{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}.card,.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:0 5px 18px #00000008}.num{font-size:25px;font-weight:950;margin-top:5px}.grid{display:grid;grid-template-columns:1.6fr 1fr;gap:16px;margin-top:16px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}.section{display:none}.section.active{display:block}.panel h2{font-size:18px;margin:0 0 14px}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:11px 8px;border-bottom:1px solid #edf1f5;text-align:left;font-size:14px}.input{width:100%;padding:11px;border:1px solid #d9e1e9;border-radius:10px;background:#fff}.primary{background:var(--blue);color:#fff}.dark{background:#111827;color:#fff}.light{background:#edf2f7;color:#334155}.success{background:#dcfce7;color:#166534}.warning{background:#fef3c7;color:#92400e}.products{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-height:600px;overflow:auto}.prod{border:1px solid var(--line);border-radius:13px;padding:12px}.prod img{width:100%;height:120px;object-fit:cover;border-radius:10px;background:#eef2f7}.prod strong{display:block;margin:8px 0}.price{font-weight:950;font-size:18px}.empty{text-align:center;padding:30px;color:var(--muted)}.row{display:flex;gap:8px;align-items:center}.between{display:flex;justify-content:space-between;align-items:center}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login .panel{width:min(440px,100%)}.form{display:grid;gap:10px}.ai{background:linear-gradient(135deg,#0f172a,#164e63);color:white}.ai .muted{color:#cbd5e1}.feature{padding:13px;border:1px solid var(--line);border-radius:12px}.feature b{display:block;margin-bottom:5px}@media(max-width:1000px){.side{width:70px}.logo{font-size:0}.logo b{font-size:20px}.nav button{font-size:0;text-align:center}.nav button:after{content:'•';font-size:22px}.main{margin-left:70px;width:calc(100% - 70px)}.cards{grid-template-columns:repeat(2,1fr)}.grid,.grid3{grid-template-columns:1fr}.products{grid-template-columns:repeat(2,1fr)}}@media(max-width:560px){.main{padding:13px}.products{grid-template-columns:1fr}.cards{grid-template-columns:1fr 1fr}}
.modal-back{position:fixed;inset:0;background:#0008;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}.modal{background:white;border-radius:18px;padding:22px;max-width:620px;width:100%;max-height:90vh;overflow:auto;box-shadow:0 20px 80px #0006}.modal label{display:block;font-weight:700;font-size:13px;margin-top:8px}.modal .input{margin-top:5px}

/* Cámara de Stock: visible en celulares, oculta en escritorio */
.stockCameraOnlyMobile{display:none!important}
@media(max-width:760px){.stockCameraOnlyMobile{display:inline-flex!important}}
#stockBarcodeCameraPanel.stockCameraOnlyMobile{display:none!important}
@media(max-width:760px){#stockBarcodeCameraPanel.stockCameraOnlyMobile[style*="display: block"]{display:block!important}}

/* ComercioIA: cámara solo en móvil */
@media(min-width:761px){
  .stockCameraOnlyMobile,
  #cameraScannerPanel,
  #purchaseCameraPanel,
  button[onclick="startCameraScanner()"],
  button[onclick="stopCameraScanner()"],
  button[onclick="purchaseStartCamera()"],
  button[onclick="purchaseStopCamera()"]{
    display:none!important;
  }
}
@media(max-width:760px){
  .stockCameraOnlyMobile{display:inline-flex}
}


/* FIX: cámara de código de barras dentro de Nuevo producto */
@media (max-width: 760px) {
  button.stockCameraOnlyMobile {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  #stockBarcodeCameraPanel.stockCameraOnlyMobile {
    display: none !important;
  }
  #stockBarcodeCameraPanel.stockCameraOnlyMobile[style*="display: block"] {
    display: block !important;
  }
}
@media (min-width: 761px) {
  button.stockCameraOnlyMobile,
  #stockBarcodeCameraPanel.stockCameraOnlyMobile {
    display: none !important;
  }
}

/* ComercioIA 2.0 - diseño de venta en bloques */
#pos .grid{align-items:start;gap:20px}
#pos .panel{border-radius:18px;padding:20px;box-shadow:0 6px 22px #0f172a0a}
#pos #q,#pos #barcodeScanner{min-height:48px;font-size:16px}
#pos .products{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-height:65vh;padding:2px}
#pos .prod{border-radius:16px;padding:14px;background:#fff;transition:box-shadow .2s,border-color .2s}
#pos .prod:hover{border-color:#0ea5e9;box-shadow:0 5px 16px #0ea5e91a}
#pos .prod img{height:130px;object-fit:contain;background:#f8fafc}
#pos .prod strong{font-size:15px;line-height:1.35;min-height:38px}
#pos .prod .price{font-size:21px;color:#0f766e;margin-top:8px}
#pos .prod button{min-height:42px}
#pos #ct{max-height:42vh;overflow:auto}
#pos #ct>div{padding:13px 0!important;gap:10px!important}
#pos #ct button{min-width:36px;min-height:36px}
#pos #tt{font-size:32px;color:#0f766e}
#pos #pay,#pos #pointPrint,#pos #inv{min-height:46px;font-size:15px}
#pos button[onclick="checkout()"]{min-height:54px;font-size:18px;border-radius:14px;box-shadow:0 4px 12px #0ea5e933}
#pos button[onclick="printCurrentTicket()"],#pos button[onclick="clearCart()"]{min-height:44px}
@media(max-width:1000px){
 #pos .grid{grid-template-columns:1fr}
 #pos .products{max-height:none}
 #pos #ct{max-height:none}
}
@media(max-width:560px){
 #pos .panel{padding:14px}
 #pos .products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #pos .prod{padding:9px}
 #pos .prod img{height:95px}
 #pos .prod strong{font-size:13px;min-height:34px}
 #pos .prod .price{font-size:18px}
 #pos #tt{font-size:27px}
}

/* ComercioIA 2.0: venta centrada en el carrito */
#pos .grid{grid-template-columns:1fr!important;max-width:1100px;margin-inline:auto}
#pos .grid>.panel:first-child{order:2}
#pos .grid>.panel:last-child{order:1}
#pos #pg{display:none}
#pos #q{margin-bottom:8px}
#pos #ct{max-height:50vh;overflow-y:auto}
#pos #ct>div{display:flex;align-items:center;flex-wrap:wrap;padding:16px 8px!important;border-bottom:1px solid #e2e8f0!important;gap:12px!important}
#pos #ct>div strong{font-size:16px}
#pos #ct>div button{min-width:40px;min-height:40px;font-size:18px}
#pos #tt{font-size:34px;color:#0f766e}
#pos button[onclick="checkout()"]{min-height:58px;font-size:19px}
#pos .grid>.panel:first-child:has(#pg){padding-bottom:14px}
#pos .grid>.panel:first-child #q{margin-bottom:8px}

/* ComercioIA simple para PC: priorizar lector USB y ticket */
@media (min-width: 761px) {
  #pos #cameraScannerPanel,
  #pos button[onclick="startCameraScanner()"],
  #pos button[onclick="stopCameraScanner()"] {
    display: none !important;
  }
  #pos .grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
    align-items: start;
    gap: 18px;
  }
  #pos #barcodeScanner {
    min-height: 48px;
    font-size: 16px;
    border: 2px solid #0ea5e9;
  }
  #pos #tt {
    font-size: 32px;
    font-weight: 900;
  }
  #pos #ct {
    max-height: 55vh;
    overflow-y: auto;
  }
}

/* ComercioIA - simplificacion visual del punto de venta */
#pos .top h1 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
#pos .top .muted {
  display: block;
  margin-top: 5px;
  line-height: 1.5;
}
#pos #q,
#pos #barcodeScanner {
  min-height: 48px;
  font-size: 16px;
  border-radius: 12px;
}
#pos #barcodeScanner {
  border: 2px solid #0ea5e9;
  background: #f0f9ff;
  font-weight: 700;
}
#pos .panel h2 {
  font-size: 21px;
}
#pos #tt {
  font-size: 32px;
  color: #15803d;
}
#pos #pay,
#pos #pointPrint,
#pos #inv {
  min-height: 46px;
}
#pos button {
  min-height: 44px;
}
#pos button.primary {
  font-size: 16px;
}
#pos .prod {
  transition: box-shadow .15s ease, border-color .15s ease;
}
#pos .prod:hover {
  border-color: #0ea5e9;
  box-shadow: 0 4px 14px #0f172a12;
}
@media(max-width:700px) {
  #pos .top {
    align-items: flex-start;
    flex-direction: column;
  }
  #pos .top h1 {
    font-size: 25px;
  }
}

/* ComercioIA 2.4.6: distribución clara del punto de venta en PC */
@media (min-width: 761px) {
  #pos .grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
    align-items: start !important;
    gap: 18px !important;
    max-width: 1400px;
    margin-inline: auto;
  }
  #pos .grid > .panel:first-child {
    order: 0 !important;
  }
  #pos .grid > .panel:last-child {
    order: 0 !important;
  }
  #pos #pg {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(100vh - 300px);
    overflow-y: auto;
  }
  #pos #ct {
    max-height: 40vh;
    overflow-y: auto;
  }
  #pos #cameraScannerPanel,
  #pos button[onclick="startCameraScanner()"],
  #pos button[onclick="stopCameraScanner()"] {
    display: none !important;
  }
}


/* ComercioIA 2.4.7: Punto de Venta claro para PC */
@media (min-width: 761px) {
  #pos .grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
    align-items: start;
    gap: 18px;
    max-width: 1400px;
  }
  #pos .grid > .panel {
    min-width: 0;
  }
  #pos #pg.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 62vh;
    overflow-y: auto;
  }
  #pos .grid > .panel:nth-child(2) {
    position: sticky;
    top: 12px;
  }
  #pos #tt {
    font-size: 32px;
  }
  #pos button[onclick="checkout()"] {
    min-height: 54px;
    font-size: 17px;
  }
}
@media (max-width: 760px) {
  #pos .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #pos #pg.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ComercioIA - diseño de caja: buscador y carrito a la izquierda, cobro a la derecha */
@media (min-width: 761px) {
  #pos .grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.85fr) !important;
    align-items: start !important;
    gap: 18px !important;
    max-width: 1500px;
    margin-inline: auto;
  }
  #pos .grid > .panel:first-child {
    order: 0 !important;
    min-width: 0;
  }
  #pos .grid > .panel:last-child {
    order: 0 !important;
    min-width: 0;
    position: sticky;
    top: 12px;
  }
  #pos #pg {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-height: 28vh !important;
    overflow-y: auto !important;
  }
  #pos #ct {
    display: block !important;
    max-height: 38vh;
    overflow-y: auto;
  }
}
@media (max-width: 760px) {
  #pos .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #pos #pg {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-height: 35vh;
    overflow-y: auto;
  }
  #pos #ct {
    max-height: none;
  }
}


/* ComercioIA 2.0: bloques modernos de medios de pago */
#pos .payment-blocks{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:10px;
}
#pos .payment-tile{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:7px;
  min-height:122px;
  padding:16px;
  text-align:left;
  color:#1e293b;
  background:linear-gradient(145deg,#fff,#f8fafc);
  border:1px solid #e2e8f0;
  border-radius:17px;
  box-shadow:0 3px 10px #0f172a08;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
#pos .payment-tile:hover{transform:translateY(-2px);box-shadow:0 8px 20px #0f172a10}
#pos .payment-tile.selected{
  border:2px solid #0284c7;
  background:linear-gradient(145deg,#eff8ff,#e0f2fe);
  box-shadow:0 0 0 3px #0ea5e918;
}
#pos .payment-icon{font-size:29px;line-height:1.1}
#pos .payment-tile strong{font-size:15px;line-height:1.3}
#pos .payment-tile small{font-size:12px;color:#64748b;font-weight:500}
#pos .point-modes{
  margin-top:13px;padding:14px;border:1px solid #cbd5e1;
  border-radius:15px;background:#f8fafc;
}
#pos .point-modes-title{font-size:13px;font-weight:800;margin-bottom:10px}
#pos .point-mode-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}
#pos .point-mode{
  padding:12px 9px;border:1px solid #cbd5e1;border-radius:11px;
  color:#334155;background:#fff;font-weight:750;
}
#pos .point-mode.active{border-color:#0284c7;background:#e0f2fe;color:#075985}
@media(max-width:560px){
  #pos .payment-blocks{gap:8px}
  #pos .payment-tile{padding:12px;min-height:112px}
  #pos .payment-tile strong{font-size:13px}
  #pos .point-mode-options{grid-template-columns:1fr}
}




/* ComercioIA 2.0: carrito compacto con miniaturas */
#pos .grid{
  gap:14px !important;
}
@media(min-width:761px){
  #pos .grid{
    grid-template-columns:minmax(0,0.95fr) minmax(360px,1fr) !important;
    max-width:1400px;
  }
}
#pos .grid>.panel:first-child{
  padding:15px;
  min-width:0;
}
#pos .grid>.panel:first-child h2{
  margin-bottom:10px;
}
#pos #ct{
  max-height:42vh;
  overflow-y:auto;
  overscroll-behavior:contain;
}
#pos #ct .cart-row{
  display:grid !important;
  grid-template-columns:54px minmax(0,1fr) auto;
  align-items:center;
  gap:10px !important;
  padding:10px 2px !important;
  border-bottom:1px solid #e8edf3 !important;
}
#pos .cart-photo{
  width:54px;
  height:54px;
  overflow:hidden;
  border-radius:11px;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
}
#pos .cart-thumb{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
#pos .cart-photo-placeholder{
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  color:#64748b;
  font-size:22px;
}
#pos .cart-info{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
#pos .cart-name{
  font-size:13px !important;
  line-height:1.3;
  overflow-wrap:anywhere;
}
#pos .cart-unit{
  color:#64748b;
  font-size:11px;
  line-height:1.3;
}
#pos .cart-controls{
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:3px;
}
#pos .cart-qty-btn,
#pos .cart-remove{
  min-width:29px !important;
  min-height:29px !important;
  padding:3px 7px !important;
  border-radius:8px;
  font-size:14px !important;
}
#pos .cart-qty{
  min-width:19px;
  text-align:center;
  font-size:13px;
}
#pos .cart-subtotal{
  text-align:right;
  white-space:nowrap;
  font-size:13px;
  font-weight:850;
}
@media(max-width:560px){
  #pos .grid>.panel:first-child{padding:12px}
  #pos #ct{max-height:none}
  #pos #ct .cart-row{
    grid-template-columns:46px minmax(0,1fr) auto;
    gap:8px !important;
    padding:9px 0 !important;
  }
  #pos .cart-photo{width:46px;height:46px}
  #pos .cart-name{font-size:12px !important}
  #pos .cart-subtotal{font-size:12px}
  #pos .cart-qty-btn,#pos .cart-remove{
    min-width:27px !important;
    min-height:27px !important;
    padding:2px 6px !important;
  }
}


/* ComercioIA 2.0 — Historial de caja */
#cash .cash-history-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--card, #fff);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}

#cash .cash-history-card:hover {
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
}

#cash .cash-history-card > summary {
  padding: 16px;
}

#cash .cash-history-card[open] > summary {
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

#cash .cash-history-card .cash-history-metrics {
  gap: 12px;
}

#cash .cash-history-card .cash-history-metric {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}

#cash .cash-history-card .cash-history-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

#cash .cash-history-card .cash-history-details {
  padding: 16px;
}

@media (max-width: 640px) {
  #cash .cash-history-card > summary {
    padding: 12px;
  }

  #cash .cash-history-card .cash-history-metric {
    padding: 9px;
  }

  #cash .cash-history-card .cash-history-metric strong {
    font-size: 14px;
  }

  #cash .cash-history-card .cash-history-details {
    padding: 12px;
  }
}


/* ComercioIA 2.0 — Historial profesional destacado */
#cash .cash-history-card {
  margin-bottom: 14px !important;
  padding: 0 !important;
  border: 1px solid #dbe4ee !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .06) !important;
}

#cash .cash-history-card > summary {
  padding: 20px !important;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border-left: 5px solid #0ea5e9;
}

#cash .cash-history-card[open] > summary {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #dbe4ee;
}

#cash .cash-history-card > summary strong {
  letter-spacing: -.2px;
}

#cash .cash-history-card > summary .badge {
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

#cash .cash-history-card > summary .grid3 {
  gap: 12px;
}

#cash .cash-history-card > summary .grid3 > div {
  padding: 13px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: rgba(255,255,255,.9);
}

#cash .cash-history-card > summary .grid3 strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  color: #0f172a;
}

#cash .cash-history-card > summary .muted {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .35px;
}

#cash .cash-history-card > summary::-webkit-details-marker {
  color: #0284c7;
}

#cash .cash-history-card[open] > div {
  padding: 20px !important;
}

@media (max-width: 640px) {
  #cash .cash-history-card > summary {
    padding: 13px !important;
  }

  #cash .cash-history-card > summary .grid3 > div {
    padding: 10px;
  }

  #cash .cash-history-card > summary .grid3 strong {
    font-size: 16px;
  }

  #cash .cash-history-card[open] > div {
    padding: 13px !important;
  }
}


/* ComercioIA 2.0 — Indicadores visuales de arqueo */
#cash .cash-history-card .success {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac;
}

#cash .cash-history-card .warning {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5;
}

#cash .cash-history-card .cash-arch-summary {
  padding: 14px;
  margin-top: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fafc;
}

#cash .cash-history-card .cash-arch-difference {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 16px;
}

@media (max-width: 640px) {
  #cash .cash-history-card .cash-arch-summary {
    padding: 10px;
  }
}


/* ComercioIA 2.0 — Diferencia del arqueo */
#cash .cash-history-card .cash-arch-difference {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 900;
}

#cash .cash-history-card .cash-diff-balanced {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

#cash .cash-history-card .cash-diff-short {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

#cash .cash-history-card .cash-diff-surplus {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}


/* ComercioIA 2.4.8 - correccion de espacios del POS */
#pos,
#pos * {
  box-sizing: border-box;
}

#pos .grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
  align-items: start !important;
  gap: 20px !important;
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}

#pos .grid > .panel {
  min-width: 0;
  max-width: 100%;
}

#pos #pg.products {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  max-height: 45vh !important;
  overflow-y: auto !important;
}

#pos #ct {
  display: block !important;
  width: 100%;
  max-width: 100%;
  max-height: 42vh;
  overflow-y: auto;
}

#pos input,
#pos select,
#pos textarea {
  max-width: 100%;
  min-width: 0;
}

#pos button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

#pos .payment-blocks {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

#pos .payment-tile {
  min-width: 0;
  width: 100%;
  white-space: normal;
}

@media (max-width: 900px) {
  #pos .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #pos .grid > .panel {
    width: 100%;
  }

  #pos #pg.products {
    max-height: 40vh !important;
  }

  #pos #ct {
    max-height: none;
  }
}

@media (max-width: 560px) {
  #pos .grid {
    gap: 14px !important;
  }

  #pos #pg.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #pos .payment-blocks {
    gap: 8px !important;
  }

  #pos .payment-tile {
    padding: 10px !important;
    min-height: 96px;
  }
}

/* Ajuste final: producto en una fila y boton a la derecha */
#pos #pg.products {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 100% !important;
}

#pos #pg.products .pos-product-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
  gap: 12px !important;
}

#pos #pg.products .pos-product-row > div:nth-child(2) {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

#pos #pg.products .pos-product-row > button {
  flex: 0 0 110px !important;
  width: 110px !important;
  margin-left: auto !important;
  white-space: nowrap !important;
}


/* ComercioIA 2.0 - ticket de venta mas legible */
#pos #ct .cart-row {
  grid-template-columns: 54px minmax(0, 1fr) auto !important;
  gap: 12px !important;
  padding: 14px 6px !important;
  align-items: center !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

#pos .cart-photo {
  width: 54px;
  height: 54px;
  border-radius: 10px;
}

#pos .cart-info {
  gap: 6px !important;
}

#pos .cart-name {
  font-size: 14px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
}

#pos .cart-unit {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

#pos .cart-controls {
  gap: 7px !important;
  margin-top: 5px !important;
}

#pos .cart-qty-btn,
#pos .cart-remove {
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 8px !important;
}

#pos .cart-qty {
  min-width: 24px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#pos .cart-subtotal {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  padding-left: 4px;
}

#pos #ct .empty {
  padding: 28px 12px !important;
  text-align: center !important;
  color: #64748b !important;
}

@media (max-width: 560px) {
  #pos #ct .cart-row {
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 12px 0 !important;
  }

  #pos .cart-photo {
    width: 46px;
    height: 46px;
  }

  #pos .cart-name {
    font-size: 13px !important;
  }

  #pos .cart-subtotal {
    font-size: 13px !important;
  }
}

/* ComercioIA — pantalla de acceso */
.login-page{min-height:100vh;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr);background:#f7faff;color:#10213d}
.login-hero{position:relative;min-height:100vh;overflow:hidden;background:#eaf4ff}
.login-hero img{position:absolute;inset:0 auto 0 0;width:170%;height:100%;max-width:none;object-fit:cover;object-position:left center}
.login-hero:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(8,30,66,.66),transparent 52%);pointer-events:none}
.login-hero-caption{position:absolute;z-index:1;left:clamp(24px,5vw,72px);right:24px;bottom:clamp(30px,6vh,70px);color:#fff;text-shadow:0 2px 14px #00152e66}
.login-hero-caption span{display:block;font-size:12px;font-weight:900;letter-spacing:3px;margin-bottom:10px}
.login-hero-caption strong{display:block;font-size:clamp(24px,3vw,42px);line-height:1.12}
.login-hero-caption p{font-size:clamp(14px,1.4vw,18px);margin:10px 0 0}
.login-area{display:grid;place-items:center;padding:clamp(22px,5vw,68px)}
.login-card{width:min(100%,440px);padding:clamp(24px,3vw,42px);background:#fff;border:1px solid #e5edf7;border-radius:24px;box-shadow:0 22px 70px #173d6d12}
.login-brand{text-align:center;font-size:32px;font-weight:950;letter-spacing:-1.4px;color:#10213d;margin-bottom:28px}
.login-brand b{color:#087cf0}
.login-kicker{text-align:center;color:#087cf0;font-size:11px;font-weight:900;letter-spacing:2px;margin:0 0 8px}
.login-card h1{text-align:center;font-size:clamp(24px,2.5vw,30px);letter-spacing:-.7px;margin:0 0 10px}
.login-description{text-align:center;color:#64748b;font-size:14px;line-height:1.6;margin:0 0 28px}
.login-card .form{gap:10px}
.login-label{font-size:13px;font-weight:750;color:#243650;margin-top:4px}
.login-card .input{min-height:48px;padding:13px 14px;border:1px solid #dce5f0;border-radius:11px;outline:none}
.login-card .input:focus{border-color:#1684f8;box-shadow:0 0 0 3px #1684f81a}
.login-options{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:3px 0 8px;font-size:12px;color:#64748b}
.login-options button{background:transparent;color:#087cf0;padding:3px 0;font-size:12px;font-weight:750}
.login-submit{width:100%;min-height:50px;border-radius:11px;background:linear-gradient(100deg,#087cf0,#27a4fa);box-shadow:0 8px 18px #087cf026;font-size:15px}
.login-secondary{width:100%;min-height:44px;background:#f1f6fc;color:#29405e;border:1px solid #e4ebf5}
.login-foot{display:flex;justify-content:center;gap:8px;align-items:center;border-top:1px solid #edf1f7;margin-top:24px;padding-top:18px;color:#718096;font-size:12px}
@media(max-width:850px){.login-page{grid-template-columns:1fr}.login-hero{min-height:210px;height:26vh;max-height:280px}.login-hero img{width:170%;height:100%}.login-hero-caption{left:24px;bottom:20px}.login-hero-caption strong{font-size:25px}.login-hero-caption p{font-size:13px;margin-top:5px}.login-area{padding:24px 16px 36px}.login-card{max-width:480px}}
@media(max-width:420px){.login-card{padding:23px 19px;border-radius:18px}.login-brand{font-size:28px;margin-bottom:22px}.login-options{align-items:flex-start}.login-options button{text-align:right}}

/* ComercioIA 2.4.9 — refinamiento visual azul intenso */
:root {
  --blue: #087cf0;
}

.login-page {
  background: #f3f8ff;
}

.login-card {
  border-color: #dbeafe;
  box-shadow: 0 24px 70px rgba(0, 70, 160, 0.13);
}

.login-brand b {
  color: #0068ed;
}

.login-kicker {
  color: #0068ed;
}

.login-options button {
  color: #0068ed;
}

.login-card .input:focus {
  border-color: #087cf0;
  box-shadow: 0 0 0 3px rgba(8, 124, 240, 0.16);
}

.login-submit {
  background: linear-gradient(110deg, #0057d9 0%, #087cf0 55%, #23a7ff 100%);
  box-shadow: 0 8px 20px rgba(0, 87, 217, 0.28);
  transition: filter .18s ease, box-shadow .18s ease, transform .18s ease;
}

.login-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 24px rgba(0, 87, 217, 0.34);
}

.login-secondary {
  border-color: #d6e6fa;
  background: #f0f6ff;
  color: #164b91;
}

.login-secondary:hover {
  background: #e4f0ff;
}

.login-foot {
  border-top-color: #e5eefb;
}

@media (prefers-reduced-motion: reduce) {
  .login-submit {
    transition: none;
  }
}

/* ComercioIA — registro flotante sobre fondo a pantalla completa */
.login-page.register-mode {
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #eaf4ff;
}

.register-mode .login-hero {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  z-index: 0;
}

.register-mode .login-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.register-mode .login-hero:after {
  background: linear-gradient(
    90deg,
    rgba(5, 35, 80, 0.08),
    rgba(5, 35, 80, 0.02) 48%,
    rgba(0, 60, 140, 0.16)
  );
}

.register-mode .login-hero-caption {
  display: none;
}

.register-mode .login-area {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(20px, 5vw, 76px);
  background: transparent;
}

.register-mode .login-card {
  width: min(100%, 450px);
  padding: clamp(26px, 3vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 80px rgba(5, 35, 80, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (max-width: 850px) {
  .register-mode .login-area {
    justify-content: center;
    padding: 22px 16px;
  }

  .register-mode .login-card {
    max-width: 460px;
  }
}

@media (max-width: 480px) {
  .register-mode .login-area {
    padding: 16px 12px;
  }

  .register-mode .login-card {
    padding: 24px 19px;
    border-radius: 20px;
  }
}

/* ComercioIA — fondo completo sin panel gris */
.login-page {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 64px);
  overflow: hidden;
  background: #075de5;
}

.login-page .login-hero {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: -1;
  overflow: hidden;
  background: #075de5;
}

.login-page .login-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.login-page .login-hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 48, 130, 0.04) 0%,
    rgba(0, 55, 140, 0.02) 48%,
    rgba(0, 55, 140, 0.18) 100%
  );
  pointer-events: none;
}

.login-page .login-hero-caption {
  display: none;
}

.login-page .login-area {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 460px);
  min-height: auto;
  padding: 0;
  margin-right: clamp(0px, 2vw, 28px);
  background: transparent;
}

.login-page .login-card {
  width: 100%;
  padding: clamp(25px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 80px rgba(0, 27, 78, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 850px) {
  .login-page {
    justify-content: center;
    padding: 22px 16px;
  }

  .login-page .login-area {
    width: min(100%, 460px);
    margin-right: 0;
  }

  .login-page .login-hero img {
    object-position: 40% center;
  }

  .login-page .login-hero:after {
    background: rgba(0, 45, 120, 0.2);
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 14px 12px;
  }

  .login-page .login-card {
    padding: 24px 19px;
    border-radius: 20px;
  }
}

/* Ajuste final: una sola capa de fondo y panel de acceso por encima */
.login-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #075de5;
}

.login-page .login-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  z-index: -1;
  pointer-events: none;
}

.login-page .login-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-page .login-area {
  position: relative;
  z-index: 2;
}

.login-page .login-card {
  position: relative;
  z-index: 3;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 80px rgba(0, 27, 78, 0.3);
}


/* ComercioIA — diseño final con fondo completo */
.login-page {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-height: 100vh !important;
  width: 100% !important;
  overflow: hidden;
  isolation: isolate;
  background: #eaf4ff !important;
}

.login-page .login-hero {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  z-index: -1 !important;
  overflow: hidden;
}

.login-page .login-hero img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
}

.login-page .login-hero:after,
.login-page .login-hero-caption {
  display: none !important;
}

.login-page .login-area {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 100% !important;
  min-height: 100vh !important;
  box-sizing: border-box !important;
  padding: 32px clamp(24px, 8vw, 130px) 32px 50% !important;
  background: transparent !important;
}

.login-page .login-card {
  position: relative !important;
  z-index: 3 !important;
  width: min(100%, 420px) !important;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-sizing: border-box !important;
  padding: clamp(24px, 3vw, 38px) !important;
  border: 1px solid rgba(255,255,255,.85) !important;
  border-radius: 24px !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: 0 24px 80px rgba(0,35,90,.22) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 760px) {
  .login-page .login-area {
    justify-content: center !important;
    padding: 24px 18px !important;
  }

  .login-page .login-card {
    width: min(100%, 420px) !important;
    max-height: calc(100vh - 32px);
    padding: 24px 20px !important;
  }

  .login-page .login-hero img {
    object-position: 35% center !important;
  }
}

/* ComercioIA: fondo fijo, sin movimiento ni efectos de cursor */
.login-page .login-hero {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

.login-page .login-hero img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
  pointer-events: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}


/* ComercioIA: panel de ingreso estable y sin desplazamientos */
.login-page .login-area {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  position: relative !important;
  transform: none !important;
  animation: none !important;
}

.login-page .login-card {
  position: relative !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
}

.login-page .login-card:hover,
.login-page .login-card:focus-within {
  transform: none !important;
  animation: none !important;
}


/* ComercioIA: panel de acceso fijo sobre el fondo */
.login-page .login-area {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 24px 8vw 24px 24px !important;
  margin: 0 !important;
  background: transparent !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  pointer-events: none !important;
}

.login-page .login-card {
  position: relative !important;
  flex: 0 1 440px !important;
  width: min(440px, 100%) !important;
  margin: 0 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  pointer-events: auto !important;
}

.login-page .login-card:hover,
.login-page .login-card:focus-within {
  transform: none !important;
  animation: none !important;
}

@media (max-width: 700px) {
  .login-page .login-area {
    justify-content: center !important;
    padding: 20px 16px !important;
    overflow-y: auto !important;
  }

  .login-page .login-card {
    flex-basis: 480px !important;
  }
}



/* COMERCIAIA_MOBILE_NAV_V1 */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Navegación fija en la parte inferior */
  .side {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: #0f172a;
    color: #fff;
    z-index: 2000;
    border-top: 1px solid #263449;
    box-shadow: 0 -6px 24px #0f172a20;
  }

  .side .logo {
    display: none;
  }

  /* Marca superior */
  .side::before {
    content: "ComercioIA";
    position: fixed;
    top: 13px;
    left: 14px;
    color: #0f172a;
    font-size: 20px;
    line-height: 36px;
    font-weight: 950;
    pointer-events: none;
  }

  .side > button.light {
    position: fixed;
    top: 10px;
    right: 12px;
    width: auto !important;
    margin: 0 !important;
    padding: 8px 11px;
    min-height: 38px;
    border-radius: 999px;
    font-size: 12px;
    z-index: 2100;
  }

  .nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto !important;
    max-width: none;
    min-height: 46px;
    margin: 0;
    padding: 10px 11px;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 12px !important;
  }

  .nav button::after {
    content: none !important;
  }

  .nav button.active {
    background: #1e293b;
    color: #fff;
  }

  #moreOptions {
    flex: 0 0 auto;
    min-width: 78px;
    padding-left: 10px;
    padding-right: 10px;
    background: #334155;
    color: #fff;
  }

  /* El contenido ocupa todo el ancho disponible */
  .main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0;
    padding: 62px 12px calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .section.active {
    min-width: 0;
  }

  .top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .top h1 {
    font-size: 23px;
    line-height: 1.25;
  }

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

  .grid,
  .grid3 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  .panel {
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
  }

  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    max-height: none;
  }

  .prod {
    min-width: 0;
    padding: 9px;
  }

  .prod img {
    max-width: 100%;
    height: 100px;
  }

  button {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Tablas desplazables en pantallas angostas */
  .panel:has(.table) {
    overflow-x: auto;
  }

  .table {
    min-width: 500px;
  }
}

@media (max-width: 380px) {
  .nav button {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 11px !important;
  }

  .prod img {
    height: 82px;
  }

  .panel {
    padding: 11px;
  }
}


/* COMERCIAIA_MOBILE_POLISH_V2 */
@media (max-width: 760px) {
  .main {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .main h1 {
    font-size: clamp(21px, 5.5vw, 29px);
    line-height: 1.15;
    letter-spacing: -0.6px;
    overflow-wrap: anywhere;
  }

  .main h2 {
    line-height: 1.2;
    letter-spacing: -0.3px;
  }

  .main p {
    line-height: 1.4;
  }

  .nav {
    display: flex;
    justify-content: space-between;
    gap: 3px;
  }

  .nav button {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 5px;
    font-size: 11px !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #moreOptions {
    flex: 0 0 48px;
    min-width: 48px;
    max-width: 48px;
    padding: 8px 3px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .panel {
    margin-bottom: 12px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.035);
  }

  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .prod {
    overflow-wrap: anywhere;
    border-radius: 14px;
  }

  .prod button {
    width: 100%;
    max-width: 100%;
  }

  #pos input,
  #pos select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  .nav button {
    font-size: 10px !important;
    padding-left: 3px;
    padding-right: 3px;
  }

  #moreOptions {
    flex-basis: 42px;
    min-width: 42px;
    max-width: 42px;
  }
}


/* COMERCIAIA_MOBILE_NAV_V3 */
@media (max-width: 760px) {
  .side {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
  }

  .side::before {
    display: none !important;
  }

  .side > button.light {
    position: absolute !important;
    top: auto !important;
    right: 8px !important;
    bottom: calc(100% + 12px) !important;
    font-size: 11px !important;
  }

  .nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
    overflow: visible !important;
    align-items: stretch !important;
  }

  .nav button {
    display: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 48px !important;
    padding: 7px 2px !important;
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    border-radius: 12px !important;
    text-align: center !important;
  }

  .nav button[data-tab="pos"],
  .nav button[data-tab="stock"],
  .nav button[data-tab="cash"],
  .nav #moreOptions {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav button[data-tab="pos"] {
    grid-column: 1;
  }

  .nav button[data-tab="stock"] {
    grid-column: 2;
  }

  .nav button[data-tab="cash"] {
    grid-column: 3;
  }

  .nav #moreOptions {
    grid-column: 4;
    flex: initial !important;
    min-width: 0 !important;
    max-width: none !important;
    background: #334155;
    color: white;
  }

  .nav.mobile-menu-open {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .nav.mobile-menu-open button.nav-extra {
    display: flex !important;
    grid-column: auto !important;
    min-height: 48px !important;
  }

  .nav.mobile-menu-open #moreOptions {
    grid-column: 1 / -1;
  }

  .main {
    padding-top: 18px !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    margin-left: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .main .top {
    padding-top: 4px;
  }
}


/* COMERCIAIA_MOBILE_MORE_V4 */
@media (max-width: 760px) {
  .nav.mobile-menu-open {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 7px !important;
  }

  .nav.mobile-menu-open button.nav-extra {
    display: flex !important;
    grid-column: auto !important;
    min-width: 0 !important;
    min-height: 56px !important;
    height: auto !important;
    padding: 8px 4px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    text-align: center !important;
    line-height: 1.25 !important;
    font-size: 12px !important;
    background: #1e293b !important;
    color: #fff !important;
    border-radius: 12px !important;
  }

  .nav.mobile-menu-open #moreOptions {
    grid-column: 1 / -1 !important;
    min-height: 42px !important;
  }

  .nav:not(.mobile-menu-open) button.nav-extra {
    display: none !important;
  }
}


/* COMERCIAIA_POS_MOBILE_POLISH_V1 */
@media (max-width: 560px) {
  #pos #pg.products .pos-product-row {
    gap: 8px !important;
    padding: 12px 0 !important;
  }

  #pos #pg.products .pos-product-row > div:first-child {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  #pos #pg.products .pos-product-row > div:first-child img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain !important;
  }

  #pos #pg.products .pos-product-row > div:nth-child(2) strong {
    display: block;
    font-size: 13px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere;
  }

  #pos #pg.products .pos-product-row .price {
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.3;
  }

  #pos #pg.products .pos-product-row > button {
    flex: 0 0 76px !important;
    width: 76px !important;
    min-height: 40px !important;
    padding: 8px 4px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  #pos #ct .cart-row {
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 12px 0 !important;
  }

  #pos .cart-photo {
    width: 40px !important;
    height: 40px !important;
  }

  #pos .cart-info {
    min-width: 0 !important;
  }

  #pos .cart-name {
    overflow-wrap: anywhere;
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  #pos .cart-controls {
    flex-wrap: wrap;
    gap: 5px !important;
  }

  #pos .cart-subtotal {
    font-size: 12px !important;
    white-space: nowrap;
    padding-left: 0 !important;
  }

  #pos #tt {
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

/* COMERCIAIA_POS_MOBILE_ORDER_V1 */
@media (max-width: 900px) {
  #pos .grid > .panel:first-child {
    order: 1 !important;
  }

  #pos .grid > .panel:last-child {
    order: 2 !important;
  }
}

/* COMERCIAIA_POS_MOBILE_COMPACT_V1 */
@media (max-width: 760px) {
  #pos .grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  #pos .grid > .panel:first-child {
    order: 1 !important;
    padding-bottom: 10px !important;
  }

  #pos .grid > .panel:last-child {
    order: 2 !important;
  }

  #pos #pg {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #pos #ct {
    max-height: none !important;
    overflow: visible !important;
  }

  #pos .panel {
    padding: 14px !important;
  }

  #pos #ct > div {
    padding: 9px 0 !important;
    gap: 8px !important;
  }

  .side > button.light {
    top: 8px !important;
    right: 8px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
  }

  .main {
    padding-top: 52px !important;
  }
}

/* COMERCIAIA_POS_MOBILE_COMPACT_V2 */
@media (max-width: 760px) {
  #pos .grid > .panel:first-child {
    padding-bottom: 8px !important;
    margin-bottom: 0 !important;
  }

  #pos .grid > .panel:first-child hr {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
  }

  #pos #pg.products {
    max-height: none !important;
    overflow: visible !important;
  }

  #pos #ct {
    margin-top: 0 !important;
  }

  .side > button.light {
    position: fixed !important;
    top: auto !important;
    right: 10px !important;
    bottom: 104px !important;
    z-index: 1001 !important;
  }

  .main {
    padding-bottom: 100px !important;
  }
}

/* COMERCIAIA_LOGOUT_IN_MORE_MENU_V1 */
@media (max-width: 760px) {
  .side > button.light {
    display: none !important;
  }

  .nav:not(.mobile-menu-open) #logoutMenuButton {
    display: none !important;
  }

  .nav.mobile-menu-open #logoutMenuButton {
    display: flex !important;
    grid-column: auto !important;
    min-height: 56px !important;
    height: auto !important;
    padding: 8px 4px !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
  }
}

/* COMERCIAIA_POS_SEARCH_ON_DEMAND_V1 */
@media (max-width: 760px) {
  #pos .grid {
    gap: 10px !important;
  }

  #pos .grid > .panel:first-child {
    padding-bottom: 8px !important;
  }

  #pos #pg:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
  }

  #pos #pg:not(:empty) {
    display: flex !important;
    flex-direction: column !important;
    max-height: 32vh !important;
    overflow-y: auto !important;
    margin-top: 8px !important;
  }

  #pos #ct {
    max-height: 38vh !important;
    overflow-y: auto !important;
  }

  #pos #ct .cart-row,
  #pos #ct > div {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    gap: 8px !important;
  }

  #pos #q,
  #pos #barcodeScanner {
    margin-bottom: 6px !important;
  }
}


/* COMERCIAIA_STOCK_AUDIT_MOBILE_BUTTONS_V1 */
@media (max-width: 760px) {
  #stock > .top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #stock > .top > div,
  #stock > .top > button {
    width: 100% !important;
    min-width: 0 !important;
  }

  #stock > .top > button {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 48px !important;
    white-space: normal !important;
  }
}

/* Movimientos de stock queda dentro de Más opciones en móvil. */

/* COMERCIOIA_STOCK_MOVEMENTS_RESPONSIVE_V1 */
@media (max-width: 560px) {
  #stockMovementsPanel {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #stockMovementsPanel > div[style*="overflow-x:auto"] {
    overflow-x: visible !important;
    max-width: 100% !important;
  }

  #stockMovementsPanel table.table {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    table-layout: fixed !important;
  }

  #stockMovementsPanel table.table thead {
    display: none !important;
  }

  #stockMovementsPanel table.table tbody tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
    padding: 8px 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #fff !important;
  }

  #stockMovementsPanel table.table tbody tr td {
    display: grid !important;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 7px 0 !important;
    border: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
    vertical-align: top !important;
  }

  #stockMovementsPanel table.table tbody tr td::before {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
  }

  #stockMovementsPanel table.table tbody tr td:nth-child(1)::before {
    content: "Fecha y hora";
  }

  #stockMovementsPanel table.table tbody tr td:nth-child(2)::before {
    content: "Producto";
  }

  #stockMovementsPanel table.table tbody tr td:nth-child(3)::before {
    content: "Tipo";
  }

  #stockMovementsPanel table.table tbody tr td:nth-child(4)::before {
    content: "Cantidad";
  }

  #stockMovementsPanel table.table tbody tr td:nth-child(5)::before {
    content: "Motivo";
  }
}

/* COMERCIOIA_STOCK_MOVEMENTS_HEADER_V1 */
@media (max-width: 560px) {
  #stockMovements {
    padding-top: 12px !important;
    scroll-margin-top: 12px !important;
  }

  #stockMovements > .top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    padding: 8px 4px !important;
  }

  #stockMovements > .top h1 {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  #stockMovements > .top .muted {
    display: block !important;
    line-height: 1.4 !important;
  }

  #stockMovements > .top button {
    align-self: flex-start !important;
    max-width: 100% !important;
  }

  #stockMovementsPanel > .row label {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #stockMovementsPanel > .row select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 42px !important;
  }

  #stockMovementsStatus {
    margin-top: 12px !important;
    margin-bottom: 10px !important;
  }
}

/* COMERCIAIA_STOCK_MOVEMENTS_HEADER_V1 */
@media (max-width: 560px) {
  #stockMovements {
    padding-top: 12px !important;
    scroll-margin-top: 12px !important;
  }

  #stockMovements > .top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    padding: 8px 4px !important;
  }

  #stockMovements > .top h1 {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  #stockMovements > .top .muted {
    display: block !important;
    line-height: 1.4 !important;
  }

  #stockMovements > .top button {
    align-self: flex-start !important;
    max-width: 100% !important;
  }

  #stockMovementsPanel > .row label {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #stockMovementsPanel > .row select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 42px !important;
  }

  #stockMovementsStatus {
    margin-top: 12px !important;
    margin-bottom: 10px !important;
  }
}

/* COMERCIAIA_MOBILE_NAV_UNIFICADA_V1 */
@media (max-width: 760px) {
  .nav:not(.mobile-menu-open) {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-items: stretch !important;
  }

  .nav:not(.mobile-menu-open) button.nav-extra {
    display: none !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="pos"],
  .nav:not(.mobile-menu-open) button[data-tab="stock"],
  .nav:not(.mobile-menu-open) button[data-tab="cash"],
  .nav:not(.mobile-menu-open) > button#moreOptions {
    display: flex !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 6px 2px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    font-size: 11px !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="pos"] {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="stock"] {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="cash"] {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .nav:not(.mobile-menu-open) > button#moreOptions {
    grid-column: 4 !important;
    grid-row: 1 !important;
  }

  .nav:not(.mobile-menu-open) button:after,
  .nav.mobile-menu-open button:after {
    content: none !important;
  }

  .nav.mobile-menu-open {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-items: stretch !important;
  }

  .nav.mobile-menu-open button[data-tab="pos"] {
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .nav.mobile-menu-open button[data-tab="stock"] {
    display: flex !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .nav.mobile-menu-open button[data-tab="cash"] {
    display: flex !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .nav.mobile-menu-open button.nav-extra {
    display: flex !important;
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 8px 5px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    font-size: 12px !important;
  }

  .nav.mobile-menu-open > button#moreOptions {
    display: flex !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: center !important;
  }
}


/* COMERCIAIA_MOBILE_MENU_HEIGHT_FIX_V1 */
@media (max-width: 760px) {
  .side:has(.nav.mobile-menu-open) {
    max-height: 42dvh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  .nav.mobile-menu-open {
    max-height: 40dvh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    align-content: start !important;
    padding-bottom: 4px !important;
  }

  .nav.mobile-menu-open > button#moreOptions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 2 !important;
    background: #334155 !important;
  }
}


/* COMERCIAIA_MOBILE_MENU_DRAWER_V1 */
#mobileMorePanel[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .side {
    overflow: visible !important;
    max-height: none !important;
  }

  .side.mobile-more-open {
    z-index: 2200 !important;
  }

  #mobileMorePanel {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    max-height: min(62dvh, 520px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #334155 !important;
    border-radius: 18px !important;
    background: #0f172a !important;
    color: #fff !important;
    box-shadow: 0 12px 36px #0005 !important;
    z-index: 2201 !important;
  }

  .mobile-more-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #fff !important;
  }

  .mobile-more-close {
    flex: 0 0 auto !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #334155 !important;
    color: #fff !important;
    font-size: 12px !important;
  }

  .mobile-more-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #mobileMorePanel .nav-extra,
  #mobileMorePanel .mobile-more-logout {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 7px !important;
    margin: 0 !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    background: #1e293b !important;
    color: #fff !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2 !important;
    font-size: 12px !important;
  }

  #mobileMorePanel .nav-extra.active {
    border-color: #38bdf8 !important;
    background: #164e63 !important;
  }

  #mobileMorePanel .mobile-more-logout {
    margin-top: 10px !important;
    background: #334155 !important;
  }

  .nav:not(.mobile-menu-open) {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .nav:not(.mobile-menu-open) button.nav-extra {
    display: none !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="pos"],
  .nav:not(.mobile-menu-open) button[data-tab="stock"],
  .nav:not(.mobile-menu-open) button[data-tab="cash"],
  .nav:not(.mobile-menu-open) > button#moreOptions {
    display: flex !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 5px 2px !important;
    margin: 0 !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 11px !important;
  }

  .nav:not(.mobile-menu-open) button[data-tab="pos"] { grid-column: 1 !important; }
  .nav:not(.mobile-menu-open) button[data-tab="stock"] { grid-column: 2 !important; }
  .nav:not(.mobile-menu-open) button[data-tab="cash"] { grid-column: 3 !important; }
  .nav:not(.mobile-menu-open) > button#moreOptions { grid-column: 4 !important; }

  .nav.mobile-menu-open {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .nav.mobile-menu-open button.nav-extra,
  .nav.mobile-menu-open > button#moreOptions {
    display: none !important;
  }

  .main {
    padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 761px) {
  #mobileMorePanel {
    display: none !important;
  }
}


/* COMERCIAIA_MOBILE_MENU_COLOR_V1 */
@media (max-width: 760px) {
  #mobileMorePanel {
    background: #2457A7 !important;
    border-color: #5B8FE0 !important;
    color: #FFFFFF !important;
  }

  #mobileMorePanel .mobile-more-heading {
    color: #FFFFFF !important;
  }

  #mobileMorePanel .nav-extra {
    background: #3268B8 !important;
    border-color: #6F9BDD !important;
    color: #FFFFFF !important;
  }

  #mobileMorePanel .mobile-more-close {
    background: #DBEAFE !important;
    color: #17365F !important;
  }

  #mobileMorePanel .mobile-more-logout {
    background: #D6E6FF !important;
    color: #17365F !important;
  }

  /* Evita mostrar dos botones para cerrar el menú */
  .side.mobile-more-open #moreOptions {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


/* COMERCIAIA_MOBILE_MENU_HEIGHT_V1 */
@media (max-width: 760px) {
  #mobileMorePanel:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(
      calc(100dvh - 110px - env(safe-area-inset-bottom)),
      520px
    ) !important;
    overflow: hidden !important;
  }

  #mobileMorePanel .mobile-more-heading {
    flex: 0 0 auto !important;
  }

  #mobileMorePanel .mobile-more-grid {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
  }

  #mobileMorePanel .mobile-more-logout {
    flex: 0 0 auto !important;
    margin-top: 10px !important;
  }
}



/* ComercioIA: carrito persistente y modal de cobro */
#pos .cia-cart-total{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:14px;padding:16px;border:1px solid #cbd5e1;border-radius:14px;
  background:#f8fafc;color:#0f172a;font-weight:800
}
#pos .cia-cart-total strong{font-size:clamp(24px,3vw,34px);color:#0f766e}
#pos .cia-payment-overlay{
  position:fixed;inset:0;z-index:10000;background:rgba(15,23,42,.62);
  display:flex;align-items:center;justify-content:center;padding:16px;
  overflow-y:auto;overscroll-behavior:contain
}
#pos .cia-payment-overlay[style*="display: none"]{display:none!important}
#pos .cia-payment-modal{
  width:min(620px,100%);max-width:620px;max-height:calc(100vh - 32px);
  overflow-y:auto;margin:auto;border-radius:20px;padding:22px;
  box-shadow:0 24px 80px rgba(0,0,0,.28);flex:0 0 auto
}
#pos .cia-payment-modal #paymentMethodsPanel{display:block}
#pos .cia-payment-modal #tt{font-size:34px!important}
@media(max-width:560px){
  #pos .cia-payment-overlay{padding:10px;align-items:center}
  #pos .cia-payment-modal{padding:16px;max-height:calc(100dvh - 20px);border-radius:16px}
  #pos .cia-cart-total{padding:12px}
}


/* CIA_POS_FULLWIDTH_PRINT_V1 */
@media (min-width: 761px) {
  #pos .grid {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    max-width:none !important;
    margin-inline:0 !important;
  }
  #pos .grid > .panel:first-child {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }
}
#pos #printCurrentTicketModal {
  min-height:44px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  font-weight:700;
}

/* CIA_DESKTOP_MORE_MENU_V1 */
@media (min-width: 761px) {
  #mobileMorePanel:not([hidden]) {
    display:flex !important;
    flex-direction:column !important;
    position:fixed !important;
    left:250px !important;
    top:100px !important;
    width:min(360px, calc(100vw - 280px)) !important;
    max-height:calc(100vh - 130px) !important;
    overflow:hidden !important;
    padding:14px !important;
    box-sizing:border-box !important;
    border:1px solid #334155 !important;
    border-radius:16px !important;
    background:#0f172a !important;
    color:#fff !important;
    box-shadow:0 12px 36px #0005 !important;
    z-index:10001 !important;
  }
  #mobileMorePanel .mobile-more-heading {
    display:flex !important;
    justify-content:space-between !important;
    align-items:center !important;
    gap:8px !important;
    margin-bottom:12px !important;
    font-weight:800 !important;
  }
  #mobileMorePanel .mobile-more-grid {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
    min-height:0 !important;
    overflow-y:auto !important;
  }
  #mobileMorePanel .nav-extra {
    display:flex !important;
    min-width:0 !important;
    min-height:44px !important;
    justify-content:center !important;
    align-items:center !important;
    padding:8px !important;
    border-radius:10px !important;
    background:#1e293b !important;
    color:#fff !important;
    white-space:normal !important;
    text-align:center !important;
  }
  #mobileMorePanel .mobile-more-logout,
  #mobileMorePanel .mobile-more-close {
    display:block !important;
    margin-top:10px !important;
  }
}


/* CIA_UI_REPAIR_V2: menú, teclado y carrito compacto */
#mobileMorePanel:not([hidden]) {
  position:fixed !important;
  z-index:30000 !important;
  box-sizing:border-box !important;
  max-width:calc(100vw - 24px) !important;
  max-height:calc(100vh - 130px) !important;
  overflow:hidden !important;
  isolation:isolate !important;
}
@media (min-width:761px) {
  #mobileMorePanel:not([hidden]) {
    left:clamp(230px, 22vw, 300px) !important;
    top:100px !important;
    width:min(380px, calc(100vw - 260px)) !important;
    z-index:30000 !important;
  }
}
#mobileMorePanel .mobile-more-grid {
  overflow-y:auto !important;
  min-height:0 !important;
}
#pos .cia-payment-overlay {
  z-index:20000 !important;
}
#pos .cia-payment-modal #paymentMethodsPanel {
  display:block !important;
}
#pos #paymentMethodsPanel #printCurrentTicketModal {
  display:block !important;
  width:100% !important;
  min-height:44px !important;
  margin:0 0 12px !important;
  visibility:visible !important;
  opacity:1 !important;
}
#pos .payment-tile:focus-visible {
  outline:3px solid #2563eb !important;
  outline-offset:2px !important;
}
#pos #ct .cart-row {
  grid-template-columns:44px minmax(0,1fr) auto !important;
  gap:8px !important;
  padding:6px 0 !important;
  min-height:0 !important;
  align-items:center !important;
}
#pos #ct .cart-photo {
  width:40px !important;
  height:40px !important;
  min-width:40px !important;
}
#pos #ct .cart-info {
  min-width:0 !important;
  gap:2px !important;
}
#pos #ct .cart-name {
  font-size:13px !important;
  line-height:1.2 !important;
}
#pos #ct .cart-unit {
  font-size:11px !important;
  line-height:1.2 !important;
}
#pos #ct .cart-controls {
  display:flex !important;
  align-items:center !important;
  gap:4px !important;
  margin-top:3px !important;
}
#pos #ct .cart-qty-btn,
#pos #ct .cart-remove {
  min-width:27px !important;
  min-height:27px !important;
  padding:3px 6px !important;
}
#pos #ct .cart-qty {
  min-width:20px !important;
  font-size:12px !important;
}
#pos #ct .cart-subtotal {
  font-size:12px !important;
  white-space:nowrap !important;
  padding-left:0 !important;
}


/* CIA_MENU_MODAL_COMPACT_V2 */
@media (min-width:761px) {
  .side {
    position:relative !important;
    overflow:visible !important;
    z-index:100 !important;
  }
  #mobileMorePanel:not([hidden]) {
    position:absolute !important;
    top:100% !important;
    left:8px !important;
    right:8px !important;
    width:auto !important;
    max-width:none !important;
    max-height:calc(100vh - 180px) !important;
    overflow:hidden !important;
    z-index:101 !important;
    box-sizing:border-box !important;
  }
  #mobileMorePanel .mobile-more-grid {
    grid-template-columns:1fr !important;
    max-height:calc(100vh - 280px) !important;
    overflow-y:auto !important;
  }
}
#pos .cia-payment-overlay {
  align-items:flex-start !important;
  padding:8px !important;
  overflow-y:auto !important;
}
#pos .cia-payment-modal {
  width:min(520px,100%) !important;
  max-width:520px !important;
  max-height:calc(100dvh - 16px) !important;
  overflow-y:auto !important;
  padding:12px !important;
  margin:auto !important;
}
#pos .cia-payment-modal .payment-tile {
  min-height:68px !important;
  padding:8px !important;
}
#pos .cia-payment-modal #printCurrentTicketModal {
  min-height:36px !important;
  margin-bottom:6px !important;
}
#pos .cia-payment-modal button[onclick="checkout()"] {
  min-height:44px !important;
  margin-top:8px !important;
}
#pos .cia-payment-modal .panel {
  padding:10px !important;
}


/* CIA_FINAL_LAYOUT_KEYBOARD_V1 */
#mobileMorePanel[hidden] {
  display: none !important;
}

@media (min-width: 761px) {
  #mobileMorePanel:not([hidden]) {
    position: fixed !important;
    top: 100px !important;
    left: clamp(230px, 22vw, 300px) !important;
    right: auto !important;
    bottom: auto !important;
    width: min(360px, calc(100vw - 250px)) !important;
    max-width: calc(100vw - 250px) !important;
    max-height: calc(100vh - 125px) !important;
    overflow-y: auto !important;
    z-index: 30000 !important;
    display: block !important;
    box-sizing: border-box !important;
  }
}

#pos .grid {
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

#pos .grid > .panel:first-child {
  order: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#pos .cia-payment-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 20000 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
  overflow-y: auto !important;
}

#pos .cia-payment-modal {
  width: min(500px, calc(100vw - 24px)) !important;
  max-width: 500px !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-y: auto !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

#pos .cia-payment-modal .payment-tile:focus,
#pos .cia-payment-modal .payment-tile:focus-visible {
  outline: 3px solid #2563eb !important;
  outline-offset: 2px !important;
}


/* CIA_LAYOUT_FINAL_V2: carrito ancho y menu dentro de la barra lateral */
@media (min-width: 761px) {
  #mobileMorePanel:not([hidden]) {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 300px) !important;
    margin: 8px 0 0 !important;
    padding: 10px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    display: block !important;
    border-radius: 14px !important;
  }

  .side.mobile-more-open {
    overflow-y: auto !important;
  }

  #pos .grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  #pos .grid > .panel:first-child {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}


/* CIA_MORE_INLINE_DROPDOWN_V1 */
/* Menú Más desplegable dentro de la barra lateral */
@media (min-width: 761px) {
  .side {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: visible !important;
    z-index: 20 !important;
  }

  .side #mobileMorePanel:not([hidden]) {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(48vh, 420px) !important;
    margin: 6px 0 10px !important;
    padding: 8px !important;
    display: block !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  .side #mobileMorePanel .mobile-more-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    font-size: 13px !important;
    padding: 4px !important;
  }

  .side #mobileMorePanel .mobile-more-close {
    font-size: 12px !important;
    padding: 5px 8px !important;
    white-space: nowrap !important;
  }

  .side #mobileMorePanel .mobile-more-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .side #mobileMorePanel .mobile-more-grid > button {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 9px 7px !important;
    text-align: left !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
  }

  .side #mobileMorePanel .mobile-more-logout {
    width: 100% !important;
    margin-top: 7px !important;
    padding: 8px !important;
    font-size: 12px !important;
  }

  #pos .grid {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }
}


/* CIA_LAYOUT_UNIFICADO_V1 */
@media (min-width: 761px) {
  /* Mantener la barra lateral estable y el desplegable dentro de ella */
  .side {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: visible !important;
    z-index: 20 !important;
    flex-shrink: 0 !important;
  }

  .side #mobileMorePanel[hidden] {
    display: none !important;
  }

  .side #mobileMorePanel:not([hidden]) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 42vh !important;
    flex: 0 1 auto !important;
    margin: 6px 0 10px !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  .side #mobileMorePanel .mobile-more-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .side #mobileMorePanel .mobile-more-grid > button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* El área de trabajo usa el ancho que queda junto a la barra lateral */
  .main {
    min-width: 0 !important;
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  #pos {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #pos .grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #pos .grid > .panel:first-child {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #pos #ct {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* CIA_DISTRIBUCION_FINAL_V1 */
@media (min-width: 761px) {
  .shell {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
  }

  .shell > .side {
    flex: 0 0 230px !important;
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    height: 100vh !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .shell > .main {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
  }

  #pos {
    
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #pos .grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #pos .grid > .panel:first-child {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #pos #ct {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .side #mobileMorePanel[hidden] {
    display: none !important;
  }

  .side #mobileMorePanel:not([hidden]) {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 45vh !important;
    margin: 6px 0 10px !important;
    padding: 7px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .side #mobileMorePanel .mobile-more-heading {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 5px !important;
    font-size: 12px !important;
  }

  .side #mobileMorePanel .mobile-more-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .side #mobileMorePanel .mobile-more-grid > button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  .side #mobileMorePanel .mobile-more-logout {
    width: 100% !important;
    margin-top: 6px !important;
    font-size: 12px !important;
  }
}


/* CIA_MORE_TRUE_DROPDOWN_V2 */
@media (min-width: 761px) {
  .shell > .side {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: block !important;
    z-index: 2000 !important;
  }

  .shell > .main {
    margin-left: 230px !important;
    width: calc(100% - 230px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .side #mobileMorePanel[hidden] {
    display: none !important;
  }

  .side #mobileMorePanel:not([hidden]) {
    position: absolute !important;
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    width: calc(100% - 16px) !important;
    max-width: none !important;
    max-height: min(55vh, 440px) !important;
    margin: 6px 0 12px !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: block !important;
    box-sizing: border-box !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    background: #0f172a !important;
    z-index: 2001 !important;
  }

  .side #mobileMorePanel .mobile-more-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .side #mobileMorePanel .mobile-more-grid > button {
    width: 100% !important;
    margin: 0 !important;
    padding: 8px !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  #pos .grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  #pos .grid > .panel:first-child {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}


/* CIA_MENU_FIXED_ALL_MODULES_V1 */
@media (min-width: 761px) {
  .shell > .side {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    display: block !important;
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 14px 10px !important;
    box-sizing: border-box !important;
    z-index: 2000 !important;
  }

  .side .nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
  }

  .side .nav > button {
    display: block !important;
    width: 100% !important;
    margin: 2px 0 !important;
    padding: 9px 8px !important;
    text-align: left !important;
    white-space: normal !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    box-sizing: border-box !important;
  }

  .side .nav > #moreOptions,
  .side #mobileMorePanel {
    display: none !important;
  }

  .side .nav > .nav-logout {
    margin-top: 10px !important;
    background: #dbeafe !important;
    color: #17365f !important;
  }

  .shell > .main {
    margin-left: 230px !important;
    width: calc(100% - 230px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #pos, #pos .grid, #pos .grid > .panel:first-child {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #pos .grid {
    display: block !important;
    margin: 0 !important;
  }
}


/* CIA_PAYMENT_COMPACT_FIT_V1 */
#pos .cia-payment-overlay {
  padding: 8px !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

#pos .cia-payment-modal {
  width: min(460px, calc(100vw - 20px)) !important;
  max-width: 460px !important;
  max-height: calc(100vh - 16px) !important;
  max-height: calc(100dvh - 16px) !important;
  overflow-y: auto !important;
  padding: 12px !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

#pos .cia-payment-modal h2 {
  margin-bottom: 7px !important;
  font-size: 19px !important;
}

#pos .cia-payment-modal button {
  padding: 8px 10px !important;
}

#pos .cia-payment-modal label {
  margin-top: 5px !important;
  margin-bottom: 3px !important;
}

#pos .cia-payment-modal input,
#pos .cia-payment-modal select {
  min-height: 36px !important;
  padding: 7px 9px !important;
}

#pos .cia-payment-modal .payment-tile {
  min-height: 66px !important;
  padding: 8px !important;
}

#pos .cia-payment-modal #fase1CashReceived {
  min-height: 38px !important;
}

@media (max-height: 800px) {
  #pos .cia-payment-modal {
    padding: 9px !important;
  }

  #pos .cia-payment-modal .payment-tile {
    min-height: 54px !important;
    padding: 6px !important;
  }

  #pos .cia-payment-modal h2 {
    font-size: 17px !important;
  }
}


/* CIA_POS_PANEL_SCROLL_FIX_V1 */
@media (min-width: 761px) {
  #pos .grid > .panel:nth-child(2),
  #pos .grid > .panel:last-child {
    position: static !important;
    top: auto !important;
    align-self: start !important;
  }
}


/* CIA_POS_DESKTOP_NO_STICKY_V2 */
@media screen and (min-width: 761px) {
  #pos .grid > .panel,
  #pos .grid > .panel:first-child,
  #pos .grid > .panel:last-child,
  #pos .grid > .panel:nth-child(2) {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    align-self: start !important;
  }

  #pos .grid,
  #pos .grid > .panel {
    overflow: visible !important;
  }
}


/* COMERCIOIA_STOCK_AUDIT_DESIGN_V1 */

.stock-audit-launch:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
#stockAuditModal {
  padding: clamp(8px, 2vw, 24px);
  align-items: center;
}
#stockAuditModal > .modal {
  width: min(1120px, 96vw) !important;
  max-width: 1120px !important;
  max-height: 94vh !important;
  padding: clamp(14px, 2.5vw, 28px) !important;
  border: 1px solid #e2e8f0;
  border-radius: 22px !important;
  background: #f8fafc;
  box-shadow: 0 24px 80px #02061735;
  overscroll-behavior: contain;
  overflow-y: auto;
}
#stockAuditModal .between { gap: 12px; }
#stockAuditModal h2 {
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
#stockAuditModal h3 {
  color: #1e293b;
  margin-top: 0;
  margin-bottom: 12px;
}
#stockAuditModal .panel {
  margin: 14px 0 !important;
  padding: clamp(13px, 2vw, 20px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 12px #0f172a08;
}
#stockAuditModal button {
  min-height: 40px;
  transition: filter .15s ease, transform .15s ease;
}
#stockAuditModal button:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}
#stockAuditModal .input {
  min-height: 44px;
  border-color: #cbd5e1;
}
#stockAuditModal .input:focus {
  outline: 3px solid #38bdf833;
  border-color: #0284c7;
}
#stockAuditModal table { min-width: 560px; }
#stockAuditModal .table th {
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
#stockAuditModal .table td,
#stockAuditModal .table th {
  border-bottom-color: #e2e8f0;
}
#stockAuditModal .table tbody tr:hover { background: #f8fafc; }
#stockAuditModal .badge { white-space: nowrap; }

@media (max-width: 640px) {
  #stockAuditModal {
    padding: 6px;
    align-items: flex-start;
  }
  #stockAuditModal > .modal {
    width: 100% !important;
    max-width: none !important;
    max-height: 96vh !important;
    padding: 13px !important;
    border-radius: 16px !important;
  }
  #stockAuditModal .between { align-items: flex-start; }
  #stockAuditModal .panel {
    padding: 12px;
    border-radius: 13px;
  }
  #stockAuditModal button { min-height: 42px; }
  #stockAuditModal .table td,
  #stockAuditModal .table th {
    padding: 9px 7px;
    font-size: 12px;
  }
}


/* COMERCIOIA_GLOBAL_BRAND_V1 */
/* Identidad visual global: azul eléctrico + turquesa */
:root {
  --bg: #f1f5fb;
  --card: #ffffff;
  --ink: #17233b;
  --muted: #64748b;
  --line: #dce5f0;
  --nav: #101a30;
  --blue: #2563eb;
  --green: #0d9488;
  --cia-blue: #2563eb;
  --cia-blue-dark: #1d4ed8;
  --cia-teal: #0d9488;
  --cia-teal-light: #ccfbf1;
  --cia-bg-soft: #eff6ff;
  --cia-shadow: 0 8px 24px rgba(15, 35, 75, .07);
}

/* Fondo y tipografía */
html {
  color-scheme: light;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  color: #152544;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
h1 { font-weight: 800; }
h2, h3 { font-weight: 750; }
p, .muted, small {
  line-height: 1.55;
}
.muted, small {
  color: var(--muted);
}

/* Paneles y tarjetas */
.panel, .card, .stat-card, .metric-card {
  border-color: var(--line);
  box-shadow: var(--cia-shadow);
}
.panel {
  border-radius: 16px;
}
.card, .stat-card, .metric-card {
  border-radius: 18px;
}
.panel h2, .panel h3,
.card h2, .card h3 {
  color: #1e3154;
}

/* Botones y acciones */
button, .btn {
  border-radius: 10px;
  font-weight: 650;
  transition: background-color .16s ease, border-color .16s ease,
              box-shadow .16s ease, transform .16s ease;
}
button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgba(13, 148, 136, .35);
  outline-offset: 2px;
}
.primary, button.primary, .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .18);
}
.primary:hover, button.primary:hover, .btn-primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .24);
}
button.light, .light, .btn-light {
  background: #fff;
  border-color: #d5e1ef;
  color: #244066;
}
button.light:hover, .light:hover, .btn-light:hover {
  background: #eff6ff;
  border-color: #93b4f5;
}
button:disabled, .btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

/* Campos de formularios */
input, select, textarea, .input {
  border-color: #cbd8e8;
  border-radius: 10px;
  color: #17233b;
}
input:focus, select:focus, textarea:focus, .input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .12);
}
input::placeholder, textarea::placeholder {
  color: #94a3b8;
}

/* Tablas */
.table {
  border-color: var(--line);
}
.table th {
  background: #edf4ff;
  color: #29446d;
  font-weight: 750;
}
.table td, .table th {
  border-bottom-color: #e2eaf4;
}
.table tbody tr:hover {
  background: #f4f9ff;
}

/* Navegación: conserva la identidad oscura */
.nav, .sidebar, .app-sidebar, #sidebar, .side-nav {
  scrollbar-color: #475569 transparent;
}
.sidebar, .app-sidebar, #sidebar, .side-nav {
  background-color: #101a30;
}
.nav a, .sidebar a, .app-sidebar a, #sidebar a, .side-nav a {
  transition: background-color .16s ease, color .16s ease;
}
.nav a:hover, .sidebar a:hover, .app-sidebar a:hover,
#sidebar a:hover, .side-nav a:hover {
  background-color: rgba(45, 212, 191, .10);
}

/* Indicadores turquesa y estados */
a {
  text-underline-offset: 3px;
}
.badge, .status-badge {
  font-weight: 700;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* Lectura cómoda en pantallas pequeñas */
@media (max-width: 640px) {
  body {
    -webkit-text-size-adjust: 100%;
  }
  h1 { letter-spacing: -0.02em; }
  .panel { border-radius: 14px; }
  input, select, textarea, .input {
    font-size: 16px;
  }
}


/* COMERCIOIA_GLOBAL_THEME_V1 */
:root{
  --bg:#f1f5fb;
  --card:#ffffff;
  --ink:#17233b;
  --muted:#64748b;
  --line:#dce5f0;
  --nav:#101a30;
  --blue:#2563eb;
  --green:#0d9488;
  --cia-blue:#2563eb;
  --cia-blue-dark:#1d4ed8;
  --cia-teal:#0d9488;
  --cia-teal-light:#ccfbf1;
  --cia-bg-soft:#eff6ff;
  --cia-shadow:0 8px 24px rgba(15,35,75,.07);
}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
h1,h2,h3,h4{color:var(--ink);letter-spacing:-.025em}
h1{font-weight:800}
h2{font-weight:750}
.panel{
  background:var(--card);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--cia-shadow);
}
.primary{
  background:linear-gradient(135deg,var(--blue),var(--cia-teal));
  color:#fff;
  border:0;
  box-shadow:0 4px 12px color-mix(in srgb,var(--blue) 18%,transparent);
}
.primary:hover{filter:brightness(1.04);transform:translateY(-1px)}
.input,select,textarea{
  border-color:var(--line);
  border-radius:10px;
}
.input:focus,select:focus,textarea:focus{
  outline:3px solid color-mix(in srgb,var(--blue) 18%,transparent);
  border-color:var(--blue);
}
.table th{background:var(--cia-bg-soft);color:var(--ink)}
.table td,.table th{border-bottom-color:var(--line)}
.side{background:var(--nav)}
.side .logo b{color:var(--cia-teal)}
.cia-appearance-panel{
  margin:16px 0!important;
  padding:clamp(16px,2.5vw,26px)!important;
  border-top:3px solid var(--cia-teal);
}
.cia-appearance-heading{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.cia-appearance-icon{
  display:grid;place-items:center;flex:0 0 48px;height:48px;
  border-radius:15px;background:linear-gradient(135deg,var(--blue),var(--cia-teal));
  color:#fff;font-size:25px;box-shadow:var(--cia-shadow)
}
.cia-appearance-heading h2{margin:0 0 6px}
.cia-appearance-heading p{margin:0;line-height:1.5}
.cia-appearance-label{font-size:15px;margin:20px 0 12px}
.cia-palette-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cia-palette{
  display:flex;flex-direction:column;align-items:flex-start;gap:7px;
  padding:14px!important;min-width:0;text-align:left;
  background:var(--card);border:1px solid var(--line);border-radius:13px;
  color:var(--ink);cursor:pointer
}
.cia-palette:hover{border-color:var(--blue);background:var(--cia-bg-soft)}
.cia-palette strong{font-size:14px}
.cia-palette small{font-size:12px;color:var(--muted)}
.cia-swatches{display:flex;gap:6px;width:100%;margin-bottom:4px}
.cia-swatches i{display:block;width:29px;height:23px;border-radius:7px}
.cia-color-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cia-color-field{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px;border:1px solid var(--line);border-radius:12px;
  background:var(--bg);font-weight:600;font-size:14px
}
.cia-color-field input{width:48px;height:38px;padding:3px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer}
.cia-appearance-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.cia-appearance-actions button{min-height:42px}
.cia-appearance-note{font-size:12px;color:var(--muted);margin:14px 0 0;line-height:1.5}
@media(max-width:640px){
  .cia-appearance-heading{align-items:flex-start}
  .cia-appearance-icon{flex-basis:42px;height:42px}
  .cia-palette-grid{grid-template-columns:1fr}
  .cia-palette{display:grid;grid-template-columns:65px 1fr;column-gap:10px;align-items:center}
  .cia-swatches{grid-row:span 2;margin:0}
  .cia-swatches i{width:25px;height:30px}
  .cia-color-controls{grid-template-columns:1fr}
  .cia-appearance-actions{flex-direction:column}
  .cia-appearance-actions button{width:100%}
}


/* COMERCIAIA_THEME_MODULE_GRADIENTS_V1 */
:root{
  --cia-page-tint:#f4f7fc;
  --cia-line-active:#dce5f0;
}
body{background:var(--cia-page-tint)}
.section.active{
  background:
    radial-gradient(ellipse at 0% 0%,
      color-mix(in srgb,var(--blue) 10%,transparent),transparent 55%),
    linear-gradient(135deg,
      color-mix(in srgb,var(--blue) 3%,#f7f9fd),
      color-mix(in srgb,var(--cia-teal) 5%,#f7f9fd));
  border:1px solid var(--cia-line-active);
  border-radius:20px;
  padding:clamp(10px,1.5vw,18px);
  box-sizing:border-box;
}
.section.active > .top{
  background:linear-gradient(110deg,
    color-mix(in srgb,var(--blue) 11%,#ffffff),
    color-mix(in srgb,var(--cia-teal) 10%,#ffffff));
  border:1px solid var(--cia-line-active);
  border-radius:16px;
  padding:16px 18px;
  margin-bottom:16px;
}
.section.active > .top h1{
  color:var(--ink);
  font-weight:800;
  letter-spacing:-.035em;
}
.section.active > .top .muted{color:var(--muted)}
.section.active .panel{
  border-color:var(--cia-line-active);
  box-shadow:0 8px 24px rgba(22,40,75,.065);
}
.section.active .panel h2,
.section.active .panel h3{
  font-weight:750;
  letter-spacing:-.02em;
}
.section.active .primary{
  background:linear-gradient(120deg,var(--blue),var(--cia-teal));
  color:#fff;
  border-color:transparent;
}
.section.active .primary:focus-visible,
.section.active button:focus-visible{
  outline:3px solid color-mix(in srgb,var(--blue) 35%,transparent);
  outline-offset:2px;
}
/* Tonos suaves por módulo: todos responden a la paleta elegida. */
#pos.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--blue) 7%,#f7f9fd),
    color-mix(in srgb,var(--cia-teal) 7%,#f7f9fd));
}
#stock.section.active,
#stockMovements.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--blue) 8%,#f7f9fd),
    color-mix(in srgb,var(--cia-teal) 9%,#f7f9fd));
}
#cash.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--cia-teal) 9%,#f7f9fd),
    color-mix(in srgb,var(--blue) 5%,#f7f9fd));
}
#reports.section.active,
#dashboard.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--blue) 8%,#f7f9fd),
    color-mix(in srgb,var(--cia-teal) 5%,#f7f9fd));
}
#customers.section.active,
#suppliers.section.active,
#purchases.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--cia-teal) 7%,#f7f9fd),
    color-mix(in srgb,var(--blue) 5%,#f7f9fd));
}
#billing.section.active,
#catalog.section.active,
#onlineOrders.section.active,
#ai.section.active,
#settings.section.active{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--blue) 6%,#f7f9fd),
    color-mix(in srgb,var(--cia-teal) 7%,#f7f9fd));
}
/* Mantener legibles las ventanas emergentes y la auditoría. */
.modal-back{backdrop-filter:blur(5px)}
#stockAuditModal > .modal{
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--blue) 5%,#ffffff),
    color-mix(in srgb,var(--cia-teal) 5%,#ffffff)) !important;
  border-color:var(--cia-line-active);
}
#stockAuditModal .panel{background:#ffffff}
@media(max-width:640px){
  .section.active{padding:8px;border-radius:14px}
  .section.active > .top{padding:12px;border-radius:12px}
}


/* COMERCIOIA_STOCK_HEADER_ALIGNMENT_V1 */
#stock.section.active > .top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
#stock .stock-header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
  flex-wrap:wrap;
}
#stock .stock-header-actions button{
  margin:0;
  white-space:nowrap;
}
#stock .stock-audit-launch,
#stock .stock-product-launch{
  background:linear-gradient(120deg,var(--blue),var(--cia-teal)) !important;
  color:#fff !important;
  border:1px solid transparent;
  box-shadow:0 4px 12px color-mix(in srgb,var(--blue) 18%,transparent);
}
#stock .stock-audit-launch:hover,
#stock .stock-product-launch:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
}
@media(max-width:760px){
  #stock.section.active > .top{
    align-items:stretch;
    flex-direction:column;
    gap:14px;
  }
  #stock .stock-header-actions{
    width:100%;
    justify-content:flex-start;
  }
  #stock .stock-header-actions button{
    flex:1 1 auto;
  }
}
@media(max-width:420px){
  #stock .stock-header-actions{
    flex-direction:column;
    align-items:stretch;
  }
  #stock .stock-header-actions button{width:100%}
}


/* COMERCIOIA_TYPOGRAPHY_V1 */
body{
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{
  color:var(--ink);
  line-height:1.25;
  letter-spacing:-.025em;
}
.section.active > .top h1{
  font-size:clamp(24px,2.1vw,30px);
  font-weight:800;
  letter-spacing:-.04em;
  line-height:1.2;
}
.section.active .panel h2{
  font-size:18px;
  font-weight:750;
  line-height:1.3;
  letter-spacing:-.025em;
}
.section.active .panel h3{
  font-size:16px;
  font-weight:700;
  line-height:1.35;
}
.section.active .muted{
  color:#53647b;
  line-height:1.55;
}
.section.active p,
.section.active label,
.section.active input,
.section.active select,
.section.active textarea{
  font-size:14px;
  line-height:1.5;
}
.section.active .table{
  font-size:14px;
  font-variant-numeric:tabular-nums;
}
.section.active .table th{
  font-size:13px;
  font-weight:750;
  letter-spacing:.005em;
  line-height:1.4;
}
.section.active .table td{
  font-weight:450;
  line-height:1.5;
}
.section.active .grid3 .panel p[style*="font-size"]{
  font-size:clamp(28px,2.4vw,34px)!important;
  font-weight:800!important;
  letter-spacing:-.045em;
  line-height:1.15;
  font-variant-numeric:tabular-nums;
}
.section.active button{
  font-weight:650;
  letter-spacing:-.01em;
}
.section.active .input,
.section.active input,
.section.active select,
.section.active textarea{
  font-family:inherit;
}
.side .nav,
.side .nav button,
.side .nav a{
  font-size:14px;
  font-weight:600;
  letter-spacing:-.01em;
}
@media(max-width:640px){
  body{font-size:14px}
  .section.active > .top h1{font-size:24px}
  .section.active .panel h2{font-size:17px}
  .section.active .table th{font-size:12px}
  .section.active .table td{font-size:13px}
}


/* COMERCIOIA_POS_DESIGN_V1 */
/* Caja: jerarquía visual, acciones visibles y tarjetas modernas */
#pos .grid > .panel{
  border:1px solid #dbe5f0;
  border-radius:20px;
  background:linear-gradient(155deg,#ffffff 0%,#f7faff 72%,#effbfb 100%);
  box-shadow:0 8px 26px #0f172a0c;
  transition:box-shadow .18s ease,border-color .18s ease;
}
#pos .grid > .panel:hover{
  border-color:#c4d9ed;
  box-shadow:0 12px 30px #0f172a10;
}
#pos .panel h2{
  color:#172554;
  font-weight:800;
  letter-spacing:-.035em;
}
#pos .between{
  gap:12px;
  align-items:center;
}
#pos .pos-clear-ticket{
  min-height:42px;
  padding:10px 15px;
  border:1px solid #fecaca!important;
  border-radius:12px!important;
  background:linear-gradient(135deg,#fff1f2,#ffe4e6)!important;
  color:#be123c!important;
  font-size:13px;
  font-weight:750!important;
  box-shadow:0 3px 9px #be123c12;
  white-space:nowrap;
}
#pos .pos-clear-ticket:hover{
  background:linear-gradient(135deg,#ffe4e6,#fecdd3)!important;
  border-color:#fda4af!important;
  transform:translateY(-1px);
}
#pos .pos-print-ticket,
#pos #printCurrentTicketModal{
  min-height:46px;
  padding:11px 16px;
  border:1px solid #bae6fd!important;
  border-radius:13px!important;
  background:linear-gradient(110deg,#e0f2fe,#ccfbf1)!important;
  color:#075985!important;
  font-size:14px;
  font-weight:750!important;
  box-shadow:0 4px 12px #0284c710;
}
#pos .pos-print-ticket:hover,
#pos #printCurrentTicketModal:hover{
  filter:brightness(.98);
  border-color:#67e8f9!important;
  transform:translateY(-1px);
}
#pos .cia-cart-total{
  border:1px solid #bae6fd;
  border-radius:17px;
  background:linear-gradient(115deg,#eff6ff 0%,#e0f2fe 52%,#ccfbf1 100%);
  padding:17px 19px;
  gap:12px;
}
#pos .cia-cart-total span{
  color:#334155;
  font-size:13px;
  font-weight:800;
  letter-spacing:.045em;
}
#pos .cia-cart-total strong{
  color:var(--cia-teal,#0f766e);
  font-size:clamp(28px,3vw,36px);
  font-weight:850;
  letter-spacing:-.045em;
  font-variant-numeric:tabular-nums;
}
#pos #tt{
  color:var(--cia-teal,#0f766e)!important;
  font-weight:850!important;
  letter-spacing:-.045em;
  font-variant-numeric:tabular-nums;
}
#pos button[onclick="checkout()"]{
  min-height:58px;
  border:1px solid transparent;
  border-radius:15px!important;
  background:linear-gradient(110deg,var(--cia-blue,#2563eb),var(--cia-teal,#0d9488))!important;
  color:#fff!important;
  font-size:17px!important;
  font-weight:800!important;
  letter-spacing:.015em;
  box-shadow:0 7px 18px #2563eb30;
  transition:filter .15s ease,transform .15s ease,box-shadow .15s ease;
}
#pos button[onclick="checkout()"]:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
  box-shadow:0 10px 23px #2563eb38;
}
#pos #q,
#pos #barcodeScanner{
  border-radius:13px;
  border-color:#cbd5e1;
  background:#fff;
}
#pos #q:focus,
#pos #barcodeScanner:focus{
  border-color:var(--cia-blue,#2563eb);
  box-shadow:0 0 0 3px #38bdf833;
}
#pos #ct .empty{
  border:1px dashed #cbd5e1;
  border-radius:14px;
  background:linear-gradient(120deg,#f8fafc,#eff6ff);
  color:#475569;
  padding:20px!important;
  text-align:center;
}
@media(max-width:640px){
  #pos .between{
    align-items:center;
    flex-wrap:wrap;
  }
  #pos .pos-clear-ticket{
    min-height:42px;
    padding:9px 11px;
  }
  #pos .pos-print-ticket{
    min-height:46px;
  }
  #pos .cia-cart-total{
    padding:14px;
  }
  #pos button[onclick="checkout()"]{
    min-height:56px;
    font-size:16px!important;
  }
}






/* COMERCIOIA_PRODUCT_CHOICE_PRO_V2 */
#newProductChoiceModal {
  padding: 18px;
  align-items: center;
}

#newProductChoiceModal .cia-choice-v2 {
  width: min(740px, 94vw);
  max-width: 740px;
  padding: 28px;
  border-radius: 20px;
}

#newProductChoiceModal .cia-choice-v2-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 25px;
}

#newProductChoiceModal .cia-choice-v2-kicker {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

#newProductChoiceModal .cia-choice-v2-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

#newProductChoiceModal .cia-choice-v2-header p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

#newProductChoiceModal .cia-choice-v2-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

#newProductChoiceModal .cia-choice-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#newProductChoiceModal .cia-choice-v2-card {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 245px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
  white-space: normal;
  border: 1px solid #dce4ee;
  border-radius: 16px;
  background: #fff;
  color: #172033;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

#newProductChoiceModal .cia-choice-v2-card:hover {
  border-color: #91add3;
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
  transform: translateY(-2px);
}

#newProductChoiceModal .cia-choice-v2-card:focus-visible {
  outline: 3px solid rgba(59,130,246,.3);
  outline-offset: 3px;
}

#newProductChoiceModal .cia-choice-v2-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #edf4ff;
  font-size: 28px;
}

#newProductChoiceModal .cia-choice-v2-family .cia-choice-v2-icon {
  background: #f2edff;
}

#newProductChoiceModal .cia-choice-v2-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

#newProductChoiceModal .cia-choice-v2-description {
  display: block;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

#newProductChoiceModal .cia-choice-v2-action {
  width: 100%;
  margin-top: auto;
  padding-top: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #edf1f5;
  color: #315f9d;
  font-size: 13px;
  font-weight: 800;
}

#newProductChoiceModal .cia-choice-v2-action span {
  font-size: 20px;
}

#newProductChoiceModal .cia-choice-v2-footer {
  margin-top: 20px;
  color: #94a3b8;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 600px) {
  #newProductChoiceModal {
    padding: 12px;
  }

  #newProductChoiceModal .cia-choice-v2 {
    width: 100%;
    max-width: 100%;
    padding: 20px 17px;
  }

  #newProductChoiceModal .cia-choice-v2-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #newProductChoiceModal .cia-choice-v2-card {
    min-height: 0;
    padding: 17px;
  }

  #newProductChoiceModal .cia-choice-v2-header h2 {
    font-size: 21px;
  }
}
/* FIN COMERCIOIA_PRODUCT_CHOICE_PRO_V2 */


/* COMERCIOIA_PRODUCT_CHOICE_PRO_V3 */
#newProductChoiceModal {
  box-sizing: border-box;
  padding: 20px;
}

#newProductChoiceModal .cia-choice-v2 {
  width: min(780px, 94vw);
  max-width: 780px;
  padding: 30px;
  border-radius: 22px;
  box-sizing: border-box;
}

#newProductChoiceModal .cia-choice-v2-header {
  align-items: center;
  margin-bottom: 26px;
}

#newProductChoiceModal .cia-choice-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

#newProductChoiceModal .cia-choice-v2-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 270px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  font-family: inherit;
  line-height: 1.45;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 3px 12px rgba(15,23,42,.04);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

#newProductChoiceModal .cia-choice-v2-card > span {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
}

#newProductChoiceModal .cia-choice-v2-card:hover {
  border-color: #8baedb;
  box-shadow: 0 10px 26px rgba(15,23,42,.09);
  transform: translateY(-2px);
}

#newProductChoiceModal .cia-choice-v2-card:active {
  transform: translateY(0);
}

#newProductChoiceModal .cia-choice-v2-icon {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #eaf2ff;
  font-size: 30px;
}

#newProductChoiceModal .cia-choice-v2-family {
  border-color: #e4dcfa;
  background: linear-gradient(180deg, #fff 0%, #fcfaff 100%);
}

#newProductChoiceModal .cia-choice-v2-family .cia-choice-v2-icon {
  background: #f0eaff;
}

#newProductChoiceModal .cia-choice-v2-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  color: #172033;
}

#newProductChoiceModal .cia-choice-v2-description {
  min-height: 44px;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

#newProductChoiceModal .cia-choice-v2-action {
  width: 100%;
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e9eef5;
  color: #315f9d;
  font-size: 14px;
  font-weight: 800;
}

#newProductChoiceModal .cia-choice-v2-family .cia-choice-v2-action {
  color: #7050b5;
}

#newProductChoiceModal .cia-choice-v2-action span {
  width: auto;
  font-size: 21px;
}

#newProductChoiceModal .cia-choice-v2-footer {
  margin-top: 22px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  #newProductChoiceModal {
    padding: 12px;
  }

  #newProductChoiceModal .cia-choice-v2 {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 21px 17px;
  }

  #newProductChoiceModal .cia-choice-v2-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  #newProductChoiceModal .cia-choice-v2-card {
    min-height: 220px;
    padding: 19px;
  }

  #newProductChoiceModal .cia-choice-v2-description {
    min-height: 0;
  }

  #newProductChoiceModal .cia-choice-v2-header h2 {
    font-size: 21px;
  }
}
/* FIN COMERCIOIA_PRODUCT_CHOICE_PRO_V3 */


/* COMERCIOIA_PRODUCT_CHOICE_ICON_FIX_V1 */
#newProductChoiceModal .cia-choice-v2-card > .cia-choice-v2-icon {
  width: 62px;
  min-width: 62px;
  max-width: 62px;
  height: 62px;
  min-height: 62px;
  max-height: 62px;
  flex: 0 0 62px;
  align-self: flex-start;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}
/* FIN COMERCIOIA_PRODUCT_CHOICE_ICON_FIX_V1 */


/* COMERCIOIA_SALE_SUMMARY_V1 */
#pos .cia-sale-summary{
  border:1px solid #cbd5e1;
  border-radius:16px;
  padding:16px;
  background:linear-gradient(145deg,#ffffff,#f1f5f9);
  color:#1e293b;
  box-shadow:0 4px 14px rgba(15,23,42,.045);
}
#pos .cia-sale-summary-heading{
  font-size:14px;
  font-weight:800;
  margin-bottom:13px;
  color:#334155;
}
#pos .cia-sale-summary-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:7px 0;
  font-size:14px;
}
#pos .cia-sale-summary-row span{color:#64748b}
#pos .cia-sale-summary-row strong{
  font-variant-numeric:tabular-nums;
  font-weight:750;
}
#pos .cia-sale-discount,
#pos .cia-sale-discount strong{color:#15803d}
#pos .cia-sale-summary-divider{
  height:1px;
  background:#cbd5e1;
  margin:10px 0;
}
#pos .cia-sale-final{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:13px;
  border-radius:12px;
  background:linear-gradient(110deg,#e0f2fe,#ccfbf1);
}
#pos .cia-sale-final span{
  color:#334155;
  font-size:12px;
  font-weight:850;
  letter-spacing:.045em;
}
#pos .cia-sale-final strong{
  color:#0f766e;
  font-size:clamp(30px,4vw,38px);
  line-height:1.2;
  font-weight:900;
  letter-spacing:-.04em;
  font-variant-numeric:tabular-nums;
}
#pos .cia-sale-final small{
  color:#15803d;
  font-size:12px;
  font-weight:700;
}
@media(max-width:560px){
  #pos .cia-sale-summary{padding:13px;border-radius:13px}
  #pos .cia-sale-final{padding:12px}
}


/* COMERCIOIA_TRANSFER_MODAL_ABOVE_PAYMENT_V1 */
#transferConfirmModal {
  position: fixed !important;
  z-index: 30000 !important;
}


/* COMERCIOIA_STOCK_PRODUCTS_LAYOUT_V1 */
#stock.section.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#stock.section.active > .top { order: 0; margin-bottom: 0; }
#stock .stock-products-panel { order: 1; min-width: 0; overflow-x: auto; }
#stock .stock-scan-panel { order: 2; min-width: 0; }
#stock .stock-alerts-grid { order: 3; margin-top: 0; }
#stock .stock-summary-grid { order: 4; margin-top: 0; }
#stock .stock-inactive-panel { order: 5; }
#stock .stock-products-panel .table { min-width: 1350px; }
#stock .stock-products-panel .table th,
#stock .stock-products-panel .table td {
  padding: 12px 10px;
  vertical-align: middle;
  white-space: normal;
}
#stock .stock-products-panel .table td:first-child {
  min-width: 230px;
  max-width: 310px;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  #stock.section.active { gap: 12px; }
  #stock .stock-products-panel { padding: 12px; }
  #stock .stock-products-panel .table { min-width: 1250px; }
  #stock .stock-products-panel .table th,
  #stock .stock-products-panel .table td {
    font-size: 13px;
    padding: 10px 8px;
  }
}
/* FIN COMERCIOIA_STOCK_PRODUCTS_LAYOUT_V1 */

/* COMERCIOIA_ADMIN_AI_CHAT_V1 */

#ciaAdminAiChat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25000;
  font-family: inherit;
}

#ciaAiToggle {
  border: 0;
  border-radius: 30px;
  padding: 14px 20px;
  background: #0f172a;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 28px rgba(15,23,42,.25);
  cursor: pointer;
}

#ciaAiToggle span {
  color: #67e8f9;
  margin-right: 5px;
  font-size: 18px;
}

#ciaAiPanel {
  position: absolute;
  right: 0;
  bottom: 65px;
  width: 370px;
  height: 490px;
  max-height: calc(100dvh - 110px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(15,23,42,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ciaAiPanel[hidden] {
  display: none;
}

.cia-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px;
  color: white;
  background: #0f172a;
}

.cia-ai-header strong,
.cia-ai-header small {
  display: block;
}

.cia-ai-header small {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 12px;
}

#ciaAiClose {
  border: 0;
  background: transparent;
  color: white;
  font-size: 26px;
  cursor: pointer;
}

#ciaAiMessages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.cia-ai-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cia-ai-message.assistant {
  align-self: flex-start;
  color: #1e293b;
  background: white;
  border: 1px solid #e2e8f0;
}

.cia-ai-message.user {
  align-self: flex-end;
  color: white;
  background: #2563eb;
}

#ciaAiForm {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: white;
}

#ciaAiInput {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

#ciaAiInput:focus {
  border-color: #2563eb;
}

#ciaAiSend {
  border: 0;
  border-radius: 10px;
  padding: 12px 15px;
  background: #2563eb;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

#ciaAiSend:disabled {
  opacity: .55;
  cursor: wait;
}

#ciaAiStatus {
  padding: 0 12px 8px;
  color: #64748b;
  background: white;
  font-size: 11px;
}

@media (max-width: 600px) {
  #ciaAdminAiChat {
    right: 12px;
    bottom: 14px;
  }

  #ciaAiPanel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 78px;
    width: auto;
    height: min(520px, calc(100dvh - 110px));
    max-height: calc(100dvh - 110px);
  }

  #ciaAiToggle {
    padding: 13px 17px;
  }
}

/* FIN COMERCIOIA_ADMIN_AI_CHAT_V1 */


/* COMERCIOIA_STORE_SHARE_V1 */
.cia-store-share-button {
  background: #075985 !important;
  color: #fff !important;
  text-align: left !important;
  border: 1px solid #0e7490 !important;
}
.cia-store-share-button:hover {
  background: #0e7490 !important;
}
.cia-store-share-back {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15,23,42,.65);
}
.cia-store-share-panel {
  width: min(460px,100%);
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  color: #17202a;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.cia-store-share-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.cia-store-share-heading h2 {
  margin: 0 0 5px;
  font-size: 20px;
}
.cia-store-share-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.cia-store-share-close {
  background: #edf2f7;
  color: #334155;
}
.cia-store-share-panel label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}
#ciaStoreShareUrl {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
}
.cia-store-share-status {
  margin: 10px 0 16px;
  font-size: 12px;
  line-height: 1.4;
}
.cia-store-share-status.ready { color: #15803d; }
.cia-store-share-status.warning { color: #b45309; }
.cia-store-share-actions {
  display: flex;
  gap: 9px;
}
.cia-store-share-actions button,
.cia-store-share-actions a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}
#ciaStoreCopy {
  background: #0f172a;
  color: #fff;
}
#ciaStoreWhatsapp {
  background: #16a34a;
  color: #fff;
}
.cia-store-share-actions button:disabled,
.cia-store-share-actions a.disabled {
  opacity: .45;
  pointer-events: none;
}
@media (max-width: 760px) {
  .nav > .cia-store-share-button {
    display: none !important;
  }
  #mobileMorePanel .cia-store-share-button {
    display: flex !important;
    width: 100% !important;
    min-height: 48px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 9px 7px !important;
    border-radius: 12px !important;
    text-align: center !important;
    white-space: normal !important;
    font-size: 12px !important;
  }
}
@media (max-width: 420px) {
  .cia-store-share-actions { flex-direction: column; }
}
/* FIN COMERCIOIA_STORE_SHARE_V1 */

