:root {
    --brand-dark: #002b62;
    --brand: #09388b;
    --brand-mid: #165dc9;
    --brand-focus: #0d47a1;
    --brand-data: #074da2;
    --danger: #7b1a1a;
    --danger-mid: #c0392b;
    --ink: #1f2937;
    --muted: #64748b;
    --line: #dbe4f0;
    --surface: rgba(255, 255, 255, 0.98);
    --app-bg: #f0f4f8;
    --primary: var(--brand);
    --shadow-blue: 0 8px 24px rgba(0, 43, 98, 0.12);
    --scanner-frame-width: min(90vw, 520px);
    --scanner-frame-height: clamp(96px, 18dvh, 150px);
    --scanner-frame-top: 50%;
    --scanner-frame-radius: 14px;
    --scanner-corner-size: 24px;
    --scanner-corner-thickness: 4px;
}

/* ===== Cierre de repartos: detalle de ajuste ===== */
.ajuste-page {
    --cierre-bg: #f4f6f8;
    --cierre-surface: #ffffff;
    --cierre-surface-soft: #eef6fb;
    --cierre-border: #dfe5ea;
    --cierre-text: #17202a;
    --cierre-muted: #64717f;
    --cierre-primary: #044ec7;
    --cierre-success: #14804a;
    --cierre-danger: #c92a2a;
    --cierre-radius: 8px;
    --cierre-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    --cierre-topbar-height: 0px;
    --cierre-actionbar-height: 84px;
    min-height: 100dvh;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background: var(--cierre-bg);
    color: var(--cierre-text);
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.ajuste-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: calc(100dvh - var(--cierre-topbar-height));
    overflow: visible;
    padding-bottom: calc(var(--cierre-actionbar-height) + env(safe-area-inset-bottom) + 16px);
}

.app-mobile-page {
    min-height: 100dvh;
    background: var(--cierre-bg);
    overflow: visible;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

.container-fluid.ajuste-page.app-mobile-page {
    padding: 0;
}

.app-mobile-content {
    padding: calc(var(--cierre-topbar-height) + env(safe-area-inset-top) + 10px) 10px calc(var(--cierre-actionbar-height) + env(safe-area-inset-bottom) + 16px);
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}

.mobile-card {
    background: var(--cierre-surface);
    border: 1px solid var(--cierre-border);
    border-radius: var(--cierre-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mobile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--cierre-border);
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.mobile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ajuste-summary.mobile-summary-grid {
    display: flex;
    flex-wrap: wrap;
    align-self: start;
    align-content: flex-start;
    height: fit-content;
    min-height: 0;
    gap: 4px 8px;
    margin-bottom: 0;
}

.ajuste-summary .mobile-summary-tile {
    display: grid;
    align-self: start;
    align-content: start;
    height: fit-content;
    min-height: 0;
    padding: 6px 10px 3px;
}

.ajuste-summary .mobile-summary-tile span {
    margin-bottom: 1px;
}

.mobile-summary-tile {
    padding: 10px;
}

.mobile-summary-tile span {
    display: block;
    color: var(--cierre-muted);
    font-size: 0.72rem;
    line-height: 1.1;
    margin-bottom: 4px;
}

.mobile-summary-tile strong {
    display: block;
    color: var(--cierre-text);
    font-size: 1rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.summary-reparto {
    grid-column: 1 / -1;
    flex: 1 0 100%;
}

.summary-half {
    grid-column: span 3;
    flex: 1 1 calc(50% - 4px);
}

.summary-third {
    grid-column: span 2;
    flex: 1 1 calc(33.333% - 6px);
}

.summary-reparto-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 12px;
    align-items: start;
}

.summary-fletero-name {
    font-size: 0.88rem !important;
    font-weight: 600;
}

.cierre-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.cierre-summary-card {
    display: grid;
    gap: 7px;
    padding: 10px 12px;
}

.cierre-summary-label {
    color: var(--cierre-muted);
    font-size: 0.7rem;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.cierre-summary-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.cierre-summary-title strong {
    color: var(--cierre-primary);
    font-size: 1.18rem;
    font-weight: 950;
    line-height: 1;
}

.cierre-summary-title span {
    overflow: hidden;
    color: var(--cierre-text);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cierre-summary-metrics,
.cierre-summary-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.cierre-summary-metrics span,
.cierre-summary-breakdown span {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 8px;
    background: #f4f8fc;
}

.cierre-summary-metrics small,
.cierre-summary-breakdown small {
    overflow: hidden;
    color: var(--cierre-muted);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.cierre-summary-metrics strong,
.cierre-summary-breakdown strong {
    overflow: hidden;
    color: var(--cierre-text);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cierre-summary-money-card {
    border-left: 4px solid var(--cierre-success);
}

.cierre-summary-amount {
    color: var(--cierre-success);
    font-size: 1.42rem;
    font-weight: 950;
    line-height: 1;
}

.scan-card {
    position: sticky;
    top: calc(var(--cierre-topbar-height) + env(safe-area-inset-top) + 8px);
    z-index: 20;
    box-shadow: var(--cierre-shadow);
}

.scan-card .form-label {
    color: var(--cierre-muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.cierre-scan-body {
    display: grid;
    gap: 8px;
}

.cierre-scan-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cierre-scan-topline .form-label {
    margin-bottom: 0;
}

.cierre-scan-topline .correction-switch {
    width: auto;
    min-height: 34px;
    padding: 5px 9px;
}

.cierre-scan-topline .correction-switch .form-check-input {
    width: 2.05rem;
    height: 1.12rem;
}

.cierre-scan-topline .correction-switch .form-check-label {
    font-size: 0.78rem;
}

.ajuste-scan-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    width: 100%;
}

.ajuste-scan-group > .btn,
.ajuste-scan-group > .form-control {
    border-radius: var(--cierre-radius) !important;
}

.ajuste-scan-group > .btn {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
}

.ajuste-scan-group > .form-control {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0;
}

.correction-col {
    display: flex;
    align-items: center;
}

.correction-switch {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--cierre-surface-soft);
    border-radius: var(--cierre-radius);
}

.correction-switch .form-check-input {
    margin-left: 0;
    width: 2.5rem;
    height: 1.35rem;
}

.correction-switch .form-check-label {
    font-weight: 700;
}

.product-section {
    overflow: hidden;
}

.product-section .card-header {
    border-bottom: 1px solid var(--cierre-border);
}

.read-codes-body,
.product-table-wrap,
.out-table-wrap,
.alt-validation-table {
    max-height: 420px;
    overflow-y: auto;
}

.cierre-summary-comments {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dfe5ea;
}

.cierre-summary-comments .form-label {
    margin-bottom: 0;
    color: #17202a;
    font-size: 0.82rem;
    font-weight: 800;
}

.cierre-summary-comments textarea {
    min-height: 86px;
    resize: vertical;
}

.cierre-review-groups {
    display: grid;
    gap: 12px;
}

.cierre-review-group {
    display: grid;
    gap: 8px;
}

.cierre-review-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cierre-review-heading span {
    color: #17202a;
    font-size: 0.95rem;
    font-weight: 850;
}

.cierre-review-heading strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.45rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #edf4ff;
    color: #044ec7;
    font-size: 0.78rem;
    font-weight: 900;
}

.cierre-review-empty {
    padding: 0.65rem 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.84rem;
    text-align: center;
}

.cierre-review-list {
    display: grid;
    gap: 8px;
}

.cierre-review-item {
    display: grid;
    gap: 8px;
    padding: 0.72rem;
    border: 1px solid #dfe5ea;
    border-left: 4px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.cierre-review-item.is-out {
    border-left-color: #f2b705;
    background: #fffdf5;
}

.cierre-review-product {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
}

.cierre-review-product span {
    padding: 0.08rem 0.42rem;
    border-radius: 6px;
    background: #eaf2ff;
    color: #044ec7;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.15;
}

.cierre-review-product strong {
    min-width: 0;
    color: #17202a;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.14;
}

.cierre-review-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cierre-review-values span {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 0.42rem 0.5rem;
    border-radius: 8px;
    background: #f4f8fc;
}

.cierre-review-values small {
    overflow: hidden;
    color: #64717f;
    font-size: 0.62rem;
    font-weight: 850;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.cierre-review-values strong {
    overflow: hidden;
    color: #17202a;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cierre-review-more {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 750;
    text-align: center;
}

.cierre-review-totals {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dfe5ea;
    font-size: 0.88rem;
}

.cierre-review-totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cierre-review-totals span {
    color: #17202a;
}

.cierre-review-totals strong {
    flex: 0 0 auto;
    font-weight: 900;
}

.cierre-review-totals .is-total {
    margin-top: 4px;
    font-size: 1rem;
}

.mobile-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1025;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--cierre-border);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(12px);
}

.mobile-actionbar .btn {
    width: 100%;
    min-height: 46px;
    font-weight: 700;
}

.mobile-empty-state {
    padding: 16px 12px;
    color: var(--cierre-muted);
    text-align: center;
}

.btn-with-image-find,
.btn-with-image-barcode {
    width: 48px;
    height: 48px;
    padding: 0 !important;
    border: none;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 0 !important;
    line-height: 48px !important;
}

.btn-with-image-find {
    background-image: url("../img/find-icon.png");
    background-size: 60%;
}

.btn-with-image-barcode {
    background-image: url("../img/barcode.png");
    background-size: contain;
}

.cierre-barcode-search-line {
    align-items: stretch;
}

.cierre-barcode-search-line .form-control,
.cierre-barcode-search-line .btn {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.cierre-barcode-search-line .form-control {
    text-align: center;
}

.cierre-reparto-detail-app .cierre-barcode-search-line {
    margin-bottom: 0;
}

.cierre-reparto-detail-app .cierre-barcode-search-line .control-picking-filter-field {
    min-width: 0;
}

.cierre-reparto-detail-app .cierre-barcode-search-line .control-picking-scan-priority-button {
    min-width: 6rem;
}

.cierre-barcode-search-line .scan-tool-button,
.cierre-barcode-search-line .btn-with-image-find,
.cierre-barcode-search-line .btn-with-image-barcode {
    width: 2.15rem;
    min-width: 2.15rem;
    height: auto;
    padding: 0 !important;
    border: 1px solid #b7c7dd !important;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 0 !important;
    line-height: 1 !important;
}

.cierre-barcode-search-line .btn-with-image-find {
    background-color: transparent !important;
    box-shadow: none;
}

.cierre-barcode-search-line .btn-with-image-find:hover:not(:disabled),
.cierre-barcode-search-line .btn-with-image-find:focus-visible {
    background-color: transparent !important;
}

.cierre-barcode-search-line .btn-with-image-find {
    background-image: url("../img/find-icon.png") !important;
    background-size: 18px 18px;
}

.cierre-barcode-search-line .btn-with-image-barcode {
    background-image: url("../img/barcode.png") !important;
    background-size: 18px 18px;
}

.cierre-scan-alert {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.12;
}

.btn-with-image-back {
    width: 30px;
    height: 30px;
    padding: 10px;
    border: none;
    background: url("../img/back-icon.png") center / cover no-repeat;
    font-size: 0;
}

.ir-arriba {
    display: none;
    padding: 20px;
    background: #024959;
    color: #fff;
    cursor: pointer;
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.app-legacy-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    flex-shrink: 0;
    background-color: black;
    color: white;
    font-size: 10pt;
    font-family: Tahoma, Arial, sans-serif;
}

.ajuste-footer {
    display: none;
}

.cierre-reparto-detail-app .control-picking-actionbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    display: flex;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom));
    border-top: 1px solid #cbd8e8;
    background: rgba(213, 220, 226, 0.98);
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cierre-actionbar-icon-cancel {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E");
}

.cierre-actionbar-icon-review {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%230f7f89' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='m9 15 2 2 4-5'/%3E%3C/svg%3E");
}

.modal-backdrop-wait {
    position: fixed;
    inset: 0;
    z-index: 2050;
    background: rgba(0, 0, 0, 0.45);
}

.modal-content-wait {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 220px;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.spinner-wait {
    width: 42px;
    height: 42px;
    margin: 12px auto 0;
    border: 4px solid #dbe4f0;
    border-top-color: #044ec7;
    border-radius: 50%;
    animation: cierre-spin 0.8s linear infinite;
}

@keyframes cierre-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767.98px) {
    .ajuste-main {
        padding-left: 8px;
        padding-right: 8px;
    }

    .scan-card .row {
        --bs-gutter-y: 0.5rem;
    }

    .read-codes-body,
    .product-table-wrap,
    .out-table-wrap,
    .alt-validation-table {
        max-height: none;
    }

    .product-section .card-body {
        background: #f8fafc;
    }

    .mobile-card-table {
        overflow: visible !important;
    }

    .mobile-stack-table,
    .mobile-stack-table thead,
    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table th,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table tbody {
        display: grid;
        gap: 8px;
        padding: 8px;
    }

    .mobile-stack-table tr {
        background: var(--cierre-surface);
        border: 1px solid var(--cierre-border);
        border-left: 4px solid var(--cierre-primary);
        border-radius: var(--cierre-radius);
        padding: 8px 10px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .mobile-stack-table tr.fila-completo {
        border-left-color: var(--cierre-success);
    }

    .mobile-stack-table tr.fila-exceso {
        border-left-color: var(--cierre-danger);
    }

    .mobile-stack-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 5px 0 !important;
        border: 0 !important;
        text-align: right !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .mobile-stack-table td:first-child,
    .mobile-stack-table td:nth-child(2) {
        display: block;
        text-align: left !important;
    }

    .mobile-stack-table td:first-child {
        color: var(--cierre-primary);
        font-weight: 800;
        font-size: 0.92rem;
    }

    .mobile-stack-table td:nth-child(2) {
        color: var(--cierre-text);
        font-weight: 700;
        padding-bottom: 8px !important;
    }

    .mobile-stack-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--cierre-muted);
        font-size: 0.72rem;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-stack-table td:first-child::before,
    .mobile-stack-table td:nth-child(2)::before {
        display: block;
        margin-bottom: 2px;
    }

    .modal-dialog:not(.modal-fullscreen) {
        margin: 0.5rem;
    }

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

    .modal-footer > * {
        margin: 0 !important;
    }

    .modal-footer > :only-child {
        grid-column: 1 / -1;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .app-mobile-content {
        max-width: 1120px;
        margin: 0 auto;
        padding-left: 16px;
        padding-right: 16px;
    }

    .mobile-actionbar {
        max-width: 1120px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid var(--cierre-border);
        border-right: 1px solid var(--cierre-border);
        border-radius: var(--cierre-radius) var(--cierre-radius) 0 0;
    }
}

html, body {
    /* Fuerza a que la app ocupe el alto visible real sin desbordes raros */
    height: 100vh;
    height: 100dvh; /* Dynamic Viewport Height: clave para PWAs modernas en móviles */
    margin: 0;

    /* Evita el menú de selección de texto y el pull-to-refresh del navegador */
    user-select: none;
    overscroll-behavior-y: contain;
}

html {
    font-size: 17px;
}

body {
    overflow-x: hidden;
    /* Si tu app tiene scroll interno, manejalo acá para que no rompa overscroll-behavior */
    overflow-y: auto;

    background: var(--app-bg);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    line-height: 1.45;
}
/*
html {
    min-height: 100%;
    font-size: 17px;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    background: var(--app-bg);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    line-height: 1.45;
}
*/
#app {
    min-height: 100dvh;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: var(--brand);
}

.btn {
    min-height: 2.85rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    box-shadow: 0 10px 25px rgba(14, 73, 169, 0.24);
}

.btn-primary:hover {
    border-color: transparent;
    background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
    box-shadow: 0 12px 28px rgba(14, 73, 169, 0.32);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-outline-secondary {
    border-color: #b7c7dd;
    background: #ffffff;
    color: var(--brand);
}

.btn-outline-secondary:hover {
    border-color: var(--brand);
    background: #eef5ff;
    color: var(--brand-dark);
}

.btn-outline-danger {
    border-color: rgba(192, 57, 43, 0.4);
    color: var(--danger-mid);
}

.btn-outline-danger:hover {
    border-color: transparent;
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-mid) 100%);
    color: #ffffff;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.1);
}

.form-control,
.form-select {
    min-height: 2.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: var(--ink);
    font-size: 1rem;
}

.sale-panel .form-control:read-only,
.sale-panel .form-control:disabled,
.sale-panel .form-select:disabled {
    background-color: #f8fafc;
    color: #475569;
    opacity: 1;
}

.sale-panel .form-control,
.sale-panel .form-select {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
}

.login-viewport {
    --login-footer-height: 2.45rem;
    --login-bg-y: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding: 0 clamp(14px, 4.6vw, 44px) calc(var(--login-footer-height) + 18px + env(safe-area-inset-bottom));
    background:
        linear-gradient(180deg, rgba(0, 43, 98, 0.02) 0%, rgba(0, 43, 98, 0.04) 46%, rgba(0, 43, 98, 0.24) 100%),
        url("../img/back_login.png") center var(--login-bg-y) / auto 100dvh no-repeat,
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #ffffff;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    width: min(100%, 560px);
    min-height: clamp(430px, calc(52dvh + 30px), 590px);
    padding: clamp(10px, calc(5.8dvh - 20px), 34px) 0 0;
    text-align: center;
    animation: slideUpFade 0.6s ease-out;
}

.login-logo-circle {
    display: block;
    width: min(66vw, 410px);
    height: auto;
    margin: 0 auto 0.35rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.login-logo-circle img {
    width: 100%;
    height: auto;
    max-height: 74px;
    object-fit: contain;
    border-radius: 0;
    filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.58));
    transition: transform 0.3s ease;
}

.login-logo-circle img:active {
    transform: scale(0.92);
}

.login-brand {
    width: min(84vw, 520px);
    margin: 0 auto;
    color: #111827;
    font-size: clamp(1.02rem, 3.5vw, 1.25rem);
    font-weight: 850;
    letter-spacing: 0;
    text-shadow: none;
}

.login-brand span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    max-width: 100%;
    min-height: 2.1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    background: rgba(0, 43, 98, 0.46);
    color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(0, 43, 98, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 1;
    white-space: nowrap;
}

.login-tagline {
    display: none;
}

.login-content {
    width: min(84vw, 520px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: -1.35rem;
}

.login-card {
    width: 100%;
    padding: clamp(0.95rem, 3.1vw, 1.65rem);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: clamp(28px, 7vw, 44px);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    box-shadow: 0 18px 44px rgba(0, 43, 98, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-form-container {
    animation: slideUpFade 0.6s ease-out 0.2s both;
}

.login-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: clamp(3.05rem, 5.7dvh, 3.85rem);
    margin-bottom: clamp(0.68rem, 1.7dvh, 1.05rem);
    padding: 0.28rem;
    border: 2px solid rgba(209, 213, 219, 0.78);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 0 0 1px rgba(9, 56, 139, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input-group:focus-within {
    border-color: var(--brand-focus);
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.08);
}

.login-input-icon {
    flex: 0 0 clamp(2.55rem, 9.5vw, 3.2rem);
    display: grid;
    place-items: center;
    width: clamp(2.55rem, 9.5vw, 3.2rem);
    border-radius: 13px;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
    box-shadow: 0 8px 20px rgba(9, 56, 139, 0.26);
}

.login-input-icon::before,
.login-submit-icon::before {
    content: "";
    display: block;
    width: clamp(1rem, 3.35vw, 1.42rem);
    height: clamp(1rem, 3.35vw, 1.42rem);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.bi-person-fill::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/%3E%3C/svg%3E");
}

.bi-lock-fill::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a4 4 0 0 0-4 4v2H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-1V5a4 4 0 0 0-4-4Zm3 6H5V5a3 3 0 0 1 6 0v2Z'/%3E%3C/svg%3E");
}

.bi-box-arrow-in-right::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M6 3.5a.5.5 0 0 1 .5-.5h6A1.5 1.5 0 0 1 14 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-6a.5.5 0 0 1 0-1h6a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-6a.5.5 0 0 1-.5-.5Z'/%3E%3Cpath fill-rule='evenodd' d='M11.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H2.5a.5.5 0 0 0 0 1h7.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3Z'/%3E%3C/svg%3E");
}

.floating-input {
    flex: 1;
    position: relative;
    min-width: 0;
    margin-bottom: 0;
}

.floating-input input {
    width: 100%;
    min-height: 100%;
    padding: 1.08rem 0.85rem 0.3rem;
    color: var(--ink);
    font-size: clamp(1rem, 3.8vw, 1.35rem);
    font-weight: 750;
    border: none;
    outline: none;
    background: transparent;
}

.floating-input label {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: #9ca3af;
    font-size: clamp(1rem, 4vw, 1.45rem);
    font-weight: 500;
    transform: translateY(-50%);
    transition: 0.18s ease all;
    pointer-events: none;
}

.floating-input input:focus ~ label,
.floating-input input:not(:placeholder-shown) ~ label {
    top: 0.45rem;
    color: var(--brand-focus);
    font-size: 0.82rem;
    font-weight: 850;
    transform: none;
}

.floating-input input:focus {
    border-bottom-color: transparent;
}

.password-toggle-button {
    flex: 0 0 clamp(2.35rem, 8.4vw, 2.9rem);
    display: grid;
    place-items: center;
    align-self: stretch;
    margin-left: 0.15rem;
    border: none;
    border-radius: 13px;
    background: rgba(9, 56, 139, 0.08);
    color: var(--brand);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
    background: rgba(9, 56, 139, 0.14);
}

.password-toggle-button:active {
    transform: scale(0.96);
}

.password-eye-icon {
    width: 1.35rem;
    height: 1.35rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2309388B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.password-toggle-button.is-visible .password-eye-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2309388B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.58 10.58A2 2 0 0 0 12 14a2 2 0 0 0 1.42-.58'/%3E%3Cpath d='M9.88 4.24A10.6 10.6 0 0 1 12 4c6.5 0 10 8 10 8a17.8 17.8 0 0 1-3.1 4.33'/%3E%3Cpath d='M6.61 6.61C3.64 8.57 2 12 2 12s3.5 8 10 8a10.8 10.8 0 0 0 5.39-1.39'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.btn-full-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: clamp(3.15rem, 5.8dvh, 3.85rem);
    margin-top: 0.15rem;
    padding: 0.78rem clamp(1rem, 4vw, 1.5rem);
    border: none;
    border-radius: 15px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    color: white;
    font-size: clamp(1.25rem, 4.9vw, 1.8rem);
    font-weight: 850;
    box-shadow: 0 10px 25px rgba(14, 73, 169, 0.35);
    transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-full-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-full-primary:hover:not(:disabled) {
    box-shadow: 0 14px 30px rgba(14, 73, 169, 0.42);
    transform: translateY(-2px);
}

.btn-full-primary:disabled {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    opacity: 0.86;
    cursor: not-allowed;
}

.btn-full-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.58rem 1rem;
    border: 2px solid rgba(217, 222, 231, 0.86);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--brand);
    font-size: 1rem;
    font-weight: 850;
    transition: transform 0.1s ease-in-out, background-color 0.2s, border-color 0.2s;
}

.btn-full-outline:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-full-outline:disabled {
    border-color: #c8d4e6;
    color: #8aa2c7;
    opacity: 0.75;
}

.login-separator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 0.5rem 0 0.48rem;
    color: var(--brand-dark);
    font-weight: 800;
}

.login-separator span {
    height: 1px;
    background: #d9dee7;
}

.login-separator small {
    font-size: 0.76rem;
    text-transform: uppercase;
}

.barcode-scan-icon,
.camera-switch-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
}

