/* =========================================================
   EMI CARD MANAGEMENT
   public/admin/css/emicard.css
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.emi-page {
    width: 100%;
    display: block;
}

.emi-page * {
    box-sizing: border-box;
}

.page-heading {
    margin-bottom: 20px;
}

.page-heading h2 {
    margin: 0;
    color: #1d3557;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 800;
}

.page-heading p {
    margin: 6px 0 0;
    color: #8b98aa;
    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   ALERTS
========================================================= */

.emi-page .alert-box {
    padding: 13px 16px;
    margin-bottom: 16px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 700;
}

.emi-page .alert-box ul {
    font-size: 12px;
}

.emi-page .alert-success {
    color: #166534;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.emi-page .alert-error {
    color: #be123c;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}


/* =========================================================
   STATS
========================================================= */

.emi-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.emi-page .stat-card {
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 13px;
    padding: 18px;
}

.emi-page .stat-label {
    color: #8b98aa;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.emi-page .stat-value {
    margin-top: 7px;
    color: #273b59;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 900;
}

.emi-page .stat-green .stat-value {
    color: #287646;
}

.emi-page .stat-orange .stat-value {
    color: #b7791f;
}

.emi-page .stat-red .stat-value {
    color: #be123c;
}

.emi-page .stat-blue .stat-value {
    color: #1769e0;
}


/* =========================================================
   GENERATE BAR
========================================================= */

.emi-page .generate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 13px;

    padding: 17px 19px;
    margin-bottom: 18px;
}

.emi-page .generate-title {
    color: #273b59;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 800;
}

.emi-page .generate-description {
    margin-top: 5px;
    color: #9aa6b6;
    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.emi-page .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 0 15px;

    border: 0;
    border-radius: 8px;

    background: #1769e0;
    color: #fff;

    font-size: 11px;
    line-height: 1;
    font-weight: 800;

    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.emi-page .primary-btn:hover {
    background: #1258be;
}


/* =========================================================
   SEARCH / FILTER
========================================================= */

.emi-page .filter-card {
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 13px;

    padding: 16px 18px;
    margin-bottom: 18px;
}

.emi-page .filter-form {
    display: flex;
    gap: 9px;
    align-items: center;
}

.emi-page .filter-input,
.emi-page .filter-select {
    height: 40px;

    border: 1px solid #dce4ef;
    border-radius: 8px;

    padding: 0 11px;

    color: #344966;
    background: #fff;

    outline: none;

    font-family: inherit;
    font-size: 12px;
    line-height: 1;
}

.emi-page .filter-input {
    flex: 1;
    min-width: 0;
}

.emi-page .filter-select {
    width: 170px;
}

.emi-page .filter-input::placeholder {
    color: #a3afbf;
    opacity: 1;
}

.emi-page .filter-input:focus,
.emi-page .filter-select:focus {
    border-color: #1769e0;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .08);
}

.emi-page .filter-btn {
    height: 40px;
    padding: 0 16px;

    border: 0;
    border-radius: 8px;

    background: #273b59;
    color: #fff;

    font-family: inherit;
    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
    white-space: nowrap;
}

.emi-page .filter-btn:hover {
    background: #1d2f48;
}

.emi-page .clear-btn {
    height: 40px;
    padding: 0 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #dce4ef;
    border-radius: 8px;

    background: #fff;
    color: #64748b;

    font-family: inherit;
    font-size: 11px;
    font-weight: 700;

    text-decoration: none;
    white-space: nowrap;
}

.emi-page .clear-btn:hover {
    background: #f8fafc;
}


/* =========================================================
   TABLE CARD
========================================================= */

.emi-page .table-card {
    width: 100%;

    background: #fff;

    border: 1px solid #e3eaf3;
    border-radius: 13px;

    overflow: hidden;
}

.emi-page .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 17px 19px;

    border-bottom: 1px solid #edf1f6;
}

