/* =========================================
   Customer Loans Portal
   ========================================= */
#customer-loans-portal {
    direction: rtl;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 30px 30px 30px;
    background: #ffffff;
    font-family: "Assistant", Sans-serif;
    box-sizing: border-box;
}

/* =========================================
   Login / OTP
   ========================================= */
#customer-loans-auth {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* =========================================
   Results
   ========================================= */
#customer-loans-result {
    width: 100%;
    max-width: 900px;
    margin: 10px auto 0;
}

.customer-loans-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.customer-loans-result-header h3 {
    margin: 0;
}

/* =========================================
   Cards
   ========================================= */
.customer-loans-card {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 20px 30px 20px;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 767px) {
    #customer-loans-portal {
        padding: 15px;
    }

    #customer-loans-auth {
        max-width: 400px;
    }

    #customer-loans-result {
        margin-top: 10px;
    }

    .customer-loans-card {
        padding: 20px;
    }
}

#customer-loans-portal *, #customer-loans-portal *::before, #customer-loans-portal *::after {
    box-sizing: border-box;
}

/* =========================================
   Headings
   ========================================= */
#customer-loans-portal h3 {
    margin: 0;
    font-size: 32px;
    line-height: 1.3;
    font-weight: 600;
    color: #1C244B;
}

#customer-loans-portal h4 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    color: #1C244B;
}

/* =========================================
   Paragraphs
   ========================================= */
#customer-loans-portal p,#customer-loans-portal .customer-loans-form-row {
    margin: 0 0 15px;
}

/* =========================================
   Labels
   ========================================= */
#customer-loans-portal label {
    display: block;
    margin-bottom: 7px;
    font-size: 18px;
    font-weight: 400;
    color: #1C244B;
}

/* =========================================
   Inputs
   ========================================= */
#customer-loans-portal input[type="text"], #customer-loans-portal input[type="tel"], #customer-loans-portal input[type="email"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #1C244B;
    font-family: inherit;
    font-size: 20px;
    text-align: right;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#customer-loans-portal input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#customer-loans-portal input::placeholder {
    color: #9ca3af;
}

/* =========================================
   OTP input
   ========================================= */
#customer-loans-portal #customer_otp {
    direction: ltr;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 6px;
}

/* =========================================
   Buttons
   ========================================= */
#customer-loans-portal button {
    width: auto;
    min-height: 40px;
    padding: 6px 20px 8px;
    border: 1px solid #467FF7;
    border-radius: 100px;
    background: #467FF7;
    color: #ffffff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    margin: 0 0 15px;
}

#customer-loans-login button {
    width: 100%;
    min-height: 40px;
}

#customer-loans-otp button {
    width: 49%;
}

#customer-loans-result button {
    margin: 0;
}

#customer-loans-portal .customer-loan-actions button {
    margin: 0;
    width: calc(33.33% - 10px);
    background: #1C244B;
    border-color: #1C244B;
    color: #ffffff;
    font-size: 16px;
    min-height: 30px;
    padding: 6px 6px 8px;
    margin: 0 10px 0 0px;
}

#customer-loans-portal .customer-loan-actions button:hover ,#customer-loans-portal .customer-loan-actions button.active {
    background: transparent;
    color: #1C244B;
    border-color: #1C244B;
}

#customer-loans-portal button:hover {
    background: transparent;
    color: #467FF7;
    border-color: #467FF7;
}

#customer-loans-portal #customer-loans-logout {
    font-size: 16px;
    min-height: 30px;
}

#customer-loans-portal button:active {
    transform: translateY(1px);
}

#customer-loans-portal button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* =========================================
   Secondary buttons
   ========================================= */
#customer-loans-portal .customer-loans-secondary-button {
    background: transparent;
    color: #467FF7;
    border: 1px solid #467FF7;
}

#customer-loans-portal .customer-loans-secondary-button:hover {
    background: #467FF7;
    color: #ffffff;
}