.barcode-scan-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2309388B' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5Zm2 0a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5Zm2 0a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5Zm2.5.5a.5.5 0 0 1 1 0v13a.5.5 0 0 1-1 0v-13Zm3-.5a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13A.5.5 0 0 0 11 1Zm2.5 0a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5Z'/%3E%3C/svg%3E");
}

.camera-switch-icon {
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 0-15-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3 12a9 9 0 0 0 15 6.7l3-2.7'/%3E%3Cpath d='M21 21v-5h-5'/%3E%3C/svg%3E");
}

.scanner-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30;
    width: 100%;
    justify-content: space-between;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(0, 43, 98, 0.72) 0%, rgba(0, 43, 98, 0) 100%);
    pointer-events: none;
}

.scanner-modal-content {
    position: relative;
    min-height: 100dvh;
    overflow: hidden;
    background: #000000;
}

.scanner-modal-content .modal-body {
    min-height: 100dvh;
}

.scanner-camera-switch-inline,
.scanner-close-button {
    pointer-events: auto;
}

#scannerContainer {
    width: 100%;
    min-height: 100dvh;
    background: #000000;
}

#scannerContainer video {
    width: 100% !important;
    min-height: 100dvh;
    object-fit: cover;
}

.scanner-camera-switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.85rem;
    padding: 0.68rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 43, 98, 0.78);
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(0, 43, 98, 0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.12s ease, background-color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.scanner-camera-switch-inline:active {
    transform: scale(0.96);
}

.scanner-camera-switch-inline:disabled {
    opacity: 0.65;
}

.scanner-camera-switch-label {
    display: inline-block;
}

.scanner-close-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 43, 98, 0.78);
    box-shadow: 0 8px 24px rgba(0, 43, 98, 0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.12s ease, background-color 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.scanner-close-button::before,
.scanner-close-button::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
}

.scanner-close-button::before {
    transform: rotate(45deg);
}

.scanner-close-button::after {
    transform: rotate(-45deg);
}

.scanner-close-button:active {
    transform: scale(0.96);
}

.scanner-scan-modal.modal {
    position: fixed;
    inset: 0;
    z-index: 1070;
    width: 100vw;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
}

.scanner-scan-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0 !important;
}

.scanner-scan-content {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #000000;
}

.scanner-modal-controls {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(0, 43, 98, 0.72) 0%, rgba(0, 43, 98, 0) 100%);
    pointer-events: none;
}

.scanner-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    pointer-events: auto;
}

.scanner-modal-close {
    flex: 0 0 auto;
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background-color: rgba(0, 43, 98, 0.78);
    box-shadow: 0 8px 24px rgba(0, 43, 98, 0.34);
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.scanner-modal-close.btn-close {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 1rem 1rem;
    background-repeat: no-repeat;
    filter: none;
}

.scanner-modal-body {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
    background: #000000;
}

.scanner-scan-modal #scannerContainer {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
}

.scanner-scan-modal #scannerContainer video {
    width: 100% !important;
    height: 100% !important;
    min-height: 100dvh !important;
    object-fit: cover !important;
}

.scanner-modal-frame-wrap {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.scanner-modal-frame {
    position: absolute;
    top: var(--scanner-frame-top);
    left: 50%;
    width: var(--scanner-frame-width);
    height: var(--scanner-frame-height);
    transform: translate(-50%, -50%);
    border-radius: var(--scanner-frame-radius);
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.58);
}

.scanner-modal-frame::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ff2d20;
    box-shadow: 0 0 14px rgba(255, 45, 32, 0.95);
}

.scanner-modal-corner {
    position: absolute;
    width: var(--scanner-corner-size);
    height: var(--scanner-corner-size);
    border: var(--scanner-corner-thickness) solid #ffffff;
}

.scanner-modal-corner-top-left {
    top: -2px;
    left: -2px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: var(--scanner-frame-radius);
}

.scanner-modal-corner-top-right {
    top: -2px;
    right: -2px;
    border-bottom: 0;
    border-left: 0;
    border-top-right-radius: var(--scanner-frame-radius);
}

.scanner-modal-corner-bottom-left {
    bottom: -2px;
    left: -2px;
    border-top: 0;
    border-right: 0;
    border-bottom-left-radius: var(--scanner-frame-radius);
}

.scanner-modal-corner-bottom-right {
    right: -2px;
    bottom: -2px;
    border-top: 0;
    border-left: 0;
    border-bottom-right-radius: var(--scanner-frame-radius);
}

.scanner-flash-toggle-inline.is-active {
    border-color: rgba(255, 214, 102, 0.85);
    background: rgba(151, 96, 0, 0.86);
}

.scanner-flash-icon {
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h8l-1 8 10-12h-8l1-8Z'/%3E%3C/svg%3E");
}

.modern-error-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 12px 15px;
    border-left: 4px solid var(--danger-mid);
    border-radius: 10px;
    background: #fff0f0;
    color: var(--danger-mid);
    font-size: 0.9rem;
    animation: slideUpFade 0.3s ease-out;
}

.login-footer {
    position: fixed;
    right: clamp(14px, 4.6vw, 44px);
    bottom: calc(22px + env(safe-area-inset-bottom));
    left: clamp(14px, 4.6vw, 44px);
    z-index: 3;
    width: min(84vw, 520px);
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    width: 100%;
    max-width: 100%;
    min-height: 2.1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    background: rgba(0, 43, 98, 0.46);
    box-shadow: 0 10px 24px rgba(0, 43, 98, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.version-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.96);
    font-size: 0.75rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: none;
    white-space: nowrap;
}

.api-location {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    text-align: right;
    word-break: break-word;
    box-shadow: none;
}

.sales-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 5rem;
}

.facturacion-pedidos-page {
    background: transparent;
}

.facturacion-page {
    height: calc(100dvh - 3.25rem - 6.3rem);
    min-height: 0;
    overflow: auto;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

.app-menu-page {
    min-height: auto;
    display: grid;
    align-items: start;
    padding: 0.15rem 0.25rem 0.85rem;
}

.app-menu-shell {
    display: grid;
    gap: 0.85rem;
    width: min(100%, 560px);
    margin: 0 auto;
}

.app-menu-heading {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    text-align: center;
}

.app-menu-heading span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.app-menu-heading h1 {
    margin: 0;
    color: var(--ink);
    font-size: 1.22rem;
    font-weight: 900;
}

.app-menu-logo {
    display: block;
    width: min(74vw, 360px);
    max-height: 72px;
    object-fit: contain;
}

.app-menu-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.app-menu-button {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.55rem;
    min-height: 8.25rem;
    padding: 0.85rem 0.55rem;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 43, 98, 0.4);
    transition: transform 0.12s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-menu-button-primary {
    border-color: rgba(255, 255, 255, 0.72);
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
    color: #ffffff;
}

.app-menu-button-send {
    background: linear-gradient(135deg, #074da2 0%, #1872d7 100%);
}

.app-menu-button:active {
    transform: scale(0.97);
}

.app-menu-button:hover {
    box-shadow: 0 10px 28px rgba(0, 43, 98, 0.48);
}

.app-menu-icon {
    flex: 0 0 3rem;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
}

.app-menu-icon::before {
    content: "";
    display: block;
    width: 1.45rem;
    height: 1.45rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.bi-receipt-cutoff::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M3 4.5a.5.5 0 0 1 .5-.5h6a.5.5 0 1 1 0 1h-6a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h6a.5.5 0 1 1 0 1h-6a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h6a.5.5 0 1 1 0 1h-6a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5Z'/%3E%3Cpath d='M1.92.506a.5.5 0 0 1 .434.14L3 1.293l.646-.647a.5.5 0 0 1 .708 0L5 1.293l.646-.647a.5.5 0 0 1 .708 0L7 1.293l.646-.647a.5.5 0 0 1 .708 0L9 1.293l.646-.647a.5.5 0 0 1 .708 0L11 1.293l.646-.647a.5.5 0 0 1 .854.353v14a.5.5 0 0 1-.854.353L11 14.707l-.646.647a.5.5 0 0 1-.708 0L9 14.707l-.646.647a.5.5 0 0 1-.708 0L7 14.707l-.646.647a.5.5 0 0 1-.708 0L5 14.707l-.646.647a.5.5 0 0 1-.708 0L3 14.707l-.646.647A.5.5 0 0 1 1.5 15V1a.5.5 0 0 1 .42-.494Z'/%3E%3C/svg%3E");
}

.bi-list-check::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5ZM3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0Zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0Zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0Z'/%3E%3C/svg%3E");
}

.bi-send-invoice::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M2 1.5A1.5 1.5 0 0 1 3.5 0h5.086a1.5 1.5 0 0 1 1.06.44l2.914 2.914A1.5 1.5 0 0 1 13 4.414V7.5a.5.5 0 0 1-1 0V5H9.5A1.5 1.5 0 0 1 8 3.5V1H3.5a.5.5 0 0 0-.5.5v8.586l1.146-1.147a.5.5 0 0 1 .708 0L6 10.086l1.146-1.147a.5.5 0 0 1 .708 0l.646.647a.5.5 0 0 1-.708.708L7.5 10l-1.146 1.146a.5.5 0 0 1-.708 0L4.5 10 3 11.5V14a.5.5 0 0 0 .5.5H8a.5.5 0 0 1 0 1H3.5A1.5 1.5 0 0 1 2 14V1.5Zm7 .207V3.5a.5.5 0 0 0 .5.5h1.793L9 1.707Z'/%3E%3Cpath d='M10.146 10.146a.5.5 0 0 1 .708 0L12 11.293V8.5a.5.5 0 0 1 1 0v2.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 0-.708Z'/%3E%3C/svg%3E");
}

