/* =========================================================
   NEX FINSEV ADMIN
   LOAN SHOW / DETAILS PAGE
   Page-specific stylesheet
========================================================= */


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

.loan-show-page {
    width: 100%;
    min-height: calc(100vh - 70px);

    padding: 28px;

    background: #f5f8fc;

    color: #14243a;
}

.loan-show-container {
    width: 100%;
    max-width: 1450px;

    margin: 0 auto;
}


/* =========================================================
   BACK
========================================================= */

.loan-back {
    display: inline-flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 18px;

    color: #63758c;

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

    font-weight: 700;

    text-decoration: none;

    transition: color .18s ease;
}

.loan-back:hover {
    color: #1769e0;
}


/* =========================================================
   HEADER
========================================================= */

.loan-head {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.loan-head h1 {
    margin: 0;

    color: #172b4d;

    font-size: 27px;
    line-height: 1.25;

    font-weight: 800;

    letter-spacing: -.5px;
}

.loan-head p {
    margin: 6px 0 0;

    color: #7a8a9d;

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

.loan-head-actions {
    display: flex;

    align-items: center;

    gap: 8px;

    flex-wrap: wrap;

    flex-shrink: 0;
}


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

.ls-btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

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

    padding: 0 13px;

    border: 1px solid transparent;

    border-radius: 8px;

    font-family: inherit;

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

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.ls-btn:hover {
    transform: translateY(-1px);
}

.ls-btn:active {
    transform: translateY(0);
}


/* =========================================================
   BUTTON COLORS
========================================================= */

.ls-btn-blue {
    background: #1769e0;

    border-color: #1769e0;

    color: #ffffff;
}

.ls-btn-blue:hover {
    background: #1259c0;

    border-color: #1259c0;
}


.ls-btn-green {
    background: #198754;

    border-color: #198754;

    color: #ffffff;
}

.ls-btn-green:hover {
    background: #157347;

    border-color: #157347;
}


.ls-btn-red {
    background: #dc3545;

    border-color: #dc3545;

    color: #ffffff;
}

.ls-btn-red:hover {
    background: #bb2d3b;

    border-color: #bb2d3b;
}


.ls-btn-light {
    background: #ffffff;

    border-color: #e1e8f1;

    color: #42556c;
}

.ls-btn-light:hover {
    background: #f5f8fc;

    border-color: #d4deea;

    color: #1769e0;
}


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

.loan-alert {
    margin-bottom: 16px;

    padding: 11px 13px;

    border-radius: 9px;

    font-size: 12px;

    line-height: 1.5;

    font-weight: 600;
}

.loan-alert-success {
    color: #146c43;

    background: #dff5e9;

    border: 1px solid #c4ebd5;
}

.loan-alert-error {
    color: #a52834;

    background: #fde4e7;

    border: 1px solid #f7c9cf;
}


/* =========================================================
   MAIN GRID
========================================================= */

.loan-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(300px, .55fr);

    gap: 18px;

    align-items: start;
}


/* =========================================================
   CARDS
========================================================= */

.ls-card {
    width: 100%;

    margin-bottom: 18px;

    background: #ffffff;

    border: 1px solid #e1e8f1;

    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(24, 52, 86, .05);

    overflow: hidden;
}

.ls-card:last-child {
    margin-bottom: 0;
}


/* =========================================================
   CARD HEADER
========================================================= */

.ls-card-head {
    min-height: 54px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 15px 18px;

    border-bottom: 1px solid #edf1f5;
}

.ls-card-head h2 {
    margin: 0;

    color: #233a55;

    font-size: 14px;
    line-height: 1.35;

    font-weight: 800;
}

.ls-card-head span {
    color: #8998a9;

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

    white-space: nowrap;
}


/* =========================================================
   CARD BODY
========================================================= */

.ls-card-body {
    padding: 18px;
}


/* =========================================================
   LOAN HERO
========================================================= */

.loan-hero {
    position: relative;

    padding: 22px;

    background:
        linear-gradient(
            135deg,
            #071b36,
            #0c407e 62%,
            #1769e0
        );

    border-radius: 15px;

    color: #ffffff;

    overflow: hidden;
}

.loan-hero::after {
    content: "";

    position: absolute;

    width: 250px;
    height: 250px;

    right: -80px;
    top: -120px;

    border: 1px solid rgba(255,255,255,.1);

    border-radius: 50%;

    pointer-events: none;
}


/* =========================================================
   HERO TOP
========================================================= */

.loan-hero-top {
    position: relative;

    z-index: 2;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;
}

.loan-hero-label {
    color: #a9c4e6;

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

    text-transform: uppercase;

    letter-spacing: 1.3px;

    font-weight: 900;
}

.loan-number {
    margin-top: 5px;

    color: #ffffff;

    font-size: 22px;
    line-height: 1.25;

    font-weight: 900;

    letter-spacing: -.4px;
}

.loan-hero-status {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 28px;

    padding: 0 10px;

    border-radius: 50px;

    background: rgba(255,255,255,.12);

    color: #ffffff;

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

    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   HERO BOTTOM STATS
========================================================= */

.loan-hero-bottom {
    position: relative;

    z-index: 2;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-top: 24px;
}

.loan-hero-stat {
    min-width: 0;
}

.loan-hero-stat span {
    display: block;

    margin-bottom: 4px;

    color: #aac1dc;

    font-size: 9px;
    line-height: 1.35;
}

.loan-hero-stat strong {
    display: block;

    color: #ffffff;

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

    font-weight: 800;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   DETAIL GRID
========================================================= */

.detail-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 11px;
}

.detail-item {
    min-width: 0;

    padding: 12px;

    background: #f8fafc;

    border: 1px solid #e8eef4;

    border-radius: 10px;
}

.detail-item small {
    display: block;

    color: #8291a4;

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

    text-transform: uppercase;

    letter-spacing: .45px;

    font-weight: 700;
}

.detail-item strong {
    display: block;

    margin-top: 5px;

    color: #263d58;

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

    font-weight: 700;

    word-break: break-word;
}

.detail-item .green {
    color: #198754;
}

.detail-item .blue {
    color: #1769e0;
}


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

.client-box {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;
}

.client-avatar {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 13px;

    background: #edf4ff;

    color: #1769e0;

    font-size: 15px;

    line-height: 1;

    font-weight: 900;
}

.client-name {
    color: #213852;

    font-size: 14px;
    line-height: 1.35;

    font-weight: 800;

    word-break: break-word;
}

.client-sub {
    margin-top: 3px;

    color: #8493a5;

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

    word-break: break-word;
}


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

.client-links {
    display: flex;

    align-items: center;

    gap: 6px;

    flex-wrap: wrap;

    margin-top: 14px;
}

.client-link {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 29px;

    padding: 0 9px;

    border-radius: 7px;

    background: #f4f7fb;

    border: 1px solid #e4eaf1;

    color: #51647b;

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

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;
}

.client-link:hover {
    background: #eaf2ff;

    border-color: #d5e4f7;

    color: #1769e0;
}


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

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

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

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;

    scrollbar-color: #cbd5e1 transparent;
}

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

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

.emi-table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 20px;
}

