/* ============================================================
   Xeus POS v3.5 - Responsive UX Layer
   ------------------------------------------------------------
   Capa transversal de experiencia responsive. Se carga después
   de custom-xeus.css para preservar la funcionalidad y adaptar
   el sistema a escritorio, portátil, tablet y móvil.
   ============================================================ */

:root {
  --xeus-touch-target: 42px;
  --xeus-mobile-gutter: .75rem;
  --xeus-table-scroll-shadow: rgba(15, 23, 42, .12);
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.xeus-body {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.wrapper,
.body,
#app-content,
#app-content > *,
.row > * {
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

iframe {
  max-width: 100%;
}

/* ---------- Shell / navegación ---------- */
.header .container-fluid {
  min-height: 64px;
}

.header-toggler {
  min-width: var(--xeus-touch-target);
  min-height: var(--xeus-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
}

.sidebar .nav-link,
.sidebar .nav-group-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
}

.sidebar .nav-group-items .nav-link {
  min-height: 38px;
}

.xeus-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cui-sidebar-zindex, 1030) - 1);
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
  backdrop-filter: blur(1px);
}

.xeus-sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

body.xeus-sidebar-open {
  overflow: hidden;
}

/* ---------- Cabeceras de página / acciones ---------- */
#app-content h1,
#app-content h2 {
  overflow-wrap: anywhere;
}

.xeus-page-toolbar {
  width: 100%;
}

.xeus-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.xeus-page-actions > .btn,
.xeus-page-actions > a.btn,
.xeus-page-actions > button.btn {
  white-space: normal;
}

/* ---------- Cards ---------- */
.card,
.card-header,
.card-body,
.card-footer {
  min-width: 0;
}

.card-header.d-flex,
.card-footer.d-flex {
  gap: .65rem;
}

/* ---------- Formularios ---------- */
.form-control,
.form-select,
.select2-container {
  max-width: 100%;
}

input[type="file"].form-control {
  overflow: hidden;
}

textarea.form-control {
  resize: vertical;
}

.form-text,
.form-label,
.alert,
.card,
.modal-content {
  overflow-wrap: anywhere;
}

/* Compatibilidad con vistas heredadas de Bootstrap 3. */
.control-label {
  font-weight: 600;
  margin-bottom: .35rem;
}

.form-horizontal .form-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: .45rem;
  margin-bottom: 1rem;
}

.form-horizontal .form-group > [class*="col-"] {
  min-width: 0;
}

.form-horizontal .help-block {
  display: block;
  margin-top: .35rem;
  color: #6b7280;
  font-size: .82rem;
}

.pull-right { float: right !important; }
.pull-left { float: left !important; }

@media (min-width: 992px) {
  .col-lg-offset-1 { margin-left: 8.33333333%; }
  .col-lg-offset-2 { margin-left: 16.66666667%; }
  .col-lg-offset-3 { margin-left: 25%; }
  .col-lg-offset-4 { margin-left: 33.33333333%; }
}

/* ---------- Tablas ---------- */
.table-responsive,
.xeus-auto-table-responsive {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar,
.xeus-auto-table-responsive::-webkit-scrollbar,
.xeus-tabs .xeus-tab-nav::-webkit-scrollbar {
  height: 7px;
}

.table-responsive::-webkit-scrollbar-thumb,
.xeus-auto-table-responsive::-webkit-scrollbar-thumb,
.xeus-tabs .xeus-tab-nav::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .35);
  border-radius: 999px;
}

.xeus-auto-table-responsive.xeus-has-horizontal-overflow,
.table-responsive.xeus-has-horizontal-overflow {
  box-shadow: inset -10px 0 12px -14px var(--xeus-table-scroll-shadow);
}

.xeus-responsive-table {
  margin-bottom: 0 !important;
}

.xeus-responsive-table th {
  white-space: nowrap;
}

/* Mantener el ancho intrínseco de las palabras para que DataTables no trate
   cada letra como una columna mínima. Los identificadores largos aún pueden
   partirse cuando realmente no caben, sin cambiar controles ni paginación. */
.xeus-responsive-table td {
  overflow-wrap: break-word;
  word-break: normal;
}
.xeus-responsive-table td[data-xeus-responsive-control="1"]:focus-visible {
  outline: 3px solid #6554df;
  outline-offset: -3px;
}

.xeus-responsive-table .xeus-actions-cell,
.xeus-responsive-table .xeus-table-actions,
.xeus-responsive-table .xeus-action-inline {
  white-space: nowrap;
}

.xeus-responsive-table .xeus-actions-cell > form,
.xeus-responsive-table .xeus-actions-cell > a,
.xeus-responsive-table .xeus-actions-cell > button {
  margin-bottom: .2rem;
}

/* DataTables: controles legibles y táctiles en cualquier ancho. */
.dataTables_wrapper,
.dt-container {
  width: 100%;
  max-width: 100%;
}

