.rewards-form {
    text-align: center;
/*    border: 1px solid blue;
    border-radius: 5px 5px 5px 5px;*/
}

.error-message {
    color: red;
}

.client-lookup-status.alert-info {
    border-left: 4px solid #0dcaf0;
}
.client-lookup-status.alert-success {
    border-left: 4px solid #198754;
}
.client-lookup-status.alert-warning {
    border-left: 4px solid #ffc107;
}
.client-lookup-status.alert-danger {
    border-left: 4px solid #dc3545;
}

.loyalty-add-client-section .form-control {
    min-height: 44px;
    font-size: 16px;
}

/* Allocate modal — mobile-first tap targets */
.loyalty-allocate-modal .modal-content {
    border-radius: 0;
}
@media (min-width: 576px) {
    .loyalty-allocate-modal .modal-content {
        border-radius: var(--bs-modal-border-radius, 0.5rem);
    }
}

#exampleModal .loyalty-allocate-client-name[readonly] {
    background-color: var(--bs-secondary-bg, #e9ecef);
    cursor: default;
}

.min-touch-target {
    min-height: 48px;
}

.loyalty-modal-footer .btn {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.cell-number-field {
    border-color: #0d6efd;
}

.cell-number-input-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.cell-number-input-row .cell-number-field {
    flex: 1;
    min-width: 0;
}

.btn-qr-scan {
    flex-shrink: 0;
    min-width: 52px;
    min-height: 48px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 1.15rem;
    align-self: stretch;
}

.qr-scanner-modal-dialog {
    max-width: min(720px, 96vw);
}

.qr-scanner-hint {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: #6c757d;
    line-height: 1.45;
}

.qr-scanner-status {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.qr-scanner-status.info {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

.qr-scanner-status.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.qr-scanner-status.error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.qr-scanner-reader {
    width: 100%;
    min-height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
}

.qr-scanner-reader video {
    object-fit: cover;
}

.qr-scanner-reader #qr-scanner-reader__scan_region {
    min-height: 420px;
}

.qr-scanner-reader #qr-scanner-reader__dashboard_section {
    display: none !important;
}

@media (max-width: 576px) {
    .qr-scanner-reader {
        min-height: 360px;
    }

    .qr-scanner-reader #qr-scanner-reader__scan_region {
        min-height: 360px;
    }
}

.product-code-field {
    border-color: #0d6efd;
    color: #0d6efd;
    min-height: 48px;
    padding: 10px 12px;
    font-size: 16px;
}

.loyalty-reward-confirm-dl dt {
    color: #6c757d;
}
.loyalty-reward-confirm-dl dd {
    font-weight: 500;
}

#BtnRewardInc,
#BtnRewardDec {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.25rem;
    line-height: 1;
}

.reward-cnt-btn {
    border-radius: 10px 10px 10px 10px;
    border-color: #0d6efd;
}

.reward-table {
    padding-top: 20px;
    max-height: calc(100vh - 248px); /* Adjust based on header, title, padding, and search input */
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-color: #4169E1 #e0e0e0; /* Firefox: thumb and track */
    scrollbar-width: thin;
}

.reward-table-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
}

.reward-table-inner {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 12px;
}

.reward-table-content {
    min-width: 600px;
}

.table-record-count {
    background-color: #f1f5ff;
    color: #0d6efd;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.3px;
}

/* Webkit browsers (Chrome, Safari, Edge) - Horizontal scrollbar */
.reward-table-inner::-webkit-scrollbar {
    height: 8px;
}

.reward-table-inner::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.reward-table-inner::-webkit-scrollbar-thumb {
    background: #4169E1;
    border-radius: 4px;
}

.reward-table-inner::-webkit-scrollbar-thumb:hover {
    background: #3151B8;
}

#loyaltyHistoryTable {
    margin-bottom: 0;
    width: 100%;
    min-width: 600px; /* Minimum width to enable horizontal scroll on mobile */
    border-collapse: collapse;
    table-layout: fixed;
}

#loyaltyHistoryTable thead {
    display: table;
    width: 100%;
    min-width: 600px; /* Match table min-width */
    table-layout: fixed;
}

#loyaltyHistoryTable thead tr {
    display: table-row;
}

#loyaltyHistoryTable thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6;
    display: table-cell;
}

#loyaltyHistoryTable thead th:nth-child(1) { width: 16%; }
#loyaltyHistoryTable thead th:nth-child(2) { width: 18%; }
#loyaltyHistoryTable thead th:nth-child(3) { width: 26%; }
#loyaltyHistoryTable thead th:nth-child(4) { width: 14%; }
#loyaltyHistoryTable thead th:nth-child(5) { width: 26%; }

#loyaltyHistoryTable tbody {
    display: block;
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 308px); /* Adjust based on header, title, padding, search input, and table header */
    width: 100%;
    scrollbar-color: #4169E1 #e0e0e0; /* Firefox: thumb and track */
    scrollbar-width: thin;
}

/* Webkit browsers (Chrome, Safari, Edge) - Vertical scrollbar */
#loyaltyHistoryTable tbody::-webkit-scrollbar {
    width: 8px;
}

#loyaltyHistoryTable tbody::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

#loyaltyHistoryTable tbody::-webkit-scrollbar-thumb {
    background: #4169E1;
    border-radius: 4px;
}

#loyaltyHistoryTable tbody::-webkit-scrollbar-thumb:hover {
    background: #3151B8;
}

#loyaltyHistoryTable tbody tr {
    display: table;
    width: 100%;
    min-width: 600px; /* Match table min-width */
    table-layout: fixed;
}

#loyaltyHistoryTable tbody td {
    display: table-cell;
}

#loyaltyHistoryTable tbody td:nth-child(1) { width: 16%; }
#loyaltyHistoryTable tbody td:nth-child(2) { width: 18%; }
#loyaltyHistoryTable tbody td:nth-child(3) { width: 26%; }
#loyaltyHistoryTable tbody td:nth-child(4) { width: 14%; }
#loyaltyHistoryTable tbody td:nth-child(5) { width: 26%; }

.reward-search-container {
    padding: 15px 0;
}

.reward-search-input {
    max-width: 400px;
}

.product-code-field option {
    padding: 8px 12px;
}

.product-code-field::-webkit-scrollbar {
    width: 8px;
}

.product-code-field::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.product-code-field::-webkit-scrollbar-thumb {
    background: #4169E1;
    border-radius: 4px;
}

.product-code-field::-webkit-scrollbar-thumb:hover {
    background: #3151B8;
}

/* Multi-product selection under allocate dropdown */
.loyalty-selected-products-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loyalty-selected-products-list:empty {
    display: none;
}

.loyalty-selected-products-empty {
    margin-top: 8px;
}

.loyalty-selected-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    min-height: 52px;
}

.loyalty-selected-product-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loyalty-selected-product-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.loyalty-selected-product-controls .btn {
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.loyalty-selected-product-count {
    min-width: 1.75rem;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.loyalty-selected-product-remove {
    color: #dc3545;
    border-color: #dc3545;
}

