:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --topbar-h: 3.25rem;
}
/* Layout app: barra superior + menú vertical izquierdo en celular */
.app-body {
    min-height: 100vh;
    background: #f8fafc;
}
.app-flash-wrap {
    position: sticky;
    top: 0;
    z-index: 1060;
}
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--topbar-h);
    padding: 0 0.75rem;
    background: var(--brand-dark);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.app-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    min-width: 0;
    flex: 1;
}
.app-brand:hover { color: #fff; opacity: 0.92; }
.app-menu-btn {
    color: #fff;
    padding: 0.15rem 0.35rem;
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
}
.app-menu-btn:hover { color: #fff; opacity: 0.85; }
.app-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}
.app-nav-desktop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
}
.app-nav-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}
.app-nav-link:hover,
.app-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}
.app-offcanvas {
    width: min(17rem, 82vw);
    background: #0f172a;
}
.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
    gap: 0.1rem;
}
.app-sidebar-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}
.app-sidebar-link i {
    font-size: 1.15rem;
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
}
.app-sidebar-link:hover,
.app-sidebar-link.active {
    color: #fff;
    background: rgba(37, 99, 235, 0.35);
    border-left-color: var(--brand);
}
.app-sidebar-link-muted { color: rgba(255, 255, 255, 0.55); }
.app-main {
    min-height: calc(100vh - var(--topbar-h));
}
@media (min-width: 992px) {
    .app-brand { flex: 0 1 auto; max-width: 16rem; }
    .app-nav-desktop { flex: 1; }
}
.login-card { max-width: 420px; margin: 0 auto; }
.kiosco-login-body .login-card { border-top: 3px solid var(--brand); }
.superadmin-login-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
}
.superadmin-login-card { max-width: 440px; }
.superadmin-login-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.hero-landing { background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); }
.pos-wrap { max-width: 1400px; margin: 0 auto; }
.pos-scan-card { border-top: 3px solid var(--brand); }
/* Campo oculto para pistola USB — no abre teclado en pantalla */
.pos-scan-capture {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.pos-scan-block .pos-scan-input {
    font-size: 1.35rem;
    letter-spacing: 0.05em;
    font-family: ui-monospace, monospace;
}
.pos-btn-camera {
    min-height: 3.25rem;
    font-size: 1.1rem;
}
.pos-cart-table td, .pos-cart-table th { vertical-align: middle; }
.pos-total-box {
    background: #0f172a;
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem;
}
.pos-total-box .total-amount { font-size: 2rem; font-weight: 800; }
.pos-pago-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.pos-pago-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 4.25rem;
    padding: 0.5rem 0.35rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.15;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.pos-pago-btn i {
    font-size: 1.45rem;
    line-height: 1;
}
.pos-pago-btn:hover {
    border-color: var(--brand, #2563eb);
    color: var(--brand, #2563eb);
    background: #f8fafc;
}
.pos-pago-btn.active {
    border-color: var(--brand, #2563eb);
    background: #eff6ff;
    color: var(--brand, #2563eb);
    box-shadow: 0 0 0 1px var(--brand, #2563eb);
}
.pos-pago-btn:focus-visible {
    outline: 2px solid var(--brand, #2563eb);
    outline-offset: 2px;
}
@media (max-width: 400px) {
    .pos-pago-grid { grid-template-columns: repeat(2, 1fr); }
    .pos-pago-btn { min-height: 3.75rem; font-size: 0.68rem; }
    .pos-pago-btn i { font-size: 1.3rem; }
}
.pos-recibo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.pos-recibo-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 4rem;
    padding: 0.5rem 0.35rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.15;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pos-recibo-action i { font-size: 1.5rem; line-height: 1; }
.pos-recibo-action:hover {
    border-color: var(--brand, #2563eb);
    background: #f8fafc;
}
.pos-recibo-wa:hover { border-color: #25d366; color: #128c7e; }
.pos-recibo-mail:hover { border-color: #ea4335; color: #c5221f; }
.pos-recibo-print:hover { border-color: #64748b; color: #334155; }
.pos-scanner-inline {
    position: relative;
    width: 100%;
    height: min(52vh, 360px);
    min-height: 280px;
    background: #000;
    overflow: hidden;
}
/* Visor celular: grande e igual en todos los equipos (html5-qrcode) */
.ean-scan-root[data-mode="mobile"] .pos-scanner-inline,
.pos-wrap[data-mode="mobile"] .pos-scanner-inline {
    height: min(42vh, 264px);
    min-height: 204px;
    max-height: 264px;
}
/* Ocultar UI del escáner nativo en celular (no debe usarse) */
.ean-scan-root[data-mode="mobile"] .pc-scan-frame,
.pos-wrap[data-mode="mobile"] .pc-scan-frame {
    display: none !important;
}
/* Visor PC compacto: preview chico, escaneo en alta resolución */
.ean-scan-root[data-mode="camera"] .pos-scanner-inline,
.pos-wrap[data-mode="camera"] .pos-scanner-inline {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    height: 142px;
    min-height: 142px;
    max-height: 142px;
}
.pc-scan-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}
.pc-scan-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
/* Celular: nitidez y recorte centrado en el código */
.ean-scan-root[data-mode="mobile"] .pc-scan-video,
.pos-wrap[data-mode="mobile"] .pc-scan-video {
    object-fit: cover;
    object-position: center center;
}
.pc-scan-frame {
    position: absolute;
    top: 10%;
    left: 4%;
    right: 4%;
    bottom: 10%;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
}
.pos-wrap[data-mode="camera"] .pos-scanner-viewport video:not(.pc-scan-video),
.ean-scan-root[data-mode="camera"] .pos-scanner-viewport video:not(.pc-scan-video) {
    object-fit: cover !important;
    object-position: center center !important;
}
.pos-pc-scan-picker {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.pos-pc-scan-picker .form-check-label {
    cursor: pointer;
    user-select: none;
}
.pos-scan-banner {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.55rem 0.75rem;
    font-size: 1.05rem;
    text-align: center !important;
    font-weight: 700;
    z-index: 10;
}
.pos-scan-banner.d-none {
    display: none !important;
}
#posMsg.alert-success {
    text-align: center !important;
    font-weight: 700;
    font-size: 1.05rem;
}
.ean-scan-root[data-mode="mobile"] #eanScanOk,
.ean-scan-root[data-mode="mobile"] #eanScanWarn,
.ean-scan-root[data-mode="camera"] #eanScanOk,
.ean-scan-root[data-mode="camera"] #eanScanWarn {
    display: none !important;
}
.pos-scanner-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}
.pos-scanner-viewport video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}
.pos-scanner-viewport canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.pos-scanner-viewport #qr-shaded-region {
    border-color: rgba(255, 255, 255, 0.95) !important;
    border-width: 3px !important;
    border-radius: 10px !important;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45) !important;
}
/* Celular: sin recuadro ni oscurecimiento — cámara a pantalla completa */
.ean-scan-root[data-mode="mobile"] .pos-scanner-viewport #qr-shaded-region,
.pos-wrap[data-mode="mobile"] .pos-scanner-viewport #qr-shaded-region {
    display: none !important;
}
.pos-scanner-viewport img[alt="Info icon"],
.pos-scanner-viewport #html5-qrcode-anchor-scan-type-change,
.pos-scanner-viewport #html5-qrcode-button-camera-stop {
    display: none !important;
}
.pos-scanner-status {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.pos-mixto-row .pos-mixto-monto { max-width: 7.5rem; }
.pos-manual-entry summary { cursor: pointer; }
.pos-manual-entry .input-group .btn { min-width: 5.5rem; }
.pos-wrap[data-mode="mobile"] .pos-scan-card { margin-bottom: 0.75rem; }
.pos-wrap[data-mode="camera"] .pos-scan-card { margin-bottom: 0.75rem; }
.ean-scan-root[data-mode="mobile"] { margin-bottom: 0.75rem; }
.ean-scan-root[data-mode="camera"] { margin-bottom: 0.75rem; }
@media (max-width: 768px) {
    .pos-scan-block .pos-scan-input { font-size: 1.15rem; }
    .pos-total-box .total-amount { font-size: 1.6rem; }
}
.product-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
@media print {
    .no-print { display: none !important; }
    main { padding: 0 !important; }
}
