/* Marivent — Ventas (Factura + POS) */

:root {
    --sale-teal: #00bfa5;
    --sale-teal-dark: #0f766e;
    --sale-ink: #1f2a37;
    --sale-muted: #6b7280;
    --sale-line: #e5e7eb;
    --sale-bg: #f3f5f7;
    --sale-surface: #ffffff;
    --sale-font: "Manrope", system-ui, sans-serif;
}

/* —— Layout full-bleed dentro del shell —— */
.shell-main:has(.sale-pos-root),
.shell-main:has(.sale-pos-page),
.shell-main:has(.sale-invoice-root) {
    padding: 0 !important;
    background: var(--sale-bg);
}

.sale-pos-root,
.sale-invoice-root {
    min-height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    font-family: var(--sale-font);
    color: var(--sale-ink);
}

.shell-body:has(.sale-pos-root),
.shell-body:has(.sale-pos-page) {
    height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    max-height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    overflow: hidden;
}

.shell-main:has(.sale-pos-root),
.shell-main:has(.sale-pos-page) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shell-main:has(.sale-pos-root) > .sale-pos-root,
.shell-main:has(.sale-pos-page) > .sale-pos-page {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.sale-pos-page {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    position: relative;
}

.shell-root.is-collapsed .shell-main:has(.sale-pos-root),
.shell-root.is-collapsed .sale-pos-root {
    width: 100%;
    max-width: 100%;
}

/* ===================== FACTURA ===================== */
.sale-invoice-root {
    padding: 1.25rem 1.5rem 2.5rem;
}

.sale-invoice-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sale-invoice-toolbar h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sale-invoice-toolbar p {
    margin: 0.2rem 0 0;
    color: var(--sale-muted);
    font-size: 0.88rem;
}

.sale-invoice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.sale-invoice-canvas {
    display: flex;
    justify-content: center;
}

.sale-invoice-paper {
    width: min(860px, 100%);
    background: var(--sale-surface);
    border-radius: 0.35rem;
    box-shadow:
        0 1px 2px rgba(15, 39, 68, 0.06),
        0 12px 40px rgba(15, 39, 68, 0.1);
    border: 1px solid #e8eaed;
    overflow: hidden;
}

.sale-invoice-paper-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem 1.1rem;
    border-bottom: 1px solid var(--sale-line);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.sale-invoice-brand {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.sale-invoice-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.45rem;
    background: linear-gradient(145deg, #ccfbf1, #99f6e4);
    border: 1px dashed #5eead4;
    display: grid;
    place-items: center;
    color: var(--sale-teal-dark);
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.sale-invoice-brand h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.sale-invoice-brand small {
    color: var(--sale-muted);
    font-size: 0.82rem;
}

.sale-invoice-number {
    text-align: right;
    min-width: 15rem;
    max-width: 18rem;
    flex: 0 1 18rem;
}

.sale-invoice-number span {
    display: block;
    font-size: 0.75rem;
    color: var(--sale-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sale-invoice-number strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.15rem;
    color: var(--sale-teal-dark);
    letter-spacing: 0.02em;
    word-break: break-all;
}

.sale-invoice-number-hint {
    display: block;
    margin-top: 0.2rem;
    color: var(--sale-muted);
    font-size: 0.75rem;
}

.sale-invoice-series-static {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 650;
    color: #374151;
}

.sale-invoice-series-select {
    margin-top: 0.35rem;
    width: 100%;
    max-width: none;
    margin-left: 0;
}

.sale-invoice-series-select .mud-input-control {
    margin: 0;
}

.sale-invoice-series-select .mud-input {
    background: #fff;
}

.sale-invoice-series-select .mud-select-input,
.sale-invoice-series-select .mud-input-slot {
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
}

.sale-invoice-number span.mt-2 {
    margin-top: 0.65rem;
}

.sale-invoice-fields {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 0.85rem 1rem;
    padding: 1.15rem 1.75rem;
}

.sale-invoice-fields .sale-field-wide {
    grid-column: 1 / -1;
}

.sale-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sale-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.sale-field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--sale-muted);
}

.sale-invoice-detail-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.75rem;
    background: #f8fafb;
    border-top: 1px solid var(--sale-line);
    border-bottom: 1px solid var(--sale-line);
}

.sale-invoice-detail-bar h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
}

