/* --- Select2 Custom Dropdown Height for INV/CN Dropdown --- */
#addPaymentModal #invCnNumber.select2-hidden-accessible + .select2-container--default .select2-selection--single {
    height: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
}
#addPaymentModal #invCnNumber.select2-hidden-accessible + .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
}
#addPaymentModal #invCnNumber.select2-hidden-accessible + .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}
#addPaymentModal #invCnNumber.select2-hidden-accessible + .select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    min-height: 40px;
    overflow-y: auto;
}

#addPaymentModal #invoiceDate[readonly] {
    background-color: #e9ecef;
}

/* Hide browser date-format hint for empty Invoice Date input */
#addPaymentModal #invoiceDate:not(.has-value):not(:focus)::-webkit-datetime-edit {
    color: transparent;
}
#addPaymentModal #invoiceDate.has-value::-webkit-datetime-edit,
#addPaymentModal #invoiceDate:focus::-webkit-datetime-edit {
    color: inherit;
}

/* --- Select2 Custom Dropdown Height for Account Dropdown --- */
#addPaymentModal .select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    min-height: 40px;
    overflow-y: auto;
}
#addPaymentModal .select2-container--default .select2-selection--single {
    height: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
}
#addPaymentModal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
}
#addPaymentModal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* Receipt Modal Footer Button Layouts */
#receiptModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1.2rem;
}

/* For negative payments: only Delete (left) and Cancel (right) */
#receiptModal .modal-footer.negative-footer {
    justify-content: flex-start;
    gap: 0;
    padding-left: 2rem;
    padding-right: 2rem;
}
#receiptModal .modal-footer.negative-footer .delete-receipt-btn {
    margin-right: auto;
    order: 1;
}
#receiptModal .modal-footer.negative-footer .cancel-btn {
    margin-left: auto;
    order: 2;
}

/* For positive payments: Send | Delete | Cancel (Delete in the middle) */
#receiptModal .modal-footer .send-btn {
    order: 1;
}
#receiptModal .modal-footer .delete-receipt-btn {
    order: 2;
}
#receiptModal .modal-footer .cancel-btn {
    order: 3;
}

.delete-receipt-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.delete-receipt-btn:hover {
    background-color: #b71c1c;
    color: #fff;
}
/* Payments Page Styling */

.payments-container {
    padding: 1rem;
    max-width: 1500px;
    margin: 0 auto;
}

/* Sticky title row */
.payments-title-row {
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 120;
    margin: 0 auto 0.5rem auto;
    padding-top: 0.5rem;
    width: 100%;
    max-width: 1250px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.payments-title {
    margin: 0;
    font-weight: 600;
    text-align: left;
}
.payments-export-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #d9d9d9;
    background: #ffffff;
    color: #222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.payments-export-btn:hover {
    background: #f2f2f2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.payments-export-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

/* Toolbar (search, toggle, add, filters) */
.payments-toolbar {
    box-shadow: none !important;
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 1250px;
    margin: 0 auto 1rem auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Row for all controls */
.toolbar-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.7rem;
    margin-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Toggle at far right */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    min-width: 110px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: #000000;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 24px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Search bar */
.search-container {
    margin-bottom: 0.5rem;
    margin-right: auto;
    margin-left: auto;
    max-width: 1250px;
    width: 100%;
}
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
}
.input-group .form-control {
    flex-grow: 1;
    border-radius: 0;
    padding-right: 40px;
    padding-left: 10px;
    font-size: 16px;
    border: none;
    background-color: #fafafa;
    color: #333;
    height: 45px;
    box-sizing: border-box;
}
.input-group .form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #e0e0e0;
}
.input-group .btn {
    background-color: transparent;
    border: none;
    color: #555;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 0;
}
.input-group .btn:hover {
    color: #333;
}

/* Add Payment Button */
.add-payment-container {
    display: flex;
    align-items: center;
    margin-right: 1.2rem;
}
/* Date Range Popover */
.date-range-popover {
    position: fixed; /* anchored relative to viewport using button rect */
    z-index: 2000;
    background: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border-radius: 10px;
    padding: 14px 16px 12px;
    width: 340px;
    max-width: 92vw;
    font-size: 14px;
    animation: dr-pop-fade .12s ease-out;
    /* Arrow positioning variable (distance from left edge) */
    --arrow-left: 50%;
}
@keyframes dr-pop-fade { from { opacity:0; transform: translateY(4px);} to {opacity:1; transform: translateY(0);} }