.app-menu-copy {
    flex: 1;
    display: grid;
    gap: 0.12rem;
    justify-items: center;
    min-width: 0;
    width: 100%;
}

.app-menu-copy strong {
    font-size: 0.96rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.app-menu-copy small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.app-menu-footer {
    width: min(84vw, 520px);
    margin: 0.25rem auto 0;
    text-align: center;
}

.app-menu-footer .footer-info {
    min-height: 2.2rem;
    border-color: rgba(9, 56, 139, 0.16);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-menu-footer .version-pill {
    color: #111827;
}

.app-menu-footer .api-location {
    color: #111827;
}

.sales-header {
    display: grid;
    gap: 0.75rem;
    padding: 0.1rem 0 0.2rem;
}

.page-top-nav {
    display: flex;
    justify-content: flex-start;
    padding: 0.1rem 0 0;
}

.menu-back-button {
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-weight: 850;
}

.sales-header-actions-only {
    display: none;
}

.sales-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: 0;
}

.pedido-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    padding: 0.1rem 0 0.45rem;
}

.pedido-page-header-left {
    display: flex;
    justify-content: flex-start;
}

.pedido-page-header-right {
    min-height: 1px;
}

.pedido-page-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: 0;
    text-align: center;
}

.header-meta {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.45rem 0 0.15rem;
    color: var(--muted);
    font-size: 0.82rem;
    scrollbar-width: none;
}

.header-meta span {
    flex: 0 0 auto;
    padding: 0.2rem 0.55rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #ffffff;
}

.header-actions {
    display: none;
}

.compact-alert {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
}

.work-grid,
.lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.product-stack {
    grid-template-columns: minmax(0, 1fr);
}

.customer-doc-stack {
    grid-template-columns: minmax(0, 1fr);
}

.panel {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(9, 56, 139, 0.12);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(0, 43, 98, 0.08);
}

.panel-title {
    margin-bottom: 0.75rem;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.form-grid label,
.add-product-grid label,
.item-card-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.form-grid span,
.add-product-grid span,
.item-card-grid span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.wide {
    grid-column: 1 / -1;
}

.comprobante-triplet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.toggle-row {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
}

.form-check {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    margin: 0;
    padding: 0 0.7rem;
    border: 1px solid #d6e2f0;
    border-radius: 999px;
    background: #f8fbff;
    color: #1f2937;
}

.form-check .form-check-input {
    margin: 0;
}

.form-check-input:checked {
    border-color: var(--brand);
    background-color: var(--brand);
}

.sale-panel .toggle-row {
    margin-top: 0.65rem;
}

.sale-panel .form-check {
    min-height: 1.65rem;
    padding: 0 0.55rem;
    font-size: 0.82rem;
}

.search-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.barcode-search-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.client-panel .form-control,
.client-panel .btn,
.product-panel .form-control,
.product-panel .form-select,
.product-panel .btn {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
}

.client-panel.is-readonly .form-control {
    background-color: #f8fafc;
    color: #475569;
    opacity: 1;
}

.product-panel .form-control {
    text-align: center;
}

.product-panel .form-control:read-only {
    background-color: #f8fafc;
    color: #475569;
    opacity: 1;
}

.scan-tool-button {
    width: 2.15rem;
    min-width: 2.15rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.pedido-control-picking-panel {
    padding: 0.75rem;
    border-radius: 18px;
}

.pedido-control-picking-panel .panel-title {
    margin-bottom: 0.55rem;
}

.pedido-control-search-line {
    gap: 0.5rem;
}

.pedido-control-search-line .control-picking-filter-field {
    min-width: 0;
}

.pedido-control-search-line .control-picking-scan-priority-button {
    min-width: 6rem;
}

.pedido-product-camera-button:not(:disabled) {
    border-color: #e4aa00 !important;
    background: #ffd24a !important;
    color: #342300 !important;
    box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.72);
    animation: pedidoProductCameraBlink 1.35s ease-in-out infinite;
}

.pedido-product-camera-button:not(:disabled) .barcode-tool-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23342300' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5v14'/%3E%3Cpath d='M8 5v14'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M17 5v14'/%3E%3Cpath d='M21 5v14'/%3E%3Cpath d='M5 5v14'/%3E%3Cpath d='M15 5v14'/%3E%3C/svg%3E");
}

@keyframes pedidoProductCameraBlink {
    0%,
    100% {
        background-color: #ffd24a;
        box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.5);
        transform: translateY(0);
    }

    50% {
        background-color: #ffe28a;
        box-shadow: 0 0 0 5px rgba(255, 210, 74, 0.22);
        transform: translateY(-1px);
    }
}

.barcode-tool-icon {
    width: 18px;
    height: 18px;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2309388B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5v14'/%3E%3Cpath d='M8 5v14'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M17 5v14'/%3E%3Cpath d='M21 5v14'/%3E%3Cpath d='M5 5v14'/%3E%3Cpath d='M15 5v14'/%3E%3C/svg%3E");
}

.code-input {
    max-width: none;
}

.result-list {
    display: grid;
    gap: 0.35rem;
    max-height: 220px;
    overflow: auto;
    margin-bottom: 0.75rem;
}

.product-results {
    max-height: 180px;
}

.selected-product-trigger {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 3.15rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #f8fbff;
    color: var(--ink);
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 43, 98, 0.06);
}

.selected-product-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dce8f4;
    border-radius: 10px;
    background: #ffffff;
    color: var(--brand-data);
    font-size: 0.72rem;
    font-weight: 900;
}

.selected-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.selected-product-thumb span {
    display: none;
}

.selected-product-thumb.is-missing span {
    display: inline-flex;
}

.selected-product-copy {
    display: grid;
    min-width: 0;
    gap: 0.04rem;
}

.selected-product-copy strong {
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.05;
}

.selected-product-copy span {
    overflow: hidden;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-product-action {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #e8f1ff;
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 900;
}

.result-row {
    display: grid;
    gap: 0.1rem;
    width: 100%;
    padding: 0.6rem 0.65rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
    text-align: left;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.result-row:hover {
    background: #eef5ff;
    border-color: #a8bee2;
}

.result-row:active {
    transform: scale(0.98);
}

.result-main {
    color: var(--ink);
    font-weight: 800;
}

.result-sub {
    color: #63716f;
    font-size: 0.82rem;
}

.client-summary-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e1e6e6;
}

.client-summary {
    display: grid;
    gap: 0.15rem;
    color: #5a6865;
    font-size: 0.9rem;
    line-height: 1.25;
}

.client-summary strong {
    color: var(--ink);
    font-size: 0.9rem;
}

.client-summary span {
    font-size: 0.9em;
}

.client-cf-toggle {
    justify-self: end;
    min-height: 2.55rem;
    padding: 0 0.75rem;
    border-color: rgba(9, 56, 139, 0.18);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 43, 98, 0.08);
}

.client-cf-toggle .form-check-label {
    color: var(--brand);
    font-weight: 900;
}

.pedido-client-panel {
    font-size: 0.8rem;
}

.pedido-client-panel .panel-title {
    margin-bottom: 0.55rem;
    font-size: 0.66rem;
}

.pedido-client-summary {
    gap: 0.08rem;
    padding-top: 0.45rem;
    line-height: 1.25;
}

.pedido-client-name {
    text-transform: uppercase;
}

.pedido-client-document-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}

.pedido-client-document-row strong {
    font-weight: 900;
}

.add-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 0.65rem;
}

.add-button {
    grid-column: 1 / -1;
}

@media (max-width: 759px) {
    .product-panel .add-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .product-panel .add-product-grid .wide,
    .product-panel .add-product-grid .add-button {
        grid-column: 1 / -1;
    }

    .product-panel .add-product-grid span {
        font-size: 0.68rem;
    }

    .product-panel .add-product-grid .form-control {
        min-width: 0;
        padding-right: 0.25rem;
        padding-left: 0.25rem;
        font-size: 0.82rem;
    }
}

.totals-list {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
}

.totals-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e8eef8;
}

.totals-list dt {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

.totals-list dt span {
    color: var(--brand-data);
    font-size: 0.78em;
    font-weight: 850;
}

.totals-list dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.totals-list .total-row {
    margin-top: 0.35rem;
    border-bottom: 0;
    color: var(--brand-data);
    font-size: 0.94rem;
}

.totals-bottom-sheet-modal {
    z-index: 1070;
}

.totals-bottom-sheet-modal .modal-dialog {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    animation: totalsSheetIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform;
}

.totals-bottom-sheet-modal.is-closing {
    pointer-events: none;
}

.totals-bottom-sheet-modal.is-closing .modal-dialog {
    animation: totalsSheetOut 250ms cubic-bezier(0.4, 0, 1, 1) both;
}

.totals-bottom-sheet {
    max-height: min(82dvh, 42rem);
    overflow: hidden;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 55px rgba(15, 23, 42, 0.24);
}

.totals-sheet-handle {
    width: 4.25rem;
    height: 0.32rem;
    margin: 0.65rem auto 0.35rem;
    border-radius: 999px;
    background: #d5dbe6;
}

.totals-sheet-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 1rem 0.9rem;
    border-bottom: 1px solid #e5ebf4;
}

.totals-sheet-icon {
    display: inline-flex;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 12px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%230f5fd0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='m9 16 2 2 4-4'/%3E%3C/svg%3E") center / 1.25rem 1.25rem no-repeat,
        #edf4ff;
}

.totals-sheet-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.18;
}

.totals-sheet-header div > span {
    display: block;
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.totals-sheet-close {
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    border-radius: 999px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23253647' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / 1.1rem 1.1rem no-repeat,
        transparent;
}

.totals-sheet-list {
    display: grid;
    max-height: min(52dvh, 24rem);
    margin: 0;
    overflow: auto;
}

.totals-sheet-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.76rem 1rem;
    border-bottom: 1px solid #e9eef6;
}

.totals-sheet-list dt {
    display: grid;
    gap: 0.13rem;
    min-width: 0;
}

.totals-sheet-list dt strong {
    overflow: hidden;
    color: #172033;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.totals-sheet-list dt span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.totals-sheet-list dd {
    margin: 0;
    color: #172033;
    font-size: 0.92rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.totals-sheet-list .is-discount dd {
    color: #d92d20;
}

.totals-sheet-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    background: #ffffff;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
}

.totals-sheet-footer span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.totals-sheet-footer strong {
    display: block;
    color: #111827;
    font-size: 1.28rem;
    font-weight: 950;
    line-height: 1.1;
    white-space: nowrap;
}

.totals-sheet-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-width: 8.7rem;
    min-height: 3.2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 900;
}

.save-sheet-icon {
    width: 1.2rem;
    height: 1.2rem;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M17 21v-7H7v7'/%3E%3Cpath d='M7 3v5h8'/%3E%3C/svg%3E") center / 1.2rem 1.2rem no-repeat;
}

.totals-sheet-backdrop {
    z-index: 1068;
    animation: totalsBackdropIn 180ms ease-out both;
}

.totals-sheet-backdrop.is-closing {
    animation: totalsBackdropOut 220ms ease-in both;
}

@keyframes totalsSheetIn {
    from {
        transform: translate3d(0, 105%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes totalsSheetOut {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, 105%, 0);
    }
}

@keyframes totalsBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.55;
    }
}

@keyframes totalsBackdropOut {
    from {
        opacity: 0.55;
    }

    to {
        opacity: 0;
    }
}

.items-panel .table-responsive {
    display: none;
}

.items-panel .form-control {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
    text-align: center;
}

.items-panel .form-control:read-only {
    background-color: #f8fafc;
    color: #475569;
    opacity: 1;
}

.mobile-items {
    display: grid;
    gap: 0.75rem;
}

.item-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 43, 98, 0.07);
}

.item-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.item-card-head strong {
    display: block;
    line-height: 1.2;
}

.item-card-head span {
    color: var(--muted);
    font-size: 0.8rem;
}

.item-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.sales-items-panel .mobile-items .item-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.sales-items-panel .mobile-items .item-card-grid .item-total-field {
    grid-column: 1 / -1;
}

.sales-items-panel .mobile-items .item-card-grid span {
    font-size: 0.68rem;
}

.sales-items-panel .mobile-items .item-card-grid .form-control {
    min-width: 0;
    padding-right: 0.25rem;
    padding-left: 0.25rem;
    font-size: 0.82rem;
}

.sales-items-panel .mobile-items {
    gap: 0.85rem;
}

.facturacion-page .sales-items-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sales-items-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-right: 0.1rem;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.sale-item-card {
    display: grid;
    grid-template-columns: 5.95rem minmax(0, 1fr) 3.7rem;
    align-items: center;
    gap: 0.65rem;
    min-height: 7.7rem;
    padding: 0.8rem 0.7rem 0.8rem 0.75rem;
    border: 1px solid #edf2f8;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.sale-item-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-width: 0;
}

.sale-item-image-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.55rem;
    height: 5.55rem;
    border: 1px solid #dce8f4;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(0, 76, 153, 0.12), rgba(229, 242, 255, 0.82)),
        #f7fbff;
    color: var(--brand-data);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0;
}

.sale-item-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.sale-item-image-frame span {
    display: none;
}

.sale-item-image-frame.is-missing span {
    display: inline-flex;
}

.sale-item-remove {
    position: absolute;
    top: 0.22rem;
    right: 0.22rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: #c9372c;
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(201, 55, 44, 0.26);
}

.facturacion-page .sale-item-remove {
    top: 0.18rem;
    right: auto;
    left: 0.18rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1rem;
}

.sale-item-main {
    display: grid;
    align-content: center;
    min-width: 0;
    gap: 0.16rem;
}

.sale-item-name {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.14;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-item-code {
    justify-self: start;
    padding: 0.1rem 0.48rem;
    border-radius: 7px;
    background: #edf4ff;
    color: #0b3f7d;
    font-size: 0.81rem;
    font-weight: 750;
    line-height: 1.25;
}

.sale-item-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    margin-top: 0.08rem;
}

.sale-item-details span {
    display: grid;
    gap: 0.02rem;
    min-width: 0;
}

.sale-item-details small {
    overflow: hidden;
    color: #6b7280;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-item-details strong {
    overflow: hidden;
    color: #253247;
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-item-price {
    color: #063f83;
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.15;
}

.sale-item-qty-controls {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
}

.sale-item-qty-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.95rem;
    height: 2.95rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #08438a, #1268d7);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 15px rgba(8, 67, 138, 0.18);
}

.facturacion-page .sale-item-qty-button {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.2rem;
}

.sale-item-qty-button:active {
    transform: translateY(1px);
}

.sale-item-qty-button:disabled {
    opacity: 0.45;
}

.items-panel .sale-item-qty-input.form-control {
    width: 3.25rem;
    min-height: 2.35rem;
    padding: 0.15rem 0.25rem;
    border-color: #d7dce5;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 900;
    text-align: center;
}

.pedido-sale-item-card.item-complete {
    border-color: #7fc79a;
    background: #edf8f1;
    box-shadow:
        0 8px 22px rgba(15, 23, 42, 0.08),
        inset 0 0 0 1px rgba(34, 139, 82, 0.08);
}

.pedido-sale-item-card {
    grid-template-columns: 5.95rem minmax(0, 1fr);
    padding-right: 0.9rem;
}

.pedido-items-panel {
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    min-height: 0;
    overflow: hidden;
}

.pedido-items-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0.1rem;
    -webkit-overflow-scrolling: touch;
}