.sale-invoice-lines {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 0.35rem;
}

.sale-invoice-lines-head {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(5.5rem, 0.7fr) 5.5rem 5.5rem 5.5rem 5.25rem 2.5rem;
    gap: 0.45rem;
    align-items: center;
    padding: 0.65rem 1.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sale-muted);
    background: #fafbfc;
    border-bottom: 1px solid var(--sale-line);
}

.sale-invoice-line-card {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(5.5rem, 0.7fr) 5.5rem 5.5rem 5.5rem 5.25rem 2.5rem;
    gap: 0.45rem;
    align-items: center;
    padding: 0.55rem 1.75rem;
    border-bottom: 1px solid #f0f1f3;
}

.sale-invoice-line-label {
    display: none;
    margin-bottom: 0.28rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--sale-muted);
}

.sale-invoice-line-field {
    min-width: 0;
}

.sale-invoice-line-nums {
    display: contents;
}

.sale-invoice-line-foot {
    display: contents;
}

.sale-invoice-line-total {
    font-weight: 700;
    white-space: nowrap;
    color: var(--sale-ink);
}

.sale-invoice-line-total strong {
    font-size: 0.92rem;
    color: var(--sale-teal-dark);
}

.sale-invoice-line-remove {
    justify-self: end;
}

.sale-invoice-foot {
    display: grid;
    grid-template-columns: 1fr minmax(14rem, 16rem);
    gap: 1.5rem;
    padding: 1.25rem 1.75rem 1.5rem;
    align-items: end;
}

.sale-invoice-foot-note {
    color: var(--sale-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.sale-invoice-totals {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sale-invoice-totals-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.sale-invoice-totals-row.is-grand {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 2px solid var(--sale-ink);
    font-size: 1.05rem;
    color: var(--sale-ink);
    font-weight: 700;
}

.sale-invoice-totals-row.is-grand strong {
    color: var(--sale-teal-dark);
    font-size: 1.35rem;
    font-weight: 800;
}

/* ===================== POS ===================== */
.sale-pos-root {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(380px, 38vw);
    background: var(--sale-bg);
    height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    max-height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    min-height: 0;
    overflow: hidden;
}

.sale-pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.5rem;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.sale-pos-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(90deg, #ecfdf5, #f0fdfa);
    border: 1px solid #a7f3d0;
    border-radius: 0.55rem;
    color: var(--sale-teal-dark);
    font-size: 0.88rem;
    font-weight: 600;
}

.sale-pos-search-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.sale-pos-search-row .sale-pos-search {
    flex: 1;
    background: #fff;
    border-radius: 0.55rem;
}

.sale-pos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sale-pos-chips .mud-chip {
    background: #fff !important;
    color: #1f2a37 !important;
    border: 1px solid #d1d5db !important;
    font-weight: 650 !important;
    opacity: 1 !important;
}

.sale-pos-chips .mud-chip.mud-chip-filled {
    background: var(--sale-teal) !important;
    border-color: var(--sale-teal) !important;
    color: #fff !important;
}

.sale-pos-chips .mud-chip .mud-chip-content {
    color: inherit !important;
}

.sale-chip {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sale-chip:hover { border-color: var(--sale-teal); color: var(--sale-teal-dark); }

.sale-chip.is-active {
    background: var(--sale-teal);
    border-color: var(--sale-teal);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.25);
}

.sale-pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)) !important;
    gap: 1.05rem !important;
    align-content: start;
}

.sale-pos-card.mud-button-root,
.sale-pos-card {
    appearance: none;
    -webkit-appearance: none;
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start;
    text-align: left;
    border: 1px solid var(--sale-line) !important;
    background: var(--sale-surface) !important;
    border-radius: 0.85rem !important;
    padding: 0 !important;
    min-height: 8.75rem;
    cursor: pointer;
    font-family: inherit;
    color: inherit !important;
    text-transform: none !important;
    box-shadow: 0 1px 3px rgba(15, 39, 68, 0.04) !important;
    transition: border-color 0.12s ease;
    position: relative;
    z-index: 2;
    width: 100%;
    height: auto !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto !important;
}

.sale-pos-card .mud-button-label,
.sale-pos-card-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    padding: 0.95rem 0.9rem 0.9rem;
    text-align: left;
    white-space: normal;
    pointer-events: none;
}

