/* Shared client dashboard tables. Admin and public pages keep their own styles. */
.dashboard .dashboard-body { background: #f7f8fc; }
.dashboard .dashboard-header { margin-bottom: 6px; }
.dashboard .dashboard-header__title { color: #273150; font-size: clamp(21px, 1.35vw, 26px); letter-spacing: -.02em; }
.dashboard-body .custom--card:not(:has(.table)),
.dashboard-body .dashboard-widget {
    border: 1px solid #e7e9f0;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(25, 35, 65, .035);
}
.dashboard-body a .dashboard-widget { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dashboard-body a:hover .dashboard-widget { transform: translateY(-2px); border-color: #dce0ea; box-shadow: 0 10px 28px rgba(25, 35, 65, .08); }
.dashboard-body .dashboard-widget__icon { border-radius: 10px; }
.dashboard-body .form-control,
.dashboard-body .form-select {
    min-height: 42px;
    border-color: #dfe3ec;
    border-radius: 8px;
    box-shadow: none;
}
.dashboard-body .form-control:focus,
.dashboard-body .form-select:focus {
    border-color: hsl(var(--base));
    box-shadow: 0 0 0 3px hsl(var(--base) / .12);
}
.dashboard-body textarea.form-control { min-height: 112px; }
.dashboard-body .btn { border-radius: 8px; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.dashboard-body .btn:hover { transform: translateY(-1px); }
.dashboard-body .alert { border: 0; border-radius: 12px; box-shadow: 0 3px 14px rgba(25, 35, 65, .035); }
.dashboard-body .card-footer { border-color: #edf0f5; }
.dashboard-body .pagination { gap: 5px; }
.dashboard-body .page-link { min-width: 34px; border-radius: 8px !important; border-color: #e1e5ee; color: #65708a; text-align: center; }
.dashboard-body .page-item.active .page-link { box-shadow: 0 4px 10px hsl(var(--base) / .2); }
.dashboard-body .custom--card:has(.table) {
    border: 1px solid #e7e9f0;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(25, 35, 65, .035);
}

.dashboard-body .table thead tr th {
    padding: 16px 20px;
    background: #f8f9fc;
    color: #687187;
    border-bottom: 1px solid #e7e9f0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .035em;
    white-space: nowrap;
}

.dashboard-body .table tbody tr td {
    padding: 20px;
    color: #323b50;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid #edf0f5;
}

.dashboard-body .table tbody tr:last-child td { border-bottom: 0; }
.dashboard-body .table tbody tr:hover td { background-color: #fafbfe; }
.dashboard-body .table tbody tr td[colspan] { padding: 40px 20px; color: #687187; }
.dashboard-body .table tbody tr td[colspan]::before { display: none; }
.dashboard-body .table .badge { border-radius: 20px; padding: 7px 12px; font-weight: 500; }
.dashboard-body .table a:focus-visible,
.dashboard-body .table button:focus-visible { outline: 2px solid hsl(var(--base)); outline-offset: 3px; }

.dashboard-body .client-table-card .card-header {
    padding: 22px 24px;
    border-bottom: 0;
    background: transparent;
}
.client-table-card .header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.client-table-heading { margin-inline-end: auto; text-align: left; }
.loan-table-scroll { border-radius: 0 0 14px 14px; }
.client-table-heading h5 { font-size: 18px; }
.client-table-heading p { color: #687187; font-size: 13px; }
.client-table-card .header-nav form { max-width: 100%; }
.client-table-card .header-nav .input-group { flex: 1 1 210px; width: 240px !important; }
.client-table-card .header-nav .form-control { min-width: 0; width: 1%; height: 42px; font-size: 13px; border-color: #dfe3ec; }
.client-table-card .header-nav .btn { padding: 8px 14px; }
.loan-list-navigation { display: flex; flex-wrap: wrap; gap: 8px; }
.loan-list-navigation .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.loan-table-card .header-nav form { margin-inline-start: 8px; }
.dashboard-body .loan-table tbody tr td { padding-top: 16px; padding-bottom: 16px; }
.investment-table-card .header-nav form { margin-inline-start: 8px; }
.dashboard-body .investment-table tbody tr td { padding-top: 16px; padding-bottom: 16px; }
.dashboard-body .investment-table thead tr th:last-child,
.dashboard-body .investment-table tbody tr td:last-child { text-align: right; }
.dashboard-body .loan-table thead tr th,
.dashboard-body .loan-table tbody tr td { text-align: left; }
.dashboard-body .loan-table thead tr th:nth-child(3),
.dashboard-body .loan-table thead tr th:nth-child(4),
.dashboard-body .loan-table thead tr th:nth-child(7),
.dashboard-body .loan-table tbody tr td:nth-child(3),
.dashboard-body .loan-table tbody tr td:nth-child(4),
.dashboard-body .loan-table tbody tr td:nth-child(7),
.dashboard-body .loan-table thead tr th:last-child,
.dashboard-body .loan-table tbody tr td:last-child { text-align: right; }
.loan-number { color: #272f50; font-weight: 600; }
.loan-number:hover { color: hsl(var(--base)); text-decoration: underline; }
.loan-repayments { display: inline-flex; flex-direction: column; gap: 7px; min-width: 100px; }
.repayment-label { color: #687187; font-size: 12px; }
.loan-repayments progress { appearance: none; width: 100px; height: 5px; border: 0; border-radius: 8px; overflow: hidden; background: #e9ecf3; color: hsl(var(--base)); }
.loan-repayments progress::-webkit-progress-bar { background: #e9ecf3; }
.loan-repayments progress::-webkit-progress-value { background: hsl(var(--base)); border-radius: 8px; }
.loan-repayments progress::-moz-progress-bar { background: hsl(var(--base)); border-radius: 8px; }
.dashboard-body .loan-table .loan-actions { width: 34px; height: 34px; padding: 0; border-color: #e0e4ed; border-radius: 8px; }
/* The dashboard script lifts open table menus above the scrolling table. */
.loan-table .dropdown-menu.show { z-index: 1055; }

.loan-summary-card { border: 1px solid #e7e9f0; border-radius: 14px; box-shadow: 0 4px 20px rgba(25, 35, 65, .035); }
.loan-summary-card .card-body { padding: 20px 24px; }
.loan-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.loan-summary-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.loan-summary-nav .btn { padding: 8px 12px; font-size: 13px; }
.loan-summary-eyebrow { color: hsl(var(--base)); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.loan-summary-title { margin: 4px 0 1px; color: #273150; font-size: 18px; }
.loan-summary-number { color: #77819a; font-size: 13px; font-weight: 600; }
.loan-summary-progress { margin: 16px 0; padding: 12px 16px; background: #f7f8fc; border-radius: 10px; color: #687187; font-size: 13px; }
.loan-summary-progress strong { color: #323b50; }
.loan-summary-progress progress { width: 100%; height: 7px; appearance: none; border: 0; border-radius: 8px; overflow: hidden; background: #e4e8f1; }
.loan-summary-progress progress::-webkit-progress-bar { background: #e4e8f1; }
.loan-summary-progress progress::-webkit-progress-value { background: hsl(var(--base)); border-radius: 8px; }
.loan-summary-progress progress::-moz-progress-bar { background: hsl(var(--base)); border-radius: 8px; }
.loan-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #edf0f5; border-radius: 10px; background: #edf0f5; }
.loan-summary-grid > div { min-height: 70px; padding: 12px 15px; background: #fff; }
.loan-summary-grid span { display: block; margin-bottom: 5px; color: #77819a; font-size: 12px; }
.loan-summary-grid strong { color: #323b50; font-size: 15px; }
.loan-delay-note { display: flex; gap: 9px; margin-top: 14px; color: #b65a63; font-size: 12px; line-height: 1.55; }
.loan-delay-note i { margin-top: 2px; color: #ef5d6b; font-size: 16px; }

.installment-table-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.installment-table-card .card-header h5 { font-size: 18px; }
.installment-table-card .card-header p { color: #687187; font-size: 13px; }
.installment-count { padding: 7px 11px; border-radius: 20px; background: #f0f2f7; color: #687187; font-size: 12px; font-weight: 600; white-space: nowrap; }
.installment-table tbody tr td { vertical-align: middle; }
.installment-number { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #f0f2f7; color: #566078; font-size: 12px; font-weight: 700; }
.installment-status { display: inline-flex; padding: 6px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.installment-status.is-paid { background: #e9f8ef; color: #278751; }
.installment-status.is-upcoming { background: #eff2f7; color: #687187; }
.installment-status.is-overdue { background: #fff0f1; color: #d64b5b; }
.installment-empty { color: #a3aabd; font-size: 16px; }

@media (min-width: 992px) {
    .loan-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .loan-summary-grid > div { min-height: 76px; }
}

@media (max-width: 767px) {
    .dashboard .dashboard-header { margin-bottom: 0; }
    .dashboard-body .dashboard-widget { padding: 22px 18px; }
    .dashboard-body .client-table-card .card-header { padding: 18px 16px; }
    .client-table-card .header-nav form { width: 100%; }
    .loan-list-navigation { order: 2; }
    .loan-table-card .header-nav form,
    .investment-table-card .header-nav form { order: 3; margin-inline-start: 0; }
    .dashboard-body .table--responsive--md tbody tr { padding: 12px 0; border-bottom: 6px solid #f4f6fa; }
    .dashboard-body .table--responsive--md tbody tr:last-child { border-bottom: 0; }
    .dashboard-body .table--responsive--md tbody tr td { padding: 10px 16px; white-space: normal; overflow-wrap: anywhere; border-bottom: 0; text-align: right; gap: 16px; }
    .dashboard-body .table--responsive--md tbody tr td::before { color: #687187; font-size: 12px; flex: 0 0 40%; }
    .dashboard-body .table--responsive--md tbody tr td[colspan] { display: block; text-align: center; }
    .loan-repayments { align-items: flex-end; }
    .loan-summary-card .card-body { padding: 20px; }
    .loan-summary-top { flex-direction: column; }
    .loan-summary-nav { justify-content: flex-start; }
    .installment-table-card .card-header { align-items: flex-start; padding: 18px 16px; }
    .installment-count { margin-top: 2px; }
}
