/*
 * POS Gourmet — interfaz del punto de venta.
 * Se apoya en Bootstrap 3 (modales y pestañas que usa posgourmet.js) y sobrescribe
 * los estilos en línea que el JS heredado genera para categorías, productos y detalle.
 */

:root {
    --pos-bg: #eef1f5;
    --pos-surface: #ffffff;
    --pos-surface-2: #f6f7f9;
    --pos-border: #dde2e8;
    --pos-text: #1f2933;
    --pos-muted: #6b7785;
    --pos-topbar: #1d2633;
    --pos-topbar-2: #2a3545;
    --pos-accent: #f2711c;
    --pos-accent-dark: #d65d0e;
    --pos-accent-soft: #fff1e6;
    --pos-success: #1f9d55;
    --pos-danger: #d64545;
    --pos-radius: 12px;
    --pos-radius-sm: 8px;
    --pos-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --pos-ticket-width: 430px;
    --pos-topbar-height: 60px;
}

/* ---------- Base ---------- */
html, body.pos-body { height: 100%; }

body.pos-body {
    margin: 0;
    overflow: hidden;
    background: var(--pos-bg);
    color: var(--pos-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

body.pos-body-login {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--pos-topbar) 0%, #34465e 100%);
}

body.pos-body-login .pos-app { display: none; }

.pos-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.pos-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pos-muted);
}

.pos-hint { color: var(--pos-muted); margin: 12px 4px; }

/* ---------- Barra superior ---------- */
.pos-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--pos-topbar-height);
    padding: 0 16px;
    background: var(--pos-topbar);
    color: #fff;
    flex-shrink: 0;
}

.pos-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    white-space: nowrap;
}

.pos-brand img { height: 32px; width: 32px; object-fit: contain; }
.pos-brand strong { color: var(--pos-accent); margin-left: 2px; }

.pos-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.pos-search .fa {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b1;
}

.pos-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1px solid transparent;
    border-radius: 19px;
    background: var(--pos-topbar-2);
    color: #fff;
    outline: none;
    transition: border-color .15s, background .15s;
}

.pos-search input::placeholder { color: #9aa5b1; }
.pos-search input:focus { border-color: var(--pos-accent); background: #111823; }

.pos-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.pos-chip,
#labelUsuario,
#labelTipoCambio,
#labelTurno {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    margin: 0;
    border-radius: 17px;
    background: var(--pos-topbar-2);
    font-size: 13px !important;
    font-weight: 600;
    white-space: nowrap;
}

.pos-topbar .fa { color: var(--pos-accent); }
.pos-search .fa { color: #9aa5b1; }
.pos-icon-btn .fa { color: inherit; }

.pos-chip-select select {
    background: transparent;
    border: 0;
    color: #fff;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    max-width: 150px;
}

.pos-chip-select option { color: var(--pos-text); }

.pos-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    padding: 0 6px;
}

.pos-clock #h1reloj {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pos-clock #h3FechaActual { color: #9aa5b1; font-size: 11px; }

.pos-topbar-actions { display: flex; gap: 6px; margin: 0; }

.pos-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--pos-topbar-2);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
}

.pos-icon-btn:hover { background: #3b4a5f; color: #fff; text-decoration: none; }
.pos-icon-btn.disabled { opacity: .45; cursor: not-allowed; }
.pos-icon-btn-danger:hover { background: var(--pos-danger); }

/* ---------- Distribución principal ---------- */
.pos-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--pos-ticket-width);
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 12px;
}

.pos-workspace,
.pos-ticket {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--pos-surface);
    border-radius: var(--pos-radius);
    box-shadow: var(--pos-shadow);
}

/* ---------- Pestañas ---------- */
.pos-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.pos-tabs > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--pos-radius-sm) var(--pos-radius-sm) 0 0;
    color: var(--pos-muted);
    font-weight: 600;
    border-bottom: 3px solid transparent;
}

.pos-tabs > li > a:hover,
.pos-tabs > li > a:focus { background: var(--pos-surface-2); color: var(--pos-text); }

.pos-tabs > li.active > a,
.pos-tabs > li.active > a:hover {
    color: var(--pos-accent-dark);
    border-bottom-color: var(--pos-accent);
    background: transparent;
}

.pos-badge {
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--pos-accent);
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.pos-tab-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.pos-tab-content > .tab-pane { height: 100%; }
.pos-tab-content > .tab-pane.active { display: flex; flex-direction: column; }

