/* ==========================================================================
   BillEase Design System — 6. Documents & print (invoice paper, POS receipt, labels)
   Generated from legacy app.css by scripts/css_migration (see docs/UI_SYSTEM.md):
   unused selectors removed, component-owned selectors removed (now in
   components.css/layout.css), duplicate selectors merged, colours intentionally literal for print fidelity. Edit this file directly from now on.
   ========================================================================== */

@media print  {
    .no-print  {
        display:none!important
    }

    #bulkCodesResult,
    #bulkCodesResult * {
        visibility: visible !important;
    }

    #bulkCodesResult {
        position: absolute;
        inset: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: #ffffff;
    }

    #bulkCodesResult .panel-head {
        display: none;
    }
}

.code-pair-label {
    min-width: 0;
    height: 86px;
    padding: 5px;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) 1px 76px;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    border: 1px dashed #cfd3df;
    border-radius: 10px;
    background: #ffffff;
}

.pair-barcode {
    min-width: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.pair-barcode svg {
    width: 100%;
    max-width: 150px;
    height: 56px;
}

.pair-divider {
    width: 1px;
    height: 62px;
    background: #e9ebf2;
}

.pair-qr {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
}

.pair-qr canvas,
.pair-qr img {
    width: 72px !important;
    height: 72px !important;
}

.code-history {
    margin-top: 16px;
}

.code-history-list {
    display: grid;
    gap: 7px;
}

.code-history-card {
    min-height: 60px;
    padding: 8px 9px;
    display: grid;
    grid-template-columns:
        38px 1fr auto;
    gap: 9px;
    align-items: center;
    border: 1px solid #e7e9f1;
    border-radius: 15px;
    background: #ffffff;
}

.code-history-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eeecff;
    color: #5d50ef;
}

.code-history-card b,
.code-history-card small {
    display: block;
}

.code-history-card b {
    margin-bottom: 3px;
    font-size: 9.5px;
}

.code-history-card small {
    color: #979daf;
    font-size: 7.5px;
}

.code-history-card button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #e3e6ef;
    border-radius: 11px;
    background: #f8f9fd;
    color: #5c4ff0;
    font-size: 8px;
    font-weight: 900;
}

@media print  {

    body:has(#bulkCodesResult) * {
        visibility: hidden !important;
    }

    #bulkCodesResult,
    #bulkCodesResult * {
        visibility: visible !important;
    }

    #bulkCodesResult {
        width: auto !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    #bulkCodesResult .code-results-head {
        display: none !important;
    }

    .code-pair-label {
        width: auto !important;
        height: 25mm !important;
        padding: 1.5mm !important;
        grid-template-columns:
            minmax(0, 1fr)
            .2mm
            19mm !important;
        gap: 1mm !important;
        border: .2mm solid #aaaaaa !important;
        border-radius: 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .pair-barcode svg {
        width: 100% !important;
        height: 15mm !important;
    }

    .pair-divider {
        height: 18mm !important;
    }

    .pair-qr,
    .pair-qr canvas,
    .pair-qr img {
        width: 18mm !important;
        height: 18mm !important;
    }
}

body.label-pdf-mode .code-pair-label {
    height: 126px;
    grid-template-columns:
        minmax(0, 1fr)
        1px
        104px;
}

body.label-pdf-mode .pair-qr,
body.label-pdf-mode .pair-qr canvas,
body.label-pdf-mode .pair-qr img {
    width: 96px !important;
    height: 96px !important;
}

@media (max-width: 390px)  {
    .payment-modes {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));
        gap: 4px;
    }

    .payment-modes button {
        padding: 7px 2px;
        font-size: 7px;
    }

    .code-pair-label {
        height: 92px;
        grid-template-columns:
            minmax(0, 1fr)
            1px
            82px;
    }

    .pair-qr,
    .pair-qr canvas,
    .pair-qr img {
        width: 78px !important;
        height: 78px !important;
    }
}

.doc-party-row {
    min-height: 92px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
}

.doc-terms {
    margin-top: 16px;
}

.doc-terms b {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
}

.doc-terms p {
    margin: 0;
    font-size: 10px;
    line-height: 1.4;
}

.pos-item-head {
    align-items: start;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) 34px 54px;
    display: grid;
    margin-bottom: 4px;
    font-size: 9px;
}

.pos-item-head > b:nth-child(n+2) {
    text-align: right;
}

.pos-footer {
    margin-top: 8px;
    text-align: center;
    font-size: 9px;
    line-height: 1.35;
}

@media (max-width: 390px)  {
    .variant-attribute-grid {
        grid-template-columns: 1fr 1fr;
    }

    .variant-attribute-grid .smart-field:last-child {
        grid-column: 1 / -1;
    }
}

.variation-report-panel {
    margin-top: 12px;
}

.variation-report-list {
    display: grid;
    gap: 7px;
}

.variation-report-list article {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e8eaf1;
    border-radius: 13px;
    background: #fafbfe;
}

.variation-report-list b,
.variation-report-list small {
    display: block;
}

.variation-report-list b {
    margin-bottom: 3px;
    font-size: 11px;
}

.variation-report-list small {
    color: #969cad;
    font-size: 9px;
}

.variation-report-list > article > span {
    text-align: right;
}

.pay-brand > span.has-logo {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7ef;
}

.pay-brand > span.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

@media print  {
    body:has(.barcode-only-grid) * {
        visibility: hidden !important;
    }

    #bulkCodesResult,
    #bulkCodesResult * {
        visibility: visible !important;
    }

    #bulkCodesResult {
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    #bulkCodesResult .code-results-head {
        display: none !important;
    }

    .barcode-only-grid {
        display: grid !important;
        grid-template-columns:
            repeat(4, 1fr) !important;
        gap: 2mm !important;
    }

    .barcode-label-v69 {
        height: 27mm !important;
        padding: 1.5mm !important;
        border: .2mm solid #999999 !important;
        border-radius: 0 !important;
        break-inside: avoid !important;
    }

    .barcode-label-svg {
        width: 100% !important;
        height: 15mm !important;
    }

    .barcode-label-name {
        font-size: 8pt !important;
    }

    .barcode-label-price {
        font-size: 9pt !important;
    }

    .barcode-label-logo {
        max-height: 7mm !important;
    }
}

@media (max-width: 390px)  {
    .barcode-only-grid {
        grid-template-columns: 1fr 1fr;
    }

    .emi-customer-profile-card,
    .emi-kyc-head {
        grid-template-columns: 44px 1fr;
    }

    .emi-customer-profile-card .kyc-status,
    .emi-kyc-head .kyc-status {
        grid-column: 1 / -1;
        width: max-content;
    }
}

@media (min-width: 720px)  {

    body:has(#billingConfig) .upi-customer-panel {
        padding: 24px;
    }

    body:has(#billingConfig) .upi-customer-panel .qr-card-large {
        max-width: 560px;
    }
}