.dataTables_wrapper .row,
.dt-container .row {
  align-items: center;
  row-gap: .6rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dt-container .dt-length,
.dt-container .dt-search,
.dt-container .dt-info,
.dt-container .dt-paging {
  min-width: 0;
}

.dataTables_wrapper .dataTables_filter input,
.dt-container .dt-search input,
.dataTables_wrapper .dataTables_length select,
.dt-container .dt-length select {
  min-height: 38px;
}

.dataTables_wrapper .pagination,
.dt-container .pagination,
.dt-container .dt-paging nav {
  flex-wrap: wrap;
  gap: .15rem;
}

/* ---------- Tabs ---------- */
.xeus-tabs {
  max-width: 100%;
}

.xeus-tabs .xeus-tab-nav {
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.xeus-tabs .xeus-tab-button {
  min-height: 44px;
}

/* ---------- Modales / SweetAlert ---------- */
.modal-dialog {
  max-width: min(var(--cui-modal-width, 500px), calc(100vw - 1.5rem));
}

.modal-content {
  max-height: calc(100dvh - 1rem);
}

.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.swal2-popup:not(.swal2-toast) {
  width: min(32em, calc(100vw - 1.25rem)) !important;
  max-width: calc(100vw - 1.25rem) !important;
}

/* Los avisos de formularios mantienen el cierre visible incluso con texto largo.
   No modifica los diálogos de cobro ni sus controles personalizados. */
.swal2-popup.xeus-async-feedback-popup {
  display: flex !important;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
}
.xeus-async-feedback-popup .swal2-icon,
.xeus-async-feedback-popup .swal2-title,
.xeus-async-feedback-popup .swal2-actions {
  flex: 0 0 auto;
}
.xeus-async-feedback-popup .swal2-html-container {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.xeus-async-feedback-popup .swal2-actions {
  margin-top: .75rem;
}
.xeus-async-feedback-popup .swal2-confirm {
  min-height: 44px;
}
@media (max-height: 500px) {
  .swal2-popup.xeus-async-feedback-popup {
    padding-bottom: .75rem;
  }
  .xeus-async-feedback-popup .swal2-icon {
    font-size: .65rem;
    margin-top: .5rem;
  }
  .xeus-async-feedback-popup .swal2-title {
    padding-top: .35rem;
    font-size: 1.35rem;
  }
  .xeus-async-feedback-popup .swal2-html-container {
    margin-top: .5rem;
  }
}

/* Avisos flotantes nativos Xeus POS · v3.7.3.116
   Componente independiente de SweetAlert2. Mantiene tamaño, icono y texto
   correctos en cualquier zoom y en vistas cargadas por AJAX. */
.xeus-toast-host {
  position: fixed !important;
  top: 76px !important;
  right: 14px !important;
  z-index: 2147483000 !important;
  width: min(380px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  pointer-events: none !important;
}
.xeus-native-toast {
  --xeus-toast-accent: #2563eb;
  --xeus-toast-soft: #eff6ff;
  --xeus-toast-border: rgba(37,99,235,.28);
  position: relative !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 62px !important;
  padding: 11px 40px 11px 12px !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0,1fr) !important;
  column-gap: 11px !important;
  align-items: center !important;
  overflow: hidden !important;
  border: 1px solid var(--xeus-toast-border) !important;
  border-left: 4px solid var(--xeus-toast-accent) !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.18) !important;
  opacity: 0 !important;
  transform: translateY(-8px) scale(.985) !important;
  transition: opacity .16s ease, transform .16s ease !important;
  pointer-events: auto !important;
  isolation: isolate !important;
}
.xeus-native-toast.is-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}
.xeus-native-toast.is-leaving {
  opacity: 0 !important;
  transform: translateY(-6px) scale(.99) !important;
}
.xeus-native-toast--success {
  --xeus-toast-accent: #16a34a;
  --xeus-toast-soft: #ecfdf3;
  --xeus-toast-border: rgba(22,163,74,.28);
}
.xeus-native-toast--error {
  --xeus-toast-accent: #dc2626;
  --xeus-toast-soft: #fff1f2;
  --xeus-toast-border: rgba(220,38,38,.28);
}
.xeus-native-toast--warning {
  --xeus-toast-accent: #d97706;
  --xeus-toast-soft: #fffbeb;
  --xeus-toast-border: rgba(217,119,6,.30);
}
.xeus-native-toast--info {
  --xeus-toast-accent: #2563eb;
  --xeus-toast-soft: #eff6ff;
  --xeus-toast-border: rgba(37,99,235,.28);
}
.xeus-native-toast--question {
  --xeus-toast-accent: #7c3aed;
  --xeus-toast-soft: #f5f3ff;
  --xeus-toast-border: rgba(124,58,237,.28);
}
.xeus-native-toast__icon {
  box-sizing: border-box !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--xeus-toast-border) !important;
  border-radius: 50% !important;
  background: var(--xeus-toast-soft) !important;
  color: var(--xeus-toast-accent) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  overflow: hidden !important;
}
.xeus-native-toast--warning .xeus-native-toast__icon,
.xeus-native-toast--info .xeus-native-toast__icon,
.xeus-native-toast--question .xeus-native-toast__icon { font-size: 17px !important; }
.xeus-native-toast__content {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
}
.xeus-native-toast__title {
  margin: 0 !important;
  padding: 0 !important;
  color: #172033 !important;
  font-size: .90rem !important;
  font-weight: 750 !important;
  line-height: 1.28 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
.xeus-native-toast__message {
  margin: 0 !important;
  padding: 0 !important;
  color: #64748b !important;
  font-size: .79rem !important;
  line-height: 1.3 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
.xeus-native-toast__close {
  position: absolute !important;
  top: 50% !important;
  right: 10px !important;
  transform: translateY(-50%) !important;
  box-sizing: border-box !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #64748b !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
.xeus-native-toast__close:hover,
.xeus-native-toast__close:focus-visible {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  outline: none !important;
}
.xeus-native-toast--no-close { padding-right: 14px !important; }
.xeus-native-toast__progress {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 3px !important;
  overflow: hidden !important;
  background: rgba(148,163,184,.13) !important;
}
.xeus-native-toast__progress-bar {
  display: block !important;
  width: 100%;
  height: 100% !important;
  background: var(--xeus-toast-accent) !important;
  transform-origin: left center !important;
}
@keyframes xeusToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Fallback: si por una carga parcial apareciera un toast SweetAlert2 antes del
   puente global, se oculta para evitar el diseño roto y se mantiene compacto. */
.swal2-popup.swal2-toast {
  width: min(360px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  min-height: 58px !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.18) !important;
}

/* Modales transaccionales globales · v3.7.3.116
   Todos los modales CoreUI/Bootstrap quedan estáticos: clic fuera y Escape no
   los cierran. Las únicas salidas son sus controles explícitos o el cierre
   programático tras completar/cancelar la operación. */
.modal.xeus-modal-locked.show {
  --xeus-modal-static-outline: rgba(79,70,229,.22);
}
.modal.xeus-modal-locked.xeus-modal-static-feedback .modal-content {
  animation: xeus-modal-static-feedback .18s ease-out !important;
}
@keyframes xeus-modal-static-feedback {
  0% { transform: scale(1); box-shadow: 0 .75rem 2rem rgba(15,23,42,.18); }
  50% { transform: scale(.995); box-shadow: 0 0 0 4px var(--xeus-modal-static-outline), 0 .75rem 2rem rgba(15,23,42,.18); }
  100% { transform: scale(1); box-shadow: 0 .75rem 2rem rgba(15,23,42,.18); }
}

@media (max-width: 575.98px) {
  .xeus-toast-host {
    top: 66px !important;
    right: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    gap: 7px !important;
  }
  .xeus-native-toast {
    min-height: 56px !important;
    padding: 9px 36px 9px 10px !important;
    grid-template-columns: 34px minmax(0,1fr) !important;
    column-gap: 9px !important;
    border-radius: 11px !important;
  }
  .xeus-native-toast__icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 18px !important;
  }
  .xeus-native-toast__title { font-size: .84rem !important; }
  .xeus-native-toast__message { font-size: .75rem !important; }
  .xeus-native-toast__close {
    right: 7px !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
  }
}

/* ---------- Gráficos / estados vacíos ---------- */
#app-content canvas {
  width: 100% !important;
}

.jumbotron,
.xeus-empty-state {
  max-width: 100%;
}

/* ---------- POS ---------- */
@media (min-width: 1200px) {
  #cart_summary {
    position: sticky;
    top: 86px;
  }
}