.pedido-item-tags {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.pedido-card-combo-badge {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pedido-sale-item-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pedido-product-selection-modal .product-selection-action .btn {
    min-height: 3.55rem;
}

.pedido-product-detail-card {
    margin-bottom: 0.5rem;
}

@media (max-width: 420px) {
    .sale-item-card {
        grid-template-columns: 5rem minmax(0, 1fr) 3.25rem;
        gap: 0.5rem;
        min-height: 7.25rem;
        padding: 0.7rem 0.58rem;
        border-radius: 20px;
    }

    .sale-item-image-frame {
        width: 4.75rem;
        height: 4.75rem;
        border-radius: 12px;
        font-size: 0.9rem;
    }

    .sale-item-remove {
        top: 0.18rem;
        right: 0.18rem;
        width: 1.8rem;
        height: 1.8rem;
        font-size: 1.08rem;
    }

    .facturacion-page .sale-item-remove {
        top: 0.14rem;
        right: auto;
        left: 0.14rem;
        width: 1.44rem;
        height: 1.44rem;
        font-size: 0.86rem;
    }

    .sale-item-name {
        font-size: 0.83rem;
    }

    .sale-item-code {
        font-size: 0.71rem;
    }

    .sale-item-details {
        gap: 0.16rem;
    }

    .sale-item-details small {
        font-size: 0.52rem;
    }

    .sale-item-details strong {
        font-size: 0.58rem;
    }

    .sale-item-price {
        font-size: 0.9rem;
    }

    .sale-item-qty-button {
        width: 2.55rem;
        height: 2.55rem;
        font-size: 1.25rem;
    }

    .facturacion-page .sale-item-qty-button {
        width: 2.04rem;
        height: 2.04rem;
        font-size: 1rem;
    }

    .items-panel .sale-item-qty-input.form-control {
        width: 2.85rem;
        min-height: 2.1rem;
        font-size: 0.85rem;
    }

    .pedido-sale-item-card {
        grid-template-columns: 5rem minmax(0, 1fr);
        padding-right: 0.72rem;
    }
}

.pedido-items-panel .mobile-items .item-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.pedido-items-panel .mobile-items .item-card-grid span {
    font-size: 0.66rem;
    line-height: 1.1;
}

.pedido-items-panel .mobile-items .item-card-grid .form-control {
    min-width: 0;
    padding-right: 0.18rem;
    padding-left: 0.18rem;
    font-size: 0.76rem;
}

.item-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.combo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.15rem;
    padding: 0.08rem 0.35rem;
    border: 1px solid var(--combo-border, #f0c45a);
    border-radius: 999px;
    background: var(--combo-bg, #fff1b8);
    color: var(--combo-ink, #7a4f00);
    font-size: 0.68rem;
    font-weight: 850;
    white-space: nowrap;
}

.pedido-table .combo-badge {
    margin-left: 0.35rem;
}

.item-card-head .combo-badge {
    color: var(--combo-ink, #7a4f00);
    font-size: 0.68rem;
}

.sales-table {
    min-width: 1020px;
    margin: 0;
}

.sales-table th {
    color: #63716f;
    font-size: 0.78rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.sales-table td {
    vertical-align: middle;
    font-size: 0.92rem;
}

.grid-input {
    width: 92px;
    min-width: 92px;
}

.adjustments-panel .form-control {
    text-align: center;
}

.adjustments-panel .form-control:not(.comment-input) {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
}

.pedido-top-grid,
.pedido-prep-grid {
    display: grid;
    gap: 0.75rem;
}

.pedido-prep-grid {
    grid-template-columns: minmax(0, 1fr);
}

.pedido-prep-grid .wide {
    grid-column: 1 / -1;
}

.pedido-prep-main-row {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(120px, 3fr);
    align-items: end;
    gap: 0.75rem;
}

.pedido-prep-select,
.pedido-prep-check {
    min-width: 0;
}

.pedido-prep-check {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-height: 1.95rem;
    padding-bottom: 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.pedido-prep-check span {
    order: 1;
}

.pedido-prep-check .form-check-input {
    order: 2;
    flex: 0 0 auto;
    margin: 0;
}

.pedido-load-panel {
    width: 100%;
}

.pedido-scan-entry {
    display: grid;
    gap: 0.5rem;
}

.pedido-scan-entry label {
    margin: 0;
    color: #687572;
    font-size: 0.78rem;
    font-weight: 800;
}

.pedido-scan-input-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: stretch;
}

.pedido-camera-button {
    width: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
}

.pedido-code-input,
.pedido-load-button {
    min-height: 2.35rem;
}

.pedido-page .form-control,
.pedido-page .form-select,
.pedido-page .btn {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
}

.pedido-page .pedido-camera-button,
.pedido-page .pedido-code-input,
.pedido-page .pedido-load-button {
    min-height: 2.35rem;
}

.pedido-page .pedido-camera-button {
    width: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
}

.pedido-page .comment-input {
    min-height: 4.2rem;
}

.pedido-summary {
    display: grid;
    gap: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e1e6e6;
    color: #5a6865;
    font-size: 0.8rem;
}

.pedido-summary strong {
    color: var(--ink);
}

.item-card.item-complete {
    border-color: #9bd5b0;
    background: #f5fbf7;
}

.item-status {
    flex: 0 0 auto;
    align-self: start;
    padding: 0.18rem 0.4rem;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 850;
}

.read-code-list {
    display: grid;
    gap: 0.35rem;
}

.read-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.6rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
}

.read-code-row strong {
    grid-column: 1 / -1;
    color: var(--ink);
}

.read-code-qty {
    align-self: start;
    justify-self: end;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: #e8f1ff;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 850;
}

.read-code-row em {
    grid-column: 1 / -1;
    color: var(--muted);
    font-style: normal;
    font-size: 0.82rem;
}

.read-code-row.error {
    border-color: #efc5bd;
    background: #fff8f6;
}

.read-code-row.error strong,
.read-code-row.error em {
    color: var(--danger-mid);
}

.palet-tag-list {
    display: grid;
    gap: 0.45rem;
}

.palet-tag {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
}

.palet-tag strong {
    color: var(--ink);
    font-size: 0.82rem;
}

.facturas-share-page {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    height: calc(100dvh - 3.25rem - 6.3rem);
    min-height: 0;
    overflow: auto;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

.facturas-date-input {
    width: 10.5rem;
}

.facturas-toolbar-panel {
    padding: 0.7rem;
}

.facturas-toolbar {
    display: grid;
    grid-template-columns: minmax(8.5rem, 0.85fr) minmax(0, 1.15fr);
    align-items: end;
    gap: 0.65rem;
}

.facturas-toolbar label {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.facturas-client-filter {
    grid-column: auto;
}

.facturas-toolbar .btn {
    grid-column: 1;
}

.facturas-filter-count {
    grid-column: 2;
    align-self: center;
    justify-self: end;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-align: right;
}

.facturas-list-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0.75rem;
}

.facturas-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-right: 0.1rem;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.facturas-mobile-list {
    gap: 0.65rem;
}

.factura-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.78rem;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 43, 98, 0.08);
}

.factura-card-head,
.factura-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.factura-card-head div,
.factura-card-client {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.factura-card-head span,
.factura-card-client span,
.factura-row-subtitle {
    color: var(--muted);
    font-size: 0.78rem;
}

.factura-card-head strong,
.factura-card-client strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.factura-card-foot span {
    color: var(--brand-dark);
    font-size: 1.05rem;
    font-weight: 900;
}

.factura-status {
    flex: 0 0 auto;
    padding: 0.24rem 0.48rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

button.factura-status {
    cursor: pointer;
    line-height: 1.1;
}

.factura-status.ready {
    border-color: rgba(22, 138, 74, 0.28);
    background: #eaf7ef;
    color: #17613b;
}

.factura-status.pending {
    border-color: rgba(192, 57, 43, 0.22);
    background: #fff4f2;
    color: #9b2f24;
}

.factura-pdf-trigger:hover,
.factura-pdf-trigger:focus {
    border-color: rgba(22, 138, 74, 0.5);
    background: #d9f1e3;
    color: #0d5b32;
}

.factura-whatsapp-button {
    min-height: 2.25rem;
    padding: 0.35rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: #168a4a;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(22, 138, 74, 0.24);
}

.factura-whatsapp-button:hover,
.factura-whatsapp-button:focus {
    background: #116d3b;
    color: #ffffff;
}

.factura-whatsapp-button:disabled {
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
}

.factura-phone-input {
    width: min(100%, 11.5rem);
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem;
    border-width: 1px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 800;
}

.factura-card-client .factura-phone-input {
    width: 100%;
    margin-top: 0.2rem;
}

.factura-preview-phone {
    display: grid;
    gap: 0.25rem;
    min-width: min(100%, 13rem);
    margin-right: auto;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.facturas-table td {
    vertical-align: middle;
}

.facturas-table strong,
.factura-row-subtitle {
    display: block;
}

.factura-preview-modal {
    z-index: 1070;
}

.factura-preview-modal .modal-dialog {
    width: min(100% - 1rem, 980px);
    max-width: 980px;
    height: calc(100dvh - 1rem);
    margin: 0.5rem auto;
}

.factura-preview-modal .modal-content {
    height: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 43, 98, 0.24);
}

.factura-preview-modal .modal-header {
    align-items: flex-start;
    border-bottom: 0;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #ffffff;
}

.factura-preview-modal .modal-title {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
}

.factura-preview-modal .modal-header span {
    display: block;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 800;
}

.factura-preview-modal .btn-close {
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.15);
    filter: invert(1) grayscale(1) brightness(1.6);
    opacity: 0.86;
}

.factura-preview-modal .modal-body {
    min-height: 0;
    padding: 0;
    overflow: auto;
    background: #f1f5f9;
}

.factura-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: calc(100dvh - 10.5rem);
    border: 0;
    background: #ffffff;
}

.factura-preview-image {
    display: block;
    width: min(100%, 920px);
    height: auto;
    margin: 0 auto;
    background: #ffffff;
}

.factura-preview-modal .modal-footer {
    border-top-color: #e8eef8;
}

.row-actions {
    width: 54px;
    text-align: right;
}

.empty-row,
.validation-empty,
.validation-ok {
    color: var(--muted);
    padding: 0.85rem 0;
}

.validation-ok {
    color: var(--brand);
    font-weight: 850;
}

.validation-list {
    margin: 0;
    padding-left: 1.1rem;
}

.validation-list + .validation-list {
    margin-top: 0.7rem;
}

.stock-warning-modal,
.notification-modal,
.confirmation-modal,
.system-message-modal,
.system-confirm-modal,
.saving-modal,
.product-selection-modal {
    z-index: 1065;
}

.stock-warning-modal .modal-dialog,
.notification-modal .modal-dialog,
.confirmation-modal .modal-dialog,
.system-message-modal .modal-dialog,
.system-confirm-modal .modal-dialog,
.saving-modal .modal-dialog,
.product-selection-modal .modal-dialog {
    margin: 1rem;
}

.modal.show > .modal-dialog.modal-dialog-centered:not(.modal-fullscreen) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 2rem);
    margin: 1rem auto;
}

.modal.show > .modal-dialog.modal-dialog-centered:not(.modal-fullscreen) > .modal-content {
    width: 100%;
}

.stock-warning-modal .modal-dialog,
.notification-modal .modal-dialog,
.confirmation-modal .modal-dialog,
.system-message-modal .modal-dialog,
.system-confirm-modal .modal-dialog,
.saving-modal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 2rem);
    margin: 1rem auto;
}

.stock-warning-modal .modal-dialog > .modal-content,
.notification-modal .modal-dialog > .modal-content,
.confirmation-modal .modal-dialog > .modal-content,
.system-message-modal .modal-dialog > .modal-content,
.system-confirm-modal .modal-dialog > .modal-content,
.saving-modal .modal-dialog > .modal-content {
    width: 100%;
}

.stock-warning-modal .modal-content,
.notification-modal .modal-content,
.confirmation-modal .modal-content,
.system-message-modal .modal-content,
.system-confirm-modal .modal-content,
.saving-modal .modal-content,
.product-selection-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(0, 43, 98, 0.24);
}

.stock-warning-modal .modal-header,
.notification-modal .modal-header,
.confirmation-modal .modal-header,
.product-selection-modal .modal-header {
    border-bottom: 0;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #ffffff;
}

.stock-warning-modal .modal-footer,
.notification-modal .modal-footer,
.confirmation-modal .modal-footer,
.product-selection-modal .modal-footer {
    border-top-color: #e8eef8;
}

.stock-warning-modal .btn-close,
.notification-modal .btn-close,
.confirmation-modal .btn-close,
.product-selection-modal .btn-close {
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.15);
    filter: invert(1) grayscale(1) brightness(1.6);
    opacity: 0.86;
}

.stock-warning-modal .modal-title,
.notification-modal .modal-title,
.confirmation-modal .modal-title,
.product-selection-modal .modal-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 850;
}

.stock-warning-modal .modal-body p,
.notification-modal .modal-body p,
.confirmation-modal .modal-body p {
    margin: 0 0 0.85rem;
    color: var(--ink);
}

.confirmation-modal .modal-body {
    max-height: min(65dvh, 36rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.notification-modal .modal-body p {
    margin-bottom: 0;
}

.notification-message {
    white-space: pre-line;
}

.saving-modal-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.saving-modal-body .spinner-border {
    color: var(--brand);
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
}

.saving-modal-body h2 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 850;
}

.saving-modal-body p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.stock-modal-values {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.stock-modal-values div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #e2e8e8;
    border-radius: 10px;
    background: #f8fbfa;
}

.stock-modal-values dt {
    color: var(--muted);
    font-weight: 800;
}

.stock-modal-values dd {
    margin: 0;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.product-selection-modal .modal-dialog {
    max-width: 480px;
}

.product-modal-summary {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.95rem;
}

.product-modal-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.4rem;
    height: 5.4rem;
    border: 1px solid #dce8f4;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(0, 76, 153, 0.12), rgba(229, 242, 255, 0.82)),
        #f7fbff;
    color: var(--brand-data);
    font-size: 1.05rem;
    font-weight: 900;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.product-modal-image span {
    display: none;
}

.product-modal-image.is-missing span {
    display: inline-flex;
}

.product-modal-info {
    display: grid;
    min-width: 0;
    gap: 0.18rem;
}

.product-modal-code {
    justify-self: start;
    padding: 0.1rem 0.52rem;
    border-radius: 7px;
    background: #edf4ff;
    color: #0b3f7d;
    font-size: 0.86rem;
    font-weight: 850;
}

.product-modal-info > strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
}

.product-modal-info > span:not(.product-modal-code) {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.product-modal-info dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0.45rem 0 0;
}

.product-modal-info dl div {
    display: grid;
    gap: 0.04rem;
    min-width: 0;
}

.product-modal-info dt {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-modal-info dd {
    overflow: hidden;
    margin: 0;
    color: #253247;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.product-modal-form label {
    display: grid;
    gap: 0.22rem;
}

.product-modal-form span {
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 850;
}

.product-modal-form .form-control {
    min-height: 2.4rem;
    border-color: #d6e2f0;
    border-radius: 12px;
    text-align: center;
}

.product-modal-form .form-control:read-only {
    background: #f8fafc;
    color: #475569;
    opacity: 1;
}

.product-selection-modal .modal-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    animation: productSheetIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform;
}

.product-selection-modal .product-selection-shell {
    display: grid;
    grid-template-rows: minmax(19.5rem, 43dvh) minmax(0, 1fr) auto;
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    background: #edf3fb;
    box-shadow: none;
}

.product-selection-modal {
    animation: productModalFadeIn 180ms ease-out both;
}

.product-selection-modal.is-closing {
    pointer-events: none;
    animation: productModalFadeOut 240ms ease-in both;
}

.product-selection-modal.is-closing .modal-dialog {
    animation: productSheetOut 260ms cubic-bezier(0.4, 0, 1, 1) both;
}

.product-selection-backdrop {
    animation: productBackdropIn 180ms ease-out both;
}

.product-selection-backdrop.is-closing {
    animation: productBackdropOut 240ms ease-in both;
}

.product-selection-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 19.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, #eef5ff 0%, #dfe8f5 58%, #243f75 100%);
}

.product-selection-hero::after {
    content: "";
    position: absolute;
    inset: 38% 0 0;
    background: linear-gradient(180deg, rgba(36, 63, 117, 0) 0%, rgba(24, 47, 96, 0.78) 63%, rgba(11, 39, 87, 0.94) 100%);
    pointer-events: none;
}

.product-modal-dismiss {
    position: absolute;
    top: calc(0.9rem + env(safe-area-inset-top));
    left: 1rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.05rem;
    height: 3.05rem;
    border: 0;
    border-radius: 999px;
    background: rgba(89, 96, 112, 0.72);
    box-shadow: 0 10px 24px rgba(13, 25, 45, 0.18);
}

.product-modal-dismiss span {
    width: 0.9rem;
    height: 0.9rem;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg) translate(-1px, -3px);
}

.product-hero-image {
    position: absolute;
    top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(58vw, 16.5rem);
    height: min(58vw, 16.5rem);
    color: var(--brand-data);
    font-size: 1.6rem;
    font-weight: 950;
    z-index: 1;
}

.product-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 18px rgba(15, 23, 42, 0.18));
}

.product-hero-image span {
    display: none;
}

.product-hero-image.is-missing {
    top: 4.2rem;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.38);
}

.product-hero-image.is-missing span {
    display: inline-flex;
}

.product-hero-info {
    position: absolute;
    right: 1.2rem;
    bottom: 1.65rem;
    left: 1.2rem;
    z-index: 2;
    display: grid;
    gap: 0.75rem;
    color: #ffffff;
}

