/* Custom styles for Sistema POS - AdminLTE 3 */

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    min-height: 100vh;
}
.login-card-body {
    padding: 30px;
}
.login-logo a {
    color: #fff;
    font-size: 2rem;
}
.login-logo .brand-pos {
    color: #3b82f6;
}
.login-logo .brand-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    display: block;
}

/* Sidebar — Estilos base movidos a admin.css y pos.css (light theme) */

/* Cards */
.card {
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}
.card-header {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px 10px 0 0 !important;
}
.card-title {
    font-weight: 700;
    color: #1e293b;
}

/* Small info boxes */
.small-box {
    border-radius: 10px;
}
.small-box .inner h3 {
    font-weight: 700;
}

/* Tables */
.table thead th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.table tbody tr:hover {
    background-color: #f8fafc;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

/* Buttons */
.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
}
.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}
/* `btn-success` sigue al tema como todo lo demás. Estos verdes fijos eran los
   que hacían que el «Guardar Configuración» del POS saliera verde aunque la
   caja estuviera en cyan o en morado. */
.btn-success {
    background-color: var(--acento, #7e22ce);
    border-color: var(--acento, #7e22ce);
}
.btn-success:hover {
    background-color: var(--acento-fuerte, #6b21a8);
    border-color: var(--acento-fuerte, #6b21a8);
}
.btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
}
.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}
.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
}
.btn-secondary {
    background-color: #64748b;
    border-color: #64748b;
}

/* Forms */
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25);
}

/* Content wrapper */
.content-wrapper {
    background: #f1f5f9 !important;
}

/* POS specific styles */
.pos-total-display {
    background: linear-gradient(135deg, var(--pos-total-primary, #1e40af) 0%, var(--pos-total-secondary, #3b82f6) 100%);
    color: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 15px;
}
.pos-total-display .total-amount {
    font-size: 5.6rem;
    font-weight: 800;
    letter-spacing: -2px;
}
/* v1.0.62: contador de productos distintos en el card del TOTAL.
   Posicionado absoluto a la derecha para que el TOTAL siga centrado
   sin desplazarse según haya o no contador visible. Mismo estilo
   tipográfico (blanco, weight 800), tamaño proporcional al total. */
.pos-total-display {
    position: relative;
}
.pos-total-display .total-counter-wrapper {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}
.pos-total-display .total-counter {
    font-size: 3.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.pos-total-display .total-counter-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.pos-total-display.has-change {
    background: linear-gradient(135deg, var(--pos-change-primary, #15803d) 0%, var(--pos-change-secondary, #16a34a) 100%);
}
.pos-search-input {
    font-size: 1.5rem !important;
    height: 60px !important;
    font-weight: 700;
}
.pos-cart-table th {
    font-size: 0.9rem;
}
.pos-cart-table td {
    font-size: 0.95rem;
    vertical-align: middle;
}
.pos-cart-table tr.selected {
    background-color: #dbeafe !important;
}
.pos-hints {
    color: #94a3b8;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
}
.pos-hints .main-hint {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
}

/* Product card view */
.product-field {
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.product-field .field-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}
.product-field .field-value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
}

/* Badge styles */
/* «Activo» pasa al tema: no era «esto salió bien» sino «este registro está
   habilitado», que es una etiqueta de estado como cualquier otra. El
   `badge-inactivo` de abajo se queda rojo, que ahí sí informa. */
.badge-activo {
    background-color: var(--acento, #7e22ce);
}
.badge-inactivo {
    background-color: #dc2626;
}

/* Scrollable sections */
.scroll-section {
    max-height: 500px;
    overflow-y: auto;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide number input spinners */
input.no-spinners::-webkit-outer-spin-button,
input.no-spinners::-webkit-inner-spin-button,
input.conteo-input::-webkit-outer-spin-button,
input.conteo-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input.no-spinners[type=number],
input.conteo-input[type=number] {
    -moz-appearance: textbox;
    appearance: textbox;
}

/* Modal improvements - centered and AdminLTE themed */
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
}
.modal-header.bg-primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
}
.modal-header.bg-success {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%) !important;
}
.modal-header.bg-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
}
.modal-header.bg-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
}
.modal-title {
    font-weight: 700;
    color: #1e293b;
}
.modal-header.bg-primary .modal-title,
.modal-header.bg-success .modal-title,
.modal-header.bg-danger .modal-title,
.modal-header.bg-warning .modal-title {
    color: #fff;
}
.modal-footer {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 10px 10px;
}

/* Tiquete térmico - Formato 80mm */
.tiquete-thermal {
    font-family: 'Courier New', monospace;
    width: 80mm;
    background: white;
    padding: 5mm;
    font-size: 11px;
    line-height: 1.4;
    color: #000;
    box-sizing: border-box;
}
.tiq-pre {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    white-space: pre;
    overflow: visible;
}
.tiq-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 2px;
}
.tiq-subheader {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 2px;
}
.tiq-title {
    font-size: 14px;
    font-weight: bold;
    margin: 5px 0;
}
.tiq-subtitle {
    font-size: 12px;
    font-weight: bold;
    margin: 5px 0;
}
.tiq-text {
    font-size: 11px;
    margin: 2px 0;
}
.tiq-separator {
    font-size: 11px;
    margin: 3px 0;
    font-weight: normal;
}
.tiq-table {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
}
.tiq-table th,
.tiq-table td {
    padding: 2px 0;
    font-size: 11px;
}
.tiq-table thead th {
    border-bottom: 1px solid #000;
    font-weight: bold;
}
.tiq-table-totales {
    width: 100%;
    font-size: 11px;
}
.tiq-table-totales td {
    padding: 2px 0;
}
.tiq-total {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin: 5px 0;
}
.tiq-pago {
    font-size: 11px;
    margin: 2px 0;
}
.tiq-cambio {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin: 8px 0;
    padding: 5px 0;
}
.tiq-table-totales .font-weight-bold {
    font-weight: bold;
}
.tiq-iva {
    font-size: 11px;
    margin: 2px 0;
}
.tiq-dian {
    font-size: 10px;
    margin: 2px 0;
}
.tiq-footer {
    font-size: 11px;
    margin: 2px 0;
}