/* ---------- Compras profesionales ---------- */
.purchase-table input,
.purchase-table .input-group {
  min-width: 0;
}

.purchase-table .purchase-cart-money {
  min-width: 132px;
}

/* ============================================================
   PORTÁTILES / TABLETS HORIZONTALES (<= 1199.98)
   ============================================================ */
@media (max-width: 1199.98px) {
  #app-content {
    padding-inline: 1rem !important;
  }

  .card-body {
    padding: 1.25rem !important;
  }

  .card-header {
    padding: 1rem 1.25rem !important;
  }

  .card-footer {
    padding: .9rem 1.25rem !important;
  }

  .table-responsive > table.xeus-table-wide,
  .xeus-auto-table-responsive > table.xeus-table-wide {
    width: max(100%, var(--xeus-table-min-width, 760px)) !important;
    max-width: none !important;
  }

  /* En POS el carrito pasa debajo del catálogo antes de quedar demasiado angosto. */
  #cart_summary {
    margin-top: .25rem;
  }
}

/* ============================================================
   TABLET / MÓVIL (<= 991.98)
   ============================================================ */
@media (max-width: 991.98px) {
  .sidebar {
    --cui-sidebar-width: 17rem;
    width: min(17rem, 88vw);
    box-shadow: 0 0 30px rgba(15, 23, 42, .18);
  }

  .sidebar-header {
    min-height: 62px;
  }

  .header {
    margin-bottom: 1rem !important;
  }

  .header .container-fluid {
    min-height: 58px;
    padding-inline: .9rem !important;
  }

  #app-content {
    padding-inline: .85rem !important;
  }

  #app-content h1,
  #app-content h2 {
    font-size: clamp(1.3rem, 3.2vw, 1.55rem) !important;
    margin-bottom: .9rem !important;
  }

  .footer {
    padding-inline: .9rem !important;
    gap: .35rem .75rem;
    flex-wrap: wrap;
  }

  .xeus-page-actions .btn {
    min-height: 40px;
  }

  /* La tabla sigue siendo completa: se desplaza horizontalmente en lugar de
     comprimir columnas hasta volverlas ilegibles. */
  .table-responsive > table.xeus-table-wide,
  .xeus-auto-table-responsive > table.xeus-table-wide {
    min-width: var(--xeus-table-min-width, 720px) !important;
  }

  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    --cui-modal-width: calc(100vw - 1.5rem);
  }
}

/* ============================================================
   MÓVIL (<= 767.98)
   ============================================================ */
@media (max-width: 767.98px) {
  :root {
    --xeus-mobile-gutter: .7rem;
  }

  #app-content {
    padding-inline: var(--xeus-mobile-gutter) !important;
  }

  .card {
    margin-bottom: 1rem !important;
    border-radius: .65rem !important;
  }

  .card-header {
    padding: .85rem 1rem !important;
    font-size: .82rem !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  .card-footer {
    padding: .85rem 1rem !important;
  }

  .card-body.p-0 {
    padding: 0 !important;
  }

  .btn:not(.xeus-action-btn):not(.btn-close):not(.pos-nav-btn) {
    min-height: 40px;
  }

  .xeus-page-toolbar {
    align-items: stretch !important;
  }

  .xeus-page-actions {
    width: 100%;
  }

  .xeus-page-actions > .btn,
  .xeus-page-actions > a.btn,
  .xeus-page-actions > button.btn {
    flex: 1 1 auto;
  }

  .xeus-mobile-full-actions > .btn,
  .xeus-mobile-full-actions > a.btn,
  .xeus-mobile-full-actions > button.btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .form-control,
  .form-select {
    min-height: 42px;
    font-size: 16px !important; /* evita zoom automático de iOS */
  }

  textarea.form-control {
    min-height: 88px;
  }

  .select2-container--default .select2-selection--single {
    min-height: 42px;
    height: 42px !important;
  }

  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
  }

  .form-horizontal .form-group > .control-label,
  .form-horizontal .form-group > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    margin-left: 0 !important;
  }

  .xeus-stack-mobile.input-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0;
  }

  .xeus-stack-mobile.input-group > .form-control,
  .xeus-stack-mobile.input-group > .form-select {
    grid-column: 2;
    width: 100%;
    border-radius: 0 .375rem .375rem 0 !important;
  }

  .xeus-stack-mobile.input-group > .input-group-text:first-child {
    grid-column: 1;
    grid-row: 1;
    border-radius: .375rem 0 0 .375rem;
  }

  .xeus-stack-mobile.input-group > .btn:last-child {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: .5rem;
    border-radius: .45rem !important;
  }

  .table thead th {
    padding: .65rem .7rem !important;
    font-size: .73rem !important;
  }

  .table tbody td {
    padding: .65rem .7rem !important;
    font-size: .84rem !important;
  }

  .table-responsive > table.xeus-table-wide,
  .xeus-auto-table-responsive > table.xeus-table-wide {
    min-width: var(--xeus-table-min-width, 680px) !important;
  }

  .dataTables_wrapper .row > [class*="col-"],
  .dt-container .row > [class*="col-"] {
    width: 100%;
    text-align: left !important;
  }

  .dataTables_wrapper .dataTables_filter,
  .dt-container .dt-search {
    text-align: left !important;
  }

  .dataTables_wrapper .dataTables_filter label,
  .dt-container .dt-search label {
    width: 100%;
  }

  .dataTables_wrapper .dataTables_filter input,
  .dt-container .dt-search input {
    width: 100% !important;
    max-width: none !important;
    margin: .35rem 0 0 !important;
  }

  .dataTables_wrapper .dataTables_paginate,
  .dt-container .dt-paging {
    overflow-x: auto;
    padding-bottom: .2rem;
  }

  .dataTables_wrapper .pagination,
  .dt-container .pagination {
    flex-wrap: nowrap;
    width: max-content;
  }

  .xeus-tabs .xeus-tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 0;
  }

  .xeus-tabs .xeus-tab-button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: .7rem .8rem;
  }

  .xeus-tabs .xeus-tab-panel {
    padding: .9rem !important;
  }

  .modal-dialog {
    margin: .5rem auto;
    max-width: calc(100vw - 1rem);
  }

  .modal-content {
    max-height: calc(100dvh - 1rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: .9rem;
  }

  .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0 !important;
  }

  .swal2-actions {
    width: 100%;
    padding-inline: .4rem;
  }

  .swal2-actions .swal2-styled {
    flex: 1 1 140px;
  }

  .jumbotron {
    padding: 2rem 1rem !important;
  }

  /* Dashboard: dos tarjetas por fila en móvil mediano y una en móvil estrecho. */
  .dashboard-nav-card .card-body {
    padding: 1rem !important;
  }

  /* Compras: los inputs de precio no se aplastan. */
  .purchase-table {
    min-width: 1080px !important;
  }

  /* POS: resumen debajo del catálogo y tarjetas cómodas al tacto. */
  #xeus-pos-catalog .pos-products-scroll {
    max-height: 56vh !important;
  }

  #xeus-pos-catalog .pos-product-card {
    border-radius: .65rem;
  }

  #xeus-pos-catalog .pos-product-body {
    padding: .55rem !important;
  }

  #cart_summary .card {
    margin-top: .25rem;
  }
}