.emi-table {
    width: 100%;

    min-width: 720px;

    border-collapse: collapse;

    border-spacing: 0;
}

.emi-table th {
    padding: 11px 12px;

    background: #f8fafc;

    color: #7d8da0;

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

    text-align: left;

    text-transform: uppercase;

    letter-spacing: .6px;

    font-weight: 800;

    white-space: nowrap;

    border-bottom: 1px solid #e9eef4;
}

.emi-table td {
    padding: 11px 12px;

    color: #40536a;

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

    vertical-align: middle;

    white-space: nowrap;

    border-top: 1px solid #edf1f5;
}

.emi-table tbody tr:hover {
    background: #fbfdff;
}


/* =========================================================
   EMI CONTENT
========================================================= */

.emi-no {
    color: #1769e0;

    font-weight: 800;
}

.emi-money {
    color: #253b55;

    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   EMI STATUS
========================================================= */

.emi-status {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 24px;

    padding: 0 7px;

    border-radius: 50px;

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

    font-weight: 900;

    white-space: nowrap;
}

.emi-pending {
    background: #fff5df;

    color: #b36b00;
}

.emi-paid {
    background: #eaf8f0;

    color: #198754;
}

.emi-partial {
    background: #eaf3ff;

    color: #1769e0;
}

.emi-overdue {
    background: #fff0f1;

    color: #dc3545;
}

.emi-cancelled {
    background: #f0f2f5;

    color: #778597;
}


/* =========================================================
   SIDE SUMMARY
========================================================= */

.side-summary {
    display: grid;

    gap: 0;
}

.side-row {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 12px;

    padding: 10px 0;

    border-bottom: 1px solid #edf1f5;

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

.side-row:last-child {
    border-bottom: 0;
}

.side-row span {
    color: #7d8da0;

    flex: 0 0 auto;
}

.side-row strong {
    color: #253b55;

    text-align: right;

    word-break: break-word;
}


/* =========================================================
   PROGRESS
========================================================= */

.progress {
    width: 100%;

    height: 8px;

    margin-top: 8px;

    background: #eaf0f6;

    border-radius: 50px;

    overflow: hidden;
}

.progress span {
    display: block;

    height: 100%;

    min-width: 0;

    background: #198754;

    border-radius: 50px;
}


/* =========================================================
   ACTION STACK
========================================================= */

.action-stack {
    display: grid;

    gap: 8px;
}

.action-stack form {
    width: 100%;

    margin: 0;
}

.action-stack button {
    width: 100%;
}


/* =========================================================
   REJECTION
========================================================= */

.rejection-box {
    padding: 12px;

    background: #fff4f5;

    border: 1px solid #f3d3d7;

    border-radius: 10px;

    color: #a52834;

    font-size: 11px;

    line-height: 1.6;
}


/* =========================================================
   NOTES
========================================================= */

.notes-box {
    padding: 12px;

    background: #f7f9fc;

    border: 1px solid #e5ebf2;

    border-radius: 10px;

    color: #65778d;

    font-size: 11px;

    line-height: 1.7;

    white-space: pre-line;

    overflow-wrap: anywhere;
}


/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 1050px) {

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

    .loan-hero-bottom {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE — 760px
========================================================= */

@media (max-width: 760px) {

    .loan-show-page {
        padding: 18px 14px 30px;
    }

    .loan-head {
        flex-direction: column;

        gap: 14px;
    }

    .loan-head-actions {
        width: 100%;
    }

    .loan-head-actions > * {
        flex: 1 1 auto;
    }

    .loan-head h1 {
        font-size: 23px;
    }

    .loan-head p {
        font-size: 11px;
    }

    .loan-hero {
        padding: 18px;
    }

    .loan-hero-top {
        flex-direction: column;

        gap: 12px;
    }

    .loan-hero-bottom {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .ls-card-body {
        padding: 16px;
    }

}


/* =========================================================
   RESPONSIVE — 480px
========================================================= */

@media (max-width: 480px) {

    .loan-show-page {
        padding: 14px 10px 25px;
    }

    .loan-head {
        margin-bottom: 17px;
    }

    .loan-head h1 {
        font-size: 21px;
    }

    .loan-head-actions {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .loan-head-actions > * {
        width: 100%;
    }

    .ls-btn {
        height: 36px;

        min-height: 36px;

        padding: 0 9px;

        font-size: 10px;
    }

    .loan-hero {
        padding: 16px;

        border-radius: 13px;
    }

    .loan-number {
        font-size: 19px;
    }

    .loan-hero-bottom {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 11px;

        margin-top: 20px;
    }

    .loan-hero-stat strong {
        font-size: 14px;
    }

    .ls-card {
        border-radius: 13px;
    }

    .ls-card-head {
        padding: 13px 14px;
    }

    .ls-card-head h2 {
        font-size: 13px;
    }

    .ls-card-body {
        padding: 14px;
    }

    .client-avatar {
        width: 42px;
        height: 42px;

        flex-basis: 42px;
    }

    .client-name {
        font-size: 13px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 360px) {

    .loan-show-page {
        padding-left: 8px;

        padding-right: 8px;
    }

    .loan-head-actions {
        grid-template-columns: 1fr;
    }

    .loan-hero-bottom {
        grid-template-columns: 1fr;
    }

    .loan-hero-stat strong {
        font-size: 14px;
    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .loan-back,
    .ls-btn,
    .client-link {
        transition: none;
    }

    .ls-btn:hover {
        transform: none;
    }

}