.product-hero-info h2 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 950;
    line-height: 1.16;
    text-shadow: 0 2px 10px rgba(5, 18, 43, 0.28);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-hero-info div {
    display: grid;
    grid-template-columns: minmax(0, auto) auto minmax(7rem, 1fr);
    gap: 0.65rem;
    align-items: baseline;
}

.product-hero-info span {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-hero-info span + span::before {
    content: "";
    display: inline-block;
    width: 0.2rem;
    height: 0.2rem;
    margin: 0 0.5rem 0.12rem 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.product-hero-info strong {
    justify-self: end;
    color: #ffffff;
    font-size: 1.62rem;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(5, 18, 43, 0.28);
    white-space: nowrap;
}

.product-selection-body {
    display: grid;
    align-content: start;
    gap: 0.8rem;
    min-height: 0;
    padding: 1.35rem 1rem 1rem;
    overflow: auto;
}

.product-quantity-card,
.product-detail-card {
    border: 1px solid #e7edf6;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.product-quantity-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 5.15rem;
    padding: 1rem 1.05rem;
}

.product-quantity-card > span {
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-quantity-stepper {
    display: inline-grid;
    grid-template-columns: auto 4rem auto;
    gap: 0.45rem;
    align-items: center;
}

.product-quantity-stepper button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #08438a, #1268d7);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 9px 18px rgba(8, 67, 138, 0.2);
}

.product-quantity-stepper .form-control {
    width: 4rem;
    min-height: 2.8rem;
    padding: 0.2rem 0.35rem;
    border-color: #d7dce5;
    border-radius: 12px;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 950;
    text-align: center;
}

.product-detail-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
    padding: 0.9rem 1rem;
}

.product-detail-card div {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.product-detail-card span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 850;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.product-detail-card strong {
    overflow: hidden;
    color: #253247;
    font-size: 0.86rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-selection-action {
    padding: 0.95rem 1rem calc(0.95rem + env(safe-area-inset-bottom));
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.product-selection-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 3.55rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 950;
}

.add-cart-icon {
    width: 1.25rem;
    height: 1.25rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h8.9a2 2 0 0 0 2-1.58L21 7H5.12'/%3E%3Cpath d='M15 6V2'/%3E%3Cpath d='M13 4h4'/%3E%3C/svg%3E");
}

.cierre-quantity-modal .product-selection-shell {
    grid-template-rows: minmax(15rem, 34dvh) minmax(0, 1fr) auto;
}

.cierre-quantity-modal .product-selection-hero {
    min-height: 15rem;
    background: linear-gradient(180deg, #eef5ff 0%, #dfe8f5 56%, #123d76 100%);
}

.cierre-quantity-modal.is-correction .product-selection-hero {
    background: linear-gradient(180deg, #fff7dc 0%, #ffe6a6 56%, #7a4f00 100%);
}

.cierre-quantity-modal .product-hero-image.is-missing {
    top: 3.1rem;
    width: min(34vw, 7.8rem);
    height: min(34vw, 7.8rem);
    color: var(--brand);
    font-size: 1.45rem;
}

.cierre-quantity-modal .product-hero-info h2 {
    -webkit-line-clamp: 3;
}

.cierre-quantity-modal .product-hero-info strong {
    font-size: 1.35rem;
}

.cierre-quantity-modal .product-selection-body {
    padding-top: 1rem;
}

.cierre-quantity-modal .product-quantity-card {
    min-height: 4.75rem;
}

.cierre-quantity-modal .product-quantity-stepper {
    grid-template-columns: auto 5rem auto;
}

.cierre-quantity-modal .product-quantity-stepper .form-control {
    width: 5rem;
}

.cierre-quantity-modal.is-correction .product-quantity-stepper button {
    background: linear-gradient(135deg, #7a4f00, #e0a100);
}

.cierre-quantity-detail-card strong {
    white-space: normal;
}

.cierre-quantity-error {
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 750;
}

@keyframes productSheetIn {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes productSheetOut {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, 100%, 0);
    }
}

@keyframes productModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes productModalFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes productBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.5;
    }
}

@keyframes productBackdropOut {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-selection-modal,
    .product-selection-modal .modal-dialog,
    .product-selection-backdrop,
    .totals-bottom-sheet-modal .modal-dialog,
    .totals-sheet-backdrop {
        animation-duration: 1ms;
    }
}

.product-qty-modal .modal-dialog {
    max-width: 430px;
}

.product-qty-product {
    display: grid;
    gap: 0.15rem;
}

.product-qty-product strong {
    font-size: 0.95rem;
}

.product-qty-product span {
    color: var(--muted);
}

.product-qty-grid {
    display: grid;
    gap: 0.55rem;
}

.product-qty-grid label {
    display: grid;
    gap: 0.25rem;
}

.product-qty-grid span {
    color: #687572;
    font-size: 0.78rem;
    font-weight: 800;
}

.product-qty-grid .form-control {
    min-height: 2.05rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.product-qty-error {
    margin-top: 0.7rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #f2c6bd;
    border-radius: 10px;
    background: #fff8f6;
    color: #a33a2c;
    font-size: 0.85rem;
    font-weight: 750;
}

.pedido-scanner-modal .modal-dialog {
    margin: 0;
    max-width: none;
}

.pedido-scanner-modal .modal-content {
    min-height: 100dvh;
    overflow: hidden;
    border-radius: 0;
}

.pedido-full-scanner {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.pedido-page-scanner.facturacion-pedidos-page {
    background: transparent;
}

.pedido-full-scanner-header {
    min-height: calc(56px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: center;
    padding: env(safe-area-inset-top) 10px 0;
    background: #050505;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pedido-scanner-brand,
.pedido-scanner-exit {
    border: 0;
    background: transparent;
    color: #fff;
}

.pedido-scanner-brand {
    display: inline-grid;
    place-items: center;
    padding: 5px 10px;
}

.pedido-scanner-brand img {
    border-radius: 999px;
}

.pedido-scanner-exit {
    padding: 5px 8px;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: right;
}

.pedido-full-scanner-title {
    min-width: 0;
    overflow: hidden;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pedido-full-scanner-camera {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000;
}

.pedido-full-scanner #scannerContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 0;
}

.pedido-full-scanner #scannerContainer video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.pedido-full-scanner #scannerContainer [id$="__scan_region"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.pedido-full-scanner #scannerContainer .qr-shaded-region,
.pedido-full-scanner #scannerContainer [class*="qr-shaded-region"],
.pedido-full-scanner #scannerContainer [id*="qr-shaded-region"],
.pedido-full-scanner #scannerContainer [id$="__dashboard"],
.pedido-full-scanner #scannerContainer [id$="__dashboard_section"],
.pedido-full-scanner #scannerContainer [id$="__header_message"] {
    display: none !important;
}

.pedido-scanner-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: calc(100% - 28px);
}

.pedido-switch-camera {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 43, 98, 0.78);
    color: #fff;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(0, 43, 98, 0.34);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pedido-scanner-actions .pedido-switch-camera {
    position: static;
}

.pedido-full-scanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.pedido-full-viewfinder {
    position: absolute;
    top: var(--scanner-frame-top);
    left: 50%;
    width: var(--scanner-frame-width);
    height: var(--scanner-frame-height);
    transform: translate(-50%, -50%);
    border-radius: var(--scanner-frame-radius);
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.6);
}

.pedido-full-corner {
    position: absolute;
    width: var(--scanner-corner-size);
    height: var(--scanner-corner-size);
    border: var(--scanner-corner-thickness) solid #fff;
}

.pedido-full-corner.top-left {
    top: -2px;
    left: -2px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: var(--scanner-frame-radius);
}

.pedido-full-corner.top-right {
    top: -2px;
    right: -2px;
    border-left: 0;
    border-bottom: 0;
    border-top-right-radius: var(--scanner-frame-radius);
}

.pedido-full-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-top: 0;
    border-right: 0;
    border-bottom-left-radius: var(--scanner-frame-radius);
}

.pedido-full-corner.bottom-right {
    right: -2px;
    bottom: -2px;
    border-top: 0;
    border-left: 0;
    border-bottom-right-radius: var(--scanner-frame-radius);
}

.pedido-full-scan-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ff2d20;
    box-shadow: 0 0 14px rgba(255, 45, 32, 0.95);
}

.pedido-full-scanner-overlay p {
    position: absolute;
    right: 0;
    bottom: 25%;
    left: 0;
    margin: 0;
    padding: 0 18px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.pedido-full-scanner.camera-off .pedido-full-scanner-overlay p {
    color: rgba(255, 255, 255, 0.62);
}

.pedido-activate-scanner {
    position: absolute;
    bottom: 30px;
    left: 50%;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 220px;
    min-height: 48px;
    padding: 12px 24px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 50px;
    background: rgba(9, 56, 139, 0.82);
    color: #fff;
    transform: translateX(-50%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.pedido-camera-start-button:not(.active):not(:disabled) {
    border-color: #e4aa00;
    background: #ffd24a;
    color: #342300;
    box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.72);
    animation: pedidoCameraStartBlink 1.35s ease-in-out infinite;
}

.pedido-camera-start-button:not(.active):not(:disabled) .barcode-tool-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23342300' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5v14'/%3E%3Cpath d='M8 5v14'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M17 5v14'/%3E%3Cpath d='M21 5v14'/%3E%3Cpath d='M5 5v14'/%3E%3Cpath d='M15 5v14'/%3E%3C/svg%3E");
}

@keyframes pedidoCameraStartBlink {
    0%,
    100% {
        background-color: #ffd24a;
        box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.5);
        transform: translate(-50%, 0);
    }

    50% {
        background-color: #ffe28a;
        box-shadow: 0 0 0 8px rgba(255, 210, 74, 0.22);
        transform: translate(-50%, -1px);
    }
}

.pedido-activate-scanner.active {
    border-color: rgba(255, 255, 255, 0.65);
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-mid) 100%);
}

.pedido-activate-scanner .barcode-tool-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5v14'/%3E%3Cpath d='M8 5v14'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M17 5v14'/%3E%3Cpath d='M21 5v14'/%3E%3Cpath d='M5 5v14'/%3E%3Cpath d='M15 5v14'/%3E%3C/svg%3E");
}

.pedido-activate-scanner strong {
    font-size: 1rem;
    font-weight: 700;
}

.pedido-manual-input-panel {
    z-index: 20;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    box-shadow: 0 -8px 24px rgba(0, 43, 98, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pedido-manual-handle {
    width: 45px;
    height: 5px;
    margin: 12px auto 20px;
    border-radius: 3px;
    background: #d9dee7;
}

.pedido-manual-input-container {
    padding: 0 20px;
}

.pedido-manual-input-panel label {
    display: block;
    margin-bottom: 18px;
    color: var(--brand-dark);
    font-size: 0.95rem;
    font-weight: 700;
}

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

.pedido-manual-input-group .form-control {
    min-height: 44px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    font-size: 1.05rem;
}

.pedido-manual-input-group .btn {
    min-width: 82px;
    min-height: 44px;
    border: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    font-weight: 700;
}

.cta-disabled-reason {
    display: block;
    max-width: 100%;
    margin-top: 0.28rem;
    color: #7a3440;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.22;
}

.action-bar-reason {
    grid-column: 1 / -1;
    margin-top: -0.15rem;
    text-align: right;
}

.ingresos-save-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.confirm-summary-list {
    display: grid;
    gap: 0.32rem;
    margin: 0.45rem 0 0;
    padding: 0.65rem 0.8rem 0.65rem 1.35rem;
    border: 1px solid #e5edf7;
    border-radius: 8px;
    background: #f8fbff;
    color: #253247;
    font-size: 0.9rem;
}

.app-scanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.app-scanner-viewfinder {
    position: absolute;
    top: var(--scanner-frame-top);
    left: 50%;
    width: var(--scanner-frame-width);
    height: var(--scanner-frame-height);
    transform: translate(-50%, -50%);
    border-radius: var(--scanner-frame-radius);
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.58);
}

.app-scanner-corner {
    position: absolute;
    width: var(--scanner-corner-size);
    height: var(--scanner-corner-size);
    border: var(--scanner-corner-thickness) solid #ffffff;
}

.app-scanner-corner.top-left {
    top: -2px;
    left: -2px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: var(--scanner-frame-radius);
}

.app-scanner-corner.top-right {
    top: -2px;
    right: -2px;
    border-left: 0;
    border-bottom: 0;
    border-top-right-radius: var(--scanner-frame-radius);
}

.app-scanner-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: 0;
    border-top: 0;
    border-bottom-left-radius: var(--scanner-frame-radius);
}

.app-scanner-corner.bottom-right {
    right: -2px;
    bottom: -2px;
    border-left: 0;
    border-top: 0;
    border-bottom-right-radius: var(--scanner-frame-radius);
}

.app-scan-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ff2d20;
    box-shadow: 0 0 14px rgba(255, 45, 32, 0.95);
}

.app-scanner-overlay p {
    position: absolute;
    right: 0;
    bottom: 25%;
    left: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

@media (max-width: 380px) {
    .pedido-full-scanner-title {
        font-size: 0.98rem;
    }

    .pedido-full-viewfinder {
        top: var(--scanner-frame-top);
        width: var(--scanner-frame-width);
        height: var(--scanner-frame-height);
    }

    .pedido-full-scanner-overlay p {
        bottom: 28%;
    }

    .pedido-manual-input-panel label {
        margin-bottom: 10px;
    }

    .pedido-manual-input-group {
        gap: 6px;
    }

    .pedido-manual-input-group .form-control,
    .pedido-manual-input-group .btn {
        border-radius: 8px;
    }
}

.error-list {
    color: #a33a2c;
}

.warning-list {
    color: #8b6318;
}

.mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
    border-top: 2px solid #e8eef8;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -4px 16px rgba(9, 56, 139, 0.14);
    backdrop-filter: blur(10px);
}

.total-sheet-trigger {
    display: grid;
    justify-items: start;
    min-width: 0;
    padding: 0.15rem 0.4rem 0.15rem 0;
    border: 0;
    background: transparent;
    text-align: left;
}

.total-sheet-trigger::after {
    content: "";
    width: 2.7rem;
    height: 0.18rem;
    margin-top: 0.28rem;
    border-radius: 999px;
    background: #cfd8e6;
}

.mobile-action-bar span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.mobile-action-bar strong {
    display: block;
    color: var(--brand-data);
    font-size: 1.05rem;
    line-height: 1.1;
}

.pedido-page .mobile-action-bar .btn {
    min-height: 2.7rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--brand);
}

.invalid {
    outline: 1px solid #b42318;
}

.validation-message {
    color: #b42318;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8d7;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b42318;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ocurrio un error.";
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--brand);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #8a3ffc;
}

.app-menu-button-repartos {
    background: linear-gradient(135deg, #0f3f5f 0%, #157f8f 100%);
}

.app-menu-button-ingresos {
    background: linear-gradient(135deg, #315f2d 0%, #168f5a 100%);
}

.bi-truck-route::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M3 6.5A2.5 2.5 0 0 1 5.5 4h9A2.5 2.5 0 0 1 17 6.5V8h1.5c.8 0 1.55.38 2.02 1.03l1.5 2.08c.31.43.48.94.48 1.47V17a1 1 0 0 1-1 1h-1.68a3 3 0 0 1-5.64 0H9.82a3 3 0 0 1-5.64 0H3a1 1 0 0 1-1-1V6.5Zm2.5-1A1.5 1.5 0 0 0 4 7v9h.18a3 3 0 0 1 5.64 0H15V6.5A1.5 1.5 0 0 0 13.5 5.5h-8Zm11 10.5h.18a3 3 0 0 1 5.32.65V12.58c0-.21-.07-.41-.19-.58l-1.5-2.08a1 1 0 0 0-.81-.42H16.5V16ZM7 19.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm12 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z'/%3E%3Cpath d='M6 8h5.5a.75.75 0 0 1 0 1.5H6A.75.75 0 0 1 6 8Zm0 3h3.5a.75.75 0 0 1 0 1.5H6A.75.75 0 0 1 6 11Z'/%3E%3C/svg%3E");
}

.bi-box-ingresos::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5 8.186 1.113ZM15 4.239 8.5 6.839v7.922l6.5-2.6V4.24ZM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6Z'/%3E%3Cpath d='M6.354 8.354a.5.5 0 1 0-.708-.708L4.5 8.793V6.5a.5.5 0 0 0-1 0v2.293L2.354 7.646a.5.5 0 1 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2Z'/%3E%3C/svg%3E");
}