/* Single triangle arrow (no diamond duplicate) */
.date-range-popover::after {
    content: '';
    position: absolute;
    left: var(--arrow-left);
    transform: translateX(-50%);
    top: -7px;
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    filter: drop-shadow(0 -1px 1px rgba(0,0,0,0.08));
}
.date-range-popover.above::after {
    top: auto;
    bottom: -7px;
    border-bottom: none;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}
.date-range-popover .dr-header { display:flex; justify-content:space-between; align-items:center; font-weight:600; margin-bottom:6px; }
.date-range-popover .dr-close { background:none; border:0; font-size:20px; line-height:1; cursor:pointer; color:#666; }
.date-range-popover .dr-close:hover { color:#c00; }
.date-range-popover .dr-body { display:flex; gap:10px; }
.date-range-popover .dr-label { flex:1; display:flex; flex-direction:column; font-size:12px; font-weight:600; color:#444; }
.date-range-popover .dr-label input { margin-top:2px; font-size:13px; padding:4px 6px; }
.date-range-popover .dr-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:12px; }
.date-range-popover .dr-presets { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 12px; }
/* Mini filter buttons */
.mini-filter-btn { background:#f5f5f5; border:none; border-radius:16px; padding:4px 10px; font-size:12px; font-weight:600; color:#333; cursor:pointer; transition:all .15s ease-in-out; }
.mini-filter-btn:hover { background:#e6e6e6; }
.mini-filter-btn:active { background:#dcdcdc; }
.mini-filter-btn.active { background:#000; color:#fff; }
.date-range-popover .dr-footer .dr-clear-left { margin-right:auto; }
.date-range-popover .dr-footer .dr-apply-right { margin-left:auto; }
.date-range-popover .dr-errors { margin-top:6px; }
.btn-method.date-range-btn { display:inline-flex; align-items:center; justify-content:center; }
.btn-method.date-range-btn.active { background:#000; color:#fff; }
/* Transient state only while popover open; JS removes .active on close */

/* Date range footer action buttons */
.dr-cancel-btn { background:#000 !important; color:#fff !important; border:none; border-radius:6px; font-weight:600; letter-spacing:.5px; }
.dr-cancel-btn:hover { background:#222 !important; }
.dr-apply-btn { background:#dc3545 !important; color:#fff !important; border:none; border-radius:6px; font-weight:600; letter-spacing:.5px; }
.dr-apply-btn:hover { background:#b71c1c !important; }

.add-payment-btn {
    width: 65px;
    height: 65px;
    background: #ffcf01;
    color: white;
    border-radius: 100%;
    text-decoration: none;
    font-weight: 550;
    transition: all 0.2s;
    font-size: 1.8rem;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.add-payment-btn:hover {
    background: #ffdf54;
    transform: translateY(-1px);
    color: white;
}
.add-payment-btn i {
    font-size: 28px;
    color: white;
}

/* Filters take remaining space, align right of add button */
.payment-filters {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
    margin-left: 0;
}

/* Method buttons in a row */
.payment-method-filters {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.btn-method {
    background-color: #f0f0f0;
    color: #333;
    border-radius: 24px;
    padding: 0.6rem 1.3rem;
    font-size: 1.1rem;
    border: none;
    transition: all 0.2s;
    margin-right: 5px;
    font-weight: 500;
}
.btn-method.active {
    background-color: #000000;
    color: white;
    font-weight: 500;
}
.btn-method:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #e6e6e6;
}
.btn-method.active:hover {
    background-color: #333333;
}

.payment-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 24px 28px;
    gap: 12px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 105px;
    width: 100%;
    max-width: 900px;
    font-size: 1.1rem;
    font-weight: 300;
    transition: transform 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    cursor: pointer;
    align-items: center;
}
.payment-card:hover {
    background-color: #f0f0f0;
    transform: scale(1.01);
}
.payment-details {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    flex: 1 1 auto;
    gap: 24px;
}
.payment-left, .payment-right {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.payment-date {
    font-weight: 600;
}
.payment-amount {
    font-weight: 600;
}
.payment-method {
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #666;
}
.payment-docid {
    font-weight: 600;
    text-align: right;
}
.payment-description {
    color: #333;
    text-align: right;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.payment-account {
    font-size: 0.9rem;
    color: #666;
    text-align: right;
}
.payment-right {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 160px;
    text-align: right;
    margin-left: auto;
}

/* Make action buttons larger and more prominent */
.payment-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.payment-actions .btn {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    padding: 0;
    background-color: rgba(0,0,0,0.02);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.payment-actions .fas {
    font-size: 22px;
}
.btn-view.has-receipt i {
    color: #000000;
    background: transparent;
    border: none;
}
.btn-view.no-receipt i {
    color: #dc3545;
    background: transparent;
    border: none;
}
.btn-edit {
    color: #ffcf01;
    background: transparent;
    border: none;
}
.btn-delete {
    color: #dc3545;
    background: transparent;
    border: none;
}
.payment-actions .btn:hover {
    background-color: rgba(0,0,0,0.05);
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-view:hover {
    color: #000000;
}
.btn-edit:hover {
    color: #ffb400;
}
.btn-delete:hover {
    color: #c82333;
}

/* Outstanding Invoices Section */
.outstanding-invoices-section {
    margin-top: 2rem;
}
.outstanding-invoices-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.invoice-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.invoice-placeholder {
    font-style: italic;
    color: #6c757d;
}

/* Modal Customization */
.modal-content {
    border-radius: 12px;
    border: none;
}
.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
}
.modal-footer {
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    gap: 10px;
}
.modal-footer .btn-secondary { order: 2; }
.modal-footer .btn-primary { order: 1; }
.modal-footer .btn-warning { order: 3; }
.custom-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #000;
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
}
.custom-close:hover { color: #dc3545; }

/* Default: all cancel buttons are red */
.cancel-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.cancel-btn:hover {
    background-color: #b71c1c;
    color: #fff;
}

/* Exception: cancel buttons in the receipt modal are yellow */
#receiptModal .cancel-btn {
    background-color: #ffcf01;
    color: #000;
}
#receiptModal .cancel-btn:hover {
    background-color: #ffe066;
    color: #000;
}
.save-btn {
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    text-transform: uppercase;
    font-weight: 500;
}
.receipt-btn {
    background-color: #ffcf01;
    color: black;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Upload Receipt Styling */

/* --- Make Upload Receipt input area same height as other input areas --- */

/* --- Fix Upload Receipt input area width to match other fields --- */
.upload-receipt-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    height: 40px;
    min-height: 40px;
    width: 100%;
}
.btn-upload-receipt {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    color: #6c757d;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    text-align: center;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    box-sizing: border-box;
}
#fileNameDisplay {
    font-size: 0.9rem;
    color: #495057;
    margin-left: 0;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Receipt Modal Styling */
/* Modal Body */
#receiptModal .modal-body,
.receipt-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* Image Area */
#receiptImageArea {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* PDF Container */
#receiptPdfContainer {
    flex: 1 1 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 600px;         /* Set a fixed width for PDFs */
    max-width: 90vw;
    height: 75vh;         /* Cap the height */
    max-height: 75vh;
    padding: 0;
    box-sizing: border-box;
    margin: 0 auto;       /* Center horizontally */
}
#receiptPdfView {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    border-radius: 6px;
}

/* Image Container */
#receiptImageContainer {
    flex: 1 1 auto;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 0;
    max-width: 95vw;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}
#receiptImageView {
    display: block;
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    margin: auto;
}

#noReceiptContainer.no-receipt-message {
    flex: 1 1 auto; 
    display: none; 
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}
#noReceiptContainer.no-receipt-message p {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #6c757d;
}
#receiptModal .upload-receipt-container-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
#receiptModal .btn-upload-receipt-modal {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    color: #6c757d;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    width: 100%;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
#receiptModal .btn-upload-receipt-modal:hover {
    background-color: #e2e6ea;
}
#receiptModal #receiptFileNameDisplay {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 0.5rem;
    word-break: break-all;
}
#receiptModal .modal-dialog {
    max-width: 600px;
    width: 90vw;
    margin: 1.75rem auto;
}
/* Modal Content */
#receiptModal .modal-content {
    width: auto;
    max-width: 95vw;
    min-width: 320px;   
    display: flex;
    flex-direction: column;
}
#receiptModal .modal-dialog {
    width: auto;
    max-width: 95vw;
    margin: 1.75rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
#receiptModal .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}
#receiptModal .modal-footer {
    flex-shrink: 0; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
}

/* Center the cancel button when only it is visible */
#receiptModal .modal-footer.center-footer {
    justify-content: center !important;
}
#receiptModal .modal-footer.center-footer .cancel-btn {
    margin-left: auto;
    margin-right: auto;
    float: none !important;
}