.sale-pos-card:hover {
    border-color: var(--sale-teal) !important;
}

.sale-pos-card:active {
    border-color: var(--sale-teal) !important;
    background: #f0fdfa !important;
}

.sale-pos-card-simple {
    background: linear-gradient(160deg, #ecfdf5 0%, #ffffff 70%) !important;
    border-color: #99f6e4 !important;
    min-height: 7.25rem;
}

.sale-pos-card-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #ccfbf1;
    color: var(--sale-teal-dark);
    display: grid;
    place-items: center;
    margin-bottom: 0.1rem;
    font-weight: 800;
    font-size: 0.95rem;
}

.sale-pos-card-name {
    font-weight: 750;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--sale-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sale-pos-card-code {
    font-size: 0.75rem;
    color: #9ca3af;
}

.sale-pos-card-price {
    margin-top: 0;
    padding-top: 0;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--sale-teal-dark);
    white-space: nowrap;
}

.sale-pos-card-meta {
    margin-top: auto;
    padding-top: 0.35rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
}

.sale-pos-card-stock {
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.sale-pos-card-stock.is-low {
    color: #d97706;
}

.sale-pos-card-stock.is-out {
    color: #dc2626;
}

.sale-pos-card.is-no-stock {
    opacity: 0.72;
    border-color: #fecaca !important;
}

.sale-pos-card-qty {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--sale-teal);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.sale-pos-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--sale-muted);
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 0.7rem;
}

/* Ticket / Boleta */
.sale-pos-ticket {
    display: flex;
    flex-direction: column;
    background: var(--sale-surface);
    border-left: 1px solid var(--sale-line);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    box-shadow: -8px 0 28px rgba(15, 39, 68, 0.05);
}

.sale-pos-ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--sale-line);
    flex-shrink: 0;
}

.sale-pos-ticket-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.sale-pos-sunat-hint {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #92400e;
    letter-spacing: 0.01em;
}

.sale-pos-ticket-meta {
    padding: 0.85rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-bottom: 1px solid var(--sale-line);
    background: #fafbfc;
    flex-shrink: 0;
}

.sale-pos-ticket-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sale-pos-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sale-pos-line-empty {
    margin: 2rem 0.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.sale-pos-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 0.35rem 0.45rem;
    align-items: center;
    padding: 0.65rem 0.45rem;
    border-radius: 0.45rem;
}

