/* Adnan Ijaz Hardware POS - safe production polish */
:root {
    --theme-700: #2563eb;
    --theme-800: #1d4ed8;
    --theme-900: #1e3a8a;
}

/* Keep AJAX areas responsive without nested fixed-height scrolling. */
#contact_payments_div {
    min-height: 120px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
#contact_payments_div.nx-loading {
    opacity: .55;
    pointer-events: none;
}
#contact_payments_table,
#ledger_table {
    margin-bottom: 0;
}
#contact_payments_table th,
#contact_payments_table td,
#ledger_table th,
#ledger_table td {
    vertical-align: middle;
}
#contact_payments_table .tw-dw-btn {
    margin: 2px;
}

/* Better mobile table behavior while preserving all accounting columns. */
@media (max-width: 767px) {
    #contact_payments_div,
    #contact_ledger_div .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #contact_payments_table {
        min-width: 760px;
    }
    #ledger_table {
        min-width: 900px;
    }
    .nav-tabs-custom > .nav-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs-custom > .nav-tabs > li {
        float: none;
        display: inline-block;
        width: auto !important;
    }
}

/* Clear keyboard focus across common controls. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .2);
    outline-offset: 1px;
}

/* Live sale profit preview: visible only to users with P&L permission. */
.nx-line-profit-wrap {
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px dashed rgba(0, 0, 0, .12);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}
.nx-line-profit-label {
    font-weight: 600;
    color: #6b7280;
    margin-right: 3px;
}
.nx-line-profit-value,
.nx-sale-profit-value {
    font-variant-numeric: tabular-nums;
}
.nx-line-profit-margin,
.nx-sale-profit-margin {
    margin-left: 3px;
    color: #6b7280;
}
.nx-line-profit-estimated,
.nx-sale-profit-note {
    margin-left: 4px;
    color: #92400e;
    font-weight: 600;
}
.nx-profit-positive {
    color: #15803d !important;
}
.nx-profit-negative {
    color: #b91c1c !important;
}
.nx-sale-profit-summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border: 1px solid rgba(21, 128, 61, .18);
    border-radius: 8px;
    background: rgba(21, 128, 61, .06);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}
.nx-sale-profit-label {
    color: #374151;
    font-weight: 600;
}
.nx-sale-profit-summary-direct {
    margin-top: 6px;
}
@media (max-width: 767px) {
    .nx-sale-profit-summary {
        padding: 4px 7px;
        font-size: 11px;
    }
    .nx-line-profit-wrap {
        font-size: 10px;
    }
}