.send-btn {
    background-color: black;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Form layout */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}
.form-group {
    margin-bottom: 1rem;
}
.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 10px;
    padding-left: 10px;
}

/* DOC# header + unlink button (Edit/Add Payment modal) */
.doc-field-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.unlink-doc-btn{
    width: 26px;
    height: 26px;
    line-height: 24px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.unlink-doc-btn:hover{
    background: #b71c1c;
}

/* Add color indicators as per wireframe */
.payment-required.empty { color: #dc3545; }
.payment-optional:empty { display: none; }
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff0f0;
}
#addPaymentModal .select2-container.input-error .select2-selection--single {
    border-color: #dc3545 !important;
    background-color: #fff0f0;
}
.input-error-label { color: #dc3545 !important; }
/* Align label content horizontally and space-between */
label[for] {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    width: 100%;
    font-weight: 500;
}

/* Keep the error message and info button grouped next to the label text */
.input-error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-left: 8px;
    font-weight: 400;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Mini red circle info button */
.input-error-info {
    background: #dc3545;
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    margin-right: 0;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 0;
}
.input-error-info:hover {
    background: #b71c1c;
    color: #fff;
}
/*Lightbox for receipt click*/
#receiptLightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
#receiptLightbox img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 20px #000;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s;
}

/* --- Sticky header and scrollable list --- */
.payments-page-root {
    height: 100vh;
    display: flex;
    background: transparent;
    flex-direction: column;
    overflow: hidden;
}
.payments-fixed-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 110;
    background: transparent;
    padding-bottom: 0.5rem;
}
.payments-list-outer {
    flex: 1 1 auto;
    margin-top: 0;
    height: 101vh ;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.payments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 0 0 0;
    width: 95%;
    margin: 0 auto;
    margin-bottom: 0;
    max-width: 920px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    box-sizing: border-box;
}
.pagination-modal {
    display: flex;
    background: transparent;
    justify-content: center;
    align-items: center;
    padding: 0.1rem 0 0.3rem 0; /* Reduce top and bottom padding */
    position: sticky;
    bottom: 0;
    z-index: 120;
}
.pagination-modal .pagination-pages {
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}
.pagination-modal .pagination-page-btn {
    border: none;
    background: #f0f0f0;
    color: #333;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination-modal .pagination-page-btn.active {
    background: #000;
    color: #fff;
}
.pagination-modal .pagination-page-btn:hover {
    background: #ffcf01;
    color: #000;
}