.sale-pos-line:hover { background: #f8fafb; }

.sale-pos-line-remove {
    color: var(--sale-muted) !important;
}

.sale-pos-line-remove:hover {
    color: #b91c1c !important;
}

.sale-pos-line-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sale-pos-line-info strong {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sale-pos-line-info span {
    font-size: 0.75rem;
    color: var(--sale-muted);
}

.sale-pos-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0.1rem;
}

.sale-pos-qty span {
    min-width: 1.4rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.sale-pos-line-total {
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sale-pos-summary {
    padding: 0.85rem 1.1rem 1.15rem;
    border-top: 1px solid var(--sale-line);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 3;
    box-shadow: 0 -6px 16px rgba(15, 39, 68, 0.06);
}

.sale-pos-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #4b5563;
}

.sale-pos-sell {
    margin-top: 0.35rem !important;
    height: 3rem !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    border-radius: 0.55rem !important;
    background: var(--sale-teal) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(0, 191, 165, 0.28) !important;
    opacity: 1 !important;
}

.sale-pos-sell .mud-button-label {
    color: #fff !important;
    opacity: 1 !important;
}

.sale-pos-sell.mud-disabled,
.sale-pos-sell:disabled,
.sale-pos-sell.mud-button-root:disabled {
    background: #99f6e4 !important;
    color: #0f766e !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.sale-pos-sell.mud-disabled .mud-button-label,
.sale-pos-sell:disabled .mud-button-label {
    color: #0f766e !important;
    opacity: 1 !important;
}

.sale-pos-cart-fab,
.sale-pos-cart-scrim,
.sale-pos-cart-close,
.sale-pos-cart-bar {
    display: none;
}

/* Botón carrito flotante — móvil / tablet */
@media (max-width: 1100px) {
    .sale-pos-cart-fab {
        display: inline-flex !important;
        align-items: center;
        gap: 0.45rem;
        position: fixed !important;
        right: 0.85rem;
        bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
        z-index: 1200 !important;
        margin: 0;
        padding: 0.75rem 1rem;
        border: 0;
        border-radius: 999px;
        background: #00bfa5 !important;
        color: #fff !important;
        box-shadow: 0 10px 28px rgba(0, 191, 165, 0.45);
        font-family: var(--sale-font);
        font-weight: 800;
        font-size: 0.92rem;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .sale-pos-cart-fab .mud-icon-root {
        color: #fff !important;
        font-size: 1.35rem !important;
    }

    .sale-pos-cart-fab-badge {
        position: absolute;
        top: -0.25rem;
        left: -0.2rem;
        min-width: 1.4rem;
        height: 1.4rem;
        padding: 0 0.3rem;
        border-radius: 999px;
        background: #0f766e;
        border: 2px solid #fff;
        color: #fff;
        font-size: 0.7rem;
        font-weight: 800;
        display: grid;
        place-items: center;
    }

    .sale-pos-cart-fab-total {
        white-space: nowrap;
    }

    .sale-pos-page.is-cart-open .sale-pos-cart-fab {
        display: none !important;
    }

    .sale-pos-cart-bar {
        display: inline-flex !important;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .sale-pos-cart-bar-count {
        margin-left: 0.2rem;
        font-weight: 800;
    }

    .sale-pos-cart-scrim {
        display: block !important;
        position: fixed !important;
        inset: 0;
        z-index: 1190 !important;
        margin: 0;
        padding: 0;
        border: 0;
        background: rgba(15, 39, 68, 0.45);
        cursor: pointer;
    }

    .sale-pos-cart-close {
        display: inline-flex !important;
    }
}

.sale-pos-ticket-head-actions {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.sale-pos-ticket-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--sale-muted);
    font-size: 0.85rem;
}

.sale-btn-primary {
    background: var(--sale-teal) !important;
    color: #fff !important;
}

.sale-btn-primary .mud-button-label {
    color: #fff !important;
}

/* Botones y links Primary = teal plantilla (no morado Mud) */
.sale-invoice-root .mud-button-outlined-primary,
.sale-pos-root .mud-button-outlined-primary,
.sale-detail-root .mud-button-outlined-primary {
    color: var(--sale-teal-dark) !important;
    border-color: var(--sale-teal) !important;
}

.sale-invoice-root .mud-button-outlined-primary:hover,
.sale-pos-root .mud-button-outlined-primary:hover,
.sale-detail-root .mud-button-outlined-primary:hover {
    background: rgba(0, 191, 165, 0.08) !important;
    border-color: var(--sale-teal-dark) !important;
    color: var(--sale-teal-dark) !important;
}

.sale-invoice-root .mud-button-text-primary,
.sale-pos-root .mud-button-text-primary,
.sale-detail-root .mud-button-text-primary {
    color: var(--sale-teal-dark) !important;
}

.sale-invoice-root .mud-button-filled-primary:not(.sale-btn-primary),
.sale-pos-root .mud-button-filled-primary:not(.sale-pos-sell),
.sale-detail-root .mud-button-filled-primary {
    background: var(--sale-teal) !important;
    color: #fff !important;
}

.sale-invoice-root .mud-input:focus-within,
.sale-invoice-root .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.sale-pos-root .mud-input:focus-within {
    border-color: var(--sale-teal) !important;
}

.sale-invoice-root .mud-input-label-inputfocused,
.sale-pos-root .mud-input-label-inputfocused {
    color: var(--sale-teal-dark) !important;
}

.sale-invoice-root .mud-svg-icon,
.sale-pos-root .mud-button-outlined-primary .mud-icon-root,
.sale-invoice-root .mud-button-text-primary .mud-icon-root {
    color: inherit !important;
}

.sale-invoice-root .mud-input,
.sale-invoice-root .mud-input-slot,
.sale-invoice-root .mud-select,
.sale-pos-root .mud-input,
.sale-pos-root .mud-input-slot,
.sale-pos-root .mud-select {
    color: var(--sale-ink) !important;
}

.sale-pos-ticket-foot .mud-button-root {
    color: var(--sale-muted) !important;
}

/* ===================== DETALLE + TICKET ===================== */
.shell-main:has(.sale-detail-root) {
    padding: 0 !important;
    background: var(--sale-bg);
}

.sale-detail-root {
    min-height: calc(100vh - var(--shell-topbar-h, 3.5rem));
    padding: 1.15rem 1.35rem 2rem;
    font-family: var(--sale-font);
    color: var(--sale-ink);
}

.sale-detail-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.sale-detail-toolbar h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sale-detail-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.sale-detail-meta {
    color: var(--sale-muted);
    font-size: 0.82rem;
    margin-left: 0.25rem;
}

.sale-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sale-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: #eef2f6;
    color: #475569;
}

.sale-status-chip.is-ok,
.sale-status-chip.is-paid {
    background: #ccfbf1;
    color: #0f766e;
}

.sale-status-chip.is-partial {
    background: #fef3c7;
    color: #92400e;
}

.sale-status-chip.is-draft {
    background: #e2e8f0;
    color: #475569;
}

.sale-status-chip.is-void {
    background: #fee2e2;
    color: #b91c1c;
}

.sale-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.1rem;
    align-items: start;
}

.sale-detail-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.sale-detail-main {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}

/* Formularios compactos (devoluciones / NC) */
.sale-form-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.sale-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.sale-form-field-sm {
    max-width: 140px;
}

.sale-form-field-md {
    max-width: 320px;
}

.sale-form-total {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.35rem;
    color: var(--sale-ink);
}

/* —— Selector venta / devolución (UX) —— */
.sale-pick-page {
    max-width: 920px;
}

.sale-pick-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.sale-pick-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    background: var(--sale-surface);
    border: 1px solid var(--sale-line);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
}

.sale-pick-step-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    background: var(--sale-teal-dark);
    flex-shrink: 0;
}