/* ═══ Logo del negocio como fondo en la tabla de productos del POS ═══
   Marca de agua constante detrás del contenido. Visible siempre, y el
   texto de la tabla queda encima con fondo transparente. */
.pos-cart-logo-bg {
    position: relative;
}
.pos-cart-logo-bg.has-logo::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--pos-logo-url);
    background-repeat: no-repeat;
    background-position: center;
    background-size: min(70%, 380px) auto;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}
.pos-cart-logo-bg > table {
    position: relative;
    z-index: 1;
    background-color: transparent;
}
/* Todas las filas del carrito en modo "logo visible": fondo transparente
   para que se vea el logo detrás, el texto encima. Bootstrap aplica el
   background en los `<td>` individuales con alta especificidad, así que
   hay que forzarlo con !important. La fila seleccionada conserva un
   tinte azul sutil para marcar el foco. */
.pos-cart-logo-bg.has-logo > table > tbody > tr,
.pos-cart-logo-bg.has-logo > table > tbody > tr > td,
.pos-cart-logo-bg.has-logo > table > tbody > tr > th,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-light,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-light > td,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-light > th {
    background-color: transparent !important;
}
/* La fila seleccionada, en el color del tema.
 *
 * Estaba en `rgba(184, 218, 255, 0.55)` —un azul claro fijo— y esta regla le
 * ganaba por especificidad a la de `pos.css`, así que la selección seguía
 * azul aunque el resto de la caja fuera de otro color. Era el último azul
 * hardcodeado de la pantalla de venta.
 *
 * Se mezcla contra TRANSPARENTE y no contra blanco: el logo del negocio va
 * detrás de la tabla y la fila tiene que dejarlo ver, que es el motivo por el
 * que todas las demás filas son transparentes acá. */