#mini-popup {
    position: fixed;
    left: 50%;
    top: 12%; /* Adjust as needed to be just above your modal */
    transform: translateX(-50%);
    background: #f44336;
    color: #fff;
    padding: 14px 32px 14px 20px;
    border-radius: 6px;
    z-index: 2147483647;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 1rem;
    display: flex;
    align-items: center;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.2s;
}
#mini-popup.hide {
    opacity: 0;
    pointer-events: none;
}
#mini-popup .mini-popup-close {
    margin-left: 18px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.3em;
    background: none;
    border: none;
    color: #fff;
    outline: none;
}

/* Responsive Design */
@media (max-width: 900px) {
    .payments-export-btn {
        display: none;
    }
    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .add-payment-container,
    .payment-filters,
    .toggle-container {
        margin: 0;
        width: 100%;
    }
    .payment-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }
    .payment-method-filters {
        width: 100%;
        justify-content: space-between;
    }
    .add-payment-container {
        justify-content: flex-start;
        margin-bottom: 0.5rem;
    }
    .toggle-container {
        margin-left: 0;
    }
    .payment-details {
        flex-direction: column;
        gap: 0.8rem;
    }
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    .modal-footer .btn {
        width: 100%;
        order: initial !important;
    }
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .btn-method {
        padding: 0.7rem 1.4rem;
        font-size: 1.15rem;
    }
    .payment-actions .btn {
        width: 74px;
        height: 74px;
    }
    .payment-actions .fas {
        font-size: 32px;
    }
}