.emi-page .table-header h3 {
    margin: 0;

    color: #273b59;

    font-size: 15px;
    line-height: 1.4;
    font-weight: 800;
}

.emi-page .result-count {
    color: #8b98aa;

    font-size: 11px;
    line-height: 1.4;

    white-space: nowrap;
}


/* =========================================================
   TABLE WRAPPER
========================================================= */

.emi-page .table-wrap {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
    scrollbar-color: #b8c2cf #f1f4f7;
}

.emi-page .table-wrap::-webkit-scrollbar {
    height: 7px;
}

.emi-page .table-wrap::-webkit-scrollbar-track {
    background: #f1f4f7;
}

.emi-page .table-wrap::-webkit-scrollbar-thumb {
    background: #b8c2cf;
    border-radius: 10px;
}

.emi-page .table-wrap::-webkit-scrollbar-thumb:hover {
    background: #929eae;
}


/* =========================================================
   TABLE
========================================================= */

.emi-page .table-wrap table {
    width: 100%;
    min-width: 1150px;

    border-collapse: collapse;
    border-spacing: 0;
}

.emi-page .table-wrap th {
    padding: 12px 14px;

    background: #fafbfd;
    border-bottom: 1px solid #edf1f6;

    color: #8795a8;

    font-family: inherit;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 800;

    text-align: left;
    text-transform: uppercase;
    letter-spacing: .35px;

    white-space: nowrap;
}

.emi-page .table-wrap td {
    padding: 15px 14px;

    border-bottom: 1px solid #edf1f6;

    color: #344966;

    font-family: inherit;
    font-size: 12px;
    line-height: 1.4;

    vertical-align: middle;
    white-space: nowrap;
}

.emi-page .table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.emi-page .table-wrap tbody tr:hover {
    background: #fcfdff;
}


/* =========================================================
   CLIENT
========================================================= */

.emi-page .client {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.emi-page .client-avatar {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eaf2ff;
    color: #1769e0;

    font-size: 13px;
    line-height: 1;
    font-weight: 900;
}

.emi-page .client-name {
    display: block;

    color: #344966;

    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
}

.emi-page .client-email {
    display: block;

    margin-top: 3px;

    color: #8b98aa;

    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
}


/* =========================================================
   CARD NUMBER
========================================================= */

.emi-page .card-number {
    color: #344966;

    font-family: Consolas, Monaco, monospace;

    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;

    letter-spacing: .35px;

    white-space: nowrap;
}


/* =========================================================
   MONEY
========================================================= */

.emi-page .money {
    color: #273b59;

    font-size: 12px;
    line-height: 1.4;
    font-weight: 900;

    white-space: nowrap;
}

.emi-page .available {
    margin-top: 4px;

    color: #287646;

    font-size: 11px;
    line-height: 1.3;
    font-weight: 700;
}


/* =========================================================
   BADGES
========================================================= */

.emi-page .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 6px 10px;

    border-radius: 20px;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;

    white-space: nowrap;
}

.emi-page .dot {
    width: 6px;
    height: 6px;

    flex-shrink: 0;

    border-radius: 50%;
    background: currentColor;
}

.emi-page .badge-active {
    color: #287646;
    background: #eaf8ef;
}

.emi-page .badge-pending {
    color: #b7791f;
    background: #fff7e8;
}

.emi-page .badge-blocked {
    color: #be123c;
    background: #fff1f2;
}

.emi-page .badge-expired {
    color: #64748b;
    background: #f1f5f9;
}


/* =========================================================
   PAYMENT STATUS
========================================================= */

.emi-page .payment-paid,
.emi-page .payment-pending {
    display: inline-flex;
    align-items: center;

    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;

    white-space: nowrap;
}

.emi-page .payment-paid {
    color: #287646;
}