.pos-pane { padding: 16px; overflow-y: auto; }

.pos-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pos-pane-header h4 { margin: 0; font-weight: 700; }
.pos-pane-header select { max-width: 280px; }

/* ---------- Categorías (botones generados por el JS) ---------- */
.pos-categorias {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    flex-shrink: 0;
    max-height: none !important;
    min-height: 0 !important;
    background: var(--pos-surface) !important;
    border-bottom: 1px solid var(--pos-border);
}

.pos-categorias > button,
.pos-categorias > button.botonCategoria,
.pos-categorias > button.botonCategoriaMobil {
    flex-shrink: 0;
    width: auto !important;
    height: 40px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    border: 1px solid var(--pos-border) !important;
    border-radius: 20px !important;
    background: var(--pos-surface-2) !important;
    color: var(--pos-text) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    white-space: nowrap;
    cursor: pointer;
}

.pos-categorias > button:hover { border-color: var(--pos-accent) !important; color: var(--pos-accent-dark) !important; }

.pos-categorias > button.clickMenuGrupo {
    background: var(--pos-accent) !important;
    border-color: var(--pos-accent) !important;
    color: #fff !important;
}

/* ---------- Productos (botones generados por el JS) ---------- */
.pos-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: 112px;
    gap: 10px;
    flex: 1;
    align-content: start;
    padding: 12px;
    margin: 0 !important;
    overflow-y: auto;
    max-height: none !important;
    min-height: 0 !important;
    background: var(--pos-surface-2) !important;
}

.pos-productos > button.btnMenu,
.pos-productos > a.btnMenu > div > .btn {
    position: relative;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 10px 10px 8px !important;
    border: 0 !important;
    border-radius: var(--pos-radius-sm) !important;
    overflow: hidden;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35) !important;
    white-space: normal !important;
    box-shadow: var(--pos-shadow) !important;
    transition: transform .08s ease, box-shadow .15s ease;
}

/* Capa para asegurar contraste sobre el color configurado de cada producto */
.pos-productos > button.btnMenu::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .28) 100%);
    pointer-events: none;
}

.pos-productos > button.btnMenu::after {
    content: "Bs " attr(precio);
    position: relative;
    align-self: flex-end;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .92);
    color: var(--pos-text);
    font-size: 12px;
    text-shadow: none;
}

.pos-productos > button.btnMenu:hover { box-shadow: 0 6px 14px rgba(16, 24, 40, .18) !important; }
.pos-productos > button.btnMenu:active { transform: scale(.97); }

/* Productos con foto: el JS heredado genera <a><div><div.btn><img><span>; se rediseña como tarjeta */
.pos-productos > a.btnMenu {
    position: relative;
    display: block !important;
    height: 100%;
    border-radius: var(--pos-radius-sm);
    overflow: hidden;
    box-shadow: var(--pos-shadow);
    text-decoration: none;
    transition: transform .08s ease, box-shadow .15s ease;
}

.pos-productos > a.btnMenu:hover { box-shadow: 0 6px 14px rgba(16, 24, 40, .18); }
.pos-productos > a.btnMenu:active { transform: scale(.97); }
.pos-productos > a.btnMenu > div { display: block !important; width: 100% !important; height: 100%; padding: 0 !important; }

.pos-productos > a.btnMenu > div > .btn {
    display: block !important;
    padding: 0 !important;
    background: var(--pos-topbar-2) !important;
    box-shadow: none !important;
}

/* Degradado para que el nombre se lea sobre cualquier foto */
.pos-productos > a.btnMenu > div > .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .78) 100%);
    pointer-events: none;
}

.pos-productos > a.btnMenu .col-lg-6 { position: static !important; float: none; width: auto; padding: 0 !important; }

.pos-productos > a.btnMenu img {
    position: absolute !important;
    inset: 0;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.pos-productos > a.btnMenu span {
    position: absolute !important;
    z-index: 2;
    left: 10px !important;
    right: 10px;
    top: auto !important;
    bottom: 8px;
    color: #fff;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6) !important;
}

.pos-productos > a.btnMenu::after {
    content: "Bs " attr(precio);
    position: absolute;
    z-index: 3;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .92);
    color: var(--pos-text);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Mesas ---------- */
.pos-mesas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    height: auto !important;
}