.app-menu-button-picking {
    background: linear-gradient(135deg, #53318f 0%, #0f7f89 100%);
}

.app-menu-button-admin {
    background: linear-gradient(135deg, #f28b82 0%, #d44f4f 100%);
    box-shadow: 0 8px 24px rgba(166, 45, 45, 0.32);
}

.bi-picking-control::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M7 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-1.2A3 3 0 0 0 13 1h-2a3 3 0 0 0-2.8 2H7Zm4-1h2a2 2 0 0 1 2 2v1H9V4a2 2 0 0 1 2-2Zm-4 3h1v1h8V5h1a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M8 9h1v7H8V9Zm2 0h2v7h-2V9Zm3 0h1v7h-1V9Zm2 0h1v7h-1V9Z'/%3E%3C/svg%3E");
}

.bi-admin-users::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0-6.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM2 20a7 7 0 0 1 14 0 .75.75 0 0 1-1.5 0 5.5 5.5 0 0 0-11 0 .75.75 0 0 1-1.5 0Zm15.8-12.7a.75.75 0 0 1 1.05-.15l2 1.5a.75.75 0 0 1 0 1.2l-2 1.5a.75.75 0 1 1-.9-1.2l.8-.6H16a.75.75 0 0 1 0-1.5h2.75l-.8-.6a.75.75 0 0 1-.15-1.05ZM18 14.5a2.5 2.5 0 0 0-2.2 1.3.75.75 0 0 1-1.32-.72 4 4 0 1 1 0 3.84.75.75 0 0 1 1.32-.72A2.5 2.5 0 1 0 18 14.5Z'/%3E%3C/svg%3E");
}

.admin-users-page {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    padding: 0.85rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f4f7fb;
    color: #172033;
    -webkit-overflow-scrolling: touch;
}

.admin-users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 1160px;
    margin: 0 auto 0.75rem;
}

.admin-users-header span {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-users-header h1 {
    margin: 0;
    color: #152238;
    font-size: 1.35rem;
    font-weight: 900;
}

.admin-users-back,
.admin-users-refresh,
.admin-users-secondary,
.admin-users-danger,
.admin-users-save {
    min-height: 2.35rem;
    border: 0;
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font-weight: 850;
}

.admin-users-back,
.admin-users-secondary {
    background: #e6edf5;
    color: #20304a;
}

.admin-users-refresh,
.admin-users-save {
    background: #155da8;
    color: #fff;
}

.admin-users-refresh {
    padding: 1pt;
}

.admin-users-danger {
    background: #d92d20;
    color: #fff;
}

.admin-users-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    flex: 0 0 auto;
    width: min(100%, 1160px);
    max-width: 1160px;
    margin: 0 auto 0.75rem;
}

.admin-users-search {
    min-height: 2.45rem;
    border: 1px solid #cfd8e5;
    border-radius: 8px;
    padding: 5px;
    font-size: 0.95rem;
}

.admin-users-alert {
    flex: 0 0 auto;
    width: min(100%, 1160px);
    max-width: 1160px;
    margin: 0 auto 0.75rem;
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    font-weight: 750;
}

.admin-users-alert.is-error {
    background: #fee4e2;
    color: #8f1d1d;
}

.admin-users-alert.is-ok {
    background: #dcfce7;
    color: #166534;
}

.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
    gap: 0.85rem;
    max-width: 1160px;
    margin: 0 auto;
}

.admin-users-list,
.admin-users-detail {
    min-height: 28rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(24, 39, 75, 0.08);
}

.admin-users-list {
    display: grid;
    align-content: start;
    gap: 0.4rem;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.admin-users-list-full {
    flex: 1 1 auto;
    width: min(100%, 1160px);
    max-width: 1160px;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.65rem;
    background: #f8fafc;
    color: #1d2939;
    text-align: left;
}

.admin-user-row-open {
    display: grid;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.admin-user-row-open:focus-visible,
.admin-user-badge-button:focus-visible,
.admin-users-selected-count:focus-visible {
    outline: 3px solid rgba(21, 93, 168, 0.28);
    outline-offset: 3px;
}

.admin-user-row.is-selected {
    border-color: #155da8;
    background: #eaf3ff;
}

.admin-user-row-main {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.admin-user-row-main strong,
.admin-users-selected h2 {
    overflow-wrap: anywhere;
}

.admin-user-row-main small,
.admin-users-selected p {
    margin: 0;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.admin-user-row-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
}

.admin-user-badge {
    border-radius: 8px;
    border: 0;
    background: #eef2f6;
    color: #475467;
    padding: 0.2rem 0.38rem;
    font-size: 0.68rem;
    font-weight: 850;
}

.admin-user-badge-button {
    cursor: pointer;
}

.admin-user-badge-button:hover {
    background: #dbeafe;
    color: #155da8;
}

.admin-user-badge.is-admin {
    background: #fee4e2;
    color: #b42318;
}

.admin-user-badge.is-locked {
    background: #fef0c7;
    color: #93370d;
}

.admin-users-detail {
    display: grid;
    align-content: start;
    gap: 0.8rem;
    padding: 0.85rem;
}

.admin-users-empty,
.admin-users-loading {
    display: grid;
    place-items: center;
    min-height: 12rem;
    color: #667085;
    font-weight: 850;
}

.admin-users-selected {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #e4e7ec;
    padding-bottom: 0.8rem;
}

.admin-users-selected span {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-users-selected h2 {
    margin: 0.08rem 0;
    color: #152238;
    font-size: 1.08rem;
    font-weight: 900;
}

.admin-users-selected strong {
    flex: 0 0 auto;
    border-radius: 8px;
    background: #eef4ff;
    color: #155da8;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
}

.admin-users-selected-count {
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    background: #eef4ff;
    color: #155da8;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 850;
}

.admin-users-selected-count:hover {
    background: #dbeafe;
}

.admin-permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.admin-permission-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    color: #1d2939;
    font-weight: 850;
}

.admin-permission-toggle.is-admin {
    background: #fff4f2;
    border-color: #f7b8b0;
}

.admin-permission-toggle input {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

.admin-users-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #e4e7ec;
    padding-top: 0.8rem;
}

.admin-user-modal .modal-dialog {
    margin: 0;
    max-width: none;
}

.admin-user-modal .modal-content {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #f4f7fb;
    color: #172033;
}

.admin-user-modal .modal-header {
    align-items: flex-start;
    gap: 0.75rem;
    border: 0;
    padding: 0.85rem clamp(0.85rem, 3vw, 1.5rem);
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(24, 39, 75, 0.08);
}

.admin-user-modal .modal-body {
    width: min(100%, 1160px);
    margin: 0 auto;
    padding: clamp(0.85rem, 2.5vw, 1.25rem);
    overflow: auto;
}

.admin-user-modal .admin-users-selected {
    flex: 1 1 auto;
    min-width: 0;
    border-bottom: 0;
    padding-bottom: 0;
}

.admin-user-modal .admin-users-selected h2 {
    font-size: 1.2rem;
}

.admin-user-modal .admin-users-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin: 0;
    border-top: 1px solid #d8e0eb;
    padding: 0.75rem clamp(0.85rem, 3vw, 1.5rem);
    background: #ffffff;
}

.admin-users-linked-modal {
    z-index: 1065;
}

.admin-users-linked-backdrop {
    z-index: 1060;
}

.admin-linked-users-body {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.admin-linked-users-list {
    display: grid;
    gap: 0.55rem;
}

.admin-linked-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.55rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(24, 39, 75, 0.06);
}

.admin-linked-user-cell {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.admin-linked-user-cell span {
    color: #667085;
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-linked-user-cell strong {
    color: #152238;
    font-size: 0.95rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.admin-linked-user-cell.is-provider {
    min-width: 8.5rem;
}

.admin-users-back:disabled,
.admin-users-refresh:disabled,
.admin-users-secondary:disabled,
.admin-users-danger:disabled,
.admin-users-save:disabled,
.admin-permission-toggle:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.58;
}

@media (max-width: 860px) {
    .admin-users-layout,
    .admin-users-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-users-list {
        max-height: none;
    }

    .admin-users-list-full {
        min-height: 0;
        max-height: none;
    }

    .admin-permissions-grid {
        grid-template-columns: 1fr;
    }

    .admin-users-selected,
    .admin-users-actions {
        display: grid;
        justify-content: stretch;
    }

    .admin-user-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .admin-user-row-badges {
        justify-content: flex-start;
    }

    .admin-users-selected-count {
        width: 100%;
        min-height: 44px;
    }

    .admin-linked-user-row {
        grid-template-columns: 1fr;
    }

    .admin-linked-user-cell.is-provider {
        min-width: 0;
    }

    .admin-user-modal .admin-users-actions > button {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .btn-sm,
    .btn-close,
    .admin-users-secondary,
    .admin-users-save,
    .admin-users-danger,
    .ingresos-card-action,
    .ingresos-controladas-footer-button,
    .ingresos-selection-footer-button,
    .product-modal-dismiss,
    .control-picking-report-close {
        min-width: 44px;
        min-height: 44px;
    }

    .facturacion-page,
    .facturas-share-page {
        height: auto;
        min-height: calc(100dvh - 3.25rem);
        overflow: visible;
        padding-bottom: 5.5rem;
    }

    .facturacion-page .sales-items-panel,
    .facturas-list-panel {
        overflow: visible;
    }

    .sales-items-scroll,
    .facturas-list-scroll {
        flex: 0 0 auto;
        overflow: visible;
    }

    .admin-users-page {
        height: auto;
        min-height: 100%;
    }
}

.control-picking-app {
    --control-accent: #0f7f89;
    --control-accent-strong: #53318f;
    --control-picking-top-offset: 3.25rem;
    --control-picking-fixed-card-height: 12rem;
    --control-picking-actionbar-height: 76px;
    padding-bottom: calc(var(--control-picking-actionbar-height) + env(safe-area-inset-bottom) + 0.65rem);
}

.ingresos-simple-loading.control-picking-loading {
    align-content: center;
    justify-items: center;
    gap: 0.7rem;
    text-align: center;
}

.control-picking-loading-logo {
    display: block;
    width: min(68vw, 340px);
    max-height: 72px;
    object-fit: contain;
}

.control-picking-loading span {
    display: block;
}

.control-picking-rubro-select {
    display: grid;
    min-height: calc(100dvh - var(--control-picking-top-offset));
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(15, 127, 137, 0.08), rgba(83, 49, 143, 0.08)),
        #f8fafc;
}

.control-picking-rubro-panel {
    display: grid;
    width: min(28rem, 100%);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.control-picking-rubro-kicker {
    color: var(--control-accent-strong);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.control-picking-rubro-panel h1 {
    margin: 0;
    color: #172033;
    font-size: 1.18rem;
    font-weight: 950;
}

.control-picking-rubro-actions {
    display: grid;
    gap: 0.75rem;
}

.control-picking-rubro-option {
    min-height: 3.25rem;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 950;
    letter-spacing: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.control-picking-rubro-option:disabled {
    opacity: 0.68;
}

.control-picking-rubro-option.is-alimentos {
    background: #c67d12;
}

.control-picking-rubro-option.is-bebidas {
    background: #b42318;
}

.control-picking-rubro-option.is-perfumeria {
    background: var(--control-accent-strong);
}

.control-picking-sticky-card {
    position: fixed;
    top: var(--control-picking-top-offset);
    right: 0;
    left: 0;
    z-index: 1040;
    width: auto;
    max-width: none;
    margin: 0;
    border: 1px solid rgba(9, 56, 139, 0.1);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink, #1f2937);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    transform: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.control-picking-fixed-spacer {
    height: var(--control-picking-fixed-card-height);
}

.control-picking-sticky-card .row {
    --bs-gutter-x: 0.5rem;
    align-items: center;
}

.control-picking-sticky-card .row:first-child {
    min-height: 2rem;
}

.control-picking-sticky-card .ingresos-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e8eef8;
}

.control-picking-heading {
    min-height: 2rem;
}

.control-picking-sticky-card .ingresos-section-heading > .col-5,
.control-picking-sticky-card .ingresos-section-heading > .col-7 {
    width: auto;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

.control-picking-sticky-card .ingresos-section-heading > .col-5 {
    flex: 1 1 auto;
    min-width: 0;
}

.control-picking-sticky-card .ingresos-section-heading > .col-7 {
    flex: 0 0 auto;
}

.control-picking-sticky-card h6 {
    margin-bottom: 0;
    color: var(--brand, #09388b);
    overflow: hidden;
    font-size: 0.96rem;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-title-line {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
}

.control-picking-title-line > div {
    min-width: 0;
}

.control-picking-title-copy {
    flex: 1 1 auto;
}

.control-picking-title-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.control-picking-title-header h6 {
    flex: 0 1 auto;
    min-width: 0;
}

.control-picking-change-rubro-button {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-width: 4.75rem;
    min-height: 2.45rem;
    padding: 0.28rem 0.52rem;
    border: 1px solid rgba(9, 56, 139, 0.22);
    border-radius: 8px;
    background: #eef6ff;
    color: var(--brand, #09388b);
    text-align: center;
    box-shadow: 0 3px 8px rgba(9, 56, 139, 0.08);
}

.control-picking-change-rubro-button:disabled {
    opacity: 0.62;
}

.control-picking-change-rubro-text {
    display: grid;
    gap: 0.08rem;
    line-height: 1;
}

.control-picking-change-rubro-text strong,
.control-picking-change-rubro-text small {
    color: inherit;
    font-weight: 900;
}

.control-picking-change-rubro-text strong {
    font-size: 0.68rem;
}

.control-picking-change-rubro-text small {
    font-size: 0.6rem;
}

.control-picking-sync-alert-button {
    flex: 0 0 auto;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.42rem;
    min-width: 8.25rem;
    min-height: 2.45rem;
    padding: 0.36rem 0.58rem;
    border: 1px solid #991b1b;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    text-align: left;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55), 0 8px 18px rgba(153, 27, 27, 0.24);
    animation: controlPickingSyncAlertPulse 0.95s ease-in-out infinite;
}

.control-picking-sync-alert-button.btn-titilando {
    animation: controlPickingSyncAlertPulse 0.95s ease-in-out infinite;
}

.control-picking-sync-alert-button:disabled {
    opacity: 0.75;
}

.control-picking-sync-alert-icon {
    grid-row: 1 / -1;
    display: block;
    width: 1.3rem;
    height: 1.3rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.3rem 1.3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.45' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.control-picking-sync-alert-text {
    display: grid;
    min-width: 0;
}

.control-picking-sync-alert-text strong,
.control-picking-sync-alert-text small {
    overflow: hidden;
    color: inherit;
    line-height: 1.02;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-sync-alert-text strong {
    font-size: 0.72rem;
    font-weight: 950;
}

.control-picking-sync-alert-text small {
    font-size: 0.59rem;
    font-weight: 850;
    opacity: 0.92;
}

@keyframes controlPickingSyncAlertPulse {
    0%,
    100% {
        background-color: #dc2626;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.62), 0 8px 18px rgba(153, 27, 27, 0.24);
        transform: translateY(0);
    }

    50% {
        background-color: #b91c1c;
        box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.22), 0 10px 22px rgba(153, 27, 27, 0.3);
        transform: translateY(-1px);
    }
}

.control-picking-barcodes-button {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
    min-height: 2.1rem;
    padding: 0;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 43, 98, 0.1);
}

.control-picking-rubros-icon {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2353318f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.15rem 1.15rem;
}

.control-picking-sticky-card span,
.control-picking-sticky-card label,
.control-picking-sticky-card div {
    color: inherit;
}

.control-picking-sticky-card .form-select,
.control-picking-sticky-card .form-control {
    min-height: 2.45rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background-color: #ffffff;
    color: var(--ink, #1f2937);
    font-weight: 750;
    box-shadow: 0 4px 12px rgba(0, 43, 98, 0.06);
}

.control-picking-sticky-card .form-select:focus,
.control-picking-sticky-card .form-control:focus {
    border-color: var(--brand, #09388b);
    box-shadow: 0 0 0 0.18rem rgba(13, 71, 161, 0.1);
}

.control-picking-subtitle {
    display: block;
    margin-top: 0.15rem;
    overflow: hidden;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-refresh {
    min-height: 2.1rem;
    border-radius: 10px;
    font-size: 0.78rem;
}

.control-picking-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    width: 100%;
}

.control-picking-header-actions .btn {
    flex: 0 0 auto;
}

.control-picking-header-actions .control-picking-icon-button {
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
    min-height: 2.1rem;
    padding: 0;
    border-radius: 10px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.15rem 1.15rem;
}

.control-picking-report-button {
    border-color: transparent !important;
    background-color: var(--control-accent-strong) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15v2'/%3E%3Cpath d='M12 9v8'/%3E%3Cpath d='M17 5v12'/%3E%3C/svg%3E") !important;
    box-shadow: 0 8px 18px rgba(83, 49, 143, 0.22);
}

.control-picking-sync-button {
    display: inline-grid;
    place-items: center;
    border-color: transparent !important;
    background: #b42318 !important;
    background-image: none !important;
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.24);
}

.control-picking-sync-icon {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.15rem 1.15rem;
}

.control-picking-search-line {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    margin-bottom: 0;
}

.control-picking-search-line .form-control,
.control-picking-search-line .btn {
    min-height: 1.95rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.9rem;
}

.control-picking-filter-field {
    position: relative;
    min-width: 0;
}

.control-picking-search-line .form-control {
    width: 100%;
    padding-right: 2.2rem;
    text-align: center;
}

.control-picking-clear-filter {
    position: absolute;
    top: 50%;
    right: 0.38rem;
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    min-width: 1.55rem;
    height: 1.55rem;
    min-height: 1.55rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    transform: translateY(-50%);
}

.control-picking-clear-filter span[aria-hidden="true"] {
    position: relative;
    display: block;
    width: 0.72rem;
    height: 0.72rem;
}

.control-picking-clear-filter span[aria-hidden="true"]::before,
.control-picking-clear-filter span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.75rem;
    height: 2px;
    border-radius: 999px;
    background: #475569;
}

.control-picking-clear-filter span[aria-hidden="true"]::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.control-picking-clear-filter span[aria-hidden="true"]::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.control-picking-scan-priority-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-width: 6rem;
    padding-right: 0.65rem !important;
    padding-left: 0.65rem !important;
    border: 1px solid #e4aa00 !important;
    border-radius: 12px !important;
    background: #ffd24a !important;
    color: #342300 !important;
    font-weight: 950 !important;
    box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.72);
    animation: controlPickingScanBlink 1.35s ease-in-out infinite;
}

.control-picking-scan-priority-button strong {
    color: inherit;
    font-size: 0.76rem;
    font-weight: 950;
    line-height: 1;
}

.control-picking-scan-priority-button .barcode-tool-icon {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    background-size: 1.1rem 1.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23342300' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5v14'/%3E%3Cpath d='M8 5v14'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M17 5v14'/%3E%3Cpath d='M21 5v14'/%3E%3Cpath d='M5 5v14'/%3E%3Cpath d='M15 5v14'/%3E%3C/svg%3E");
}

@keyframes controlPickingScanBlink {
    0%,
    100% {
        background-color: #ffd24a;
        box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.5);
        transform: translateY(0);
    }

    50% {
        background-color: #ffe28a;
        box-shadow: 0 0 0 5px rgba(255, 210, 74, 0.22);
        transform: translateY(-1px);
    }
}

.control-picking-search-icon {
    width: 18px;
    height: 18px;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2309388B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

.control-picking-scroll-top {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--control-picking-actionbar-height) + env(safe-area-inset-bottom) + 0.85rem);
    z-index: 1046;
    display: inline-grid;
    place-items: center;
    width: 3rem;
    min-width: 3rem;
    height: 3rem;
    min-height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--control-accent-strong), var(--control-accent));
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.35rem);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.control-picking-scroll-top::before {
    content: "";
    width: 0.86rem;
    height: 0.86rem;
    margin-top: 0.3rem;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    transform: rotate(45deg);
}

.control-picking-scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ingresos-app .control-picking-actionbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    display: flex;
    gap: 0.45rem;
    width: 100%;
    max-width: none;
    padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom));
    border-top: 1px solid #cbd8e8;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(213, 220, 226, 0.98);
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.14);
    transform: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.control-picking-actionbar-button {
    flex: 1 1 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.42rem;
    min-width: 0;
    min-height: 3.25rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #f8fbff;
    color: #172033;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 43, 98, 0.08);
}