.emi-page .payment-pending {
    color: #b7791f;
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.emi-page .action-buttons {
    display: flex;
    align-items: center;

    gap: 6px;

    flex-wrap: wrap;

    min-width: 205px;
}

.emi-page .small-btn {
    min-height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 10px;

    border: 0;
    border-radius: 7px;

    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;

    cursor: pointer;

    text-decoration: none;
    white-space: nowrap;
}

.emi-page .view-btn {
    background: #eaf2ff;
    color: #1769e0;
}

.emi-page .view-btn:hover {
    background: #dceaff;
}

.emi-page .limit-btn {
    background: #fff7e8;
    color: #b7791f;
}

.emi-page .limit-btn:hover {
    background: #fff0d2;
}

.emi-page .approve-btn {
    background: #eaf8ef;
    color: #287646;
}

.emi-page .approve-btn:hover {
    background: #dcf5e6;
}

.emi-page .block-btn {
    background: #fff1f2;
    color: #be123c;
}

.emi-page .block-btn:hover {
    background: #ffe4e7;
}

.emi-page .disabled-btn {
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
}


/* =========================================================
   EMPTY
========================================================= */

.emi-page .empty {
    padding: 60px 20px;

    text-align: center;

    color: #9aa6b6;

    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   PAGINATION
========================================================= */

.emi-page .pagination-area {
    width: 100%;

    min-height: 68px;

    padding: 14px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-top: 1px solid #edf1f6;

    background: #fff;
}

.emi-page .pagination-info {
    flex-shrink: 0;

    color: #8b98aa;

    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;

    white-space: nowrap;
}

.emi-page .pagination-links {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 5px;

    flex-shrink: 0;
}


/* =========================================================
   PAGE BUTTON
========================================================= */

.emi-page .page-btn {
    width: 36px;
    min-width: 36px;

    height: 36px;
    min-height: 36px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #dce4ef;
    border-radius: 8px;

    background: #fff;
    color: #64748b;

    font-family: inherit;

    font-size: 12px;
    line-height: 1;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;

    box-sizing: border-box;
}

.emi-page a.page-btn:hover {
    background: #f4f8fd;

    border-color: #c8d7e8;

    color: #1769e0;
}

.emi-page .page-btn.active {
    background: #1769e0;

    border-color: #1769e0;

    color: #fff;

    font-weight: 900;
}

.emi-page .page-btn.disabled {
    background: #f8fafc;

    border-color: #edf1f5;

    color: #b7c0cb;

    cursor: default;
}


/* =========================================================
   EMI MODAL
   Unique class names used to avoid layout CSS conflicts
========================================================= */

.emi-modal-overlay {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 99999;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, .58);
}

.emi-modal-overlay.show {
    display: flex;
}

.emi-modal {
    width: 100%;
    max-width: 480px;

    margin: auto;

    background: #fff;

    border-radius: 14px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, .20);

    overflow: hidden;

    position: relative;
}


/* =========================================================
   EMI MODAL HEADER
========================================================= */

.emi-modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 18px 20px;

    border-bottom: 1px solid #edf1f6;

    background: #fff;
}

.emi-modal-header h3 {
    margin: 0;

    color: #273b59;

    font-size: 15px;
    line-height: 1.4;

    font-weight: 800;
}

.emi-modal-close {
    width: 31px;
    height: 31px;

    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background: #f1f5f9;
    color: #64748b;

    cursor: pointer;

    font-family: inherit;
    font-size: 18px;
    line-height: 1;
}

.emi-modal-close:hover {
    background: #e8eef5;
    color: #273b59;
}


/* =========================================================
   EMI MODAL BODY
========================================================= */

.emi-modal-body {
    padding: 20px;

    background: #fff;
}

.emi-form-group {
    margin-bottom: 15px;
}

.emi-form-label {
    display: block;

    margin-bottom: 6px;

    color: #64748b;

    font-size: 11px;
    line-height: 1.3;

    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .4px;
}