.sale-pick-step-body h2 {
    margin: 0 0 0.55rem;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.sale-pick-hint,
.sale-pick-empty {
    margin: 0 0 0.65rem;
    color: var(--sale-muted);
    font-size: 0.85rem;
}

.sale-pick-search {
    max-width: 100%;
}

.sale-pick-field {
    max-width: 360px;
}

.sale-pick-fields {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.sale-pick-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.sale-pick-card {
    background: linear-gradient(145deg, #f0fdfa 0%, #ffffff 55%);
    border: 1px solid #99f6e4;
    border-radius: 0.55rem;
    padding: 0.95rem 1.05rem;
}

.sale-pick-card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.sale-pick-card-top strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
}

.sale-pick-card-top p {
    margin: 0.2rem 0 0;
    color: var(--sale-muted);
    font-size: 0.85rem;
}

.sale-pick-card-total {
    text-align: right;
}

.sale-pick-card-total span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sale-muted);
}

.sale-pick-card-total strong {
    color: var(--sale-teal-dark);
    font-size: 1.2rem;
}

.sale-pick-card-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.sale-pick-card-stats div {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--sale-line);
    border-radius: 0.35rem;
    padding: 0.4rem 0.55rem;
}

.sale-pick-card-stats span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sale-muted);
}

.sale-pick-card-stats strong {
    font-size: 0.92rem;
}

.sale-pick-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.55rem;
}

.sale-pick-option {
    text-align: left;
    border: 1px solid var(--sale-line);
    background: #fff;
    border-radius: 0.45rem;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sale-pick-option:hover {
    border-color: #5eead4;
}

.sale-pick-option.is-active {
    border-color: var(--sale-teal-dark);
    background: #f0fdfa;
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.sale-pick-option-title {
    display: block;
    font-weight: 750;
    font-size: 0.9rem;
    color: var(--sale-ink);
}

.sale-pick-option-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--sale-muted);
}

.sale-pick-preview {
    background: var(--sale-surface);
    border: 1px solid var(--sale-line);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.sale-pick-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--sale-line);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.sale-pick-preview-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.sale-pick-preview-head strong {
    color: var(--sale-teal-dark);
    font-size: 1.05rem;
}

.sale-pick-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1.25rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--sale-line);
    background: #fafbfc;
}

.sale-pick-totals div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.sale-pick-totals span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sale-muted);
}

.sale-pick-totals.is-grand strong,
.sale-pick-totals .is-grand strong {
    color: var(--sale-teal-dark);
    font-size: 1.1rem;
}

@media (max-width: 720px) {
    .sale-pick-card-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sale-pick-card-top {
        flex-direction: column;
    }

    .sale-pick-card-total {
        text-align: left;
    }
}