.control-picking-actionbar-button:disabled {
    opacity: 0.58;
}

.control-picking-actionbar-button.is-danger {
    border-color: #f1c7c2;
    background: #fff5f5;
}

.control-picking-actionbar-button strong,
.control-picking-actionbar-button small {
    min-width: 0;
    overflow: hidden;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-actionbar-button strong {
    align-self: end;
    color: #172033;
    font-size: 0.76rem;
    font-weight: 950;
}

.control-picking-actionbar-button small {
    align-self: start;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 850;
}

.control-picking-actionbar-button.is-danger strong {
    color: #8a2d25;
}

.control-picking-actionbar-icon {
    grid-row: 1 / -1;
    display: block;
    width: 1.32rem;
    height: 1.32rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.32rem 1.32rem;
}

.control-picking-actionbar-icon-codes {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2353318f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
}

.control-picking-actionbar-icon-passed {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%230f7f89' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18 9 12l6-6'/%3E%3Cpath d='M20 12H9'/%3E%3Cpath d='M5 5v14'/%3E%3C/svg%3E");
}

.control-picking-actionbar-icon-report {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2353318f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15v2'/%3E%3Cpath d='M12 9v8'/%3E%3Cpath d='M17 5v12'/%3E%3C/svg%3E");
}

.control-picking-actionbar-icon-sync {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.control-picking-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0.55rem 0 0.42rem;
}

.control-picking-summary span {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    padding: 0.42rem 0.5rem;
    border: 1px solid #e8eef8;
    border-radius: 10px;
    background: #f8fbff;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.05;
}

.control-picking-summary strong {
    color: var(--control-accent-strong);
    font-size: 0.92rem;
    font-weight: 950;
}

.control-picking-progress {
    height: 0.28rem;
    margin-bottom: 0.4rem;
    border-radius: 999px;
    background-color: #dbe4f0;
}

.control-picking-progress .progress-bar {
    background: linear-gradient(90deg, var(--control-accent-strong), var(--control-accent)) !important;
}

.control-picking-rubro {
    margin: 0.3rem 0 0;
    padding: 0.38rem 0.6rem;
    border-left: 4px solid var(--control-accent);
    border-radius: 10px;
    background: #eefafa;
    color: #0f5860;
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
}

.control-picking-product {
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-left: 4px solid var(--control-accent-strong);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(0, 43, 98, 0.08);
}

.control-picking-product.is-partial {
    border-left-color: #c0392b;
    background: #fffafa;
}

.control-picking-product.is-done {
    border-left-color: #64748b;
    background: #f8fafc;
}

.control-picking-product-main {
    display: grid;
    grid-template-columns: 5.1rem minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.6rem;
}

.control-picking-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-picking-product-image .imagepick {
    width: 100%;
    max-height: 5.2rem;
    padding: 0.24rem;
    border: 1px solid #e8eef8;
    border-radius: 10px;
    background: #ffffff;
    object-fit: contain;
}

.control-picking-product-info {
    display: grid;
    min-width: 0;
    gap: 0.18rem;
}

.control-picking-product-title {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.control-picking-code-badge {
    flex: 0 0 auto;
    max-width: 5.4rem;
    padding: 0.12rem 0.36rem;
    border: 1px solid rgba(83, 49, 143, 0.2);
    border-radius: 999px;
    background: #f3efff;
    color: var(--control-accent-strong) !important;
    font-size: 0.78rem !important;
    font-weight: 950 !important;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-product-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink) !important;
    font-size: 0.88rem !important;
    font-weight: 850 !important;
    line-height: 1.13 !important;
}

.control-picking-product-info strong {
    color: var(--control-accent-strong);
    font-size: 0.86rem;
    font-weight: 950;
}

.control-picking-product-info span {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.16;
}

.control-picking-qty {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.1rem;
}

.control-picking-qty span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.24rem;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    background: #eef5ff;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
}

.control-picking-qty b {
    color: var(--control-accent-strong);
    font-size: 0.78rem;
}

.control-picking-ean-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.control-picking-ean-row .fontEAN {
    min-width: 0;
    overflow: hidden;
    color: #0f4f80;
    font-size: 0.66rem !important;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-ean-row .fontEAN:only-child {
    grid-column: 1 / -1;
}

.control-picking-product-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-picking-product-action .btn {
    min-width: 4.6rem;
    min-height: 2.35rem;
    padding-right: 0.62rem;
    padding-left: 0.62rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 900;
}

.control-picking-missing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.42rem 0.65rem;
    border-top: 1px solid #f1c7c2;
    background: #fff5f5;
}

.control-picking-missing span {
    color: #8a2d25;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: center;
}

.control-picking-missing strong {
    color: #641e18;
}

.control-picking-pasados-title {
    margin-top: 0.8rem;
    scroll-margin-top: calc(var(--control-picking-top-offset) + var(--control-picking-fixed-card-height) + 0.75rem);
}

.control-picking-report-modal {
    position: fixed;
    z-index: 1065;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
}

.control-picking-barcodes-modal {
    position: fixed;
    inset: 0;
    z-index: 1065;
    width: 100vw;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
}

.control-picking-scanner-modal.modal {
    position: fixed;
    inset: 0;
    z-index: 1070;
    width: 100vw;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
}

.control-picking-scanner-modal .modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0 !important;
}

.control-picking-scanner-modal .modal-content {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
}

.control-picking-scanner-modal .modal-body {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0 !important;
}

.control-picking-scanner-modal #scannerContainer {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.control-picking-scanner-modal #scannerContainer video {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
}

.control-picking-scanner-modal #scannerContainer [id$="__scan_region"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.control-picking-scanner-modal #scannerContainer .qr-shaded-region,
.control-picking-scanner-modal #scannerContainer [class*="qr-shaded-region"],
.control-picking-scanner-modal #scannerContainer [id*="qr-shaded-region"],
.control-picking-scanner-modal #scannerContainer [id$="__dashboard"],
.control-picking-scanner-modal #scannerContainer [id$="__dashboard_section"],
.control-picking-scanner-modal #scannerContainer [id$="__header_message"] {
    display: none !important;
}

.control-picking-report-modal .modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100%;
    min-height: 100dvh;
    margin: 0 !important;
}

.control-picking-report-modal .modal-content {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #f8fafc;
}

.control-picking-barcodes-modal .modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100%;
    min-height: 100dvh;
    margin: 0 !important;
}

.control-picking-barcodes-modal .modal-content {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #f8fafc;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
}

.control-picking-report-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 0;
    background: linear-gradient(135deg, var(--control-accent-strong, #53318f), var(--control-accent, #0f7f89));
    color: #ffffff;
}

.control-picking-barcodes-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 0;
    background: linear-gradient(135deg, var(--control-accent-strong, #53318f), var(--control-accent, #0f7f89));
    color: #ffffff;
}

.control-picking-barcodes-modal .modal-header > div {
    min-width: 0;
}

.control-picking-report-modal .modal-header > div {
    min-width: 0;
}

.control-picking-barcodes-modal .modal-title,
.control-picking-report-modal .modal-title {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
}

.control-picking-barcodes-modal .modal-header span,
.control-picking-report-modal .modal-header span {
    display: block;
    margin-top: 0.12rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 800;
}

.control-picking-report-close {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
    width: 2.65rem;
    height: 2.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
}

.control-picking-report-close::before,
.control-picking-report-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.05rem;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
}

.control-picking-report-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.control-picking-report-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.control-picking-report-modal .modal-body {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    padding: 0.85rem;
    overflow: auto;
}

.control-picking-barcodes-modal .modal-body {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    height: 100%;
    max-height: none;
    padding: 0.85rem;
    overflow: auto;
}

.control-picking-barcode-rubro {
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 43, 98, 0.08);
}

.control-picking-barcode-rubro h3 {
    margin: 0;
    color: var(--control-accent-strong);
    font-size: 0.88rem;
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
}

.control-picking-barcode-svg {
    display: block;
    width: 100%;
    max-width: 24rem;
    height: 3.2rem;
    margin: 0 auto;
}

.control-picking-barcode-rubro small {
    overflow: hidden;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-picking-barcode-empty {
    display: grid;
    min-height: 3.2rem;
    place-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 850;
}

.control-picking-barcode-totals,
.control-picking-barcode-grand-total {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.control-picking-barcode-totals span,
.control-picking-barcode-grand-total span {
    display: grid;
    gap: 0.08rem;
    padding: 0.42rem 0.5rem;
    border-radius: 10px;
    background: #eef5ff;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 850;
    text-align: center;
}

.control-picking-barcode-totals strong,
.control-picking-barcode-grand-total strong {
    color: var(--control-accent-strong);
    font-size: 0.98rem;
    font-weight: 950;
}

.control-picking-barcode-grand-total {
    padding: 0.65rem;
    border-radius: 12px;
    background: #14532d;
}

.control-picking-barcode-grand-total span {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.82);
}

.control-picking-barcode-grand-total strong {
    color: #ffffff;
}

.control-picking-report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.control-picking-report-summary span {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    padding: 0.48rem 0.55rem;
    border: 1px solid #e3ebf5;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 850;
    box-shadow: 0 5px 14px rgba(0, 43, 98, 0.08);
}

.control-picking-report-summary strong {
    color: var(--control-accent-strong, #53318f);
    font-size: 1rem;
    font-weight: 950;
}

.control-picking-report-empty {
    display: grid;
    min-height: 12rem;
    place-items: center;
    padding: 1rem;
    color: #64748b;
    font-weight: 850;
    text-align: center;
}

.control-picking-report-table-wrap {
    overflow: auto;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 43, 98, 0.09);
}

.control-picking-report-table {
    width: 100%;
    min-width: 0;
    margin: 0;
    table-layout: fixed;
}

.control-picking-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #dbe4f0;
    background: #eef5ff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

.control-picking-report-table td,
.control-picking-report-table th {
    padding: 0.52rem 0.55rem;
    white-space: normal;
}

.control-picking-report-table th:first-child,
.control-picking-report-table td:first-child {
    width: 62%;
}

.control-picking-report-table th:nth-child(2),
.control-picking-report-table td:nth-child(2),
.control-picking-report-table th:nth-child(3),
.control-picking-report-table td:nth-child(3) {
    width: 19%;
}

.control-picking-report-rubro-row td {
    padding-top: 0.62rem;
    padding-bottom: 0.36rem;
    border-bottom: 0;
    background: #ffffff;
}

.control-picking-report-rubro-row span {
    display: inline-flex;
    max-width: 100%;
    padding: 0.22rem 0.55rem;
    border: 1px solid #d6e2f0;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--control-accent-strong, #53318f);
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1.1;
    text-transform: uppercase;
}

.control-picking-report-subtotal td {
    background: #f1f5f9;
    color: #334155;
    font-weight: 900;
}

.control-picking-report-table tfoot th {
    background: #1f2937;
    color: #ffffff;
    font-weight: 950;
}

.control-picking-confirm-product {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid #e8eef8;
    border-radius: 12px;
    background: #f8fbff;
}

.control-picking-confirm-product .imagepick {
    max-height: 4.8rem;
    object-fit: contain;
}

.control-picking-confirm-product div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.control-picking-confirm-product strong {
    color: var(--control-accent-strong);
    font-weight: 950;
}

.control-picking-confirm-product span {
    color: var(--ink);
    font-weight: 850;
    line-height: 1.15;
}

.control-picking-confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.control-picking-confirm-grid label,
.control-picking-lote {
    display: grid;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.control-picking-lote {
    margin-top: 0.8rem;
}

.control-picking-selection-modal .product-selection-shell {
    grid-template-rows: minmax(18rem, 40dvh) minmax(0, 1fr) auto;
}

.control-picking-selection-modal .product-hero-info div {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.control-picking-selection-modal .product-hero-info strong {
    min-width: 4.8rem;
    font-size: 1.28rem;
    text-align: right;
}

.control-picking-quantity-card {
    grid-template-columns: minmax(0, 1fr) auto;
}

.control-picking-confirm-detail strong {
    white-space: normal;
}

.control-picking-lote-form {
    padding: 1rem;
    border: 1px solid #e7edf6;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.control-picking-lote-form label {
    margin: 0;
}

.ingresos-app .ingresos-product-selection-modal {
    width: 100vw;
    max-width: 100vw;
    padding-right: 0 !important;
    overflow: hidden;
}

.ingresos-app .ingresos-product-selection-modal .modal-dialog,
.ingresos-app .ingresos-product-selection-modal .modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    margin: 0;
}

.ingresos-app .ingresos-product-selection-modal .product-selection-shell {
    grid-template-rows: minmax(18rem, 40dvh) minmax(0, 1fr) auto;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    border-radius: 0;
    background: #edf3fb;
    box-shadow: none;
}

.ingresos-app .ingresos-product-selection-modal .product-hero-info div {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
}

.ingresos-app .ingresos-product-selection-modal .product-hero-info strong {
    min-width: 5.2rem;
    font-size: 1.28rem;
    text-align: right;
}

.ingresos-app .ingresos-product-quantity-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.ingresos-app .ingresos-product-quantity-card > div {
    display: grid;
    gap: 0.55rem;
    justify-items: end;
}

.ingresos-app .ingresos-product-validation {
    width: min(17rem, 70vw);
    margin: 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    text-align: left;
}

.ingresos-app .ingresos-product-detail-card strong {
    white-space: normal;
}

.ingresos-app .ingresos-product-modal-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
    border: 1px solid #e7edf6;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.ingresos-app .ingresos-product-modal-form label {
    display: grid;
    gap: 0.45rem;
    width: 100%;
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ingresos-app .ingresos-product-modal-form .form-control {
    min-height: 2.75rem;
    border-color: #d7dce5;
    border-radius: 12px;
    color: #111827;
    font-weight: 850;
}

.ingresos-app .ingresos-product-modal-form textarea.form-control {
    min-height: 5.5rem;
    resize: vertical;
    text-align: left;
}

@media (max-width: 390px) {
    .control-picking-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .control-picking-app {
        --control-picking-fixed-card-height: 12.5rem;
    }

    .control-picking-sync-alert-button {
        min-width: 7.35rem;
        padding-right: 0.42rem;
        padding-left: 0.42rem;
        column-gap: 0.32rem;
    }

    .control-picking-sync-alert-icon {
        width: 1.12rem;
        height: 1.12rem;
        background-size: 1.12rem 1.12rem;
    }

    .control-picking-sync-alert-text strong {
        font-size: 0.66rem;
    }

    .control-picking-sync-alert-text small {
        font-size: 0.54rem;
    }

    .control-picking-title-header {
        gap: 0.35rem;
    }

    .control-picking-change-rubro-button {
        min-width: 4.25rem;
        padding-right: 0.42rem;
        padding-left: 0.42rem;
    }

    .control-picking-change-rubro-text strong {
        font-size: 0.62rem;
    }

    .control-picking-change-rubro-text small {
        font-size: 0.55rem;
    }

    .control-picking-product-main {
        grid-template-columns: 4.6rem minmax(0, 1fr) auto;
        gap: 0.45rem;
        padding: 0.5rem;
    }

    .control-picking-refresh {
        padding-right: 0.45rem;
        padding-left: 0.45rem;
        font-size: 0.72rem;
    }

    .control-picking-header-actions {
        gap: 0.25rem;
    }

    .control-picking-product-action .btn {
        min-width: 4.15rem;
        padding-right: 0.48rem;
        padding-left: 0.48rem;
        font-size: 0.72rem;
    }

    .control-picking-scroll-top {
        right: 0.75rem;
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
    }

    .control-picking-report-table {
        min-width: 0;
    }

    .control-picking-report-table thead {
        display: none;
    }

    .control-picking-report-table,
    .control-picking-report-table tbody,
    .control-picking-report-table tr,
    .control-picking-report-table td {
        display: block;
        width: 100%;
    }

    .control-picking-report-table tr {
        border-bottom: 1px solid #e8eef8;
    }

    .control-picking-report-table td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        text-align: right !important;
        white-space: normal;
    }

    .control-picking-report-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #64748b;
        font-weight: 900;
        text-align: left;
    }

    .control-picking-report-subtotal td {
        display: table-cell;
        width: auto;
    }

    .control-picking-report-subtotal td::before,
    .control-picking-report-table tfoot {
        display: none;
    }
}