.pos-mesas > button {
    width: 100% !important;
    height: 80px !important;
    margin: 0 !important;
    border: 2px dashed #b9c3cf !important;
    border-radius: var(--pos-radius-sm) !important;
    background: var(--pos-surface-2);
    color: var(--pos-text) !important;
    font-size: 18px !important;
    font-weight: 700;
    white-space: normal !important;
}

.pos-mesas > button.agregarPM { background: var(--pos-surface-2) !important; }
.pos-mesas > button.aumentarPM { border-style: solid !important; border-color: rgba(0, 0, 0, .15) !important; }
.pos-mesas > button .fa { display: block; font-size: 16px; opacity: .7; margin-bottom: 4px; }

/* ---------- Formularios de caja / domicilio ---------- */
.pos-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }

.pos-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.pos-form-grid > label { font-size: 12px; font-weight: 600; color: var(--pos-muted); margin: 0; }
.pos-form-grid > label > .form-control { margin-top: 4px; color: var(--pos-text); }
.pos-span-2 { grid-column: span 2; }
.pos-span-4 { grid-column: span 4; }

.pos-checks { display: flex; gap: 20px; margin-bottom: 12px; }
.pos-checks label { font-weight: 600; cursor: pointer; }

.pos-table-wrap { border: 1px solid var(--pos-border); border-radius: var(--pos-radius-sm); overflow: hidden; }

/* ---------- Tablas ---------- */
.pos-table { margin: 0; }

.pos-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px;
    border-bottom: 1px solid var(--pos-border) !important;
    background: var(--pos-surface-2);
    color: var(--pos-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pos-table > tbody > tr > td { padding: 8px; vertical-align: middle; border-top: 1px solid var(--pos-border) !important; }

/* ---------- Ticket ---------- */
.pos-ticket { overflow: hidden; }

.pos-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--pos-border);
}

.pos-ticket-head > div:first-child { display: flex; align-items: baseline; gap: 8px; }

.pos-orden {
    width: 64px;
    border: 0;
    background: transparent;
    font-size: 22px;
    font-weight: 800;
    color: var(--pos-text);
}

.pos-ticket-head-actions { display: flex; gap: 6px; }

.pos-procesando {
    display: none;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fff4d6;
    color: #8a5a00 !important;
    font-size: 11px;
    font-weight: 700;
    animation: pos-pulso 1.2s ease-in-out infinite;
}

@keyframes pos-pulso { 50% { opacity: .45; } }

.pos-cliente,
.pos-codigo {
    display: grid;
    gap: 6px;
    padding: 10px 14px 0;
}

.pos-cliente { grid-template-columns: 1.6fr 1fr auto; }
.pos-codigo { grid-template-columns: 1fr 80px; padding-bottom: 10px; border-bottom: 1px solid var(--pos-border); }

.pos-detalle {
    position: relative;
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
}

.pos-detalle #tablaDetalle { font-size: 13px; }

/* filas generadas por listarDetalleVenta() */
#tablaDetalle > tbody > tr.colorhover { background: transparent; font-weight: 600 !important; }
#tablaDetalle > tbody > tr.colorhover:hover { background: var(--pos-accent-soft); }
#tablaDetalle > tbody > tr > td { width: auto !important; padding: 7px 6px !important; }
#tablaDetalle > tbody > tr > td:nth-child(1) { width: 52px !important; }
#tablaDetalle > tbody > tr > td:nth-child(3),
#tablaDetalle > tbody > tr > td:nth-child(4) { width: 70px !important; }
#tablaDetalle > tbody > tr > td:last-child { width: 1% !important; white-space: nowrap; padding: 4px !important; text-align: right; }
#tablaDetalle > tbody > tr > td:last-child .btn { padding: 3px 7px; font-size: 11px; border-radius: 6px; }
#tablaDetalle input[name=notaProducto][type=text] { margin-top: 4px; height: 28px; font-size: 12px; }

.pos-detalle-vacio {
    position: absolute;
    inset: 40px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #a4aeb9;
    pointer-events: none;
}

.pos-detalle-vacio .fa { font-size: 34px; }
.pos-detalle:has(#tbdoyDetalle tr) .pos-detalle-vacio { display: none; }

.pos-ticket-foot {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--pos-border);
    background: var(--pos-surface-2);
}