/* =========================================
   Messages
   ========================================= */
#customer-login-message, #customer-otp-message {
    margin-top: 0;
    padding: 5px 0;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 600;
}

#customer-login-message:empty, #customer-otp-message:empty {
    display: none;
}

/* =========================================
   API response
   ========================================= */
#customer-loans-response {
    direction: rtl;
    text-align: right;
    overflow-x: visible;
    max-width: 100%;
    /* margin: 10px 0; */
    font-size: 16px;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
    width: 100%;
}

/* =========================================
   Loans table
   ========================================= */
.customer-loans-table-wrapper {
    width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    margin: 10px 0;
    max-height: 255px;
    overflow: auto;
}
#customer-loans-result .customer-loans-table-wrapper { 
    max-height: none;
}
.customer-loans-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    font-family: "Assistant", Sans-serif;
    font-size: 18px;
    text-align: right;
    border: 0;
    margin: 0;
	position:relative;
}

.customer-loans-table thead {
    border: 0 !important;
	position: sticky;
    top: 0;
    width: 100%;
    background: #fff;
}

.customer-loans-table tr {
    border: 0 !important;
}

.customer-loans-table th {
    padding: 10px 6px;
    color: #1C244B;
    font-weight: 600;
    white-space: nowrap;
    border: 0;
    border-block-start: 1px solid #e5e7eb91 !important;
    border-block-end: 1px solid #e5e7eb91 !important;
    }

.customer-loans-table td {
    padding: 10px 6px;
    color: #1C244B;
    vertical-align: middle;
    border: 0;
    /* border-block-start: 1px solid #e5e7eb91; */
    /* background-color: hsla(0, 0%, 50%, .05) !important; */
}

.customer-loans-table tbody tr:hover td {
    /*background-color: #f9fafb !important;*/
}

#customer-loans-modal-body tbody tr:nth-child(odd) {
    background-color: #f2f2f2;
}

#customer-loans-modal-body tbody tr:nth-child(even) {
    background-color: #fff;
}

/* Loan number */
.customer-loans-table td:first-child {
    font-weight: 600;
    direction: rtl;
    text-align: right;
}

/* Car number */
.customer-loans-table td:nth-child(2) {
    /* direction: ltr; */
    text-align: right;
    white-space: nowrap;
}

/* Record type */
.customer-loans-table td:nth-child(3) {
    /* text-align: center; */
}

/* =========================================
   Loan action buttons
   ========================================= */
@media (min-width: 900px) {
#customer-loans-result .customer-loans-table {
    width: 100%;
    table-layout: fixed;
}

#customer-loans-result .customer-loans-table th:nth-child(1),
#customer-loans-result .customer-loans-table td:nth-child(1),
#customer-loans-result .customer-loans-table th:nth-child(2),
#customer-loans-result .customer-loans-table td:nth-child(2){
    width: 15%;
}
#customer-loans-result .customer-loans-table th:nth-child(3),
#customer-loans-result .customer-loans-table td:nth-child(3){
    width: 20%;
}
#customer-loans-result .customer-loans-table th:nth-child(4),
#customer-loans-result .customer-loans-table td:nth-child(4) {
    width: 6%;
}
#customer-loans-result .customer-loans-table th:nth-child(5),
#customer-loans-result .customer-loans-table td:nth-child(5) {
    width: 45%;
}
#customer-loans-result .customer-loan-actions {
    width: 45% !important;
    padding-left: 0 !important;
    text-align: right;
    vertical-align: middle;
}
}
/* =========================================
   Loan details
   ========================================= */
.customer-loan-details {
    width: 100%;
    direction: rtl;
}

.customer-loan-details-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

.customer-loan-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb91;
}

.customer-loan-detail-label {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.4;
}

.customer-loan-detail-value {
    color: #1C244B;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    word-break: break-word;
}

/* =========================================
   Payment schedule
   ========================================= */
