/* Sistema POS: reemplazo local de las utilidades Tailwind utilizadas por las pantallas operativas. */
*, *::before, *::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: #e5e7eb; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; line-height: inherit; }
button, input, select, textarea { font: inherit; margin: 0; }
button { cursor: pointer; text-transform: none; background: transparent; }
button:disabled { cursor: default; }
img, svg { display: block; vertical-align: middle; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
h1, h2, h3, p { margin: 0; }

/* Layout */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.min-h-0 { min-height: 0; }
.w-full { width: 100%; }
.w-40 { width: 10rem; }
.w-44 { width: 11rem; }
.w-48 { width: 12rem; }
.w-56 { width: 14rem; }
.w-80 { width: 20rem; }
.w-\[600px\] { width: 600px; }
.w-\[40\%\] { width: 40%; }
.w-\[60\%\] { width: 60%; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: .5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: .75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Spacing */
.m-0 { margin: 0; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.ml-2 { margin-left: .5rem; }
.mr-1 { margin-right: .25rem; }
.mr-2 { margin-right: .5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.p-2 { padding: .5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-10 { padding: 2.5rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.pt-4 { padding-top: 1rem; }

/* Size and overflow */
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-h-full { max-height: 100%; }
.max-h-\[400px\] { max-height: 400px; }
.max-h-\[calc\(100vh-2rem\)\] { max-height: calc(100vh - 2rem); }
.min-w-\[1100px\] { min-width: 1100px; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overscroll-contain { overscroll-behavior: contain; }

/* Typography */
.font-sans { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.leading-none { line-height: 1; }

/* Colors */
.bg-white { background-color: #fff; }
.bg-black { background-color: #000; }
.bg-neutral-100 { background-color: #f5f5f5; }
.bg-neutral-700 { background-color: #404040; }
.bg-neutral-800 { background-color: #262626; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-400 { background-color: #9ca3af; }
.bg-gray-700 { background-color: #374151; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-600 { background-color: #16a34a; }
.bg-green-700 { background-color: #15803d; }
.bg-indigo-600 { background-color: #4f46e5; }
.text-black { color: #000; }
.text-white { color: #fff; }
.text-cyan-300 { color: #67e8f9; }
.text-gray-300 { color: #d1d5db; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-red-600 { color: #dc2626; }

/* Borders, radius and effects */
.border { border-width: 1px; }
.border-r { border-right-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-white { border-color: #fff; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-400 { border-color: #9ca3af; }
.border-gray-500 { border-color: #6b7280; }
.border-gray-700 { border-color: #374151; }
.rounded { border-radius: .25rem; }
.rounded-lg { border-radius: .5rem; }
.rounded-2xl { border-radius: 1rem; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0,0,0,.05); }
.sticky { position: sticky; }
.fixed { position: fixed; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Interaction */
.transition { transition-property: color, background-color, border-color, opacity, box-shadow, transform; transition-duration: 150ms; transition-timing-function: ease; }
.duration-300 { transition-duration: 300ms; }
.opacity-50 { opacity: .5; }
.opacity-60 { opacity: .6; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(96,165,250,.8); }
.hover\:bg-blue-600:hover { background-color: #2563eb; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-green-800:hover { background-color: #166534; }
.hover\:bg-gray-400:hover { background-color: #9ca3af; }
.disabled\:opacity-50:disabled { opacity: .5; }
.disabled\:opacity-60:disabled { opacity: .6; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* Tablas y controles usados por el POS */
.table-auto { table-layout: auto; }
.w-full table { width: 100%; }
.border-collapse { border-collapse: collapse; }
.text-white.border { border-color: #fff; }
input, select, textarea { border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 2px rgba(96,165,250,.8); }

@media (min-width: 768px) {
  .md\:w-\[40\%\] { width: 40%; }
  .md\:w-\[60\%\] { width: 60%; }
}

@media (max-width: 767px) {
  .grid-cols-6 { grid-template-columns: 1fr; }
  .w-56, .w-80, .w-48, .w-44, .w-40 { width: 100%; }
  .p-10 { padding: 1.5rem; }
  .md\:w-\[40\%\], .md\:w-\[60\%\] { width: 100%; }
}

/* Ajustes de los modales dinámicos creados por funciones.js */
#modalEntregaPOS, #modalPagoPOS, #modalResultados { background-color: rgba(0,0,0,.7); padding: 1rem; }
#modalEntregaPOS > div, #modalPagoPOS > div, #modalResultados > div { box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); }
#modalEntregaPOS > div { width: 100%; max-width: 32rem; }
#modalPagoPOS > div { width: 100%; max-width: 28rem; max-height: calc(100vh - 2rem); overflow-y: auto; border-radius: .5rem; padding: 1.5rem; }
#modalResultados > div { width: 100%; max-width: 600px; }
#modalEntregaPOS select, #modalPagoPOS button, #modalResultados button { min-height: 40px; }
#modalPagoPOS h2 { color: #111827; letter-spacing: .01em; }
#modalPagoPOS #resumenPagoPOS { color: #374151; line-height: 1.5; }
#modalPagoPOS .grid { gap: .75rem; }
#modalPagoPOS button { border-radius: .5rem; font-weight: 600; transition: background-color .18s ease, transform .15s ease, box-shadow .18s ease; }
#modalPagoPOS button:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.18); }
#modalPagoPOS button[onclick*="pagarEfectivoPOS"] { background-color: #15803d; color: #fff; }
#modalPagoPOS button[onclick*="pagarTransferenciaPOS"] { background-color: #1d4ed8; color: #fff; }
#modalPagoPOS button[onclick*="cerrarModalPagoPOS"] { min-height: 34px; color: #374151; background: transparent; box-shadow: none; }
#modalPagoPOS button[onclick*="cancelarTransferenciaPOS"] { background-color: #d1d5db; color: #111827; }
#qrTransferenciaPOS { display: flex; justify-content: center; }

/* Estilos específicos de botones de acción para conservar el aspecto del POS */
#btnCrearCliente, #btnBuscarVentas, #btnGenerarPDF, #btnEnviarPDF, #realizarVentaBtn { transition: background-color .2s ease, transform .15s ease, box-shadow .2s ease; }
#btnCrearCliente:hover, #btnBuscarVentas:hover, #btnGenerarPDF:hover, #btnEnviarPDF:hover, #realizarVentaBtn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.22); }

/* Compatibilidad con las etiquetas de estado creadas dinámicamente */
#tablaVentasBody span { display: inline-flex; align-items: center; min-height: 26px; }