.pos-opciones { display: flex; gap: 18px; margin-bottom: 8px; }
.pos-opciones label { margin: 0; font-weight: 600; cursor: pointer; }
.pos-opciones .fa { color: var(--pos-muted); }

.pos-keypad {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.pos-keypad #cant {
    grid-column: span 6;
    height: 34px;
    font-weight: 700;
    text-align: right;
}

.pos-keypad button {
    height: 36px;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    background: var(--pos-surface);
    font-size: 15px;
    font-weight: 700;
    color: var(--pos-text);
}

.pos-keypad button:active { background: var(--pos-accent-soft); }
.pos-keypad .pos-keypad-clear { color: var(--pos-danger); }

.pos-totales {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pos-totales input {
    width: 100%;
    border: 0;
    background: transparent;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--pos-text);
    outline: none;
}

#totalBs { font-size: 30px; line-height: 1.1; }
.pos-total-usd { text-align: right; }
.pos-total-usd input { font-size: 16px; text-align: right; color: var(--pos-muted); }

.pos-btn-facturar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: var(--pos-radius-sm);
    background: var(--pos-accent);
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 4px 12px rgba(242, 113, 28, .35);
    transition: background .15s;
}

.pos-btn-facturar:hover { background: var(--pos-accent-dark); }
.pos-btn-facturar small { font-size: 11px; opacity: .75; font-weight: 600; }

/* ---------- Modales heredados ---------- */
.modal-content { border-radius: var(--pos-radius); border: 0; box-shadow: 0 20px 50px rgba(16, 24, 40, .3); }

/* ---------- Cobro ---------- */
.pos-cobro .modal-dialog { width: 1040px; max-width: calc(100% - 24px); margin: 24px auto; }
.pos-cobro .modal-content { overflow: hidden; background: var(--pos-bg); }

.pos-cobro-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 22px;
    background: var(--pos-topbar);
    color: #fff;
}

.pos-cobro-head .pos-label { color: #9aa5b1; }
.pos-cobro-total { font-size: 18px; font-weight: 700; color: #9aa5b1; line-height: 1.1; }
.pos-cobro-total strong { font-size: 38px; font-weight: 800; color: var(--pos-accent); font-variant-numeric: tabular-nums; }
.pos-cobro-total-usd { color: #9aa5b1; font-weight: 600; font-variant-numeric: tabular-nums; }

.pos-cobro-head-info { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.pos-cobro-salida {
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--pos-topbar-2);
    font-weight: 700;
    text-transform: uppercase;
}
.pos-cobro-literal { max-width: 360px; color: #c5ced8; font-size: 13px; text-transform: uppercase; }

.pos-cobro-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 14px;
    padding: 16px;
}

.pos-cobro-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--pos-radius);
    background: var(--pos-surface);
    box-shadow: var(--pos-shadow);
}

.pos-cobro-monto {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 12px;
    border: 2px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface-2);
    cursor: pointer;
}
.pos-cobro-monto:has(input[type=radio]:checked) { border-color: var(--pos-accent); background: #fff; }
.pos-cobro-monto input[type=radio] { margin: 0; accent-color: var(--pos-accent); }
.pos-cobro-monto span { width: 34px; font-weight: 700; color: var(--pos-muted); }
.pos-cobro-monto input[type=text] {
    flex: 1;
    min-width: 0;
    height: 50px;
    border: 0;
    background: transparent;
    font-size: 24px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.pos-cobro-billetes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.pos-cobro-billetes button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 3px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: #fff;
    transition: transform .1s, box-shadow .1s;
}
.pos-cobro-billetes button:hover { box-shadow: var(--pos-shadow); border-color: var(--pos-accent); }
.pos-cobro-billetes button:active { transform: scale(.96); }
.pos-cobro-billetes img { max-width: 100%; max-height: 100%; border-radius: 3px; }
.pos-cobro-billetes .is-moneda img { height: 44px; border-radius: 50%; }
.pos-cobro-billetes .pos-cobro-exacto { background: var(--pos-accent-soft); color: var(--pos-accent-dark); font-weight: 700; }

.pos-cobro-keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pos-cobro-keypad button {
    height: 50px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface-2);
    font-size: 20px;
    font-weight: 700;
}
.pos-cobro-keypad button:hover { background: #fff; border-color: var(--pos-accent); }
.pos-cobro-keypad button:active { background: var(--pos-accent-soft); }
.pos-cobro-keypad .pos-cobro-limpiar { grid-column: span 3; height: 40px; font-size: 14px; color: var(--pos-danger); }

.pos-cobro-cambio { margin-top: auto; padding: 12px 14px; border-radius: var(--pos-radius-sm); background: #e3f6ec; }
.pos-cobro-cambio .pos-label { color: var(--pos-success); }
.pos-cobro-cambio-montos { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pos-cobro-cambio-montos label { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--pos-muted); font-weight: 600; }
.pos-cobro-cambio-montos input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--pos-success);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    outline: none;
}
.pos-cobro-cambio-montos label:first-child { flex: 1; min-width: 0; }
.pos-cobro-cambio-montos label:first-child input { font-size: 26px; }
.pos-cobro-cambio-montos label:last-child { flex: 0 0 110px; }
.pos-cobro-cambio-montos label:last-child input { font-size: 16px; text-align: right; }
.pos-cobro-cambio.is-falta { background: #fde8e8; }
.pos-cobro-cambio.is-falta .pos-label,
.pos-cobro-cambio.is-falta input { color: var(--pos-danger); }

.pos-cobro-formas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pos-cobro-opcion {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 2px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface-2);
    font-weight: 600;
    cursor: pointer;
}
.pos-cobro-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.pos-cobro-opcion .fa { color: var(--pos-muted); }
.pos-cobro-opcion:has(input:checked) { border-color: var(--pos-accent); background: var(--pos-accent-soft); color: var(--pos-accent-dark); }
.pos-cobro-opcion:has(input:checked) .fa { color: var(--pos-accent); }