.customer-loan-payments {
    width: 100%;
    direction: rtl;
}

.customer-loan-payments-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.customer-loan-payments-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    direction: rtl;
    font-family: "Assistant", Sans-serif;
    font-size: 16px;
    text-align: right;
}

.customer-loan-payments-table th {
    padding: 11px 10px;
    color: #1C244B;
    font-weight: 600;
    white-space: nowrap;
    border: 0;
    border-bottom: 1px solid #e5e7eb91;
}

.customer-loan-payments-table td {
    padding: 10px;
    color: #1C244B;
    border: 0;
    border-bottom: 1px solid #e5e7eb91;
    background: hsla(0, 0%, 50%, .05);
    vertical-align: middle;
}

.customer-loan-payments-table tbody tr:hover td {
    background: #f9fafb;
}

/* Numeric values */
.customer-loan-payments-table .amount, .customer-loan-payments-table .number, .customer-loan-payments-table .date {
    direction: ltr;
    text-align: right;
    white-space: nowrap;
}

/* =========================================
   Documents
   ========================================= */
.customer-loan-documents {
    width: 100%;
    direction: rtl;
}

.customer-loan-documents-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
}

.customer-loan-document {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb91;
}

.customer-loan-document:last-child {
    border-bottom: 0;
}

.customer-loan-document-info {
    min-width: 0;
    flex: 1;
}

.customer-loan-document-name {
    display: block;
    color: #1C244B;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    word-break: break-word;
}

.customer-loan-document-file {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
    direction: ltr;
    text-align: right;
    word-break: break-all;
}

.customer-loan-document-button {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 100px;
    min-height: 42px !important;
    padding: 8px 15px !important;
    font-size: 16px !important;
}

/* =========================================
   Document viewer
   ========================================= */
.customer-loan-document-viewer {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    border: 0;
    background: #f5f5f5;
}

.customer-loan-document-viewer iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================================
   Modal
   ========================================= */
.customer-loans-modal {
    position: relative;
    z-index: 9;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    /* padding: 20px; */
    /* background: rgba(0, 0, 0, 0.55); */
    direction: rtl;
    width: 100%;
    max-width: 900px;
    margin: 10px auto 0;
    background: #fff;
}

.customer-loans-modal.is-open {
    display: block;
}

.customer-loans-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
    font-family: "Assistant", Sans-serif;
    display: flex;
    flex-direction: column;
}

.customer-loans-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    flex: 0 0 auto;
    padding-bottom: 5px;
}

.customer-loans-modal-title {
    margin: 0;
    color: #1C244B;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.customer-loans-modal-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #1C244B !important;
    font-size: 24px !important;
    line-height: 1.8px !important;
    cursor: pointer;
    margin-bottom: 0px !important;
}

.customer-loans-modal-close:hover {
    background: #1C244B !important;
    color: #ffffff !important;
    border-color: #1C244B !important;
}

.customer-loans-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0px;
    font-size: 18px;
}

.customer-loans-detail-grid .customer-loans-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 18px;
    /*background-color: #f9fafb !important;*/
    padding: 5px 0px;
    color: #1C244B;
    /*font-weight: bold;*/
}

.customer-loans-category-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: #1C244B;
    font-weight: bold;
    padding: 10px 0px;
}

.customer-loans-detail-name {
    font-weight: bold;
}

.customer-loans-summary-box {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 18px;
    /*background-color: #f9fafb !important;*/
    padding: 5px 0px;
    color: #1C244B;
    /*font-weight: bold;*/
}

.customer-loans-summary-label {
    font-weight: bold;
    color: #1C244B;
}

/* =========================================
   Modal loading
   ========================================= */
.customer-loans-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #6b7280;
    font-size: 18px;
}

/* =========================================
   Loading spinner
   ========================================= */
.customer-loans-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    border: 3px solid #e5e7eb;
    border-top-color: #467FF7;
    border-radius: 50%;
    animation: customer-loans-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes customer-loans-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   Empty state
   ========================================= */
