*{box-sizing:border-box}:root{--sidebar-width:285px;--bg:#f4f6f8;--dark:#111827;--text:#1f2937;--blue:#1d4ed8}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
.app{display:flex;min-height:100vh}
.sidebar{width:var(--sidebar-width);background:var(--dark);color:white;padding:18px;position:fixed;left:0;top:0;bottom:0;height:100vh;overflow:auto;z-index:5000;transform:translateX(0);transition:transform .25s ease;box-shadow:8px 0 24px #0003}
body.menu-collapsed .sidebar{transform:translateX(calc(-1 * var(--sidebar-width)))}
.menu-toggle{position:fixed!important;left:285px;top:50%;transform:translateY(-50%);z-index:6000!important;width:46px!important;height:76px!important;min-height:76px!important;border:0!important;border-radius:0 18px 18px 0!important;background:#111827!important;color:white!important;cursor:pointer!important;font-size:34px!important;line-height:1!important;padding:0!important;box-shadow:6px 0 18px #0004!important;display:flex!important;align-items:center!important;justify-content:center!important}
body.menu-collapsed .menu-toggle{left:0!important}.menu-toggle:hover{background:#374151!important}.menu-overlay{display:none}
.brand{display:flex;align-items:center;gap:10px;margin-bottom:18px}.brand img{width:44px;height:44px;object-fit:contain}.brand span{display:block;font-size:12px;color:#d1d5db}
.sidebar a{display:block;color:white;text-decoration:none;padding:10px 11px;border-radius:10px;margin:4px 0}.sidebar a:hover{background:#374151}
.navtitle{font-size:12px;text-transform:uppercase;color:#9ca3af;margin:16px 0 6px}.userbox{font-size:12px;color:#d1d5db;margin-top:18px}
.main{flex:1;margin-left:var(--sidebar-width);padding:24px;width:calc(100% - var(--sidebar-width));transition:margin-left .25s ease,width .25s ease}
body.menu-collapsed .main{margin-left:0;width:100%}.main>h1,.main>.card,.main>.grid,.main>form,.main>table{max-width:1180px;margin-left:auto;margin-right:auto}
.login-wrap{max-width:420px;margin:60px auto;background:white;padding:30px;border-radius:18px;box-shadow:0 12px 35px #0002}
.card{background:white;border-radius:16px;padding:18px;margin-bottom:18px;box-shadow:0 6px 20px #0001}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
label{display:block;font-size:13px;margin:8px 0 4px}input,select,textarea,button{width:100%;padding:11px;border:1px solid #d1d5db;border-radius:10px;font-size:15px}textarea{min-height:75px}
button,.btn{background:var(--blue);color:white;border:0;cursor:pointer;text-decoration:none;display:inline-block;text-align:center;padding:10px 12px;border-radius:10px}.btn-danger{background:#b91c1c!important}.btn-gray{background:#4b5563!important}.btn-ok{background:#047857!important}
.flash{padding:14px;border-radius:10px;margin:10px auto;font-weight:600;max-width:1180px}.ok{background:#dcfce7;color:#14532d}.err{background:#fee2e2;color:#7f1d1d;border:1px solid #fecaca}.warn{background:#fef3c7;color:#78350f;border:1px solid #f59e0b}
.bigwarn{display:none;background:#fee2e2;color:#7f1d1d;border:2px solid #b91c1c;border-radius:12px;padding:14px;font-weight:bold;margin:12px 0}
table{width:100%;border-collapse:collapse;background:white;border-radius:12px;overflow:hidden}th,td{padding:10px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top}th{background:#f3f4f6}
.actions{display:flex;gap:8px;flex-wrap:wrap}.actions form{margin:0}.actions button,.actions .btn{width:auto}.small{font-size:13px;color:#6b7280}.num{text-align:right}.readonly{background:#f3f4f6}.anulado{opacity:.55;text-decoration:line-through}.asiento{font-weight:bold}
.libro{background:white;color:#001f3f}.libro-logo{height:42px;max-width:120px;object-fit:contain;margin-right:12px;vertical-align:middle}.libro-header{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;background:#d9d9d9;font-weight:bold;font-size:20px;padding:8px;align-items:center}.libro-header div:nth-child(2){text-align:center}.libro-header div:nth-child(3){text-align:right}.libro-table{width:100%;border-collapse:collapse;font-size:12px}.libro-table th{background:#fff;color:#001f3f;font-size:15px;border-bottom:10px solid #7d7d7d;text-align:center}.libro-table td{border-bottom:1px solid #ccc;padding:6px}.libro-table .num{text-align:right}
@media(max-width:900px){:root{--sidebar-width:82vw}.sidebar{max-width:330px}.main{margin-left:0!important;width:100%!important;padding:14px;padding-top:18px}body.menu-open .menu-overlay{display:block;position:fixed;inset:0;background:#0006;z-index:4500}.menu-toggle{top:auto!important;bottom:18px!important;left:0!important;transform:none!important;width:48px!important;height:60px!important;min-height:60px!important;border-radius:0 16px 16px 0!important;font-size:28px!important}body.menu-open .menu-toggle{left:min(82vw,330px)!important}.grid{grid-template-columns:1fr;gap:12px}.card{padding:14px;border-radius:14px}h1{font-size:26px;margin-left:42px}input,select,textarea,button{font-size:16px;min-height:44px}table{display:block;overflow-x:auto;white-space:nowrap}.actions{display:block}.actions .btn,.actions button{width:100%;margin:3px 0}.libro-header{grid-template-columns:1fr;font-size:16px;text-align:left}.libro-header div:nth-child(2),.libro-header div:nth-child(3){text-align:left}}
@media print{body{background:#fff}.sidebar,.print-actions,h1,.menu-toggle,.menu-overlay{display:none!important}.app{display:block}.main{padding:0;margin-left:0;width:100%}.card{box-shadow:none;border-radius:0;padding:0}.libro-header{font-size:18px}.libro-table th{font-size:13px}.libro-table{font-size:11px}}


/* V19 FINAL */
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.card-head h2{margin:0}
.btn-small{width:auto!important;min-height:auto!important;padding:7px 11px!important;font-size:13px!important;border-radius:999px!important;white-space:nowrap}
.hidden{display:none!important}
.brand img{background:#000;border-radius:6px;width:92px!important;height:42px!important;object-fit:contain!important}
.libro-logo{background:#000;border-radius:4px;padding:2px;height:38px!important;max-width:160px!important;object-fit:contain!important}
.libro-table th,.libro-table td{text-align:center!important;vertical-align:middle!important}
.export-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.export-buttons .btn{width:auto}
.export-buttons .active-export{background:#1d4ed8!important;color:#fff!important;box-shadow:0 0 0 3px rgba(29,78,216,.25)}
.validate-inline{margin-top:10px}
.validate-inline button{background:#047857!important}
.pdf-footer{display:none;text-align:center;font-size:11px;color:#111827;margin-top:12px}
.print-note{font-size:12px;color:#6b7280;margin-top:8px}
@page{size:A4 landscape;margin:8mm}
@media(max-width:900px){
  .card-head{align-items:flex-start}
  .btn-small{padding:8px 10px!important}
  .export-buttons{display:block}
  .export-buttons .btn{width:100%;margin:3px 0}
}
@media print{
  @page{size:A4 landscape;margin:8mm}
  html,body{margin:0!important;padding:0!important}
  .print-actions,.sidebar,.menu-toggle,.menu-overlay,h1{display:none!important}
  .pdf-footer{display:block!important;position:fixed;bottom:3mm;left:0;right:0}
  .main{padding:0!important;margin:0!important;width:100%!important}
  .card{box-shadow:none!important;border-radius:0!important;padding:0!important;margin:0!important}
  .libro-header{font-size:15px!important}
  .libro-table{font-size:10px!important}
  .libro-table th{font-size:10px!important}
}


/* V20 Categorías / Calibres */
.section-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 auto 18px;max-width:1180px}
.section-tabs .btn{width:auto}
.section-tabs .active-tab{background:#1d4ed8!important;color:#fff!important;box-shadow:0 0 0 3px rgba(29,78,216,.22)}
.admin-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.admin-section-title h2{margin:0}
@media(max-width:900px){
  .section-tabs{display:block}
  .section-tabs .btn{width:100%;margin:4px 0}
  .admin-section-title{display:block}
}

/* V21 Ventas por cliente */
.client-search-results table{margin-top:10px}
.filter-summary{background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:12px;margin-bottom:12px}
@media print{.client-search-panel,.filter-form-panel,.print-actions{display:none!important}}

/* V23 autoselectivo ventas cliente */
.auto-client-results{margin-top:12px}
.auto-client-results table{margin-top:8px}
.auto-status{font-size:13px;color:#6b7280;margin-top:8px}

/* V24 */
.mov-entrada td{background:#e8f8ec!important}
.mov-salida td{background:#fff!important}
.stock-cat-badge{display:inline-block;background:#ecfdf5;border:1px solid #10b981;color:#065f46;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:bold}

/* V26 export menu */
.calibre-export-box{margin-top:12px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:14px;padding:14px}
.calibre-export-box h3{margin:0 0 10px}
.calibre-export-box .grid{align-items:end}

/* V27 selector calibre PDF */
.calibre-export-box{margin-top:12px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:14px;padding:14px}
.calibre-export-box h3{margin:0 0 10px}
.calibre-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.calibre-actions button,.calibre-actions .btn{width:auto}
@media(max-width:900px){
  .calibre-actions{display:block}
  .calibre-actions button,.calibre-actions .btn{width:100%;margin:4px 0}
}

/* V28 Stock + movimientos */
.mov-entrada td{background:#e8f8ec!important}
.mov-salida td{background:#fff!important}
.stock-layout-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.stock-chip{display:inline-block;border-radius:999px;padding:4px 10px;background:#ecfdf5;border:1px solid #10b981;color:#065f46;font-weight:700}
.mov-filter-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:14px;margin-bottom:14px}


/* V29 Stock y movimientos con submenú */
.subtabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 auto 16px;max-width:1180px}
.subtabs .btn{width:auto}
.subtabs .active-tab{background:#1d4ed8!important;color:#fff!important;box-shadow:0 0 0 3px rgba(29,78,216,.22)}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-width:1180px;margin:0 auto 16px}
.stat-card{background:white;border-radius:18px;padding:18px;box-shadow:0 6px 20px #0001;border-left:6px solid #1d4ed8}
.stat-card h3{margin:0 0 8px;font-size:14px;color:#6b7280}
.stat-card .stat-number{font-size:32px;font-weight:800;color:#111827;line-height:1}
.stat-card .stat-note{font-size:12px;color:#6b7280;margin-top:6px}
.stat-card.ok{border-left-color:#047857}
.stat-card.warn{border-left-color:#f59e0b;background:white;color:#111827}
.stat-card.err{border-left-color:#b91c1c;background:white;color:#111827}
.mobile-summary-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.summary-mini{background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:12px}
.summary-mini strong{display:block;font-size:20px}
@media(max-width:900px){
  .subtabs{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
  .subtabs .btn{width:100%}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stat-card{padding:14px}
  .stat-card .stat-number{font-size:28px}
}
@media(max-width:520px){
  .stats-grid{grid-template-columns:1fr}
  .mobile-summary-list{grid-template-columns:1fr}
}

/* V30 export calibre PDF definitivo */
.calibre-export-box{margin-top:12px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:14px;padding:14px}
.calibre-export-box h3{margin:0 0 10px}
.calibre-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.calibre-actions button,.calibre-actions .btn{width:auto}
@media(max-width:900px){
  .calibre-actions{display:block}
  .calibre-actions button,.calibre-actions .btn{width:100%;margin:4px 0}
}


/* V40 botones exportación libro */
.btn-mini{width:auto!important;min-height:auto!important;padding:7px 11px!important;font-size:13px!important;border-radius:9px!important}
.btn-soft-green{background:#bbf7d0!important;color:#064e3b!important;border:1px solid #86efac!important}
.btn-soft-green:hover{background:#86efac!important;color:#052e16!important}
.libro-actions-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
.libro-actions-row .btn,.libro-actions-row button{width:auto!important}
.calibre-export-box{margin-top:12px;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:14px;padding:14px}
.calibre-export-box h3{margin:0 0 10px;color:#064e3b}
.calibre-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.calibre-actions button,.calibre-actions .btn{width:auto!important}
@media(max-width:900px){
  .libro-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .libro-actions-row .btn,.libro-actions-row button{width:100%!important}
  .calibre-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .calibre-actions button,.calibre-actions .btn{width:100%!important}
}


/* V41 filtros libro en una línea */
.libro-filter-line{
  display:grid;
  grid-template-columns: 150px 150px 190px minmax(190px,1fr) minmax(220px,1fr);
  gap:10px;
  align-items:end;
}
.libro-filter-line label{white-space:nowrap}
.libro-filter-line input,
.libro-filter-line select{width:100%}
@media(max-width:1100px){
  .libro-filter-line{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .libro-filter-line{grid-template-columns:1fr}
}


/* V42 caja amarilla Libro registro */
.libro-registro-box{
  margin-top:12px;
  border:1px solid #fde68a;
  background:#fffbeb;
  border-radius:14px;
  padding:14px;
}
.libro-registro-box h3{
  margin:0 0 10px;
  color:#78350f;
}
.libro-registro-box .libro-actions-row{
  margin-top:10px;
}
.btn-soft-yellow{
  background:#fde68a!important;
  color:#78350f!important;
  border:1px solid #f59e0b!important;
}
.btn-soft-yellow:hover{
  background:#fcd34d!important;
  color:#451a03!important;
}


/* V43 opciones General/Categorías dentro caja amarilla */
.libro-box-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.libro-box-head h3{
  margin:0!important;
  white-space:nowrap;
}
.libro-mode-buttons{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.libro-mode-buttons .btn{
  width:auto!important;
  min-height:auto!important;
  padding:7px 11px!important;
  font-size:13px!important;
  border-radius:999px!important;
}
.libro-mode-buttons .active-export{
  background:#1d4ed8!important;
  color:#fff!important;
  border-color:#1d4ed8!important;
  box-shadow:0 0 0 3px rgba(29,78,216,.22);
}
@media(max-width:900px){
  .libro-box-head{display:block}
  .libro-mode-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:10px}
  .libro-mode-buttons .btn{width:100%!important}
}
@media(max-width:520px){
  .libro-mode-buttons{grid-template-columns:1fr}
}


/* V44 quitar título superior vacío en Libro registro */
.main > h1:empty,
h1:empty{
  display:none!important;
  margin:0!important;
  padding:0!important;
}


/* V45 barra validación libro */
.validacion-export-bar{
  margin:12px 0;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  font-weight:700;
}
.validacion-export-bar.roja{
  background:#fee2e2;
  border:1px solid #ef4444;
  color:#7f1d1d;
}
.validacion-export-bar.verde{
  background:#dcfce7;
  border:1px solid #22c55e;
  color:#14532d;
}
.validacion-export-bar form{
  margin:0;
}
.validacion-export-bar button{
  width:auto!important;
  min-height:auto!important;
  padding:8px 12px!important;
  font-size:13px!important;
  border-radius:10px!important;
}
.validacion-export-bar.roja button{
  background:#b91c1c!important;
}
.validacion-export-bar.verde button{
  background:#047857!important;
}
@media(max-width:700px){
  .validacion-export-bar{
    display:block;
  }
  .validacion-export-bar button{
    width:100%!important;
    margin-top:8px;
  }
}


/* V55 clientes inactivos */
.inline-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.inline-actions form{margin:0}
.client-reactivate-box{
  border:1px solid #f59e0b;
  background:#fffbeb;
  color:#78350f;
  border-radius:14px;
  padding:12px;
  margin:12px 0;
}
.client-reactivate-box strong{display:block;margin-bottom:6px}
.btn-warning{
  background:#f59e0b!important;
  color:#451a03!important;
}
@media(max-width:700px){
  .inline-actions{display:block}
  .inline-actions .btn,
  .inline-actions button{width:100%;margin:3px 0}
}


/* V56 Resumen con barras */
.barras-resumen{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
  max-width:1180px;
  margin:0 auto 16px;
}
.panel-barras{
  background:#fff;
  border-radius:18px;
  padding:16px;
  box-shadow:0 6px 20px #0001;
}
.panel-barras h2{
  margin-top:0;
  margin-bottom:12px;
}
.barra-item{
  margin:10px 0;
}
.barra-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  font-size:14px;
  font-weight:700;
}
.barra-track{
  height:16px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin-top:5px;
}
.barra-fill{
  height:100%;
  min-width:3px;
  border-radius:999px;
}
.barra-fill.azul{background:#2563eb}
.barra-fill.verde{background:#16a34a}
.barra-fill.roja{background:#dc2626}
.barra-fill.ambar{background:#f59e0b}
.barra-fill.morada{background:#7c3aed}
.barra-fill.cian{background:#0891b2}
.barra-fill.gris{background:#475569}
.barra-mini-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.barra-kpi{
  border-radius:16px;
  padding:14px;
  border:1px solid #e5e7eb;
  background:#f8fafc;
}
.barra-kpi .titulo{
  font-size:14px;
  font-weight:800;
  color:#374151;
}
.barra-kpi .numero{
  font-size:34px;
  line-height:1;
  font-weight:900;
  margin:6px 0;
}
.barra-kpi.verde{border-left:7px solid #16a34a}
.barra-kpi.roja{border-left:7px solid #dc2626}
.barra-kpi .barra-track{height:20px}
@media(max-width:900px){
  .barras-resumen{grid-template-columns:1fr}
  .panel-barras{padding:14px}
}


/* V57 barra validar asientos */
.barra-validar-asientos{
  margin:14px 0;
  border-radius:14px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:100%;
  box-sizing:border-box;
  font-weight:800;
}
.barra-validar-asientos.roja{
  background:#fee2e2;
  border:1px solid #dc2626;
  color:#7f1d1d;
}
.barra-validar-asientos.verde{
  background:#dcfce7;
  border:1px solid #16a34a;
  color:#14532d;
}
.barra-validar-asientos .estado{
  flex:1;
  min-width:240px;
}
.barra-validar-asientos .detalle{
  display:block;
  font-size:13px;
  font-weight:500;
  margin-top:3px;
  opacity:.9;
}
.barra-validar-asientos form{margin:0}
.barra-validar-asientos button{
  width:auto!important;
  min-height:auto!important;
  padding:9px 16px!important;
  border-radius:10px!important;
  font-size:14px!important;
  font-weight:800!important;
}
.barra-validar-asientos.roja button{
  background:#b91c1c!important;
  color:#fff!important;
}
@media(max-width:760px){
  .barra-validar-asientos{display:block}
  .barra-validar-asientos button{width:100%!important;margin-top:10px}
}
@media print{
  .barra-validar-asientos{display:none!important}
}


/* V58 - Ajuste PDF/ancho folio */
.libro{
  width:100%;
  max-width:none!important;
  box-sizing:border-box;
  overflow-x:auto;
}

.libro-header{
  width:100%;
  box-sizing:border-box;
}

.libro-table{
  width:100%!important;
  table-layout:fixed;
  border-collapse:collapse;
}

.libro-table th,
.libro-table td{
  box-sizing:border-box;
  overflow-wrap:anywhere;
  word-break:normal;
  vertical-align:middle;
}

.libro-table th{
  text-align:center;
}

.libro-table td.num,
.libro-table th.num{
  text-align:right;
}

/* Anchos orientativos para que el libro encaje mejor en A4 horizontal */
.libro-table th:nth-child(1),
.libro-table td:nth-child(1){width:6%}

.libro-table th:nth-child(2),
.libro-table td:nth-child(2){width:8%}

.libro-table th:nth-child(3),
.libro-table td:nth-child(3){width:11%}

.libro-table th:nth-child(4),
.libro-table td:nth-child(4){width:13%}

.libro-table th:nth-child(5),
.libro-table td:nth-child(5){width:14%}

.libro-table th:nth-child(6),
.libro-table td:nth-child(6){width:14%}

.libro-table th:nth-child(7),
.libro-table td:nth-child(7){width:10%}

.libro-table th:nth-child(8),
.libro-table td:nth-child(8){width:8%}

.libro-table th:nth-child(9),
.libro-table td:nth-child(9){width:8%}

.libro-table th:nth-child(10),
.libro-table td:nth-child(10){width:8%}

/* ── V153: Anchos para libro-table-11 (sin total) ─────────────── */
.libro-table-11 th:nth-child(1),.libro-table-11 td:nth-child(1){width:5%}
.libro-table-11 th:nth-child(2),.libro-table-11 td:nth-child(2){width:7%}
.libro-table-11 th:nth-child(3),.libro-table-11 td:nth-child(3){width:10%}
.libro-table-11 th:nth-child(4),.libro-table-11 td:nth-child(4){width:7%}
.libro-table-11 th:nth-child(5),.libro-table-11 td:nth-child(5){width:9%}
.libro-table-11 th:nth-child(6),.libro-table-11 td:nth-child(6){width:7%}
.libro-table-11 th:nth-child(7),.libro-table-11 td:nth-child(7){width:13%}
.libro-table-11 th:nth-child(8),.libro-table-11 td:nth-child(8){width:13%}
.libro-table-11 th:nth-child(9),.libro-table-11 td:nth-child(9){width:9%}
.libro-table-11 th:nth-child(10),.libro-table-11 td:nth-child(10){width:7%}
.libro-table-11 th:nth-child(11),.libro-table-11 td:nth-child(11){width:7%}

/* ── V153: Anchos para libro-table-12 (con total) ─────────────── */
.libro-table-12 th:nth-child(1),.libro-table-12 td:nth-child(1){width:5%}
.libro-table-12 th:nth-child(2),.libro-table-12 td:nth-child(2){width:6%}
.libro-table-12 th:nth-child(3),.libro-table-12 td:nth-child(3){width:9%}
.libro-table-12 th:nth-child(4),.libro-table-12 td:nth-child(4){width:6%}
.libro-table-12 th:nth-child(5),.libro-table-12 td:nth-child(5){width:8%}
.libro-table-12 th:nth-child(6),.libro-table-12 td:nth-child(6){width:6%}
.libro-table-12 th:nth-child(7),.libro-table-12 td:nth-child(7){width:12%}
.libro-table-12 th:nth-child(8),.libro-table-12 td:nth-child(8){width:12%}
.libro-table-12 th:nth-child(9),.libro-table-12 td:nth-child(9){width:9%}
.libro-table-12 th:nth-child(10),.libro-table-12 td:nth-child(10){width:7%}
.libro-table-12 th:nth-child(11),.libro-table-12 td:nth-child(11){width:7%}
.libro-table-12 th:nth-child(12),.libro-table-12 td:nth-child(12){width:7%}

/* Centrado de columnas Autorización / Guía / Transporte */
.libro-table .ctr,.libro-table td.ctr{text-align:center!important}

/* Ventas por cliente también ajustado a ancho */
.ventas-cliente-print table{
  width:100%!important;
  table-layout:fixed;
}

@media print{
  @page{
    size:A4 landscape;
    margin:8mm;
  }

  html,
  body{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
  }

  body{
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }

  .sidebar,
  .menu,
  nav,
  .topbar,
  .print-actions,
  .subtabs,
  .client-search-panel,
  .filter-form-panel,
  .no-print,
  .barra-validar-asientos,
  .calibre-export-box,
  .libro-registro-box{
    display:none!important;
  }

  .main,
  main,
  .content,
  .container{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
  }

  .card{
    box-shadow:none!important;
    border:none!important;
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
  }

  .libro{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    page-break-inside:auto;
  }

  .libro-header{
    display:grid!important;
    grid-template-columns:1fr 1.1fr 1fr;
    align-items:center;
    gap:6px;
    width:100%!important;
    margin:0 0 4mm 0!important;
    padding:0!important;
    font-size:12px!important;
    line-height:1.15!important;
  }

  .libro-logo{
    max-height:11mm!important;
    width:auto!important;
  }

  .libro-table{
    width:100%!important;
    max-width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    font-size:8.5px!important;
    line-height:1.08!important;
  }

  .libro-table th,
  .libro-table td{
    padding:2px 3px!important;
    border-bottom:1px solid #bbb!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    white-space:normal!important;
  }

  .libro-table th{
    font-size:8.5px!important;
    font-weight:800!important;
    text-align:center!important;
    background:#e5e7eb!important;
  }

  .libro-table td{
    font-size:8.3px!important;
  }

  .libro-table td.num{
    text-align:right!important;
    white-space:nowrap!important;
  }

  .pdf-footer{
    display:block!important;
    position:fixed;
    right:8mm;
    bottom:4mm;
    font-size:8px!important;
    color:#333!important;
  }

  /* Tablas de ventas por cliente / listados exportables */
  .ventas-cliente-print,
  .ventas-cliente-print table,
  table{
    max-width:100%!important;
  }

  .ventas-cliente-print table{
    width:100%!important;
    table-layout:fixed!important;
    font-size:8.5px!important;
  }

  .ventas-cliente-print th,
  .ventas-cliente-print td{
    padding:2px 3px!important;
    overflow-wrap:anywhere!important;
  }
}


/* V61 Venta táctil rápida */
.touch-body{
  max-width:1180px;
  margin:0 auto;
}
.touch-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.touch-logo{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:22px;
}
.touch-user-badge{
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:999px;
  padding:10px 14px;
  font-weight:700;
}
.touch-card{
  background:#fff;
  border-radius:22px;
  padding:18px;
  box-shadow:0 8px 26px #00000012;
  margin-bottom:14px;
}
.touch-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:end;
}
.touch-search{
  font-size:20px!important;
  padding:18px!important;
  border-radius:16px!important;
}
.touch-client-results{
  margin-top:10px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  overflow:hidden;
}
.touch-client-item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid #e5e7eb;
  text-decoration:none;
  color:#111827;
  background:#fff;
}
.touch-client-item:last-child{border-bottom:0}
.touch-client-item strong{font-size:18px}
.touch-client-item span{display:block;color:#6b7280;margin-top:3px}
.touch-client-item:hover{background:#eef2ff}
.touch-add-client{
  min-width:150px;
  padding:17px 18px!important;
  border-radius:16px!important;
  font-size:18px!important;
}
.touch-step-title{
  font-size:18px;
  font-weight:900;
  margin:0 0 10px;
}
.touch-category-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.touch-category{
  border:2px solid #d1d5db;
  background:#fff;
  border-radius:18px;
  padding:18px 10px;
  min-height:110px;
  text-align:center;
  cursor:pointer;
  font-size:18px;
  font-weight:900;
  color:#111827;
}
.touch-category small{
  display:block;
  font-size:34px;
  line-height:1;
  margin-bottom:8px;
}
.touch-category.active{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1d4ed8;
  box-shadow:0 0 0 4px rgba(37,99,235,.15);
}
.touch-calibres{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}
.touch-chip{
  border:1px solid #d1d5db;
  background:#fff;
  border-radius:14px;
  padding:14px 18px;
  font-size:18px;
  font-weight:800;
  min-width:72px;
  cursor:pointer;
}
.touch-chip.active{
  background:#2563eb;
  color:white;
  border-color:#2563eb;
}
.touch-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.touch-form-grid label{
  font-weight:800;
}
.touch-form-grid input,
.touch-form-grid select{
  font-size:18px!important;
  padding:15px!important;
  border-radius:14px!important;
}
.touch-help{
  color:#2563eb;
  font-weight:700;
  margin-top:6px;
}
.touch-qty{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
}
.touch-qty button{
  width:70px!important;
  height:62px!important;
  border-radius:16px!important;
  font-size:32px!important;
  padding:0!important;
}
.touch-qty-number{
  text-align:center;
  font-size:48px;
  font-weight:950;
  line-height:1;
}
.touch-qty-number span{
  display:block;
  font-size:16px;
  font-weight:700;
  color:#6b7280;
}
.touch-fast{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.touch-fast button{
  width:auto!important;
  min-width:92px;
  border-radius:14px!important;
  padding:12px 16px!important;
  font-size:18px!important;
}
.touch-alert{
  background:#fff7ed;
  border:1px solid #fb923c;
  color:#9a3412;
  border-radius:16px;
  padding:14px 16px;
  font-weight:800;
  margin-top:12px;
}
.touch-summary{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:12px;
}
.touch-summary div{
  border-right:1px solid #e5e7eb;
  padding:8px;
}
.touch-summary div:last-child{border-right:0}
.touch-summary span{
  display:block;
  color:#6b7280;
  font-size:13px;
  font-weight:800;
}
.touch-summary strong{
  display:block;
  font-size:18px;
  margin-top:5px;
}
.touch-actions{
  display:grid;
  grid-template-columns:.7fr 1.3fr;
  gap:12px;
  position:sticky;
  bottom:10px;
  z-index:10;
}
.touch-actions button,
.touch-actions a{
  border-radius:18px!important;
  padding:20px 18px!important;
  font-size:22px!important;
  font-weight:900!important;
  text-align:center;
}
.touch-save{
  background:#047857!important;
}
.touch-modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.touch-modal.open{display:flex}
.touch-modal-box{
  background:#fff;
  border-radius:22px;
  padding:20px;
  width:min(520px,100%);
  box-shadow:0 18px 60px rgba(0,0,0,.25);
}
.touch-modal-box h2{margin-top:0}
.touch-modal-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
@media(max-width:900px){
  .touch-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .touch-form-grid{grid-template-columns:1fr}
  .touch-summary{grid-template-columns:repeat(2,1fr)}
  .touch-summary div:nth-child(2){border-right:0}
  .touch-row{grid-template-columns:1fr}
  .touch-add-client{width:100%!important}
}
@media(max-width:520px){
  .touch-body{padding:0 4px}
  .touch-header{display:block}
  .touch-user-badge{display:inline-block;margin-top:8px}
  .touch-category{min-height:92px;font-size:16px}
  .touch-category small{font-size:28px}
  .touch-summary{grid-template-columns:1fr}
  .touch-summary div{border-right:0;border-bottom:1px solid #e5e7eb}
  .touch-summary div:last-child{border-bottom:0}
  .touch-actions{grid-template-columns:1fr}
}

/* V62 */
.touch-chip{background:#e5e7eb!important;border:2px solid #9ca3af!important;color:#111827!important}
.touch-chip.active{background:#2563eb!important;color:#fff!important;border-color:#1d4ed8!important}
.touch-qty-input{width:170px!important;max-width:100%;text-align:center;font-size:42px!important;font-weight:900!important;border-radius:18px!important;padding:10px!important}
.touch-qty-number{display:flex;flex-direction:column;align-items:center;justify-content:center}
.touch-guide-required{color:#b91c1c;font-weight:800;margin-top:6px}
.mov-edit-box{background:#f8fafc;border:1px solid #d1d5db;border-radius:14px;padding:12px;margin-top:10px}
.btn-edit{background:#2563eb!important;color:#fff!important}
@media print{
  @page{size:A4 landscape;margin:6mm}
  .ventas-cliente-print,.ventas-cliente-print table{width:100%!important;max-width:100%!important;table-layout:fixed!important}
  .ventas-cliente-print th,.ventas-cliente-print td{font-size:8px!important;padding:2px 3px!important;overflow-wrap:anywhere!important}
}


/* V65 fix cantidad táctil */
.touch-qty-input{
  -moz-appearance:textfield;
}
.touch-qty-input::-webkit-outer-spin-button,
.touch-qty-input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}


/* V65 ventas cliente ancho A4 */
.ventas-cliente-print,
.informe-a4{
  width:100%!important;
  max-width:none!important;
}
.ventas-cliente-print table{
  width:100%!important;
  table-layout:fixed;
}


/* V67 búsqueda cliente táctil */
button.touch-client-item{
  width:100%!important;
  border:0!important;
  border-bottom:1px solid #e5e7eb!important;
  text-align:left!important;
  cursor:pointer;
  font:inherit;
}
button.touch-client-item:last-child{
  border-bottom:0!important;
}


/* V69 búsqueda cliente táctil definitiva */
.touch-client-results{
  display:none;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:16px;
  overflow:hidden;
  margin-top:10px;
  box-shadow:0 10px 28px rgba(15,23,42,.12);
}
button.touch-client-item{
  width:100%!important;
  border:0!important;
  border-bottom:1px solid #e5e7eb!important;
  background:#fff!important;
  color:#111827!important;
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  padding:16px!important;
  text-align:left!important;
  cursor:pointer!important;
  font:inherit!important;
}
button.touch-client-item:last-child{
  border-bottom:0!important;
}
button.touch-client-item strong{
  display:block;
  font-size:18px;
}
button.touch-client-item span{
  display:block;
  margin-top:3px;
  color:#6b7280;
}
button.touch-client-item:active,
button.touch-client-item:hover{
  background:#eef2ff!important;
}
.touch-client-empty{
  padding:16px;
  color:#6b7280;
  font-weight:700;
}


/* V70 script táctil limpio */
.touch-client-results{
  display:none;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:16px;
  overflow:hidden;
  margin-top:10px;
  box-shadow:0 10px 28px rgba(15,23,42,.12);
}
button.touch-client-item{
  width:100%!important;
  border:0!important;
  border-bottom:1px solid #e5e7eb!important;
  background:#fff!important;
  color:#111827!important;
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  padding:16px!important;
  text-align:left!important;
  cursor:pointer!important;
  font:inherit!important;
}
button.touch-client-item:last-child{border-bottom:0!important}
button.touch-client-item strong{display:block;font-size:18px}
button.touch-client-item span{display:block;margin-top:3px;color:#6b7280}
button.touch-client-item:active,
button.touch-client-item:hover{background:#eef2ff!important}
.touch-client-empty{padding:16px;color:#6b7280;font-weight:700}
.touch-chip{background:#e5e7eb!important;border:2px solid #9ca3af!important;color:#111827!important}
.touch-chip.active{background:#2563eb!important;color:#fff!important;border-color:#1d4ed8!important}


/* V75 calibres táctiles en una sola fila */
.touch-calibres{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  gap:10px!important;
  padding-bottom:8px!important;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.touch-calibres .touch-chip{
  flex:0 0 auto!important;
  white-space:nowrap!important;
  min-width:88px!important;
}
.touch-calibres::-webkit-scrollbar{
  height:8px;
}
.touch-calibres::-webkit-scrollbar-thumb{
  background:#9ca3af;
  border-radius:999px;
}


/* V76 - Calibres táctiles en una sola fila SIN desplazamiento */
.touch-calibres{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:hidden!important;
  overflow-y:hidden!important;
  gap:6px!important;
  padding-bottom:0!important;
  width:100%!important;
  max-width:100%!important;
}

.touch-calibres .touch-chip{
  flex:1 1 0!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  padding:11px 6px!important;
  font-size:clamp(11px, 2.7vw, 16px)!important;
  line-height:1.05!important;
  text-align:center!important;
}

.touch-calibres::-webkit-scrollbar{
  display:none!important;
}

@media(max-width:520px){
  .touch-calibres{
    gap:4px!important;
  }

  .touch-calibres .touch-chip{
    padding:10px 4px!important;
    font-size:clamp(10px, 2.6vw, 14px)!important;
    border-radius:11px!important;
  }
}


/* V78 aviso fecha validada en edición */
.notice{
  background:#eff6ff;
  border:1px solid #93c5fd;
  color:#1e3a8a;
  border-radius:12px;
  padding:10px 12px;
  margin:10px 0;
  font-weight:700;
}
.notice.small{
  font-size:14px;
}


/* V80 iconos reales en categorías táctiles */
.touch-category{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}

.touch-category-icon{
  width:54px!important;
  height:54px!important;
  object-fit:contain!important;
  display:block!important;
  margin:0 auto 4px!important;
  filter:none!important;
}

@media(max-width:520px){
  .touch-category-icon{
    width:46px!important;
    height:46px!important;
  }

  .touch-category{
    gap:6px!important;
  }
}


/* V81 - Categorías táctiles en una sola fila + calibres más pequeños */
.touch-category-grid{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:hidden!important;
  overflow-y:hidden!important;
  gap:6px!important;
  width:100%!important;
  max-width:100%!important;
}

.touch-category{
  flex:1 1 0!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  min-height:86px!important;
  padding:8px 4px!important;
  font-size:clamp(10px, 2.2vw, 14px)!important;
  line-height:1.05!important;
  text-align:center!important;
  white-space:normal!important;
  overflow:hidden!important;
}

.touch-category-icon{
  width:42px!important;
  height:42px!important;
  object-fit:contain!important;
  margin:0 auto 4px!important;
}

.touch-calibres{
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:hidden!important;
  overflow-y:hidden!important;
  gap:4px!important;
  width:100%!important;
  max-width:100%!important;
}

.touch-calibres .touch-chip{
  flex:1 1 0!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  padding:8px 3px!important;
  font-size:clamp(8px, 2.1vw, 12px)!important;
  line-height:1!important;
  text-align:center!important;
  border-radius:10px!important;
}

/* Móvil estrecho: aún más compacto */
@media(max-width:520px){
  .touch-category-grid{
    gap:4px!important;
  }

  .touch-category{
    min-height:76px!important;
    padding:6px 2px!important;
    font-size:clamp(8px, 2.1vw, 11px)!important;
    border-radius:12px!important;
  }

  .touch-category-icon{
    width:34px!important;
    height:34px!important;
    margin-bottom:3px!important;
  }

  .touch-calibres{
    gap:3px!important;
  }

  .touch-calibres .touch-chip{
    padding:7px 2px!important;
    font-size:clamp(7px, 2vw, 10px)!important;
    border-radius:9px!important;
  }
}


/* V82 - Icono 22 dorado y pistola */
.touch-category-icon-text{
  width:54px!important;
  height:54px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0 auto 4px!important;
  border-radius:14px!important;
  background:linear-gradient(145deg,#facc15,#b45309)!important;
  color:#111827!important;
  font-weight:950!important;
  font-size:22px!important;
  line-height:1!important;
  border:2px solid #92400e!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), 0 3px 8px rgba(0,0,0,.18)!important;
}

@media(max-width:520px){
  .touch-category-icon-text{
    width:42px!important;
    height:42px!important;
    font-size:18px!important;
    border-radius:11px!important;
  }
}

.notice-error{
  background:#fee2e2!important;
  border-color:#ef4444!important;
  color:#7f1d1d!important;
}


/* V97 - Venta táctil como pantalla principal */
.admin-quick-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 14px 0;
  padding:10px;
  background:#eef6ff;
  border:1px solid #bfdbfe;
  border-radius:14px;
}
.admin-quick-actions a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  background:#ffffff;
  border:1px solid #cbd5e1;
  color:#0f172a;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
}
.admin-quick-actions a:hover{
  background:#dbeafe;
}
@media(max-width:700px){
  .admin-quick-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
  }
  .admin-quick-actions a{
    padding:9px 6px;
    font-size:12px;
  }
}


* V109 - Validar hasta fecha */
.validar-fecha-label{
  display:inline-block;
  margin-left:10px;
  margin-right:6px;
  font-weight:800;
}
input[name="validar_hasta_fecha"]{
  max-width:160px;
  min-height:36px;
  padding:6px 8px;
  border-radius:8px;
}


/* V110 - Filtro fecha libro */
.libro-filtro-fechas{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  gap:8px;
  padding:10px;
  margin:8px 0 10px 0;
  background:#f8fafc;
  border:1px solid #cbd5e1;
  border-radius:12px;
}
.libro-filtro-fechas label{
  font-weight:800;
  font-size:12px;
}
.libro-filtro-fechas input[type="date"]{
  min-height:36px;
  padding:6px 8px;
  border-radius:8px;
}
.libro-filtro-activo{
  margin:8px 0;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e3a8a;
}


/* V118 - Vista previa manual filtrada */
.libro-sin-vista{
  margin:8px 0;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}
button[name="accion_libro"],
.btn-vista-previa{
  background:#2563eb!important;
  color:white!important;
  font-weight:800!important;
}


/* V119 - Botón visible Mostrar vista previa */
.form-mostrar-vista-previa{
  display:inline-block!important;
  margin-right:8px!important;
}
.btn-vista-previa{
  background:#2563eb!important;
  color:#ffffff!important;
  border:0!important;
  border-radius:10px!important;
  padding:10px 16px!important;
  font-weight:900!important;
  min-height:40px!important;
  box-shadow:0 2px 8px rgba(37,99,235,.25)!important;
}
.btn-vista-previa:hover{
  background:#1d4ed8!important;
}


/* V122 - Filtro real y flujo limpio */
.form-mostrar-vista-previa{display:none!important;}
.barra-validar-asientos,
.bloque-asientos-sin-validar,
.asientos-sin-validar,
.vista-pendiente-preparar{
  display:none!important;
}
.libro-filter-actions{
  display:flex;
  align-items:end;
  margin-top:18px;
}
.btn-vista-previa{
  background:#2563eb!important;
  color:white!important;
  border:0!important;
  border-radius:10px!important;
  padding:10px 16px!important;
  font-weight:900!important;
  min-height:40px!important;
  box-shadow:0 2px 8px rgba(37,99,235,.25)!important;
}
.form-validar-vista-previa{
  display:inline-block!important;
  margin-right:8px!important;
}
.btn-validar-vista{
  background:#15803d!important;
  color:white!important;
  border:0!important;
  border-radius:10px!important;
  padding:10px 16px!important;
  font-weight:900!important;
  min-height:40px!important;
}
.hint-validar-vista{
  display:inline-block;
  padding:8px 12px;
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  color:#166534;
  border-radius:10px;
  font-weight:700;
}

/* V126 - asientos temporales solo en request actual */


/* V127 - Vista previa en pestaña independiente */
.v127-main-note{
  margin:10px 0;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e3a8a;
}
.btn-vista-previa{
  background:#2563eb!important;
  color:white!important;
  border:0!important;
  border-radius:10px!important;
  padding:10px 16px!important;
  font-weight:900!important;
  min-height:40px!important;
  width:100%;
}


/* V128 - Ocultar avisos inferiores del libro principal */
.libro-sin-vista,
.v127-main-note{
  display:none!important;
}




/* V131 - ocultar barra gris y tabla antigua en Libro registro principal */
.v131-hide-old-preview-table,
.v131-hide-old-grey-header,
.v130-hide-only-old-table {
  display:none!important;
}


/* V132 - Quitar explicaciones/recuadros azules en PDF/impresión */
@media print {
  .notice-blue,
  .notice-info,
  .alert-info,
  .libro-filtro-activo,
  .v127-main-note,
  .v120-ayuda-flujo,
  .libro-sin-vista,
  .no-print,
  .notice-print-hide {
    display:none!important;
  }
}

/* También oculto en pantalla los recuadros informativos azules del libro/exportación */
.notice-blue,
.notice-info,
.alert-info,
.libro-filtro-activo,
.v127-main-note {
  display:none!important;
}


/* ============================================================
   V133 - Venta mostrador táctil 10" horizontal sin scroll
   Aplicado a venta_touch.php para usuarios y admin
   ============================================================ */

html.venta-touch-page-v133,
body.venta-touch-10-v133{
  width:100%;
  height:100%;
  overflow:hidden!important;
  background:#f3f4f6!important;
}

body.venta-touch-10-v133{
  font-size:14px!important;
}

/* Ocultar menú lateral por defecto en venta táctil */
body.venta-touch-10-v133 aside,
body.venta-touch-10-v133 .sidebar,
body.venta-touch-10-v133 .side-menu,
body.venta-touch-10-v133 nav.sidebar,
body.venta-touch-10-v133 .left-menu{
  transform:translateX(-110%)!important;
  width:0!important;
  min-width:0!important;
  overflow:hidden!important;
}

/* Contenedor principal a pantalla completa */
body.venta-touch-10-v133 main,
body.venta-touch-10-v133 .main,
body.venta-touch-10-v133 .content,
body.venta-touch-10-v133 .page,
body.venta-touch-10-v133 .container{
  margin-left:0!important;
  max-width:none!important;
  width:100vw!important;
  height:100vh!important;
  padding:6px 10px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Título compacto */
body.venta-touch-10-v133 h1,
body.venta-touch-10-v133 h2{
  font-size:22px!important;
  margin:0 0 6px 0!important;
  line-height:1.1!important;
}

/* Bloques tipo tarjeta */
body.venta-touch-10-v133 .card,
body.venta-touch-10-v133 .panel,
body.venta-touch-10-v133 section,
body.venta-touch-10-v133 .v133-touch-block{
  border-radius:12px!important;
  padding:8px 10px!important;
  margin:5px 0!important;
  box-shadow:0 4px 12px rgba(15,23,42,.06)!important;
  box-sizing:border-box!important;
}

/* Formularios compactos en rejilla */
body.venta-touch-10-v133 form{
  display:grid!important;
  grid-template-columns:repeat(12, 1fr)!important;
  gap:6px 8px!important;
  align-items:end!important;
  height:calc(100vh - 12px)!important;
  overflow:hidden!important;
}

/* Campos base */
body.venta-touch-10-v133 label{
  font-size:12px!important;
  font-weight:800!important;
  margin-bottom:2px!important;
  color:#111827!important;
}

body.venta-touch-10-v133 input,
body.venta-touch-10-v133 select,
body.venta-touch-10-v133 textarea{
  min-height:40px!important;
  height:40px!important;
  border-radius:10px!important;
  font-size:16px!important;
  padding:6px 10px!important;
  box-sizing:border-box!important;
}

body.venta-touch-10-v133 textarea{
  height:44px!important;
  resize:none!important;
}

/* Buscar cliente ocupa zona superior amplia */
body.venta-touch-10-v133 .v133-cliente-search,
body.venta-touch-10-v133 input[placeholder*="Buscar"],
body.venta-touch-10-v133 input[placeholder*="cliente"],
body.venta-touch-10-v133 input[placeholder*="DNI"]{
  font-size:18px!important;
  height:46px!important;
  min-height:46px!important;
}

/* Botones táctiles */
body.venta-touch-10-v133 button,
body.venta-touch-10-v133 .btn,
body.venta-touch-10-v133 a.button,
body.venta-touch-10-v133 input[type="submit"]{
  min-height:42px!important;
  border-radius:11px!important;
  font-size:15px!important;
  font-weight:900!important;
  padding:8px 10px!important;
  touch-action:manipulation!important;
}

/* Categorías en una sola fila */
body.venta-touch-10-v133 .categorias,
body.venta-touch-10-v133 .categoria-buttons,
body.venta-touch-10-v133 [class*="categoria"] .buttons,
body.venta-touch-10-v133 .v133-touch-pill{
  white-space:nowrap!important;
}

body.venta-touch-10-v133 .v133-touch-pill{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:112px!important;
  max-width:160px!important;
  height:42px!important;
  margin:2px!important;
  background:#f8fafc!important;
  border:1px solid #d1d5db!important;
  color:#111827!important;
}

/* Calibres en una sola fila compacta */
body.venta-touch-10-v133 .v133-calibre-pill{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:58px!important;
  max-width:72px!important;
  height:38px!important;
  margin:2px!important;
  font-size:14px!important;
  padding:6px!important;
  background:#f8fafc!important;
  border:1px solid #cbd5e1!important;
  color:#111827!important;
}

/* Atajos cantidad */
body.venta-touch-10-v133 .v133-qty-shortcut{
  min-width:72px!important;
  height:42px!important;
  font-size:20px!important;
  color:#075985!important;
}

/* Cantidad central grande */
body.venta-touch-10-v133 .v133-cantidad-input,
body.venta-touch-10-v133 input[name*="cantidad"]{
  height:58px!important;
  min-height:58px!important;
  font-size:36px!important;
  font-weight:900!important;
  text-align:center!important;
  border:2px solid #111827!important;
}

/* Botones más/menos */
body.venta-touch-10-v133 button:has(+ input[name*="cantidad"]),
body.venta-touch-10-v133 button[onclick*="cantidad"],
body.venta-touch-10-v133 .qty-minus,
body.venta-touch-10-v133 .qty-plus{
  height:58px!important;
  min-width:90px!important;
  font-size:36px!important;
  background:#1d4ed8!important;
  color:white!important;
}

/* Guardar y limpiar fijos abajo */
body.venta-touch-10-v133 .v133-save-main,
body.venta-touch-10-v133 button[type="submit"],
body.venta-touch-10-v133 input[type="submit"]{
  background:#15803d!important;
  color:white!important;
  height:54px!important;
  min-height:54px!important;
  font-size:20px!important;
}

body.venta-touch-10-v133 .v133-clear-main{
  background:#dc2626!important;
  color:white!important;
  height:54px!important;
  min-height:54px!important;
  font-size:20px!important;
}

/* Mensajes compactos */
body.venta-touch-10-v133 .notice,
body.venta-touch-10-v133 .alert,
body.venta-touch-10-v133 .error,
body.venta-touch-10-v133 .success{
  padding:6px 10px!important;
  margin:3px 0!important;
  font-size:13px!important;
  border-radius:8px!important;
}

/* Ajustes para 10 pulgadas horizontal */
@media (max-width:1100px) and (max-height:820px){
  body.venta-touch-10-v133 main,
  body.venta-touch-10-v133 .main,
  body.venta-touch-10-v133 .content,
  body.venta-touch-10-v133 .page,
  body.venta-touch-10-v133 .container{
    padding:4px 8px!important;
  }

  body.venta-touch-10-v133 form{
    gap:5px 7px!important;
  }

  body.venta-touch-10-v133 .card,
  body.venta-touch-10-v133 .panel,
  body.venta-touch-10-v133 section,
  body.venta-touch-10-v133 .v133-touch-block{
    padding:6px 8px!important;
    margin:4px 0!important;
  }

  body.venta-touch-10-v133 h1,
  body.venta-touch-10-v133 h2{
    font-size:20px!important;
  }

  body.venta-touch-10-v133 input,
  body.venta-touch-10-v133 select{
    height:38px!important;
    min-height:38px!important;
  }

  body.venta-touch-10-v133 .v133-touch-pill{
    min-width:96px!important;
    height:38px!important;
    font-size:13px!important;
  }

  body.venta-touch-10-v133 .v133-calibre-pill{
    min-width:50px!important;
    height:34px!important;
    font-size:12px!important;
  }

  body.venta-touch-10-v133 .v133-cantidad-input,
  body.venta-touch-10-v133 input[name*="cantidad"]{
    height:50px!important;
    min-height:50px!important;
    font-size:30px!important;
  }

  body.venta-touch-10-v133 textarea{
    height:38px!important;
  }
}


/* V134 - PDF ventas cliente columnas centradas */
@media print{
  body table th,
  body table td{
    text-align:center!important;
    vertical-align:middle!important;
  }
  body td.num,
  body th.num{
    text-align:center!important;
  }
}


/* V135 - Venta mostrador táctil real 10": todo visible, sin pantalla en blanco */
body.venta-touch-screen{
  overflow:hidden;
  background:#f3f4f6;
}
body.venta-touch-screen .main{
  padding:6px 14px!important;
  overflow:hidden!important;
  height:100vh;
}
body.venta-touch-screen .main > h1{
  position:absolute!important;
  left:-9999px!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  margin:0!important;
  padding:0!important;
}
body.venta-touch-screen .touch-body{
  max-width:1180px!important;
  height:calc(100vh - 12px);
  margin:0 auto!important;
  display:grid;
  grid-template-rows:54px 66px 1fr;
  gap:8px;
}
body.venta-touch-screen .touch-header{
  margin:0!important;
  min-height:0;
}
body.venta-touch-screen .touch-logo{
  font-size:22px!important;
  line-height:1.1;
}
body.venta-touch-screen .touch-user-badge{
  padding:8px 14px!important;
  font-size:14px;
}
body.venta-touch-screen .touch-card{
  margin:0!important;
  padding:10px!important;
  border-radius:18px!important;
  box-shadow:0 4px 16px rgba(15,23,42,.08)!important;
}
body.venta-touch-screen .touch-row{
  grid-template-columns:1fr 150px!important;
  gap:10px!important;
  align-items:center!important;
}
body.venta-touch-screen .touch-search{
  height:44px!important;
  font-size:18px!important;
  padding:8px 12px!important;
  border-radius:10px!important;
}
body.venta-touch-screen .touch-add-client{
  height:44px!important;
  min-width:0!important;
  padding:8px 10px!important;
  border-radius:10px!important;
  font-size:16px!important;
}
body.venta-touch-screen #formVentaTouch{
  min-height:0;
  display:grid!important;
  grid-template-columns:1.05fr 1.15fr .9fr;
  grid-template-rows:76px 1fr 112px 72px;
  gap:8px;
  overflow:hidden!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1){grid-column:1;grid-row:1;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(2){grid-column:1;grid-row:2 / span 2;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(3){grid-column:2;grid-row:1 / span 2;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(4){grid-column:3;grid-row:1 / span 2;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(5){grid-column:2;grid-row:3;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(6){grid-column:3;grid-row:3;}
body.venta-touch-screen #formVentaTouch > .touch-actions{grid-column:1 / -1;grid-row:4;}
body.venta-touch-screen .touch-step-title{
  font-size:14px!important;
  margin:0 0 6px!important;
}
body.venta-touch-screen .touch-summary{
  grid-template-columns:1fr 1fr!important;
  gap:4px!important;
  padding:6px!important;
  border-radius:12px!important;
}
body.venta-touch-screen .touch-summary div{
  padding:4px 6px!important;
}
body.venta-touch-screen .touch-summary span{
  font-size:11px!important;
}
body.venta-touch-screen .touch-summary strong{
  font-size:13px!important;
  margin-top:2px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.venta-touch-screen .touch-category-grid{
  height:calc(100% - 22px);
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(66px,1fr);
  gap:7px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-category{
  min-height:0!important;
  padding:8px 6px!important;
  border-radius:14px!important;
  font-size:14px!important;
  line-height:1.1;
}
body.venta-touch-screen .touch-category-icon{
  max-height:30px!important;
  max-width:44px!important;
  object-fit:contain;
  display:block;
  margin:0 auto 4px;
}
body.venta-touch-screen .touch-category-icon-text{
  display:block;
  font-size:26px!important;
  line-height:1;
  margin-bottom:3px;
}
body.venta-touch-screen .touch-calibres{
  height:calc(100% - 22px);
  overflow:hidden!important;
  align-content:flex-start;
  gap:6px!important;
}
body.venta-touch-screen .touch-chip{
  min-width:64px!important;
  padding:9px 11px!important;
  border-radius:11px!important;
  font-size:14px!important;
}
body.venta-touch-screen .touch-form-grid{
  grid-template-columns:1fr!important;
  gap:6px!important;
}
body.venta-touch-screen .touch-form-grid label{
  font-size:12px!important;
}
body.venta-touch-screen .touch-form-grid input{
  height:36px!important;
  font-size:14px!important;
  padding:6px 9px!important;
  border-radius:10px!important;
}
body.venta-touch-screen .touch-help,
body.venta-touch-screen .touch-guide-required{
  font-size:11px!important;
  margin-top:3px!important;
  line-height:1.15;
}
body.venta-touch-screen .touch-qty{
  grid-template-columns:46px 1fr 46px!important;
  gap:7px!important;
}
body.venta-touch-screen .touch-qty button{
  width:46px!important;
  height:44px!important;
  border-radius:12px!important;
  font-size:26px!important;
}
body.venta-touch-screen .touch-qty-input{
  width:105px!important;
  height:42px!important;
  font-size:26px!important;
  padding:4px!important;
  border-radius:12px!important;
}
body.venta-touch-screen .touch-qty-number span{
  font-size:11px!important;
}
body.venta-touch-screen .touch-fast{
  gap:6px!important;
  margin-top:7px!important;
}
body.venta-touch-screen .touch-fast button{
  min-width:62px!important;
  padding:7px 9px!important;
  border-radius:10px!important;
  font-size:14px!important;
}
body.venta-touch-screen .touch-alert{
  padding:6px 8px!important;
  font-size:12px!important;
  border-radius:10px!important;
  margin-top:6px!important;
}
body.venta-touch-screen .touch-actions{
  position:static!important;
  grid-template-columns:.35fr .65fr!important;
  gap:8px!important;
  align-items:stretch;
}
body.venta-touch-screen .touch-actions button,
body.venta-touch-screen .touch-actions a{
  padding:13px 12px!important;
  font-size:18px!important;
  border-radius:14px!important;
  display:flex;
  align-items:center;
  justify-content:center;
}
body.venta-touch-screen .touch-client-results{
  position:absolute;
  left:0;
  right:0;
  top:48px;
  z-index:5000;
  max-height:290px;
  overflow:auto;
  box-shadow:0 18px 50px rgba(15,23,42,.18);
}
body.venta-touch-screen .touch-row > div:first-child{
  position:relative;
}
body.venta-touch-screen .admin-quick-actions.venta-11-screen{
  display:none!important;
}
@media(max-width:900px){
  body.venta-touch-screen .touch-body{grid-template-rows:52px 64px 1fr;}
  body.venta-touch-screen #formVentaTouch{
    grid-template-columns:1fr 1fr;
    grid-template-rows:72px 1fr 104px 68px;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1){grid-column:1;grid-row:1;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(2){grid-column:1;grid-row:2 / span 2;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(3){grid-column:2;grid-row:1;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(4){grid-column:2;grid-row:2;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(5){grid-column:2;grid-row:3;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(6){display:none;}
  body.venta-touch-screen #formVentaTouch > .touch-actions{grid-column:1 / -1;grid-row:4;}
}


/* V136 - Reparación definitiva venta mostrador PC/tablet: sin pantalla blanca ni desorden */
body.venta-touch-screen{
  margin:0!important;
  overflow:hidden!important;
  background:#f3f4f6!important;
}
body.venta-touch-screen .app{
  min-height:100vh!important;
  display:block!important;
}
body.venta-touch-screen .sidebar,
body.venta-touch-screen .menu-overlay{
  display:none!important;
}
body.venta-touch-screen .menu-toggle{
  left:0!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  width:40px!important;
  height:76px!important;
  min-height:76px!important;
  border-radius:0 10px 10px 0!important;
  font-size:20px!important;
}
body.venta-touch-screen .main{
  margin:0!important;
  width:100%!important;
  max-width:none!important;
  height:100vh!important;
  padding:8px 18px 10px 18px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .main > h1{
  display:none!important;
}
body.venta-touch-screen .touch-body{
  width:min(1180px, calc(100vw - 36px))!important;
  max-width:none!important;
  height:calc(100vh - 18px)!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-rows:58px 68px minmax(0,1fr)!important;
  gap:8px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-header{
  height:58px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
}
body.venta-touch-screen .touch-card{
  margin:0!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-body > .touch-card{
  height:68px!important;
  padding:9px 12px!important;
}
body.venta-touch-screen #formVentaTouch{
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  display:grid!important;
  grid-template-columns:1fr 1.08fr .92fr!important;
  grid-template-rows:78px minmax(0,1fr) 118px 66px!important;
  gap:8px!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.venta-touch-screen #formVentaTouch > input[type="hidden"]{
  display:none!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card{
  min-height:0!important;
  overflow:hidden!important;
  padding:10px!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(3){grid-column:2!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(4){grid-column:3!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(6){grid-column:3!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch > .touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
body.venta-touch-screen .touch-category-grid{
  height:calc(100% - 24px)!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(54px,1fr)!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-calibres{
  max-height:calc(100% - 24px)!important;
  overflow:auto!important;
}
body.venta-touch-screen .touch-form-grid{
  max-height:calc(100% - 24px)!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-summary{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
@media (min-width:1300px){
  body.venta-touch-screen .touch-body{width:1180px!important;}
}
@media (max-width:900px){
  body.venta-touch-screen .main{padding:6px 8px 8px 42px!important;}
  body.venta-touch-screen .touch-body{width:calc(100vw - 50px)!important;grid-template-rows:54px 64px minmax(0,1fr)!important;}
  body.venta-touch-screen #formVentaTouch{
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:74px minmax(0,1fr) 112px 62px!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(3){grid-column:2!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(4){grid-column:2!important;grid-row:2!important;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(6){display:none!important;}
  body.venta-touch-screen #formVentaTouch > .touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
}


/* ============================================================
   V137 - Venta mostrador: menú funcional + grid estable PC/tablet
   ============================================================ */
body.venta-touch-screen{
  margin:0!important;
  overflow:hidden!important;
  background:#f3f4f6!important;
}
body.venta-touch-screen .app{display:block!important;min-height:100vh!important;}
body.venta-touch-screen .main{
  margin-left:0!important;
  width:100vw!important;
  max-width:none!important;
  height:100vh!important;
  padding:8px 18px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .main>h1{display:none!important;}

/* Menú lateral: oculto por defecto, pero abre con el botón */
body.venta-touch-screen .sidebar{
  display:block!important;
  width:285px!important;
  min-width:285px!important;
  transform:translateX(-110%)!important;
  transition:transform .22s ease!important;
  z-index:7000!important;
}
body.venta-touch-screen.menu-open .sidebar{
  transform:translateX(0)!important;
}
body.venta-touch-screen .menu-overlay{display:none!important;}
body.venta-touch-screen.menu-open .menu-overlay{
  display:block!important;
  position:fixed!important;
  inset:0!important;
  background:rgba(0,0,0,.35)!important;
  z-index:6500!important;
}
body.venta-touch-screen .menu-toggle{
  display:flex!important;
  position:fixed!important;
  left:0!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  z-index:7600!important;
  width:42px!important;
  height:76px!important;
  min-height:76px!important;
  border-radius:0 12px 12px 0!important;
  font-size:22px!important;
}
body.venta-touch-screen.menu-open .menu-toggle{
  left:285px!important;
}

body.venta-touch-screen .touch-body{
  width:min(1180px, calc(100vw - 36px))!important;
  max-width:none!important;
  height:calc(100vh - 16px)!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-rows:58px 68px minmax(0,1fr)!important;
  gap:8px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-header{
  height:58px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
}
body.venta-touch-screen .touch-logo{font-size:22px!important;line-height:1.08!important;}
body.venta-touch-screen .touch-user-badge{padding:8px 14px!important;font-size:14px!important;}
body.venta-touch-screen .touch-body>.touch-card{
  height:68px!important;
  padding:9px 12px!important;
  margin:0!important;
  overflow:visible!important;
}
body.venta-touch-screen .touch-row{
  grid-template-columns:1fr 150px!important;
  gap:10px!important;
  align-items:center!important;
}
body.venta-touch-screen .touch-search{
  height:44px!important;
  min-height:44px!important;
  font-size:18px!important;
  padding:8px 12px!important;
  border-radius:10px!important;
}
body.venta-touch-screen .touch-add-client{
  height:44px!important;
  min-height:44px!important;
  padding:8px 10px!important;
  border-radius:10px!important;
  font-size:16px!important;
}
body.venta-touch-screen .touch-row>div:first-child{position:relative!important;}
body.venta-touch-screen .touch-client-results{
  position:absolute!important;
  left:0!important;right:0!important;top:48px!important;
  z-index:8000!important;
  max-height:300px!important;
  overflow:auto!important;
}

/* Grid principal cerrado: evita huecos blancos y descuadres */
body.venta-touch-screen #formVentaTouch{
  height:100%!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:1fr 1.08fr .92fr!important;
  grid-template-rows:76px 254px 122px 64px!important;
  gap:8px!important;
  align-content:start!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
body.venta-touch-screen #formVentaTouch>input[type="hidden"]{display:none!important;}
body.venta-touch-screen #formVentaTouch>.touch-card{
  margin:0!important;
  padding:10px!important;
  min-height:0!important;
  overflow:hidden!important;
  border-radius:18px!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){grid-column:3!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){grid-column:3!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch>.touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
body.venta-touch-screen .touch-step-title{font-size:14px!important;margin:0 0 6px!important;line-height:1.1!important;}
body.venta-touch-screen .touch-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;padding:6px!important;border-radius:12px!important;}
body.venta-touch-screen .touch-summary div{padding:4px 6px!important;min-width:0!important;}
body.venta-touch-screen .touch-summary span{font-size:11px!important;}
body.venta-touch-screen .touch-summary strong{font-size:13px!important;margin-top:2px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen .touch-category-grid{
  height:calc(100% - 22px)!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:64px!important;
  gap:7px!important;
  overflow:hidden!important;
  align-content:start!important;
}
body.venta-touch-screen .touch-category{
  min-height:0!important;
  height:64px!important;
  padding:6px!important;
  border-radius:14px!important;
  font-size:14px!important;
  line-height:1.05!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
}
body.venta-touch-screen .touch-category-icon{max-height:28px!important;max-width:44px!important;object-fit:contain!important;margin:0 auto 3px!important;display:block!important;}
body.venta-touch-screen .touch-category-icon-text{font-size:25px!important;line-height:1!important;margin:0 0 2px!important;display:block!important;}
body.venta-touch-screen .touch-calibres{height:calc(100% - 22px)!important;max-height:none!important;overflow:auto!important;align-content:flex-start!important;gap:6px!important;}
body.venta-touch-screen .touch-chip{min-width:64px!important;padding:9px 10px!important;border-radius:11px!important;font-size:14px!important;}
body.venta-touch-screen .touch-form-grid{grid-template-columns:1fr!important;gap:6px!important;height:calc(100% - 22px)!important;overflow:hidden!important;}
body.venta-touch-screen .touch-form-grid label{font-size:12px!important;line-height:1!important;}
body.venta-touch-screen .touch-form-grid input{height:35px!important;min-height:35px!important;font-size:14px!important;padding:6px 9px!important;border-radius:10px!important;}
body.venta-touch-screen .touch-help,body.venta-touch-screen .touch-guide-required{font-size:11px!important;line-height:1.12!important;margin-top:3px!important;}
body.venta-touch-screen .touch-qty{grid-template-columns:46px 1fr 46px!important;gap:7px!important;}
body.venta-touch-screen .touch-qty button{width:46px!important;height:44px!important;min-height:44px!important;border-radius:12px!important;font-size:26px!important;}
body.venta-touch-screen .touch-qty-input{width:105px!important;height:42px!important;min-height:42px!important;font-size:26px!important;padding:4px!important;border-radius:12px!important;}
body.venta-touch-screen .touch-qty-number span{font-size:11px!important;}
body.venta-touch-screen .touch-fast{gap:6px!important;margin-top:7px!important;}
body.venta-touch-screen .touch-fast button{min-width:62px!important;min-height:34px!important;padding:6px 9px!important;border-radius:10px!important;font-size:14px!important;}
body.venta-touch-screen .touch-alert{padding:6px 8px!important;font-size:12px!important;border-radius:10px!important;margin-top:6px!important;}
body.venta-touch-screen .touch-actions{position:static!important;display:grid!important;grid-template-columns:.35fr .65fr!important;gap:8px!important;}
body.venta-touch-screen .touch-actions button,body.venta-touch-screen .touch-actions a{padding:12px!important;font-size:18px!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:center!important;min-height:0!important;}
body.venta-touch-screen .admin-quick-actions.venta-11-screen{display:none!important;}

@media (max-width:1200px){
  body.venta-touch-screen .main{padding-left:44px!important;}
  body.venta-touch-screen .touch-body{width:calc(100vw - 62px)!important;}
}
@media (max-width:900px){
  body.venta-touch-screen .sidebar{width:min(82vw,330px)!important;min-width:min(82vw,330px)!important;}
  body.venta-touch-screen.menu-open .menu-toggle{left:min(82vw,330px)!important;}
  body.venta-touch-screen .main{padding:6px 8px 8px 44px!important;}
  body.venta-touch-screen .touch-body{width:calc(100vw - 52px)!important;grid-template-rows:54px 64px minmax(0,1fr)!important;}
  body.venta-touch-screen #formVentaTouch{
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:72px 242px 112px 60px!important;
  }
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){grid-column:2!important;grid-row:2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){display:none!important;}
  body.venta-touch-screen #formVentaTouch>.touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
}

/* ============================================================
   V138 - Venta mostrador: calibres/cantidad dentro del recuadro
          + campos condicionales Transporte / Recarga
   ============================================================ */
body.venta-touch-screen #formVentaTouch{
  grid-template-columns:1.05fr 1.05fr .90fr!important;
  grid-template-rows:76px 268px 122px 64px!important;
  gap:8px!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card{
  overflow:hidden!important;
}
body.venta-touch-screen #cardCalibre{
  overflow:hidden!important;
}
body.venta-touch-screen .touch-calibres{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(68px,1fr))!important;
  grid-auto-rows:minmax(34px,auto)!important;
  height:calc(100% - 22px)!important;
  max-height:100%!important;
  overflow:hidden!important;
  gap:5px!important;
  align-content:start!important;
  padding:0!important;
}
body.venta-touch-screen .touch-calibres .touch-chip,
body.venta-touch-screen .touch-chip{
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  height:34px!important;
  min-height:34px!important;
  padding:5px 4px!important;
  border-radius:9px!important;
  font-size:clamp(10px,1.05vw,13px)!important;
  line-height:1.05!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){
  overflow:hidden!important;
}
body.venta-touch-screen .touch-qty{
  grid-template-columns:42px minmax(82px,1fr) 42px!important;
  gap:6px!important;
  width:100%!important;
  max-width:100%!important;
}
body.venta-touch-screen .touch-qty button{
  width:42px!important;
  height:40px!important;
  min-height:40px!important;
  padding:0!important;
  font-size:24px!important;
}
body.venta-touch-screen .touch-qty-number{
  min-width:0!important;
  width:100%!important;
}
body.venta-touch-screen .touch-qty-input{
  width:100%!important;
  max-width:118px!important;
  height:40px!important;
  min-height:40px!important;
  font-size:24px!important;
}
body.venta-touch-screen .touch-fast{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:5px!important;
  margin-top:6px!important;
}
body.venta-touch-screen .touch-fast button{
  width:100%!important;
  min-width:0!important;
  min-height:31px!important;
  padding:5px!important;
  font-size:13px!important;
}
body.venta-touch-screen .touch-form-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:4px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-extra-field{
  display:none;
}
body.venta-touch-screen .touch-form-grid input{
  height:31px!important;
  min-height:31px!important;
  font-size:13px!important;
  padding:5px 8px!important;
}
body.venta-touch-screen .touch-form-grid label{
  font-size:11px!important;
  margin-bottom:1px!important;
}
body.venta-touch-screen .touch-help,
body.venta-touch-screen .touch-guide-required{
  font-size:10px!important;
  line-height:1.05!important;
  margin-top:2px!important;
}
@media (max-width:900px){
  body.venta-touch-screen #formVentaTouch{
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:72px 252px 120px 60px!important;
  }
  body.venta-touch-screen .touch-calibres{
    grid-template-columns:repeat(auto-fit,minmax(58px,1fr))!important;
  }
}


/* ============================================================
   V139 - Corrección visual cantidad dentro de su recuadro
   ============================================================ */
body.venta-touch-screen #formVentaTouch{
  grid-template-rows:76px 252px 146px 60px!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){
  display:grid!important;
  grid-template-rows:auto 52px 38px minmax(0,1fr)!important;
  gap:6px!important;
  padding:10px!important;
  overflow:hidden!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5) .touch-step-title{
  margin:0!important;
  line-height:16px!important;
}
body.venta-touch-screen .touch-qty{
  display:grid!important;
  grid-template-columns:48px minmax(96px,1fr) 48px!important;
  gap:8px!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
}
body.venta-touch-screen .touch-qty button{
  width:48px!important;
  height:48px!important;
  min-height:48px!important;
  max-height:48px!important;
  border-radius:12px!important;
  padding:0!important;
  font-size:26px!important;
  line-height:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.venta-touch-screen .touch-qty-number{
  min-width:0!important;
  width:100%!important;
  height:52px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-qty-input{
  width:100%!important;
  max-width:none!important;
  height:36px!important;
  min-height:36px!important;
  box-sizing:border-box!important;
  font-size:24px!important;
  line-height:1!important;
  padding:2px 6px!important;
  margin:0!important;
  border-radius:11px!important;
  text-align:center!important;
}
body.venta-touch-screen .touch-qty-number span{
  height:14px!important;
  line-height:14px!important;
  margin-top:1px!important;
  font-size:11px!important;
  display:block!important;
}
body.venta-touch-screen .touch-fast{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  margin:0!important;
  width:100%!important;
  max-width:100%!important;
}
body.venta-touch-screen .touch-fast button{
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:4px 6px!important;
  font-size:13px!important;
  line-height:1!important;
  border-radius:10px!important;
}
body.venta-touch-screen #aviso100{
  margin:0!important;
  padding:5px 8px!important;
  font-size:11px!important;
  line-height:1.1!important;
}
@media (max-width:900px){
  body.venta-touch-screen #formVentaTouch{
    grid-template-rows:72px 238px 142px 58px!important;
  }
  body.venta-touch-screen .touch-qty{
    grid-template-columns:44px minmax(82px,1fr) 44px!important;
    gap:6px!important;
  }
  body.venta-touch-screen .touch-qty button{
    width:44px!important;
    height:44px!important;
    min-height:44px!important;
  }
}


/* ============================================================
   V140 DEFINITIVA - Venta mostrador PC + tablet 10 pulgadas
   Objetivo: una sola pantalla estable, sin scroll, menu funcional,
   calibres y cantidad siempre dentro de su recuadro.
   ============================================================ */
html, body.venta-touch-screen{
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  overflow:hidden!important;
  background:#f3f4f6!important;
}
body.venta-touch-screen h1{
  display:none!important;
}
body.venta-touch-screen .app{
  height:100vh!important;
  min-height:100vh!important;
  overflow:hidden!important;
}
body.venta-touch-screen .main{
  height:100vh!important;
  min-height:100vh!important;
  overflow:hidden!important;
  padding:8px 16px 10px 54px!important;
  background:#f3f4f6!important;
}
body.venta-touch-screen.menu-open .main{
  padding-left:54px!important;
}
body.venta-touch-screen .menu-toggle{
  z-index:2000!important;
}
body.venta-touch-screen .touch-body{
  width:min(1180px,calc(100vw - 86px))!important;
  height:calc(100vh - 18px)!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-rows:58px 68px minmax(0,1fr)!important;
  gap:8px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-header{
  height:58px!important;
  min-height:58px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  padding:0 6px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-logo{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  font-weight:900!important;
  font-size:24px!important;
  line-height:1.02!important;
}
body.venta-touch-screen .touch-logo small{font-size:19px!important;}
body.venta-touch-screen .touch-user-badge{
  padding:9px 16px!important;
  border-radius:22px!important;
  font-size:14px!important;
  white-space:nowrap!important;
}
body.venta-touch-screen .touch-body > .touch-card{
  min-height:0!important;
  padding:10px!important;
  border-radius:16px!important;
  overflow:visible!important;
}
body.venta-touch-screen .touch-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 150px!important;
  gap:10px!important;
  align-items:center!important;
}
body.venta-touch-screen .touch-search{
  height:46px!important;
  min-height:46px!important;
  font-size:18px!important;
  border-radius:10px!important;
}
body.venta-touch-screen .touch-add-client{
  height:44px!important;
  min-height:44px!important;
  border-radius:10px!important;
  font-size:17px!important;
  padding:0 12px!important;
}
body.venta-touch-screen #formVentaTouch{
  min-height:0!important;
  height:100%!important;
  display:grid!important;
  grid-template-columns:1.04fr 1.12fr .94fr!important;
  grid-template-rows:76px minmax(0,1fr) 152px 58px!important;
  gap:8px!important;
  overflow:hidden!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card{
  min-width:0!important;
  min-height:0!important;
  padding:10px!important;
  border-radius:16px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){grid-column:3!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){grid-column:3!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch>.touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
body.venta-touch-screen .touch-step-title{
  font-size:15px!important;
  line-height:18px!important;
  margin:0 0 7px!important;
  font-weight:900!important;
  white-space:normal!important;
}
body.venta-touch-screen .touch-summary{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
  padding:6px!important;
}
body.venta-touch-screen .touch-summary div{min-width:0!important;padding:5px 7px!important;}
body.venta-touch-screen .touch-summary span{font-size:11px!important;}
body.venta-touch-screen .touch-summary strong{font-size:13px!important;line-height:16px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen .touch-category-grid{
  height:calc(100% - 25px)!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(54px,1fr)!important;
  gap:7px!important;
  overflow:hidden!important;
  align-content:start!important;
}
body.venta-touch-screen .touch-category{
  min-width:0!important;
  width:100%!important;
  height:100%!important;
  min-height:54px!important;
  max-height:82px!important;
  padding:5px!important;
  border-radius:12px!important;
  font-size:13px!important;
  line-height:1.08!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-category-icon{max-width:42px!important;max-height:26px!important;object-fit:contain!important;margin:0 0 3px!important;}
body.venta-touch-screen .touch-category-icon-text{font-size:24px!important;line-height:1!important;margin:0!important;}
body.venta-touch-screen #cardCalibre{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
}
body.venta-touch-screen .touch-calibres{
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(78px,1fr))!important;
  grid-auto-rows:38px!important;
  gap:6px!important;
  overflow:hidden!important;
  align-content:start!important;
  padding:0!important;
}
body.venta-touch-screen .touch-chip{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  padding:4px 5px!important;
  border-radius:10px!important;
  font-size:clamp(10px,1vw,13px)!important;
  line-height:1.05!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}
body.venta-touch-screen .touch-form-grid{
  height:calc(100% - 25px)!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-auto-rows:min-content!important;
  gap:5px!important;
  overflow:hidden!important;
  align-content:start!important;
}
body.venta-touch-screen .touch-form-grid label{font-size:11px!important;line-height:13px!important;margin-bottom:2px!important;}
body.venta-touch-screen .touch-form-grid input{height:31px!important;min-height:31px!important;font-size:13px!important;padding:5px 8px!important;border-radius:9px!important;}
body.venta-touch-screen .touch-help,
body.venta-touch-screen .touch-guide-required{font-size:10px!important;line-height:1.08!important;margin-top:2px!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){
  display:grid!important;
  grid-template-rows:auto 52px 36px minmax(0,1fr)!important;
  gap:6px!important;
}
body.venta-touch-screen .touch-qty{
  display:grid!important;
  grid-template-columns:50px minmax(90px,1fr) 50px!important;
  gap:8px!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
}
body.venta-touch-screen .touch-qty button{
  width:50px!important;
  height:50px!important;
  min-height:50px!important;
  max-height:50px!important;
  padding:0!important;
  border-radius:12px!important;
  font-size:27px!important;
  line-height:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.venta-touch-screen .touch-qty-number{
  min-width:0!important;
  width:100%!important;
  height:52px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-qty-input{
  width:100%!important;
  max-width:none!important;
  height:36px!important;
  min-height:36px!important;
  box-sizing:border-box!important;
  font-size:24px!important;
  line-height:1!important;
  text-align:center!important;
  padding:2px 6px!important;
  margin:0!important;
  border-radius:11px!important;
}
body.venta-touch-screen .touch-qty-number span{height:13px!important;line-height:13px!important;font-size:11px!important;margin-top:1px!important;}
body.venta-touch-screen .touch-fast{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  margin:0!important;
  width:100%!important;
}
body.venta-touch-screen .touch-fast button{
  width:100%!important;
  min-width:0!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:4px 6px!important;
  border-radius:10px!important;
  font-size:13px!important;
  line-height:1!important;
}
body.venta-touch-screen #atajosPolvora[style*="flex"]{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
body.venta-touch-screen #aviso100{margin:0!important;padding:5px 8px!important;font-size:11px!important;line-height:1.1!important;overflow:hidden!important;}
body.venta-touch-screen .touch-actions{
  position:static!important;
  display:grid!important;
  grid-template-columns:.35fr .65fr!important;
  gap:8px!important;
  min-height:0!important;
}
body.venta-touch-screen .touch-actions button,
body.venta-touch-screen .touch-actions a{
  min-height:0!important;
  height:58px!important;
  padding:0 12px!important;
  border-radius:14px!important;
  font-size:18px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
@media (max-width:900px), (pointer:coarse){
  body.venta-touch-screen .main{padding:6px 8px 8px 46px!important;}
  body.venta-touch-screen .touch-body{width:calc(100vw - 58px)!important;height:calc(100vh - 14px)!important;grid-template-rows:54px 64px minmax(0,1fr)!important;}
  body.venta-touch-screen .touch-logo{font-size:21px!important;}
  body.venta-touch-screen .touch-logo small{font-size:17px!important;}
  body.venta-touch-screen #formVentaTouch{
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:70px minmax(0,1fr) 146px 56px!important;
  }
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:1 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){display:none!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){display:none!important;}
  body.venta-touch-screen #formVentaTouch>.touch-actions{grid-column:1 / -1!important;grid-row:4!important;}
  body.venta-touch-screen .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(70px,1fr))!important;grid-auto-rows:36px!important;}
  body.venta-touch-screen .touch-chip{height:36px!important;min-height:36px!important;max-height:36px!important;font-size:11px!important;}
  body.venta-touch-screen .touch-category-grid{grid-auto-rows:minmax(50px,1fr)!important;}
  body.venta-touch-screen .touch-qty{grid-template-columns:46px minmax(82px,1fr) 46px!important;gap:6px!important;}
  body.venta-touch-screen .touch-qty button{width:46px!important;height:46px!important;min-height:46px!important;}
}
@media (max-width:700px){
  body.venta-touch-screen .touch-body{width:calc(100vw - 54px)!important;}
  body.venta-touch-screen .touch-row{grid-template-columns:1fr 116px!important;gap:6px!important;}
  body.venta-touch-screen .touch-add-client{font-size:15px!important;}
  body.venta-touch-screen #formVentaTouch{gap:6px!important;}
}

/* ============================================================
   V141 - Cantidad compacta: evita que el número quede tapado por - / +
   ============================================================ */
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){
  grid-template-rows:auto 44px 31px minmax(0,1fr)!important;
  gap:5px!important;
  padding:9px!important;
}
body.venta-touch-screen .touch-qty{
  display:grid!important;
  grid-template-columns:36px 78px 36px!important;
  gap:7px!important;
  justify-content:center!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-qty button{
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  padding:0!important;
  border-radius:10px!important;
  font-size:22px!important;
  line-height:1!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-qty-number{
  width:78px!important;
  min-width:78px!important;
  max-width:78px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  overflow:visible!important;
}
body.venta-touch-screen .touch-qty-input{
  width:78px!important;
  min-width:78px!important;
  max-width:78px!important;
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  font-size:19px!important;
  line-height:1!important;
  padding:1px 4px!important;
  margin:0!important;
  text-align:center!important;
  box-sizing:border-box!important;
  border-radius:9px!important;
  appearance:textfield!important;
  -moz-appearance:textfield!important;
}
body.venta-touch-screen .touch-qty-input::-webkit-outer-spin-button,
body.venta-touch-screen .touch-qty-input::-webkit-inner-spin-button{
  -webkit-appearance:none!important;
  margin:0!important;
}
body.venta-touch-screen .touch-qty-number span{
  height:12px!important;
  line-height:12px!important;
  font-size:10px!important;
  margin-top:1px!important;
}
body.venta-touch-screen .touch-fast{
  height:31px!important;
  gap:5px!important;
}
body.venta-touch-screen .touch-fast button{
  height:29px!important;
  min-height:29px!important;
  max-height:29px!important;
  font-size:12px!important;
  padding:3px 4px!important;
}
@media (max-width:900px), (pointer:coarse){
  body.venta-touch-screen #formVentaTouch{grid-template-rows:70px minmax(0,1fr) 132px 56px!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-template-rows:auto 42px 30px minmax(0,1fr)!important;gap:4px!important;}
  body.venta-touch-screen .touch-qty{grid-template-columns:34px 72px 34px!important;gap:6px!important;}
  body.venta-touch-screen .touch-qty button{width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;min-height:34px!important;max-height:34px!important;font-size:21px!important;}
  body.venta-touch-screen .touch-qty-number{width:72px!important;min-width:72px!important;max-width:72px!important;height:42px!important;min-height:42px!important;max-height:42px!important;}
  body.venta-touch-screen .touch-qty-input{width:72px!important;min-width:72px!important;max-width:72px!important;height:29px!important;min-height:29px!important;max-height:29px!important;font-size:18px!important;padding:1px 3px!important;}
}


/* V142 - contraste fuerte y lectura clara en botones venta mostrador */
body.venta-touch-screen button,
body.venta-touch-screen .btn,
body.venta-touch-screen a.btn,
body.venta-touch-screen input[type="submit"]{
  color:#ffffff!important;
  background:#1d4ed8!important;
  border:1px solid #1e40af!important;
  font-weight:900!important;
  text-shadow:none!important;
  opacity:1!important;
  box-shadow:0 2px 4px rgba(15,23,42,.18)!important;
}

body.venta-touch-screen button:hover,
body.venta-touch-screen .btn:hover,
body.venta-touch-screen a.btn:hover,
body.venta-touch-screen input[type="submit"]:hover{
  background:#1e40af!important;
  color:#ffffff!important;
}

body.venta-touch-screen button:active,
body.venta-touch-screen .btn:active,
body.venta-touch-screen a.btn:active,
body.venta-touch-screen input[type="submit"]:active{
  background:#172554!important;
  color:#ffffff!important;
}

body.venta-touch-screen .touch-category,
body.venta-touch-screen .touch-chip,
body.venta-touch-screen .v133-touch-pill,
body.venta-touch-screen .v133-calibre-pill{
  background:#ffffff!important;
  color:#111827!important;
  border:2px solid #475569!important;
  font-weight:900!important;
  text-shadow:none!important;
}

body.venta-touch-screen .touch-category.active,
body.venta-touch-screen .touch-chip.active,
body.venta-touch-screen .v133-touch-pill.active,
body.venta-touch-screen .v133-calibre-pill.active,
body.venta-touch-screen button.active,
body.venta-touch-screen .btn.active{
  background:#1d4ed8!important;
  color:#ffffff!important;
  border-color:#1e3a8a!important;
  box-shadow:0 0 0 3px rgba(29,78,216,.25)!important;
}

body.venta-touch-screen .touch-fast button,
body.venta-touch-screen .v133-qty-shortcut{
  background:#0f766e!important;
  color:#ffffff!important;
  border:1px solid #115e59!important;
  font-size:13px!important;
  font-weight:950!important;
  letter-spacing:.2px!important;
}

body.venta-touch-screen .touch-qty button,
body.venta-touch-screen .qty-minus,
body.venta-touch-screen .qty-plus{
  background:#111827!important;
  color:#ffffff!important;
  border:1px solid #000000!important;
  font-size:24px!important;
  font-weight:950!important;
  line-height:1!important;
}

body.venta-touch-screen .touch-actions .touch-save,
body.venta-touch-screen button[type="submit"],
body.venta-touch-screen input[type="submit"]{
  background:#047857!important;
  color:#ffffff!important;
  border:1px solid #065f46!important;
}

body.venta-touch-screen .touch-actions a,
body.venta-touch-screen .v133-clear-main,
body.venta-touch-screen .btn-danger{
  background:#b91c1c!important;
  color:#ffffff!important;
  border:1px solid #7f1d1d!important;
}

body.venta-touch-screen button:disabled,
body.venta-touch-screen .btn:disabled{
  background:#64748b!important;
  color:#ffffff!important;
  border-color:#475569!important;
  opacity:.85!important;
}

@media (max-width:900px), (pointer:coarse){
  body.venta-touch-screen button,
  body.venta-touch-screen .btn,
  body.venta-touch-screen a.btn{
    font-size:14px!important;
    line-height:1.1!important;
  }
  body.venta-touch-screen .touch-fast button{
    font-size:12px!important;
    padding:2px 4px!important;
  }
  body.venta-touch-screen .touch-qty button{
    font-size:23px!important;
  }
}

/* ============================================================
   V144 - Scroll permitido también en venta mostrador/material
   Motivo: en móvil/tablet la pantalla no cabe completa; se prioriza usabilidad.
   ============================================================ */
@media screen{
  html,
  body{
    min-height:100%!important;
    height:auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }

  .app{
    min-height:100vh!important;
    height:auto!important;
    overflow:visible!important;
  }

  .main,
  main,
  .content,
  .container{
    min-height:100vh!important;
    height:auto!important;
    overflow:visible!important;
  }

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

  /* Venta mostrador/material: deja scroll vertical si no cabe en pantalla */
  body.venta-touch-screen,
  body.venta-touch-10-v133{
    width:100%!important;
    min-height:100vh!important;
    height:auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
  }

  body.venta-touch-screen .app,
  body.venta-touch-10-v133 .app,
  body.venta-touch-screen .main,
  body.venta-touch-10-v133 .main,
  body.venta-touch-screen main,
  body.venta-touch-10-v133 main,
  body.venta-touch-screen .content,
  body.venta-touch-10-v133 .content,
  body.venta-touch-screen .container,
  body.venta-touch-10-v133 .container{
    min-height:100vh!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }

  body.venta-touch-screen .main,
  body.venta-touch-10-v133 .main{
    padding-bottom:96px!important;
  }

  body.venta-touch-screen .touch-body,
  body.venta-touch-10-v133 .touch-body{
    padding-bottom:96px!important;
  }
}


/* ============================================================
   V145 - Venta mostrador/material responsive real móvil/tablet
   Objetivo: en horizontal ocupa ancho y alto de pantalla sin descuadrar.
   En vertical permite scroll limpio, sin corte lateral.
   ============================================================ */

/* Base: venta táctil ocupa siempre el ancho útil y no hereda máximos antiguos */
body.venta-touch-screen{
  background:#f3f4f6!important;
  margin:0!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}
body.venta-touch-screen *{
  box-sizing:border-box!important;
}
body.venta-touch-screen .main{
  width:100%!important;
  max-width:none!important;
}
body.venta-touch-screen .touch-body{
  width:100%!important;
  max-width:none!important;
}

/* MÓVIL/TABLET HORIZONTAL: todo encajado dentro del viewport */
@media screen and (orientation:landscape) and (max-height:620px),
       screen and (pointer:coarse) and (orientation:landscape){
  html,
  body.venta-touch-screen{
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen .app{
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen .main{
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
    padding:4px 6px 4px 42px!important;
  }

  body.venta-touch-screen .main>h1,
  body.venta-touch-screen .flash{
    display:none!important;
  }

  body.venta-touch-screen .touch-body{
    height:calc(100dvh - 8px)!important;
    min-height:0!important;
    width:calc(100vw - 50px)!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    grid-template-rows:38px 48px minmax(0,1fr)!important;
    gap:4px!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen .touch-header{
    height:38px!important;
    min-height:38px!important;
    padding:0 4px!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen .touch-logo{
    gap:7px!important;
    font-size:18px!important;
    line-height:.95!important;
  }
  body.venta-touch-screen .touch-logo small{
    font-size:14px!important;
  }
  body.venta-touch-screen .touch-user-badge{
    height:32px!important;
    min-height:32px!important;
    padding:5px 12px!important;
    font-size:13px!important;
    display:flex!important;
    align-items:center!important;
    white-space:nowrap!important;
  }

  body.venta-touch-screen .touch-body>.touch-card{
    height:48px!important;
    min-height:48px!important;
    padding:5px 7px!important;
    border-radius:12px!important;
    margin:0!important;
    overflow:visible!important;
  }

  body.venta-touch-screen .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 116px!important;
    gap:6px!important;
    align-items:center!important;
  }
  body.venta-touch-screen .touch-search{
    height:36px!important;
    min-height:36px!important;
    padding:5px 10px!important;
    font-size:16px!important;
    border-radius:9px!important;
  }
  body.venta-touch-screen .touch-add-client{
    height:36px!important;
    min-height:36px!important;
    padding:0 8px!important;
    font-size:15px!important;
    border-radius:9px!important;
  }

  body.venta-touch-screen #formVentaTouch{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    display:grid!important;
    grid-template-columns:.95fr 1.05fr .92fr!important;
    grid-template-rows:44px minmax(0,1fr) 60px 38px!important;
    gap:5px!important;
    align-items:stretch!important;
  }
  body.venta-touch-screen #formVentaTouch>input[type="hidden"]{
    display:none!important;
  }
  body.venta-touch-screen #formVentaTouch>.touch-card{
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:6px!important;
    border-radius:12px!important;
    overflow:hidden!important;
    box-shadow:0 3px 10px rgba(15,23,42,.06)!important;
  }

  /* Recolocación completa para horizontal móvil/tablet */
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:1!important;grid-row:2 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:1 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){display:block!important;grid-column:3!important;grid-row:1 / span 2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:2!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){display:block!important;grid-column:3!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-actions{grid-column:1 / -1!important;grid-row:4!important;}

  body.venta-touch-screen .touch-step-title{
    font-size:13px!important;
    line-height:14px!important;
    margin:0 0 3px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body.venta-touch-screen .touch-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:3px!important;
    padding:3px!important;
    border-radius:9px!important;
  }
  body.venta-touch-screen .touch-summary div{
    padding:2px 4px!important;
    min-width:0!important;
  }
  body.venta-touch-screen .touch-summary span{
    font-size:9px!important;
    line-height:10px!important;
  }
  body.venta-touch-screen .touch-summary strong{
    font-size:11px!important;
    line-height:12px!important;
    margin-top:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body.venta-touch-screen .touch-category-grid{
    height:calc(100% - 17px)!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-rows:minmax(31px,1fr)!important;
    gap:4px!important;
    overflow:hidden!important;
    align-content:start!important;
  }
  body.venta-touch-screen .touch-category{
    min-width:0!important;
    width:100%!important;
    min-height:0!important;
    height:100%!important;
    max-height:none!important;
    padding:2px 3px!important;
    border-radius:9px!important;
    font-size:clamp(9px,1.55vw,12px)!important;
    line-height:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }
  body.venta-touch-screen .touch-category-icon{
    width:22px!important;
    height:18px!important;
    max-width:22px!important;
    max-height:18px!important;
    margin:0 0 1px!important;
    object-fit:contain!important;
  }
  body.venta-touch-screen .touch-category-icon-text{
    width:30px!important;
    height:18px!important;
    min-height:18px!important;
    font-size:13px!important;
    border-radius:6px!important;
    margin:0 0 1px!important;
  }

  body.venta-touch-screen #cardCalibre{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
  }
  body.venta-touch-screen .touch-calibres{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(48px,1fr))!important;
    grid-auto-rows:26px!important;
    gap:3px!important;
    padding:0!important;
    overflow:hidden!important;
    align-content:start!important;
  }
  body.venta-touch-screen .touch-calibres .small{
    font-size:12px!important;
  }
  body.venta-touch-screen .touch-chip{
    width:100%!important;
    min-width:0!important;
    height:26px!important;
    min-height:26px!important;
    max-height:26px!important;
    padding:2px 3px!important;
    border-radius:8px!important;
    font-size:clamp(8px,1.3vw,11px)!important;
    line-height:1!important;
    white-space:normal!important;
    overflow:hidden!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }

  body.venta-touch-screen .touch-form-grid{
    height:calc(100% - 17px)!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    grid-auto-rows:min-content!important;
    gap:3px 5px!important;
    overflow:hidden!important;
    align-content:start!important;
  }
  body.venta-touch-screen .touch-form-grid>div{
    min-width:0!important;
  }
  body.venta-touch-screen .touch-form-grid label{
    display:block!important;
    font-size:9px!important;
    line-height:10px!important;
    margin:0 0 1px!important;
  }
  body.venta-touch-screen .touch-form-grid input,
  body.venta-touch-screen .touch-form-grid select{
    width:100%!important;
    height:23px!important;
    min-height:23px!important;
    padding:2px 5px!important;
    font-size:11px!important;
    border-radius:7px!important;
  }
  body.venta-touch-screen .touch-help,
  body.venta-touch-screen .touch-guide-required{
    display:none!important;
  }
  body.venta-touch-screen #campoTransporteTouch,
  body.venta-touch-screen #campoRecargaTouch{
    min-width:0!important;
  }

  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:2px!important;
  }
  body.venta-touch-screen .touch-qty{
    display:grid!important;
    grid-template-columns:32px 64px 32px!important;
    justify-content:center!important;
    align-items:center!important;
    gap:5px!important;
    width:100%!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen .touch-qty button{
    width:32px!important;
    min-width:32px!important;
    height:30px!important;
    min-height:30px!important;
    max-height:30px!important;
    padding:0!important;
    border-radius:8px!important;
    font-size:20px!important;
  }
  body.venta-touch-screen .touch-qty-number{
    width:64px!important;
    min-width:64px!important;
    max-width:64px!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen .touch-qty-input{
    width:64px!important;
    min-width:64px!important;
    max-width:64px!important;
    height:23px!important;
    min-height:23px!important;
    max-height:23px!important;
    padding:0 3px!important;
    font-size:16px!important;
    line-height:1!important;
    border-radius:7px!important;
  }
  body.venta-touch-screen .touch-qty-number span{
    height:10px!important;
    line-height:10px!important;
    font-size:8px!important;
    margin-top:0!important;
  }
  body.venta-touch-screen .touch-fast{
    display:none!important;
  }
  body.venta-touch-screen .touch-alert{
    display:none!important;
  }

  body.venta-touch-screen .touch-actions{
    position:static!important;
    display:grid!important;
    grid-template-columns:.32fr .68fr!important;
    gap:5px!important;
    min-height:0!important;
  }
  body.venta-touch-screen .touch-actions button,
  body.venta-touch-screen .touch-actions a{
    height:38px!important;
    min-height:38px!important;
    padding:0 8px!important;
    border-radius:10px!important;
    font-size:15px!important;
    line-height:1!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  body.venta-touch-screen .touch-client-results{
    position:absolute!important;
    top:39px!important;
    left:0!important;
    right:0!important;
    max-height:calc(100dvh - 96px)!important;
    overflow:auto!important;
    z-index:8000!important;
  }
  body.venta-touch-screen button.touch-client-item{
    padding:8px!important;
  }
  body.venta-touch-screen button.touch-client-item strong{
    font-size:13px!important;
  }
  body.venta-touch-screen button.touch-client-item span{
    font-size:11px!important;
  }

  body.venta-touch-screen .menu-toggle{
    width:36px!important;
    height:56px!important;
    min-height:56px!important;
    font-size:20px!important;
    left:0!important;
    top:50%!important;
    border-radius:0 10px 10px 0!important;
  }
  body.venta-touch-screen .sidebar{
    width:min(82vw,300px)!important;
    min-width:min(82vw,300px)!important;
  }
  body.venta-touch-screen.menu-open .menu-toggle{
    left:min(82vw,300px)!important;
  }
}

/* MÓVIL/TABLET VERTICAL: una columna, ancho completo y scroll limpio */
@media screen and (orientation:portrait) and (max-width:900px){
  html,
  body.venta-touch-screen{
    height:auto!important;
    min-height:100dvh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.venta-touch-screen .app,
  body.venta-touch-screen .main{
    height:auto!important;
    min-height:100dvh!important;
    overflow:visible!important;
  }
  body.venta-touch-screen .main{
    padding:8px 8px 90px 44px!important;
  }
  body.venta-touch-screen .touch-body{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    display:block!important;
    padding:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen .touch-header{
    height:auto!important;
    min-height:0!important;
    margin-bottom:8px!important;
  }
  body.venta-touch-screen .touch-body>.touch-card,
  body.venta-touch-screen #formVentaTouch>.touch-card{
    height:auto!important;
    margin-bottom:8px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen #formVentaTouch{
    display:block!important;
    height:auto!important;
    overflow:visible!important;
  }
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4),
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(6){
    display:block!important;
  }
  body.venta-touch-screen .touch-row{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen .touch-add-client{
    width:100%!important;
  }
  body.venta-touch-screen .touch-category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    height:auto!important;
    overflow:visible!important;
  }
  body.venta-touch-screen .touch-calibres{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    grid-template-columns:repeat(auto-fit,minmax(70px,1fr))!important;
  }
  body.venta-touch-screen .touch-form-grid{
    height:auto!important;
    overflow:visible!important;
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen .touch-actions{
    position:sticky!important;
    bottom:8px!important;
    z-index:20!important;
  }
}


/* ============================================================
   V146 - Modo venta guiada para móvil/tablet
   PC se mantiene como estaba. En táctil se muestra un solo paso
   por pantalla para que no se corte ni en vertical ni en horizontal.
   ============================================================ */
body.venta-touch-screen .touch-wizard-prev,
body.venta-touch-screen .touch-wizard-next{
  display:none;
}

@media screen and (pointer:coarse), screen and (hover:none), screen and (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard{
    width:100%!important;
    max-width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    background:#f3f4f6!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .app,
  body.venta-touch-screen.touch-mobile-wizard .main{
    width:100%!important;
    max-width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .main{
    padding:6px 8px 86px 44px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .main>h1,
  body.venta-touch-screen.touch-mobile-wizard .admin-quick-actions,
  body.venta-touch-screen.touch-mobile-wizard .flash{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-body{
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    height:auto!important;
    display:block!important;
    padding:0!important;
    margin:0!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-header{
    height:46px!important;
    min-height:46px!important;
    padding:0 4px!important;
    margin:0 0 6px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-logo{
    font-size:20px!important;
    line-height:.95!important;
    gap:7px!important;
    min-width:0!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{
    font-size:15px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{
    height:32px!important;
    min-height:32px!important;
    padding:4px 10px!important;
    font-size:13px!important;
    white-space:nowrap!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-body>.touch-card{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0 0 6px!important;
    padding:8px!important;
    border-radius:14px!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(105px,18vw)!important;
    gap:7px!important;
    align-items:center!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-search{
    width:100%!important;
    height:42px!important;
    min-height:42px!important;
    padding:6px 12px!important;
    font-size:17px!important;
    border-radius:11px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
    height:42px!important;
    min-height:42px!important;
    padding:0 10px!important;
    font-size:16px!important;
    border-radius:11px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch{
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    height:auto!important;
    display:block!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
    display:none!important;
    width:100%!important;
    height:auto!important;
    min-height:calc(100dvh - 178px)!important;
    max-height:none!important;
    margin:0!important;
    padding:12px!important;
    border-radius:16px!important;
    overflow:auto!important;
    box-shadow:0 8px 22px rgba(15,23,42,.08)!important;
  }

  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card.touch-step-active{
    display:block!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-step-title{
    font-size:20px!important;
    line-height:24px!important;
    margin:0 0 10px!important;
    white-space:normal!important;
    overflow:visible!important;
    color:#111827!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-summary{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    padding:10px!important;
    border-radius:12px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-summary span{
    font-size:12px!important;
    line-height:14px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-summary strong{
    font-size:16px!important;
    line-height:20px!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    height:auto!important;
    max-height:none!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category{
    width:100%!important;
    min-width:0!important;
    height:clamp(74px,18dvh,116px)!important;
    min-height:74px!important;
    padding:8px 6px!important;
    border-radius:13px!important;
    font-size:clamp(15px,2.5vw,20px)!important;
    line-height:1.08!important;
    white-space:normal!important;
    overflow:hidden!important;
    text-align:center!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-icon{
    width:clamp(30px,6vw,50px)!important;
    height:clamp(25px,5vw,42px)!important;
    max-width:50px!important;
    max-height:42px!important;
    object-fit:contain!important;
    margin-bottom:4px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-icon-text{
    width:clamp(45px,9vw,70px)!important;
    height:clamp(26px,5vw,40px)!important;
    min-height:26px!important;
    font-size:clamp(18px,4vw,30px)!important;
    margin-bottom:4px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-calibres{
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(92px,1fr))!important;
    gap:9px!important;
    padding:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-calibres .small{
    font-size:17px!important;
    line-height:22px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-chip{
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:46px!important;
    padding:8px 6px!important;
    border-radius:11px!important;
    font-size:clamp(14px,2.4vw,18px)!important;
    line-height:1.1!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    text-align:center!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid{
    height:auto!important;
    max-height:none!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid label{
    display:block!important;
    font-size:13px!important;
    line-height:15px!important;
    margin-bottom:4px!important;
    font-weight:800!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid input,
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid select{
    width:100%!important;
    height:44px!important;
    min-height:44px!important;
    padding:7px 10px!important;
    font-size:16px!important;
    border-radius:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-help,
  body.venta-touch-screen.touch-mobile-wizard .touch-guide-required{
    font-size:11px!important;
    line-height:13px!important;
    margin-top:3px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-qty{
    width:100%!important;
    display:grid!important;
    grid-template-columns:64px minmax(90px,170px) 64px!important;
    justify-content:center!important;
    align-items:center!important;
    gap:14px!important;
    margin:8px 0 14px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty button{
    width:64px!important;
    min-width:64px!important;
    height:58px!important;
    min-height:58px!important;
    border-radius:13px!important;
    font-size:32px!important;
    line-height:1!important;
    padding:0!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-number{
    width:100%!important;
    max-width:170px!important;
    height:62px!important;
    min-height:62px!important;
    border-radius:13px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-input{
    width:100%!important;
    height:39px!important;
    min-height:39px!important;
    padding:0 8px!important;
    font-size:26px!important;
    line-height:1!important;
    border-radius:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-number span{
    height:auto!important;
    font-size:13px!important;
    line-height:15px!important;
    margin-top:2px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-fast{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-fast button{
    height:50px!important;
    min-height:50px!important;
    border-radius:12px!important;
    font-size:18px!important;
    font-weight:800!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-actions{
    position:fixed!important;
    left:44px!important;
    right:8px!important;
    bottom:8px!important;
    z-index:5000!important;
    display:grid!important;
    grid-template-columns:.7fr .85fr 1fr 1.1fr!important;
    gap:6px!important;
    margin:0!important;
    padding:0!important;
    min-height:0!important;
    background:transparent!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    border-radius:12px!important;
    font-size:clamp(13px,2.2vw,17px)!important;
    font-weight:800!important;
    line-height:1!important;
    padding:0 6px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    white-space:nowrap!important;
    text-align:center!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-wizard-prev,
  body.venta-touch-screen.touch-mobile-wizard .touch-wizard-next{
    display:flex!important;
    background:#0f172a!important;
    color:#fff!important;
    border:0!important;
    box-shadow:0 8px 18px rgba(15,23,42,.18)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-wizard-prev:disabled{
    opacity:.38!important;
  }
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-save{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-wizard-next{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    grid-template-columns:.8fr .9fr 1.4fr!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .menu-toggle{
    width:36px!important;
    height:58px!important;
    min-height:58px!important;
    left:0!important;
    top:50%!important;
    border-radius:0 12px 12px 0!important;
    z-index:6000!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .sidebar{
    width:min(84vw,320px)!important;
    min-width:min(84vw,320px)!important;
    z-index:7000!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.menu-open .menu-toggle{
    left:min(84vw,320px)!important;
  }
}

@media screen and (pointer:coarse) and (orientation:landscape), screen and (hover:none) and (orientation:landscape), screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard,
  body.venta-touch-screen.touch-mobile-wizard .app,
  body.venta-touch-screen.touch-mobile-wizard .main{
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .main{
    padding:4px 8px 62px 44px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-header{
    height:38px!important;
    min-height:38px!important;
    margin-bottom:4px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo{
    font-size:18px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{
    font-size:13px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-body>.touch-card{
    margin-bottom:4px!important;
    padding:6px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-search,
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
    height:36px!important;
    min-height:36px!important;
    font-size:15px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
    height:calc(100dvh - 154px)!important;
    min-height:calc(100dvh - 154px)!important;
    max-height:calc(100dvh - 154px)!important;
    padding:9px!important;
    overflow:auto!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-step-title{
    font-size:18px!important;
    line-height:21px!important;
    margin-bottom:7px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category{
    height:clamp(52px,18dvh,88px)!important;
    min-height:52px!important;
    font-size:clamp(12px,1.8vw,16px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-icon{
    width:clamp(22px,4vw,38px)!important;
    height:clamp(18px,3vw,30px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid input,
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid select{
    height:36px!important;
    min-height:36px!important;
    font-size:14px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty{
    grid-template-columns:54px minmax(90px,140px) 54px!important;
    gap:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty button{
    width:54px!important;
    min-width:54px!important;
    height:48px!important;
    min-height:48px!important;
    font-size:28px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-number{
    height:52px!important;
    min-height:52px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-input{
    height:32px!important;
    min-height:32px!important;
    font-size:22px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-fast button{
    height:42px!important;
    min-height:42px!important;
    font-size:16px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions{
    bottom:5px!important;
    left:44px!important;
    right:8px!important;
    grid-template-columns:.6fr .8fr 1fr 1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{
    height:48px!important;
    min-height:48px!important;
    font-size:clamp(12px,1.7vw,16px)!important;
  }
}

@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard .main{
    padding:6px 8px 82px 40px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-header{
    height:42px!important;
    min-height:42px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo{
    font-size:17px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{
    font-size:13px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{
    height:30px!important;
    min-height:30px!important;
    font-size:12px!important;
    padding:3px 8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-row{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
    width:100%!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
    min-height:calc(100dvh - 214px)!important;
    padding:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions{
    left:40px!important;
    right:8px!important;
    grid-template-columns:.75fr .9fr 1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-clear{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    grid-template-columns:.9fr 1.3fr!important;
  }
}


/* V147 - Venta mostrador: alternar unidades/kg de forma real.
   La pólvora solo muestra botones de kg y oculta el control numérico de unidades.
   El resto de categorías oculta los kg y muestra cantidad normal. */
body.venta-touch-screen .is-hidden,
body.venta-touch-screen [hidden]{
  display:none!important;
}
body.venta-touch-screen #atajosPolvora:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body.venta-touch-screen #atajosUnidades:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body.venta-touch-screen.touch-mobile-wizard #atajosPolvora:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body.venta-touch-screen.touch-mobile-wizard #atajosUnidades:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body.venta-touch-screen #atajosPolvora button{
  font-weight:900!important;
  font-size:18px!important;
}


/* V150 - Libro registro y PDF A4 horizontal sin scroll lateral */
.libro{
  width:100%!important;
  max-width:100%!important;
  overflow:visible!important;
}
.libro-table{
  width:100%!important;
  max-width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
.libro-table th,
.libro-table td{
  box-sizing:border-box!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-align:center!important;
  vertical-align:middle!important;
  line-height:1.08!important;
}
.libro-table td.num,
.libro-table th.num{
  white-space:nowrap!important;
  text-align:right!important;
}
.libro-table col.c-asiento{width:6%}
.libro-table col.c-fecha{width:8%}
.libro-table col.c-tipo{width:13%}
.libro-table col.c-guia{width:15%}
.libro-table col.c-procedencia{width:15%}
.libro-table col.c-destino{width:15%}
.libro-table col.c-calibre{width:12%}
.libro-table col.c-entrada{width:8%}
.libro-table col.c-salida{width:8%}
.libro-table col.c-total{width:8%}
.libro-table-10 col.c-asiento{width:5.5%}
.libro-table-10 col.c-fecha{width:7.5%}
.libro-table-10 col.c-tipo{width:12%}
.libro-table-10 col.c-guia{width:14%}
.libro-table-10 col.c-procedencia{width:14%}
.libro-table-10 col.c-destino{width:14%}
.libro-table-10 col.c-calibre{width:10.5%}
.libro-table-10 col.c-entrada{width:7.5%}
.libro-table-10 col.c-salida{width:7.5%}
.libro-table-10 col.c-total{width:7.5%}

@media(max-width:900px){
  .libro table.libro-table{
    display:table!important;
    overflow:visible!important;
    white-space:normal!important;
  }
}

@page{size:A4 landscape;margin:7mm}
@media print{
  html,body{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  .libro{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  .libro-header{
    display:grid!important;
    grid-template-columns:25mm 1fr 46mm!important;
    gap:3mm!important;
    align-items:center!important;
    margin:0 0 3mm 0!important;
    padding:1.5mm 2mm!important;
    font-size:9.5px!important;
    line-height:1.05!important;
  }
  .libro-logo{
    max-height:9mm!important;
    max-width:23mm!important;
  }
  .libro-table{
    display:table!important;
    width:100%!important;
    max-width:100%!important;
    table-layout:fixed!important;
    font-size:7.6px!important;
    line-height:1.0!important;
  }
  .libro-table th,
  .libro-table td{
    padding:1.4px 2px!important;
    font-size:7.4px!important;
    line-height:1.0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    border-bottom:1px solid #bbb!important;
  }
  .libro-table th{
    font-size:7.5px!important;
    font-weight:900!important;
    border-bottom:3px solid #777!important;
    background:#e5e7eb!important;
  }
  .libro-table td.num{
    white-space:nowrap!important;
  }
  .pdf-footer{display:none!important}
}


/* V151 - Visibilidad correcta cantidad/kg en venta mostrador, también rol usuario móvil/tablet */
body.venta-touch-screen #cantidadUnidadesControl.is-hidden,
body.venta-touch-screen #atajosUnidades.is-hidden,
body.venta-touch-screen #atajosPolvora.is-hidden,
body.venta-touch-screen.touch-mobile-wizard #cantidadUnidadesControl.is-hidden,
body.venta-touch-screen.touch-mobile-wizard #atajosUnidades.is-hidden,
body.venta-touch-screen.touch-mobile-wizard #atajosPolvora.is-hidden{
  display:none!important;
}
body.venta-touch-screen #atajosPolvora:not(.is-hidden),
body.venta-touch-screen.touch-mobile-wizard #atajosPolvora:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body.venta-touch-screen #atajosUnidades:not(.is-hidden),
body.venta-touch-screen.touch-mobile-wizard #atajosUnidades:not(.is-hidden){
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}


/* ================================================================
   V152 – FIX RESPONSIVE MÓVIL/TABLET (venta mostrador)
   Problema: min-height:calc(100dvh-178px) sin max-height → la
   tarjeta de paso crecía libremente y la barra fija la tapaba.
   Solución: max-height preciso + overflow-y:auto por breakpoint.
   ================================================================ */

/* ── LOGIN: evitar que se alargue en móvil ────────────────────── */
@media (max-width: 520px) {
  .login-wrap {
    margin: 16px auto !important;
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }
  .login-wrap h1 {
    font-size: 22px !important;
    margin: 0 0 14px !important;
  }
  .login-wrap button {
    width: 100% !important;
  }
}

/* ── WIZARD PORTRAIT GENERAL (tablet ≤1024px, búsqueda en 1 fila)
   Desglose: pt(6)+header(46)+hm(6)+search(64)+pb(86) = 208px
   Margen de seguridad +12px → 220px                           ── */
@media screen and (pointer:coarse),
       screen and (max-width:1024px) {
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card {
    /* Eliminar el min-height excesivo y poner un máximo correcto */
    min-height: 0 !important;
    max-height: calc(100dvh - 220px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    /* padding-bottom interno para que el último elemento no quede
       pegado al borde de scroll */
    padding-bottom: 12px !important;
    box-sizing: border-box !important;
  }
}

/* ── WIZARD PORTRAIT TELÉFONO ≤700px (búsqueda en 2 filas: input
   encima + botón debajo)
   Desglose: pt(6)+header(42)+hm(6)+search_2filas(107)+pb(82) = 243px
   Margen de seguridad +14px → 257px                           ── */
@media screen and (max-width: 700px) {
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card {
    max-height: calc(100dvh - 257px) !important;
  }
  /* Categorías: scroll interno si no caben todas */
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid {
    overflow-y: auto !important;
    max-height: calc(100% - 34px) !important; /* 34px = título paso */
  }
  /* Calibres: scroll interno */
  body.venta-touch-screen.touch-mobile-wizard .touch-calibres {
    overflow-y: auto !important;
    max-height: calc(100% - 34px) !important;
  }
}

/* ── WIZARD LANDSCAPE (ya tenía max-height correcto; solo reforzar
   overflow-y por si acaso)                                      ── */
@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (max-width:1024px) and (orientation:landscape) {
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
  }
}

/* ── BARRA DE ACCIONES: fondo semiopaco para que sea siempre
   legible aunque haya contenido debajo (íPhone + Android)      ── */
@media screen and (pointer:coarse),
       screen and (max-width:1024px) {
  body.venta-touch-screen.touch-mobile-wizard .touch-actions {
    background: rgba(243,244,246,0.96) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-top: 1px solid rgba(226,232,240,0.9) !important;
    /* safe-area-inset para iPhone con notch */
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

/* ── TELÉFONOS MUY PEQUEÑOS (<380px) ─────────────────────────── */
@media screen and (max-width: 380px) {
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card {
    max-height: calc(100dvh - 245px) !important;
    padding: 8px 8px 12px !important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category {
    height: 60px !important;
    min-height: 60px !important;
    font-size: 13px !important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button {
    font-size: 12px !important;
    padding: 0 4px !important;
  }
}

/* ── INNER CONTAINERS en modo wizard: dejar fluir al padre
   El problema raíz estaba en:
     .touch-form-grid  → overflow:hidden  (ocultaba campos)
     .touch-calibres   → height:calc(100%-22px) (recortaba chips)
     .touch-category-grid → idem
   En wizard el CARD tiene max-height + overflow-y:auto, los
   hijos deben fluir libremente para que el card haga el scroll. ── */
@media screen and (pointer:coarse),
       screen and (max-width:1024px) {

  /* Formulario fecha/autorización/guía: quitar el overflow:hidden */
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Chips de calibres: flujo natural */
  body.venta-touch-screen.touch-mobile-wizard .touch-calibres {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Botones de categorías: flujo natural */
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Cantidad: flujo natural */
  body.venta-touch-screen.touch-mobile-wizard .touch-fast,
  body.venta-touch-screen.touch-mobile-wizard .touch-qty {
    overflow: visible !important;
  }
}


/* ── V153: Guardar venta SIEMPRE visible en barra de acciones ──
   Antes: display:none en pasos no-últimos  
   Ahora: siempre visible, la validación controla el envío       */
body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-save {
  display: flex !important;
}

/* Grid acciones en pasos intermedios (Siguiente visible):
   Limpiar | Anterior | Siguiente | Guardar                      */
@media screen and (pointer:coarse),
       screen and (max-width:1024px) {
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-actions {
    grid-template-columns: .55fr .75fr .85fr 1.1fr !important;
  }
  /* Último paso (Siguiente oculto): Limpiar | Anterior | Guardar */
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions {
    grid-template-columns: .65fr .75fr 1.3fr !important;
  }
}

/* Portrait teléfono ≤700px (Limpiar oculto):
   Anterior | Siguiente | Guardar  /  Anterior | Guardar         */
@media screen and (max-width:700px) {
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-actions {
    grid-template-columns: .75fr .85fr 1.2fr !important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions {
    grid-template-columns: .9fr 1.5fr !important;
  }
}
/* ── fin fix Guardar venta ── */

/* ── fin V152 responsive fix ── */


/* ================================================================
   V154 - Reparación final: login responsive + finalizar compra visible
   Mantiene la seguridad V152/V153 de 5 bloqueos de login.
   ================================================================ */

/* LOGIN PC / tablet / móvil: tarjeta centrada, sin alargarse */
body.login-screen{
  min-height:100dvh!important;
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:18px!important;
  box-sizing:border-box!important;
  overflow:auto!important;
  background:linear-gradient(135deg,#f3f4f6 0%,#e5e7eb 100%)!important;
}
body.login-screen .login-wrap{
  width:min(420px,100%)!important;
  max-width:420px!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:24px!important;
  box-sizing:border-box!important;
  border-radius:18px!important;
  background:#fff!important;
  box-shadow:0 18px 45px rgba(15,23,42,.16)!important;
}
body.login-screen .login-wrap h1{
  font-size:26px!important;
  line-height:1.1!important;
  margin:0 0 18px!important;
  text-align:center!important;
}
body.login-screen .login-form-fixed{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  width:100%!important;
  margin:0!important;
}
body.login-screen .login-form-fixed label{
  display:block!important;
  font-weight:800!important;
  margin:0 0 5px!important;
  color:#111827!important;
}
body.login-screen .login-form-fixed input{
  width:100%!important;
  height:46px!important;
  min-height:46px!important;
  box-sizing:border-box!important;
  border-radius:12px!important;
  font-size:17px!important;
  padding:9px 12px!important;
}
body.login-screen .login-form-fixed button{
  width:100%!important;
  height:48px!important;
  min-height:48px!important;
  margin-top:4px!important;
  border-radius:12px!important;
  font-size:18px!important;
  font-weight:900!important;
}
body.login-screen .flash{
  margin:0 0 12px!important;
  font-size:14px!important;
  line-height:1.25!important;
}
@media (max-width:520px){
  body.login-screen{align-items:flex-start!important;padding:14px!important;}
  body.login-screen .login-wrap{width:100%!important;max-width:100%!important;padding:18px!important;border-radius:16px!important;}
  body.login-screen .login-wrap h1{font-size:23px!important;margin-bottom:14px!important;}
  body.login-screen .login-form-fixed input{height:44px!important;min-height:44px!important;font-size:16px!important;}
  body.login-screen .login-form-fixed button{height:46px!important;min-height:46px!important;font-size:17px!important;}
}
@media (orientation:landscape) and (max-height:520px){
  body.login-screen{align-items:flex-start!important;padding:10px!important;}
  body.login-screen .login-wrap{padding:14px 18px!important;}
  body.login-screen .login-wrap h1{font-size:21px!important;margin-bottom:10px!important;}
  body.login-screen .login-form-fixed{gap:8px!important;}
  body.login-screen .login-form-fixed input{height:38px!important;min-height:38px!important;}
  body.login-screen .login-form-fixed button{height:40px!important;min-height:40px!important;}
}

/* VENTA MOSTRADOR PC: conservar pantalla completa, pero con botón de finalizar visible */
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-wizard-prev,
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-wizard-next{
  display:none!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #touchWizardSubmit,
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-save{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  background:#047857!important;
  color:#fff!important;
  border:0!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-actions{
  display:grid!important;
  grid-template-columns:.55fr 1.45fr!important;
  gap:10px!important;
  align-items:stretch!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-actions a,
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-actions button{
  width:100%!important;
  min-width:0!important;
  height:58px!important;
  min-height:58px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}

/* VENTA MOSTRADOR móvil/tablet: modo guiado ocupa pantalla, sin desbordes */
@media screen and (pointer:coarse), screen and (hover:none), screen and (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard{
    overflow:hidden!important;
    min-height:100dvh!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .app,
  body.venta-touch-screen.touch-mobile-wizard .main{
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .main{
    padding:6px 8px 8px 46px!important;
    box-sizing:border-box!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-body{
    width:calc(100vw - 58px)!important;
    height:calc(100dvh - 14px)!important;
    max-height:calc(100dvh - 14px)!important;
    display:grid!important;
    grid-template-rows:52px auto minmax(0,1fr)!important;
    gap:7px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-header{
    height:52px!important;
    min-height:52px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo{font-size:19px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{font-size:15px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{font-size:13px!important;padding:7px 10px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-body>.touch-card{
    padding:8px!important;
    border-radius:14px!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 118px!important;
    gap:7px!important;
    align-items:center!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-search,
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
    height:42px!important;
    min-height:42px!important;
    font-size:16px!important;
    border-radius:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch{
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
    display:none!important;
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    padding:12px!important;
    box-sizing:border-box!important;
    border-radius:16px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card.touch-step-active{
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-summary,
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid,
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid,
  body.venta-touch-screen.touch-mobile-wizard .touch-calibres{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:auto!important;
    gap:10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category{
    height:auto!important;
    min-height:82px!important;
    max-height:none!important;
    font-size:15px!important;
    padding:10px 8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-calibres{
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(90px,1fr))!important;
    gap:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-chip{
    height:auto!important;
    min-height:44px!important;
    max-height:none!important;
    font-size:15px!important;
    padding:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-form-grid input{
    height:43px!important;
    min-height:43px!important;
    font-size:16px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card:nth-of-type(5){
    display:none!important;
    grid-template-rows:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card:nth-of-type(5).touch-step-active{
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty{
    grid-template-columns:56px minmax(110px,180px) 56px!important;
    justify-content:center!important;
    gap:10px!important;
    margin-top:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty button{
    width:56px!important;min-width:56px!important;height:52px!important;min-height:52px!important;font-size:28px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-number,
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-input{
    width:100%!important;min-width:0!important;max-width:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-number{height:auto!important;min-height:56px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-qty-input{height:40px!important;min-height:40px!important;font-size:24px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-fast{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
    height:auto!important;
    margin-top:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #atajosPolvora:not(.is-hidden){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-fast button{
    height:46px!important;min-height:46px!important;font-size:17px!important;border-radius:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions{
    grid-column:1!important;
    grid-row:2!important;
    position:static!important;
    display:grid!important;
    gap:7px!important;
    background:#f3f4f6!important;
    padding:0!important;
    border:0!important;
  }
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-first):not(.touch-wizard-last) .touch-actions{
    grid-template-columns:.75fr .85fr 1.15fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-first .touch-actions{
    grid-template-columns:.9fr 1.1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    grid-template-columns:.9fr 1.4fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-clear{display:none!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{
    height:52px!important;
    min-height:52px!important;
    padding:0 8px!important;
    font-size:15px!important;
    border-radius:12px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    white-space:normal!important;
    line-height:1.05!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-save{
    display:flex!important;
    background:#047857!important;
    color:#fff!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-first .touch-wizard-prev{display:none!important;}
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-wizard-next{display:none!important;}
}

@media screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard .main{padding-left:42px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-body{width:calc(100vw - 50px)!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-header{height:46px!important;min-height:46px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-logo{font-size:16px!important;gap:7px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{font-size:13px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{font-size:12px!important;padding:6px 8px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{width:100%!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{font-size:14px!important;}
}

@media screen and (pointer:coarse) and (orientation:landscape), screen and (hover:none) and (orientation:landscape), screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard .touch-body{grid-template-rows:44px 54px minmax(0,1fr)!important;gap:5px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-header{height:44px!important;min-height:44px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-logo{font-size:16px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{font-size:12px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-row{grid-template-columns:minmax(0,1fr) 110px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-search,
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{height:36px!important;min-height:36px!important;font-size:14px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{height:42px!important;min-height:42px!important;font-size:13px!important;}
}
/* Fin V154 */


/* ============================================================
   V155 - Restauración informes libro + columnas nuevas
   Objetivo: A4 horizontal completo, sin scroll lateral en PDF,
   con Transporte y Autorización centradas.
   ============================================================ */
.libro-table{width:100%!important;max-width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;}
.libro-table th,.libro-table td{white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;text-align:center!important;vertical-align:middle!important;}
.libro-table td.num,.libro-table th.num{text-align:right!important;white-space:nowrap!important;}
.libro-table .ctr,.libro-table td.ctr{text-align:center!important;}
.libro-table-11 col.c-asiento{width:5%!important}.libro-table-11 col.c-fecha{width:7%!important}.libro-table-11 col.c-tipo{width:10%!important}.libro-table-11 col.c-autorizacion{width:7%!important}.libro-table-11 col.c-guia{width:9%!important}.libro-table-11 col.c-transporte{width:7%!important}.libro-table-11 col.c-procedencia{width:13%!important}.libro-table-11 col.c-destino{width:13%!important}.libro-table-11 col.c-calibre{width:9%!important}.libro-table-11 col.c-entrada{width:7%!important}.libro-table-11 col.c-salida{width:7%!important}
.libro-table-12 col.c-asiento{width:4.5%!important}.libro-table-12 col.c-fecha{width:6%!important}.libro-table-12 col.c-tipo{width:9%!important}.libro-table-12 col.c-autorizacion{width:6.5%!important}.libro-table-12 col.c-guia{width:8%!important}.libro-table-12 col.c-transporte{width:6.5%!important}.libro-table-12 col.c-procedencia{width:12%!important}.libro-table-12 col.c-destino{width:12%!important}.libro-table-12 col.c-calibre{width:9%!important}.libro-table-12 col.c-entrada{width:6.5%!important}.libro-table-12 col.c-salida{width:6.5%!important}.libro-table-12 col.c-total{width:7.5%!important}
@media print{
  @page{size:A4 landscape;margin:6mm!important;}
  .libro,.card.libro{width:100%!important;max-width:100%!important;overflow:visible!important;}
  .libro-table{font-size:7.5px!important;line-height:1!important;}
  .libro-table th,.libro-table td{padding:1.4px 2px!important;line-height:1!important;}
  .libro-table th{font-size:7.5px!important;}
  .libro-table td{font-size:7.3px!important;}
}

/* V157 - informes libro: datos centrados y columnas opcionales transporte/recarga */
.libro-table,
.preview-libro-table{
  width:100%!important;
  max-width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
.libro-table th,
.libro-table td,
.preview-libro-table th,
.preview-libro-table td{
  text-align:center!important;
  vertical-align:middle!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
.libro-table td.num,
.libro-table th.num,
.preview-libro-table td.num,
.preview-libro-table th.num{
  text-align:center!important;
}
.libro-table col.c-recarga,
.preview-libro-table col.c-recarga{width:7%!important;}
.libro-table col.c-transporte,
.preview-libro-table col.c-transporte{width:7%!important;}
.libro-table col.c-autorizacion,
.preview-libro-table col.c-autorizacion{width:7%!important;}
.libro-table col.c-total,
.preview-libro-table col.c-total{width:7%!important;}
@page{size:A4 landscape;margin:7mm;}
@media print{
  .libro-table,
  .preview-libro-table{font-size:7.2px!important;line-height:1!important;}
  .libro-table th,
  .libro-table td,
  .preview-libro-table th,
  .preview-libro-table td{padding:1.5px 2px!important;line-height:1!important;}
}

/* V158 - Libro registro: tabla centrada y columnas oficiales compactas */
.libro-table-v158{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px;}
.libro-table-v158 th,.libro-table-v158 td{text-align:center!important;vertical-align:middle!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.12;padding:4px 3px;}
.libro-table-v158 .num{text-align:center!important;white-space:nowrap!important;}
.libro-table-v158 .stack-lines{display:block;text-align:center!important;line-height:1.15;white-space:normal!important;overflow-wrap:anywhere!important;}
.libro-table-v158 col.c-asiento{width:6%;}
.libro-table-v158 col.c-fecha{width:8%;}
.libro-table-v158 col.c-tipo{width:14%;}
.libro-table-v158 col.c-guia{width:22%;}
.libro-table-v158 col.c-destino{width:22%;}
.libro-table-v158 col.c-calibre{width:10%;}
.libro-table-v158 col.c-entrada{width:9%;}
.libro-table-v158 col.c-salida{width:9%;}
.libro-table-v158 col.c-total{width:8%;}
@media print{
  .libro-table-v158{font-size:7.6px!important;line-height:1!important;}
  .libro-table-v158 th,.libro-table-v158 td{padding:1.5px 2px!important;line-height:1.05!important;}
}


/* V159 - Libro registro: recuperar columna Procedencia separada */
.libro-table-v158 col.c-asiento, .preview-libro-table col.c-asiento{width:5.5%!important;}
.libro-table-v158 col.c-fecha, .preview-libro-table col.c-fecha{width:7.5%!important;}
.libro-table-v158 col.c-tipo, .preview-libro-table col.c-tipo{width:12%!important;}
.libro-table-v158 col.c-guia, .preview-libro-table col.c-guia{width:18%!important;}
.libro-table-v158 col.c-procedencia, .preview-libro-table col.c-procedencia{width:14%!important;}
.libro-table-v158 col.c-destino, .preview-libro-table col.c-destino{width:16%!important;}
.libro-table-v158 col.c-calibre, .preview-libro-table col.c-calibre{width:8%!important;}
.libro-table-v158 col.c-entrada, .preview-libro-table col.c-entrada{width:7%!important;}
.libro-table-v158 col.c-salida, .preview-libro-table col.c-salida{width:7%!important;}
.libro-table-v158 col.c-total, .preview-libro-table col.c-total{width:5%!important;}
.libro-table-v158 th,.libro-table-v158 td,.preview-libro-table th,.preview-libro-table td{text-align:center!important;vertical-align:middle!important;}
@media print{
  .libro-table-v158,.preview-libro-table{font-size:7px!important;}
  .libro-table-v158 th,.libro-table-v158 td,.preview-libro-table th,.preview-libro-table td{padding:1.2px 1.6px!important;}
}

/* V160 - libro registro categorías ajustado */
.existencia-anterior-box{
  margin:10px 0 8px;
  padding:8px 12px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#f8fafc;
  font-weight:900;
  color:#0f172a;
  text-align:left;
}
.existencia-anterior-box b{color:#002244;}
.libro-table-v158.modo-general col.c-asiento{width:5.5%!important;}
.libro-table-v158.modo-general col.c-fecha{width:7.5%!important;}
.libro-table-v158.modo-general col.c-tipo{width:12%!important;}
.libro-table-v158.modo-general col.c-guia{width:18%!important;}
.libro-table-v158.modo-general col.c-procedencia{width:14%!important;}
.libro-table-v158.modo-general col.c-destino{width:16%!important;}
.libro-table-v158.modo-general col.c-calibre{width:8%!important;}
.libro-table-v158.modo-general col.c-entrada{width:9.5%!important;}
.libro-table-v158.modo-general col.c-salida{width:9.5%!important;}
.libro-table-v158.modo-categoria col.c-asiento{width:7%!important;}
.libro-table-v158.modo-categoria col.c-fecha{width:9%!important;}
.libro-table-v158.modo-categoria col.c-guia{width:24%!important;}
.libro-table-v158.modo-categoria col.c-procedencia{width:16%!important;}
.libro-table-v158.modo-categoria col.c-destino{width:18%!important;}
.libro-table-v158.modo-categoria col.c-entrada{width:8.5%!important;}
.libro-table-v158.modo-categoria col.c-salida{width:8.5%!important;}
.libro-table-v158.modo-categoria col.c-total{width:9%!important;}


/* V167: libros ajustados a folio A4 horizontal */
.libro-table-v158{width:100%!important;min-width:100%!important;max-width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;}
.libro-table-v158 th,.libro-table-v158 td{text-align:center!important;vertical-align:middle!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;box-sizing:border-box!important;}
.libro-table-v158 td.num,.libro-table-v158 th.num{text-align:center!important;white-space:normal!important;}
.libro-table-v158 .stack-lines{display:block!important;text-align:center!important;white-space:normal!important;overflow-wrap:anywhere!important;}
.libro-table-v158.modo-general col.c-asiento{width:5%!important;}
.libro-table-v158.modo-general col.c-fecha{width:7%!important;}
.libro-table-v158.modo-general col.c-tipo{width:12%!important;}
.libro-table-v158.modo-general col.c-guia{width:18%!important;}
.libro-table-v158.modo-general col.c-procedencia{width:14%!important;}
.libro-table-v158.modo-general col.c-destino{width:16%!important;}
.libro-table-v158.modo-general col.c-calibre{width:8%!important;}
.libro-table-v158.modo-general col.c-entrada{width:10%!important;}
.libro-table-v158.modo-general col.c-salida{width:10%!important;}
.libro-table-v158.modo-categoria col.c-asiento{width:7%!important;}
.libro-table-v158.modo-categoria col.c-fecha{width:9%!important;}
.libro-table-v158.modo-categoria col.c-guia{width:24%!important;}
.libro-table-v158.modo-categoria col.c-procedencia{width:17%!important;}
.libro-table-v158.modo-categoria col.c-destino{width:18%!important;}
.libro-table-v158.modo-categoria col.c-entrada{width:8%!important;}
.libro-table-v158.modo-categoria col.c-salida{width:8%!important;}
.libro-table-v158.modo-categoria col.c-total{width:9%!important;}
@page{size:A4 landscape;margin:6mm!important;}
@media print{
  html,body{margin:0!important;padding:0!important;background:white!important;overflow:visible!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}
  .sidebar,.menu-toggle,.menu-overlay,h1,.libro-registro-box,.libro-actions-row,.libro-filter-line,.libro-filter-actions{display:none!important;}
  .app,.main{display:block!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;}
  .card.print-actions{display:block!important;width:285mm!important;max-width:285mm!important;margin:0!important;padding:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important;}
  .libro-table-v158{width:285mm!important;min-width:285mm!important;max-width:285mm!important;table-layout:fixed!important;font-size:6.9px!important;line-height:1!important;}
  .libro-table-v158 th,.libro-table-v158 td{padding:1.1px 1.3px!important;line-height:1!important;}
  .libro-table-v158 th{font-size:6.7px!important;border-bottom:2px solid #777!important;}
  .libro-table-v158 td{font-size:6.5px!important;}
  .existencia-anterior-box{font-size:8px!important;margin:1.5mm 0!important;padding:1mm 1.5mm!important;}
  .pdf-footer{display:none!important;}
}


/* V169 - override final para impresión A4 horizontal de libros */
@page { size: A4 landscape; margin: 6mm; }
@media print {
  html, body { width:auto!important; min-width:0!important; max-width:none!important; margin:0!important; padding:0!important; background:#fff!important; overflow:visible!important; }
  .actions,.notice-print-hide,.print-actions,.no-print,.sidebar,.menu-toggle,.menu-overlay,h1 { display:none!important; }
  .preview-wrap,.preview-card { width:100%!important; min-width:0!important; max-width:none!important; height:auto!important; min-height:0!important; margin:0!important; padding:0!important; box-shadow:none!important; border-radius:0!important; overflow:visible!important; transform:none!important; }
  .preview-head { width:100%!important; display:grid!important; grid-template-columns:28mm 1fr 62mm!important; align-items:center!important; margin:0 0 3mm 0!important; padding:3mm 3.5mm!important; background:#d9d9d9!important; }
  .preview-head img { max-width:24mm!important; max-height:11mm!important; object-fit:contain!important; }
  .preview-title { font-size:11pt!important; line-height:1.08!important; font-weight:900!important; text-align:center!important; }
  .preview-company { font-size:8.5pt!important; line-height:1.08!important; font-weight:900!important; text-align:right!important; }
  .preview-info-line { width:100%!important; margin:0 0 2mm 0!important; padding:1.5mm 2mm!important; font-size:8pt!important; line-height:1.1!important; }
  .preview-table-wrap { width:100%!important; min-width:0!important; max-width:100%!important; margin:0!important; padding:0!important; overflow:visible!important; }
  .preview-libro-table { width:100%!important; min-width:0!important; max-width:100%!important; table-layout:fixed!important; border-collapse:collapse!important; font-size:7.2pt!important; line-height:1.08!important; }
  .preview-libro-table th,.preview-libro-table td { text-align:center!important; vertical-align:middle!important; white-space:normal!important; overflow-wrap:anywhere!important; word-break:normal!important; padding:1.7pt 2pt!important; line-height:1.08!important; }
  .preview-libro-table th { font-size:7.2pt!important; font-weight:900!important; border-bottom:2pt solid #777!important; }
  .preview-libro-table td { font-size:7pt!important; border-bottom:.7pt solid #cbd5e1!important; }
  .preview-libro-table .stack-lines { display:block!important; text-align:center!important; line-height:1.08!important; white-space:normal!important; overflow-wrap:anywhere!important; }
  .preview-libro-table.modo-general col.c-asiento{width:5%!important}.preview-libro-table.modo-general col.c-fecha{width:7%!important}.preview-libro-table.modo-general col.c-tipo{width:13%!important}.preview-libro-table.modo-general col.c-guia{width:18%!important}.preview-libro-table.modo-general col.c-procedencia{width:14%!important}.preview-libro-table.modo-general col.c-destino{width:16%!important}.preview-libro-table.modo-general col.c-calibre{width:8%!important}.preview-libro-table.modo-general col.c-entrada{width:9.5%!important}.preview-libro-table.modo-general col.c-salida{width:9.5%!important}
  .preview-libro-table.modo-categoria col.c-asiento{width:7%!important}.preview-libro-table.modo-categoria col.c-fecha{width:9%!important}.preview-libro-table.modo-categoria col.c-guia{width:24%!important}.preview-libro-table.modo-categoria col.c-procedencia{width:17%!important}.preview-libro-table.modo-categoria col.c-destino{width:18%!important}.preview-libro-table.modo-categoria col.c-entrada{width:8%!important}.preview-libro-table.modo-categoria col.c-salida{width:8%!important}.preview-libro-table.modo-categoria col.c-total{width:9%!important}
}


/* V170 - Validación / Presentación Guardia Civil */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:16px}.kpi-num{font-size:34px;font-weight:900;line-height:1}.gc-ok{color:#15803d}.estado-validado td{font-weight:800}.estado-presentado-gc td{color:#15803d!important;font-weight:900}.badge-gc{display:inline-flex;align-items:center;gap:5px;background:#dcfce7;color:#166534;border:1px solid #86efac;border-radius:999px;padding:3px 8px;font-weight:900;font-size:12px}.badge-gc:before{content:'🔒'}.btn-success{background:#15803d!important;color:#fff!important;border-color:#15803d!important}.btn-small{padding:5px 9px!important;font-size:12px!important}.gc-presentado-box{border:2px solid #86efac!important;background:#f0fdf4!important}

/* V171 retoques movimientos/GC */
.estado-presentado-gc td{color:#b91c1c!important;font-weight:900!important;}
.estado-validado td{color:#1d4ed8!important;font-weight:800!important;}
.mov-entrada td{font-weight:800;}
.movimientos-compactos table td,
.movimientos-compactos table th{white-space:nowrap;line-height:1.15;padding-top:6px;padding-bottom:6px;vertical-align:middle;}
.center{text-align:center!important;}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;border:1px solid #cbd5e1;background:#f8fafc;color:#0f172a;font-weight:900;text-decoration:none;cursor:pointer;padding:0!important;font-size:15px;}
.icon-btn.danger{background:#fee2e2;border-color:#fecaca;color:#991b1b;}
.mov-actions-top{display:flex;justify-content:flex-end;align-items:center;gap:6px;white-space:nowrap;}
.inline-form{display:inline;margin:0;}
.stock-chip{display:inline-block;min-width:70px;text-align:center;}
.mov-entrada td{font-weight:inherit;}
.mov-entrada td:first-child{color:#15803d!important;font-weight:900!important;}
.estado-presentado-gc.mov-entrada td:first-child{color:#b91c1c!important;}
.estado-validado.mov-entrada td:first-child{color:#1d4ed8!important;}


/* V172 - iconos ultra compactos en Movimientos */
.movimientos-compactos table td,
.movimientos-compactos table th{
  padding-top:3px!important;
  padding-bottom:3px!important;
  line-height:1.05!important;
}
.movimientos-compactos td:last-child{
  width:42px!important;
  min-width:42px!important;
  padding-left:2px!important;
  padding-right:2px!important;
  text-align:right!important;
}
.movimientos-compactos .mov-actions-top{
  display:inline-flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:2px!important;
  height:auto!important;
  min-height:0!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.movimientos-compactos .inline-form{
  display:inline-flex!important;
  align-items:center!important;
  margin:0!important;
  padding:0!important;
  height:auto!important;
  min-height:0!important;
}
.movimientos-compactos .icon-btn{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  min-height:18px!important;
  max-width:18px!important;
  max-height:18px!important;
  padding:0!important;
  margin:0!important;
  border-radius:4px!important;
  font-size:10px!important;
  line-height:18px!important;
  font-family:Arial, Helvetica, sans-serif!important;
  vertical-align:middle!important;
}
.movimientos-compactos .icon-btn.danger{
  font-size:11px!important;
}


/* V173/V174 - entradas en movimientos en verde, negrita y cursiva */
.movimientos-compactos .mov-entrada td:first-child{
  color:#15803d!important;
  font-weight:900!important;
  font-style:italic!important;
}
.movimientos-compactos .mov-entrada td{
  font-style:italic!important;
}
.estado-presentado-gc.mov-entrada td:first-child{color:#b91c1c!important;}
.estado-validado.mov-entrada td:first-child{color:#1d4ed8!important;}


/* V181 - colores visibles por estado en la pantalla de Libro registro/exportar.php */
.libro-table tr.estado-presentado-gc td,
.libro-table tr.estado-presentado-gc td *{
  color:#b91c1c!important;
  font-weight:900!important;
}
.libro-table tr.estado-validado td,
.libro-table tr.estado-validado td *{
  color:#166534!important;
}
.libro-table tr:not(.estado-validado):not(.estado-presentado-gc) td,
.libro-table tr:not(.estado-validado):not(.estado-presentado-gc) td *{
  font-weight:400;
}

/* V182: calibre visible en informes por categoría 22, PISTOLA y RIFLE */
.libro-table-v158.modo-categoria-calibre col.c-asiento{width:6%!important;}
.libro-table-v158.modo-categoria-calibre col.c-fecha{width:8%!important;}
.libro-table-v158.modo-categoria-calibre col.c-guia{width:20%!important;}
.libro-table-v158.modo-categoria-calibre col.c-procedencia{width:15%!important;}
.libro-table-v158.modo-categoria-calibre col.c-destino{width:16%!important;}
.libro-table-v158.modo-categoria-calibre col.c-calibre{width:8%!important;}
.libro-table-v158.modo-categoria-calibre col.c-entrada{width:8%!important;}
.libro-table-v158.modo-categoria-calibre col.c-salida{width:8%!important;}
.libro-table-v158.modo-categoria-calibre col.c-total{width:11%!important;}


/* V198 - Administración: tablet/móvil con disposición tipo PC */
@media(max-width:900px){
  body.admin-role .main{
    padding:24px!important;
    padding-top:24px!important;
  }

  body.admin-role h1{
    margin-left:0!important;
  }

  body.admin-role table{
    display:table!important;
    white-space:normal!important;
    overflow:visible!important;
  }

  body.admin-role thead{
    display:table-header-group!important;
  }

  body.admin-role tbody{
    display:table-row-group!important;
  }

  body.admin-role tr{
    display:table-row!important;
  }

  body.admin-role th,
  body.admin-role td{
    display:table-cell!important;
    white-space:normal!important;
  }

  body.admin-role .actions{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
  }

  body.admin-role .actions .btn,
  body.admin-role .actions button{
    width:auto!important;
    margin:0!important;
  }

  body.admin-role .grid{
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;
  }

  body.admin-role .section-tabs{
    display:flex!important;
    flex-wrap:wrap!important;
  }

  body.admin-role .section-tabs .btn{
    width:auto!important;
  }
}


/* V200 - Responsive admin seguro SOLO CSS.
   No toca layout.php ni mete JavaScript.
   Evita HTTP 500 y mantiene todos los campos visibles con scroll horizontal. */

@media(max-width:1180px){

  body.admin-role .main,
  body.admin-role .content,
  body.admin-role .page,
  body.admin-role .card{
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  body.admin-role .card{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body.admin-role table,
  body.admin-role .libro-table,
  body.admin-role .movimientos-table,
  body.admin-role .preview-table,
  body.admin-role .config-table{
    width:max-content!important;
    min-width:100%!important;
    table-layout:auto!important;
    border-collapse:collapse!important;
  }

  body.admin-role table th,
  body.admin-role table td,
  body.admin-role .libro-table th,
  body.admin-role .libro-table td,
  body.admin-role .movimientos-table th,
  body.admin-role .movimientos-table td,
  body.admin-role .preview-table th,
  body.admin-role .preview-table td{
    white-space:nowrap!important;
    vertical-align:middle!important;
    font-size:12px!important;
    line-height:1.15!important;
    padding:5px 7px!important;
  }

  body.admin-role table th,
  body.admin-role .libro-table th,
  body.admin-role .movimientos-table th,
  body.admin-role .preview-table th{
    position:sticky!important;
    top:0!important;
    z-index:3!important;
    background:#f8fafc!important;
  }

  body.admin-role .stack-lines,
  body.admin-role .stack-lines div{
    white-space:nowrap!important;
    line-height:1.12!important;
  }

  body.admin-role .num,
  body.admin-role .ctr{
    text-align:center!important;
  }

  body.admin-role .txt-left{
    text-align:left!important;
  }

  body.admin-role .compact-actions,
  body.admin-role .row-actions,
  body.admin-role .acciones,
  body.admin-role .acciones-mini{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:4px!important;
    white-space:nowrap!important;
  }

  body.admin-role .compact-actions a,
  body.admin-role .compact-actions button,
  body.admin-role .row-actions a,
  body.admin-role .row-actions button,
  body.admin-role .acciones a,
  body.admin-role .acciones button,
  body.admin-role .acciones-mini a,
  body.admin-role .acciones-mini button{
    width:auto!important;
    min-width:22px!important;
    height:22px!important;
    padding:2px 4px!important;
    font-size:12px!important;
    line-height:1!important;
  }

  body.admin-role .filters,
  body.admin-role .filtros,
  body.admin-role .toolbar,
  body.admin-role .actions{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    align-items:end!important;
  }

  body.admin-role .filters input,
  body.admin-role .filters select,
  body.admin-role .filtros input,
  body.admin-role .filtros select,
  body.admin-role .toolbar input,
  body.admin-role .toolbar select{
    min-width:150px!important;
    max-width:100%!important;
  }
}

@media(max-width:700px){

  body.admin-role{
    overflow-x:hidden!important;
  }

  body.admin-role .main{
    padding:10px!important;
  }

  body.admin-role h1{
    font-size:20px!important;
  }

  body.admin-role h2{
    font-size:17px!important;
  }

  body.admin-role .card{
    padding:10px!important;
    border-radius:12px!important;
    overflow-x:auto!important;
  }

  body.admin-role table th,
  body.admin-role table td,
  body.admin-role .libro-table th,
  body.admin-role .libro-table td,
  body.admin-role .movimientos-table th,
  body.admin-role .movimientos-table td,
  body.admin-role .preview-table th,
  body.admin-role .preview-table td{
    font-size:11px!important;
    padding:4px 6px!important;
  }

  body.admin-role .libro-table,
  body.admin-role .preview-table{
    min-width:980px!important;
  }

  body.admin-role .movimientos-table{
    min-width:900px!important;
  }

  body.admin-role .section-tabs,
  body.admin-role .tabs{
    overflow-x:auto!important;
    white-space:nowrap!important;
    flex-wrap:nowrap!important;
    padding-bottom:4px!important;
  }

  body.admin-role .section-tabs a,
  body.admin-role .tabs a,
  body.admin-role .section-tabs .btn{
    flex:0 0 auto!important;
  }
}

@media screen and (max-width:900px){
  body.admin-role .print-area,
  body.admin-role .a4-preview,
  body.admin-role #print-area,
  body.admin-role #vista-previa{
    width:max-content!important;
    min-width:980px!important;
    transform:none!important;
    zoom:1!important;
  }

  body.admin-role .preview-page,
  body.admin-role .page-preview{
    overflow-x:auto!important;
    max-width:100%!important;
  }
}

@media print{
  body.admin-role .card{
    overflow:visible!important;
  }

  body.admin-role table,
  body.admin-role .libro-table,
  body.admin-role .preview-table{
    width:100%!important;
    min-width:0!important;
  }

  body.admin-role table th,
  body.admin-role table td{
    white-space:normal!important;
    font-size:8.5pt!important;
    padding:2.5pt!important;
  }
}


/* V201 - Cajones de movimientos móvil/tablet */
@media(max-width:900px){
  body.admin-role .mov-mobile-cards{display:block!important}
}
@media(min-width:901px){
  body.admin-role .mov-mobile-cards{display:none!important}
}




/* V203 - Móvil/tablet: libro registro con filtros + vista previa normal.
   Sin botones extra de imprimir/exportar. */
@media(max-width:900px){
  body.admin-role .libro-mobile-actions{
    display:none!important;
  }

  body.admin-role .libro-table,
  body.admin-role table.libro-table{
    display:table!important;
  }

  body.admin-role .libro-scroll,
  body.admin-role .responsive-table-wrap,
  body.admin-role .card{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body.admin-role .libro-table{
    width:max-content!important;
    min-width:980px!important;
  }
}


/* V213 - Movimientos móvil/tablet: entradas en burbuja verde clara */
@media(max-width:900px){
  .mov-mobile-card.entrada{
    background:#dcfce7!important;
    border-color:#86efac!important;
    border-left:6px solid #15803d!important;
    font-weight:800!important;
    font-style:italic!important;
    color:#064e3b!important;
  }

  .mov-mobile-card.entrada .mov-mobile-title,
  .mov-mobile-card.entrada .mov-mobile-value{
    color:#064e3b!important;
    font-weight:900!important;
    font-style:italic!important;
  }

  .mov-mobile-card.entrada .mov-mobile-label{
    color:#166534!important;
    font-weight:900!important;
  }
}


/* V214 - Fallback global acciones burbujas movimientos */
@media(max-width:900px){
  .mov-mobile-card{position:relative!important}
  .mov-mobile-card .mov-mobile-head{padding-right:66px!important}
  .mov-mobile-card .mov-mobile-actions{
    position:absolute!important;
    top:8px!important;
    right:8px!important;
    display:flex!important;
    gap:5px!important;
    border:0!important;
    margin:0!important;
    padding:0!important;
  }
  .mov-mobile-card .mov-mobile-actions a,
  .mov-mobile-card .mov-mobile-actions button{
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    min-height:26px!important;
    padding:0!important;
    border-radius:7px!important;
    font-size:0!important;
    background:#fff!important;
    border:1px solid #cbd5e1!important;
  }
  .mov-mobile-card.bloqueado .mov-mobile-actions,
  .mov-mobile-card.estado-validado .mov-mobile-actions,
  .mov-mobile-card.estado-presentado-gc .mov-mobile-actions{display:none!important}
}

/* V216 - acciones reales fallback */
@media(max-width:900px){
  .mov-mobile-card{position:relative!important}
  .mov-mobile-card .mov-mobile-head{padding-right:72px!important}
  .mov-mobile-actions.v216-actions{
    position:absolute!important;
    right:8px!important;
    top:8px!important;
    display:flex!important;
    gap:5px!important;
  }
  .mov-mobile-actions.v216-actions a{
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    min-height:28px!important;
    border-radius:8px!important;
    background:#fff!important;
    border:1px solid #cbd5e1!important;
    text-decoration:none!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* V211 - Burbuja inferior única.
   Sin burbuja izquierda, sin barra inferior que tape botones. */

body.menu-abajo-activo{
  overflow-x:hidden!important;
}

body.menu-abajo-activo .sidebar,
body.menu-abajo-activo #sidebar,
body.menu-abajo-activo nav.sidebar,
body.menu-abajo-activo aside.sidebar,
body.menu-abajo-activo .side-menu,
body.menu-abajo-activo #menu,
body.menu-abajo-activo .menu-abajo-drawer{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  top:auto!important;
  width:100vw!important;
  max-width:100vw!important;
  max-height:78vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  transform:translateY(115%)!important;
  transition:transform .22s ease!important;
  z-index:99980!important;
  border-radius:18px 18px 0 0!important;
  background:#111827!important;
  color:#fff!important;
  padding:16px 12px 18px 12px!important;
  box-shadow:0 -14px 34px rgba(0,0,0,.32)!important;
}

body.menu-abajo-activo.menu-abajo-abierto .sidebar,
body.menu-abajo-activo.menu-abajo-abierto #sidebar,
body.menu-abajo-activo.menu-abajo-abierto nav.sidebar,
body.menu-abajo-activo.menu-abajo-abierto aside.sidebar,
body.menu-abajo-activo.menu-abajo-abierto .side-menu,
body.menu-abajo-activo.menu-abajo-abierto #menu,
body.menu-abajo-activo.menu-abajo-abierto .menu-abajo-drawer{
  transform:translateY(0)!important;
}

body.menu-abajo-activo .main,
body.menu-abajo-activo main,
body.menu-abajo-activo .content,
body.menu-abajo-activo .page,
body.menu-abajo-activo .app,
body.menu-abajo-activo .container{
  margin-left:0!important;
  padding-left:10px!important;
  padding-right:10px!important;
  padding-bottom:8px!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

.menu-abajo-boton,
.bottom-open-menu-button,
.bottom-menu-tab{
  position:fixed!important;
  right:10px!important;
  left:auto!important;
  bottom:10px!important;
  transform:none!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  border-radius:999px!important;
  border:0!important;
  padding:0!important;
  background:#111827!important;
  color:#fff!important;
  font-size:0!important;
  line-height:44px!important;
  text-align:center!important;
  box-shadow:0 8px 24px rgba(0,0,0,.30)!important;
  z-index:99990!important;
  cursor:pointer!important;
  opacity:.88!important;
}

.menu-abajo-boton::before,
.bottom-open-menu-button::before,
.bottom-menu-tab::before{
  content:"☰";
  display:block;
  font-size:22px!important;
  line-height:44px!important;
  text-align:center!important;
  color:#fff!important;
}

body.menu-abajo-abierto .menu-abajo-boton,
body.menu-abajo-abierto .bottom-open-menu-button,
body.menu-abajo-abierto .bottom-menu-tab{
  background:#b91c1c!important;
  opacity:1!important;
}

body.menu-abajo-abierto .menu-abajo-boton::before,
body.menu-abajo-abierto .bottom-open-menu-button::before,
body.menu-abajo-abierto .bottom-menu-tab::before{
  content:"×";
  font-size:26px!important;
}

body.menu-abajo-activo .sidebar a,
body.menu-abajo-activo #sidebar a,
body.menu-abajo-activo nav.sidebar a,
body.menu-abajo-activo aside.sidebar a,
body.menu-abajo-activo .side-menu a,
body.menu-abajo-activo #menu a,
body.menu-abajo-activo .menu-abajo-drawer a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:36px!important;
  margin:4px!important;
  padding:8px 11px!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
  text-decoration:none!important;
  white-space:nowrap!important;
}

body.menu-abajo-activo .navtitle{
  display:block!important;
  width:100%!important;
  color:#facc15!important;
  margin:8px 0 5px 4px!important;
  font-weight:800!important;
}

/* Ocultar de forma agresiva burbujas/toggles laterales antiguos */
@media(max-width:1200px){
  .sidebar-toggle,
  .menu-toggle,
  .nav-toggle,
  .toggle-menu,
  .toggle-sidebar,
  .hamburger,
  .hamburger-menu,
  .floating-menu,
  .floating-toggle,
  .side-toggle,
  .open-menu,
  .btn-menu,
  .menu-float,
  .bubble-menu,
  .burbuja-menu,
  .flecha-menu,
  .menu-arrow,
  .sidebar-arrow,
  .collapse-toggle,
  .drawer-toggle,
  #sidebar-toggle,
  #menu-toggle,
  #nav-toggle,
  #toggle-menu,
  #toggleSidebar,
  #open-menu,
  #floating-menu{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="menu"],
  body.menu-abajo-activo a:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="menu"],
  body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="toggle"],
  body.menu-abajo-activo a:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="toggle"],
  body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="sidebar"],
  body.menu-abajo-activo a:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="sidebar"]{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
}

@media(max-width:900px){
  .menu-abajo-boton,
  .bottom-open-menu-button,
  .bottom-menu-tab{
    right:8px!important;
    bottom:8px!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    max-width:40px!important;
    max-height:40px!important;
    line-height:40px!important;
  }

  .menu-abajo-boton::before,
  .bottom-open-menu-button::before,
  .bottom-menu-tab::before{
    font-size:20px!important;
    line-height:40px!important;
  }

  body.menu-abajo-activo .main,
  body.menu-abajo-activo main,
  body.menu-abajo-activo .content,
  body.menu-abajo-activo .page{
    padding-bottom:8px!important;
  }
}

@media print{
  .menu-abajo-boton,
  .bottom-open-menu-button,
  .bottom-menu-tab,
  body.menu-abajo-activo .sidebar,
  body.menu-abajo-activo #sidebar,
  body.menu-abajo-activo nav.sidebar,
  body.menu-abajo-activo aside.sidebar,
  body.menu-abajo-activo .side-menu,
  body.menu-abajo-activo #menu,
  body.menu-abajo-activo .menu-abajo-drawer{
    display:none!important;
  }
}


/* V212 - Menú PC compacto y burbuja centrada */

@media(min-width:901px){

  body.menu-abajo-activo .sidebar,
  body.menu-abajo-activo #sidebar,
  body.menu-abajo-activo nav.sidebar,
  body.menu-abajo-activo aside.sidebar,
  body.menu-abajo-activo .side-menu,
  body.menu-abajo-activo #menu,
  body.menu-abajo-activo .menu-abajo-drawer{
    left:50%!important;
    right:auto!important;
    bottom:62px!important;
    top:auto!important;
    width:auto!important;
    min-width:620px!important;
    max-width:min(980px, calc(100vw - 40px))!important;
    height:auto!important;
    min-height:0!important;
    max-height:70vh!important;
    transform:translate(-50%, 125%)!important;
    border-radius:18px!important;
    padding:14px!important;
    display:block!important;
    box-sizing:border-box!important;
  }

  body.menu-abajo-activo.menu-abajo-abierto .sidebar,
  body.menu-abajo-activo.menu-abajo-abierto #sidebar,
  body.menu-abajo-activo.menu-abajo-abierto nav.sidebar,
  body.menu-abajo-activo.menu-abajo-abierto aside.sidebar,
  body.menu-abajo-activo.menu-abajo-abierto .side-menu,
  body.menu-abajo-activo.menu-abajo-abierto #menu,
  body.menu-abajo-activo.menu-abajo-abierto .menu-abajo-drawer{
    transform:translate(-50%, 0)!important;
  }

  .menu-abajo-boton,
  .bottom-open-menu-button,
  .bottom-menu-tab{
    left:50%!important;
    right:auto!important;
    bottom:12px!important;
    transform:translateX(-50%)!important;
    width:46px!important;
    height:46px!important;
    min-width:46px!important;
    min-height:46px!important;
    max-width:46px!important;
    max-height:46px!important;
  }

  .menu-abajo-boton::before,
  .bottom-open-menu-button::before,
  .bottom-menu-tab::before{
    line-height:46px!important;
  }

  body.menu-abajo-activo .sidebar a,
  body.menu-abajo-activo #sidebar a,
  body.menu-abajo-activo nav.sidebar a,
  body.menu-abajo-activo aside.sidebar a,
  body.menu-abajo-activo .side-menu a,
  body.menu-abajo-activo #menu a,
  body.menu-abajo-activo .menu-abajo-drawer a{
    min-height:34px!important;
    padding:8px 11px!important;
    margin:3px!important;
    font-size:13px!important;
  }

  body.menu-abajo-activo .navtitle{
    margin:8px 0 5px 4px!important;
    font-size:12px!important;
  }
}

@media(max-width:900px){

  .menu-abajo-boton,
  .bottom-open-menu-button,
  .bottom-menu-tab{
    left:50%!important;
    right:auto!important;
    bottom:8px!important;
    transform:translateX(-50%)!important;
  }

  body.menu-abajo-activo .sidebar,
  body.menu-abajo-activo #sidebar,
  body.menu-abajo-activo nav.sidebar,
  body.menu-abajo-activo aside.sidebar,
  body.menu-abajo-activo .side-menu,
  body.menu-abajo-activo #menu,
  body.menu-abajo-activo .menu-abajo-drawer{
    max-height:70vh!important;
    padding:12px 10px 14px 10px!important;
  }
}


/* V213 - Movimientos móvil/tablet: entradas en burbuja verde clara */
@media(max-width:900px){
  .mov-mobile-card.entrada{
    background:#dcfce7!important;
    border-color:#86efac!important;
    border-left:6px solid #15803d!important;
    font-weight:800!important;
    font-style:italic!important;
    color:#064e3b!important;
  }

  .mov-mobile-card.entrada .mov-mobile-title,
  .mov-mobile-card.entrada .mov-mobile-value{
    color:#064e3b!important;
    font-weight:900!important;
    font-style:italic!important;
  }

  .mov-mobile-card.entrada .mov-mobile-label{
    color:#166534!important;
    font-weight:900!important;
  }
}


/* V214 - Fallback global acciones burbujas movimientos */
@media(max-width:900px){
  .mov-mobile-card{position:relative!important}
  .mov-mobile-card .mov-mobile-head{padding-right:66px!important}
  .mov-mobile-card .mov-mobile-actions{
    position:absolute!important;
    top:8px!important;
    right:8px!important;
    display:flex!important;
    gap:5px!important;
    border:0!important;
    margin:0!important;
    padding:0!important;
  }
  .mov-mobile-card .mov-mobile-actions a,
  .mov-mobile-card .mov-mobile-actions button{
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    min-height:26px!important;
    padding:0!important;
    border-radius:7px!important;
    font-size:0!important;
    background:#fff!important;
    border:1px solid #cbd5e1!important;
  }
  .mov-mobile-card.bloqueado .mov-mobile-actions,
  .mov-mobile-card.estado-validado .mov-mobile-actions,
  .mov-mobile-card.estado-presentado-gc .mov-mobile-actions{display:none!important}
}

/* V216 - acciones reales fallback */
@media(max-width:900px){
  .mov-mobile-card{position:relative!important}
  .mov-mobile-card .mov-mobile-head{padding-right:72px!important}
  .mov-mobile-actions.v216-actions{
    position:absolute!important;
    right:8px!important;
    top:8px!important;
    display:flex!important;
    gap:5px!important;
  }
  .mov-mobile-actions.v216-actions a{
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    min-height:28px!important;
    border-radius:8px!important;
    background:#fff!important;
    border:1px solid #cbd5e1!important;
    text-decoration:none!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* V218 - eliminar restos de pestaña/flechita lateral antigua en PC/tablet/móvil.
   Se conserva solo la burbuja inferior nueva. */

.sidebar-handle,
.sidebar-tab,
.menu-handle,
.menu-tab,
.side-handle,
.side-tab,
.handle-menu,
.tab-menu,
.collapse-handle,
.collapse-tab,
.sidebar-collapse,
.sidebar-collapser,
.sidebar-toggle-handle,
.sidebar-mini-toggle,
.menu-mini-toggle,
.floating-sidebar-toggle,
.drawer-handle,
.drawer-tab,
.offcanvas-toggle,
.offcanvas-handle,
#sidebar-handle,
#sidebar-tab,
#menu-handle,
#menu-tab,
#side-handle,
#side-tab{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* Cualquier resto oscuro lateral con flecha */
body.menu-abajo-activo [class*="collapse"],
body.menu-abajo-activo [class*="handle"],
body.menu-abajo-activo [class*="drawer-toggle"],
body.menu-abajo-activo [class*="sidebar-toggle"],
body.menu-abajo-activo [id*="collapse"],
body.menu-abajo-activo [id*="handle"],
body.menu-abajo-activo [id*="sidebar-toggle"]{
  /* No tocar el menú real ni la burbuja nueva */
}

body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="collapse"],
body.menu-abajo-activo div:not(.menu-abajo-drawer):not(.sidebar):not(#sidebar)[class*="collapse"],
body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="handle"],
body.menu-abajo-activo div:not(.menu-abajo-drawer):not(.sidebar):not(#sidebar)[class*="handle"],
body.menu-abajo-activo button:not(.menu-abajo-boton):not(.bottom-open-menu-button):not(.bottom-menu-tab)[class*="toggle"],
body.menu-abajo-activo div:not(.menu-abajo-drawer):not(.sidebar):not(#sidebar)[class*="toggle"]{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* La burbuja inferior correcta nunca se oculta */
.menu-abajo-boton{
  display:block!important;
  visibility:visible!important;
  opacity:.88!important;
  pointer-events:auto!important;
}
body.menu-abajo-abierto .menu-abajo-boton{
  opacity:1!important;
}

/* V221 - fallback asiento acciones */
.mov-asiento-badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:22px;padding:0 8px;border-radius:999px;font-weight:900;font-size:12px;background:#e5e7eb;color:#334155}
.mov-asiento-badge.sin{background:#f8fafc;color:#64748b;border:1px dashed #94a3b8}
@media(max-width:900px){
  .mov-mobile-asiento{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:24px;border-radius:999px;font-weight:900;font-size:12px;margin-right:6px;padding:0 8px;background:#e5e7eb;color:#334155}
  .mov-mobile-asiento.sin{background:#f8fafc;color:#64748b;border:1px dashed #94a3b8}
  .mov-mobile-actions.v221-actions{position:absolute!important;right:8px!important;top:8px!important;display:flex!important;gap:5px!important}
  .mov-mobile-actions.v221-actions a{width:29px!important;height:29px!important;min-width:29px!important;min-height:29px!important;border-radius:8px!important;background:#fff!important;border:1px solid #cbd5e1!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important}
}


/* ============================================================
   V226 - Venta táctil: sin capa gris inicial + cliente visible arriba
   ============================================================ */
body.venta-touch-screen:not(.menu-open) .menu-overlay{
  display:none!important;
  pointer-events:none!important;
  background:transparent!important;
}
body.venta-touch-screen.menu-open .menu-overlay{
  display:block!important;
  pointer-events:auto!important;
  background:rgba(0,0,0,.35)!important;
}
body.venta-touch-screen .touch-search:not(:placeholder-shown){
  font-weight:800!important;
  color:#0f172a!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1) .touch-summary{
  height:calc(100% - 22px)!important;
  align-items:center!important;
}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1) .touch-step-title{
  margin-bottom:5px!important;
}


/* ============================================================
   V228 - Venta táctil: eliminado bloque 1 Cliente seleccionado.
   El cliente/DNI queda solo en la barra superior de búsqueda.
   Se reasigna la rejilla para aprovechar el hueco libre.
   ============================================================ */
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1 / span 3!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:2!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:3!important;grid-row:1 / span 2!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){grid-column:2!important;grid-row:3!important;}
body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){grid-column:3!important;grid-row:3!important;}

body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1) .touch-category-grid{
  height:calc(100% - 30px)!important;
  grid-auto-rows:minmax(84px,1fr)!important;
}

body.venta-touch-screen .touch-search-row,
body.venta-touch-screen .touch-body>.touch-card:first-of-type{
  margin-bottom:8px!important;
}

@media(max-width:1100px){
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(1){grid-column:1!important;grid-row:1 / span 3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(2){grid-column:2!important;grid-row:1!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(3){grid-column:2!important;grid-row:2!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(4){grid-column:2!important;grid-row:3!important;}
  body.venta-touch-screen #formVentaTouch>.touch-card:nth-of-type(5){display:none!important;}
}


/* V236 - Corrección venta mostrador: PC intacto desde v230, asistente solo móvil */
@media (min-width:1025px){
  body.venta-touch-screen:not(.touch-mobile-wizard) .touch-body{
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto!important;
  }
  body.venta-touch-screen:not(.touch-mobile-wizard) .touch-body > .touch-card{
    display:block!important;
    grid-column:1!important;
    grid-row:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch{
    display:grid!important;
    width:100%!important;
  }
  body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }
  body.venta-touch-screen:not(.touch-mobile-wizard) .touch-wizard-prev,
  body.venta-touch-screen:not(.touch-mobile-wizard) .touch-wizard-next{
    display:none!important;
  }
  body.venta-touch-screen:not(.touch-mobile-wizard) #touchWizardSubmit{
    display:block!important;
  }
}

@media (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard .touch-body{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-body > .touch-card{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-body > .touch-card.touch-step-active{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:calc(100dvh - 170px)!important;
    overflow:auto!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch > .touch-card{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch > .touch-card.touch-step-active{
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) #touchWizardSubmit{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last #touchWizardSubmit{
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-wizard-prev,
  body.venta-touch-screen.touch-mobile-wizard .touch-wizard-next{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* V259 - Compras/entradas en azul oscuro en libros y vistas previas */
.libro-entrada-azul td,
.libro-table .mov-entrada td,
.preview-libro-table .mov-entrada td,
.tabla-libro-main .mov-entrada td{
  color:#0b2f6b!important;
  font-weight:800!important;
}
.libro-entrada-azul td:first-child,
.libro-table .mov-entrada td:first-child,
.preview-libro-table .mov-entrada td:first-child,
.tabla-libro-main .mov-entrada td:first-child{
  color:#0b2f6b!important;
}

/* ============================================================
   V279 - Venta táctil tablet/móvil: asistente real de un paso
   - PC/escritorio conserva el formato existente.
   - Tablet/móvil: una sola pantalla por paso.
   - Búsqueda de cliente a pantalla completa usando altura visible
     para que el teclado no tape los resultados.
   ============================================================ */
body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{
  display:none;
}

@media screen and (pointer:coarse), screen and (hover:none), screen and (max-width:1280px){
  html:has(body.venta-touch-screen.touch-mobile-wizard-v279),
  body.venta-touch-screen.touch-mobile-wizard-v279{
    width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    margin:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    background:#eef2f7!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 *{
    box-sizing:border-box!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .app,
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    width:100%!important;
    max-width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    overflow:visible!important;
    background:#eef2f7!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    padding:8px 10px 78px 44px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .main>h1,
  body.venta-touch-screen.touch-mobile-wizard-v279 .admin-quick-actions.venta-11-screen{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body{
    width:100%!important;
    max-width:980px!important;
    margin:0 auto!important;
    padding:0!important;
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-header{
    height:44px!important;
    min-height:44px!important;
    margin:0 0 6px!important;
    padding:0 2px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-logo{
    font-size:18px!important;
    line-height:1!important;
    gap:8px!important;
    color:#0f172a!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-logo small{
    font-size:13px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-user-badge{
    height:32px!important;
    min-height:32px!important;
    padding:5px 10px!important;
    font-size:12px!important;
    white-space:nowrap!important;
    border-radius:999px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{
    display:grid!important;
    grid-template-columns:repeat(6,1fr)!important;
    gap:4px!important;
    margin:0 0 6px!important;
    height:30px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress span{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    border-radius:999px!important;
    background:#dbe4f0!important;
    color:#334155!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:900!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    padding:0 5px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="1"] .touch-v279-progress span:nth-child(1),
  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="2"] .touch-v279-progress span:nth-child(2),
  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="3"] .touch-v279-progress span:nth-child(3),
  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="4"] .touch-v279-progress span:nth-child(4),
  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="5"] .touch-v279-progress span:nth-child(5),
  body.venta-touch-screen.touch-mobile-wizard-v279[data-touch-step="6"] .touch-v279-progress span:nth-child(6){
    background:#1d4ed8!important;
    color:#fff!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card{
    display:none!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:12px!important;
    border-radius:18px!important;
    background:#ffffff!important;
    box-shadow:0 10px 26px rgba(15,23,42,.10)!important;
    overflow:auto!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    display:block!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>input[type="hidden"]{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    min-height:calc(100dvh - 176px)!important;
    max-height:calc(100dvh - 176px)!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-step-title{
    font-size:22px!important;
    line-height:1.15!important;
    margin:0 0 12px!important;
    color:#0f172a!important;
    font-weight:950!important;
    white-space:normal!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 132px!important;
    gap:8px!important;
    align-items:center!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-search{
    width:100%!important;
    height:54px!important;
    min-height:54px!important;
    font-size:19px!important;
    padding:10px 14px!important;
    border-radius:14px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-add-client{
    height:54px!important;
    min-height:54px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0 10px!important;
    border-radius:14px!important;
    font-size:17px!important;
    font-weight:900!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    height:auto!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category{
    width:100%!important;
    min-width:0!important;
    min-height:96px!important;
    height:auto!important;
    padding:12px 8px!important;
    border-radius:16px!important;
    font-size:18px!important;
    line-height:1.12!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-icon{
    width:46px!important;
    height:38px!important;
    max-width:46px!important;
    max-height:38px!important;
    object-fit:contain!important;
    margin:0 0 7px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-icon-text{
    font-size:30px!important;
    margin-bottom:7px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-calibres{
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(104px,1fr))!important;
    gap:10px!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-chip{
    width:100%!important;
    min-width:0!important;
    min-height:52px!important;
    height:auto!important;
    padding:8px 6px!important;
    border-radius:13px!important;
    font-size:17px!important;
    line-height:1.12!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid label{
    display:block!important;
    margin:0 0 5px!important;
    font-size:14px!important;
    line-height:1.1!important;
    font-weight:900!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid input,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid select,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid textarea{
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
    padding:8px 11px!important;
    font-size:17px!important;
    border-radius:12px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-help,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-guide-required{
    font-size:12px!important;
    line-height:1.25!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty{
    display:grid!important;
    grid-template-columns:68px minmax(110px,180px) 68px!important;
    justify-content:center!important;
    align-items:center!important;
    gap:16px!important;
    margin:14px 0!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty button{
    width:68px!important;
    height:62px!important;
    min-height:62px!important;
    border-radius:15px!important;
    font-size:34px!important;
    padding:0!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty-number,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty-input{
    width:100%!important;
    max-width:180px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty-number{
    height:auto!important;
    min-height:64px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-qty-input{
    height:44px!important;
    min-height:44px!important;
    font-size:28px!important;
    text-align:center!important;
    border-radius:12px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-fast{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
    height:auto!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-fast button{
    width:100%!important;
    height:54px!important;
    min-height:54px!important;
    border-radius:14px!important;
    font-size:18px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-summary{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    padding:10px!important;
    border-radius:14px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-summary div{
    min-width:0!important;
    padding:8px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-summary span{
    font-size:12px!important;
    font-weight:900!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-summary strong{
    font-size:17px!important;
    line-height:1.2!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions{
    position:fixed!important;
    left:44px!important;
    right:10px!important;
    bottom:8px!important;
    z-index:6000!important;
    display:grid!important;
    grid-template-columns:.72fr .82fr .95fr 1.15fr!important;
    gap:6px!important;
    margin:0!important;
    padding:0!important;
    background:transparent!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions button{
    width:100%!important;
    height:54px!important;
    min-height:54px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:13px!important;
    font-size:clamp(13px,2.1vw,17px)!important;
    line-height:1!important;
    font-weight:950!important;
    padding:0 5px!important;
    white-space:nowrap!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-wizard-prev,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-wizard-next{
    display:flex!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-first .touch-wizard-prev{
    opacity:.35!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279:not(.touch-wizard-last) .touch-save{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-last .touch-wizard-next{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-last .touch-actions{
    grid-template-columns:.8fr .95fr 1.35fr!important;
  }

  /* Buscador cliente a pantalla completa: evita que el teclado tape la lista */
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .app,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .main{
    height:var(--touch-vvh,100dvh)!important;
    min-height:var(--touch-vvh,100dvh)!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .main{
    padding:0!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-header,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-v279-progress,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode #formVentaTouch,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-actions,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .menu-toggle{
    display:none!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body{
    width:100%!important;
    max-width:none!important;
    height:var(--touch-vvh,100dvh)!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body>.touch-card{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--touch-vvh,100dvh)!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:8px 10px 10px!important;
    border-radius:0!important;
    overflow:hidden!important;
    z-index:12000!important;
    background:#ffffff!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body>.touch-card::before{
    content:'Buscar cliente';
    display:block!important;
    height:28px!important;
    line-height:28px!important;
    font-size:18px!important;
    font-weight:950!important;
    color:#0f172a!important;
    margin:0 0 6px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 110px!important;
    gap:6px!important;
    align-items:center!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-search{
    height:46px!important;
    min-height:46px!important;
    font-size:18px!important;
    padding:8px 12px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-add-client{
    height:46px!important;
    min-height:46px!important;
    font-size:15px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-results{
    position:static!important;
    display:block;
    width:100%!important;
    max-height:calc(var(--touch-vvh,100dvh) - 96px)!important;
    margin-top:8px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    border-radius:14px!important;
    box-shadow:none!important;
    -webkit-overflow-scrolling:touch;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-item{
    width:100%!important;
    min-height:52px!important;
    padding:9px 11px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    font-size:15px!important;
    background:#fff!important;
    color:#111827!important;
    border:0!important;
    border-bottom:1px solid #e5e7eb!important;
    border-radius:0!important;
    box-shadow:none!important;
    text-align:left!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-item strong{
    font-size:16px!important;
    line-height:1.1!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-item span{
    font-size:12px!important;
  }
}

@media screen and (pointer:coarse) and (orientation:landscape), screen and (hover:none) and (orientation:landscape), screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    padding:5px 8px 62px 42px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-header{
    height:36px!important;
    min-height:36px!important;
    margin-bottom:4px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{
    height:26px!important;
    margin-bottom:5px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress span{
    font-size:10px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    min-height:calc(100dvh - 135px)!important;
    max-height:calc(100dvh - 135px)!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-step-title{
    font-size:18px!important;
    margin-bottom:8px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category{
    min-height:66px!important;
    font-size:15px!important;
    padding:7px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-icon{
    width:34px!important;
    height:28px!important;
    margin-bottom:4px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-calibres{
    grid-template-columns:repeat(auto-fit,minmax(88px,1fr))!important;
    gap:7px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-chip{
    min-height:42px!important;
    font-size:15px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid input,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid select{
    height:38px!important;
    min-height:38px!important;
    font-size:14px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions button{
    height:48px!important;
    min-height:48px!important;
  }
}

@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    padding:6px 8px 82px 40px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{
    grid-template-columns:repeat(3,1fr)!important;
    height:auto!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress span{
    height:26px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-row{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-add-client{
    width:100%!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions{
    left:40px!important;
    right:8px!important;
    grid-template-columns:.85fr .95fr 1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-clear{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-last .touch-actions{
    grid-template-columns:.95fr 1.35fr!important;
  }
}


/* ============================================================
   V280 - Activación tablet real sin depender del zoom de Chrome
   Problema corregido: algunas tablets 10" en Chrome dan viewport >1024px
   al 100%, por eso no entraba el diseño táctil hasta subir zoom.
   Estas reglas solo actúan si JS detecta tablet/móvil y añade
   .touch-mobile-wizard-v279, por tanto PC normal queda intacto.
   ============================================================ */
@media screen and (max-width:1400px), screen and (pointer:coarse), screen and (hover:none){
  body.venta-touch-screen.touch-mobile-wizard-v279{
    width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    margin:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    background:#eef2f7!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .app,
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    width:100%!important;
    max-width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    overflow:visible!important;
    background:#eef2f7!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    padding:8px 10px 78px 44px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .main>h1,
  body.venta-touch-screen.touch-mobile-wizard-v279 .admin-quick-actions.venta-11-screen{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body{
    width:100%!important;
    max-width:980px!important;
    margin:0 auto!important;
    padding:0!important;
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-header{
    height:44px!important;
    min-height:44px!important;
    margin:0 0 6px!important;
    padding:0 2px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:5px!important;
    margin:0 0 8px!important;
    height:31px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress span{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
    background:#dbeafe!important;
    color:#1e3a8a!important;
    font-size:11px!important;
    font-weight:900!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    padding:0 5px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card{
    display:none!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:14px!important;
    border-radius:18px!important;
    overflow:auto!important;
    min-height:calc(100dvh - 178px)!important;
    max-height:calc(100dvh - 178px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>input[type="hidden"]{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions{
    position:fixed!important;
    left:44px!important;
    right:10px!important;
    bottom:8px!important;
    z-index:9000!important;
    display:grid!important;
    grid-template-columns:1fr 1fr 1fr!important;
    gap:8px!important;
    padding:0!important;
    background:transparent!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-actions button{
    width:100%!important;
    height:56px!important;
    min-height:56px!important;
    border-radius:14px!important;
    font-size:17px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279:not(.touch-wizard-last) .touch-save{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-last .touch-wizard-next{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-wizard-last .touch-actions{
    grid-template-columns:1fr 1fr 1.4fr!important;
  }
}

@media screen and (max-width:1400px) and (orientation:landscape), screen and (pointer:coarse) and (orientation:landscape), screen and (hover:none) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{padding:5px 8px 62px 42px!important;}
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-header{height:36px!important;min-height:36px!important;margin-bottom:4px!important;}
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress{height:26px!important;margin-bottom:5px!important;}
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-v279-progress span{font-size:10px!important;}
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    min-height:calc(100dvh - 135px)!important;
    max-height:calc(100dvh - 135px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;}
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-form-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;}
}

@media screen and (max-width:1400px), screen and (pointer:coarse), screen and (hover:none){
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .app,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .main{
    height:var(--touch-vvh,100dvh)!important;
    min-height:var(--touch-vvh,100dvh)!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .main{
    padding:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-header,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-v279-progress,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode #formVentaTouch,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-actions,
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .menu-toggle{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body{
    width:100%!important;
    max-width:none!important;
    height:var(--touch-vvh,100dvh)!important;
    display:block!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body>.touch-card{
    display:block!important;
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    top:8px!important;
    height:calc(var(--touch-vvh,100dvh) - 16px)!important;
    min-height:0!important;
    max-height:none!important;
    padding:12px!important;
    overflow:hidden!important;
    border-radius:18px!important;
    z-index:9500!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-body>.touch-card::before{
    content:'Buscar cliente';
    display:block!important;
    font-size:18px!important;
    font-weight:900!important;
    color:#0f172a!important;
    margin-bottom:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 120px!important;
    gap:8px!important;
    align-items:start!important;
    height:100%!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-search{
    width:100%!important;
    height:46px!important;
    min-height:46px!important;
    font-size:17px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-add-client{
    height:46px!important;
    min-height:46px!important;
    font-size:15px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-results{
    display:block!important;
    position:fixed!important;
    left:14px!important;
    right:14px!important;
    top:76px!important;
    max-height:calc(var(--touch-vvh,100dvh) - 92px)!important;
    overflow:auto!important;
    z-index:9600!important;
    border-radius:14px!important;
    box-shadow:none!important;
  }
}


/* ============================================================
   V281 - Redmi Pad SE 11" 1920x1200 / Chrome 100%
   Forzado solo cuando JS activa touch-mobile-wizard-v279.
   ============================================================ */
body.venta-touch-screen.touch-mobile-wizard-v279.touch-client-search-mode .touch-client-results{
  max-height:calc(var(--touch-vvh,100dvh) - 104px)!important;
}
@media screen and (min-width:1025px) and (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body{
    max-width:1120px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .main{
    padding-left:42px!important;
    padding-right:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard-v279 .touch-body>.touch-card.touch-step-active,
  body.venta-touch-screen.touch-mobile-wizard-v279 #formVentaTouch>.touch-card.touch-step-active{
    min-height:calc(100dvh - 140px)!important;
    max-height:calc(100dvh - 140px)!important;
  }
}

/* ============================================================
   V282 - Ajuste real Redmi Pad SE 11" / tablet horizontal
   Objetivo: PC intacto. En tablet/móvil guiado, la categoría
   ocupa el área disponible sin desbordar ni taparse con botones.
   ============================================================ */
@media screen and (pointer:coarse), screen and (hover:none), screen and (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard{
    --v282-header-h: 40px;
    --v282-client-h: 42px;
    --v282-actions-h: 46px;
    --v282-gap: 5px;
  }

  body.venta-touch-screen.touch-mobile-wizard .main{
    padding:4px 7px 6px 44px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-body{
    height:calc(100dvh - 10px)!important;
    max-height:calc(100dvh - 10px)!important;
    grid-template-rows:var(--v282-header-h) var(--v282-client-h) minmax(0,1fr)!important;
    gap:var(--v282-gap)!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-header{
    height:var(--v282-header-h)!important;
    min-height:var(--v282-header-h)!important;
    margin:0!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-logo{
    font-size:15px!important;
    line-height:.9!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-logo small{font-size:11px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{
    height:28px!important;
    min-height:28px!important;
    font-size:12px!important;
    padding:4px 9px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-body>.touch-card{
    height:var(--v282-client-h)!important;
    min-height:var(--v282-client-h)!important;
    max-height:var(--v282-client-h)!important;
    padding:3px 7px!important;
    margin:0!important;
    border-radius:12px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-row{
    grid-template-columns:minmax(0,1fr) 100px!important;
    gap:6px!important;
    height:100%!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-search,
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
    height:34px!important;
    min-height:34px!important;
    font-size:14px!important;
    border-radius:9px!important;
    padding:0 9px!important;
  }

  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) var(--v282-actions-h)!important;
    gap:var(--v282-gap)!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    padding:8px!important;
    border-radius:14px!important;
    overflow:hidden!important;
  }

  body.venta-touch-screen.touch-mobile-wizard .touch-step-title{
    font-size:17px!important;
    line-height:20px!important;
    margin:0 0 6px!important;
  }

  /* En flujo guiado, Finalizar solo aparece en el resumen final. */
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-save{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-actions{
    grid-template-columns:.8fr .95fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-first .touch-actions{
    grid-template-columns:1fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    grid-template-columns:.75fr 1.25fr!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions{
    height:var(--v282-actions-h)!important;
    min-height:var(--v282-actions-h)!important;
    max-height:var(--v282-actions-h)!important;
    gap:7px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard .touch-actions button{
    height:var(--v282-actions-h)!important;
    min-height:var(--v282-actions-h)!important;
    max-height:var(--v282-actions-h)!important;
    font-size:14px!important;
    border-radius:11px!important;
    padding:0 8px!important;
  }

  /* Paso 2 Categoría: 6 tarjetas exactas, 2 columnas x 3 filas, sin scroll ni cortes. */
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch>.touch-card.touch-step-active{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:6px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-grid{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    gap:7px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    padding:5px 6px!important;
    border-radius:12px!important;
    font-size:clamp(13px,2.1vw,16px)!important;
    line-height:1.05!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon{
    width:clamp(24px,4.4vw,38px)!important;
    height:clamp(20px,3.8vw,32px)!important;
    margin:0!important;
    object-fit:contain!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-text{
    width:clamp(38px,7vw,54px)!important;
    height:clamp(24px,4vw,32px)!important;
    min-height:0!important;
    font-size:clamp(18px,3.3vw,24px)!important;
    margin:0!important;
  }

  /* Paso 3 Calibre: cuadrícula compacta y centrada. */
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] #formVentaTouch>.touch-card.touch-step-active{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:6px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-calibres{
    height:100%!important;
    max-height:100%!important;
    overflow:auto!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    align-content:start!important;
    gap:7px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-chip{
    min-height:42px!important;
    height:42px!important;
    font-size:15px!important;
    padding:5px 7px!important;
  }
}

/* Redmi Pad SE horizontal suele trabajar con alto CSS reducido: compactar aún más. */
@media screen and (pointer:coarse) and (orientation:landscape) and (max-height:720px),
       screen and (hover:none) and (orientation:landscape) and (max-height:720px){
  body.venta-touch-screen.touch-mobile-wizard{
    --v282-header-h: 36px;
    --v282-client-h: 38px;
    --v282-actions-h: 42px;
    --v282-gap: 4px;
  }
  body.venta-touch-screen.touch-mobile-wizard .main{padding:3px 6px 4px 42px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-step-title{font-size:16px!important;line-height:18px!important;margin-bottom:4px!important;}
  body.venta-touch-screen.touch-mobile-wizard .touch-search,
  body.venta-touch-screen.touch-mobile-wizard .touch-add-client{height:31px!important;min-height:31px!important;font-size:13px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-grid{gap:5px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category{font-size:13px!important;padding:4px!important;}
}


/* ============================================================
   V283 - Redmi Pad SE / tablet: cuadrado real de Categoría y Calibre
   PC intacto: solo se aplica si JS marca body.touch-mobile-wizard.
   Corrige cache con layout v=283.
   ============================================================ */
body.venta-touch-screen.touch-mobile-wizard{
  --v283-header:34px;
  --v283-client:38px;
  --v283-actions:42px;
  --v283-gap:4px;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard .main,
body.venta-touch-screen.touch-mobile-wizard main,
body.venta-touch-screen.touch-mobile-wizard .content{
  height:100dvh!important;
  max-height:100dvh!important;
  overflow:hidden!important;
  padding:3px 6px 4px 40px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-body{
  width:calc(100vw - 52px)!important;
  max-width:none!important;
  height:calc(var(--touch-vvh, 100dvh) - 8px)!important;
  max-height:calc(var(--touch-vvh, 100dvh) - 8px)!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-rows:var(--v283-header) var(--v283-client) minmax(0,1fr)!important;
  gap:var(--v283-gap)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-header{
  min-height:0!important;
  height:var(--v283-header)!important;
  padding:0 5px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-logo{font-size:14px!important;line-height:.88!important;gap:5px!important;}
body.venta-touch-screen.touch-mobile-wizard .touch-logo small{font-size:10px!important;}
body.venta-touch-screen.touch-mobile-wizard .touch-user-badge{height:25px!important;min-height:25px!important;padding:2px 8px!important;font-size:11px!important;}
body.venta-touch-screen.touch-mobile-wizard .touch-body>.touch-card{
  height:var(--v283-client)!important;
  min-height:0!important;
  max-height:var(--v283-client)!important;
  padding:3px 6px!important;
  margin:0!important;
  border-radius:10px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-row{
  grid-template-columns:minmax(0,1fr) 88px!important;
  height:100%!important;
  gap:5px!important;
  align-items:center!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-search,
body.venta-touch-screen.touch-mobile-wizard .touch-add-client{
  height:30px!important;
  min-height:30px!important;
  font-size:13px!important;
  padding:0 8px!important;
  border-radius:8px!important;
}
body.venta-touch-screen.touch-mobile-wizard #formVentaTouch{
  min-height:0!important;
  height:100%!important;
  max-height:100%!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:minmax(0,1fr) var(--v283-actions)!important;
  gap:var(--v283-gap)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card{
  display:none!important;
  grid-column:1!important;
  grid-row:1!important;
  min-height:0!important;
  height:100%!important;
  max-height:100%!important;
  width:100%!important;
  margin:0!important;
  padding:6px!important;
  border-radius:12px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card.touch-step-active{
  display:block!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-step-title{
  font-size:15px!important;
  line-height:17px!important;
  min-height:0!important;
  margin:0 0 4px!important;
  padding:0!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-actions{
  grid-column:1!important;
  grid-row:2!important;
  height:var(--v283-actions)!important;
  min-height:0!important;
  max-height:var(--v283-actions)!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  position:static!important;
  transform:none!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-actions a,
body.venta-touch-screen.touch-mobile-wizard .touch-actions button{
  height:var(--v283-actions)!important;
  min-height:0!important;
  max-height:var(--v283-actions)!important;
  font-size:13px!important;
  padding:0 6px!important;
  border-radius:10px!important;
}
body.venta-touch-screen.touch-mobile-wizard:not(.touch-wizard-last) .touch-save{display:none!important;}
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-first .touch-wizard-prev{display:none!important;}
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-first .touch-actions{grid-template-columns:1fr!important;}
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-wizard-next{display:none!important;}
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{grid-template-columns:1fr 1.4fr!important;}

/* Categorías: en tablet horizontal usar 3 columnas x 2 filas para no comerse altura. */
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch>.touch-card.touch-step-active{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:5px!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  grid-auto-rows:minmax(0,1fr)!important;
  gap:6px!important;
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  padding:4px!important;
  margin:0!important;
  border-radius:11px!important;
  font-size:12px!important;
  line-height:1!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:2px!important;
  white-space:normal!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon{
  width:28px!important;
  height:24px!important;
  max-width:28px!important;
  max-height:24px!important;
  object-fit:contain!important;
  margin:0!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-text{
  width:40px!important;
  height:26px!important;
  min-height:0!important;
  font-size:20px!important;
  line-height:26px!important;
  margin:0!important;
  padding:0!important;
}

/* Calibres: botones compactos en columnas, sin amontonarse ni salir de la tarjeta. */
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] #formVentaTouch>.touch-card.touch-step-active{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:5px!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-calibres{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-auto-rows:36px!important;
  gap:6px!important;
  align-content:start!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 2px 2px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-chip{
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  padding:0 6px!important;
  margin:0!important;
  border-radius:10px!important;
  font-size:13px!important;
  line-height:36px!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
@media screen and (orientation:portrait){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-calibres{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media screen and (max-height:620px){
  body.venta-touch-screen.touch-mobile-wizard{--v283-header:30px;--v283-client:34px;--v283-actions:38px;--v283-gap:3px;}
  body.venta-touch-screen.touch-mobile-wizard .touch-step-title{font-size:14px!important;line-height:15px!important;margin-bottom:3px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-grid{gap:4px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category{font-size:11px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-calibres{grid-auto-rows:32px!important;gap:4px!important;}
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] .touch-chip{height:32px!important;min-height:32px!important;line-height:32px!important;font-size:12px!important;}
}

/* ============================================================
   V284 - Categorías proporcionadas + selección cliente azul
   Objetivo:
   - PC: todas las burbujas de categoría de sección 1 mismo tamaño.
   - Tablet/móvil: categoría siempre 3x2 en horizontal y 2x3 en vertical,
     sin salirse de pantalla.
   - Cliente: al pulsar resultado vuelve el fondo azul visual antes de cerrar.
   ============================================================ */
body.venta-touch-screen .touch-client-item.is-selected,
body.venta-touch-screen button.touch-client-item.is-selected,
body.venta-touch-screen .touch-client-item:focus,
body.venta-touch-screen button.touch-client-item:focus{
  background:#1d4ed8!important;
  color:#ffffff!important;
  border-color:#1e3a8a!important;
  outline:none!important;
}
body.venta-touch-screen .touch-client-item.is-selected strong,
body.venta-touch-screen .touch-client-item.is-selected span,
body.venta-touch-screen button.touch-client-item.is-selected strong,
body.venta-touch-screen button.touch-client-item.is-selected span,
body.venta-touch-screen button.touch-client-item.is-selected div,
body.venta-touch-screen button.touch-client-item:focus strong,
body.venta-touch-screen button.touch-client-item:focus span,
body.venta-touch-screen button.touch-client-item:focus div{
  color:#ffffff!important;
}

/* PC / formato completo: sección Categoría con botones exactamente iguales */
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:unset!important;
  gap:8px!important;
  height:calc(100% - 25px)!important;
  min-height:0!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-category{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  width:100%!important;
  padding:6px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-category-icon{
  width:42px!important;
  height:30px!important;
  max-width:42px!important;
  max-height:30px!important;
  object-fit:contain!important;
  margin:0 0 4px!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-category-icon-text{
  width:46px!important;
  height:30px!important;
  min-height:30px!important;
  font-size:20px!important;
  margin:0 0 4px!important;
}

/* Tablet/móvil guiado: categoría en tarjeta limpia, cuadrados iguales */
body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card:nth-of-type(1){
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:unset!important;
  gap:10px!important;
  height:calc(100% - 36px)!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-category{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  width:100%!important;
  padding:7px 6px!important;
  border-radius:14px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-category-icon{
  width:clamp(28px,5vw,48px)!important;
  height:clamp(22px,4vw,40px)!important;
  max-width:48px!important;
  max-height:40px!important;
  object-fit:contain!important;
  margin:0 0 4px!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-category-icon-text{
  width:clamp(40px,7vw,60px)!important;
  height:clamp(24px,4vw,36px)!important;
  min-height:24px!important;
  font-size:clamp(16px,3.3vw,26px)!important;
  margin:0 0 4px!important;
}

/* Redmi Pad / tablet horizontal: 3 columnas x 2 filas, ocupa el alto exacto disponible */
@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (hover:none) and (orientation:landscape),
       screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard #formVentaTouch>.touch-card:nth-of-type(1){
    height:calc(100dvh - 154px)!important;
    min-height:calc(100dvh - 154px)!important;
    max-height:calc(100dvh - 154px)!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    height:calc(100% - 31px)!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category{
    font-size:clamp(13px,1.9vw,17px)!important;
    line-height:1.05!important;
    padding:6px 5px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-icon{
    width:clamp(26px,4vw,42px)!important;
    height:clamp(20px,3.4vw,34px)!important;
    max-width:42px!important;
    max-height:34px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category-icon-text{
    width:clamp(38px,6vw,56px)!important;
    height:clamp(22px,3.6vw,34px)!important;
    font-size:clamp(15px,3vw,24px)!important;
  }
}

/* Tablet/móvil vertical: 2 columnas x 3 filas proporcionadas con scroll de página si hace falta */
@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard .touch-category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(86px,1fr))!important;
    height:auto!important;
    min-height:calc(100dvh - 255px)!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-category{
    min-height:86px!important;
  }
}

/* ============================================================
   V285 - Categorías 100% cuadradas/iguales en PC, tablet y móvil
   Corrige especialmente 22 y Pólvora para que no queden desalineadas
   ni salgan de la tarjeta. No toca lógica, solo presentación.
   ============================================================ */
body.venta-touch-screen .touch-category{
  box-sizing:border-box!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  text-align:center!important;
  white-space:normal!important;
}
body.venta-touch-screen .touch-category-icon-wrap{
  width:100%!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  flex:0 0 38px!important;
}
body.venta-touch-screen .touch-category-icon{
  width:auto!important;
  height:auto!important;
  max-width:58px!important;
  max-height:36px!important;
  object-fit:contain!important;
  display:block!important;
  margin:0!important;
}
body.venta-touch-screen .touch-category-icon-text{
  width:58px!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  font-weight:900!important;
  font-size:24px!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-category-label{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.08!important;
  font-weight:800!important;
  text-align:center!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
}

/* PC: todas las categorías con la misma celda real, incluido 22 y pólvora */
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1){
  overflow:hidden!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(94px,1fr))!important;
  grid-auto-rows:unset!important;
  gap:10px!important;
  align-items:stretch!important;
  justify-items:stretch!important;
  overflow:hidden!important;
  height:auto!important;
  min-height:198px!important;
  max-height:none!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
  width:100%!important;
  height:100%!important;
  min-height:94px!important;
  max-height:118px!important;
  padding:9px 8px!important;
  font-size:15px!important;
}

/* Tablet horizontal Redmi/Android: 3x2 exacto, no se sale de pantalla */
@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (hover:none) and (orientation:landscape),
       screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1){
    height:calc(100dvh - 158px)!important;
    min-height:0!important;
    max-height:calc(100dvh - 158px)!important;
    overflow:hidden!important;
    padding:8px 10px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-step-title{
    height:22px!important;
    line-height:22px!important;
    margin:0 0 6px!important;
    font-size:15px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:unset!important;
    gap:8px!important;
    height:calc(100% - 28px)!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    padding:5px!important;
    gap:3px!important;
    font-size:clamp(12px,1.65vw,15px)!important;
    line-height:1.05!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-wrap{
    height:28px!important;
    min-height:28px!important;
    max-height:28px!important;
    flex-basis:28px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon{
    max-width:44px!important;
    max-height:26px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-text{
    width:46px!important;
    height:26px!important;
    min-height:26px!important;
    max-height:26px!important;
    font-size:20px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-label{
    -webkit-line-clamp:2!important;
    line-height:1.04!important;
  }
}

/* Tablet/móvil vertical: 2x3 iguales */
@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(86px,1fr))!important;
    gap:8px!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    min-height:86px!important;
    height:100%!important;
  }
}

/* ============================================================
   V286 - Corrección real categorías + botón finalizar en tablet
   - Categorías iguales en PC y tablet, incluyendo 22 y Pólvora.
   - En último paso tablet: Finalizar compra grande y visible.
   ============================================================ */

/* Base común: todos los botones de categoría usan la misma geometría interna */
body.venta-touch-screen .touch-category,
body.venta-touch-screen.touch-mobile-wizard .touch-category{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  gap:4px!important;
  white-space:normal!important;
}
body.venta-touch-screen .touch-category-icon-wrap,
body.venta-touch-screen.touch-mobile-wizard .touch-category-icon-wrap{
  width:100%!important;
  flex:0 0 34px!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-category-icon,
body.venta-touch-screen.touch-mobile-wizard .touch-category-icon{
  width:auto!important;
  height:auto!important;
  max-width:54px!important;
  max-height:32px!important;
  object-fit:contain!important;
  margin:0!important;
  display:block!important;
}
body.venta-touch-screen .touch-category-icon-text,
body.venta-touch-screen.touch-mobile-wizard .touch-category-icon-text{
  width:54px!important;
  height:32px!important;
  min-height:32px!important;
  max-height:32px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  font-size:23px!important;
  font-weight:950!important;
  line-height:1!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-category-label,
body.venta-touch-screen.touch-mobile-wizard .touch-category-label{
  flex:1 1 auto!important;
  width:100%!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.08!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
}

/* PC / formato completo: 6 celdas exactas 3x2, todas iguales */
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1){
  overflow:hidden!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:unset!important;
  gap:8px!important;
  height:calc(100% - 27px)!important;
  min-height:170px!important;
  max-height:none!important;
  overflow:hidden!important;
  align-items:stretch!important;
  justify-items:stretch!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  padding:6px!important;
  border-radius:13px!important;
  font-size:14px!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-label{
  font-size:14px!important;
  max-height:38px!important;
}

/* Tablet horizontal Redmi/Android: paso Categoría exacto 3x2 dentro de pantalla */
@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (hover:none) and (orientation:landscape),
       screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1){
    height:calc(100dvh - 156px)!important;
    min-height:0!important;
    max-height:calc(100dvh - 156px)!important;
    overflow:hidden!important;
    padding:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-step-title{
    height:20px!important;
    line-height:20px!important;
    margin:0 0 6px!important;
    font-size:15px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:unset!important;
    gap:8px!important;
    height:calc(100% - 26px)!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    padding:4px!important;
    border-radius:12px!important;
    font-size:clamp(12px,1.45vw,15px)!important;
    line-height:1.05!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-wrap{
    flex-basis:28px!important;
    height:28px!important;
    min-height:28px!important;
    max-height:28px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon{
    max-width:46px!important;
    max-height:27px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-icon-text{
    width:46px!important;
    height:27px!important;
    min-height:27px!important;
    max-height:27px!important;
    font-size:20px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] .touch-category-label{
    max-height:34px!important;
    font-size:clamp(11px,1.45vw,14px)!important;
  }
}

/* Tablet/móvil vertical: 2x3 proporcionado */
@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(82px,1fr))!important;
    grid-auto-rows:unset!important;
    gap:8px!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    min-height:82px!important;
    height:100%!important;
  }
}

/* Última pantalla resumen: botón Finalizar grande y siempre visible en tablet */
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last #touchWizardSubmit,
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-save{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  background:#047857!important;
  color:#ffffff!important;
  border-color:#065f46!important;
  font-size:clamp(17px,2.7vw,22px)!important;
  font-weight:950!important;
  min-width:0!important;
  white-space:normal!important;
  text-align:center!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last #touchWizardNext,
body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-wizard-next{
  display:none!important;
}
@media screen and (pointer:coarse), screen and (max-width:1280px){
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    display:grid!important;
    grid-template-columns:.65fr .85fr 1.8fr!important;
    gap:7px!important;
    left:44px!important;
    right:8px!important;
    bottom:8px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions a,
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions button{
    height:58px!important;
    min-height:58px!important;
    border-radius:13px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last #formVentaTouch > .touch-card.touch-step-active{
    max-height:calc(100dvh - 170px)!important;
    padding-bottom:16px!important;
  }
}
@media screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-clear{
    display:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last .touch-actions{
    grid-template-columns:.9fr 1.8fr!important;
    left:40px!important;
  }
}

/* ============================================================
   V287 - CATEGORÍAS IGUALES DE VERDAD
   Solo presentación. Fuerza una rejilla estable y celdas idénticas
   en PC, tablet horizontal Redmi y móvil/tablet vertical.
   ============================================================ */

/* Geometría interna única para TODOS los botones de categoría */
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  padding:0!important;
  border-radius:14px!important;
  overflow:hidden!important;
  display:grid!important;
  grid-template-rows:52px minmax(34px,44px)!important;
  align-content:center!important;
  justify-items:center!important;
  align-items:center!important;
  gap:4px!important;
  text-align:center!important;
  line-height:1.05!important;
}

body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon-wrap{
  width:64px!important;
  height:46px!important;
  min-width:64px!important;
  max-width:64px!important;
  min-height:46px!important;
  max-height:46px!important;
  flex:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  margin:0!important;
  padding:0!important;
}

body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon{
  display:block!important;
  width:58px!important;
  height:42px!important;
  max-width:58px!important;
  max-height:42px!important;
  object-fit:contain!important;
  margin:0!important;
  padding:0!important;
}

body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon-text{
  width:58px!important;
  height:42px!important;
  min-width:58px!important;
  max-width:58px!important;
  min-height:42px!important;
  max-height:42px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:26px!important;
  font-weight:950!important;
  line-height:1!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}

body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-label{
  width:100%!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  padding:0 6px!important;
  margin:0!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  font-weight:850!important;
  font-size:14px!important;
  line-height:1.08!important;
}

/* PC: sección 1 en 3 columnas x 2 filas, misma anchura y misma altura */
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1){
  overflow:visible!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,112px)!important;
  grid-auto-rows:112px!important;
  gap:10px!important;
  width:100%!important;
  height:auto!important;
  min-height:234px!important;
  max-height:none!important;
  overflow:visible!important;
  align-items:stretch!important;
  justify-items:stretch!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
  height:112px!important;
  min-height:112px!important;
  max-height:112px!important;
}

/* Tablet horizontal / Redmi Pad SE: 3 x 2 exacto dentro del paso */
@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (hover:none) and (orientation:landscape),
       screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1){
    height:calc(100dvh - 150px)!important;
    min-height:0!important;
    max-height:calc(100dvh - 150px)!important;
    overflow:hidden!important;
    padding:7px 9px!important;
    box-sizing:border-box!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-step-title{
    height:18px!important;
    min-height:18px!important;
    max-height:18px!important;
    line-height:18px!important;
    margin:0 0 6px!important;
    font-size:14px!important;
    overflow:hidden!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:unset!important;
    gap:8px!important;
    width:100%!important;
    height:calc(100% - 24px)!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    grid-template-rows:38px minmax(28px,36px)!important;
    gap:3px!important;
    border-radius:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon-wrap{
    width:52px!important;
    height:34px!important;
    min-width:52px!important;
    max-width:52px!important;
    min-height:34px!important;
    max-height:34px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon{
    width:48px!important;
    height:32px!important;
    max-width:48px!important;
    max-height:32px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-icon-text{
    width:48px!important;
    height:32px!important;
    min-width:48px!important;
    max-width:48px!important;
    min-height:32px!important;
    max-height:32px!important;
    font-size:21px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-label{
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    font-size:13px!important;
    line-height:1.04!important;
    padding:0 4px!important;
  }
}

/* Tablet/móvil vertical: 2 x 3 exacto, botones iguales */
@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1){
    overflow:visible!important;
    height:auto!important;
    max-height:none!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,96px)!important;
    grid-auto-rows:96px!important;
    gap:8px!important;
    height:auto!important;
    min-height:304px!important;
    overflow:visible!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1) .touch-category{
    height:96px!important;
    min-height:96px!important;
    max-height:96px!important;
    grid-template-rows:38px 34px!important;
  }
}

/* ============================================================
   V289 - Venta touch: quitar barra superior grande y ganar pantalla
   ============================================================ */
body.venta-touch-screen h1{
  display:none!important;
}

body.venta-touch-screen .touch-header{
  display:none!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

body.venta-touch-screen .touch-body.touch-body-no-header,
body.venta-touch-screen .touch-body{
  padding-top:4px!important;
  margin-top:0!important;
}

body.venta-touch-screen .touch-session-pill{
  position:fixed!important;
  top:8px!important;
  right:14px!important;
  z-index:6100!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:28px!important;
  padding:4px 12px!important;
  border:1px solid #d1d5db!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.96)!important;
  color:#111827!important;
  font-size:13px!important;
  font-weight:850!important;
  box-shadow:0 4px 14px rgba(15,23,42,.08)!important;
  pointer-events:none!important;
}

body.venta-touch-screen .main{
  padding-top:6px!important;
}

body.venta-touch-screen .touch-body > .touch-card:first-of-type{
  margin-top:0!important;
}

/* PC: al quitar cabecera, dar más aire útil al bloque de venta */
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-body{
  max-width:none!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) .touch-card{
  margin-bottom:6px!important;
}
body.venta-touch-screen:not(.touch-mobile-wizard) #formVentaTouch > .touch-card:nth-of-type(1){
  padding-top:10px!important;
}

/* Tablet/móvil: recalcular alturas con menos cabecera */
body.venta-touch-screen.touch-mobile-wizard .touch-body{
  height:calc(100dvh - 72px)!important;
  min-height:0!important;
  padding:4px 8px 70px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard .touch-body > .touch-card,
body.venta-touch-screen.touch-mobile-wizard #formVentaTouch > .touch-card{
  margin-top:0!important;
}

@media screen and (pointer:coarse) and (orientation:landscape),
       screen and (hover:none) and (orientation:landscape),
       screen and (max-width:1280px) and (orientation:landscape){
  body.venta-touch-screen.touch-mobile-wizard .main{
    padding-top:2px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard .touch-session-pill{
    top:6px!important;
    right:10px!important;
    min-height:24px!important;
    padding:3px 10px!important;
    font-size:12px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="2"] #formVentaTouch > .touch-card:nth-of-type(1){
    height:calc(100dvh - 116px)!important;
    max-height:calc(100dvh - 116px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard[data-touch-step="3"] #formVentaTouch > .touch-card.touch-step-active{
    height:calc(100dvh - 116px)!important;
    max-height:calc(100dvh - 116px)!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-wizard-last #formVentaTouch > .touch-card.touch-step-active{
    height:calc(100dvh - 116px)!important;
    max-height:calc(100dvh - 116px)!important;
  }
}

@media screen and (pointer:coarse) and (orientation:portrait), screen and (max-width:700px){
  body.venta-touch-screen.touch-mobile-wizard .touch-session-pill{
    top:6px!important;
    right:8px!important;
    font-size:11px!important;
    min-height:24px!important;
    padding:3px 9px!important;
  }
}

/* ============================================================
   V290 - Tablet/móvil: formato por filas horizontales.
   Objetivo: dejar de usar bloques altos por paso en tablet.
   PC intacto: solo se activa con body.touch-row-mode-v290.
   ============================================================ */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290{
  --v290-actions:44px;
  --v290-client:48px;
  --v290-gap:5px;
  overflow:hidden!important;
}

body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .main,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 main,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .content{
  height:100dvh!important;
  max-height:100dvh!important;
  overflow:hidden!important;
  padding:3px 6px calc(var(--v290-actions) + 8px) 6px!important;
  box-sizing:border-box!important;
}

/* Usuario activo: pequeño, arriba derecha, sin robar alto real. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-session-pill{
  top:5px!important;
  right:8px!important;
  left:auto!important;
  min-height:22px!important;
  height:22px!important;
  padding:2px 8px!important;
  font-size:11px!important;
  line-height:18px!important;
  z-index:6100!important;
}

/* Burbuja de menú a la izquierda otra vez. */
body.venta-touch-screen.touch-row-mode-v290 .menu-abajo-boton,
body.venta-touch-screen.touch-row-mode-v290 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v290 .bottom-menu-tab{
  left:8px!important;
  right:auto!important;
  bottom:7px!important;
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px!important;
  max-width:40px!important;
  max-height:40px!important;
  line-height:40px!important;
  z-index:99990!important;
}
body.venta-touch-screen.touch-row-mode-v290 .menu-abajo-boton::before,
body.venta-touch-screen.touch-row-mode-v290 .bottom-open-menu-button::before,
body.venta-touch-screen.touch-row-mode-v290 .bottom-menu-tab::before{
  line-height:40px!important;
  font-size:20px!important;
}

/* Contenedor general: cliente arriba + todo el formulario debajo en filas. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-body,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-body.touch-body-no-header{
  width:100%!important;
  max-width:none!important;
  height:calc(var(--touch-vvh, 100dvh) - var(--v290-actions) - 12px)!important;
  max-height:calc(var(--touch-vvh, 100dvh) - var(--v290-actions) - 12px)!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-rows:var(--v290-client) minmax(0,1fr)!important;
  gap:var(--v290-gap)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Burbuja/fila cliente a ancho completo, proporcionada. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-body > .touch-card:first-of-type{
  grid-row:1!important;
  height:var(--v290-client)!important;
  min-height:var(--v290-client)!important;
  max-height:var(--v290-client)!important;
  width:100%!important;
  margin:0!important;
  padding:5px 7px!important;
  border-radius:13px!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  box-shadow:0 3px 12px rgba(15,23,42,.08)!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-row{
  grid-template-columns:minmax(0,1fr) 82px!important;
  gap:6px!important;
  height:100%!important;
  align-items:center!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-search,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-add-client{
  height:35px!important;
  min-height:35px!important;
  max-height:35px!important;
  font-size:14px!important;
  line-height:35px!important;
  padding:0 10px!important;
  border-radius:10px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-add-client{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:82px!important;
  width:82px!important;
}

/* Formulario visible completo por filas. Se anula el wizard ocultador. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch{
  grid-row:2!important;
  display:grid!important;
  grid-template-rows:78px 70px 66px 64px minmax(48px,1fr)!important;
  grid-template-columns:1fr!important;
  gap:var(--v290-gap)!important;
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  grid-column:1!important;
  grid-row:auto!important;
  position:relative!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:5px 7px!important;
  border-radius:12px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  box-shadow:0 3px 12px rgba(15,23,42,.07)!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card.touch-step-active{
  display:grid!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-step-title{
  height:16px!important;
  min-height:16px!important;
  max-height:16px!important;
  line-height:16px!important;
  margin:0 0 3px!important;
  padding:0!important;
  font-size:12px!important;
  font-weight:900!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}

/* Fila 1: Categorías en UNA fila horizontal completa, todas iguales. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(1){
  grid-row:1!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  grid-template-rows:1fr!important;
  grid-auto-flow:column!important;
  grid-auto-columns:minmax(110px,1fr)!important;
  gap:6px!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  align-items:stretch!important;
  justify-items:stretch!important;
  scrollbar-width:thin!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  width:100%!important;
  min-width:0!important;
  padding:0 4px!important;
  border-radius:10px!important;
  border-width:1.5px!important;
  display:grid!important;
  grid-template-rows:26px 24px!important;
  gap:1px!important;
  align-items:center!important;
  justify-items:center!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-icon-wrap{
  width:42px!important;
  height:25px!important;
  min-width:42px!important;
  max-width:42px!important;
  min-height:25px!important;
  max-height:25px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-icon{
  width:38px!important;
  height:23px!important;
  max-width:38px!important;
  max-height:23px!important;
  object-fit:contain!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-icon-text{
  width:38px!important;
  height:23px!important;
  min-width:38px!important;
  max-width:38px!important;
  min-height:23px!important;
  max-height:23px!important;
  font-size:17px!important;
  line-height:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-label{
  width:100%!important;
  height:24px!important;
  min-height:24px!important;
  max-height:24px!important;
  padding:0 2px!important;
  margin:0!important;
  font-size:10.5px!important;
  line-height:1.02!important;
  font-weight:900!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
}

/* Fila 2: Calibres en fila horizontal, no bloque amontonado. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(2){
  grid-row:2!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-calibres{
  display:grid!important;
  grid-auto-flow:column!important;
  grid-auto-columns:minmax(94px,1fr)!important;
  grid-template-rows:1fr!important;
  gap:6px!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  align-items:stretch!important;
  scrollbar-width:thin!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-chip{
  height:100%!important;
  min-height:0!important;
  width:100%!important;
  min-width:94px!important;
  padding:0 8px!important;
  border-radius:10px!important;
  font-size:13px!important;
  font-weight:900!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  box-sizing:border-box!important;
  white-space:normal!important;
  line-height:1.05!important;
}

/* Fila 3: Fecha y autorización en una línea flexible. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(3){
  grid-row:3!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid{
  display:grid!important;
  grid-template-columns:1.05fr 1fr 1.15fr 1fr 1fr!important;
  gap:6px!important;
  align-items:stretch!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid > div{
  min-width:0!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid label{
  display:block!important;
  height:13px!important;
  line-height:13px!important;
  font-size:10px!important;
  margin:0 0 2px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid input,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid select{
  height:31px!important;
  min-height:31px!important;
  max-height:31px!important;
  padding:0 8px!important;
  font-size:12px!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
}

/* Fila 4: Cantidad horizontal compacta. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(4){
  grid-row:4!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  column-gap:8px!important;
  row-gap:2px!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(4) .touch-step-title{
  grid-column:1/-1!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-qty{
  grid-column:1!important;
  display:grid!important;
  grid-template-columns:38px 82px 38px!important;
  gap:5px!important;
  align-items:center!important;
  height:100%!important;
  margin:0!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-qty button{
  width:38px!important;
  height:34px!important;
  min-width:38px!important;
  min-height:34px!important;
  max-height:34px!important;
  border-radius:9px!important;
  font-size:22px!important;
  line-height:32px!important;
  padding:0!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-qty-input{
  width:72px!important;
  height:34px!important;
  padding:0!important;
  font-size:22px!important;
  border-radius:9px!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-qty-number span{
  font-size:9px!important;
  line-height:10px!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-fast{
  grid-column:2!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  height:100%!important;
  margin:0!important;
  align-items:stretch!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-fast button{
  width:100%!important;
  min-width:0!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 8px!important;
  border-radius:9px!important;
  font-size:13px!important;
  font-weight:900!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #atajosPolvora{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-alert{
  grid-column:3!important;
  height:34px!important;
  min-width:180px!important;
  margin:0!important;
  padding:6px 8px!important;
  font-size:11px!important;
  line-height:1.05!important;
  border-radius:9px!important;
  overflow:hidden!important;
}

/* Fila 5: Resumen compacto, visible siempre. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch > .touch-card:nth-of-type(5){
  grid-row:5!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-summary{
  display:grid!important;
  grid-template-columns:1.6fr 1fr 1fr 1fr!important;
  gap:5px!important;
  height:100%!important;
  min-height:0!important;
  padding:5px!important;
  border-radius:10px!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-summary div{
  min-width:0!important;
  height:100%!important;
  padding:4px 6px!important;
  border-right:1px solid #e5e7eb!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-summary span{
  font-size:9px!important;
  line-height:10px!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-summary strong{
  font-size:12px!important;
  line-height:14px!important;
  margin-top:1px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Botonera fija inferior: no se corta nunca, sin Anterior/Siguiente. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-actions{
  position:fixed!important;
  left:56px!important;
  right:8px!important;
  bottom:7px!important;
  height:var(--v290-actions)!important;
  min-height:var(--v290-actions)!important;
  max-height:var(--v290-actions)!important;
  display:grid!important;
  grid-template-columns:140px minmax(0,1fr)!important;
  gap:8px!important;
  padding:0!important;
  margin:0!important;
  overflow:visible!important;
  z-index:9990!important;
  transform:none!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-wizard-prev,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-wizard-next{
  display:none!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-save,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #touchWizardSubmit,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-clear{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:var(--v290-actions)!important;
  min-height:var(--v290-actions)!important;
  max-height:var(--v290-actions)!important;
  padding:0 10px!important;
  border-radius:12px!important;
  font-size:14px!important;
  font-weight:950!important;
  line-height:1!important;
  text-align:center!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-save,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #touchWizardSubmit{
  grid-column:2!important;
  width:100%!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-clear{
  grid-column:1!important;
}

/* Modo búsqueda cliente con teclado: se mantiene pantalla interna, pero optimizada. */
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290.touch-client-search-mode .touch-body{
  display:block!important;
  height:calc(var(--touch-vvh, 100dvh) - 8px)!important;
  max-height:calc(var(--touch-vvh, 100dvh) - 8px)!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290.touch-client-search-mode .touch-body > .touch-card:first-of-type{
  position:fixed!important;
  top:6px!important;
  left:6px!important;
  right:6px!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(var(--touch-vvh, 100dvh) - 12px)!important;
  z-index:9000!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290.touch-client-search-mode #formVentaTouch,
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290.touch-client-search-mode .touch-actions{
  display:none!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290.touch-client-search-mode .touch-client-results{
  max-height:calc(var(--touch-vvh, 100dvh) - 62px)!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-client-item.is-selected{
  background:#2563eb!important;
  color:#fff!important;
}
body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-client-item.is-selected span{
  color:#dbeafe!important;
}

@media screen and (orientation:portrait){
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 #formVentaTouch{
    grid-template-rows:auto auto auto auto auto!important;
    overflow:auto!important;
    padding-bottom:6px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category-grid{
    grid-template-columns:repeat(3,minmax(110px,1fr))!important;
    grid-auto-flow:row!important;
    grid-template-rows:none!important;
    height:auto!important;
    min-height:136px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-category{
    height:64px!important;
    min-height:64px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-calibres{
    grid-template-rows:repeat(2,42px)!important;
    height:88px!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-form-grid{
    grid-template-columns:1fr 1fr!important;
    grid-auto-rows:46px!important;
    height:auto!important;
  }
  body.venta-touch-screen.touch-mobile-wizard.touch-row-mode-v290 .touch-summary{
    grid-template-columns:1fr 1fr!important;
  }
}


/* ============================================================
   V291 - Formato por FILAS en TODOS los formatos (PC/tablet/móvil)
   Mantiene lógica PHP. Solo cambia presentación de venta_touch.php.
   ============================================================ */
body.venta-touch-screen.touch-row-mode-v291{
  --v291-gap:8px;
  --v291-radius:14px;
  --v291-actions:54px;
  --v291-client-row:58px;
  --v291-cat-row:116px;
  --v291-cal-row:96px;
  --v291-data-row:88px;
  --v291-qty-row:88px;
  --v291-summary-row:66px;
  overflow:hidden!important;
}

body.venta-touch-screen.touch-row-mode-v291 .admin-quick-actions.venta-11-screen{
  display:none!important;
}

body.venta-touch-screen.touch-row-mode-v291 .main,
body.venta-touch-screen.touch-row-mode-v291 main,
body.venta-touch-screen.touch-row-mode-v291 .content{
  height:100dvh!important;
  max-height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:8px 10px calc(var(--v291-actions) + 14px) 10px!important;
  box-sizing:border-box!important;
}

body.venta-touch-screen.touch-row-mode-v291 .touch-session-pill{
  position:fixed!important;
  top:8px!important;
  right:10px!important;
  left:auto!important;
  height:24px!important;
  min-height:24px!important;
  max-height:24px!important;
  padding:3px 10px!important;
  border-radius:999px!important;
  font-size:11px!important;
  line-height:18px!important;
  z-index:6500!important;
  box-shadow:0 4px 12px rgba(15,23,42,.12)!important;
}

body.venta-touch-screen.touch-row-mode-v291 .touch-body,
body.venta-touch-screen.touch-row-mode-v291 .touch-body.touch-body-no-header{
  width:100%!important;
  max-width:none!important;
  margin:0 auto!important;
  height:calc(var(--touch-vvh, 100dvh) - var(--v291-actions) - 22px)!important;
  max-height:calc(var(--touch-vvh, 100dvh) - var(--v291-actions) - 22px)!important;
  min-height:0!important;
  display:grid!important;
  grid-template-rows:var(--v291-client-row) minmax(0,1fr)!important;
  grid-template-columns:1fr!important;
  gap:var(--v291-gap)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Fila cliente: una burbuja completa y proporcionada */
body.venta-touch-screen.touch-row-mode-v291 .touch-body > .touch-card:first-of-type{
  grid-row:1!important;
  height:var(--v291-client-row)!important;
  min-height:var(--v291-client-row)!important;
  max-height:var(--v291-client-row)!important;
  padding:8px!important;
  margin:0!important;
  border-radius:var(--v291-radius)!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 118px!important;
  gap:8px!important;
  height:100%!important;
  min-height:0!important;
  align-items:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-search,
body.venta-touch-screen.touch-row-mode-v291 .touch-add-client{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  border-radius:12px!important;
  font-size:16px!important;
  font-weight:800!important;
  padding:0 14px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-add-client{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  white-space:nowrap!important;
}

/* Formulario completo: cada sección es una fila, nunca wizard por bloques */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch{
  grid-row:2!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:var(--v291-cat-row) var(--v291-cal-row) var(--v291-data-row) var(--v291-qty-row) var(--v291-summary-row)!important;
  gap:var(--v291-gap)!important;
  height:100%!important;
  max-height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:0!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:18px minmax(0,1fr)!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  width:100%!important;
  margin:0!important;
  padding:7px 9px!important;
  border-radius:var(--v291-radius)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  box-shadow:0 4px 14px rgba(15,23,42,.08)!important;
}
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card.touch-step-active{
  display:grid!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-step-title{
  height:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  line-height:18px!important;
  margin:0!important;
  padding:0!important;
  font-size:13px!important;
  font-weight:950!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  color:#0f172a!important;
}

/* Categorías: fila única, 6 burbujas iguales y contenido ajustado */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(1){grid-row:1!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  grid-template-rows:1fr!important;
  gap:8px!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow:hidden!important;
  align-items:stretch!important;
  justify-items:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-category{
  display:grid!important;
  grid-template-rows:42px minmax(0,1fr)!important;
  gap:3px!important;
  align-items:center!important;
  justify-items:center!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  padding:6px 5px!important;
  border-radius:13px!important;
  border-width:2px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon-wrap{
  width:58px!important;
  height:40px!important;
  min-width:58px!important;
  max-width:58px!important;
  min-height:40px!important;
  max-height:40px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon{
  width:54px!important;
  height:38px!important;
  max-width:54px!important;
  max-height:38px!important;
  object-fit:contain!important;
  display:block!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon-text{
  width:54px!important;
  height:38px!important;
  min-width:54px!important;
  max-width:54px!important;
  min-height:38px!important;
  max-height:38px!important;
  font-size:24px!important;
  line-height:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:10px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-category-label{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  padding:0 3px!important;
  margin:0!important;
  font-size:clamp(10px, 1vw, 14px)!important;
  line-height:1.05!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}

/* Calibres: fila horizontal limpia, todos los chips iguales */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(2){grid-row:2!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-calibres{
  display:grid!important;
  grid-auto-flow:column!important;
  grid-auto-columns:minmax(96px,1fr)!important;
  grid-template-rows:1fr!important;
  gap:8px!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  align-items:stretch!important;
  scrollbar-width:thin!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-chip{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:96px!important;
  height:100%!important;
  min-height:0!important;
  padding:0 9px!important;
  border-radius:13px!important;
  font-size:clamp(12px, 1vw, 16px)!important;
  font-weight:950!important;
  text-align:center!important;
  line-height:1.08!important;
  white-space:normal!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Datos: cada campo como burbuja igualada */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(3){grid-row:3!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid{
  display:grid!important;
  grid-template-columns:1fr 1fr 1.2fr 1fr 1fr!important;
  gap:8px!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid > div{
  display:grid!important;
  grid-template-rows:18px minmax(0,1fr)!important;
  gap:3px!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:5px!important;
  border:1px solid #e5e7eb!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid label{
  height:18px!important;
  line-height:18px!important;
  font-size:11px!important;
  font-weight:950!important;
  margin:0!important;
  padding:0 2px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid select{
  width:100%!important;
  height:100%!important;
  min-height:30px!important;
  max-height:38px!important;
  padding:0 8px!important;
  border-radius:9px!important;
  font-size:13px!important;
  font-weight:800!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-guide-required{display:none!important;}

/* Cantidad: controles alineados y sin pisarse */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(4){
  grid-row:4!important;
  grid-template-columns:230px minmax(0,1fr) minmax(170px,240px)!important;
  grid-template-rows:18px minmax(0,1fr)!important;
  column-gap:10px!important;
  row-gap:4px!important;
}
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(4) .touch-step-title{grid-column:1/-1!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-qty{
  grid-column:1!important;
  display:grid!important;
  grid-template-columns:48px minmax(92px,1fr) 48px!important;
  gap:7px!important;
  align-items:stretch!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-qty button{
  width:48px!important;
  height:100%!important;
  min-height:40px!important;
  max-height:50px!important;
  border-radius:12px!important;
  font-size:26px!important;
  line-height:1!important;
  padding:0!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-qty-number{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  min-width:0!important;
  height:100%!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-qty-input{
  width:100%!important;
  height:38px!important;
  min-height:38px!important;
  max-height:42px!important;
  padding:0!important;
  border-radius:12px!important;
  font-size:24px!important;
  font-weight:950!important;
  text-align:center!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-qty-number span{font-size:10px!important;line-height:12px!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-fast{
  grid-column:2!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-fast button{
  width:100%!important;
  height:100%!important;
  min-height:40px!important;
  max-height:50px!important;
  border-radius:12px!important;
  padding:0 8px!important;
  font-size:15px!important;
  font-weight:950!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 #atajosPolvora{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-alert{
  grid-column:3!important;
  height:100%!important;
  min-height:40px!important;
  max-height:50px!important;
  margin:0!important;
  padding:6px 9px!important;
  border-radius:12px!important;
  font-size:12px!important;
  line-height:1.08!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Resumen: fila inferior compacta */
body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(5){grid-row:5!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-summary{
  display:grid!important;
  grid-template-columns:1.7fr 1fr 1fr .8fr!important;
  gap:8px!important;
  height:100%!important;
  min-height:0!important;
  padding:0!important;
  background:transparent!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-summary div{
  display:grid!important;
  grid-template-rows:16px minmax(0,1fr)!important;
  min-width:0!important;
  height:100%!important;
  padding:5px 8px!important;
  border:1px solid #e5e7eb!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-summary span{
  height:16px!important;
  line-height:16px!important;
  font-size:10px!important;
  font-weight:900!important;
  color:#64748b!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-summary strong{
  display:flex!important;
  align-items:center!important;
  min-width:0!important;
  height:100%!important;
  font-size:13px!important;
  font-weight:950!important;
  line-height:1.05!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Barra inferior: siempre visible y proporcional */
body.venta-touch-screen.touch-row-mode-v291 .touch-actions{
  position:fixed!important;
  left:58px!important;
  right:10px!important;
  bottom:8px!important;
  height:var(--v291-actions)!important;
  min-height:var(--v291-actions)!important;
  max-height:var(--v291-actions)!important;
  display:grid!important;
  grid-template-columns:160px minmax(0,1fr)!important;
  gap:10px!important;
  padding:0!important;
  margin:0!important;
  overflow:visible!important;
  z-index:9990!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v291 .touch-wizard-next{display:none!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-clear,
body.venta-touch-screen.touch-row-mode-v291 .touch-save,
body.venta-touch-screen.touch-row-mode-v291 #touchWizardSubmit{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:var(--v291-actions)!important;
  min-height:var(--v291-actions)!important;
  max-height:var(--v291-actions)!important;
  padding:0 12px!important;
  border-radius:14px!important;
  font-size:16px!important;
  font-weight:950!important;
  line-height:1!important;
  text-align:center!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-clear{grid-column:1!important;}
body.venta-touch-screen.touch-row-mode-v291 .touch-save,
body.venta-touch-screen.touch-row-mode-v291 #touchWizardSubmit{grid-column:2!important;}

body.venta-touch-screen.touch-row-mode-v291 .menu-abajo-boton,
body.venta-touch-screen.touch-row-mode-v291 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v291 .bottom-menu-tab{
  left:10px!important;
  right:auto!important;
  bottom:8px!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
  line-height:44px!important;
  z-index:99990!important;
}

/* Búsqueda cliente con teclado: modal interno, sin pisar resultados */
body.venta-touch-screen.touch-row-mode-v291.touch-client-search-mode .touch-body{
  display:block!important;
  height:calc(var(--touch-vvh, 100dvh) - 10px)!important;
  max-height:calc(var(--touch-vvh, 100dvh) - 10px)!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v291.touch-client-search-mode .touch-body > .touch-card:first-of-type{
  position:fixed!important;
  top:7px!important;
  left:7px!important;
  right:7px!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(var(--touch-vvh, 100dvh) - 14px)!important;
  z-index:9000!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-row-mode-v291.touch-client-search-mode #formVentaTouch,
body.venta-touch-screen.touch-row-mode-v291.touch-client-search-mode .touch-actions{
  display:none!important;
}
body.venta-touch-screen.touch-row-mode-v291.touch-client-search-mode .touch-client-results{
  max-height:calc(var(--touch-vvh, 100dvh) - 70px)!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-client-item.is-selected{
  background:#2563eb!important;
  color:#fff!important;
}
body.venta-touch-screen.touch-row-mode-v291 .touch-client-item.is-selected span{color:#dbeafe!important;}

/* Ajustes para alturas más bajas: reduce sin superponer */
@media screen and (max-height:720px){
  body.venta-touch-screen.touch-row-mode-v291{
    --v291-actions:48px;
    --v291-client-row:52px;
    --v291-cat-row:96px;
    --v291-cal-row:76px;
    --v291-data-row:76px;
    --v291-qty-row:74px;
    --v291-summary-row:58px;
    --v291-gap:6px;
  }
  body.venta-touch-screen.touch-row-mode-v291 .touch-category{grid-template-rows:32px minmax(0,1fr)!important;padding:4px!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon-wrap{height:31px!important;max-height:31px!important;width:48px!important;max-width:48px!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon{width:46px!important;height:29px!important;max-width:46px!important;max-height:29px!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-category-icon-text{width:46px!important;height:29px!important;font-size:20px!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-category-label{font-size:10px!important;line-height:1.02!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-step-title{font-size:12px!important;height:16px!important;line-height:16px!important;}
  body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card{grid-template-rows:16px minmax(0,1fr)!important;padding:5px 7px!important;}
}

/* Ajuste para pantallas estrechas: filas siguen siendo filas, pero con scroll horizontal controlado */
@media screen and (max-width:900px){
  body.venta-touch-screen.touch-row-mode-v291{
    --v291-actions:50px;
    --v291-client-row:54px;
    --v291-cat-row:98px;
    --v291-cal-row:82px;
    --v291-data-row:136px;
    --v291-qty-row:86px;
    --v291-summary-row:96px;
  }
  body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch{
    overflow:auto!important;
    padding-bottom:4px!important;
  }
  body.venta-touch-screen.touch-row-mode-v291 .touch-category-grid{
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(112px,1fr)!important;
    grid-template-columns:none!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body.venta-touch-screen.touch-row-mode-v291 .touch-form-grid{
    grid-template-columns:repeat(3,minmax(150px,1fr))!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(150px,1fr)!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body.venta-touch-screen.touch-row-mode-v291 #formVentaTouch > .touch-card:nth-of-type(4){
    grid-template-columns:210px minmax(260px,1fr)!important;
  }
  body.venta-touch-screen.touch-row-mode-v291 .touch-alert{display:none!important;}
  body.venta-touch-screen.touch-row-mode-v291 .touch-summary{
    grid-template-columns:repeat(4,minmax(120px,1fr))!important;
    overflow-x:auto!important;
  }
}

/* ============================================================
   V292 - Burbujas adaptativas reales PC/tablet/móvil
   Corrige descuadre por CSS antiguo V133 y escala contenido interno.
   ============================================================ */
body.venta-touch-screen.touch-row-mode-v292,
body.venta-touch-screen.touch-row-mode-v291{
  --v291-gap: clamp(6px, .65vw, 12px) !important;
  --v291-actions: clamp(48px, 6vh, 58px) !important;
  --v291-client-row: clamp(52px, 6.4vh, 66px) !important;
  --v291-cat-row: clamp(96px, 13.2vh, 132px) !important;
  --v291-cal-row: clamp(78px, 10.8vh, 108px) !important;
  --v291-data-row: clamp(82px, 11.5vh, 110px) !important;
  --v291-qty-row: clamp(78px, 10.5vh, 104px) !important;
  --v291-summary-row: clamp(62px, 8.4vh, 82px) !important;
}

body.venta-touch-screen.touch-row-mode-v292 .touch-body,
body.venta-touch-screen.touch-row-mode-v291 .touch-body.touch-body-no-header{
  padding:0 !important;
  gap:var(--v291-gap) !important;
}

body.venta-touch-screen.touch-row-mode-v292 #formVentaTouch{
  grid-template-rows:
    minmax(86px,var(--v291-cat-row))
    minmax(70px,var(--v291-cal-row))
    minmax(78px,var(--v291-data-row))
    minmax(72px,var(--v291-qty-row))
    minmax(58px,var(--v291-summary-row)) !important;
  gap:var(--v291-gap) !important;
}

/* Tarjetas/fila sin heredar anchos raros */
body.venta-touch-screen.touch-row-mode-v292 #formVentaTouch > .touch-card,
body.venta-touch-screen.touch-row-mode-v292 .touch-body > .touch-card:first-of-type{
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}

/* Categorías: 6 burbujas iguales, contenido siempre dentro */
body.venta-touch-screen.touch-row-mode-v292 .touch-category-grid{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  grid-template-rows:1fr !important;
  grid-auto-flow:row !important;
  grid-auto-columns:auto !important;
  gap:clamp(5px,.7vw,12px) !important;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  overflow:hidden !important;
  align-items:stretch !important;
  justify-items:stretch !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category,
body.venta-touch-screen.touch-row-mode-v292 .touch-category.v133-touch-pill{
  all:unset;
  display:grid !important;
  grid-template-rows:minmax(30px,42%) minmax(0,1fr) !important;
  align-items:center !important;
  justify-items:center !important;
  gap:clamp(2px,.35vw,6px) !important;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  max-width:none !important;
  min-height:0 !important;
  max-height:none !important;
  padding:clamp(4px,.55vw,9px) !important;
  margin:0 !important;
  border:2px solid #334155 !important;
  border-radius:clamp(10px,1vw,16px) !important;
  background:#fff !important;
  color:#0f172a !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  cursor:pointer !important;
  text-align:center !important;
  font-family:inherit !important;
  white-space:normal !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category *,
body.venta-touch-screen.touch-row-mode-v292 .touch-chip *,
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid *{
  box-sizing:border-box !important;
  min-width:0 !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category-icon-wrap{
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  min-height:0 !important;
  max-height:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category-icon{
  width:auto !important;
  height:auto !important;
  max-width:min(68px,70%) !important;
  max-height:100% !important;
  object-fit:contain !important;
  display:block !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category-icon-text{
  width:min(64px,78%) !important;
  height:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  min-height:0 !important;
  max-height:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:10px !important;
  font-size:clamp(18px,2.2vw,30px) !important;
  font-weight:950 !important;
  line-height:1 !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category-label{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:100% !important;
  padding:0 2px !important;
  margin:0 !important;
  text-align:center !important;
  font-size:clamp(10px, .92vw, 15px) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  letter-spacing:0 !important;
  white-space:normal !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-category.active,
body.venta-touch-screen.touch-row-mode-v292 .touch-category.is-selected{
  background:#1d4ed8 !important;
  color:#fff !important;
  border-color:#1e3a8a !important;
  box-shadow:0 0 0 3px rgba(29,78,216,.22) !important;
}

/* Calibres: chips iguales y texto escalado a cada burbuja */
body.venta-touch-screen.touch-row-mode-v292 .touch-calibres{
  display:grid !important;
  grid-auto-flow:column !important;
  grid-auto-columns:minmax(clamp(76px,8vw,132px),1fr) !important;
  grid-template-rows:1fr !important;
  gap:clamp(5px,.65vw,10px) !important;
  width:100% !important;
  height:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  align-items:stretch !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-chip,
body.venta-touch-screen.touch-row-mode-v292 .touch-chip.v133-calibre-pill{
  all:unset;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:0 !important;
  width:100% !important;
  height:100% !important;
  padding:0 clamp(5px,.7vw,10px) !important;
  margin:0 !important;
  border:2px solid #334155 !important;
  border-radius:clamp(10px,.9vw,15px) !important;
  background:#fff !important;
  color:#0f172a !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  text-align:center !important;
  font-size:clamp(11px,.95vw,16px) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  white-space:normal !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  cursor:pointer !important;
}

/* Campos: el input ocupa su propia burbuja sin salirse */
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  grid-auto-flow:row !important;
  gap:clamp(5px,.65vw,10px) !important;
  height:100% !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid > div{
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) !important;
  gap:3px !important;
  min-width:0 !important;
  height:100% !important;
  padding:clamp(4px,.5vw,7px) !important;
  border:1px solid #dbe3ee !important;
  border-radius:12px !important;
  overflow:hidden !important;
  background:#f8fafc !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid label{
  margin:0 !important;
  font-size:clamp(9px,.75vw,12px) !important;
  line-height:1.05 !important;
  font-weight:950 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid select{
  width:100% !important;
  height:100% !important;
  min-height:28px !important;
  max-height:42px !important;
  padding:0 clamp(6px,.6vw,10px) !important;
  font-size:clamp(11px,.9vw,15px) !important;
  border-radius:10px !important;
  overflow:hidden !important;
}

/* Cantidad/resumen ajustados */
body.venta-touch-screen.touch-row-mode-v292 #formVentaTouch > .touch-card:nth-of-type(4){
  grid-template-columns:minmax(190px, .55fr) minmax(220px, 1fr) minmax(0,.8fr) !important;
}
body.venta-touch-screen.touch-row-mode-v292 .touch-summary{
  grid-template-columns:1.45fr 1fr 1fr .85fr !important;
  gap:clamp(5px,.65vw,10px) !important;
}

/* Móvil/anchos cortos: mantener filas pero permitir scroll horizontal interno, sin pisarse */
@media screen and (max-width:1050px){
  body.venta-touch-screen.touch-row-mode-v292 .touch-category-grid{
    grid-template-columns:repeat(6,minmax(112px,1fr)) !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
  }
  body.venta-touch-screen.touch-row-mode-v292 .touch-form-grid{
    grid-template-columns:repeat(5,minmax(135px,1fr)) !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
  }
  body.venta-touch-screen.touch-row-mode-v292 .touch-category-label{font-size:clamp(9px,1.5vw,13px) !important;}
}

@media screen and (max-height:720px){
  body.venta-touch-screen.touch-row-mode-v292{
    --v291-cat-row:96px !important;
    --v291-cal-row:74px !important;
    --v291-data-row:74px !important;
    --v291-qty-row:70px !important;
    --v291-summary-row:56px !important;
  }
  body.venta-touch-screen.touch-row-mode-v292 .touch-category{grid-template-rows:minmax(24px,38%) minmax(0,1fr) !important;}
  body.venta-touch-screen.touch-row-mode-v292 .touch-category-icon{max-width:min(50px,70%) !important;}
  body.venta-touch-screen.touch-row-mode-v292 .touch-category-icon-text{font-size:clamp(16px,2vw,22px) !important;}
  body.venta-touch-screen.touch-row-mode-v292 .touch-category-label{font-size:clamp(9px,.78vw,12px) !important;}
}


/* =========================================================
   V296 - VENTA TOUCH: DISEÑO LIMPIO POR FILAS REALES
   Objetivo: mismo aspecto en PC/tablet/móvil, sin wizard,
   burbujas autoajustadas y contenido siempre dentro.
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v296,
body.venta-touch-screen.touch-row-mode-v296 *{ box-sizing:border-box !important; }

body.venta-touch-screen.touch-row-mode-v296{
  --v296-gap:clamp(8px,1vw,14px);
  --v296-radius:clamp(12px,1vw,18px);
  --v296-card-pad:clamp(10px,1vw,16px);
  --v296-title:clamp(17px,1.25vw,25px);
  --v296-text:clamp(12px,.85vw,16px);
  --v296-small:clamp(10px,.72vw,13px);
  background:#f3f4f6 !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  height:auto !important;
  min-height:100vh !important;
}

body.venta-touch-screen.touch-row-mode-v296 .app,
body.venta-touch-screen.touch-row-mode-v296 .main,
body.venta-touch-screen.touch-row-mode-v296 main,
body.venta-touch-screen.touch-row-mode-v296 .content{
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  margin-left:0 !important;
  padding:clamp(6px,.8vw,14px) !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
}

body.venta-touch-screen.touch-row-mode-v296 .admin-quick-actions,
body.venta-touch-screen.touch-row-mode-v296 .touch-logo,
body.venta-touch-screen.touch-row-mode-v296 .touch-header,
body.venta-touch-screen.touch-row-mode-v296 .touch-v279-progress,
body.venta-touch-screen.touch-row-mode-v296 #wizardStepError,
body.venta-touch-screen.touch-row-mode-v296 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v296 .touch-wizard-next{
  display:none !important;
}

body.venta-touch-screen.touch-row-mode-v296 .touch-session-pill{
  position:fixed !important;
  right:clamp(8px,1vw,18px) !important;
  top:clamp(6px,.8vw,12px) !important;
  z-index:50 !important;
  font-size:clamp(9px,.75vw,13px) !important;
  padding:4px 9px !important;
  border-radius:999px !important;
  max-width:25vw !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

body.venta-touch-screen.touch-row-mode-v296 .touch-body,
body.venta-touch-screen.touch-row-mode-v296 .touch-body.touch-body-no-header{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--v296-gap) !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
}

body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--v296-gap) !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
}

body.venta-touch-screen.touch-row-mode-v296 .touch-card,
body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch>.touch-card,
body.venta-touch-screen.touch-row-mode-v296 .touch-body>.touch-card:first-of-type{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:var(--v296-card-pad) !important;
  border:0 !important;
  border-radius:var(--v296-radius) !important;
  background:#fff !important;
  box-shadow:0 6px 22px rgba(15,23,42,.08) !important;
  overflow:hidden !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
  opacity:1 !important;
  visibility:visible !important;
}

body.venta-touch-screen.touch-row-mode-v296 .touch-step-title{
  display:block !important;
  height:auto !important;
  margin:0 0 clamp(7px,.65vw,12px) 0 !important;
  padding:0 !important;
  font-size:var(--v296-title) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  color:#020617 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* Cliente */
body.venta-touch-screen.touch-row-mode-v296 .touch-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:clamp(8px,1vw,14px) !important;
  align-items:center !important;
  width:100% !important;
  height:auto !important;
  min-width:0 !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-search,
body.venta-touch-screen.touch-row-mode-v296 input.touch-search{
  width:100% !important;
  height:clamp(42px,4.5vh,58px) !important;
  min-height:40px !important;
  max-height:64px !important;
  padding:0 clamp(12px,1vw,18px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(10px,.9vw,15px) !important;
  font-size:clamp(17px,1.35vw,26px) !important;
  font-weight:900 !important;
  line-height:1 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-add-client{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  height:clamp(42px,4.5vh,58px) !important;
  max-width:25vw !important;
  padding:0 clamp(10px,1vw,18px) !important;
  font-size:clamp(14px,1.15vw,22px) !important;
  line-height:1 !important;
  font-weight:950 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* Categorías: filas/burbujas reales */
body.venta-touch-screen.touch-row-mode-v296 .touch-category-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)) !important;
  gap:clamp(8px,1vw,16px) !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
  align-items:stretch !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category,
body.venta-touch-screen.touch-row-mode-v296 .touch-category.v133-touch-pill{
  all:unset;
  display:grid !important;
  grid-template-rows:minmax(28px,1fr) auto !important;
  place-items:center !important;
  gap:clamp(4px,.55vw,8px) !important;
  width:100% !important;
  min-width:0 !important;
  min-height:clamp(74px,10vh,120px) !important;
  max-height:none !important;
  height:auto !important;
  padding:clamp(8px,.9vw,14px) !important;
  margin:0 !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(11px,1vw,17px) !important;
  background:#fff !important;
  color:#0f172a !important;
  box-shadow:none !important;
  cursor:pointer !important;
  overflow:hidden !important;
  text-align:center !important;
  font-family:inherit !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon-wrap{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:clamp(30px,4.8vh,58px) !important;
  min-width:0 !important;
  min-height:0 !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon{
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:clamp(34px,5vw,68px) !important;
  max-height:clamp(28px,4.5vh,56px) !important;
  object-fit:contain !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon-text{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:clamp(42px,5vw,66px) !important;
  height:clamp(32px,4.8vh,54px) !important;
  max-width:100% !important;
  border-radius:10px !important;
  font-size:clamp(20px,2vw,34px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category-label{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  height:auto !important;
  max-height:2.4em !important;
  font-size:clamp(11px,.9vw,16px) !important;
  font-weight:950 !important;
  line-height:1.12 !important;
  text-align:center !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-category.active,
body.venta-touch-screen.touch-row-mode-v296 .touch-category.is-selected{
  border-color:#0f766e !important;
  box-shadow:inset 0 0 0 1px #0f766e, 0 0 0 3px rgba(15,118,110,.12) !important;
  background:#f0fdfa !important;
}

/* Calibres */
body.venta-touch-screen.touch-row-mode-v296 .touch-calibres{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)) !important;
  gap:clamp(8px,1vw,14px) !important;
  width:100% !important;
  height:auto !important;
  min-height:clamp(56px,7vh,84px) !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-chip,
body.venta-touch-screen.touch-row-mode-v296 .touch-chip.v133-calibre-pill{
  all:unset;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  min-width:0 !important;
  min-height:clamp(46px,6vh,68px) !important;
  padding:clamp(7px,.8vw,12px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(10px,.9vw,15px) !important;
  background:#fff !important;
  color:#020617 !important;
  font-size:clamp(12px,.95vw,17px) !important;
  font-weight:950 !important;
  line-height:1.1 !important;
  text-align:center !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  overflow:hidden !important;
  cursor:pointer !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-chip.active,
body.venta-touch-screen.touch-row-mode-v296 .touch-chip.is-selected{
  border-color:#0f766e !important;
  background:#f0fdfa !important;
}

/* Fecha/autorización */
body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr)) !important;
  gap:clamp(8px,1vw,14px) !important;
  width:100% !important;
  height:auto !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid>div{
  display:grid !important;
  grid-template-rows:auto 1fr !important;
  gap:clamp(4px,.45vw,7px) !important;
  min-width:0 !important;
  min-height:clamp(58px,7vh,84px) !important;
  padding:clamp(7px,.75vw,11px) !important;
  border:1px solid #dbe3ee !important;
  border-radius:clamp(10px,.9vw,15px) !important;
  background:#f8fafc !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid label{
  margin:0 !important;
  font-size:clamp(11px,.78vw,14px) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid select{
  width:100% !important;
  min-width:0 !important;
  height:clamp(34px,4vh,46px) !important;
  min-height:0 !important;
  padding:0 clamp(8px,.8vw,12px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(8px,.8vw,12px) !important;
  font-size:clamp(12px,.9vw,16px) !important;
  font-weight:800 !important;
  line-height:1 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-guide-required,
body.venta-touch-screen.touch-row-mode-v296 .touch-help{font-size:var(--v296-small)!important;line-height:1.1!important;overflow:hidden!important;}

/* Cantidad */
body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch>.touch-card:nth-of-type(4){
  display:grid !important;
  grid-template-columns:auto minmax(240px,1fr) !important;
  grid-template-areas:"title title" "qty fast" "alert alert" !important;
  gap:clamp(8px,1vw,14px) !important;
  align-items:center !important;
}
body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin-bottom:0!important;}
body.venta-touch-screen.touch-row-mode-v296 .touch-qty{
  grid-area:qty !important;
  display:flex !important;
  align-items:center !important;
  gap:clamp(8px,.9vw,14px) !important;
  min-width:0 !important;
  height:auto !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-qty button{
  flex:0 0 clamp(42px,3.8vw,60px) !important;
  width:clamp(42px,3.8vw,60px) !important;
  height:clamp(42px,3.8vw,60px) !important;
  min-height:0 !important;
  border-radius:clamp(9px,.8vw,14px) !important;
  font-size:clamp(22px,2vw,34px) !important;
  line-height:1 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-qty-number{
  flex:0 0 clamp(88px,7vw,150px) !important;
  width:clamp(88px,7vw,150px) !important;
  height:clamp(46px,5vw,72px) !important;
  min-height:0 !important;
  display:grid !important;
  grid-template-rows:1fr auto !important;
  place-items:center !important;
  padding:clamp(3px,.35vw,6px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(9px,.8vw,14px) !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-qty-input{
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  font-size:clamp(22px,2.1vw,36px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  text-align:center !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-qty-number span{
  font-size:clamp(9px,.7vw,12px) !important;
  line-height:1 !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-fast{
  grid-area:fast !important;
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr)) !important;
  gap:clamp(8px,1vw,14px) !important;
  width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-fast button{
  width:100% !important;
  min-width:0 !important;
  height:clamp(44px,5vh,66px) !important;
  min-height:0 !important;
  padding:0 clamp(8px,1vw,14px) !important;
  border-radius:clamp(10px,.8vw,15px) !important;
  font-size:clamp(16px,1.3vw,24px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-alert{grid-area:alert!important;font-size:var(--v296-small)!important;}
body.venta-touch-screen.touch-row-mode-v296 #cantidadUnidadesControl.is-hidden,
body.venta-touch-screen.touch-row-mode-v296 #atajosUnidades.is-hidden,
body.venta-touch-screen.touch-row-mode-v296 #atajosPolvora.is-hidden{display:none!important;}

/* Resumen */
body.venta-touch-screen.touch-row-mode-v296 .touch-summary{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr)) !important;
  gap:clamp(8px,1vw,14px) !important;
  width:100% !important;
  height:auto !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-summary>div{
  min-width:0 !important;
  min-height:clamp(42px,5vh,62px) !important;
  padding:clamp(7px,.8vw,11px) !important;
  border:1px solid #dbe3ee !important;
  border-radius:clamp(10px,.8vw,14px) !important;
  background:#f8fafc !important;
  display:grid !important;
  grid-template-rows:auto 1fr !important;
  gap:2px !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-summary span{
  font-size:clamp(10px,.7vw,12px) !important;
  font-weight:900 !important;
  color:#475569 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-summary strong{
  font-size:clamp(12px,.86vw,16px) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  overflow:hidden !important;
}

/* Acciones */
body.venta-touch-screen.touch-row-mode-v296 .touch-actions{
  display:grid !important;
  grid-template-columns:minmax(160px,.45fr) minmax(260px,1fr) !important;
  gap:clamp(8px,1vw,14px) !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  margin:0 0 clamp(8px,1vw,16px) 0 !important;
  padding:0 !important;
  overflow:hidden !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-actions a,
body.venta-touch-screen.touch-row-mode-v296 .touch-actions button{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:clamp(50px,6vh,74px) !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 clamp(10px,1vw,18px) !important;
  border-radius:clamp(11px,.9vw,16px) !important;
  font-size:clamp(16px,1.3vw,25px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v296 .touch-save{display:flex!important;background:#087f5b!important;color:#fff!important;}
body.venta-touch-screen.touch-row-mode-v296 .touch-clear{display:flex!important;background:#c81e1e!important;color:#fff!important;}

/* Anchos pequeños: mismo diseño por filas, pero 1-2 columnas según quepa */
@media screen and (max-width:900px){
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(min(135px,100%),1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid{grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-actions{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-row{grid-template-columns:1fr auto!important;}
}
@media screen and (max-width:520px){
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-grid,
  body.venta-touch-screen.touch-row-mode-v296 .touch-calibres,
  body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid,
  body.venta-touch-screen.touch-row-mode-v296 .touch-summary{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-add-client{max-width:none!important;width:100%!important;}
}
@media screen and (max-height:760px) and (min-width:1000px){
  body.venta-touch-screen.touch-row-mode-v296{--v296-gap:7px;--v296-card-pad:8px;--v296-title:clamp(15px,1.05vw,21px);}
  body.venta-touch-screen.touch-row-mode-v296 .touch-category{min-height:76px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon-wrap{height:32px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon{max-height:30px!important;max-width:48px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-icon-text{height:30px!important;width:48px!important;font-size:22px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-category-label{font-size:11px!important;line-height:1.05!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-chip{min-height:42px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid>div{min-height:54px!important;padding:6px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-form-grid input{height:30px!important;}
  body.venta-touch-screen.touch-row-mode-v296 .touch-actions a,
  body.venta-touch-screen.touch-row-mode-v296 .touch-actions button{height:48px!important;}
}

/* ==========================================================
   V297 - VENTA TOUCH: diseño único por filas, contenido interno adaptable
   Objetivo: PC/tablet/móvil con el mismo esquema visual, sin wizard,
   sin solapes y con botón de pantalla completa.
   ========================================================== */
html:has(body.venta-touch-screen.touch-row-mode-v297),
body.venta-touch-screen.touch-row-mode-v297{
  min-height:100% !important;
  width:100% !important;
  overflow-x:hidden !important;
  background:#f3f4f6 !important;
}
body.venta-touch-screen.touch-row-mode-v297{
  --v297-gap:clamp(8px,1.05vw,16px);
  --v297-pad:clamp(8px,1vw,16px);
  --v297-radius:clamp(12px,1vw,18px);
  --v297-title:clamp(16px,1.28vw,24px);
  --v297-text:clamp(11px,.82vw,15px);
  --v297-small:clamp(9px,.68vw,12px);
  --v297-control:clamp(38px,4.8vh,56px);
}
body.venta-touch-screen.touch-row-mode-v297 .main,
body.venta-touch-screen.touch-row-mode-v297 main,
body.venta-touch-screen.touch-row-mode-v297 .content{
  width:100% !important;
  max-width:none !important;
  margin-left:0 !important;
  padding:clamp(6px,.8vw,14px) !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v297 h1,
body.venta-touch-screen.touch-row-mode-v297 .admin-quick-actions,
body.venta-touch-screen.touch-row-mode-v297 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v297 .touch-wizard-next{
  display:none !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-session-pill{
  position:fixed !important;
  top:clamp(6px,.7vw,12px) !important;
  right:clamp(8px,.9vw,14px) !important;
  z-index:50 !important;
  height:clamp(20px,2.8vh,30px) !important;
  padding:0 clamp(8px,.8vw,12px) !important;
  font-size:var(--v297-small) !important;
  line-height:1 !important;
  border-radius:999px !important;
  display:flex !important;
  align-items:center !important;
  max-width:30vw !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-body{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:var(--v297-gap) !important;
  min-height:0 !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v297 #formVentaTouch{
  width:100% !important;
  max-width:none !important;
  display:flex !important;
  flex-direction:column !important;
  gap:var(--v297-gap) !important;
  margin:0 !important;
  padding:0 !important;
  position:static !important;
  transform:none !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-card,
body.venta-touch-screen.touch-row-mode-v297 #formVentaTouch>.touch-card,
body.venta-touch-screen.touch-row-mode-v297 .touch-body>.touch-card{
  display:block !important;
  position:relative !important;
  left:auto !important; right:auto !important; top:auto !important; bottom:auto !important;
  transform:none !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:var(--v297-pad) !important;
  border:1px solid #e2e8f0 !important;
  border-radius:var(--v297-radius) !important;
  background:#fff !important;
  box-shadow:0 8px 24px rgba(15,23,42,.07) !important;
  overflow:visible !important;
  opacity:1 !important;
  visibility:visible !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-step-title{
  display:block !important;
  margin:0 0 clamp(6px,.7vw,10px) 0 !important;
  font-size:var(--v297-title) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  color:#020617 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
/* cabecera cliente */
body.venta-touch-screen.touch-row-mode-v297 .touch-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:var(--v297-gap) !important;
  width:100% !important;
  min-width:0 !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-row>div:first-child{min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-top-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:clamp(6px,.7vw,10px) !important;
  min-width:0 !important;
  flex-wrap:nowrap !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-search{
  width:100% !important;
  height:clamp(40px,5vh,58px) !important;
  min-height:0 !important;
  padding:0 clamp(10px,1vw,16px) !important;
  border-radius:clamp(10px,.9vw,16px) !important;
  font-size:clamp(18px,1.55vw,28px) !important;
  font-weight:950 !important;
  line-height:1 !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-add-client,
body.venta-touch-screen.touch-row-mode-v297 .touch-fullscreen-btn{
  flex:0 0 auto !important;
  height:clamp(38px,4.8vh,54px) !important;
  min-height:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 clamp(10px,1vw,16px) !important;
  border-radius:clamp(10px,.9vw,16px) !important;
  border:1px solid #cbd5e1 !important;
  background:#fff !important;
  color:#0f172a !important;
  font-size:clamp(12px,.95vw,18px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  text-decoration:none !important;
  cursor:pointer !important;
  box-shadow:0 2px 8px rgba(15,23,42,.08) !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-add-client{color:#073bc7!important;}
/* categorías/calibres: cada contenido queda dentro de su burbuja */
body.venta-touch-screen.touch-row-mode-v297 .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v297 .touch-calibres{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr)) !important;
  gap:clamp(7px,.9vw,14px) !important;
  width:100% !important;
  min-width:0 !important;
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
  align-items:stretch !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category,
body.venta-touch-screen.touch-row-mode-v297 .touch-chip{
  position:relative !important;
  display:grid !important;
  place-items:center !important;
  grid-template-rows:auto auto !important;
  gap:clamp(3px,.45vw,7px) !important;
  width:100% !important;
  min-width:0 !important;
  min-height:clamp(58px,9.5vh,112px) !important;
  height:auto !important;
  max-height:none !important;
  padding:clamp(6px,.85vw,12px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(10px,.9vw,16px) !important;
  background:#fff !important;
  overflow:hidden !important;
  text-align:center !important;
  box-sizing:border-box !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category.active,
body.venta-touch-screen.touch-row-mode-v297 .touch-chip.active,
body.venta-touch-screen.touch-row-mode-v297 .touch-chip.is-selected{
  border-color:#0f766e !important;
  box-shadow:inset 0 0 0 1px #0f766e,0 0 0 2px rgba(15,118,110,.08) !important;
  background:#f0fdfa !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon-wrap{
  width:100% !important;
  max-width:100% !important;
  height:clamp(26px,4.4vh,50px) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon{
  display:block !important;
  max-width:clamp(28px,5vw,74px) !important;
  max-height:clamp(24px,4.2vh,48px) !important;
  width:auto !important;
  height:auto !important;
  object-fit:contain !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon-text{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:clamp(38px,5.2vw,68px) !important;
  height:clamp(26px,4.2vh,46px) !important;
  max-width:100% !important;
  border-radius:clamp(7px,.7vw,12px) !important;
  font-size:clamp(17px,2vw,32px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-category-label,
body.venta-touch-screen.touch-row-mode-v297 .touch-chip{
  max-width:100% !important;
  color:#020617 !important;
  font-size:clamp(10px,.86vw,16px) !important;
  font-weight:950 !important;
  line-height:1.05 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  text-align:center !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-chip{
  grid-template-rows:1fr !important;
  min-height:clamp(42px,6.5vh,66px) !important;
  padding:clamp(5px,.65vw,10px) !important;
}
/* fecha/autorización */
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr)) !important;
  gap:clamp(7px,.9vw,14px) !important;
  width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid>div{
  min-width:0 !important;
  min-height:clamp(58px,7.5vh,82px) !important;
  padding:clamp(6px,.75vw,11px) !important;
  border:1px solid #dbe3ee !important;
  border-radius:clamp(10px,.8vw,14px) !important;
  background:#f8fafc !important;
  display:grid !important;
  grid-template-rows:auto 1fr !important;
  gap:clamp(4px,.45vw,7px) !important;
  overflow:hidden !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid label{
  margin:0 !important;
  font-size:clamp(10px,.82vw,15px) !important;
  font-weight:950 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid select,
body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid textarea{
  width:100% !important;
  min-width:0 !important;
  height:clamp(32px,4.2vh,46px) !important;
  min-height:0 !important;
  padding:0 clamp(8px,.8vw,12px) !important;
  border:1px solid #cbd5e1 !important;
  border-radius:clamp(8px,.75vw,12px) !important;
  background:#fff !important;
  font-size:clamp(12px,.95vw,17px) !important;
  font-weight:850 !important;
  line-height:1 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
/* cantidad */
body.venta-touch-screen.touch-row-mode-v297 #formVentaTouch>.touch-card:nth-of-type(4){
  display:grid !important;
  grid-template-columns:auto minmax(260px,1fr) !important;
  grid-template-areas:"title title" "qty fast" "alert alert" !important;
  gap:clamp(7px,.9vw,14px) !important;
  align-items:center !important;
}
body.venta-touch-screen.touch-row-mode-v297 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin-bottom:0!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-qty{grid-area:qty!important;display:flex!important;align-items:center!important;gap:clamp(7px,.8vw,13px)!important;min-width:0!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-qty button{flex:0 0 var(--v297-control)!important;width:var(--v297-control)!important;height:var(--v297-control)!important;min-height:0!important;border-radius:clamp(9px,.75vw,14px)!important;font-size:clamp(22px,2vw,34px)!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-qty-number{flex:0 0 clamp(82px,7vw,142px)!important;width:clamp(82px,7vw,142px)!important;height:clamp(44px,5.2vh,68px)!important;min-height:0!important;padding:clamp(3px,.4vw,6px)!important;border:1px solid #cbd5e1!important;border-radius:clamp(9px,.75vw,14px)!important;display:grid!important;grid-template-rows:1fr auto!important;place-items:center!important;overflow:hidden!important;background:#fff!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-qty-input{width:100%!important;height:100%!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;text-align:center!important;font-size:clamp(22px,2.2vw,36px)!important;font-weight:950!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-qty-number span{font-size:clamp(9px,.68vw,12px)!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(120px,100%),1fr))!important;gap:clamp(7px,.85vw,13px)!important;width:100%!important;min-width:0!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-fast button{width:100%!important;min-width:0!important;height:clamp(42px,5.4vh,62px)!important;min-height:0!important;padding:0 clamp(8px,.85vw,14px)!important;border-radius:clamp(10px,.8vw,15px)!important;background:#0f8275!important;color:#fff!important;font-size:clamp(16px,1.25vw,23px)!important;font-weight:950!important;line-height:1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
body.venta-touch-screen.touch-row-mode-v297 #cantidadUnidadesControl.is-hidden,
body.venta-touch-screen.touch-row-mode-v297 #atajosUnidades.is-hidden,
body.venta-touch-screen.touch-row-mode-v297 #atajosPolvora.is-hidden{display:none!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-alert{grid-area:alert!important;font-size:var(--v297-small)!important;line-height:1.15!important;}
/* resumen */
body.venta-touch-screen.touch-row-mode-v297 .touch-summary{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr))!important;gap:clamp(7px,.85vw,13px)!important;width:100%!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-summary>div{min-width:0!important;min-height:clamp(40px,5.4vh,62px)!important;padding:clamp(6px,.72vw,10px)!important;border:1px solid #dbe3ee!important;border-radius:clamp(10px,.8vw,14px)!important;background:#f8fafc!important;display:grid!important;grid-template-rows:auto 1fr!important;gap:2px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-summary span{font-size:clamp(9px,.68vw,12px)!important;font-weight:950!important;color:#475569!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-summary strong{font-size:clamp(11px,.82vw,16px)!important;font-weight:950!important;line-height:1.05!important;white-space:normal!important;overflow-wrap:anywhere!important;overflow:hidden!important;}
/* acciones siempre visibles */
body.venta-touch-screen.touch-row-mode-v297 .touch-actions{display:grid!important;grid-template-columns:minmax(140px,.42fr) minmax(260px,1fr)!important;gap:var(--v297-gap)!important;width:100%!important;margin:0 0 var(--v297-gap) 0!important;padding:0!important;position:static!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-actions a,
body.venta-touch-screen.touch-row-mode-v297 .touch-actions button{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:clamp(48px,6.2vh,72px)!important;min-height:0!important;margin:0!important;padding:0 clamp(10px,1vw,18px)!important;border-radius:clamp(11px,.9vw,16px)!important;border:0!important;color:#fff!important;font-size:clamp(16px,1.25vw,24px)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;opacity:1!important;visibility:visible!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-clear{background:#c81e1e!important;}
body.venta-touch-screen.touch-row-mode-v297 .touch-save,
body.venta-touch-screen.touch-row-mode-v297 #touchWizardSubmit{display:flex!important;background:#087f5b!important;color:#fff!important;}
/* menú: solo botón, sin gesto */
body.venta-touch-screen.touch-row-mode-v297 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v297 .bottom-menu-tab{display:none!important;}
/* ajustes por ancho */
@media screen and (max-width:1100px){
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-grid,
  body.venta-touch-screen.touch-row-mode-v297 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(min(155px,100%),1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid{grid-template-columns:repeat(auto-fit,minmax(min(165px,100%),1fr))!important;}
}
@media screen and (max-width:760px){
  body.venta-touch-screen.touch-row-mode-v297 .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-top-actions{justify-content:stretch!important;display:grid!important;grid-template-columns:1fr 1fr!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-add-client,
  body.venta-touch-screen.touch-row-mode-v297 .touch-fullscreen-btn{width:100%!important;}
  body.venta-touch-screen.touch-row-mode-v297 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-actions{grid-template-columns:1fr!important;}
}
@media screen and (max-width:480px){
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-grid,
  body.venta-touch-screen.touch-row-mode-v297 .touch-calibres{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid,
  body.venta-touch-screen.touch-row-mode-v297 .touch-summary{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-top-actions{grid-template-columns:1fr!important;}
}
@media screen and (max-height:760px) and (min-width:900px){
  body.venta-touch-screen.touch-row-mode-v297{--v297-gap:7px;--v297-pad:8px;--v297-title:clamp(15px,1.05vw,21px);--v297-control:42px;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-search{height:38px!important;font-size:18px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-add-client,
  body.venta-touch-screen.touch-row-mode-v297 .touch-fullscreen-btn{height:36px!important;font-size:12px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-category{min-height:58px!important;padding:5px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon-wrap{height:24px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon{max-height:22px!important;max-width:42px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-icon-text{height:24px!important;width:38px!important;font-size:18px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-category-label,
  body.venta-touch-screen.touch-row-mode-v297 .touch-chip{font-size:10px!important;line-height:1.02!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-chip{min-height:38px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid>div{min-height:50px!important;padding:5px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid input,
  body.venta-touch-screen.touch-row-mode-v297 .touch-form-grid select{height:28px!important;font-size:12px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-fast button{height:38px!important;font-size:15px!important;}
  body.venta-touch-screen.touch-row-mode-v297 .touch-actions a,
  body.venta-touch-screen.touch-row-mode-v297 .touch-actions button{height:46px!important;font-size:16px!important;}
}

/* =========================================================
   V298 - Venta touch: una sola pantalla, contenido compacto real
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v298{
  --v298-gap:clamp(6px,.75vw,12px);
  --v298-pad:clamp(7px,.8vw,12px);
  --v298-title:clamp(12px,1.05vw,18px);
  --v298-text:clamp(10px,.78vw,14px);
  --v298-small:clamp(8px,.62vw,11px);
  --v298-chip-h:clamp(34px,5.1vh,58px);
  --v298-icon:clamp(18px,2.6vh,31px);
  --v298-radius:clamp(10px,.9vw,16px);
  overflow-x:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-mobile-wizard,
body.venta-touch-screen.touch-row-mode-v298 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v298 .touch-wizard-next,
body.venta-touch-screen.touch-row-mode-v298 #touchWizardPrev,
body.venta-touch-screen.touch-row-mode-v298 #touchWizardNext{display:none!important;visibility:hidden!important;width:0!important;height:0!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-body,
body.venta-touch-screen.touch-row-mode-v298 .touch-body.touch-body-no-header{
  width:min(100vw,100%)!important;
  max-width:100%!important;
  min-height:calc(var(--touch-vvh,100vh) - 8px)!important;
  padding:var(--v298-gap)!important;
  display:grid!important;
  grid-template-rows:auto 1fr!important;
  gap:var(--v298-gap)!important;
  overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-card,
body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch>.touch-card,
body.venta-touch-screen.touch-row-mode-v298 .touch-body>.touch-card{
  display:block!important;
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:var(--v298-pad)!important;
  border-radius:var(--v298-radius)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch{
  display:grid!important;
  grid-template-rows:auto auto auto auto auto auto!important;
  gap:var(--v298-gap)!important;
  width:100%!important;
  max-width:100%!important;
  overflow:visible!important;
  margin:0!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-step-title{
  margin:0 0 clamp(4px,.55vw,8px) 0!important;
  padding:0!important;
  font-size:var(--v298-title)!important;
  line-height:1.05!important;
  font-weight:950!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
/* cabecera cliente + fullscreen siempre visible */
body.venta-touch-screen.touch-row-mode-v298 .touch-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:var(--v298-gap)!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-search{height:clamp(36px,5.2vh,54px)!important;min-height:0!important;font-size:clamp(14px,1.25vw,22px)!important;padding:0 clamp(10px,1vw,16px)!important;border-radius:var(--v298-radius)!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-top-actions{display:flex!important;gap:var(--v298-gap)!important;align-items:center!important;justify-content:flex-end!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v298 #touchFullscreenBtn,
body.venta-touch-screen.touch-row-mode-v298 .touch-fullscreen-btn,
body.venta-touch-screen.touch-row-mode-v298 .touch-add-client{display:inline-flex!important;visibility:visible!important;align-items:center!important;justify-content:center!important;height:clamp(36px,5.2vh,54px)!important;min-height:0!important;padding:0 clamp(9px,.9vw,14px)!important;border-radius:var(--v298-radius)!important;font-size:clamp(11px,.82vw,15px)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;text-decoration:none!important;}
body.venta-touch-screen.touch-row-mode-v298 #touchFullscreenBtn{background:#0f766e!important;color:#fff!important;border:0!important;}
/* categorias: muchas burbujas pequeñas dentro de la burbuja padre */
body.venta-touch-screen.touch-row-mode-v298 .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(clamp(72px,7vw,118px),1fr))!important;
  gap:clamp(4px,.48vw,8px)!important;
  width:100%!important;
  max-height:clamp(96px,18vh,170px)!important;
  overflow:auto!important;
  padding:1px!important;
  align-items:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-category{
  width:100%!important;
  min-width:0!important;
  min-height:var(--v298-chip-h)!important;
  height:var(--v298-chip-h)!important;
  padding:clamp(3px,.42vw,6px)!important;
  border-radius:clamp(8px,.7vw,12px)!important;
  display:grid!important;
  grid-template-rows:auto 1fr!important;
  gap:clamp(1px,.25vw,3px)!important;
  place-items:center!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-category-icon-wrap{height:var(--v298-icon)!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-category-icon{max-height:var(--v298-icon)!important;max-width:clamp(22px,3.4vw,42px)!important;object-fit:contain!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-category-icon-text{width:clamp(28px,3.5vw,46px)!important;height:var(--v298-icon)!important;font-size:clamp(14px,1.45vw,22px)!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-category-label{font-size:var(--v298-small)!important;line-height:1.02!important;font-weight:950!important;max-width:100%!important;max-height:2.1em!important;white-space:normal!important;overflow:hidden!important;text-align:center!important;overflow-wrap:anywhere!important;}
/* calibres compactos */
body.venta-touch-screen.touch-row-mode-v298 .touch-calibres{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(clamp(68px,6.6vw,112px),1fr))!important;
  gap:clamp(4px,.48vw,8px)!important;
  max-height:clamp(88px,16vh,150px)!important;
  overflow:auto!important;
  padding:1px!important;
}
body.venta-touch-screen.touch-row-mode-v298 .touch-chip,
body.venta-touch-screen.touch-row-mode-v298 .touch-calibres button{
  width:100%!important;min-width:0!important;height:clamp(30px,4.4vh,48px)!important;min-height:0!important;padding:clamp(2px,.35vw,5px) clamp(4px,.55vw,8px)!important;border-radius:clamp(8px,.65vw,12px)!important;font-size:clamp(9px,.72vw,13px)!important;font-weight:950!important;line-height:1.02!important;white-space:normal!important;overflow:hidden!important;text-align:center!important;overflow-wrap:anywhere!important;display:flex!important;align-items:center!important;justify-content:center!important;}
/* fecha/autorizacion compacto */
body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(clamp(128px,15vw,230px),1fr))!important;gap:clamp(5px,.62vw,9px)!important;align-items:stretch!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid>div{min-width:0!important;min-height:clamp(44px,6.4vh,68px)!important;padding:clamp(4px,.52vw,8px)!important;border-radius:clamp(8px,.7vw,12px)!important;overflow:hidden!important;display:grid!important;grid-template-rows:auto 1fr!important;gap:clamp(2px,.3vw,4px)!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid label{font-size:var(--v298-small)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid select{height:clamp(26px,3.9vh,38px)!important;min-height:0!important;font-size:clamp(10px,.78vw,14px)!important;font-weight:850!important;line-height:1!important;padding:0 clamp(6px,.65vw,10px)!important;border-radius:clamp(7px,.6vw,10px)!important;min-width:0!important;width:100%!important;box-sizing:border-box!important;}
/* cantidad */
body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch>.touch-card:nth-of-type(4){display:grid!important;grid-template-columns:minmax(190px,.55fr) minmax(180px,1fr)!important;grid-template-areas:"title title" "qty fast" "alert alert"!important;gap:clamp(5px,.65vw,10px)!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-qty{grid-area:qty!important;display:flex!important;align-items:center!important;gap:clamp(5px,.6vw,9px)!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-qty button{flex:0 0 clamp(34px,4.8vh,52px)!important;width:clamp(34px,4.8vh,52px)!important;height:clamp(34px,4.8vh,52px)!important;min-height:0!important;font-size:clamp(18px,1.8vw,28px)!important;border-radius:clamp(8px,.7vw,12px)!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-qty-number{flex:1 1 auto!important;min-width:70px!important;height:clamp(36px,5.2vh,56px)!important;min-height:0!important;padding:clamp(2px,.35vw,5px)!important;border-radius:clamp(8px,.7vw,12px)!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-qty-input{height:100%!important;font-size:clamp(18px,1.8vw,30px)!important;line-height:1!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-qty-number span{font-size:var(--v298-small)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(64px,1fr))!important;gap:clamp(5px,.6vw,9px)!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-fast button{height:clamp(34px,4.8vh,52px)!important;min-height:0!important;font-size:clamp(12px,.95vw,18px)!important;font-weight:950!important;border-radius:clamp(8px,.7vw,12px)!important;padding:0 clamp(5px,.6vw,9px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-alert{grid-area:alert!important;font-size:var(--v298-small)!important;line-height:1.1!important;padding:clamp(4px,.5vw,8px)!important;margin:0!important;}
/* resumen */
body.venta-touch-screen.touch-row-mode-v298 .touch-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:clamp(5px,.6vw,9px)!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-summary>div{min-width:0!important;min-height:clamp(36px,5.1vh,58px)!important;padding:clamp(4px,.52vw,8px)!important;border-radius:clamp(8px,.7vw,12px)!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-summary span{font-size:var(--v298-small)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-summary strong{font-size:clamp(10px,.78vw,14px)!important;line-height:1.05!important;max-height:2.1em!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
/* acciones: solo limpiar y finalizar */
body.venta-touch-screen.touch-row-mode-v298 .touch-actions{display:grid!important;grid-template-columns:minmax(110px,.35fr) minmax(180px,1fr)!important;gap:var(--v298-gap)!important;position:static!important;margin:0 0 var(--v298-gap) 0!important;padding:0!important;width:100%!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-actions .touch-clear,
body.venta-touch-screen.touch-row-mode-v298 .touch-actions .touch-save,
body.venta-touch-screen.touch-row-mode-v298 .touch-actions #touchWizardSubmit{display:flex!important;visibility:visible!important;width:100%!important;height:clamp(42px,5.8vh,62px)!important;min-height:0!important;align-items:center!important;justify-content:center!important;font-size:clamp(14px,1.05vw,20px)!important;font-weight:950!important;line-height:1!important;border-radius:var(--v298-radius)!important;margin:0!important;padding:0 clamp(8px,.9vw,14px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#fff!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-actions .touch-clear{background:#c81e1e!important;}
body.venta-touch-screen.touch-row-mode-v298 .touch-actions .touch-save,
body.venta-touch-screen.touch-row-mode-v298 .touch-actions #touchWizardSubmit{background:#087f5b!important;}
/* sin gesto/menu inferior */
body.venta-touch-screen.touch-row-mode-v298 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v298 .bottom-menu-tab,
body.venta-touch-screen.touch-row-mode-v298 .menu-abajo-boton{display:none!important;}
@media screen and (max-width:900px){
  body.venta-touch-screen.touch-row-mode-v298{--v298-chip-h:clamp(32px,4.8vh,52px);}
  body.venta-touch-screen.touch-row-mode-v298 .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-top-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(70px,1fr))!important;max-height:clamp(98px,20vh,160px)!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(68px,1fr))!important;max-height:clamp(86px,17vh,145px)!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media screen and (max-width:560px){
  body.venta-touch-screen.touch-row-mode-v298 .touch-top-actions{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-calibres{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-actions{grid-template-columns:1fr!important;}
}
@media screen and (max-height:760px) and (min-width:760px){
  body.venta-touch-screen.touch-row-mode-v298{--v298-gap:5px;--v298-pad:6px;--v298-chip-h:34px;--v298-icon:17px;--v298-title:12px;--v298-small:8px;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-category-grid{max-height:82px!important;grid-template-columns:repeat(auto-fit,minmax(66px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-calibres{max-height:76px!important;grid-template-columns:repeat(auto-fit,minmax(62px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid>div{min-height:42px!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-form-grid input{height:24px!important;}
  body.venta-touch-screen.touch-row-mode-v298 .touch-actions .touch-clear,
  body.venta-touch-screen.touch-row-mode-v298 .touch-actions #touchWizardSubmit{height:38px!important;}
}

/* V299 - venta_touch: filas padre a ancho completo y contenido interno mini-adaptativo real */
html:has(body.venta-touch-screen),
body.venta-touch-screen{
  width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
  background:#eef7f5!important;
}
body.venta-touch-screen.touch-row-mode-v299 *,
body.venta-touch-screen.touch-row-mode-v299 *::before,
body.venta-touch-screen.touch-row-mode-v299 *::after{box-sizing:border-box!important;}
body.venta-touch-screen.touch-row-mode-v299{
  --v299-gap:clamp(5px,.75vw,10px);
  --v299-pad:clamp(7px,.9vw,13px);
  --v299-radius:clamp(12px,1vw,18px);
  --v299-title:clamp(11px,.86vw,15px);
  --v299-text:clamp(9px,.72vw,13px);
  --v299-mini:clamp(8px,.62vw,11px);
  --v299-chip-h:clamp(25px,3.7vh,40px);
  --v299-icon:clamp(16px,2.5vh,27px);
}
body.venta-touch-screen.touch-row-mode-v299 .main,
body.venta-touch-screen.touch-row-mode-v299 main,
body.venta-touch-screen.touch-row-mode-v299 .content,
body.venta-touch-screen.touch-row-mode-v299 .container{
  width:100%!important;max-width:none!important;margin:0!important;padding:var(--v299-gap)!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v299 .admin-quick-actions{display:none!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-session-pill{
  position:static!important;width:100%!important;margin:0 0 var(--v299-gap)!important;height:auto!important;
  min-height:clamp(28px,4vh,38px)!important;padding:5px 10px!important;border-radius:999px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;font-size:var(--v299-text)!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-body,
body.venta-touch-screen.touch-row-mode-v299 .touch-body.touch-body-no-header,
body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch{
  width:100%!important;max-width:none!important;margin:0!important;padding:0!important;
  display:flex!important;flex-direction:column!important;gap:var(--v299-gap)!important;
  height:auto!important;min-height:0!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-card,
body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch>.touch-card,
body.venta-touch-screen.touch-row-mode-v299 .touch-body>.touch-card{
  width:100%!important;max-width:none!important;min-width:0!important;min-height:0!important;height:auto!important;
  margin:0!important;padding:var(--v299-pad)!important;border-radius:var(--v299-radius)!important;
  display:block!important;position:static!important;transform:none!important;overflow:visible!important;
  background:#fff!important;border:1px solid rgba(5,150,105,.16)!important;box-shadow:0 5px 16px rgba(15,23,42,.07)!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-row{
  width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:var(--v299-gap)!important;align-items:center!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-top-actions{display:flex!important;gap:var(--v299-gap)!important;align-items:stretch!important;justify-content:flex-end!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-fullscreen-btn,
body.venta-touch-screen.touch-row-mode-v299 .touch-add-client{
  display:inline-flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;
  height:clamp(32px,4.6vh,45px)!important;min-height:0!important;padding:0 clamp(8px,1vw,14px)!important;border-radius:12px!important;
  font-size:var(--v299-text)!important;font-weight:900!important;line-height:1!important;white-space:nowrap!important;text-decoration:none!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-fullscreen-btn{background:#0f766e!important;color:#fff!important;border:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-add-client{background:#e8fff7!important;color:#065f46!important;border:1px solid rgba(5,150,105,.3)!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-search{
  width:100%!important;height:clamp(32px,4.8vh,46px)!important;min-height:0!important;border-radius:12px!important;
  padding:0 clamp(8px,1vw,14px)!important;font-size:var(--v299-text)!important;font-weight:800!important;line-height:1!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-step-title{
  margin:0 0 clamp(4px,.55vw,8px)!important;padding:0!important;font-size:var(--v299-title)!important;line-height:1.05!important;font-weight:950!important;
  display:flex!important;align-items:center!important;color:#0f172a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
/* categorías: mini tarjetas siempre dentro de la burbuja padre */
body.venta-touch-screen.touch-row-mode-v299 .touch-category-grid{
  width:100%!important;min-width:0!important;display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(clamp(72px,9vw,125px),1fr))!important;
  gap:clamp(4px,.55vw,8px)!important;align-items:stretch!important;overflow:visible!important;max-height:none!important;padding:0!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-category{
  width:100%!important;min-width:0!important;height:var(--v299-chip-h)!important;min-height:0!important;max-height:none!important;
  padding:clamp(2px,.38vw,5px) clamp(4px,.55vw,8px)!important;border-radius:clamp(8px,.8vw,13px)!important;
  display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:clamp(3px,.45vw,7px)!important;align-items:center!important;justify-content:start!important;
  overflow:hidden!important;text-align:left!important;background:#f8fffc!important;border:1px solid rgba(20,184,166,.24)!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-category-icon-wrap{
  width:var(--v299-icon)!important;height:var(--v299-icon)!important;min-width:var(--v299-icon)!important;min-height:var(--v299-icon)!important;margin:0!important;border-radius:50%!important;
  display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;background:#e9fbf4!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-category-icon{width:78%!important;height:78%!important;object-fit:contain!important;display:block!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-category-icon-text{font-size:clamp(8px,.72vw,12px)!important;font-weight:950!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-category-label{
  min-width:0!important;width:100%!important;max-width:100%!important;font-size:var(--v299-mini)!important;line-height:1.02!important;font-weight:950!important;
  display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:left!important;
}
/* calibres: píldoras pequeñas, mismo criterio */
body.venta-touch-screen.touch-row-mode-v299 .touch-calibres{
  width:100%!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(clamp(58px,7vw,98px),1fr))!important;
  gap:clamp(4px,.5vw,7px)!important;overflow:visible!important;max-height:none!important;padding:0!important;min-height:var(--v299-chip-h)!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-chip,
body.venta-touch-screen.touch-row-mode-v299 .touch-calibres button{
  width:100%!important;min-width:0!important;height:clamp(24px,3.4vh,36px)!important;min-height:0!important;padding:0 clamp(4px,.6vw,8px)!important;border-radius:999px!important;
  font-size:var(--v299-mini)!important;font-weight:950!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important;
  white-space:normal!important;text-align:center!important;overflow:hidden!important;overflow-wrap:anywhere!important;
}
/* fecha/autorizaciones: campos horizontales compactos */
body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid{
  width:100%!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(clamp(130px,16vw,230px),1fr))!important;
  gap:clamp(5px,.6vw,9px)!important;align-items:stretch!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid>div{
  min-width:0!important;min-height:clamp(42px,5.7vh,58px)!important;height:auto!important;padding:clamp(4px,.55vw,8px)!important;border-radius:12px!important;
  display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;gap:3px!important;overflow:hidden!important;background:#f8fafc!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid label{font-size:var(--v299-mini)!important;line-height:1!important;font-weight:950!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid select{
  width:100%!important;min-width:0!important;height:clamp(24px,3.4vh,34px)!important;min-height:0!important;padding:0 clamp(5px,.65vw,9px)!important;border-radius:9px!important;
  font-size:var(--v299-mini)!important;font-weight:850!important;line-height:1!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
/* cantidad: todo compacto dentro de su fila */
body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch>.touch-card:nth-of-type(4){
  display:grid!important;grid-template-columns:minmax(170px,.5fr) minmax(180px,1fr)!important;grid-template-areas:"title title" "qty fast" "alert alert"!important;
  gap:clamp(5px,.6vw,9px)!important;align-items:center!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-qty{grid-area:qty!important;display:flex!important;align-items:center!important;gap:clamp(4px,.55vw,8px)!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-qty button{
  flex:0 0 clamp(30px,4.2vh,44px)!important;width:clamp(30px,4.2vh,44px)!important;height:clamp(30px,4.2vh,44px)!important;min-height:0!important;
  font-size:clamp(16px,1.5vw,24px)!important;line-height:1!important;border-radius:10px!important;padding:0!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-qty-number{flex:1 1 auto!important;min-width:70px!important;height:clamp(32px,4.6vh,46px)!important;min-height:0!important;padding:2px 4px!important;border-radius:10px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-qty-input{height:70%!important;min-height:0!important;font-size:clamp(15px,1.35vw,24px)!important;line-height:1!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-qty-number span{font-size:var(--v299-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(54px,1fr))!important;gap:clamp(4px,.55vw,8px)!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-fast button{height:clamp(28px,4vh,42px)!important;min-height:0!important;padding:0 clamp(4px,.55vw,8px)!important;border-radius:10px!important;font-size:var(--v299-text)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-alert{grid-area:alert!important;margin:0!important;padding:5px 8px!important;font-size:var(--v299-mini)!important;line-height:1.1!important;border-radius:10px!important;overflow:hidden!important;}
/* resumen */
body.venta-touch-screen.touch-row-mode-v299 .touch-summary{width:100%!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:clamp(5px,.6vw,9px)!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-summary>div{min-width:0!important;min-height:clamp(34px,4.8vh,50px)!important;padding:clamp(4px,.55vw,8px)!important;border-radius:12px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-summary span{font-size:var(--v299-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-summary strong{font-size:var(--v299-text)!important;line-height:1.05!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
/* acciones finales */
body.venta-touch-screen.touch-row-mode-v299 .touch-actions{
  width:100%!important;display:grid!important;grid-template-columns:minmax(110px,.28fr) minmax(180px,1fr)!important;gap:var(--v299-gap)!important;margin:0 0 var(--v299-gap)!important;padding:0!important;position:static!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-actions .touch-clear,
body.venta-touch-screen.touch-row-mode-v299 .touch-actions .touch-save,
body.venta-touch-screen.touch-row-mode-v299 .touch-actions #touchWizardSubmit{
  display:flex!important;visibility:visible!important;opacity:1!important;width:100%!important;height:clamp(36px,5vh,52px)!important;min-height:0!important;
  align-items:center!important;justify-content:center!important;border-radius:var(--v299-radius)!important;padding:0 10px!important;font-size:var(--v299-title)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#fff!important;text-decoration:none!important;
}
body.venta-touch-screen.touch-row-mode-v299 .touch-actions .touch-clear{background:#b91c1c!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-actions .touch-save,
body.venta-touch-screen.touch-row-mode-v299 .touch-actions #touchWizardSubmit{background:#047857!important;}
/* prohibido wizard/botones antiguos/gesto inferior */
body.venta-touch-screen.touch-row-mode-v299 #touchWizardPrev,
body.venta-touch-screen.touch-row-mode-v299 #touchWizardNext,
body.venta-touch-screen.touch-row-mode-v299 .touch-wizard-nav,
body.venta-touch-screen.touch-row-mode-v299 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v299 .bottom-menu-tab,
body.venta-touch-screen.touch-row-mode-v299 .menu-abajo-boton{display:none!important;visibility:hidden!important;pointer-events:none!important;}
body.venta-touch-screen.touch-row-mode-v299 .touch-client-results{z-index:10000!important;max-height:40vh!important;overflow:auto!important;}
@media (max-width:900px){
  body.venta-touch-screen.touch-row-mode-v299{--v299-gap:6px;--v299-pad:7px;--v299-chip-h:clamp(25px,3.8vh,36px);--v299-icon:clamp(15px,2.3vh,23px);}
  body.venta-touch-screen.touch-row-mode-v299 .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-top-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(70px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(56px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media (max-width:560px){
  body.venta-touch-screen.touch-row-mode-v299{--v299-gap:5px;--v299-pad:6px;--v299-title:11px;--v299-text:10px;--v299-mini:8px;--v299-chip-h:30px;--v299-icon:18px;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-top-actions{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-calibres{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-actions{grid-template-columns:1fr!important;}
}
@media (max-height:760px) and (min-width:700px){
  body.venta-touch-screen.touch-row-mode-v299{--v299-gap:4px;--v299-pad:5px;--v299-radius:10px;--v299-title:10px;--v299-text:9px;--v299-mini:7.5px;--v299-chip-h:25px;--v299-icon:15px;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid>div{min-height:36px!important;padding:3px 5px!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-form-grid input{height:22px!important;}
  body.venta-touch-screen.touch-row-mode-v299 .touch-actions .touch-clear,
  body.venta-touch-screen.touch-row-mode-v299 .touch-actions #touchWizardSubmit{height:34px!important;}
}

/* =========================================================
   V300 - Venta touch: burbujas padre a ancho completo y
   contenido interno mini-adaptativo para PC/tablet/móvil.
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v300{
  --v300-gap: clamp(4px, .65vw, 9px);
  --v300-pad: clamp(5px, .75vw, 10px);
  --v300-radius: clamp(10px, 1vw, 16px);
  --v300-title: clamp(10px, .82vw, 14px);
  --v300-text: clamp(8px, .74vw, 12px);
  --v300-mini: clamp(7px, .62vw, 10px);
  --v300-chip-h: clamp(26px, 4.0vh, 38px);
  --v300-field-h: clamp(25px, 4.0vh, 36px);
  min-height:100dvh!important;
  background:#eef5f4!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-row-mode-v300 .admin-quick-actions,
body.venta-touch-screen.touch-row-mode-v300 .venta-11-screen{display:none!important;}
body.venta-touch-screen.touch-row-mode-v300 .main,
body.venta-touch-screen.touch-row-mode-v300 main,
body.venta-touch-screen.touch-row-mode-v300 .content{
  width:100%!important;max-width:none!important;margin:0!important;padding:0!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-session-pill{
  position:fixed!important;left:8px!important;top:8px!important;z-index:20000!important;
  height:30px!important;max-width:45vw!important;padding:0 10px!important;border-radius:999px!important;
  display:flex!important;align-items:center!important;font-size:11px!important;font-weight:900!important;line-height:1!important;
  box-shadow:0 6px 16px rgba(15,23,42,.12)!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-fullscreen-btn,
body.venta-touch-screen.touch-row-mode-v300 #touchFullscreenBtn{
  position:fixed!important;right:8px!important;top:8px!important;z-index:20001!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:auto!important;min-width:34px!important;max-width:44vw!important;height:30px!important;
  padding:0 10px!important;border:0!important;border-radius:999px!important;background:#0f766e!important;color:#fff!important;
  font-size:11px!important;font-weight:950!important;line-height:1!important;box-shadow:0 6px 16px rgba(15,23,42,.18)!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;cursor:pointer!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-body,
body.venta-touch-screen.touch-row-mode-v300 .touch-body.touch-body-no-header{
  width:100%!important;max-width:none!important;margin:0!important;padding:42px var(--v300-gap) var(--v300-gap)!important;
  display:flex!important;flex-direction:column!important;gap:var(--v300-gap)!important;overflow:visible!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-body>.touch-card,
body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch>.touch-card{
  width:100%!important;max-width:none!important;margin:0!important;padding:var(--v300-pad)!important;border-radius:var(--v300-radius)!important;
  min-height:0!important;height:auto!important;box-sizing:border-box!important;overflow:hidden!important;
  background:rgba(255,255,255,.96)!important;border:1px solid rgba(13,148,136,.18)!important;box-shadow:0 4px 14px rgba(15,23,42,.07)!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:var(--v300-gap)!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-top-actions{display:flex!important;gap:var(--v300-gap)!important;align-items:center!important;justify-content:flex-end!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-top-actions #touchFullscreenBtn{position:fixed!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-add-client{height:30px!important;padding:0 10px!important;border-radius:999px!important;font-size:11px!important;font-weight:900!important;display:flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-search{height:32px!important;min-height:0!important;border-radius:999px!important;padding:0 12px!important;font-size:12px!important;font-weight:850!important;}
body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch{width:100%!important;display:flex!important;flex-direction:column!important;gap:var(--v300-gap)!important;margin:0!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-step-title{font-size:var(--v300-title)!important;line-height:1!important;font-weight:950!important;margin:0 0 5px!important;padding:0!important;color:#0f172a!important;}
/* Categorías: fichas internas pequeñas, siempre dentro de la burbuja padre */
body.venta-touch-screen.touch-row-mode-v300 .touch-category-grid{
  display:grid!important;grid-template-columns:repeat(auto-fit,minmax(58px,1fr))!important;gap:clamp(3px,.45vw,6px)!important;
  width:100%!important;max-height:calc(var(--v300-chip-h) * 2 + 9px)!important;overflow:auto!important;align-items:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-category{
  width:100%!important;min-width:0!important;height:var(--v300-chip-h)!important;min-height:0!important;padding:2px 4px!important;border-radius:10px!important;
  display:grid!important;grid-template-columns:clamp(15px,2.4vh,22px) minmax(0,1fr)!important;grid-template-rows:1fr!important;gap:3px!important;align-items:center!important;
  overflow:hidden!important;box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v300 .touch-category-icon-wrap{width:clamp(15px,2.4vh,22px)!important;height:clamp(15px,2.4vh,22px)!important;min-width:0!important;min-height:0!important;border-radius:7px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-category-icon{width:100%!important;height:100%!important;object-fit:contain!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-category-icon-text{font-size:clamp(8px,1.25vh,12px)!important;line-height:1!important;font-weight:950!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-category-label{font-size:var(--v300-text)!important;line-height:1.02!important;font-weight:900!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;overflow:hidden!important;text-align:left!important;overflow-wrap:anywhere!important;}
/* Calibres: más pequeños que categorías */
body.venta-touch-screen.touch-row-mode-v300 .touch-calibres{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(48px,1fr))!important;gap:clamp(3px,.45vw,6px)!important;width:100%!important;max-height:calc(var(--v300-chip-h) * 2 + 9px)!important;overflow:auto!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-chip{height:var(--v300-chip-h)!important;min-height:0!important;padding:2px 4px!important;border-radius:10px!important;font-size:var(--v300-text)!important;font-weight:950!important;line-height:1.05!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;white-space:normal!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
/* Fecha/autorización */
body.venta-touch-screen.touch-row-mode-v300 .touch-form-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(135px,1fr))!important;gap:clamp(4px,.55vw,7px)!important;width:100%!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-form-grid>div{min-width:0!important;min-height:0!important;padding:4px 6px!important;border-radius:10px!important;background:#f8fafc!important;display:grid!important;grid-template-rows:auto auto!important;gap:3px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-form-grid label{font-size:var(--v300-mini)!important;line-height:1!important;font-weight:950!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v300 .touch-form-grid select{height:var(--v300-field-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 7px!important;border-radius:8px!important;font-size:var(--v300-text)!important;font-weight:850!important;line-height:1!important;}
/* Cantidad en una fila adaptable */
body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch>.touch-card:nth-of-type(4){display:grid!important;grid-template-columns:minmax(160px,.45fr) minmax(220px,1fr)!important;grid-template-areas:"title title" "qty fast" "alert alert"!important;gap:clamp(4px,.55vw,7px)!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-qty{grid-area:qty!important;display:grid!important;grid-template-columns:32px minmax(70px,1fr) 32px!important;gap:4px!important;align-items:center!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-qty button{width:32px!important;height:32px!important;min-height:0!important;border-radius:9px!important;padding:0!important;font-size:18px!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-qty-number{height:32px!important;min-height:0!important;padding:2px 4px!important;border-radius:9px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-qty-input{height:18px!important;min-height:0!important;font-size:16px!important;line-height:1!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-qty-number span{font-size:var(--v300-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(44px,1fr))!important;gap:4px!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-fast button{height:30px!important;min-height:0!important;padding:0 4px!important;border-radius:9px!important;font-size:var(--v300-text)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-alert{grid-area:alert!important;margin:0!important;padding:4px 7px!important;border-radius:9px!important;font-size:var(--v300-mini)!important;line-height:1.08!important;overflow:hidden!important;}
/* Resumen y acciones */
body.venta-touch-screen.touch-row-mode-v300 .touch-summary{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(110px,1fr))!important;gap:4px!important;width:100%!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-summary>div{min-height:34px!important;padding:4px 6px!important;border-radius:10px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-summary span{font-size:var(--v300-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-summary strong{font-size:var(--v300-text)!important;line-height:1.05!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-actions{display:grid!important;grid-template-columns:minmax(90px,.25fr) minmax(170px,1fr)!important;gap:var(--v300-gap)!important;width:100%!important;margin:0 0 var(--v300-gap)!important;padding:0!important;position:static!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-clear,
body.venta-touch-screen.touch-row-mode-v300 .touch-save,
body.venta-touch-screen.touch-row-mode-v300 #touchWizardSubmit{display:flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;width:100%!important;height:38px!important;min-height:0!important;border-radius:12px!important;padding:0 10px!important;font-size:13px!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-decoration:none!important;color:#fff!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-clear{background:#b91c1c!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-save,
body.venta-touch-screen.touch-row-mode-v300 #touchWizardSubmit{background:#047857!important;}
body.venta-touch-screen.touch-row-mode-v300 #touchWizardPrev,
body.venta-touch-screen.touch-row-mode-v300 #touchWizardNext,
body.venta-touch-screen.touch-row-mode-v300 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v300 .touch-wizard-next,
body.venta-touch-screen.touch-row-mode-v300 .touch-wizard-nav,
body.venta-touch-screen.touch-row-mode-v300 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v300 .bottom-menu-tab,
body.venta-touch-screen.touch-row-mode-v300 .menu-abajo-boton{display:none!important;visibility:hidden!important;pointer-events:none!important;}
body.venta-touch-screen.touch-row-mode-v300 .touch-client-results{z-index:21000!important;max-height:42vh!important;overflow:auto!important;}
@media (max-width:1100px){
  body.venta-touch-screen.touch-row-mode-v300{--v300-gap:5px;--v300-pad:6px;--v300-chip-h:30px;--v300-field-h:30px;--v300-title:11px;--v300-text:9.5px;--v300-mini:7.5px;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(52px,1fr))!important;max-height:75px!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))!important;max-height:75px!important;}
}
@media (max-width:760px){
  body.venta-touch-screen.touch-row-mode-v300{--v300-chip-h:28px;--v300-field-h:28px;--v300-title:10px;--v300-text:8.5px;--v300-mini:7px;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-row{grid-template-columns:1fr!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-top-actions{justify-content:stretch!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-add-client{width:100%!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(46px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(40px,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
}
@media (max-height:760px){
  body.venta-touch-screen.touch-row-mode-v300{--v300-gap:4px;--v300-pad:5px;--v300-chip-h:26px;--v300-field-h:26px;--v300-title:10px;--v300-text:8px;--v300-mini:7px;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-body{padding-top:40px!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-step-title{margin-bottom:3px!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-category-grid,
  body.venta-touch-screen.touch-row-mode-v300 .touch-calibres{max-height:58px!important;}
  body.venta-touch-screen.touch-row-mode-v300 .touch-actions .touch-clear,
  body.venta-touch-screen.touch-row-mode-v300 .touch-actions #touchWizardSubmit{height:32px!important;font-size:11px!important;}
}

/* =========================================================
   V301 - Corrección buscador cliente visible y clicable
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v301 .touch-body > .touch-card:first-child,
body.venta-touch-screen.touch-row-mode-v301 .touch-body > .touch-card:first-child .touch-row,
body.venta-touch-screen.touch-row-mode-v301 .touch-body > .touch-card:first-child .touch-row > div:first-child{
  overflow:visible!important;
  position:relative!important;
  z-index:22000!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_buscar_cliente{
  width:100%!important;
  min-width:0!important;
  height:34px!important;
  min-height:0!important;
  font-size:13px!important;
  line-height:1!important;
  padding:0 12px!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente{
  display:none;
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:calc(100% + 6px)!important;
  z-index:30000!important;
  max-height:min(46vh,360px)!important;
  overflow:auto!important;
  background:#fff!important;
  border:1px solid #cbd5e1!important;
  border-radius:14px!important;
  box-shadow:0 18px 45px rgba(15,23,42,.22)!important;
  margin:0!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente[style*="block"]{
  display:block!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-empty,
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item{
  width:100%!important;
  min-height:34px!important;
  padding:7px 10px!important;
  box-sizing:border-box!important;
  font-size:12px!important;
  line-height:1.15!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  color:#0f172a!important;
  background:#fff!important;
  border:0!important;
  border-bottom:1px solid #e5e7eb!important;
  cursor:pointer!important;
  text-align:left!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item strong{
  display:block!important;
  font-size:12px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:100%!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item span{
  display:block!important;
  margin-top:2px!important;
  font-size:10px!important;
  line-height:1!important;
  color:#64748b!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item:hover,
body.venta-touch-screen.touch-row-mode-v301 #touch_resultados_cliente .touch-client-item.is-selected{
  background:#e0f2fe!important;
}

/* =========================================================
   V302 - Venta touch: burbujas padre full-width + contenido interno real
   PC/tablet/móvil, normal y fullscreen. Sobrescribe versiones previas.
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v302{
  --v302-gap:clamp(5px,.75vw,10px);
  --v302-pad:clamp(6px,.85vw,11px);
  --v302-radius:clamp(12px,1vw,18px);
  --v302-title:clamp(10px,.86vw,14px);
  --v302-text:clamp(8px,.72vw,12px);
  --v302-mini:clamp(7px,.58vw,10px);
  --v302-chip-h:clamp(24px,3.9vh,34px);
  --v302-field-h:clamp(25px,3.8vh,34px);
  background:#eef5f4!important;
  min-height:100dvh!important;
  overflow:auto!important;
}
body.venta-touch-screen.touch-row-mode-v302 *{box-sizing:border-box!important;}
body.venta-touch-screen.touch-row-mode-v302 .admin-quick-actions,
body.venta-touch-screen.touch-row-mode-v302 .venta-11-screen,
body.venta-touch-screen.touch-row-mode-v302 #touchWizardPrev,
body.venta-touch-screen.touch-row-mode-v302 #touchWizardNext,
body.venta-touch-screen.touch-row-mode-v302 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v302 .touch-wizard-next,
body.venta-touch-screen.touch-row-mode-v302 .touch-wizard-nav,
body.venta-touch-screen.touch-row-mode-v302 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v302 .bottom-menu-tab,
body.venta-touch-screen.touch-row-mode-v302 .menu-abajo-boton{display:none!important;visibility:hidden!important;pointer-events:none!important;}
body.venta-touch-screen.touch-row-mode-v302 .main,
body.venta-touch-screen.touch-row-mode-v302 main,
body.venta-touch-screen.touch-row-mode-v302 .content,
body.venta-touch-screen.touch-row-mode-v302 .container,
body.venta-touch-screen.touch-row-mode-v302 .page-content{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-session-pill{position:fixed!important;left:8px!important;top:8px!important;z-index:40000!important;height:30px!important;max-width:42vw!important;padding:0 10px!important;border-radius:999px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:11px!important;font-weight:950!important;line-height:1!important;background:#fff!important;color:#0f172a!important;box-shadow:0 6px 16px rgba(15,23,42,.14)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v302 #touchFullscreenBtn{position:fixed!important;right:8px!important;top:8px!important;z-index:40001!important;display:flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;width:auto!important;height:30px!important;min-width:34px!important;max-width:45vw!important;padding:0 10px!important;border:0!important;border-radius:999px!important;background:#0f766e!important;color:#fff!important;font-size:11px!important;font-weight:950!important;line-height:1!important;box-shadow:0 6px 16px rgba(15,23,42,.2)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;cursor:pointer!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-body{width:100%!important;max-width:none!important;margin:0!important;padding:44px var(--v302-gap) var(--v302-gap)!important;display:block!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-body-no-header{padding-top:44px!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-card,
body.venta-touch-screen.touch-row-mode-v302 .touch-body>.touch-card,
body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card{width:100%!important;max-width:none!important;margin:0 0 var(--v302-gap)!important;padding:var(--v302-pad)!important;border-radius:var(--v302-radius)!important;background:#fff!important;border:1px solid rgba(15,118,110,.16)!important;box-shadow:0 8px 22px rgba(15,23,42,.07)!important;overflow:hidden!important;position:relative!important;display:block!important;}
body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch{display:block!important;width:100%!important;margin:0!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-step-title{margin:0 0 5px!important;font-size:var(--v302-title)!important;line-height:1!important;font-weight:950!important;color:#0f172a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
/* Cabecera cliente */
body.venta-touch-screen.touch-row-mode-v302 .touch-row{display:grid!important;grid-template-columns:minmax(280px,1fr) auto!important;gap:var(--v302-gap)!important;align-items:center!important;overflow:visible!important;position:relative!important;z-index:35000!important;}
body.venta-touch-screen.touch-row-mode-v302 #touch_buscar_cliente{height:34px!important;min-height:0!important;width:100%!important;min-width:0!important;border-radius:999px!important;padding:0 12px!important;font-size:13px!important;font-weight:800!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-top-actions{display:flex!important;align-items:center!important;gap:6px!important;justify-content:flex-end!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-add-client{height:34px!important;min-height:0!important;border-radius:999px!important;padding:0 12px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:12px!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;text-decoration:none!important;}
/* Resultados cliente azul claro */
body.venta-touch-screen.touch-row-mode-v302 .touch-body>.touch-card:first-child,
body.venta-touch-screen.touch-row-mode-v302 .touch-row>div:first-child{overflow:visible!important;position:relative!important;z-index:36000!important;}
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente{position:absolute!important;left:0!important;right:0!important;top:calc(100% + 6px)!important;z-index:50000!important;max-height:min(44vh,350px)!important;overflow:auto!important;background:#eff8ff!important;border:1px solid #bae6fd!important;border-radius:14px!important;box-shadow:0 18px 45px rgba(15,23,42,.22)!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente .touch-client-empty,
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente .touch-client-item{background:#eff8ff!important;color:#0f172a!important;width:100%!important;min-height:34px!important;padding:7px 10px!important;border:0!important;border-bottom:1px solid #d7efff!important;font-size:12px!important;line-height:1.15!important;text-align:left!important;}
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente .touch-client-item{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;cursor:pointer!important;}
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente .touch-client-item:hover,
body.venta-touch-screen.touch-row-mode-v302 #touch_resultados_cliente .touch-client-item.is-selected{background:#dff3ff!important;}
/* Categorías: mini-burbujas internas ajustadas al padre */
body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(74px,1fr))!important;gap:5px!important;width:100%!important;max-height:none!important;overflow:visible!important;align-items:stretch!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category{height:var(--v302-chip-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:2px 5px!important;border-radius:10px!important;display:grid!important;grid-template-columns:clamp(14px,2.2vh,21px) minmax(0,1fr)!important;gap:4px!important;align-items:center!important;justify-items:start!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category-icon-wrap{width:clamp(14px,2.2vh,21px)!important;height:clamp(14px,2.2vh,21px)!important;min-width:0!important;min-height:0!important;border-radius:6px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category-icon{width:100%!important;height:100%!important;object-fit:contain!important;display:block!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category-icon-text{font-size:clamp(8px,1.2vh,12px)!important;line-height:1!important;font-weight:950!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category-label{min-width:0!important;max-width:100%!important;font-size:var(--v302-text)!important;line-height:1.03!important;font-weight:900!important;text-align:left!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-category.active{outline:2px solid #0f766e!important;outline-offset:-2px!important;background:#ccfbf1!important;}
/* Calibres */
body.venta-touch-screen.touch-row-mode-v302 .touch-calibres{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(58px,1fr))!important;gap:5px!important;width:100%!important;max-height:none!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-chip{height:var(--v302-chip-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 5px!important;border-radius:10px!important;font-size:var(--v302-text)!important;font-weight:900!important;line-height:1.02!important;white-space:normal!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-chip.active{outline:2px solid #0f766e!important;outline-offset:-2px!important;background:#ccfbf1!important;}
/* Fecha/autorización: compacto y centrado dentro del recuadro */
body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(155px,1fr))!important;gap:6px!important;width:100%!important;overflow:visible!important;align-items:stretch!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid>div{min-width:0!important;min-height:0!important;height:auto!important;padding:5px 7px!important;border-radius:11px!important;background:#f8fafc!important;border:1px solid #e2e8f0!important;display:grid!important;grid-template-rows:auto var(--v302-field-h)!important;gap:3px!important;align-items:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid label{font-size:var(--v302-mini)!important;line-height:1!important;font-weight:950!important;color:#334155!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid select{height:var(--v302-field-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 8px!important;border-radius:9px!important;font-size:var(--v302-text)!important;font-weight:850!important;line-height:1!important;text-align:center!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-guide-required{font-size:var(--v302-mini)!important;line-height:1!important;margin:0!important;}
/* Cantidad perfectamente centrada */
body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card:nth-of-type(4){display:grid!important;grid-template-columns:minmax(190px,.5fr) minmax(180px,1fr)!important;grid-template-areas:"title title" "qty fast" "alert alert"!important;gap:6px!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty{grid-area:qty!important;display:grid!important;grid-template-columns:34px minmax(78px,1fr) 34px!important;gap:5px!important;align-items:center!important;width:100%!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty button{width:34px!important;height:34px!important;min-height:0!important;border-radius:10px!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:20px!important;font-weight:950!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty-number{height:34px!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 4px!important;border-radius:10px!important;display:grid!important;grid-template-columns:minmax(34px,.7fr) minmax(45px,.8fr)!important;gap:3px!important;align-items:center!important;justify-items:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty-input{width:100%!important;height:28px!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;font-size:17px!important;font-weight:950!important;line-height:1!important;text-align:center!important;appearance:textfield!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty-input::-webkit-outer-spin-button,
body.venta-touch-screen.touch-row-mode-v302 .touch-qty-input::-webkit-inner-spin-button{appearance:none!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-qty-number span{font-size:var(--v302-mini)!important;font-weight:900!important;line-height:1!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(50px,1fr))!important;gap:5px!important;width:100%!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-fast button{height:34px!important;min-height:0!important;padding:0 5px!important;border-radius:10px!important;font-size:var(--v302-text)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-alert{grid-area:alert!important;margin:0!important;padding:5px 7px!important;border-radius:10px!important;font-size:var(--v302-mini)!important;line-height:1.08!important;overflow:hidden!important;}
/* Resumen / acciones */
body.venta-touch-screen.touch-row-mode-v302 .touch-summary{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))!important;gap:5px!important;width:100%!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-summary>div{min-height:34px!important;padding:5px 7px!important;border-radius:10px!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-summary span{font-size:var(--v302-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-summary strong{font-size:var(--v302-text)!important;line-height:1.05!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-actions{display:grid!important;grid-template-columns:minmax(90px,.25fr) minmax(180px,1fr)!important;gap:var(--v302-gap)!important;width:100%!important;margin:0 0 var(--v302-gap)!important;padding:0!important;position:static!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-clear,
body.venta-touch-screen.touch-row-mode-v302 .touch-save,
body.venta-touch-screen.touch-row-mode-v302 #touchWizardSubmit{display:flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;width:100%!important;height:38px!important;min-height:0!important;border-radius:12px!important;padding:0 10px!important;font-size:13px!important;font-weight:950!important;line-height:1!important;text-decoration:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#fff!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-clear{background:#b91c1c!important;}
body.venta-touch-screen.touch-row-mode-v302 .touch-save,
body.venta-touch-screen.touch-row-mode-v302 #touchWizardSubmit{background:#047857!important;}
/* Tablet normal: mantiene burbujas padre a ancho total, reduce interiores */
@media (max-width:1180px){
 body.venta-touch-screen.touch-row-mode-v302{--v302-gap:5px;--v302-pad:6px;--v302-title:10px;--v302-text:8.4px;--v302-mini:7px;--v302-chip-h:26px;--v302-field-h:26px;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-body{padding-top:40px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(54px,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(48px,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category{grid-template-columns:14px minmax(0,1fr)!important;padding:1px 4px!important;gap:3px!important;border-radius:8px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category-icon-wrap{width:14px!important;height:14px!important;border-radius:5px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid{grid-template-columns:repeat(auto-fit,minmax(128px,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:minmax(160px,.55fr) minmax(150px,1fr)!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-qty{grid-template-columns:30px minmax(74px,1fr) 30px!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-qty button,
 body.venta-touch-screen.touch-row-mode-v302 .touch-qty-number,
 body.venta-touch-screen.touch-row-mode-v302 .touch-fast button{height:30px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-qty button{width:30px!important;font-size:18px!important;}
}
@media (max-width:820px){
 body.venta-touch-screen.touch-row-mode-v302{--v302-gap:5px;--v302-pad:6px;--v302-title:10px;--v302-text:8px;--v302-mini:7px;--v302-chip-h:25px;--v302-field-h:25px;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-row{grid-template-columns:1fr!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-top-actions{justify-content:stretch!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-add-client{width:100%!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(50px,1fr))!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
 body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-actions{grid-template-columns:1fr 1.4fr!important;}
}
@media (max-width:520px){
 body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid{grid-template-columns:1fr!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-summary{grid-template-columns:1fr 1fr!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(46px,1fr))!important;}
}
@media (max-height:760px){
 body.venta-touch-screen.touch-row-mode-v302{--v302-gap:4px;--v302-pad:5px;--v302-title:9.5px;--v302-text:7.7px;--v302-mini:6.8px;--v302-chip-h:24px;--v302-field-h:24px;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-body{padding-top:38px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-card,
 body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch>.touch-card{margin-bottom:4px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-step-title{margin-bottom:3px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(50px,1fr))!important;gap:3px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-calibres{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))!important;gap:3px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid{gap:3px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-form-grid>div{padding:3px 5px!important;gap:2px!important;}
 body.venta-touch-screen.touch-row-mode-v302 .touch-actions .touch-clear,
 body.venta-touch-screen.touch-row-mode-v302 .touch-actions #touchWizardSubmit{height:32px!important;font-size:11px!important;}
}


/* =========================================================
   V303 - Venta touch: una fila compacta por sección, contenido interno ajustado
   Objetivo: PC/tablet/móvil legible, sin solapes y sin burbujas internas gigantes.
   ========================================================= */
body.venta-touch-screen.touch-row-mode-v303{
  --v303-gap:clamp(5px,.55vw,9px);
  --v303-pad:clamp(5px,.55vw,9px);
  --v303-radius:14px;
  --v303-title:clamp(11px,.78vw,15px);
  --v303-text:clamp(10px,.68vw,13px);
  --v303-mini:clamp(7px,.52vw,10px);
  --v303-chip-h:clamp(34px,5.2vh,48px);
  --v303-field-h:clamp(30px,4.6vh,40px);
  background:#eef3f5!important;
  overflow:auto!important;
  min-height:100dvh!important;
}
body.venta-touch-screen.touch-row-mode-v303 *{box-sizing:border-box!important;}
body.venta-touch-screen.touch-row-mode-v303 .admin-quick-actions,
body.venta-touch-screen.touch-row-mode-v303 .venta-11-screen,
body.venta-touch-screen.touch-row-mode-v303 #touchWizardPrev,
body.venta-touch-screen.touch-row-mode-v303 #touchWizardNext,
body.venta-touch-screen.touch-row-mode-v303 .touch-wizard-prev,
body.venta-touch-screen.touch-row-mode-v303 .touch-wizard-next,
body.venta-touch-screen.touch-row-mode-v303 .touch-wizard-nav,
body.venta-touch-screen.touch-row-mode-v303 .bottom-open-menu-button,
body.venta-touch-screen.touch-row-mode-v303 .bottom-menu-tab,
body.venta-touch-screen.touch-row-mode-v303 .menu-abajo-boton{display:none!important;visibility:hidden!important;pointer-events:none!important;}
body.venta-touch-screen.touch-row-mode-v303 .main,
body.venta-touch-screen.touch-row-mode-v303 main,
body.venta-touch-screen.touch-row-mode-v303 .content,
body.venta-touch-screen.touch-row-mode-v303 .container,
body.venta-touch-screen.touch-row-mode-v303 .page-content{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-session-pill{position:fixed!important;left:8px!important;top:8px!important;z-index:50000!important;height:30px!important;max-width:36vw!important;padding:0 10px!important;border-radius:999px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:11px!important;font-weight:950!important;background:#fff!important;color:#0f172a!important;box-shadow:0 8px 22px rgba(15,23,42,.16)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v303 #touchFullscreenBtn{position:fixed!important;right:8px!important;top:8px!important;z-index:50001!important;display:flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;height:30px!important;min-width:34px!important;max-width:42vw!important;padding:0 10px!important;border:0!important;border-radius:999px!important;background:#0f766e!important;color:#fff!important;font-size:11px!important;font-weight:950!important;line-height:1!important;box-shadow:0 8px 22px rgba(15,23,42,.2)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;cursor:pointer!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-body{width:100%!important;max-width:none!important;margin:0!important;padding:42px var(--v303-gap) var(--v303-gap)!important;display:block!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch{display:block!important;width:100%!important;margin:0!important;padding:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-card,
body.venta-touch-screen.touch-row-mode-v303 .touch-body>.touch-card,
body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card{width:100%!important;max-width:none!important;margin:0 0 var(--v303-gap)!important;padding:var(--v303-pad)!important;border-radius:var(--v303-radius)!important;background:#fff!important;border:1px solid rgba(15,118,110,.18)!important;box-shadow:0 8px 18px rgba(15,23,42,.07)!important;overflow:hidden!important;position:relative!important;display:block!important;min-height:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-step-title{margin:0 0 5px!important;font-size:var(--v303-title)!important;line-height:1!important;font-weight:950!important;color:#0f172a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
/* Cabecera cliente */
body.venta-touch-screen.touch-row-mode-v303 .touch-row{display:grid!important;grid-template-columns:minmax(220px,1fr) auto!important;gap:var(--v303-gap)!important;align-items:center!important;position:relative!important;z-index:36000!important;overflow:visible!important;}
body.venta-touch-screen.touch-row-mode-v303 #touch_buscar_cliente{height:34px!important;width:100%!important;min-width:0!important;border-radius:999px!important;padding:0 12px!important;font-size:13px!important;font-weight:850!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-top-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-add-client{height:34px!important;border-radius:999px!important;padding:0 12px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:12px!important;font-weight:950!important;white-space:nowrap!important;text-decoration:none!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-body>.touch-card:first-child,
body.venta-touch-screen.touch-row-mode-v303 .touch-row>div:first-child{overflow:visible!important;position:relative!important;z-index:37000!important;}
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente{position:absolute!important;left:0!important;right:0!important;top:calc(100% + 5px)!important;z-index:60000!important;max-height:min(48vh,360px)!important;overflow:auto!important;background:#eff8ff!important;border:1px solid #bae6fd!important;border-radius:14px!important;box-shadow:0 20px 45px rgba(15,23,42,.22)!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente .touch-client-empty,
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente .touch-client-item{background:#eff8ff!important;color:#0f172a!important;width:100%!important;min-height:34px!important;padding:7px 10px!important;border:0!important;border-bottom:1px solid #d7efff!important;font-size:12px!important;line-height:1.15!important;text-align:left!important;}
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente .touch-client-item{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;cursor:pointer!important;}
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente .touch-client-item:hover,
body.venta-touch-screen.touch-row-mode-v303 #touch_resultados_cliente .touch-client-item.is-selected{background:#dff3ff!important;}
/* 1. Categoría: una fila compacta en PC/tablet. Icono pequeño + texto centrado */
body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(115px,1fr))!important;gap:6px!important;width:100%!important;align-items:stretch!important;overflow:visible!important;max-height:none!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category{height:var(--v303-chip-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:3px 7px!important;border-radius:12px!important;display:grid!important;grid-template-columns:22px minmax(0,1fr)!important;gap:6px!important;align-items:center!important;justify-items:stretch!important;overflow:hidden!important;background:#f3fffb!important;border:1px solid #b7eee4!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon-wrap{width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;border-radius:6px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;background:rgba(16,185,129,.08)!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important;object-fit:contain!important;display:block!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon-text{font-size:16px!important;line-height:1!important;font-weight:950!important;display:block!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category-label{min-width:0!important;max-width:100%!important;font-size:var(--v303-text)!important;line-height:1.05!important;font-weight:950!important;text-align:center!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;overflow:hidden!important;overflow-wrap:anywhere!important;white-space:normal!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-category.active{outline:2px solid #0f766e!important;outline-offset:-2px!important;background:#ccfbf1!important;}
/* 2. Calibres: misma lógica, fila de chips pequeños */
body.venta-touch-screen.touch-row-mode-v303 .touch-calibres{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(90px,1fr))!important;gap:6px!important;width:100%!important;overflow:visible!important;max-height:none!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-chip{height:var(--v303-chip-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 7px!important;border-radius:12px!important;font-size:var(--v303-text)!important;font-weight:950!important;line-height:1.05!important;white-space:normal!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;overflow:hidden!important;overflow-wrap:anywhere!important;background:#fff!important;border:1px solid #d7e2ea!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-chip.active{outline:2px solid #0f766e!important;outline-offset:-2px!important;background:#ccfbf1!important;}
/* 3. Fecha/autorización: todo dentro de sus mini-recuadros */
body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:6px!important;width:100%!important;overflow:visible!important;align-items:stretch!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid>div{min-width:0!important;min-height:0!important;height:auto!important;padding:5px 7px!important;border-radius:12px!important;background:#f8fafc!important;border:1px solid #d7e2ea!important;display:grid!important;grid-template-rows:auto var(--v303-field-h)!important;gap:3px!important;align-items:center!important;overflow:hidden!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid label{font-size:var(--v303-mini)!important;line-height:1!important;font-weight:950!important;color:#334155!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid input,
body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid select{height:var(--v303-field-h)!important;min-height:0!important;width:100%!important;min-width:0!important;padding:0 8px!important;border-radius:10px!important;font-size:var(--v303-text)!important;font-weight:850!important;line-height:1!important;text-align:center!important;overflow:hidden!important;text-overflow:ellipsis!important;background:#fff!important;}
/* 4. Cantidad: número exactamente centrado entre - y +, atajos alineados */
body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card:nth-of-type(4){display:grid!important;grid-template-columns:minmax(190px,260px) minmax(240px,1fr)!important;grid-template-areas:"title title" "qty fast" "alert alert"!important;gap:6px!important;align-items:center!important;}
body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card:nth-of-type(4) .touch-step-title{grid-area:title!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty{grid-area:qty!important;display:grid!important;grid-template-columns:34px minmax(76px,1fr) 34px!important;gap:6px!important;align-items:center!important;justify-items:center!important;width:100%!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty button{width:34px!important;height:34px!important;min-height:0!important;border-radius:10px!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:20px!important;font-weight:950!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty-number{height:34px!important;min-height:0!important;width:100%!important;min-width:0!important;padding:2px 4px!important;border-radius:10px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:0!important;overflow:hidden!important;background:#fff!important;border:1px solid #d7e2ea!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty-input{width:100%!important;height:18px!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;font-size:18px!important;font-weight:950!important;line-height:18px!important;text-align:center!important;appearance:textfield!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty-input::-webkit-outer-spin-button,
body.venta-touch-screen.touch-row-mode-v303 .touch-qty-input::-webkit-inner-spin-button{appearance:none!important;margin:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-qty-number span{display:block!important;width:100%!important;font-size:8px!important;font-weight:900!important;line-height:10px!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-fast{grid-area:fast!important;display:grid!important;grid-template-columns:repeat(3,minmax(70px,1fr))!important;gap:6px!important;width:100%!important;min-width:0!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-fast button{height:34px!important;min-height:0!important;padding:0 7px!important;border-radius:10px!important;font-size:var(--v303-text)!important;font-weight:950!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-alert{grid-area:alert!important;margin:0!important;padding:5px 7px!important;border-radius:10px!important;font-size:var(--v303-mini)!important;line-height:1.08!important;overflow:hidden!important;}
/* Resumen y acciones */
body.venta-touch-screen.touch-row-mode-v303 .touch-summary{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(130px,1fr))!important;gap:6px!important;width:100%!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-summary>div{min-height:34px!important;padding:5px 7px!important;border-radius:10px!important;overflow:hidden!important;background:#f8fafc!important;border:1px solid #d7e2ea!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-summary span{font-size:var(--v303-mini)!important;line-height:1!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-summary strong{font-size:var(--v303-text)!important;line-height:1.05!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;overflow-wrap:anywhere!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-actions{display:grid!important;grid-template-columns:minmax(100px,.28fr) minmax(220px,1fr)!important;gap:var(--v303-gap)!important;width:100%!important;margin:0 0 var(--v303-gap)!important;padding:0!important;position:static!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-clear,
body.venta-touch-screen.touch-row-mode-v303 .touch-save,
body.venta-touch-screen.touch-row-mode-v303 #touchWizardSubmit{display:flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;width:100%!important;height:38px!important;min-height:0!important;border-radius:12px!important;padding:0 10px!important;font-size:13px!important;font-weight:950!important;line-height:1!important;text-decoration:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#fff!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-clear{background:#b91c1c!important;}
body.venta-touch-screen.touch-row-mode-v303 .touch-save,
body.venta-touch-screen.touch-row-mode-v303 #touchWizardSubmit{background:#047857!important;}
/* Tablet: fuerza categorías en una fila si hay ancho mínimo; reduce altura y texto */
@media (min-width:700px) and (max-width:1180px){
 body.venta-touch-screen.touch-row-mode-v303{--v303-gap:5px;--v303-pad:6px;--v303-title:11px;--v303-text:9px;--v303-mini:7px;--v303-chip-h:34px;--v303-field-h:30px;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-body{padding-top:39px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid{grid-template-columns:repeat(auto-fit,minmax(100px,1fr))!important;gap:5px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category{grid-template-columns:18px minmax(0,1fr)!important;padding:2px 5px!important;gap:4px!important;border-radius:10px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon-wrap{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon{width:16px!important;height:16px!important;max-width:16px!important;max-height:16px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-icon-text{font-size:13px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid{grid-template-columns:repeat(auto-fit,minmax(128px,1fr))!important;gap:5px!important;}
 body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:minmax(170px,230px) minmax(210px,1fr)!important;gap:5px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-qty{grid-template-columns:30px minmax(72px,1fr) 30px!important;gap:5px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-qty button,
 body.venta-touch-screen.touch-row-mode-v303 .touch-qty-number,
 body.venta-touch-screen.touch-row-mode-v303 .touch-fast button{height:30px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-qty button{width:30px!important;font-size:18px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-qty-input{font-size:16px!important;height:16px!important;line-height:16px!important;}
}
/* Móvil: mismo diseño, pero permite 2 columnas para no romper lectura */
@media (max-width:699px){
 body.venta-touch-screen.touch-row-mode-v303{--v303-gap:5px;--v303-pad:6px;--v303-title:10.5px;--v303-text:8.5px;--v303-mini:7px;--v303-chip-h:32px;--v303-field-h:28px;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-row{grid-template-columns:1fr!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-top-actions{justify-content:stretch!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-add-client{width:100%!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-calibres{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card:nth-of-type(4){grid-template-columns:1fr!important;grid-template-areas:"title" "qty" "fast" "alert"!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-actions{grid-template-columns:1fr 1.4fr!important;}
}
@media (max-width:420px){
 body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid{grid-template-columns:1fr!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-summary{grid-template-columns:1fr 1fr!important;}
}
@media (max-height:760px){
 body.venta-touch-screen.touch-row-mode-v303{--v303-gap:4px;--v303-pad:5px;--v303-title:10px;--v303-text:8.5px;--v303-mini:7px;--v303-chip-h:30px;--v303-field-h:28px;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-body{padding-top:38px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-card,
 body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch>.touch-card{margin-bottom:4px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-step-title{margin-bottom:3px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid,
 body.venta-touch-screen.touch-row-mode-v303 .touch-calibres{gap:4px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-form-grid>div{padding:3px 5px!important;gap:2px!important;}
 body.venta-touch-screen.touch-row-mode-v303 .touch-actions .touch-clear,
 body.venta-touch-screen.touch-row-mode-v303 .touch-actions #touchWizardSubmit{height:32px!important;font-size:11px!important;}
}


/* ===== V304 - CATEGORIAS ULTRA COMPACTAS EN UNA SOLA FILA ===== */
body.venta-touch-screen.touch-row-mode-v304{
  --v304-cat-h: clamp(38px, 6.2vh, 54px);
  --v304-cat-icon: clamp(14px, 2.1vh, 20px);
  --v304-cat-text: clamp(7px, .62vw, 11px);
}

body.venta-touch-screen.touch-row-mode-v304 .touch-card:has(.touch-category-grid){
  padding-top: clamp(6px, .8vh, 10px)!important;
  padding-bottom: clamp(7px, .9vh, 11px)!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-card:has(.touch-category-grid) .touch-card-title{
  margin-bottom: clamp(4px, .5vh, 7px)!important;
  font-size: clamp(13px, 1.05vw, 19px)!important;
  line-height:1.05!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:clamp(3px,.42vw,7px)!important;
  width:100%!important;
  max-height:none!important;
  overflow:visible!important;
  align-items:stretch!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category{
  height:var(--v304-cat-h)!important;
  min-height:0!important;
  width:100%!important;
  min-width:0!important;
  padding:clamp(2px,.35vh,4px) clamp(3px,.45vw,6px)!important;
  border-radius:clamp(8px,.8vw,12px)!important;
  display:grid!important;
  grid-template-columns:var(--v304-cat-icon) minmax(0,1fr)!important;
  gap:clamp(2px,.35vw,5px)!important;
  align-items:center!important;
  justify-items:stretch!important;
  overflow:hidden!important;
  background:#f3fffb!important;
  border:1px solid #b7eee4!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category-icon-wrap{
  width:var(--v304-cat-icon)!important;
  height:var(--v304-cat-icon)!important;
  min-width:var(--v304-cat-icon)!important;
  min-height:var(--v304-cat-icon)!important;
  border-radius:5px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:rgba(16,185,129,.08)!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category-icon{
  width:calc(var(--v304-cat-icon) - 2px)!important;
  height:calc(var(--v304-cat-icon) - 2px)!important;
  max-width:calc(var(--v304-cat-icon) - 2px)!important;
  max-height:calc(var(--v304-cat-icon) - 2px)!important;
  object-fit:contain!important;
  display:block!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category-icon-text{
  font-size:clamp(8px, .8vw, 13px)!important;
  line-height:1!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category-label{
  min-width:0!important;
  max-width:100%!important;
  font-size:var(--v304-cat-text)!important;
  line-height:1!important;
  font-weight:950!important;
  text-align:center!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  white-space:normal!important;
}

body.venta-touch-screen.touch-row-mode-v304 .touch-category.active,
body.venta-touch-screen.touch-row-mode-v304 .touch-category.is-selected{
  outline:2px solid #0f766e!important;
  outline-offset:-2px!important;
  background:#ccfbf1!important;
}

/* En pantallas estrechas mantenemos una sola fila; se reduce todo más */
@media (max-width:900px){
  body.venta-touch-screen.touch-row-mode-v304{
    --v304-cat-h: clamp(34px, 5.8vh, 46px);
    --v304-cat-icon: clamp(12px, 2vh, 17px);
    --v304-cat-text: clamp(6px, 1.15vw, 9px);
  }
  body.venta-touch-screen.touch-row-mode-v304 .touch-category-grid{gap:3px!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;}
  body.venta-touch-screen.touch-row-mode-v304 .touch-category{padding:1px 2px!important;gap:2px!important;border-radius:7px!important;}
}

@media (max-width:520px){
  body.venta-touch-screen.touch-row-mode-v304{
    --v304-cat-h: 32px;
    --v304-cat-icon: 11px;
    --v304-cat-text: 5.8px;
  }
  body.venta-touch-screen.touch-row-mode-v304 .touch-category-grid{gap:2px!important;}
  body.venta-touch-screen.touch-row-mode-v304 .touch-category{grid-template-columns:11px minmax(0,1fr)!important;padding:1px!important;}
  body.venta-touch-screen.touch-row-mode-v304 .touch-category-label{-webkit-line-clamp:2!important;letter-spacing:-.25px!important;}
}

/* Cantidad: mantener centrado y compacto */
body.venta-touch-screen.touch-row-mode-v304 .touch-qty-row,
body.venta-touch-screen.touch-row-mode-v304 .qty-wrap,
body.venta-touch-screen.touch-row-mode-v304 .touch-quantity-row{
  align-items:center!important;
}
body.venta-touch-screen.touch-row-mode-v304 .qty-display,
body.venta-touch-screen.touch-row-mode-v304 .touch-qty-display,
body.venta-touch-screen.touch-row-mode-v304 .cantidad-display{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1!important;
}

/* ===== V305 - fullscreen solo tablet/móvil, botón discreto y sin PC ===== */
body.venta-touch-screen.touch-row-mode-v305 .touch-fullscreen-btn{
  position:fixed!important;
  right:8px!important;
  top:8px!important;
  z-index:9999!important;
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  min-height:34px!important;
  padding:0!important;
  border-radius:999px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  line-height:1!important;
  background:rgba(15,118,110,.88)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.65)!important;
  box-shadow:0 3px 10px rgba(15,23,42,.16)!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  opacity:.88!important;
}
@media (hover:hover) and (pointer:fine) and (min-width:1025px){
  body.venta-touch-screen.touch-row-mode-v305 .touch-fullscreen-btn{display:none!important;visibility:hidden!important;pointer-events:none!important;}
}
@media (max-width:1024px), (pointer:coarse){
  body.venta-touch-screen.touch-row-mode-v305 .touch-fullscreen-btn{display:flex!important;visibility:visible!important;}
  body.venta-touch-screen.touch-row-mode-v305 .touch-top-actions{padding-right:38px!important;}
}

/* ===== V306 - CATEGORÍAS 6 EN UNA SOLA FILA + FULLSCREEN V305 =====
   Objetivo: mantener burbuja padre a ancho completo y meter TODO su contenido
   interno en una fila compacta, similar al bloque de fecha/autorización. */
body.venta-touch-screen.touch-row-mode-v306 .touch-card:has(.touch-category-grid){
  width:100%!important;
  padding:6px 10px 10px 10px!important;
  margin-bottom:8px!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-card:has(.touch-category-grid) .touch-step-title{
  font-size:clamp(12px,1.05vw,18px)!important;
  line-height:1.05!important;
  margin:0 0 5px 0!important;
  padding:0!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  grid-auto-flow:column!important;
  grid-auto-columns:minmax(0,1fr)!important;
  gap:clamp(3px,.45vw,8px)!important;
  width:100%!important;
  max-width:100%!important;
  max-height:none!important;
  overflow:visible!important;
  align-items:stretch!important;
  justify-content:stretch!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid > .touch-category{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:clamp(34px,5.2vh,48px)!important;
  min-height:0!important;
  max-height:52px!important;
  padding:2px clamp(3px,.45vw,7px)!important;
  border-radius:10px!important;
  display:grid!important;
  grid-template-columns:clamp(14px,1.6vw,22px) minmax(0,1fr)!important;
  gap:clamp(2px,.35vw,6px)!important;
  align-items:center!important;
  justify-items:center!important;
  overflow:hidden!important;
  background:#f3fffb!important;
  border:1px solid #b7eee4!important;
  box-shadow:none!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-wrap{
  width:clamp(14px,1.6vw,22px)!important;
  height:clamp(14px,1.6vw,22px)!important;
  min-width:0!important;
  min-height:0!important;
  border-radius:5px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:rgba(16,185,129,.08)!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  display:block!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-text{
  font-size:clamp(9px,1vw,15px)!important;
  line-height:1!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100%!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category-label{
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  font-size:clamp(6.5px,.78vw,12px)!important;
  line-height:1.02!important;
  font-weight:950!important;
  text-align:center!important;
  white-space:normal!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  letter-spacing:-.1px!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-category.active,
body.venta-touch-screen.touch-row-mode-v306 .touch-category.is-selected{
  outline:2px solid #0f766e!important;
  outline-offset:-2px!important;
  background:#ccfbf1!important;
}
/* Tablet: mantener 6 columnas sí o sí, bajando tamaño interno */
@media (max-width:1024px){
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:3px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid > .touch-category{height:36px!important;padding:1px 2px!important;border-radius:8px!important;grid-template-columns:13px minmax(0,1fr)!important;gap:2px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-wrap{width:13px!important;height:13px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-label{font-size:clamp(5.8px,1.05vw,8.8px)!important;line-height:1!important;letter-spacing:-.25px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-text{font-size:9px!important;}
}
@media (max-width:620px){
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:2px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid > .touch-category{height:32px!important;grid-template-columns:10px minmax(0,1fr)!important;padding:1px!important;gap:1px!important;border-radius:7px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-wrap{width:10px!important;height:10px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-label{font-size:5.6px!important;line-height:.98!important;letter-spacing:-.35px!important;}
  body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-text{font-size:7px!important;}
}
/* Cantidad V306: número/unidades centrados entre - y + */
body.venta-touch-screen.touch-row-mode-v306 .touch-qty{
  display:grid!important;
  grid-template-columns:42px minmax(78px,110px) 42px!important;
  align-items:center!important;
  justify-content:start!important;
  gap:8px!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-qty-number{
  height:38px!important;
  min-width:78px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  gap:0!important;
  padding:2px 6px!important;
  overflow:hidden!important;
}
body.venta-touch-screen.touch-row-mode-v306 .touch-qty-input{
  width:100%!important;
  height:20px!important;
  line-height:20px!important;
  text-align:center!important;
  font-size:20px!important;
  font-weight:950!important;
  padding:0!important;
  margin:0!important;
}
body.venta-touch-screen.touch-row-mode-v306 #unidadVisual{
  display:block!important;
  width:100%!important;
  text-align:center!important;
  font-size:9px!important;
  line-height:10px!important;
  margin:0!important;
  white-space:nowrap!important;
}

/* ============================================================
   V308 - Corrección real usuario: categorías SIEMPRE en una fila,
   fullscreen oculto en PC, menú superior visible.
   ============================================================ */
body.venta-touch-screen #menuToggle,
body.venta-touch-screen .menu-toggle{
  position:fixed!important;
  top:8px!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  transform:translateX(-50%)!important;
  width:42px!important;
  height:34px!important;
  min-width:42px!important;
  min-height:34px!important;
  max-width:42px!important;
  max-height:34px!important;
  border-radius:999px!important;
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  font-size:20px!important;
  line-height:1!important;
  z-index:100050!important;
  background:#111827!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(0,0,0,.22)!important;
}
body.venta-touch-screen.menu-open #menuToggle,
body.venta-touch-screen.menu-open .menu-toggle{
  left:50%!important;
  transform:translateX(-50%)!important;
}
body.venta-touch-screen .menu-abajo-boton,
body.venta-touch-screen .bottom-open-menu-button,
body.venta-touch-screen .bottom-menu-tab{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
/* Fullscreen: oculto completamente en PC; solo aparece en tablet/móvil táctil */
@media (min-width:1025px){
  body.venta-touch-screen .touch-fullscreen-btn,
  body.venta-touch-screen #touchFullscreenBtn{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
}
@media (hover:hover) and (pointer:fine){
  body.venta-touch-screen .touch-fullscreen-btn,
  body.venta-touch-screen #touchFullscreenBtn{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
}
@media (max-width:1024px), (pointer:coarse){
  body.venta-touch-screen .touch-fullscreen-btn,
  body.venta-touch-screen #touchFullscreenBtn{
    position:fixed!important;
    top:8px!important;
    right:8px!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
    padding:0!important;
    border-radius:999px!important;
    display:flex!important;
    visibility:visible!important;
    opacity:.88!important;
    pointer-events:auto!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:0!important;
    overflow:hidden!important;
    z-index:100040!important;
    background:#0f766e!important;
    color:#fff!important;
  }
  body.venta-touch-screen .touch-fullscreen-btn::before,
  body.venta-touch-screen #touchFullscreenBtn::before{
    content:'⛶';
    font-size:18px!important;
    line-height:1!important;
  }
}
/* La burbuja padre de categoría usa todo el ancho pero poca altura */
body.venta-touch-screen #formVentaTouch > .touch-card:nth-of-type(1),
body.venta-touch-screen .touch-card:has(.touch-category-grid){
  width:100%!important;
  max-width:100%!important;
  padding:6px 8px 8px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-card:has(.touch-category-grid) .touch-step-title{
  font-size:clamp(11px,1vw,15px)!important;
  line-height:1!important;
  margin:0 0 4px!important;
  padding:0!important;
}
/* Categorías: una fila física, sin grid viejo de 2x3 */
body.venta-touch-screen .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v305 .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v304 .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid,
body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  grid-template-columns:none!important;
  grid-auto-flow:unset!important;
  grid-auto-columns:unset!important;
  grid-auto-rows:unset!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  max-height:46px!important;
  gap:clamp(2px,.45vw,6px)!important;
  padding:0!important;
  margin:0!important;
  overflow-x:hidden!important;
  overflow-y:hidden!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-category-grid > .touch-category,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-grid > .touch-category,
body.venta-touch-screen.touch-row-mode-v305 .touch-category-grid > .touch-category,
body.venta-touch-screen.touch-row-mode-v304 .touch-category-grid > .touch-category,
body.venta-touch-screen.touch-row-mode-v303 .touch-category-grid > .touch-category,
body.venta-touch-screen.touch-row-mode-v302 .touch-category-grid > .touch-category{
  flex:1 1 0!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:clamp(30px,4.7vh,42px)!important;
  min-height:0!important;
  max-height:42px!important;
  padding:1px clamp(1px,.35vw,5px)!important;
  border-radius:clamp(6px,.75vw,10px)!important;
  display:grid!important;
  grid-template-columns:clamp(11px,1.35vw,18px) minmax(0,1fr)!important;
  gap:clamp(1px,.3vw,4px)!important;
  align-items:center!important;
  justify-items:center!important;
  text-align:center!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  line-height:1!important;
}
body.venta-touch-screen .touch-category-icon-wrap,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-wrap{
  width:clamp(11px,1.35vw,18px)!important;
  height:clamp(11px,1.35vw,18px)!important;
  min-width:clamp(11px,1.35vw,18px)!important;
  min-height:clamp(11px,1.35vw,18px)!important;
  max-width:18px!important;
  max-height:18px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  border-radius:4px!important;
}
body.venta-touch-screen .touch-category-icon,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  margin:0!important;
  display:block!important;
}
body.venta-touch-screen .touch-category-icon-text,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-icon-text{
  font-size:clamp(7px,.9vw,12px)!important;
  line-height:1!important;
  margin:0!important;
  font-weight:950!important;
}
body.venta-touch-screen .touch-category-label,
body.venta-touch-screen.touch-row-mode-v306 .touch-category-label{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  font-size:clamp(5.4px,.78vw,10px)!important;
  line-height:1!important;
  font-weight:950!important;
  text-align:center!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  letter-spacing:-.18px!important;
}
@media (max-width:700px){
  body.venta-touch-screen .touch-category-grid{gap:2px!important;max-height:36px!important;}
  body.venta-touch-screen .touch-category-grid > .touch-category{
    height:32px!important;
    max-height:32px!important;
    grid-template-columns:9px minmax(0,1fr)!important;
    padding:1px!important;
    gap:1px!important;
    border-radius:6px!important;
  }
  body.venta-touch-screen .touch-category-icon-wrap{width:9px!important;height:9px!important;min-width:9px!important;min-height:9px!important;}
  body.venta-touch-screen .touch-category-label{font-size:5.1px!important;line-height:.96!important;letter-spacing:-.25px!important;}
  body.venta-touch-screen .touch-category-icon-text{font-size:6px!important;}
}
/* Cantidad centrada, por si reglas anteriores vuelven a empujar las unidades */
body.venta-touch-screen .touch-qty{
  display:grid!important;
  grid-template-columns:42px minmax(80px,110px) 42px!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:100%!important;
}
body.venta-touch-screen .touch-qty-number{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  min-width:80px!important;
  max-width:110px!important;
  height:42px!important;
  padding:2px 4px!important;
  overflow:hidden!important;
}
body.venta-touch-screen .touch-qty-input{
  width:100%!important;
  height:24px!important;
  line-height:24px!important;
  text-align:center!important;
  padding:0!important;
  margin:0!important;
  font-size:20px!important;
  font-weight:950!important;
}
body.venta-touch-screen #unidadVisual,
body.venta-touch-screen .touch-qty-number span{
  width:100%!important;
  text-align:center!important;
  display:block!important;
  font-size:9px!important;
  line-height:10px!important;
  margin:0!important;
  white-space:nowrap!important;
}


/* ===== V309 DEFINITIVO - venta_touch: PC sin fullscreen y categorías 1 fila real ===== */
body.venta-touch-screen.v309-final #touchFullscreenBtn,
body.venta-touch-screen.v309-final .touch-fullscreen-btn{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important;}
body.venta-touch-screen.v309-final.v309-mobile-device #touchFullscreenBtn,
body.venta-touch-screen.v309-final.v309-mobile-device .touch-fullscreen-btn{display:flex!important;visibility:visible!important;opacity:.88!important;pointer-events:auto!important;position:fixed!important;top:8px!important;right:8px!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;padding:0!important;border-radius:999px!important;z-index:2147483000!important;align-items:center!important;justify-content:center!important;font-size:0!important;overflow:hidden!important;background:#0f766e!important;color:#fff!important;border:0!important;}
body.venta-touch-screen.v309-final.v309-mobile-device #touchFullscreenBtn::before{content:'⛶';font-size:18px!important;line-height:1!important;}
body.venta-touch-screen.v309-final .touch-card:has(.touch-category-grid),
body.venta-touch-screen.v309-final #formVentaTouch > .touch-card:nth-of-type(1){width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important;padding:6px 8px 8px!important;margin-bottom:8px!important;}
body.venta-touch-screen.v309-final .touch-card:has(.touch-category-grid) .touch-step-title,
body.venta-touch-screen.v309-final #formVentaTouch > .touch-card:nth-of-type(1) .touch-step-title{font-size:clamp(11px,1vw,15px)!important;line-height:1!important;margin:0 0 5px!important;padding:0!important;}
body.venta-touch-screen.v309-final .touch-category-grid,
body.venta-touch-screen.v309-final #formVentaTouch .touch-card .touch-category-grid{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;grid-template-columns:none!important;grid-template-rows:none!important;grid-auto-flow:unset!important;width:100%!important;max-width:100%!important;min-width:0!important;height:clamp(30px,4.6vh,42px)!important;min-height:30px!important;max-height:42px!important;gap:clamp(2px,.45vw,6px)!important;padding:0!important;margin:0!important;overflow:hidden!important;align-items:stretch!important;justify-content:space-between!important;box-sizing:border-box!important;}
body.venta-touch-screen.v309-final .touch-category-grid > .touch-category,
body.venta-touch-screen.v309-final #formVentaTouch .touch-category-grid > button.touch-category{flex:1 1 0!important;display:grid!important;grid-template-columns:clamp(10px,1.25vw,17px) minmax(0,1fr)!important;align-items:center!important;justify-items:center!important;gap:clamp(1px,.3vw,4px)!important;width:auto!important;min-width:0!important;max-width:none!important;height:100%!important;min-height:0!important;max-height:42px!important;padding:1px clamp(1px,.35vw,5px)!important;border-radius:clamp(6px,.75vw,10px)!important;box-sizing:border-box!important;overflow:hidden!important;text-align:center!important;line-height:1!important;white-space:normal!important;}
body.venta-touch-screen.v309-final .touch-category-icon-wrap{width:clamp(10px,1.25vw,17px)!important;height:clamp(10px,1.25vw,17px)!important;min-width:clamp(10px,1.25vw,17px)!important;min-height:clamp(10px,1.25vw,17px)!important;max-width:17px!important;max-height:17px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;margin:0!important;}
body.venta-touch-screen.v309-final .touch-category-icon{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;margin:0!important;display:block!important;}
body.venta-touch-screen.v309-final .touch-category-icon-text{font-size:clamp(7px,.9vw,12px)!important;line-height:1!important;margin:0!important;font-weight:950!important;}
body.venta-touch-screen.v309-final .touch-category-label{display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:clip!important;overflow-wrap:anywhere!important;word-break:normal!important;white-space:normal!important;font-size:clamp(5.2px,.72vw,9.5px)!important;line-height:.98!important;font-weight:950!important;text-align:center!important;letter-spacing:-.2px!important;margin:0!important;}
@media (max-width:700px){body.venta-touch-screen.v309-final .touch-category-grid{height:32px!important;min-height:32px!important;max-height:32px!important;gap:2px!important;}body.venta-touch-screen.v309-final .touch-category-grid>.touch-category{grid-template-columns:9px minmax(0,1fr)!important;padding:1px!important;gap:1px!important;border-radius:6px!important;}body.venta-touch-screen.v309-final .touch-category-icon-wrap{width:9px!important;height:9px!important;min-width:9px!important;min-height:9px!important;}body.venta-touch-screen.v309-final .touch-category-label{font-size:5px!important;line-height:.95!important;letter-spacing:-.3px!important;}body.venta-touch-screen.v309-final .touch-category-icon-text{font-size:6px!important;}}
body.venta-touch-screen.v309-final .menu-abajo-boton,
body.venta-touch-screen.v309-final .bottom-open-menu-button,
body.venta-touch-screen.v309-final .bottom-menu-tab{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important;}


/* ===== V310 FINAL REAL: sin pantalla completa y categoría una fila compacta visible ===== */
body.venta-touch-screen.v310-final #touchFullscreenBtn,
body.venta-touch-screen.v310-final .touch-fullscreen-btn,
body.venta-touch-screen #touchFullscreenBtn,
body.venta-touch-screen .touch-fullscreen-btn{
  display:none!important; visibility:hidden!important; opacity:0!important; pointer-events:none!important; width:0!important; height:0!important; min-width:0!important; min-height:0!important; padding:0!important; margin:0!important; overflow:hidden!important;
}
body.venta-touch-screen.v310-final #formVentaTouch > .touch-card:nth-of-type(1),
body.venta-touch-screen.v310-final .touch-card:has(.touch-category-grid){
  width:100%!important; max-width:100%!important; height:auto!important; min-height:0!important; max-height:none!important; padding:6px 8px 8px!important; margin-bottom:8px!important; overflow:hidden!important; box-sizing:border-box!important;
}
body.venta-touch-screen.v310-final #formVentaTouch > .touch-card:nth-of-type(1) .touch-step-title,
body.venta-touch-screen.v310-final .touch-card:has(.touch-category-grid) .touch-step-title{
  height:16px!important; min-height:16px!important; max-height:16px!important; line-height:16px!important; margin:0 0 5px!important; padding:0!important; font-size:clamp(12px,1vw,15px)!important; overflow:hidden!important;
}
body.venta-touch-screen.v310-final .touch-category-grid,
body.venta-touch-screen.v310-final #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid{
  display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important; grid-template-columns:none!important; grid-template-rows:none!important; grid-auto-flow:unset!important; grid-auto-rows:unset!important; width:100%!important; max-width:100%!important; min-width:0!important; height:46px!important; min-height:46px!important; max-height:46px!important; gap:6px!important; padding:0!important; margin:0!important; overflow:hidden!important; align-items:stretch!important; justify-content:space-between!important; box-sizing:border-box!important;
}
body.venta-touch-screen.v310-final .touch-category-grid > .touch-category,
body.venta-touch-screen.v310-final #formVentaTouch > .touch-card:nth-of-type(1) .touch-category-grid > button.touch-category{
  flex:1 1 0!important; width:auto!important; min-width:0!important; max-width:none!important; height:46px!important; min-height:46px!important; max-height:46px!important; display:flex!important; flex-direction:row!important; align-items:center!important; justify-content:center!important; gap:6px!important; padding:3px 6px!important; border-radius:9px!important; box-sizing:border-box!important; overflow:hidden!important; text-align:center!important; white-space:normal!important; line-height:1!important;
}
body.venta-touch-screen.v310-final .touch-category-icon-wrap{display:flex!important; align-items:center!important; justify-content:center!important; flex:0 0 22px!important; width:22px!important; height:22px!important; min-width:22px!important; min-height:22px!important; max-width:22px!important; max-height:22px!important; margin:0!important; overflow:hidden!important; border-radius:4px!important;}
body.venta-touch-screen.v310-final .touch-category-icon{display:block!important; width:22px!important; height:22px!important; min-width:0!important; min-height:0!important; max-width:22px!important; max-height:22px!important; object-fit:contain!important; margin:0!important; padding:0!important;}
body.venta-touch-screen.v310-final .touch-category-icon-text{display:block!important; font-size:17px!important; line-height:1!important; font-weight:950!important; margin:0!important; padding:0!important;}
body.venta-touch-screen.v310-final .touch-category-label{display:block!important; flex:1 1 auto!important; min-width:0!important; max-width:100%!important; font-size:clamp(8px,.82vw,12px)!important; line-height:1.05!important; font-weight:950!important; text-align:center!important; white-space:normal!important; overflow:hidden!important; text-overflow:clip!important; word-break:normal!important; overflow-wrap:anywhere!important; margin:0!important; padding:0!important; letter-spacing:-.1px!important;}
body.venta-touch-screen.v310-final .menu-abajo-boton,
body.venta-touch-screen.v310-final .bottom-open-menu-button,
body.venta-touch-screen.v310-final .bottom-menu-tab{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important;}
@media (max-width:900px){
  body.venta-touch-screen.v310-final .touch-category-grid{height:42px!important;min-height:42px!important;max-height:42px!important;gap:4px!important;}
  body.venta-touch-screen.v310-final .touch-category-grid > .touch-category{height:42px!important;min-height:42px!important;max-height:42px!important;gap:3px!important;padding:2px 4px!important;border-radius:8px!important;}
  body.venta-touch-screen.v310-final .touch-category-icon-wrap{flex-basis:18px!important;width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;max-width:18px!important;max-height:18px!important;}
  body.venta-touch-screen.v310-final .touch-category-icon{width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;}
  body.venta-touch-screen.v310-final .touch-category-icon-text{font-size:13px!important;}
  body.venta-touch-screen.v310-final .touch-category-label{font-size:clamp(6px,1.15vw,9px)!important;line-height:1!important;letter-spacing:-.2px!important;}
}


/* ===== V311 DEFINITIVO - sin fullscreen, categorías compactas 1 fila y scroll lateral calibres ===== */
body.venta-touch-screen.v311-final #touchFullscreenBtn,
body.venta-touch-screen.v311-final .touch-fullscreen-btn,
body.venta-touch-screen #touchFullscreenBtn,
body.venta-touch-screen .touch-fullscreen-btn{
  display:none!important; visibility:hidden!important; opacity:0!important; pointer-events:none!important;
  width:0!important; height:0!important; min-width:0!important; min-height:0!important; max-width:0!important; max-height:0!important;
  position:absolute!important; left:-99999px!important; top:-99999px!important; overflow:hidden!important;
}
body.venta-touch-screen.v311-final .menu-abajo-boton,
body.venta-touch-screen.v311-final .bottom-open-menu-button,
body.venta-touch-screen.v311-final .bottom-menu-tab,
body.venta-touch-screen.v311-final .touch-wizard-nav,
body.venta-touch-screen.v311-final #touchWizardPrev,
body.venta-touch-screen.v311-final #touchWizardNext{display:none!important;visibility:hidden!important;pointer-events:none!important;}

body.venta-touch-screen.v311-final .touch-body{padding:6px 10px 10px!important; gap:8px!important;}
body.venta-touch-screen.v311-final .touch-card{width:100%!important; max-width:100%!important; box-sizing:border-box!important; overflow:hidden!important;}
body.venta-touch-screen.v311-final #formVentaTouch > .touch-card:first-of-type{
  height:auto!important; min-height:0!important; max-height:none!important; padding:7px 10px 10px!important;
}
body.venta-touch-screen.v311-final .touch-step-title{font-size:clamp(13px,1.05vw,17px)!important;line-height:1.05!important;margin:0 0 6px!important;}

/* Categorías: una sola fila real, burbujas internas pequeñas, icono+texto centrados */
body.venta-touch-screen.v311-final .touch-category-grid{
  display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important;
  width:100%!important; max-width:100%!important; height:48px!important; min-height:48px!important; max-height:48px!important;
  gap:6px!important; padding:0!important; margin:0!important; overflow:hidden!important;
  align-items:stretch!important; justify-content:space-between!important;
  grid-template-columns:none!important; grid-template-rows:none!important; grid-auto-flow:unset!important; grid-auto-rows:unset!important;
}
body.venta-touch-screen.v311-final .touch-category-grid .touch-category{
  flex:1 1 0!important; width:auto!important; min-width:0!important; max-width:none!important;
  height:48px!important; min-height:48px!important; max-height:48px!important;
  display:grid!important; grid-template-columns:28px minmax(0,1fr)!important; grid-template-rows:1fr!important;
  align-items:center!important; justify-items:center!important; justify-content:center!important; align-content:center!important;
  gap:5px!important; padding:3px 6px!important; box-sizing:border-box!important;
  overflow:hidden!important; text-align:center!important; white-space:normal!important;
  border-radius:10px!important;
}
body.venta-touch-screen.v311-final .touch-category-icon-wrap{
  grid-column:1!important; width:26px!important; height:26px!important; min-width:26px!important; min-height:26px!important;
  max-width:26px!important; max-height:26px!important; display:flex!important; align-items:center!important; justify-content:center!important;
  margin:0!important; padding:0!important; overflow:hidden!important; align-self:center!important; justify-self:center!important;
}
body.venta-touch-screen.v311-final .touch-category-icon,
body.venta-touch-screen.v311-final .touch-category-icon-wrap img{
  width:24px!important; height:24px!important; max-width:24px!important; max-height:24px!important;
  object-fit:contain!important; display:block!important; margin:0!important; padding:0!important;
}
body.venta-touch-screen.v311-final .touch-category-icon-text{
  display:flex!important; align-items:center!important; justify-content:center!important; width:24px!important; height:24px!important;
  font-size:16px!important; line-height:1!important; font-weight:950!important; margin:0!important; padding:0!important;
}
body.venta-touch-screen.v311-final .touch-category-label{
  grid-column:2!important; display:-webkit-box!important; -webkit-box-orient:vertical!important; -webkit-line-clamp:2!important;
  align-self:center!important; justify-self:center!important; width:100%!important; min-width:0!important; max-width:100%!important;
  font-size:clamp(8px,.74vw,12px)!important; line-height:1.05!important; font-weight:950!important;
  text-align:center!important; white-space:normal!important; overflow:hidden!important; text-overflow:clip!important;
  overflow-wrap:anywhere!important; word-break:normal!important; margin:0!important; padding:0!important; color:#061226!important;
}
body.venta-touch-screen.v311-final .touch-category.active .touch-category-label{color:#061226!important;}

/* En móvil muy estrecho, sigue en una fila y permite scroll horizontal limpio */
@media (max-width: 760px){
  body.venta-touch-screen.v311-final .touch-category-grid{
    overflow-x:auto!important; overflow-y:hidden!important; -webkit-overflow-scrolling:touch!important; scroll-snap-type:x mandatory!important;
    justify-content:flex-start!important; height:46px!important; min-height:46px!important; max-height:46px!important;
  }
  body.venta-touch-screen.v311-final .touch-category-grid::-webkit-scrollbar{display:none!important;}
  body.venta-touch-screen.v311-final .touch-category-grid{scrollbar-width:none!important; -ms-overflow-style:none!important;}
  body.venta-touch-screen.v311-final .touch-category-grid .touch-category{
    flex:0 0 104px!important; width:104px!important; min-width:104px!important; max-width:104px!important;
    height:46px!important; min-height:46px!important; max-height:46px!important; grid-template-columns:24px minmax(0,1fr)!important; gap:4px!important; scroll-snap-align:start!important;
  }
  body.venta-touch-screen.v311-final .touch-category-icon-wrap{width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;max-width:22px!important;max-height:22px!important;}
  body.venta-touch-screen.v311-final .touch-category-icon,
  body.venta-touch-screen.v311-final .touch-category-icon-wrap img{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important;}
  body.venta-touch-screen.v311-final .touch-category-icon-text{font-size:14px!important;width:20px!important;height:20px!important;}
  body.venta-touch-screen.v311-final .touch-category-label{font-size:8px!important;}
}

/* Calibres: si hay muchas opciones, una sola fila con scroll lateral */
body.venta-touch-screen.v311-final #cardCalibre{padding:7px 10px 10px!important; height:auto!important; min-height:0!important; overflow:hidden!important;}
body.venta-touch-screen.v311-final .touch-calibres{
  display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important; gap:8px!important; width:100%!important;
  overflow-x:auto!important; overflow-y:hidden!important; -webkit-overflow-scrolling:touch!important; scroll-snap-type:x mandatory!important;
  padding:0 0 2px!important; margin:0!important; min-height:42px!important; max-height:48px!important; align-items:stretch!important;
}
body.venta-touch-screen.v311-final .touch-calibres::-webkit-scrollbar{height:0!important; display:none!important;}
body.venta-touch-screen.v311-final .touch-calibres{scrollbar-width:none!important; -ms-overflow-style:none!important;}
body.venta-touch-screen.v311-final .touch-calibres .touch-chip{
  flex:0 0 clamp(105px, 16vw, 170px)!important; min-width:105px!important; max-width:170px!important; height:42px!important; min-height:42px!important; max-height:42px!important;
  display:flex!important; align-items:center!important; justify-content:center!important; text-align:center!important; padding:4px 7px!important; box-sizing:border-box!important;
  font-size:clamp(9px,.85vw,13px)!important; line-height:1.05!important; font-weight:950!important; overflow:hidden!important; white-space:normal!important; scroll-snap-align:start!important;
}

/* Cantidad centrada y legible */
body.venta-touch-screen.v311-final .touch-qty{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;}
body.venta-touch-screen.v311-final .touch-qty-number{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;min-width:82px!important;height:42px!important;padding:2px 8px!important;}
body.venta-touch-screen.v311-final .touch-qty-input{text-align:center!important;font-size:20px!important;line-height:1!important;height:22px!important;padding:0!important;margin:0!important;}
body.venta-touch-screen.v311-final #unidadVisual{font-size:8px!important;line-height:1!important;text-align:center!important;margin-top:2px!important;white-space:nowrap!important;}

/* V331: stock negativo permitido con aviso visual */
.stock-chip.stock-negativo{background:#fee2e2!important;border-color:#dc2626!important;color:#7f1d1d!important;font-weight:900;}


/* V331 - campo manual calibre libro para pistones */
.campo-calibre-libro{
    border:2px dashed #f59e0b;
    background:#fff7ed;
    border-radius:12px;
    padding:8px;
}
.campo-calibre-libro label{
    font-weight:800;
    color:#92400e;
}

/* V336 - bloqueo visual fuerte: calibre libro solo se muestra por JS/PHP para categoría padre Pistón */
#campoCalibreLibroTouch[hidden],
#campo_calibre_libro_entrada[hidden],
#campo_calibre_libro_clasica[hidden]{
    display:none!important;
}


/* V337 - Fecha destacada naranja fluorescente en venta/compra */
.fecha-fluor-box{
  background:linear-gradient(180deg,#ff9f1a 0%,#ff7a00 100%) !important;
  border:3px solid #7a2600 !important;
  box-shadow:0 0 0 3px rgba(255,122,0,.28),0 6px 16px rgba(122,38,0,.25) !important;
  border-radius:14px !important;
}
.fecha-fluor-box label{
  color:#111827 !important;
  font-weight:1000 !important;
  text-transform:uppercase !important;
  letter-spacing:.03em !important;
}
.fecha-fluor-box input[type="date"],
.fecha-fluor-box input[name="fecha_movimiento"]{
  background:#fff8d6 !important;
  color:#111827 !important;
  border:2px solid #111827 !important;
  font-weight:1000 !important;
  font-size:1.08em !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.75) !important;
}
body.venta-touch-screen .fecha-fluor-box{
  background:linear-gradient(180deg,#ffaa1f 0%,#ff7900 100%) !important;
  border-color:#6f2300 !important;
}
body.venta-touch-screen .fecha-fluor-box input[type="date"]{
  background:#fff6c2 !important;
  color:#0f172a !important;
}

/* V344 - Stock y movimientos: comparativa visual existencia anterior vs stock actual */
.comparativa-stock-info{
  margin:-4px 0 14px!important;
  color:#64748b!important;
  font-weight:800!important;
  font-size:12px!important;
}
.stock-comp-item{
  display:block!important;
  padding:14px 0 16px!important;
  border-bottom:1px solid #e5e7eb!important;
}
.stock-comp-item:last-child{border-bottom:0!important}
.stock-comp-item.derivada{
  padding:14px!important;
  margin:4px 0 12px!important;
  border:1px solid #bfdbfe!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,#eff6ff 0%,#f8fbff 100%)!important;
}
.stock-comp-head{
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  margin-bottom:9px!important;
}
.stock-comp-title{
  display:block!important;
  font-size:15px!important;
  font-weight:1000!important;
  color:#0f172a!important;
  letter-spacing:.02em!important;
  text-transform:uppercase!important;
}
.stock-comp-diff{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:13px!important;
  font-weight:1000!important;
  border-radius:999px!important;
  padding:4px 10px!important;
  white-space:nowrap!important;
  background:#f1f5f9!important;
  color:#334155!important;
  min-width:74px!important;
}
.stock-comp-diff.negativa{background:#fee2e2!important;color:#991b1b!important}
.stock-comp-diff.positiva{background:#dcfce7!important;color:#166534!important}
.stock-comp-diff.neutra{background:#f1f5f9!important;color:#475569!important}
.stock-comp-row{
  display:grid!important;
  grid-template-columns:122px minmax(160px,1fr) 104px!important;
  gap:10px!important;
  align-items:center!important;
  margin:7px 0!important;
  width:100%!important;
}
.stock-comp-label{
  display:block!important;
  font-size:12px!important;
  font-weight:1000!important;
  color:#334155!important;
  text-transform:uppercase!important;
  line-height:1.05!important;
}
.stock-comp-row strong{
  display:block!important;
  text-align:right!important;
  font-size:13px!important;
  font-weight:1000!important;
  color:#0f172a!important;
  line-height:1.05!important;
}
.stock-comp-track{
  display:block!important;
  width:100%!important;
  height:18px!important;
  background:#e2e8f0!important;
  border-radius:999px!important;
  overflow:hidden!important;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.12)!important;
}
.stock-comp-fill{
  display:block!important;
  height:100%!important;
  min-width:5px!important;
  border-radius:999px!important;
  transition:width .18s ease!important;
}
.stock-comp-fill.anterior{background:#475569!important}
.stock-comp-fill.actual{background:#22c55e!important}
.stock-comp-fill.negativa{background:#ef4444!important}
.stock-comp-item.derivada .stock-comp-fill.anterior{background:#1e3a8a!important}
.stock-comp-item.derivada .stock-comp-fill.actual{background:#2563eb!important}
@media(max-width:650px){
  .stock-comp-row{grid-template-columns:1fr!important;gap:5px!important;margin:11px 0!important}
  .stock-comp-row strong{text-align:left!important}
  .stock-comp-head{align-items:flex-start!important;flex-direction:column!important}
}

/* V348: tabla real de informe dinámica igual que vista previa de Configuración informes */
.libro-table-v158.modo-dinamico{table-layout:fixed!important;width:100%!important;max-width:100%!important;border-collapse:collapse!important;}
.libro-table-v158.modo-dinamico th{background:#f1f5f9!important;color:#111827!important;text-align:center!important;font-weight:900!important;white-space:normal!important;overflow-wrap:anywhere!important;}
.libro-table-v158.modo-dinamico td{white-space:normal!important;overflow-wrap:anywhere!important;vertical-align:middle!important;}
.libro-table-v158.modo-dinamico td.txt-left{text-align:left!important;}
.libro-table-v158.modo-dinamico td.ctr{text-align:center!important;}
.libro-table-v158.modo-dinamico td.num{text-align:center!important;white-space:normal!important;}


/* V357: Venta touch - atajos de cantidad compactos: +10 +20 +25 en una sola línea */
body.venta-touch-screen #atajosUnidades.touch-fast{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:clamp(4px,.55vw,8px)!important;
  width:100%!important;
  min-width:0!important;
  align-items:stretch!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast button{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:clamp(32px,4.5vh,44px)!important;
  min-height:0!important;
  padding:0 clamp(4px,.5vw,8px)!important;
  border-radius:10px!important;
  font-size:clamp(13px,1vw,18px)!important;
  line-height:1!important;
  font-weight:950!important;
  white-space:nowrap!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast button:nth-child(4),
body.venta-touch-screen #atajosUnidades.touch-fast button:nth-child(5){
  grid-column:auto!important;
}
@media(max-width:420px){
  body.venta-touch-screen #atajosUnidades.touch-fast{gap:4px!important;}
  body.venta-touch-screen #atajosUnidades.touch-fast button{height:30px!important;font-size:12px!important;padding:0 3px!important;border-radius:8px!important;}
}

/* V358: Venta touch - todos los atajos de cantidad en una sola línea: +10 +20 +25 +50 +100 */
body.venta-touch-screen #atajosUnidades.touch-fast{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:clamp(3px,.45vw,6px)!important;
  width:100%!important;
  min-width:0!important;
  align-items:stretch!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast button{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:clamp(30px,4.1vh,40px)!important;
  min-height:0!important;
  padding:0 clamp(2px,.35vw,6px)!important;
  border-radius:9px!important;
  font-size:clamp(11px,.85vw,16px)!important;
  line-height:1!important;
  font-weight:950!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast button:nth-child(4),
body.venta-touch-screen #atajosUnidades.touch-fast button:nth-child(5){
  grid-column:auto!important;
}
@media(max-width:520px){
  body.venta-touch-screen #atajosUnidades.touch-fast{gap:3px!important;}
  body.venta-touch-screen #atajosUnidades.touch-fast button{height:28px!important;font-size:11px!important;padding:0 2px!important;border-radius:7px!important;}
}

/* V361 - Venta touch: fecha/autorización más legible y cantidad simplificada */
body.venta-touch-screen .touch-form-grid > div,
body.venta-touch-screen .touch-form-grid .fecha-fluor-box{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}
body.venta-touch-screen .touch-form-grid label,
body.venta-touch-screen .fecha-fluor-box label{
  width:100%!important;
  text-align:center!important;
  font-size:13px!important;
  line-height:1.1!important;
  font-weight:900!important;
  letter-spacing:.04em!important;
  color:#1f2937!important;
  margin-bottom:4px!important;
}
body.venta-touch-screen .touch-form-grid input,
body.venta-touch-screen .fecha-fluor-box input[type="date"],
body.venta-touch-screen .fecha-fluor-box input[name="fecha_movimiento"]{
  width:100%!important;
  text-align:center!important;
  font-size:16px!important;
  font-weight:900!important;
  letter-spacing:.01em!important;
  padding:8px 8px!important;
  min-height:42px!important;
  line-height:1.1!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen .touch-qty.touch-qty-v361{
  display:grid!important;
  grid-template-columns:minmax(42px,1fr) minmax(118px,170px) minmax(74px,110px)!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  width:100%!important;
  max-width:420px!important;
  margin:0 auto!important;
}
body.venta-touch-screen .touch-qty-v361 .touch-qty-spacer{
  min-width:42px!important;
  height:1px!important;
}
body.venta-touch-screen .touch-qty-number-v361{
  width:100%!important;
  max-width:170px!important;
  min-height:64px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
}
body.venta-touch-screen .touch-qty-input-v361{
  width:100%!important;
  min-width:118px!important;
  max-width:170px!important;
  height:48px!important;
  min-height:48px!important;
  font-size:30px!important;
  line-height:1!important;
  font-weight:900!important;
  text-align:center!important;
  padding:3px 6px!important;
  border-radius:14px!important;
}
body.venta-touch-screen .touch-qty-number-v361 span{
  font-size:12px!important;
  font-weight:900!important;
  line-height:1.05!important;
  margin-top:3px!important;
}
body.venta-touch-screen .touch-qty-100{
  width:100%!important;
  min-width:74px!important;
  max-width:110px!important;
  height:58px!important;
  min-height:58px!important;
  border-radius:14px!important;
  font-size:20px!important;
  line-height:1.02!important;
  font-weight:900!important;
  padding:4px 8px!important;
  background:#047857!important;
  color:#fff!important;
  border:0!important;
}
body.venta-touch-screen .touch-qty-100 small{
  display:block!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast-v361{display:none!important;}
@media (max-width:760px){
  body.venta-touch-screen .touch-form-grid label,
  body.venta-touch-screen .fecha-fluor-box label{font-size:12px!important;}
  body.venta-touch-screen .touch-form-grid input,
  body.venta-touch-screen .fecha-fluor-box input[type="date"]{font-size:14px!important;min-height:38px!important;padding:6px!important;}
  body.venta-touch-screen .touch-qty.touch-qty-v361{grid-template-columns:minmax(26px,1fr) minmax(112px,145px) minmax(70px,92px)!important;gap:7px!important;max-width:320px!important;}
  body.venta-touch-screen .touch-qty-input-v361{font-size:27px!important;height:46px!important;min-height:46px!important;}
  body.venta-touch-screen .touch-qty-100{height:54px!important;min-height:54px!important;font-size:18px!important;}
}

/* V362 - Venta touch: fecha/autorizacion en mayúsculas y cantidad profesional centrada */
body.venta-touch-screen .touch-form-grid label,
body.venta-touch-screen .fecha-fluor-box label{
  text-transform:uppercase!important;
  font-size:clamp(13px,1.05vw,16px)!important;
  font-weight:950!important;
  letter-spacing:.06em!important;
  text-align:center!important;
  color:#111827!important;
  margin-bottom:5px!important;
}
body.venta-touch-screen .touch-form-grid input,
body.venta-touch-screen .fecha-fluor-box input[type="date"],
body.venta-touch-screen .fecha-fluor-box input[name="fecha_movimiento"]{
  font-size:clamp(15px,1.15vw,18px)!important;
  font-weight:950!important;
  text-align:center!important;
  min-height:44px!important;
  padding:7px 8px!important;
}
body.venta-touch-screen .touch-qty.touch-qty-v362{
  display:grid!important;
  grid-template-columns:minmax(42px,58px) minmax(132px,190px) minmax(42px,58px) minmax(92px,130px)!important;
  align-items:center!important;
  justify-content:center!important;
  gap:clamp(6px,.75vw,12px)!important;
  width:100%!important;
  max-width:470px!important;
  margin:2px auto 0 auto!important;
}
body.venta-touch-screen .touch-qty-step{
  width:100%!important;
  height:clamp(46px,6.4vh,58px)!important;
  min-height:46px!important;
  border:0!important;
  border-radius:14px!important;
  font-size:clamp(23px,2.2vw,34px)!important;
  line-height:1!important;
  font-weight:950!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(15,23,42,.18)!important;
}
body.venta-touch-screen .touch-qty-minus{background:#111827!important;}
body.venta-touch-screen .touch-qty-plus{background:#0f766e!important;}
body.venta-touch-screen .touch-qty-number-v362{
  width:100%!important;
  min-height:clamp(58px,7vh,70px)!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  margin:0!important;
}
body.venta-touch-screen .touch-qty-input-v362{
  width:100%!important;
  max-width:190px!important;
  min-width:132px!important;
  height:clamp(48px,6.4vh,60px)!important;
  min-height:48px!important;
  border-radius:16px!important;
  font-size:clamp(30px,3vw,42px)!important;
  font-weight:950!important;
  line-height:1!important;
  text-align:center!important;
  padding:2px 6px!important;
  border:2px solid #cbd5e1!important;
  background:#fff!important;
  color:#0f172a!important;
}
body.venta-touch-screen .touch-qty-number-v362 span{
  margin-top:3px!important;
  font-size:clamp(11px,.9vw,13px)!important;
  line-height:1!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
  color:#334155!important;
}
body.venta-touch-screen .touch-qty-100-v362{
  width:100%!important;
  min-width:92px!important;
  height:clamp(46px,6.4vh,58px)!important;
  min-height:46px!important;
  border-radius:14px!important;
  border:0!important;
  background:#047857!important;
  color:#fff!important;
  font-size:clamp(18px,1.7vw,25px)!important;
  line-height:1!important;
  font-weight:950!important;
  padding:4px 8px!important;
  box-shadow:0 8px 18px rgba(4,120,87,.20)!important;
  white-space:nowrap!important;
}
body.venta-touch-screen .touch-qty-100-v362 small{
  display:inline!important;
  font-size:clamp(10px,.8vw,12px)!important;
  font-weight:950!important;
  margin-left:3px!important;
}
body.venta-touch-screen #atajosUnidades.touch-fast-v361,
body.venta-touch-screen #atajosUnidades.touch-fast{display:none!important;}
@media(max-width:620px){
  body.venta-touch-screen .touch-form-grid label,
  body.venta-touch-screen .fecha-fluor-box label{font-size:12px!important;letter-spacing:.045em!important;}
  body.venta-touch-screen .touch-form-grid input,
  body.venta-touch-screen .fecha-fluor-box input[type="date"]{font-size:14px!important;min-height:38px!important;padding:6px!important;}
  body.venta-touch-screen .touch-qty.touch-qty-v362{
    grid-template-columns:38px minmax(104px,1fr) 38px 78px!important;
    max-width:320px!important;
    gap:5px!important;
  }
  body.venta-touch-screen .touch-qty-step{height:44px!important;min-height:44px!important;font-size:23px!important;border-radius:12px!important;}
  body.venta-touch-screen .touch-qty-input-v362{min-width:104px!important;height:46px!important;min-height:46px!important;font-size:28px!important;border-radius:13px!important;}
  body.venta-touch-screen .touch-qty-100-v362{min-width:78px!important;height:44px!important;min-height:44px!important;font-size:16px!important;border-radius:12px!important;padding:3px 4px!important;}
  body.venta-touch-screen .touch-qty-100-v362 small{font-size:9px!important;margin-left:2px!important;}
}


/* =========================================================
   V363 - Cantidad venta touch profesional y centrada
   Reordena y protege el control de cantidad para que no se corte.
   ========================================================= */
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:clamp(8px,1vw,14px)!important;
  width:100%!important;
  max-width:560px!important;
  margin:8px auto 2px auto!important;
  padding:0!important;
  overflow:visible!important;
  white-space:nowrap!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-step{
  flex:0 0 clamp(48px,4.1vw,58px)!important;
  width:clamp(48px,4.1vw,58px)!important;
  min-width:clamp(48px,4.1vw,58px)!important;
  max-width:clamp(48px,4.1vw,58px)!important;
  height:clamp(48px,5.4vh,58px)!important;
  min-height:48px!important;
  max-height:58px!important;
  border:0!important;
  border-radius:16px!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:clamp(25px,2.3vw,34px)!important;
  font-weight:950!important;
  line-height:1!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(15,23,42,.18)!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-minus{background:#111827!important;}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-plus{background:#0f766e!important;}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
  flex:0 0 clamp(128px,13vw,180px)!important;
  width:clamp(128px,13vw,180px)!important;
  min-width:128px!important;
  max-width:180px!important;
  height:clamp(58px,6.2vh,70px)!important;
  min-height:58px!important;
  border:2px solid #cbd5e1!important;
  background:#fff!important;
  border-radius:18px!important;
  padding:4px 8px!important;
  margin:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:1px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85),0 5px 14px rgba(15,23,42,.08)!important;
  overflow:hidden!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-input-v363{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  text-align:center!important;
  font-size:clamp(28px,3vw,40px)!important;
  font-weight:950!important;
  line-height:34px!important;
  color:#0f172a!important;
  appearance:textfield!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-input-v363::-webkit-outer-spin-button,
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-input-v363::-webkit-inner-spin-button{
  appearance:none!important;
  margin:0!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363 span{
  display:block!important;
  width:100%!important;
  text-align:center!important;
  font-size:clamp(10px,.9vw,12px)!important;
  line-height:12px!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  letter-spacing:.05em!important;
  color:#334155!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
  flex:0 0 clamp(92px,8.5vw,128px)!important;
  width:clamp(92px,8.5vw,128px)!important;
  min-width:92px!important;
  max-width:128px!important;
  height:clamp(48px,5.4vh,58px)!important;
  min-height:48px!important;
  max-height:58px!important;
  border:0!important;
  border-radius:16px!important;
  padding:4px 8px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  background:#047857!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(4,120,87,.20)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363 span{
  display:block!important;
  font-size:clamp(18px,1.8vw,25px)!important;
  font-weight:950!important;
  line-height:1!important;
}
body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363 small{
  display:block!important;
  font-size:clamp(9px,.75vw,11px)!important;
  font-weight:950!important;
  line-height:1!important;
  margin:2px 0 0 0!important;
  letter-spacing:.04em!important;
}
@media(max-width:620px){
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363{
    gap:6px!important;
    max-width:100%!important;
    justify-content:center!important;
    padding:0 2px!important;
  }
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-step{
    flex-basis:40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;
    height:42px!important;min-height:42px!important;max-height:42px!important;
    border-radius:12px!important;font-size:24px!important;
  }
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
    flex-basis:104px!important;width:104px!important;min-width:104px!important;max-width:104px!important;
    height:50px!important;min-height:50px!important;border-radius:13px!important;padding:3px 6px!important;
  }
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-input-v363{
    height:29px!important;min-height:29px!important;max-height:29px!important;font-size:28px!important;line-height:29px!important;
  }
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363 span{font-size:9px!important;line-height:10px!important;}
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
    flex-basis:76px!important;width:76px!important;min-width:76px!important;max-width:76px!important;
    height:42px!important;min-height:42px!important;max-height:42px!important;border-radius:12px!important;padding:3px 4px!important;
  }
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363 span{font-size:17px!important;}
  body.venta-touch-screen #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363 small{font-size:8px!important;margin-top:1px!important;}
}


/* =========================================================
   V364 - Cantidad venta touch centrada dentro de la burbuja padre
   Fuerza el bloque de cantidad a ocupar toda la tarjeta y centra
   [-] [cantidad] [+] [+100 UNDS] sin afectar stock/libros.
   ========================================================= */
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v296 #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v298 #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v299 #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v300 #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v302 #formVentaTouch > .touch-card.touch-card-cantidad-v364,
body.venta-touch-screen.touch-row-mode-v303 #formVentaTouch > .touch-card.touch-card-cantidad-v364{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-areas:"title" "qty" "alert"!important;
  align-items:center!important;
  justify-items:center!important;
  justify-content:center!important;
  gap:clamp(4px,.6vw,8px)!important;
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  padding-left:clamp(10px,1.1vw,18px)!important;
  padding-right:clamp(10px,1.1vw,18px)!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 .touch-step-title{
  grid-area:title!important;
  justify-self:start!important;
  width:100%!important;
  margin:0 0 2px 0!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363{
  grid-area:qty!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-columns:clamp(46px,4.6vw,60px) clamp(128px,12vw,184px) clamp(46px,4.6vw,60px) clamp(104px,9.2vw,140px)!important;
  align-items:center!important;
  justify-content:center!important;
  justify-items:center!important;
  gap:clamp(10px,1.05vw,16px)!important;
  padding:0!important;
  transform:none!important;
  overflow:visible!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-step,
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363,
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
  position:static!important;
  transform:none!important;
  margin:0!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-step{
  width:clamp(46px,4.6vw,60px)!important;
  min-width:46px!important;
  max-width:60px!important;
  height:clamp(46px,5.4vh,58px)!important;
  min-height:46px!important;
  max-height:58px!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
  width:clamp(128px,12vw,184px)!important;
  min-width:128px!important;
  max-width:184px!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
  width:clamp(104px,9.2vw,140px)!important;
  min-width:104px!important;
  max-width:140px!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #aviso100{
  grid-area:alert!important;
  width:100%!important;
  justify-self:stretch!important;
}
@media(max-width:620px){
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364{
    padding-left:6px!important;
    padding-right:6px!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363{
    grid-template-columns:38px minmax(92px,108px) 38px minmax(76px,88px)!important;
    gap:5px!important;
    width:auto!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-step{
    width:38px!important;min-width:38px!important;max-width:38px!important;height:40px!important;min-height:40px!important;max-height:40px!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
    width:104px!important;min-width:92px!important;max-width:108px!important;height:48px!important;min-height:48px!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
    width:82px!important;min-width:76px!important;max-width:88px!important;height:40px!important;min-height:40px!important;max-height:40px!important;
  }
}


/* =========================================================
   V365 - Ajuste fino: botón +100 UNDS un poco más a la derecha
   Solo afecta al bloque de cantidad de venta touch.
   ========================================================= */
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
  margin-left:clamp(10px,1.2vw,22px)!important;
}
@media(max-width:620px){
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
    margin-left:6px!important;
  }
}

/* =========================================================
   V366 - Botón +100 UNDS al extremo derecho de la burbuja padre
   Mantiene [-] [cantidad] [+] centrado y desplaza solo +100 al borde derecho.
   ========================================================= */
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:1fr clamp(46px,4.6vw,60px) clamp(128px,12vw,184px) clamp(46px,4.6vw,60px) 1fr clamp(112px,9.6vw,148px)!important;
  align-items:center!important;
  justify-content:stretch!important;
  justify-items:center!important;
  gap:clamp(10px,1vw,16px)!important;
  padding:0!important;
  box-sizing:border-box!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-minus{
  grid-column:2!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-number-v363{
  grid-column:3!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-plus{
  grid-column:4!important;
}
body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
  grid-column:6!important;
  justify-self:end!important;
  margin-left:0!important;
  width:clamp(112px,9.6vw,148px)!important;
  min-width:112px!important;
  max-width:148px!important;
}
@media(max-width:620px){
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363{
    grid-template-columns:1fr 38px minmax(92px,108px) 38px 1fr minmax(78px,90px)!important;
    gap:5px!important;
  }
  body.venta-touch-screen #formVentaTouch > .touch-card.touch-card-cantidad-v364 #cantidadUnidadesControl.touch-qty-v363 .touch-qty-100-v363{
    width:88px!important;min-width:78px!important;max-width:90px!important;
    margin-left:0!important;
    justify-self:end!important;
  }
}

/* V370 - Últimos 4 movimientos: datos centrados y cabecera visible */
.touch-last-movements-card{
    margin-top:10px;
    padding:14px 14px 12px;
    border-radius:18px;
    background:#ffffff;
    border:1px solid rgba(15,23,42,.08);
    box-shadow:0 8px 18px rgba(15,23,42,.07);
    overflow:visible;
}
.touch-last-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:9px;
    min-height:24px;
}
.touch-last-movements-card .touch-step-title{
    display:block;
    text-align:left;
    font-size:1.12rem;
    margin:0;
    padding:0;
    color:#0f172a;
    font-weight:950;
    letter-spacing:.02em;
    line-height:1.25;
    white-space:nowrap;
}
.touch-last-movements-note{
    font-size:.7rem;
    color:#64748b;
    margin:0;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.05em;
    white-space:nowrap;
}
.touch-last-table-wrap{
    width:100%;
    overflow:hidden;
    border-radius:12px;
    border:1px solid #dbe3ee;
}
.touch-last-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:.72rem;
    line-height:1.12;
}
.touch-last-table th{
    background:#eef2f7;
    color:#334155;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.035em;
    padding:5px 6px;
    border-bottom:1px solid #dbe3ee;
    text-align:center;
    white-space:nowrap;
}
.touch-last-table td{
    padding:5px 6px;
    border-bottom:1px solid #e8eef6;
    color:#0f172a;
    font-weight:800;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    vertical-align:middle;
    text-align:center;
}
.touch-last-table tbody tr:last-child td{border-bottom:0;}
.touch-last-table tr.touch-last-entrada td:first-child{border-left:5px solid #16a34a;}
.touch-last-table tr.touch-last-salida td:first-child{border-left:5px solid #dc2626;}
.touch-last-badge{
    display:inline-block;
    min-width:54px;
    padding:4px 7px;
    border-radius:999px;
    background:#0f172a;
    color:#fff;
    font-size:.64rem;
    line-height:1;
    text-align:center;
    font-weight:950;
}
.touch-last-entrada .touch-last-badge{background:#15803d;}
.touch-last-salida .touch-last-badge{background:#b91c1c;}
.touch-last-table .tl-fecha{width:7.5%;text-align:center;}
.touch-last-table .tl-num{width:5%;text-align:center;font-weight:950;}
.touch-last-table .tl-persona{width:23%;text-align:center;}
.touch-last-table .tl-cat{width:12%;text-align:center;}
.touch-last-table .tl-cal{width:10%;text-align:center;}
.touch-last-table .tl-cant{width:6.5%;text-align:center;font-size:.82rem;font-weight:950;}
.touch-last-table .tl-doc{width:18%;text-align:center;}
.touch-last-table .tl-user{width:8%;text-align:center;}
.touch-last-empty{
    color:#64748b;
    font-weight:800;
    padding:8px 0 4px;
    text-align:center;
}
@media (max-width: 1180px){
    .touch-desktop-only{display:none!important;}
}

}

/* V373 - Entrada pólvora: campos documentales opcionales y ayuda visible */
.campo-ayuda-polvora{font-size:11px;color:#6b7280;margin-top:4px;text-align:center;font-weight:700}
.campo-opcional-polvora{background:#fffaf0!important;border-color:#f59e0b!important}