.pos-cobro-col .form-control { height: 38px; border-color: var(--pos-border); border-radius: var(--pos-radius-sm); box-shadow: none; }
.pos-cobro-campo { margin: 0; font-weight: normal; }
.pos-cobro-campo .pos-label { margin-bottom: 4px; }
.pos-cobro-campo small { text-transform: none; letter-spacing: 0; font-weight: normal; }

.pos-cobro-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 16px 16px;
}
.pos-cobro-volver {
    height: 56px;
    padding: 0 24px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: #fff;
    font-weight: 700;
    color: var(--pos-muted);
}
.pos-cobro-volver:hover { color: var(--pos-text); }
.pos-cobro-confirmar { width: auto; flex: 0 0 340px; }
.pos-cobro-confirmar[disabled] { opacity: .6; cursor: wait; }

@media (max-width: 900px) {
    .pos-cobro .modal-dialog { margin: 8px auto; }
    .pos-cobro-head { flex-wrap: wrap; }
    .pos-cobro-head-info { align-items: flex-start; text-align: left; }
    .pos-cobro-body { grid-template-columns: 1fr; }
    .pos-cobro-confirmar { flex: 1; }
}

/* ---------- Histórico de ventas ---------- */
.pos-historico .modal-dialog { width: auto; height: calc(100vh - 32px); margin: 16px; }
.pos-historico .modal-content { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--pos-bg); }

.pos-hist-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--pos-topbar);
    color: #fff;
    flex-shrink: 0;
}

.pos-hist-title { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.pos-hist-title > .fa { font-size: 22px; color: var(--pos-accent); }
.pos-hist-title h4 { margin: 0; font-size: 18px; font-weight: 700; }
.pos-hist-title small { color: #9aa5b1; font-size: 12px; }

.pos-hist-fecha { width: 190px; }
.pos-hist-fecha .input-group-addon,
.pos-hist-fecha .form-control { height: 38px; border-color: var(--pos-topbar-2); }
.pos-hist-fecha .input-group-addon { background: var(--pos-topbar-2); color: #fff; border-radius: var(--pos-radius-sm) 0 0 var(--pos-radius-sm); }
.pos-hist-fecha .form-control { border-radius: 0 var(--pos-radius-sm) var(--pos-radius-sm) 0; font-weight: 600; cursor: pointer; }

.pos-hist-actions { display: flex; gap: 8px; }

.pos-hist-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--pos-radius-sm);
    font-weight: 600;
    color: #fff;
}

.pos-hist-btn-cierre { background: var(--pos-accent); }
.pos-hist-btn-cierre:hover { background: var(--pos-accent-dark); }
.pos-hist-btn-volver { background: var(--pos-topbar-2); }
.pos-hist-btn-volver:hover { background: #3a475a; }

.pos-hist-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 16px 0;
    flex-shrink: 0;
}

.pos-hist-stat {
    padding: 10px 14px;
    border-left: 4px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface);
    box-shadow: var(--pos-shadow);
}