.customer-loans-empty {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    /*background: #f9fafb;*/
    color: #6b7280;
    text-align: center;
    font-size: 18px;
}

/* =========================================
   Error state
   ========================================= */
.customer-loans-error {
    margin: 15px 0;
    padding: 12px 15px;
    border: 1px solid #f1b5b5;
    border-radius: 4px;
    background: #fff5f5;
    color: #b42318;
    font-size: 16px;
    line-height: 1.5;
}

/* =========================================
   Success state
   ========================================= */
.customer-loans-success {
    margin: 15px 0;
    padding: 12px 15px;
    border: 1px solid #b7dfc0;
    border-radius: 4px;
    background: #f3fff5;
    color: #18723a;
    font-size: 16px;
    line-height: 1.5;
}

/* =========================================
   Logout
   ========================================= */
.customer-loans-logout {
    margin-top: 20px;
}

.customer-loans-logout button {
    background: transparent !important;
    color: #1C244B !important;
    border: 1px solid #d1d5db !important;
}

.customer-loans-logout button:hover {
    background: #1C244B !important;
    color: #ffffff !important;
    border-color: #1C244B !important;
}

/* =========================================
   Loading state - portal
   ========================================= */
#customer-loans-portal.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* =========================================
   RTL / LTR helpers
   ========================================= */
.customer-loans-ltr {
    direction: ltr;
    text-align: right;
}

.customer-loans-number {
    direction: ltr;
    white-space: nowrap;
}

.customer-loans-date {
    direction: ltr;
    white-space: nowrap;
}

/* =========================================
   Prevent body scroll while modal is open
   ========================================= */
body.customer-loans-modal-open {
    /*overflow: hidden;*/
}

#customer-loans-modal .customer-loans-file {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#customer-loans-modal .customer-loans-file button {
    margin: 10px 0!important;
    background: #1C244B;
    border: 1px solid #1C244B;
    font-size: 14px;
    min-height: 30px;
    padding: 4px 20px 6px;
}

#customer-loans-modal .customer-loans-file button:hover {
    background: transparent;
    border: 1px solid #1C244B;
    color: #1C244B;
}

.customer-loans-loading {
    color: #1C244B;
}
.customer-loans-notes {
	color: #1C244B;
}
/* =========================================
   Mobile
   ========================================= */