.sale-detail-root a {
    color: var(--sale-teal-dark);
    font-weight: 600;
    text-decoration: none;
}

.sale-detail-root a:hover {
    text-decoration: underline;
}

.sale-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    background: var(--sale-surface);
    border: 1px solid var(--sale-line);
    border-radius: 0.4rem;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
}

.sale-detail-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.sale-detail-summary-item span {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sale-muted);
}

.sale-detail-summary-item strong {
    font-size: 0.95rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sale-detail-summary-total {
    background: linear-gradient(145deg, #f0fdfa, #ecfeff);
    border: 1px solid #99f6e4;
    border-radius: 0.35rem;
    padding: 0.45rem 0.6rem;
}

.sale-detail-summary-total strong {
    color: var(--sale-teal-dark);
    font-size: 1.05rem;
}

.sale-detail-summary-notes {
    grid-column: 1 / -1;
}

.sale-detail-panel {
    background: var(--sale-surface);
    border: 1px solid var(--sale-line);
    border-radius: 0.4rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
}

.sale-detail-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sale-line);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.sale-detail-panel-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.sale-detail-panel-head span {
    color: var(--sale-muted);
    font-size: 0.78rem;
}

.sale-detail-table {
    background: transparent;
}

.sale-detail-table .mud-table-container,
.sale-detail-table .mud-table-root,
.sale-detail-table table {
    background: #fff !important;
}

.sale-detail-table .mud-table-head .mud-table-cell {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sale-muted) !important;
    background: #fafbfc !important;
}

.sale-detail-table .mud-table-body .mud-table-cell {
    color: var(--sale-ink) !important;
    background: #fff !important;
}

.sale-detail-table .mud-table-empty-row td,
.sale-detail-table .mud-table-body tr td {
    background: #fff !important;
}

.sale-cell-strong {
    font-weight: 700;
    color: var(--sale-ink);
}

.sale-detail-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--sale-muted) !important;
    background: #fff !important;
}

.sale-detail-empty p {
    margin: 0;
    color: var(--sale-muted) !important;
}