.pos-hist-stat strong { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pos-hist-stat.is-ok { border-left-color: var(--pos-success); }
.pos-hist-stat.is-bad { border-left-color: var(--pos-danger); }
.pos-hist-stat.is-total { border-left-color: var(--pos-accent); }
.pos-hist-stat.is-total strong { color: var(--pos-accent-dark); }

.pos-hist-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 12px 16px 16px;
}

.pos-hist-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--pos-radius);
    background: var(--pos-surface);
    box-shadow: var(--pos-shadow);
    overflow: hidden;
}

.pos-hist-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.pos-hist-buscar { position: relative; flex: 0 1 320px; }
.pos-hist-buscar .fa { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--pos-muted); }
.pos-hist-buscar input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 32px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface-2);
    outline: none;
}
.pos-hist-buscar input:focus { border-color: var(--pos-accent); background: #fff; }

.pos-hist-lista .dataTables_wrapper { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pos-hist-lista .dataTables_scroll { flex: 1; min-height: 0; }
.pos-hist-lista table.dataTable { margin: 0 !important; border-collapse: collapse !important; }

.pos-historico table.table > thead > tr > th {
    padding: 9px 12px;
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface-2);
    color: var(--pos-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pos-historico table.table > tbody > tr > td {
    padding: 9px 12px;
    border-top: 1px solid #edf0f3;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

#tableHistorico > tbody > tr { cursor: pointer; background: transparent; }
#tableHistorico > tbody > tr:hover { background: var(--pos-surface-2); }
#tableHistorico > tbody > tr.is-selected,
#tableHistorico > tbody > tr.is-selected:hover { background: var(--pos-accent-soft); box-shadow: inset 3px 0 0 var(--pos-accent); }
#tableHistorico > tbody > tr.is-anulada > td { color: var(--pos-muted); }
#tableHistorico > tbody > tr.is-anulada > td:nth-child(7) { text-decoration: line-through; }
#tableHistorico > tbody > tr > td.dataTables_empty { padding: 48px 12px; color: var(--pos-muted); text-align: center; cursor: default; }

.pos-hist-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pos-hist-badge.is-ok { background: #e3f6ec; color: var(--pos-success); }
.pos-hist-badge.is-bad { background: #fde8e8; color: var(--pos-danger); }

.pos-hist-accion {
    height: 28px;
    padding: 0 12px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
}
.pos-hist-accion.is-anular { color: var(--pos-danger); }
.pos-hist-accion.is-anular:hover { background: var(--pos-danger); border-color: var(--pos-danger); color: #fff; }
.pos-hist-accion.is-activar { color: var(--pos-success); }
.pos-hist-accion.is-activar:hover { background: var(--pos-success); border-color: var(--pos-success); color: #fff; }

.pos-hist-info { padding: 8px 14px; border-top: 1px solid var(--pos-border); flex-shrink: 0; }
.pos-hist-info .dataTables_info { padding: 0; color: var(--pos-muted); font-size: 12px; }

.pos-hist-hora { color: var(--pos-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.pos-hist-campos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px 14px;
    flex-shrink: 0;
}
.pos-hist-campos label { margin: 0; font-weight: normal; }
.pos-hist-campos .pos-label { margin-bottom: 4px; }
.pos-hist-campos .form-control { height: 34px; border-color: var(--pos-border); border-radius: 6px; box-shadow: none; }
.pos-hist-campos .form-control[readonly] { background: var(--pos-surface-2); cursor: default; }

.pos-hist-items { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--pos-border); }
.pos-hist-items .table { margin: 0; }
.pos-hist-items thead th { position: sticky; top: 0; z-index: 1; }
.pos-hist-items td:first-child { width: 60px; font-weight: 600; }
.pos-hist-items td:last-child { width: 90px; }
.pos-hist-items tr.pos-hist-vacio > td { padding: 40px 14px !important; color: var(--pos-muted); text-align: center; border: 0 !important; }

.pos-hist-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--pos-topbar);
    color: #fff;
    flex-shrink: 0;
}
.pos-hist-total span { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9aa5b1; }
.pos-hist-total strong { font-size: 24px; color: var(--pos-accent); font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) {
    .pos-hist-body { grid-template-columns: minmax(0, 1fr) 340px; }
    .pos-hist-title small { display: none; }
}

@media (max-width: 900px) {
    .pos-historico .modal-dialog { height: auto; margin: 8px; }
    .pos-historico .modal-content { height: auto; }
    .pos-hist-head { flex-wrap: wrap; }
    .pos-hist-title { flex-basis: 100%; }
    .pos-hist-fecha { flex: 1; width: auto; }
    .pos-hist-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-hist-body { grid-template-columns: 1fr; }
    .pos-hist-lista { height: 60vh; }
    .pos-hist-detalle { height: 70vh; }
}

/* ---------- Notificaciones (toastr / alertify) fuera de la zona del botón COBRAR ---------- */
#toast-container.toast-bottom-center {
    left: 24px;
    right: auto;
    bottom: 24px;
    width: auto;
}

#toast-container.toast-bottom-center > div { width: 260px; margin: 6px 0 0; border-radius: var(--pos-radius-sm); }

.alertify-notifier.ajs-bottom { bottom: auto !important; top: calc(var(--pos-topbar-height) + 12px); }
.alertify-notifier.ajs-right { right: calc(var(--pos-ticket-width) + 28px) !important; }
.alertify-notifier .ajs-message { border-radius: var(--pos-radius-sm); }

/* ---------- Pantallas medianas y tablets ---------- */
@media (max-width: 1280px) {
    :root { --pos-ticket-width: 360px; }
    .pos-brand span, .pos-clock #h3FechaActual { display: none; }
    .pos-tabs > li > a { padding: 10px; }
}

@media (max-width: 1100px) {
    :root { --pos-ticket-width: 330px; }
    .pos-search { max-width: 260px; }
    .pos-chip, #labelUsuario, #labelTipoCambio, #labelTurno { padding: 0 9px; }
    .pos-productos { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .pos-keypad button { height: 32px; }
    #tablaDetalle th:nth-child(3),
    #tablaDetalle > tbody > tr > td:nth-child(3) { display: none; }
}

@media (max-width: 900px) {
    .alertify-notifier.ajs-right { right: 12px !important; }
    body.pos-body { overflow: auto; }
    .pos-app { height: auto; min-height: 100vh; }
    .pos-topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
    .pos-search { order: 3; flex-basis: 100%; max-width: none; }
    .pos-chips { flex-wrap: wrap; }
    .pos-main { grid-template-columns: 1fr; }
    .pos-workspace { height: 55vh; }
    .pos-ticket { min-height: 75vh; }
    .pos-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .pos-tabs > li > a { white-space: nowrap; }
    .pos-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-span-4 { grid-column: span 2; }
}

/* ---------- Ingreso ---------- */
body.pos-body-login .modal-backdrop.in { opacity: .15; }

.pos-login .modal-dialog { width: 400px; max-width: calc(100% - 24px); margin: 8vh auto; }
.pos-login .modal-content { overflow: hidden; }

.pos-login-head {
    padding: 28px 28px 20px;
    background: var(--pos-topbar);
    color: #fff;
    text-align: center;
}

.pos-login-head img { width: 56px; height: 56px; object-fit: contain; }
.pos-login-head h1 { margin: 10px 0 2px; font-size: 24px; font-weight: 700; }
.pos-login-head h1 strong { color: var(--pos-accent); }
.pos-login-head p { margin: 0; color: #9aa5b1; font-size: 13px; }

.pos-login-body { padding: 24px 28px 28px; }
.pos-login-body .pos-label { margin-bottom: 6px; }

.pos-login-field { position: relative; margin-bottom: 16px; }
.pos-login-field > .fa { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--pos-muted); }

.pos-login-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-sm);
    background: var(--pos-surface-2);
    font-size: 15px;
    outline: none;
}

.pos-login-field input:focus { border-color: var(--pos-accent); background: #fff; }
.pos-login-field input[readonly] { color: var(--pos-muted); }

.pos-login-tc {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pos-accent-dark);
    font-size: 12px;
    font-weight: 600;
}

.pos-login-tc:hover { background: var(--pos-accent-soft); }

.pos-login .pos-btn-facturar { height: 50px; font-size: 17px; margin-top: 6px; }