/* ============================================================
   MÓVIL ESTRECHO (<= 575.98)
   ============================================================ */
@media (max-width: 575.98px) {
  :root {
    --xeus-mobile-gutter: .6rem;
  }

  .header .container-fluid {
    padding-inline: .65rem !important;
  }

  .header .avatar.avatar-md {
    width: 36px;
    height: 36px;
    font-size: .78rem;
  }

  #app-content h1,
  #app-content h2 {
    font-size: 1.28rem !important;
  }

  #app-content p.text-muted {
    font-size: .86rem;
  }

  .card-header.d-flex:not(.xeus-keep-inline),
  .card-footer.d-flex:not(.xeus-keep-inline) {
    align-items: stretch !important;
    flex-direction: column;
  }

  .xeus-page-actions > .btn,
  .xeus-page-actions > a.btn,
  .xeus-page-actions > button.btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .metrics-grid {
    gap: .75rem !important;
  }

  .row.g-3,
  .row.g-4 {
    --bs-gutter-y: .75rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding-block: .75rem !important;
  }

  .footer .ms-auto {
    margin-left: 0 !important;
  }

  .dropdown-menu-end {
    max-width: calc(100vw - 1rem);
  }

  /* El buscador grande del POS/Compras ocupa una línea por control. */
  #purchase-search-form .input-group,
  #searchp .row > [class*="col-"] {
    width: 100%;
  }

  #xeus-pos-catalog .pos-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #xeus-pos-catalog .pos-product-name {
    font-size: .78rem !important;
  }

  #xeus-pos-catalog .pos-product-price {
    font-size: .86rem !important;
  }

  .login-card,
  .auth-card {
    margin-inline: .25rem;
  }
}

@media (max-width: 389.98px) {
  #xeus-pos-catalog .pos-products-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-nav-card .fs-3 {
    font-size: 1.45rem !important;
  }
}

/* ---------- Dispositivos táctiles ---------- */
@media (hover: none), (pointer: coarse) {
  .btn,
  .nav-link,
  .xeus-tab-button,
  .page-link {
    touch-action: manipulation;
  }

  .card-hover:hover,
  #xeus-pos-catalog .pos-product-card:hover {
    transform: none !important;
  }

  .xeus-action-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }
}

/* ---------- Accesibilidad: movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============================================================
   XEUS POS v3.6.30 - MODO TABLET COMPACTO (OPT-IN POR EMPRESA)
   ------------------------------------------------------------
   Cuando la empresa activa "Optimización especial para tablets",
   Xeus POS conserva la composición de escritorio dentro del rango
   típico de tablets actuales y reduce tamaños/espacios en lugar de
   apilar prematuramente los componentes.

   El modo NO afecta teléfonos ni el escritorio normal. El rango
   extendido 1200-1366 px sólo se aplica en dispositivos táctiles.
   ============================================================ */