@media (max-width: 768px) {
    #customer-loans-portal {
        max-width: 100%;
        margin: 5px auto 20px;
        padding: 0px 20px 20px;
        border-radius: 0;
    }

    #customer-loans-portal h3 {
        font-size: 26px;
        margin-bottom: 0;
    }

    #customer-loans-portal h4 {
        font-size: 20px;
    }

    #customer-loans-portal input[type="text"], #customer-loans-portal input[type="tel"], #customer-loans-portal input[type="email"] {
        height: 48px;
    }

    /* Tables - no horizontal scrolling on mobile */
    .customer-loans-table-wrapper {
        width: 100%;
        /* overflow-x: visible; */
        /* overflow-y: visible; */
        margin: 15px 0;
        max-height: 360px;
        overflow: auto;
    }

    .customer-loans-table {
        width: 100%;
        font-size: 15px;
    }

    .customer-loans-table th, .customer-loans-table td {
        padding: 9px 7px;
    }

    /* Main loans table */
    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) {
        display: block;
    }

    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) thead {
        display: none;
    }

    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) tbody {
        display: block;
        width: 100%;
    }

    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) tbody tr {
        /* display: grid; */
        grid-template-columns: 1fr 1fr;
        gap: 0;
        width: 100%;
        margin-bottom: 12px;
        padding: 10px;
        border: 1px solid #e5e7eb !important;
        border-radius: 0;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) tbody td {
        /* display: block; */
        /* padding: 7px 5px; */
        /* border: 0; */
        /* background: transparent !important; */
    }

    .customer-loans-table:not(#customer-loans-modal-body .customer-loans-table) tbody td:nth-child(4) {
        grid-column: 1 / -1;
        padding-top: 10px;
    }

    /* Payment table inside the modal - each payment becomes a card */
    #customer-loans-modal-body .customer-loans-table {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    #customer-loans-modal-body .customer-loans-table thead {
        display: none;
    }

    #customer-loans-modal-body .customer-loans-table tbody {
        display: block;
        width: 100%;
    }

    #customer-loans-modal-body .customer-loans-table tbody tr {
        display: block;
        width: 100%;
        margin: 0 0 14px;
        padding: 10px 14px;
        border: 1px solid #e5e7eb !important;
        border-radius: 0;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }

    #customer-loans-modal-body .customer-loans-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        width: 100%;
        min-height: 36px;
        padding: 7px 0;
        border: 0;
        border-bottom: 1px solid #f0f1f3;
        background: transparent !important;
        color: #1C244B;
        font-size: 16px;
        text-align: left;
        box-sizing: border-box;
    }

    #customer-loans-modal-body .customer-loans-table tbody td:last-child {
        border-bottom: 0;
    }

    #customer-loans-modal-body .customer-loans-table tbody td::before {
        flex: 0 0 auto;
        /* color: #6b7280; */
        font-size: 16px;
        font-weight: 600;
        text-align: right;
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(1)::before {
        content: "תשלום";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(2)::before {
        content: "תאריך";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(3)::before {
        content: "קרן";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(4)::before {
        content: "ריבית";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(5)::before {
        content: "סכום לפני מע״מ";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(6)::before {
        content: "מע״מ";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(7)::before {
        content: "סה״כ";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(8)::before {
        content: "יתרה";
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(1), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(2), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(3), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(4), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(5), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(6), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(7), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(8) {
        direction: rtl;
    }

    #customer-loans-modal-body .customer-loans-table tbody td:nth-child(2), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(3), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(4), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(5), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(6), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(7), #customer-loans-modal-body .customer-loans-table tbody td:nth-child(8) {
        white-space: nowrap;
    }

    .customer-loan-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-loan-action {
        width: 100% !important;
    }

    .customer-loan-details-list {
        grid-template-columns: 1fr;
    }

    .customer-loan-document {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .customer-loan-document-button {
        width: 100% !important;
    }

    .customer-loans-modal-content {
        max-height: 95vh;
        border-radius: 6px;
    }

    .customer-loans-modal-header {
        padding: 14px 0px;
    }

    .customer-loans-modal-title {
        font-size: 20px;
    }

    .customer-loans-modal-body {
        padding: 1px;
    }

    .customer-loan-document-viewer {
        height: 70vh;
        min-height: 350px;
    }
}

@media (max-width: 767px) {
	.customer-loans-modal-body {
		font-size: 16px;
	}
    /* Main loans table - mobile cards */ 
	#customer-loans-response .customer-loans-table {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    #customer-loans-response .customer-loans-table thead {
        display: none;
    }

    #customer-loans-response .customer-loans-table tbody {
        display: block;
        width: 100%;
    }

    #customer-loans-response .customer-loans-table tbody tr {
        display: block;
        width: 100%;
        margin: 0 0 14px;
        padding: 12px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }

    #customer-loans-response .customer-loans-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        width: 100%;
        min-height: 38px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid #f0f1f3;
        background: transparent !important;
        color: #1C244B;
        font-size: 16px;
        box-sizing: border-box;
    }

    #customer-loans-response .customer-loans-table tbody td:last-child {
        border-bottom: 0;
    }

    /* Labels */
    /* Labels */
    #customer-loans-response .customer-loans-table tbody td:nth-child(1)::before {
        content: "מספר הלוואה";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(2)::before {
        content: "מספר רכב";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(3)::before {
        content: "שם רכב";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(4)::before {
        content: "סוג";
    }

    #customer-loans-response .customer-loans-table tbody td::before {
        flex: 0 0 auto;
        color: #1C244B;
        font-size: 16px;
        font-weight: 600;
        text-align: right;
    }

    /* Actions */
    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding-top: 12px;
    }

    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions::before {
        display: none;
    }

    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions .customer-loans-button {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    #customer-loans-portal button {
        font-size: 18px;
        margin: 0 !important;
    }

    #customer-loans-portal #customer-loans-logout {
        font-size: 14px;
        min-height: 30px;
    }

    #customer-loans-modal .customer-loans-file {
        font-size: 16px;
        justify-content: space-between;
    }

    .customer-loans-modal-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 30px !important;
        min-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        font-size: 20px !important;
    }
}