@media (min-width: 980px) {
    .control-picking-app {
        --control-picking-top-offset: 3.5rem;
    }
}

.scanner-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.scanner-header {
    z-index: 10;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: center;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    background: rgba(0, 0, 0, 0.5);
}

.scanner-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.scanner-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
}

.btn-back,
.btn-close-session {
    z-index: 20;
    border: 0;
    background: none;
    color: #ffffff;
    font-size: 0.9rem;
}

.btn-back {
    justify-self: start;
    padding: 5px 10px;
}

.btn-back img {
    display: block;
    border-radius: 999px;
}

.btn-close-session {
    justify-self: end;
    padding: 5px 8px;
    font-weight: 700;
}

.scanner-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000000;
}

.scanner-screen #scannerContainer {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #000000;
}

.scanner-screen #scannerContainer video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.scanner-screen #scannerContainer [id$="__scan_region"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.scanner-screen #scannerContainer .qr-shaded-region,
.scanner-screen #scannerContainer [class*="qr-shaded-region"],
.scanner-screen #scannerContainer [id*="qr-shaded-region"],
.scanner-screen #scannerContainer [id$="__dashboard"],
.scanner-screen #scannerContainer [id$="__dashboard_section"],
.scanner-screen #scannerContainer [id$="__header_message"] {
    display: none !important;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.scanner-overlay.dimmed {
    opacity: 0.74;
}

.scanner-viewfinder {
    position: absolute;
    top: var(--scanner-frame-top);
    left: 50%;
    width: var(--scanner-frame-width);
    height: var(--scanner-frame-height);
    border-radius: var(--scanner-frame-radius);
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%);
}

.scanner-screen .corner {
    position: absolute;
    width: var(--scanner-corner-size);
    height: var(--scanner-corner-size);
    border: var(--scanner-corner-thickness) solid #ffffff;
}

.scanner-screen .top-left {
    top: -2px;
    left: -2px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: var(--scanner-frame-radius);
}

.scanner-screen .top-right {
    top: -2px;
    right: -2px;
    border-bottom: 0;
    border-left: 0;
    border-top-right-radius: var(--scanner-frame-radius);
}

.scanner-screen .bottom-left {
    bottom: -2px;
    left: -2px;
    border-top: 0;
    border-right: 0;
    border-bottom-left-radius: var(--scanner-frame-radius);
}

.scanner-screen .bottom-right {
    right: -2px;
    bottom: -2px;
    border-top: 0;
    border-left: 0;
    border-bottom-right-radius: var(--scanner-frame-radius);
}

.scan-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ff2d20;
    box-shadow: 0 0 14px rgba(255, 45, 32, 0.95);
}

.scanner-instruction {
    position: absolute;
    right: 0;
    bottom: 25%;
    left: 0;
    margin: 0;
    padding: 0 18px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.scanner-page-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: calc(100% - 28px);
}

.btn-switch-camera {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.68);
    color: #ffffff;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    touch-action: manipulation;
}

.scanner-page-actions .btn-switch-camera {
    position: static;
}

.manual-input-panel {
    z-index: 20;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.manual-input-panel.is-camera-active {
    display: none;
}

.handle {
    width: 45px;
    height: 5px;
    margin: 10px auto 14px;
    border-radius: 3px;
    background: #e0e0e0;
}

.input-container {
    display: grid;
    gap: 10px;
    padding: 0 20px;
}

.manual-input-panel label {
    display: block;
    margin-bottom: 6px;
    color: #555555;
    font-size: 0.95rem;
    font-weight: 600;
}

.manual-input-panel .btn-primary {
    border: 0;
    background-color: #044ec7;
    padding-right: 20px;
    padding-left: 20px;
}

.scanner-read-result {
    display: grid;
    gap: 0.18rem;
    margin-top: 0.65rem;
    padding: 0.7rem 0.8rem;
    border-left: 4px solid #157f8f;
    border-radius: 12px;
    background: #f4fbfb;
}

.scanner-read-result.is-error {
    border-left-color: #c0392b;
    background: #fff6f5;
}

.scanner-read-result span {
    color: #0f6862;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.scanner-read-result.is-error span {
    color: #a33a2c;
}

.scanner-read-result strong {
    color: #1f2937;
    font-size: 1.08rem;
    font-weight: 950;
}

.scanner-read-result small {
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 380px) {
    .scanner-title {
        font-size: 0.98rem;
    }

    .btn-close-session {
        padding-inline: 8px;
    }

    .scanner-viewfinder {
        top: 42%;
        width: 90vw;
        height: 45dvh;
    }

    .scanner-instruction {
        bottom: 28%;
    }

    .manual-input-panel label {
        margin-bottom: 10px;
    }

    .manual-input-panel .input-group {
        gap: 6px;
    }

    .manual-input-panel .input-group > .form-control,
    .manual-input-panel .input-group > .btn {
        border-radius: 8px;
    }

    .manual-input-panel .input-group > .btn {
        flex: 0 0 86px;
    }
}

@media (max-width: 380px) {
    .login-brand {
        font-size: 1.45rem;
    }

    .login-input-group {
        margin-bottom: 0.8rem;
    }

    .btn-full-primary,
    .btn-full-outline {
        border-radius: 10px;
    }

    .form-grid,
    .add-product-grid,
    .item-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 760px) {
    .login-viewport {
        min-height: 100dvh;
    }

    .form-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .work-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    }

    .customer-doc-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .pedido-top-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-menu-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-menu-button {
        min-height: 8.25rem;
    }

    .lower-grid {
        grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
    }

    .product-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .add-product-grid {
        grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(90px, 0.55fr)) auto;
    }

    .add-button {
        grid-column: auto;
        min-width: 96px;
    }

    .sales-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
    }

    .sales-header-actions-only {
        justify-content: flex-end;
        padding: 0;
    }

    .sales-header h1 {
        font-size: 1.55rem;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .facturas-toolbar {
        grid-template-columns: 11rem minmax(220px, 1fr) auto minmax(0, 1fr);
        align-items: center;
    }

    .facturas-toolbar .btn {
        grid-column: auto;
    }

    .facturas-client-filter,
    .facturas-filter-count {
        grid-column: auto;
    }

    .facturas-filter-count {
        justify-self: end;
        text-align: right;
    }

    .items-panel .table-responsive {
        display: block;
    }

    .mobile-items,
    .mobile-action-bar {
        display: none;
    }

    .sales-page {
        padding-bottom: 0;
    }

    .facturacion-page {
        height: calc(100dvh - 3.5rem - 2.5rem);
    }

    .facturas-share-page {
        height: calc(100dvh - 3.5rem - 3.25rem);
    }
}

.operation-message {
    display: grid;
    gap: 0.15rem;
    margin: 0 0 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-left-width: 4px;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
}

.operation-message strong {
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.operation-message span {
    font-size: 0.92rem;
}

.operation-message.is-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.operation-message.is-error {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.operation-message.is-info {
    border-left-color: #2563eb;
}

.local-recovery-actions,
.bottom-action-bar > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.bottom-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
    border-top: 1px solid #d1d5db;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
}

.bottom-action-bar > span {
    min-width: 0;
    color: #334155;
    font-weight: 700;
}

.mobile-task-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.mobile-task-header h1 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
}

.mobile-task-header p {
    margin: 0.15rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.mobile-task-header > strong {
    flex: 0 0 auto;
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    background: #ecfeff;
    color: #155e75;
    font-size: 0.78rem;
}

.scanner-fallback-note {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 4;
    margin: 0;
    color: #e5e7eb;
    font-size: 0.82rem;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.pedido-full-scanner-overlay .scanner-fallback-note,
.app-scanner-overlay .scanner-fallback-note {
    position: static;
    margin-top: 0.35rem;
}

.cierre-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.cierre-stepper span {
    display: grid;
    gap: 0.15rem;
    min-height: 44px;
    align-content: center;
    padding: 0.35rem 0.45rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 0.72rem;
    text-align: center;
}

.cierre-stepper strong {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    margin: 0 auto;
    border-radius: 999px;
    background: #e5e7eb;
    color: #111827;
    font-size: 0.78rem;
}

.cierre-stepper .is-current {
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.cierre-stepper .is-current strong {
    background: #2563eb;
    color: #ffffff;
}

.cierre-stepper .is-done {
    border-color: #16a34a;
    color: #166534;
}

.cierre-stepper .is-done strong {
    background: #dcfce7;
    color: #166534;
}

.admin-permission-diff {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.85rem;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-permission-diff h3 {
    margin: 0;
    font-size: 0.9rem;
}

.admin-permission-diff span {
    display: block;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    font-size: 0.84rem;
}

.ingresos-historico-cards {
    display: grid;
    gap: 0.65rem;
}

.ingresos-historico-card {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.ingresos-historico-card > div {
    display: grid;
    gap: 0.15rem;
}

.ingresos-historico-card strong {
    color: #111827;
    font-size: 0.95rem;
}

.ingresos-historico-card span {
    color: #475569;
    font-size: 0.82rem;
}

.ingresos-historico-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0;
}

.ingresos-historico-card dl div {
    display: grid;
    gap: 0.1rem;
}

.ingresos-historico-card dt {
    color: #64748b;
    font-size: 0.72rem;
}

.ingresos-historico-card dd {
    margin: 0;
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 700;
}

.ingresos-historico-table-wrap {
    display: none;
}

@media (min-width: 768px) {
    .ingresos-historico-cards {
        display: none;
    }

    .ingresos-historico-table-wrap {
        display: block;
    }
}

@media (min-width: 1024px) {
    .facturacion-page .product-stack,
    .pedido-page .pedido-scan-panel {
        position: sticky;
        top: 4.5rem;
        align-self: start;
    }

    .admin-user-modal .modal-body {
        display: grid;
        grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.75fr);
        gap: 1rem;
        align-items: start;
    }

    .admin-user-modal .admin-permissions-grid {
        grid-column: 1;
    }

    .admin-user-modal .admin-permission-diff {
        grid-column: 2;
        margin-top: 0;
    }
}

/* Critical layout fallback for installed PWAs that can briefly run without the isolated layout CSS. */
.page {
    min-height: 100dvh;
    background: #f0f4f8;
}

main {
    min-width: 0;
    min-height: 100dvh;
}

.sidebar {
    display: none;
}

.top-row {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e8eef8;
    box-shadow: 0 4px 16px rgba(9, 56, 139, 0.08);
    backdrop-filter: blur(10px);
}

.system-title {
    display: block;
    color: #1f2937;
    font-weight: 900;
    line-height: 1.05;
}

.top-title-group {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.45rem;
}

.top-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
}

.top-menu-button,
.top-logout {
    border: 1px solid #b7c7dd;
    border-radius: 999px;
    background: #ffffff;
    color: #09388b;
    font-weight: 850;
    line-height: 1;
    transition: transform 0.12s ease, border-color 0.18s ease, background-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.top-menu-button {
    min-height: 2rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.95rem;
}

.top-logout {
    max-width: 44vw;
    overflow: hidden;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-menu-button:active,
.top-logout:active {
    transform: scale(0.97);
}

.top-menu-button:hover,
.top-logout:hover {
    border-color: #09388b;
    background: #eef5ff;
}

.top-icon-action {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background-color: #ffffff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.2rem 1.2rem;
    box-shadow: 0 5px 14px rgba(0, 43, 98, 0.1);
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.top-icon-action:active {
    transform: scale(0.96);
}

article.content {
    min-height: calc(100dvh - 3.25rem);
    padding: 0.8rem 0.8rem 5.5rem !important;
}

article.content.cierre-reparto-content {
    padding: 1px !important;
}

article.content.admin-users-content,
article.content.ingresos-content {
    padding: 0 !important;
}

article.content.home-content {
    padding-bottom: 0.75rem !important;
}

.page.control-picking-layout-page main {
    padding-top: 3.25rem;
}

.page.control-picking-layout-page .top-row,
.page.ingresos-fixed-header-layout-page .top-row,
.page.ingresos-control-detalle-layout-page .top-row {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1055;
}

.page.ingresos-fixed-header-layout-page main,
.page.ingresos-control-detalle-layout-page main {
    padding-top: 3.25rem;
}

@media (min-width: 980px) {
    .page {
        display: flex;
    }

    .sidebar {
        display: block;
        width: 240px;
        min-height: 100dvh;
        position: sticky;
        top: 0;
        background: linear-gradient(180deg, #002b62 0%, #09388b 100%);
        box-shadow: 8px 0 24px rgba(0, 43, 98, 0.18);
    }

    main {
        flex: 1;
    }

    .top-row {
        height: 3.5rem;
    }

    article.content {
        min-height: calc(100dvh - 3.5rem);
        padding: 1.25rem 1.5rem 2rem !important;
    }

    article.content.admin-users-content {
        height: calc(100dvh - 3.5rem);
        min-height: 0;
        overflow: hidden;
    }

    .page.control-picking-layout-page main,
    .page.ingresos-fixed-header-layout-page main,
    .page.ingresos-control-detalle-layout-page main {
        padding-top: 3.5rem;
    }
}