.emi-form-control {
    width: 100%;

    height: 41px;

    padding: 0 11px;

    border: 1px solid #dce4ef;
    border-radius: 8px;

    outline: none;

    color: #344966;

    font-family: inherit;
    font-size: 12px;

    background: #fff;
}

.emi-form-control:focus {
    border-color: #1769e0;

    box-shadow:
        0 0 0 3px rgba(23, 105, 224, .08);
}


/* =========================================================
   MODAL INFO BOX
========================================================= */

.emi-modal-info-box {
    padding: 12px;

    margin-bottom: 15px;

    background: #f8fafc;

    border: 1px solid #e7edf4;
    border-radius: 8px;

    color: #64748b;

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   MODAL WARNING BOX
========================================================= */

.emi-modal-warning-box {
    padding: 11px;

    margin-bottom: 0;

    background: #fff7e8;

    border: 1px solid #fde68a;
    border-radius: 8px;

    color: #92400e;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   MODAL FOOTER
========================================================= */

.emi-modal-footer {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    padding: 15px 20px;

    border-top: 1px solid #edf1f6;

    background: #fff;
}

.emi-cancel-btn,
.emi-save-btn {
    min-height: 38px;

    padding: 0 15px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 11px;
    line-height: 1;

    font-weight: 800;

    cursor: pointer;
}

.emi-cancel-btn {
    border: 1px solid #dce4ef;

    background: #fff;

    color: #64748b;
}

.emi-cancel-btn:hover {
    background: #f8fafc;
}

.emi-save-btn {
    border: 0;

    background: #1769e0;

    color: #fff;
}

.emi-save-btn:hover {
    background: #1258be;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

    .emi-page .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .emi-page .table-wrap table {
        min-width: 1150px;
    }

}


@media (max-width: 700px) {

    .emi-page .filter-form {
        flex-wrap: wrap;
    }

    .emi-page .filter-input {
        width: 100%;
        flex-basis: 100%;
    }

    .emi-page .filter-select {
        flex: 1;
        width: auto;
    }

    .emi-page .generate-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .emi-page .primary-btn {
        width: 100%;
    }

    .emi-page .pagination-area {
        flex-direction: column;

        align-items: flex-start;

        gap: 10px;

        padding: 13px;
    }

    .emi-page .pagination-links {
        width: 100%;

        justify-content: flex-start;

        overflow-x: auto;

        padding-bottom: 2px;

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }

    .emi-page .pagination-links::-webkit-scrollbar {
        display: none;
    }

    .emi-modal-overlay {
        padding: 12px;
    }

    .emi-modal {
        max-width: 100%;
        border-radius: 12px;
    }

}


@media (max-width: 500px) {

    .emi-page .stats-grid {
        grid-template-columns: 1fr;
    }

    .emi-page .filter-select {
        width: 100%;
        flex-basis: 100%;
    }

    .emi-page .filter-btn,
    .emi-page .clear-btn {
        width: 100%;
    }

    .emi-page .filter-form {
        gap: 8px;
    }

    .emi-page .page-heading h2 {
        font-size: 19px;
    }

    .emi-page .page-heading p {
        font-size: 11px;
    }

    .emi-page .table-header {
        padding: 15px;
    }

    .emi-page .table-header h3 {
        font-size: 14px;
    }

    .emi-page .result-count {
        font-size: 10px;
    }

    .emi-page .pagination-info {
        font-size: 11px;
    }

    .emi-page .page-btn {
        width: 34px;
        min-width: 34px;

        height: 34px;
        min-height: 34px;

        font-size: 11px;
    }

    .emi-modal-header {
        padding: 16px;
    }

    .emi-modal-header h3 {
        font-size: 14px;
    }

    .emi-modal-body {
        padding: 16px;
    }

    .emi-modal-footer {
        padding: 13px 16px;
    }

    .emi-form-label {
        font-size: 10px;
    }

    .emi-form-control {
        font-size: 12px;
    }

    .emi-cancel-btn,
    .emi-save-btn {
        font-size: 11px;
    }

}