/* =========================================
   Main loans table - mobile carousel
   ========================================= */
@media (max-width: 767px) {

    #customer-loans-response .customer-loans-table-wrapper {
        width: 100%;
        max-height: none;
        overflow: hidden;
        margin: 15px 0;
        direction: rtl;
    }

    #customer-loans-response .customer-loans-table {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    #customer-loans-response .customer-loans-table thead {
        display: none;
    }

    #customer-loans-response .customer-loans-table tbody {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 0 12px;
    }

    #customer-loans-response .customer-loans-table tbody::-webkit-scrollbar {
        display: none;
    }

    #customer-loans-response .customer-loans-table tbody tr {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 12px 14px;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
        scroll-snap-align: start;
    }

    #customer-loans-response .customer-loans-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 38px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid #f0f1f3;
        background: transparent !important;
        color: #1C244B;
        font-size: 16px;
        box-sizing: border-box;
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(1)::before {
        content: "מספר הלוואה";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(2)::before {
        content: "מספר רכב";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(3)::before {
        content: "שם רכב";
    }

    #customer-loans-response .customer-loans-table tbody td:nth-child(4)::before {
        content: "סוג";
    }

    #customer-loans-response .customer-loans-table tbody td::before {
        flex: 0 0 auto;
        color: #1C244B;
        font-size: 15px;
        font-weight: 600;
        text-align: right;
    }

    #customer-loans-response .customer-loans-table tbody td:last-child {
        border-bottom: 0;
    }

    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 12px;
    }

    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions::before {
        display: none;
    }

    #customer-loans-response .customer-loans-table tbody td.customer-loan-actions .customer-loans-button {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

}

.customer-loans-carousel-nav {
    display: none;
}

@media (max-width: 767px) {
    #customer-loans-response + .customer-loans-carousel-nav,
    .customer-loans-table-wrapper + .customer-loans-carousel-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin: 0 auto 15px;
        direction: ltr;
    }

    .customer-loans-carousel-nav button {
        width: 36px !important;
        min-width: 36px;
        height: 36px;
        min-height: 36px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        font-size: 25px !important;
        line-height: 1;
    }

    .customer-loans-carousel-nav button:disabled {
        opacity: 0.3;
        cursor: default;
    }

    .customer-loans-carousel-counter {
        min-width: 55px;
        text-align: center;
        color: #1C244B;
        font-size: 15px;
        direction: ltr;
    }
}

@media (min-width: 768px) {
    .customer-loans-carousel-nav {
        display: none !important;
    }
}


/* =========================================
   Small mobile
   ========================================= */
@media (max-width: 400px) {
    #customer-loans-portal {
        padding-left: 15px;
        padding-right: 15px;
    }

    #customer-loans-portal h3 {
        font-size: 22px;
    }

    #customer-loans-portal label {
        font-size: 17px;
    }

    #customer-loans-portal button {
        font-size: 18px;
        margin: 0 !important;
    }

    .customer-loan-detail-item {
        padding: 12px 8px;
    }

    .customer-loan-detail-value {
        font-size: 17px;
    }

    .customer-loans-modal-content {
        max-height: 98vh;
    }

    .customer-loans-loading {
        padding: 10px;
    }
}