@media (min-width: 720px) and (max-width: 1199.98px) and (min-height: 560px),
       (min-width: 1200px) and (max-width: 1366px) and (min-height: 560px) and (pointer: coarse) {

  body.xeus-tablet-compact-enabled {
    --xeus-touch-target: 34px;
    --xeus-tablet-font: .82rem;
    --xeus-tablet-gap: .55rem;
  }

  body.xeus-tablet-compact-enabled #app-content {
    padding-inline: .6rem !important;
  }

  body.xeus-tablet-compact-enabled .header {
    margin-bottom: .6rem !important;
  }

  body.xeus-tablet-compact-enabled .header .container-fluid {
    min-height: 52px !important;
    padding-inline: .65rem !important;
  }

  body.xeus-tablet-compact-enabled .header-toggler {
    min-width: 34px !important;
    min-height: 34px !important;
  }

  body.xeus-tablet-compact-enabled .header-toggler .fs-3 {
    font-size: 1.35rem !important;
  }

  body.xeus-tablet-compact-enabled #app-content h1,
  body.xeus-tablet-compact-enabled #app-content h2 {
    font-size: 1.25rem !important;
    margin-bottom: .55rem !important;
    line-height: 1.2;
  }

  body.xeus-tablet-compact-enabled #app-content h3 { font-size: 1.08rem !important; }
  body.xeus-tablet-compact-enabled #app-content h4 { font-size: .98rem !important; }
  body.xeus-tablet-compact-enabled #app-content h5 { font-size: .9rem !important; }

  body.xeus-tablet-compact-enabled #app-content,
  body.xeus-tablet-compact-enabled .card,
  body.xeus-tablet-compact-enabled .dropdown-menu,
  body.xeus-tablet-compact-enabled .modal-content {
    font-size: var(--xeus-tablet-font);
  }

  body.xeus-tablet-compact-enabled .card {
    margin-bottom: .7rem !important;
    border-radius: .55rem !important;
  }

  body.xeus-tablet-compact-enabled .card-header {
    padding: .62rem .78rem !important;
    font-size: .75rem !important;
  }

  body.xeus-tablet-compact-enabled .card-body {
    padding: .78rem !important;
  }

  body.xeus-tablet-compact-enabled .card-footer {
    padding: .6rem .78rem !important;
  }

  body.xeus-tablet-compact-enabled .row {
    --bs-gutter-x: .7rem;
    --bs-gutter-y: .65rem;
  }

  /* Activa en tablet las proporciones que Bootstrap reserva para lg/xl.
     Así las vistas intentan conservar la misma posición de escritorio. */
  body.xeus-tablet-compact-enabled .col-lg-1,
  body.xeus-tablet-compact-enabled .col-xl-1 { flex: 0 0 auto !important; width: 8.33333333% !important; }
  body.xeus-tablet-compact-enabled .col-lg-2,
  body.xeus-tablet-compact-enabled .col-xl-2 { flex: 0 0 auto !important; width: 16.66666667% !important; }
  body.xeus-tablet-compact-enabled .col-lg-3,
  body.xeus-tablet-compact-enabled .col-xl-3 { flex: 0 0 auto !important; width: 25% !important; }
  body.xeus-tablet-compact-enabled .col-lg-4,
  body.xeus-tablet-compact-enabled .col-xl-4 { flex: 0 0 auto !important; width: 33.33333333% !important; }
  body.xeus-tablet-compact-enabled .col-lg-5,
  body.xeus-tablet-compact-enabled .col-xl-5 { flex: 0 0 auto !important; width: 41.66666667% !important; }
  body.xeus-tablet-compact-enabled .col-lg-6,
  body.xeus-tablet-compact-enabled .col-xl-6 { flex: 0 0 auto !important; width: 50% !important; }
  body.xeus-tablet-compact-enabled .col-lg-7,
  body.xeus-tablet-compact-enabled .col-xl-7 { flex: 0 0 auto !important; width: 58.33333333% !important; }
  body.xeus-tablet-compact-enabled .col-lg-8,
  body.xeus-tablet-compact-enabled .col-xl-8 { flex: 0 0 auto !important; width: 66.66666667% !important; }
  body.xeus-tablet-compact-enabled .col-lg-9,
  body.xeus-tablet-compact-enabled .col-xl-9 { flex: 0 0 auto !important; width: 75% !important; }
  body.xeus-tablet-compact-enabled .col-lg-10,
  body.xeus-tablet-compact-enabled .col-xl-10 { flex: 0 0 auto !important; width: 83.33333333% !important; }
  body.xeus-tablet-compact-enabled .col-lg-11,
  body.xeus-tablet-compact-enabled .col-xl-11 { flex: 0 0 auto !important; width: 91.66666667% !important; }
  body.xeus-tablet-compact-enabled .col-lg-12,
  body.xeus-tablet-compact-enabled .col-xl-12 { flex: 0 0 auto !important; width: 100% !important; }

  body.xeus-tablet-compact-enabled .flex-lg-row,
  body.xeus-tablet-compact-enabled .flex-xl-row {
    flex-direction: row !important;
  }

  body.xeus-tablet-compact-enabled .align-items-lg-start,
  body.xeus-tablet-compact-enabled .align-items-xl-start { align-items: flex-start !important; }
  body.xeus-tablet-compact-enabled .align-items-lg-center,
  body.xeus-tablet-compact-enabled .align-items-xl-center { align-items: center !important; }
  body.xeus-tablet-compact-enabled .justify-content-lg-between,
  body.xeus-tablet-compact-enabled .justify-content-xl-between { justify-content: space-between !important; }
  body.xeus-tablet-compact-enabled .justify-content-lg-end,
  body.xeus-tablet-compact-enabled .justify-content-xl-end { justify-content: flex-end !important; }

  body.xeus-tablet-compact-enabled .xeus-page-toolbar {
    flex-direction: row !important;
    align-items: center !important;
  }

  body.xeus-tablet-compact-enabled .xeus-page-actions {
    width: auto !important;
    flex-wrap: nowrap !important;
    gap: .35rem !important;
  }

  body.xeus-tablet-compact-enabled .xeus-page-actions > .btn,
  body.xeus-tablet-compact-enabled .xeus-page-actions > a.btn,
  body.xeus-tablet-compact-enabled .xeus-page-actions > button.btn {
    width: auto !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  body.xeus-tablet-compact-enabled .btn:not(.btn-close) {
    min-height: 32px !important;
    padding: .32rem .55rem !important;
    font-size: .76rem !important;
    line-height: 1.15;
  }

  body.xeus-tablet-compact-enabled .btn-sm:not(.btn-close) {
    min-height: 29px !important;
    padding: .25rem .45rem !important;
    font-size: .7rem !important;
  }

  body.xeus-tablet-compact-enabled .form-label {
    margin-bottom: .25rem;
    font-size: .76rem;
  }

  body.xeus-tablet-compact-enabled .form-control,
  body.xeus-tablet-compact-enabled .form-select,
  body.xeus-tablet-compact-enabled .input-group-text {
    min-height: 34px !important;
    padding: .34rem .5rem !important;
    font-size: .78rem !important;
  }

  body.xeus-tablet-compact-enabled textarea.form-control {
    min-height: 68px !important;
  }

  body.xeus-tablet-compact-enabled .form-text,
  body.xeus-tablet-compact-enabled .small {
    font-size: .7rem !important;
  }

  body.xeus-tablet-compact-enabled .alert {
    padding: .55rem .7rem !important;
    margin-bottom: .65rem;
  }

  body.xeus-tablet-compact-enabled .badge {
    font-size: .64rem;
    padding: .3em .48em;
  }

  /* Tablas: mismas columnas, menor densidad visual. */
  body.xeus-tablet-compact-enabled .table thead th {
    padding: .42rem .48rem !important;
    font-size: .66rem !important;
  }

  body.xeus-tablet-compact-enabled .table tbody td {
    padding: .42rem .48rem !important;
    font-size: .74rem !important;
  }

  body.xeus-tablet-compact-enabled .table-responsive > table.xeus-table-wide,
  body.xeus-tablet-compact-enabled .xeus-auto-table-responsive > table.xeus-table-wide {
    min-width: min(var(--xeus-table-min-width, 680px), 100%) !important;
  }

  body.xeus-tablet-compact-enabled .dataTables_wrapper .row > [class*="col-"],
  body.xeus-tablet-compact-enabled .dt-container .row > [class*="col-"] {
    width: auto !important;
    flex: 1 1 auto !important;
    text-align: inherit !important;
  }

  body.xeus-tablet-compact-enabled .dataTables_wrapper .dataTables_filter,
  body.xeus-tablet-compact-enabled .dt-container .dt-search {
    text-align: right !important;
  }

  body.xeus-tablet-compact-enabled .dataTables_wrapper .dataTables_filter label,
  body.xeus-tablet-compact-enabled .dt-container .dt-search label {
    width: auto !important;
  }

  body.xeus-tablet-compact-enabled .dataTables_wrapper .dataTables_filter input,
  body.xeus-tablet-compact-enabled .dt-container .dt-search input {
    width: 150px !important;
    margin: 0 0 0 .35rem !important;
    min-height: 32px !important;
  }

  body.xeus-tablet-compact-enabled .dataTables_wrapper .pagination,
  body.xeus-tablet-compact-enabled .dt-container .pagination {
    flex-wrap: nowrap !important;
  }

  body.xeus-tablet-compact-enabled .xeus-tabs .xeus-tab-button {
    padding: .5rem .62rem !important;
    font-size: .72rem !important;
  }

  body.xeus-tablet-compact-enabled .xeus-tabs .xeus-tab-panel {
    padding: .65rem !important;
  }

  /* ----------------------------------------------------------
     POS: conservar catálogo y resumen lado a lado como desktop.
     ---------------------------------------------------------- */
  body.xeus-tablet-compact-enabled .xeus-pos-main-row {
    --bs-gutter-x: .65rem;
    align-items: flex-start;
  }

  body.xeus-tablet-compact-enabled .xeus-pos-main-row > .col-xl-9 {
    width: 73% !important;
  }

  body.xeus-tablet-compact-enabled .xeus-pos-main-row > .col-xl-3 {
    width: 27% !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary {
    position: sticky !important;
    top: 62px !important;
    margin-top: 0 !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-heading-row {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: .7rem !important;
    margin-bottom: .55rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-register-tools {
    width: auto !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: .4rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-register-state,
  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-clock {
    min-height: 44px !important;
    border-radius: .55rem;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-state-icon {
    width: 29px !important;
    height: 29px !important;
    flex-basis: 29px !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-register-state {
    padding: .35rem .48rem !important;
    gap: .42rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-clock {
    min-width: 104px !important;
    padding: .32rem .45rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-clock-time {
    font-size: .88rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-state-label,
  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-state-meta,
  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-clock-date {
    font-size: .58rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .pos-state-value {
    font-size: .7rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-register-header .input-group-lg > .form-control,
  body.xeus-tablet-compact-enabled #xeus-pos-register-header .input-group-lg > .input-group-text,
  body.xeus-tablet-compact-enabled #xeus-pos-register-header .input-group-lg > .btn {
    min-height: 36px !important;
    padding-top: .35rem !important;
    padding-bottom: .35rem !important;
    font-size: .76rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .card-body {
    padding: .65rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-category-shell {
    gap: .35rem !important;
    margin-bottom: .55rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-category-tab {
    padding: .4rem .58rem !important;
    font-size: .66rem !important;
    border-radius: .5rem;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-nav-btn {
    width: 30px !important;
    height: 30px !important;
    flex-basis: 30px !important;
    min-height: 30px !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-products-shell {
    padding-right: 36px !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-products-scroll {
    max-height: 61vh !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important;
    gap: .42rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-card {
    border-radius: .55rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-image,
  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-noimage {
    aspect-ratio: 5 / 2.7 !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-noimage {
    font-size: 1.35rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-body {
    padding: .42rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-name {
    font-size: .68rem !important;
    margin-bottom: .12rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-meta {
    font-size: .6rem !important;
    margin-bottom: .1rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-price {
    font-size: .76rem !important;
    margin-bottom: .3rem !important;
  }

  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-card .input-group .form-control,
  body.xeus-tablet-compact-enabled #xeus-pos-catalog .pos-product-card .input-group .btn {
    min-height: 30px !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .card-header {
    padding: .55rem .65rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .card-body,
  body.xeus-tablet-compact-enabled #cart_summary .card-footer {
    padding: .6rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .table th,
  body.xeus-tablet-compact-enabled #cart_summary .table td {
    padding: .35rem .32rem !important;
    font-size: .68rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .form-control,
  body.xeus-tablet-compact-enabled #cart_summary .form-select {
    min-height: 32px !important;
    font-size: .72rem !important;
  }

  /* v3.6.31: densidad tipográfica real para tablet.
     Bootstrap aplica tamaños mediante clases .fs-* y .h*, por lo que
     reducir sólo los elementos h1/h2 no era suficiente en métricas,
     totales y resúmenes laterales. */
  body.xeus-tablet-compact-enabled .fs-1 { font-size: 1.22rem !important; }
  body.xeus-tablet-compact-enabled .fs-2 { font-size: 1.10rem !important; }
  body.xeus-tablet-compact-enabled .fs-3 { font-size: 1rem !important; }
  body.xeus-tablet-compact-enabled .fs-4 { font-size: .92rem !important; }
  body.xeus-tablet-compact-enabled .fs-5 { font-size: .84rem !important; }
  body.xeus-tablet-compact-enabled .fs-6 { font-size: .76rem !important; }
  body.xeus-tablet-compact-enabled .h1 { font-size: 1.18rem !important; }
  body.xeus-tablet-compact-enabled .h2 { font-size: 1.08rem !important; }
  body.xeus-tablet-compact-enabled .h3 { font-size: .98rem !important; }
  body.xeus-tablet-compact-enabled .h4 { font-size: .90rem !important; }
  body.xeus-tablet-compact-enabled .h5 { font-size: .82rem !important; }
  body.xeus-tablet-compact-enabled .h6 { font-size: .75rem !important; }

  /* Resumen POS: los importes no deben partirse en varias líneas. */
  body.xeus-tablet-compact-enabled #cart_summary #posTotalsBox {
    padding: .45rem .52rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posTotalsBox > .d-flex {
    align-items: center !important;
    gap: .35rem !important;
    min-width: 0;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posTotalsBox > .d-flex > span:first-child {
    min-width: 0;
    font-size: .66rem !important;
    line-height: 1.12 !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posGrossAmount,
  body.xeus-tablet-compact-enabled #cart_summary #posDiscountAmount {
    flex: 0 0 auto;
    white-space: nowrap !important;
    font-size: .70rem !important;
    line-height: 1.05 !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posTotalsBox > .d-flex.h5 {
    margin-top: .3rem !important;
    padding-top: .38rem !important;
    font-size: .78rem !important;
    line-height: 1.05 !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posTotalsBox > .d-flex.h5 > span:first-child {
    font-size: .74rem !important;
    font-weight: 700 !important;
    white-space: normal;
  }

  body.xeus-tablet-compact-enabled #cart_summary #posNetAmount {
    flex: 0 0 auto;
    white-space: nowrap !important;
    font-size: .88rem !important;
    line-height: 1 !important;
    letter-spacing: -.015em;
  }

  /* Mantener compactos y legibles los importes de cada línea del carrito. */
  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll th:nth-child(1),
  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll td:nth-child(1) {
    width: 34px;
    white-space: nowrap !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll th:nth-child(3),
  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll td:nth-child(3) {
    width: 72px;
    white-space: nowrap !important;
    font-size: .62rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll th:nth-child(4),
  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll td:nth-child(4) {
    width: 22px;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll th {
    white-space: nowrap !important;
    font-size: .60rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-cart-items-scroll td:nth-child(2) {
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }

  /* Rectificación: mismo criterio de densidad que el resumen de venta. */
  body.xeus-tablet-compact-enabled #cart_summary .pos-correction-summary .correction-kpi {
    gap: .35rem !important;
    padding: .32rem 0 !important;
    font-size: .66rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-correction-summary .correction-kpi strong {
    flex: 0 0 auto;
    white-space: nowrap !important;
    font-size: .70rem !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-correction-summary .correction-difference {
    padding: .48rem .55rem !important;
    margin: .48rem 0 !important;
    font-size: .65rem !important;
    line-height: 1.2 !important;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-correction-summary .correction-difference .d-flex > span:last-child {
    white-space: nowrap !important;
    flex: 0 0 auto;
  }

  body.xeus-tablet-compact-enabled #cart_summary .pos-correction-summary .small.border {
    font-size: .64rem !important;
    line-height: 1.15 !important;
  }

  body.xeus-tablet-compact-enabled .pos-correction-banner {
    padding: .55rem .7rem !important;
    margin-bottom: .65rem !important;
    gap: .55rem !important;
  }

  body.xeus-tablet-compact-enabled .pos-correction-banner .pos-correction-title {
    font-size: .78rem !important;
  }

  body.xeus-tablet-compact-enabled .pos-correction-banner .pos-correction-meta {
    font-size: .65rem !important;
  }
}

/* Ajustes complementarios para tablets compactas de menor ancho (720-767 px),
   donde las reglas móviles normales ya habrían apilado formularios/modales. */
@media (min-width: 720px) and (max-width: 767.98px) and (min-height: 560px) {
  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
  }

  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .form-control,
  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .form-select,
  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .input-group-text,
  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .btn {
    width: auto !important;
    margin-top: 0 !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .form-control,
  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .form-select {
    flex: 1 1 auto !important;
    border-radius: 0 !important;
  }

  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .input-group-text:first-child {
    border-radius: .375rem 0 0 .375rem !important;
  }

  body.xeus-tablet-compact-enabled .xeus-stack-mobile.input-group > .btn:last-child {
    border-radius: 0 .375rem .375rem 0 !important;
  }

  body.xeus-tablet-compact-enabled .form-horizontal .form-group > .control-label {
    width: 26% !important;
    flex: 0 0 26% !important;
  }

  body.xeus-tablet-compact-enabled .form-horizontal .form-group > [class*="col-"] {
    width: 74% !important;
    flex: 0 0 74% !important;
  }

  body.xeus-tablet-compact-enabled .modal-footer {
    display: flex !important;
    grid-template-columns: none !important;
    justify-content: flex-end !important;
    gap: .4rem !important;
  }

  body.xeus-tablet-compact-enabled .modal-footer .btn {
    width: auto !important;
  }
}

/* ============================================================
   Xeus POS v3.7.3.69 - Optimización móvil configurable
   ============================================================ */
@media (max-width: 767.98px) {
  body.xeus-mobile-optimized-enabled #app-content { padding: .65rem !important; }
  body.xeus-mobile-optimized-enabled h1 { font-size: 1.35rem !important; line-height: 1.15; }
  body.xeus-mobile-optimized-enabled h2 { font-size: 1.2rem !important; }
  body.xeus-mobile-optimized-enabled .card { border-radius: 14px !important; }
  body.xeus-mobile-optimized-enabled .card-body { padding: .8rem !important; }
  body.xeus-mobile-optimized-enabled .btn:not(.btn-sm),
  body.xeus-mobile-optimized-enabled .form-control,
  body.xeus-mobile-optimized-enabled .form-select,
  body.xeus-mobile-optimized-enabled .input-group-text { min-height: 44px; }
  body.xeus-mobile-optimized-enabled .xeus-page-toolbar { gap: .65rem !important; }
  body.xeus-mobile-optimized-enabled .xeus-page-actions { width: 100%; display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem !important; }
  body.xeus-mobile-optimized-enabled .xeus-page-actions > .btn { width: 100%; margin: 0 !important; }
  body.xeus-mobile-optimized-enabled .modal-dialog { margin: 0 !important; max-width: none !important; min-height: 100dvh; }
  body.xeus-mobile-optimized-enabled .modal-content { min-height: 100dvh; border: 0; border-radius: 0 !important; }
  body.xeus-mobile-optimized-enabled .modal-dialog-centered { min-height: 100dvh; align-items: stretch; }
  body.xeus-mobile-optimized-enabled .modal-dialog-scrollable { height: 100dvh; }
  body.xeus-mobile-optimized-enabled .modal-footer { position: sticky; bottom: 0; z-index: 3; background: var(--bs-body-bg,#fff); box-shadow: 0 -8px 22px rgba(15,23,42,.08); }
  body.xeus-mobile-optimized-enabled .table-responsive,
  body.xeus-mobile-optimized-enabled .xeus-auto-table-responsive { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.xeus-mobile-optimized-enabled .dataTables_wrapper .row { gap: .4rem; }
  body.xeus-mobile-optimized-enabled .dataTables_wrapper .dataTables_length,
  body.xeus-mobile-optimized-enabled .dataTables_wrapper .dataTables_filter { text-align: left !important; width: 100%; }
  body.xeus-mobile-optimized-enabled .xeus-tab-nav { overflow-x: auto; flex-wrap: nowrap !important; scroll-snap-type: x proximity; padding-bottom: .2rem; }
  body.xeus-mobile-optimized-enabled .xeus-tab-button { flex: 0 0 auto; scroll-snap-align: start; }
  body.xeus-mobile-optimized-enabled #xeus-pos-register-header { gap: .5rem !important; }
  body.xeus-mobile-optimized-enabled #xeus-pos-catalog,
  body.xeus-mobile-optimized-enabled #cart_summary { width: 100% !important; max-width: 100% !important; }
  body.xeus-mobile-optimized-enabled #cart_summary { position: static !important; max-height: none !important; }
  body.xeus-mobile-optimized-enabled #cart_summary .pos-checkout-scroll { max-height: 54dvh !important; overflow-y: auto; }
  body.xeus-mobile-optimized-enabled .pos-products-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: .5rem !important; }
  body.xeus-mobile-optimized-enabled .pos-product-name { font-size: .76rem !important; }
  body.xeus-mobile-optimized-enabled .pos-product-card .btn { min-height: 38px !important; }
  body.xeus-mobile-optimized-enabled .xeus-expenses-actions { width: 100%; display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.xeus-mobile-optimized-enabled .xeus-expenses-actions .btn { width:100%; }
}

@media (max-width: 420px) {
  body.xeus-mobile-optimized-enabled .xeus-page-actions,
  body.xeus-mobile-optimized-enabled .xeus-expenses-actions { grid-template-columns: 1fr; }
  body.xeus-mobile-optimized-enabled .pos-products-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

/* ============================================================
   Xeus POS v3.7.3.206 · Capa adaptativa global de rendimiento
   - safe areas reales (PWA/iPhone/iPad)
   - viewport visual para teclado móvil
   - controles táctiles sin inflar escritorio
   - modo de bajo consumo para hardware limitado
   ============================================================ */
:root{
  --xeus-safe-top:env(safe-area-inset-top,0px);
  --xeus-safe-right:env(safe-area-inset-right,0px);
  --xeus-safe-bottom:env(safe-area-inset-bottom,0px);
  --xeus-safe-left:env(safe-area-inset-left,0px);
  --xeus-viewport-height:100dvh;
}

body.xeus-device-touch .btn,
body.xeus-device-touch .form-control,
body.xeus-device-touch .form-select,
body.xeus-device-touch .input-group-text,
body.xeus-device-touch .page-link{
  touch-action:manipulation;
}

body.xeus-device-touch .btn:not(.btn-sm):not(.btn-link),
body.xeus-device-touch .form-control:not(.form-control-sm),
body.xeus-device-touch .form-select:not(.form-select-sm){
  min-height:42px;
}

/* El contenido respeta muescas y barras del sistema sin dejar huecos en desktop. */
body.xeus-device-mobile #app-content{
  padding-left:max(var(--xeus-mobile-gutter),var(--xeus-safe-left))!important;
  padding-right:max(var(--xeus-mobile-gutter),var(--xeus-safe-right))!important;
  padding-bottom:max(.75rem,var(--xeus-safe-bottom))!important;
}

body.xeus-standalone > .wrapper > .header{
  padding-top:var(--xeus-safe-top);
}

/* Formularios: iOS no hace zoom automático al enfocar entradas >=16px. */
@media (max-width:767.98px){
  body.xeus-device-mobile input.form-control,
  body.xeus-device-mobile select.form-select,
  body.xeus-device-mobile textarea.form-control,
  body.xeus-device-mobile .select2-selection{
    font-size:max(16px,.875rem);
  }

  body.xeus-device-mobile .card-header.d-flex,
  body.xeus-device-mobile .card-footer.d-flex{
    flex-wrap:wrap;
  }

  body.xeus-device-mobile .xeus-page-toolbar{
    align-items:stretch!important;
  }

  body.xeus-device-mobile .modal-content{
    max-height:var(--xeus-viewport-height,100dvh)!important;
  }

  body.xeus-device-mobile .modal-body{
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
  }

  body.xeus-device-mobile .modal-footer{
    padding-bottom:max(.75rem,var(--xeus-safe-bottom))!important;
  }

  body.xeus-keyboard-open .modal-dialog,
  body.xeus-keyboard-open .modal-content,
  body.xeus-keyboard-open .modal-dialog-scrollable{
    min-height:0!important;
    height:var(--xeus-viewport-height)!important;
    max-height:var(--xeus-viewport-height)!important;
  }
}

/* Tablet: densidad intermedia y acciones táctiles sin convertir todo en móvil. */
@media (min-width:768px) and (max-width:1199.98px){
  body.xeus-device-tablet #app-content{padding:.75rem!important}
  body.xeus-device-tablet .card-body{padding:.9rem}
  body.xeus-device-tablet .btn:not(.btn-sm),
  body.xeus-device-tablet .form-control:not(.form-control-sm),
  body.xeus-device-tablet .form-select:not(.form-select-sm){min-height:42px}
  body.xeus-device-tablet .table-responsive,
  body.xeus-device-tablet .xeus-auto-table-responsive{-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
}

/* En tablets estrechas cinco o más acciones no caben en una fila. El modo
   compacto conserva densidad, pero permite envolver controles sin recortarlos. */
@media (min-width:720px) and (max-width:820px){
  body.xeus-tablet-compact-enabled .xeus-page-toolbar{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  body.xeus-tablet-compact-enabled .xeus-page-actions{
    width:100%!important;
    flex-wrap:wrap!important;
  }
  body.xeus-tablet-compact-enabled .xeus-page-actions > .btn,
  body.xeus-tablet-compact-enabled .xeus-page-actions > a.btn,
  body.xeus-tablet-compact-enabled .xeus-page-actions > button.btn{
    white-space:normal!important;
  }
}

/* Pantallas bajas (portátiles pequeños/tablet horizontal): aprovechamiento vertical. */
body.xeus-compact-height #app-content{padding-top:.55rem!important;padding-bottom:.55rem!important}
body.xeus-compact-height .card{margin-bottom:.65rem}
body.xeus-compact-height .card-header{padding-top:.55rem;padding-bottom:.55rem}

/* Hardware de pocos recursos / ahorro de datos: conserva funcionalidad y elimina
   trabajo puramente visual que consume composición/GPU. */
body.xeus-low-resource *,
body.xeus-low-resource *::before,
body.xeus-low-resource *::after{
  scroll-behavior:auto!important;
}
body.xeus-low-resource .card,
body.xeus-low-resource .modal-content,
body.xeus-low-resource .dropdown-menu,
body.xeus-low-resource .xeus-native-toast{
  box-shadow:none!important;
}
body.xeus-low-resource .xeus-sidebar-backdrop,
body.xeus-low-resource .modal-backdrop{
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
body.xeus-low-resource .btn,
body.xeus-low-resource .card,
body.xeus-low-resource .modal,
body.xeus-low-resource .dropdown-menu,
body.xeus-low-resource .xeus-native-toast{
  transition-duration:.01ms!important;
  animation-duration:.01ms!important;
}

/* Cuando la pestaña queda en segundo plano no se gastan ciclos en animaciones. */
body.xeus-page-hidden *,body.xeus-page-hidden *::before,body.xeus-page-hidden *::after{
  animation-play-state:paused!important;
}

@media (prefers-reduced-motion:reduce){
  .xeus-sidebar-backdrop,.modal,.modal-dialog,.xeus-native-toast,.btn{transition:none!important}
}

/* Foco de teclado visible sin alterar la geometría ni el scroll de la tabla. */
.table-responsive[tabindex]:focus-visible,
.xeus-auto-table-responsive[tabindex]:focus-visible,
.xeus-sale-products-list[tabindex]:focus-visible{
  outline:2px solid var(--cui-primary,#5856d6);
  outline-offset:-2px;
}