.sale-detail-ticket-pane {
    position: sticky;
    top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sale-ticket-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sale-ticket-pane-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.sale-ticket-pane-head p {
    margin: 0.1rem 0 0;
    color: var(--sale-muted);
    font-size: 0.75rem;
}

.sale-ticket {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    background: #fff;
    color: #111;
    border: 1px dashed #cbd5e1;
    box-shadow:
        0 1px 2px rgba(15, 39, 68, 0.05),
        0 10px 28px rgba(15, 39, 68, 0.08);
    padding: 0.75rem 0.7rem 1rem;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 11px;
    line-height: 1.35;
}

.sale-ticket-head {
    text-align: center;
}

.sale-ticket-brand {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sale-ticket-sub {
    color: #444;
    margin-top: 0.15rem;
}

.sale-ticket-doc {
    margin-top: 0.35rem;
    font-size: 13px;
    font-weight: 800;
}

.sale-ticket-sunat-warn {
    margin-top: 0.45rem;
    padding: 0.35rem 0.3rem;
    border: 1px solid #111;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sale-ticket-sunat-warn span {
    display: block;
    margin-top: 0.2rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 9px;
}

.sale-ticket-sunat-warn-foot {
    margin: 0 0 0.35rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 9px;
}

.sale-ticket-sep {
    border-top: 1px dashed #94a3b8;
    margin: 0.55rem 0;
}

.sale-ticket-meta > div,
.sale-ticket-totals > div,
.sale-ticket-pay,
.sale-ticket-line-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.sale-ticket-meta > div span:first-child,
.sale-ticket-totals > div span:first-child {
    color: #555;
}

.sale-ticket-cols {
    display: grid;
    grid-template-columns: 2.2rem 1fr 3.5rem;
    gap: 0.25rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    margin-bottom: 0.25rem;
}

.sale-ticket-cols span:last-child {
    text-align: right;
}

.sale-ticket-line {
    margin-bottom: 0.4rem;
}

.sale-ticket-line-name {
    font-weight: 700;
    word-break: break-word;
}

.sale-ticket-line-row span:last-child {
    font-weight: 700;
    white-space: nowrap;
}

.sale-ticket-line-disc {
    color: #666;
    font-size: 10px;
}

.sale-ticket-totals {
    margin-top: 0.1rem;
}

.sale-ticket-total {
    font-size: 12px;
    font-weight: 800;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid #111;
}

.sale-ticket-section-title {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 10px;
    margin-bottom: 0.25rem;
}

.sale-ticket-notes {
    white-space: pre-wrap;
    word-break: break-word;
}

.sale-ticket-foot {
    text-align: center;
    color: #444;
}

.sale-ticket-foot div:first-child {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

@media (max-width: 1100px) {
    .shell-body:has(.sale-pos-root),
    .shell-body:has(.sale-pos-page) {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .shell-main:has(.sale-pos-root),
    .shell-main:has(.sale-pos-page) {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }

    .shell-main:has(.sale-pos-root) > .sale-pos-root,
    .shell-main:has(.sale-pos-page) > .sale-pos-page {
        flex: none;
        min-height: calc(100dvh - var(--shell-topbar-h, 3.5rem));
        height: auto;
        overflow: visible;
    }

    .sale-pos-root {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        height: auto;
        max-height: none;
        overflow: visible;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .sale-pos-catalog {
        order: 1;
        overflow: visible;
        padding: 0.75rem 0.8rem 5.5rem;
        gap: 0.7rem;
    }

    .sale-pos-banner {
        flex-wrap: wrap;
        font-size: 0.8rem;
        padding: 0.45rem 0.7rem;
    }

    .sale-pos-search-row {
        gap: 0.45rem;
    }

    .sale-pos-new-btn {
        flex-shrink: 0;
        min-width: 2.75rem !important;
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }

    .sale-pos-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
        gap: 0.35rem;
        scrollbar-width: none;
    }

    .sale-pos-chips::-webkit-scrollbar {
        display: none;
    }

    .sale-pos-chips .mud-chip {
        flex: 0 0 auto;
    }

    .sale-pos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.55rem !important;
    }

    .sale-pos-card.mud-button-root,
    .sale-pos-card {
        min-height: 6.5rem;
        border-radius: 0.65rem !important;
        box-shadow: none !important;
        transition: none;
    }

    .sale-pos-card .mud-button-label,
    .sale-pos-card-inner {
        padding: 0.7rem 0.65rem 0.65rem;
        gap: 0.2rem;
    }

    .sale-pos-card-name {
        font-size: 0.82rem;
    }

    .sale-pos-card-price {
        font-size: 0.92rem;
    }

    .sale-pos-ticket {
        order: 2;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1210 !important;
        height: auto;
        max-height: min(88dvh, 40rem);
        min-height: 0;
        border-left: none;
        border-top: 1px solid var(--sale-line);
        border-radius: 1.1rem 1.1rem 0 0;
        overflow: hidden;
        box-shadow: 0 -8px 24px rgba(15, 39, 68, 0.14);
        display: flex;
        flex-direction: column;
        background: #fff;
        transform: translateY(110%);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition:
            transform 0.22s ease-out,
            opacity 0.18s ease;
    }

    .sale-pos-ticket.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .sale-pos-ticket-head {
        padding: 0.7rem 0.85rem 0.55rem;
    }

    .sale-pos-ticket-head h2 {
        font-size: 0.98rem;
    }

    .sale-pos-ticket-meta {
        padding: 0.55rem 0.85rem 0.65rem;
        gap: 0.45rem;
    }

    .sale-pos-desktop-only {
        display: none !important;
    }

    .sale-pos-lines {
        flex: 1 1 auto;
        min-height: 4rem;
        max-height: none;
        overflow-y: auto;
        padding: 0.4rem 0.65rem;
    }

    .sale-pos-line {
        grid-template-columns: minmax(0, 1fr) auto auto;
        padding: 0.45rem 0.25rem;
        gap: 0.25rem 0.35rem;
    }

    .sale-pos-line-remove {
        grid-column: 3;
        grid-row: 1;
    }

    .sale-pos-line-total {
        grid-column: 1 / -1;
        text-align: right;
        font-size: 0.85rem;
    }

    .sale-pos-line-empty {
        margin: 0.65rem 0.25rem;
        font-size: 0.82rem;
    }

    .sale-pos-summary {
        position: relative;
        flex-shrink: 0;
        padding: 0.65rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0));
        box-shadow: 0 -4px 14px rgba(15, 39, 68, 0.06);
    }

    .sale-pos-sell {
        height: 2.85rem !important;
        font-size: 1rem !important;
    }

    .sale-invoice-fields {
        grid-template-columns: 1fr;
    }

    .sale-invoice-foot {
        grid-template-columns: 1fr;
    }

    .sale-invoice-paper-top {
        flex-direction: column;
        align-items: stretch;
        padding: 1.15rem 1rem 1rem;
    }

    .sale-invoice-number {
        text-align: left;
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
    }

    .sale-invoice-series-select {
        margin-left: 0;
        max-width: none;
        width: 100%;
    }

    .sale-invoice-fields,
    .sale-invoice-detail-bar,
    .sale-invoice-foot {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sale-invoice-lines {
        gap: 0.75rem;
        padding: 0.85rem 1rem 1rem;
    }

    .sale-invoice-lines-head {
        display: none;
    }

    .sale-invoice-line-card {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
        margin: 0;
        padding: 0.85rem 0.9rem;
        border: 1px solid var(--sale-line);
        border-radius: 0.75rem;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
    }

    .sale-invoice-line-label {
        display: block;
    }

    .sale-invoice-line-nums {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .sale-invoice-line-item,
    .sale-invoice-line-ref {
        width: 100%;
    }

    .sale-invoice-line-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.15rem;
        border-top: 1px dashed #e5e7eb;
    }

    .sale-invoice-line-total {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
    }

    .sale-invoice-line-total strong {
        font-size: 1.05rem;
    }

    .sale-invoice-line-remove {
        color: #0f766e !important;
        background: #f0fdfa;
        border-radius: 999px;
    }

    .sale-invoice-actions {
        width: 100%;
    }

    .sale-invoice-actions .mud-button {
        flex: 1 1 auto;
    }

    .sale-detail-layout {
        grid-template-columns: 1fr;
    }

    .sale-detail-ticket-pane {
        position: static;
        order: -1;
    }

    .sale-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sale-detail-actions {
        width: 100%;
    }

    .sale-detail-actions .mud-button {
        flex: 1 1 auto;
        min-height: 2.5rem;
    }
}

@media (max-width: 640px) {
    .sale-detail-summary {
        grid-template-columns: 1fr;
    }

    .sale-detail-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-invoice-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-invoice-paper {
        border-radius: 0;
        box-shadow: none;
        border-left: 0;
        border-right: 0;
    }

    .sale-invoice-root {
        padding-inline: 0;
    }

    .sale-invoice-line-card {
        padding: 0.8rem;
        gap: 0.65rem;
    }

    .sale-invoice-lines {
        padding: 0.75rem 0.75rem 1rem;
    }

    .sale-pos-new-label {
        display: none;
    }

    .sale-pos-banner-text {
        font-size: 0.76rem;
        line-height: 1.25;
    }

    .sale-pos-ticket {
        max-height: min(90dvh, 38rem);
    }

    .sale-pos-sum-row {
        font-size: 0.84rem;
    }
}

/* —— Impresión tiketera (80mm) —— */
@media print {
    @page {
        size: 80mm auto;
        margin: 2mm;
    }

    html,
    body {
        width: 80mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body.printing-ticket * {
        visibility: hidden !important;
    }

    body.printing-ticket #sale-ticket-print,
    body.printing-ticket #sale-ticket-print * {
        visibility: visible !important;
    }

    body.printing-ticket #sale-ticket-print {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 76mm !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 2mm !important;
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
        font-size: 11px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-ticket .sale-print-hide {
        display: none !important;
    }
}

/* Purchases — adjuntos factura */
.pur-attach {
    margin: 0.75rem 0 1rem;
}

.pur-attach-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border: 1.5px dashed rgba(15, 23, 42, 0.18);
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pur-attach-card:hover:not(:disabled) {
    border-color: rgba(37, 99, 235, 0.45);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.pur-attach-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pur-attach-icon {
    font-size: 1.75rem !important;
    color: #2563eb;
}

.pur-attach-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pur-attach-copy strong {
    font-size: 0.95rem;
    font-weight: 650;
}

.pur-attach-copy span {
    font-size: 0.8rem;
    color: rgba(15, 23, 42, 0.55);
}

.pur-attach-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pur-attach-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: #fff;
}

.pur-attach-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.pur-attach-item-icon {
    color: #64748b;
}

.pur-attach-item-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