.pos-cart-logo-bg.has-logo > table > tbody > tr.selected,
.pos-cart-logo-bg.has-logo > table > tbody > tr.selected > td,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-primary,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-primary > td {
    background-color: color-mix(in srgb, var(--acento, #7e22ce) 26%, transparent) !important;
}
/* La barra de la izquierda: se ve de reojo mientras se scrollea. */
.pos-cart-logo-bg.has-logo > table > tbody > tr.selected > td:first-child,
.pos-cart-logo-bg.has-logo > table > tbody > tr.table-primary > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--acento, #7e22ce);
}
/* Hover sutil que no tape el logo. En el tono del tema en vez de negro: un
   gris encima del logo lo ensucia, una tinta del acento lo acompaña. */
.pos-cart-logo-bg.has-logo > table.table-hover > tbody > tr:hover,
.pos-cart-logo-bg.has-logo > table.table-hover > tbody > tr:hover > td {
    background-color: color-mix(in srgb, var(--acento, #7e22ce) 10%, transparent) !important;
}
.pos-cart-logo-bg.has-logo > table > tbody > tr > td {
    /* Texto un pelín reforzado con sombra blanca suave para legibilidad
       sobre zonas más cargadas del logo. */
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
}

/* ═══ Tiquete modo REDUCIDO (ahorro de papel) ═══
   Mantiene el mismo contenido pero reduce fuente, line-height y márgenes.
   Separadores se comprimen visualmente. Se aplica con la clase
   `tiquete-reducido` al mismo div que lleva `tiquete-thermal`. */
.tiquete-thermal.tiquete-reducido {
    font-size: 0.85em;
    line-height: 1.15;
}
.tiquete-thermal.tiquete-reducido .tiq-header {
    font-size: 13px;
    margin-bottom: 1px;
}
.tiquete-thermal.tiquete-reducido .tiq-subheader,
.tiquete-thermal.tiquete-reducido .tiq-title,
.tiquete-thermal.tiquete-reducido .tiq-subtitle {
    font-size: 11px;
    margin: 2px 0;
}
.tiquete-thermal.tiquete-reducido .tiq-text,
.tiquete-thermal.tiquete-reducido .tiq-pago,
.tiquete-thermal.tiquete-reducido .tiq-iva,
.tiquete-thermal.tiquete-reducido .tiq-dian,
.tiquete-thermal.tiquete-reducido .tiq-footer {
    font-size: 10px;
    margin: 1px 0;
}
.tiquete-thermal.tiquete-reducido .tiq-separator {
    font-size: 10px;
    margin: 1px 0;
}
.tiquete-thermal.tiquete-reducido .tiq-table th,
.tiquete-thermal.tiquete-reducido .tiq-table td {
    padding: 1px 0;
    font-size: 10px;
}
.tiquete-thermal.tiquete-reducido .tiq-total,
.tiquete-thermal.tiquete-reducido .tiq-cambio {
    font-size: 14px; /* TOTAL sigue destacado pero un pelín menor */
    margin: 3px 0;
}
.tiquete-thermal.tiquete-reducido .tiq-pre {
    font-size: 10.5px;
    line-height: 1.1;
}

/* ═══ Sidebar Lavadero ═══ */
/* Estilos lavadero sidebar manejados en pos.css y admin.css */

/* Fix z-index para menús desplegables del sidebar */
.sidebar .nav-treeview {
    position: relative;
    z-index: 1;
}
.sidebar .nav-item.has-treeview > .nav-treeview {
    position: relative;
    z-index: auto;
}

/* Print styles */
@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }
    .main-sidebar, .main-header, .main-footer, .no-print, .modal-header, .modal-footer {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
    }
    .modal-body {
        padding: 0 !important;
    }
    .tiquete-thermal {
        width: 80mm;
        padding: 2mm;
        margin: 0 auto;
        color: #000 !important;
        box-sizing: border-box;
    }
}

/* ═══ Snapshot Monitoring (Diagnóstico de Tablas) ═══ */
.tr-snapshot-new > td {
    background-color: #d4edda !important;
    border-left: 3px solid #28a745;
}
.tr-snapshot-modified > td {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}
.tr-snapshot-new:hover > td {
    background-color: #c3e6cb !important;
}
.tr-snapshot-modified:hover > td {
    background-color: #ffeeba !important;
}

/* ============================================================
   MEDIOS DE PAGO — INPUTS GRANDES Y UNIFORMES EN MODALES
   Aplica a TODOS los modales de pago del sistema admin
   ============================================================ */
.cm-medio-input,
.go-medio-input,
.liq-medio-input,
.adel-medio-input,
.abono-medio-input {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    height: auto !important;
    border-width: 2px !important;
}
.cm-medio-input:focus,
.go-medio-input:focus,
.liq-medio-input:focus,
.adel-medio-input:focus,
.abono-medio-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(99,102,241,0.18) !important;
}
.cm-medio-label {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Cards visuales para Caja Mayor */
.cm-card-saldo {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cm-card-saldo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.10);
}

/* CartaBastos — cambios de precio pendientes: highlight pulsante para el
   item recién reasociado / editado / creado, para que el operador no
   pierda la referencia visual en lotes grandes. (Fase 5.7) */
@keyframes cbHighlightFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: #fff3cd; }
}
.cb-highlight-flash > td {
    animation: cbHighlightFlash 1s ease-in-out 3;
}

