* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body.jlan-body {
    margin: 0;
    background: #f4f6f9;
    color: #162033;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jlan-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.jlan-sidebar {
    background: #0d1f3c;
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.jlan-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    font-size: 20px;
}

.jlan-logo-mark {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--jlan-secondary, #0f766e);
    color: #fff;
    font-weight: 800;
}

.jlan-nav {
    display: grid;
    gap: 4px;
}

.jlan-nav a {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 650;
    font-size: 14px;
}

.jlan-nav a.is-active,
.jlan-nav a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.jlan-main {
    min-width: 0;
}

.jlan-topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid #e5e9f0;
    position: sticky;
    top: 0;
    z-index: 4;
}

.jlan-icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.jlan-search {
    flex: 1;
    position: relative;
    max-width: 620px;
}

.jlan-search span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.jlan-search input,
.jlan-fields input,
.jlan-fields select,
.jlan-fields textarea,
.jlan-filterbar select {
    width: 100%;
    border: 1px solid #d7dfea;
    border-radius: 8px;
    background: #fff;
    padding: 11px 12px;
    color: #152033;
    font: inherit;
}

.jlan-fields textarea {
    min-height: 120px;
    resize: vertical;
}

.jlan-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.jlan-badge {
    border: 1px solid #d8e1ee;
    border-radius: 999px;
    padding: 7px 10px;
    background: #f8fafc;
    font-size: 13px;
}

.jlan-user {
    font-weight: 700;
}

.jlan-content {
    padding: 28px;
}

.jlan-view {
    display: none;
}

.jlan-view.is-active {
    display: block;
}

.jlan-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.jlan-page-head h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 0;
}

.jlan-page-head p,
.jlan-muted {
    color: #627086;
    margin: 6px 0 0;
}

.jlan-lookup-note {
    display: block;
    margin-top: 5px;
    color: #627086;
    font-size: 12px;
}

.jlan-lookup-note[data-state="success"] {
    color: #047857;
}

.jlan-lookup-note[data-state="error"] {
    color: #b42318;
}

.jlan-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.jlan-page-actions-left {
    justify-content: flex-start;
    order: -1;
}

.jlan-contract-dropzone {
    display: grid;
    gap: 5px;
    min-width: 240px;
    padding: 12px 14px;
    border: 1px dashed #9fb0c8;
    border-radius: 8px;
    background: #fff;
    color: #172033;
}

.jlan-contract-dropzone span {
    color: #627086;
    font-size: 13px;
}

.jlan-contract-dropzone.is-dragging,
.jlan-contract-dropzone.is-loading {
    border-color: var(--jlan-primary, #12315f);
    background: #f3f7ff;
}

.jlan-contract-dropzone.is-loading {
    opacity: .72;
}

.jlan-contract-import-modal {
    max-width: 620px;
}

.jlan-contract-import-modal .jlan-contract-dropzone {
    margin-top: 18px;
    min-height: 170px;
    place-items: center;
    text-align: center;
}

.jlan-import-result {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e1e7f0;
}

.jlan-import-result h2 {
    margin: 0 0 12px;
}

.jlan-import-result dl {
    display: grid;
    grid-template-columns: minmax(140px, .7fr) 1fr;
    gap: 8px 14px;
    margin: 0 0 16px;
}

.jlan-import-result span {
    color: #627086;
}

.jlan-import-result strong {
    text-align: right;
}

.jlan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--jlan-primary, #12315f);
    border-radius: 8px;
    background: var(--jlan-primary, #12315f);
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
}

.jlan-button:hover {
    filter: brightness(.96);
}

.jlan-button-ghost {
    background: #fff;
    color: var(--jlan-primary, #12315f);
}

.jlan-button-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.jlan-button-danger {
    border-color: #b42318;
    background: #b42318;
    color: #fff;
}

.jlan-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.jlan-stat {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(20, 32, 51, .04);
}

.jlan-stat[data-dashboard-stat="week_interest_saga_motors"] {
    cursor: pointer;
}

.jlan-stat[data-dashboard-stat="week_interest_saga_motors"]:hover {
    border-color: var(--jlan-primary, #12315f);
    box-shadow: 0 12px 28px rgba(18, 49, 95, .10);
}

.jlan-stat.is-loading {
    opacity: .7;
    pointer-events: none;
}

.jlan-stat span {
    display: block;
    color: #627086;
    font-size: 13px;
    margin-bottom: 8px;
}

.jlan-stat strong {
    font-size: 25px;
    letter-spacing: 0;
}

.jlan-panel {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(20, 32, 51, .04);
}

.jlan-panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.jlan-grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr);
    gap: 18px;
}

.jlan-table-wrap {
    overflow: auto;
}

.jlan-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.jlan-loans-table {
    min-width: 1180px;
}

.jlan-table th {
    text-align: left;
    font-size: 12px;
    color: #627086;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px;
    border-bottom: 1px solid #e1e7ef;
}

.jlan-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
}

.jlan-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.jlan-loans-table th:last-child,
.jlan-loans-table td:last-child,
.jlan-borrowers-table th:last-child,
.jlan-borrowers-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: -10px 0 14px rgba(255, 255, 255, .88);
}

.jlan-loans-table th:last-child,
.jlan-borrowers-table th:last-child {
    z-index: 2;
}

.jlan-borrowers-table th:last-child,
.jlan-borrowers-table td:last-child {
    min-width: 146px;
}

.jlan-table tr.is-hidden {
    display: none;
}

.jlan-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
    background: #e8eef7;
    color: #2b3b54;
}

.jlan-status-paid,
.jlan-status-sent,
.jlan-status-active {
    background: #dff6ec;
    color: #0d6848;
}

.jlan-status-upcoming {
    background: #e1efff;
    color: #155da8;
}

.jlan-status-overdue {
    background: #ffe3e3;
    color: #b42318;
}

.jlan-status-partial {
    background: #fff3cd;
    color: #8a5a00;
}

.jlan-status-draft {
    background: #f0e6ff;
    color: #6941c6;
}

.jlan-status-closed {
    background: #e8eef7;
    color: #475467;
}

.jlan-status-trash {
    background: #fee2e2;
    color: #991b1b;
}

.jlan-status-pending {
    background: #f0e6ff;
    color: #6941c6;
}

.jlan-status-rejected,
.jlan-status-failed {
    background: #ffe3e3;
    color: #b42318;
}

.jlan-status-unknown {
    background: #fff3cd;
    color: #8a5a00;
}

.jlan-cell-note {
    display: block;
    margin-top: 3px;
    color: #627086;
    font-size: 12px;
}

.jlan-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.jlan-confidence {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.jlan-confidence-high {
    background: #dff6ec;
    color: #0d6848;
}

.jlan-confidence-medium {
    background: #fff3cd;
    color: #8a5a00;
}

.jlan-confidence-low {
    background: #ffe3e3;
    color: #b42318;
}

.jlan-form {
    display: grid;
    gap: 20px;
}

.jlan-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.jlan-fields label {
    display: grid;
    gap: 7px;
    color: #35445b;
    font-weight: 700;
    font-size: 13px;
}

.jlan-wide {
    grid-column: 1 / -1;
}

.jlan-vehicle-list {
    border: 1px solid #d7dfea;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
    display: grid;
    gap: 12px;
}

.jlan-vehicle-list-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #5b6b84;
    font-size: 13px;
}

.jlan-vehicle-list-head strong {
    color: #172033;
}

.jlan-vehicle-progress {
    display: grid;
    gap: 6px;
}

.jlan-vehicle-progress span {
    color: #172033;
    font-size: 12px;
    font-weight: 800;
}

.jlan-vehicle-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe5f0;
}

.jlan-vehicle-progress-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--jlan-secondary, #0f766e);
    transition: width .18s ease;
}

.jlan-vehicle-row {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(220px, .8fr) minmax(220px, .7fr);
    gap: 12px;
}

.jlan-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
}

.jlan-step span {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--jlan-secondary, #0f766e);
    color: #fff;
    font-weight: 800;
}

.jlan-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #edf1f6;
    padding-top: 16px;
}

.jlan-warning {
    border: 1px solid #facc15;
    border-radius: 8px;
    background: #fffbeb;
    color: #713f12;
    padding: 12px;
    font-weight: 650;
}

.jlan-checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.jlan-filterbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.jlan-filterbar select {
    max-width: 220px;
}

.jlan-schedule-preview {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.jlan-schedule-preview table {
    width: 100%;
    border-collapse: collapse;
}

.jlan-schedule-preview th,
.jlan-schedule-preview td {
    padding: 7px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.jlan-empty {
    color: #627086;
}

.jlan-empty strong {
    color: #162033;
    display: block;
    margin-bottom: 4px;
}

.jlan-report-preview {
    margin-top: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    padding: 18px;
    overflow-x: auto;
}

.jlan-report-preview h1 {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.1;
}

.jlan-report-preview .meta {
    color: #627086;
    margin: 0 0 16px;
    font-size: 14px;
}

.jlan-report-preview .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.jlan-report-preview .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #1f3b6d;
    color: #1f3b6d;
    text-decoration: none;
    font-weight: 700;
    background: #fff;
}

.jlan-report-preview .btn.primary {
    background: #1f3b6d;
    color: #fff;
}

.jlan-report-preview table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.jlan-report-preview th,
.jlan-report-preview td {
    border: 1px solid #dbe3ef;
    padding: 9px 10px;
    vertical-align: top;
    font-size: 13px;
}

.jlan-report-preview th {
    background: #f8fafc;
    text-align: left;
    font-size: 12px;
    color: #475569;
}

.jlan-report-preview .num {
    text-align: right;
    white-space: nowrap;
}

.jlan-report-preview tfoot th,
.jlan-report-preview tfoot td {
    background: #f8fafc;
    font-weight: 700;
}

.jlan-activity {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.jlan-activity li {
    display: grid;
    gap: 3px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f6;
}

.jlan-activity span,
.jlan-activity time {
    color: #627086;
    font-size: 13px;
}

.jlan-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(145deg, #f6f8fb, #e8eef6);
}

.jlan-login-card {
    width: min(430px, 100%);
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 18px 50px rgba(20, 32, 51, .12);
}

.jlan-login-card h1 {
    margin: 16px 0 0;
}

.jlan-login-card form {
    margin-top: 22px;
}

.jlan-login-card label {
    font-weight: 700;
}

.jlan-login-card input[type="text"],
.jlan-login-card input[type="password"] {
    width: 100%;
    border: 1px solid #d7dfea;
    border-radius: 8px;
    padding: 11px 12px;
    margin-top: 6px;
}

.jlan-login-card .login-submit input {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--jlan-primary, #12315f);
    color: #fff;
    font-weight: 800;
}

.jlan-forgot {
    color: var(--jlan-primary, #12315f);
}

.jlan-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    z-index: 50;
}

.jlan-modal.is-open {
    display: flex;
}

.jlan-modal-card {
    background: #fff;
    border-radius: 8px;
    width: min(980px, 100%);
    max-height: 88vh;
    overflow: auto;
    padding: 22px;
}

.jlan-interest-detail-modal {
    width: min(860px, 100%);
}

.jlan-signature-status-modal {
    width: min(760px, 100%);
}

.jlan-interest-total {
    border: 1px solid #d7e3f3;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 190px;
    text-align: right;
    background: #f8fbff;
}

.jlan-interest-total span {
    display: block;
    color: #627086;
    font-size: 12px;
    margin-bottom: 4px;
}

.jlan-interest-total strong {
    font-size: 22px;
}

.jlan-interest-detail-table td span {
    display: block;
    margin-top: 4px;
    color: #627086;
    font-size: 12px;
}

.jlan-interest-detail-table tfoot th {
    border-top: 2px solid #d7e3f3;
    font-size: 15px;
}

.jlan-signature-status-table td span {
    display: block;
    margin-top: 4px;
    color: #627086;
    font-size: 12px;
}

.jlan-signature-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 850;
}

.jlan-signature-pill.is-signed {
    background: #dff8ec;
    color: #0f6b4f;
}

.jlan-signature-pill.is-pending {
    background: #fff2d7;
    color: #8a5a00;
}

.jlan-money-cell {
    text-align: right;
    white-space: nowrap;
    font-weight: 850;
}

.jlan-contract-recipient-modal label {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    color: #31415a;
    font-size: 13px;
    font-weight: 800;
}

.jlan-contract-recipient-modal select,
.jlan-contract-recipient-modal input[type="email"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cfd9e6;
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.jlan-recipient-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
}

.jlan-loan-detail-modal {
    width: min(1180px, 100%);
}

.jlan-principal-payment-modal {
    width: min(720px, 100%);
}

.jlan-due-alert-card {
    width: min(760px, 100%);
}

.jlan-loan-payment-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.jlan-loan-payment-columns h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.jlan-payment-list {
    display: grid;
    gap: 12px;
}

.jlan-dashboard-payments {
    display: grid;
    gap: 10px;
}

.jlan-dashboard-payments .jlan-payment-card {
    box-shadow: none;
}

.jlan-payment-card {
    border: 1px solid #e1e7ef;
    border-left: 5px solid #94a3b8;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.jlan-payment-card-paid {
    border-left-color: #16a34a;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.jlan-payment-card-partial,
.jlan-payment-card-upcoming {
    border-left-color: #2563eb;
}

.jlan-payment-card-overdue {
    border-left-color: #dc2626;
}

.jlan-payment-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.jlan-payment-amount {
    margin: 10px 0;
    font-size: 22px;
    font-weight: 850;
}

.jlan-payment-card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 0;
}

.jlan-payment-card dl span {
    color: #627086;
    font-size: 12px;
}

.jlan-payment-card dl strong {
    text-align: right;
}

.jlan-payment-card p {
    margin: 10px 0 0;
    color: #627086;
    font-size: 13px;
}

.jlan-payment-card-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
}

.jlan-payment-date-field {
    display: grid;
    gap: 4px;
    margin-right: auto;
    color: #627086;
    font-size: 12px;
    font-weight: 700;
}

.jlan-payment-date-field input {
    min-height: 38px;
    border: 1px solid #cbd6e6;
    border-radius: 6px;
    padding: 7px 10px;
    color: #172033;
    font: inherit;
}

.jlan-receipt-actions {
    border: 1px solid #d7e3f3;
    border-radius: 8px;
    background: #f8fbff;
    padding: 16px;
    margin-bottom: 18px;
}

.jlan-receipt-preview h2 {
    margin: 0 0 4px;
}

.jlan-receipt-preview p {
    margin: 0 0 12px;
    color: #627086;
}

.jlan-receipt-preview dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 0;
}

.jlan-receipt-preview span {
    color: #627086;
}

.jlan-receipt-preview strong {
    text-align: right;
}

.jlan-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: #152033;
    color: #fff;
    padding: 13px 16px;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(20, 32, 51, .22);
    z-index: 60;
}

.jlan-hidden-file {
    display: none;
}

@media (max-width: 1100px) {
    .jlan-app {
        grid-template-columns: 84px 1fr;
    }

    .jlan-brand strong,
    .jlan-nav a {
        font-size: 0;
    }

    .jlan-nav a span {
        font-size: 16px;
    }

    .jlan-stats,
    .jlan-grid-two,
    .jlan-fields,
    .jlan-loan-payment-columns {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .jlan-app {
        display: block;
    }

    .jlan-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .18s ease;
        z-index: 20;
    }

    .jlan-sidebar.is-open {
        transform: translateX(0);
    }

    .jlan-brand strong,
    .jlan-nav a {
        font-size: 14px;
    }

    .jlan-topbar {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 12px;
    }

    .jlan-topbar-actions {
        width: 100%;
        overflow-x: auto;
    }

    .jlan-content {
        padding: 16px;
    }

    .jlan-page-head,
    .jlan-form-actions {
        display: grid;
    }

    .jlan-stats,
    .jlan-grid-two,
    .jlan-fields,
    .jlan-vehicle-row,
    .jlan-loan-payment-columns {
        grid-template-columns: 1fr;
    }

    .jlan-table {
        min-width: 720px;
    }
}

.jlan-control-room {
    --room-ink: #162338;
    --room-muted: #718096;
    --room-paper: #f4f1eb;
    --room-card: #fffdfa;
    --room-line: #e7e1d7;
    --room-navy: #10223d;
    --room-teal: #2e8f85;
    --room-teal-soft: #dceee9;
    --room-amber: #d59b49;
    --room-red: #c96757;
    --room-red-soft: #f8e4df;
    color: var(--room-ink);
}

.jlan-control-top,
.jlan-section-head,
.jlan-table-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.jlan-control-eyebrow {
    color: var(--room-teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.jlan-control-top h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.02;
    color: #172943;
}

.jlan-control-top p,
.jlan-control-hero p,
.jlan-table-top p {
    color: var(--room-muted);
    margin: 8px 0 0;
}

.jlan-period-pill {
    align-self: center;
    border: 1px solid var(--room-line);
    border-radius: 999px;
    padding: 9px 12px;
    color: #516072;
    background: var(--room-card);
    font-size: 12px;
    font-weight: 700;
}

.jlan-period-tabs {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    width: fit-content;
    margin: 20px 0 22px;
    padding: 5px;
    border: 1px solid #ded8ce;
    border-radius: 10px;
    background: #ebe7df;
}

.jlan-period-tabs a {
    color: #60708a;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 7px;
    font-size: 14px;
}

.jlan-period-tabs form {
    display: flex;
    gap: 4px;
    align-items: center;
}

.jlan-period-tabs input,
.jlan-period-tabs button,
.jlan-page-actions select {
    border: 0;
    border-radius: 7px;
    background: #fff;
    color: #60708a;
    padding: 9px 10px;
    font: inherit;
}

.jlan-period-tabs button {
    cursor: pointer;
    font-weight: 800;
}

.jlan-period-tabs a.is-active {
    color: var(--room-ink);
    background: var(--room-card);
    box-shadow: 0 2px 8px rgba(30, 40, 50, .07);
    font-weight: 800;
}

.jlan-period-tabs span {
    color: #8190a3;
    font-size: 11px;
    padding: 0 8px;
}

.jlan-control-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .8fr);
    gap: 24px;
    margin-top: 20px;
    margin-bottom: 18px;
    padding: 26px 28px;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(110deg, #142a49 0%, #1a3a5a 54%, #226a6c 100%);
    box-shadow: 0 18px 45px rgba(16, 34, 61, .18);
}

.jlan-control-hero h2 {
    margin: 0;
    max-width: 620px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.06;
}

.jlan-control-hero p {
    max-width: 620px;
    color: #bdd0df;
}

.jlan-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 16px;
}

.jlan-hero-stats div {
    border-left: 1px solid rgba(255, 255, 255, .22);
    padding-left: 16px;
}

.jlan-hero-stats strong {
    display: block;
    color: #fff;
    font-size: 30px;
    line-height: 1;
}

.jlan-hero-stats span {
    display: block;
    margin-top: 7px;
    color: #b3c9d9;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.jlan-portfolio-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 4px;
}

.jlan-portfolio-metrics div,
.jlan-account-card,
.jlan-control-room .jlan-panel {
    border: 1px solid var(--room-line);
    background: var(--room-card);
    box-shadow: 0 14px 40px rgba(26, 35, 52, .08);
}

.jlan-portfolio-metrics div {
    border-radius: 12px;
    min-height: 110px;
    padding: 18px;
}

.jlan-portfolio-metrics span {
    display: block;
    color: #87909b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.jlan-portfolio-metrics strong {
    display: block;
    margin-top: 10px;
    color: #172943;
    font-size: 28px;
    line-height: 1.05;
}

.jlan-portfolio-metrics small {
    display: block;
    margin-top: 7px;
    color: #8f9aab;
}

.jlan-section-head {
    margin: 28px 0 12px;
    align-items: baseline;
}

.jlan-section-head.compact {
    margin: 0 0 13px;
}

.jlan-section-head h2,
.jlan-table-top h2 {
    margin: 0;
    color: #1a2c45;
    font-size: 22px;
}

.jlan-section-head span {
    color: var(--room-muted);
    font-size: 12px;
}

.jlan-account-exposure {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.jlan-account-card {
    display: grid;
    gap: 14px;
    width: 100%;
    border-radius: 10px;
    padding: 17px;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.jlan-account-card:hover,
.jlan-account-card.is-selected {
    border-color: var(--room-teal);
    outline: 2px solid rgba(46, 143, 133, .18);
}

.jlan-account-top,
.jlan-account-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.jlan-account-top strong,
.jlan-account-top small,
.jlan-account-foot span {
    display: block;
}

.jlan-account-top small {
    margin-top: 4px;
    color: #8b95a1;
    font-size: 11px;
}

.jlan-account-top em {
    font-style: normal;
    color: #1a2d45;
    font-size: 21px;
    font-weight: 800;
    white-space: nowrap;
}

.jlan-exposure-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf0ef;
}

.jlan-exposure-bar i {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: var(--room-teal);
}

.jlan-account-interest {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-top: -2px;
    color: #7f8b9a;
    font-size: 11px;
}

.jlan-account-metrics {
    display: grid;
    gap: 6px;
}

.jlan-account-interest strong {
    color: #243955;
    font-size: 13px;
    white-space: nowrap;
}

.jlan-account-total {
    padding-top: 7px;
    border-top: 1px solid #e3e8ee;
    color: #1a2d45;
    font-weight: 700;
}

.jlan-account-total strong {
    font-size: 15px;
}

.jlan-account-foot {
    color: #778391;
    font-size: 11px;
}

.jlan-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr);
    gap: 16px;
    margin-top: 18px;
}

.jlan-cashflow-panel,
.jlan-attention-panel {
    min-height: 312px;
}

.jlan-cashflow-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.jlan-cashflow-head h2 {
    margin: 0;
    color: #1a2c45;
    font-size: 20px;
}

.jlan-cashflow-head p {
    margin: 5px 0 0;
    color: #7b8798;
    font-size: 12px;
}

.jlan-cashflow-legend {
    display: flex;
    gap: 16px;
    color: #758294;
    font-size: 11px;
}

.jlan-cashflow-legend span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 7px;
    background: #d7dce2;
}

.jlan-cashflow-legend .collected::before {
    background: var(--room-teal);
}

.jlan-cashflow-tabs {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.jlan-cashflow-tabs a {
    border: 1px solid #e5e0d7;
    border-radius: 7px;
    padding: 7px 10px;
    color: #617087;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.jlan-cashflow-tabs a.is-active {
    background: var(--room-teal);
    border-color: var(--room-teal);
    color: #fff;
}

.jlan-cashflow-chart {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    margin-top: 16px;
    padding: 0 4px 25px;
    border-bottom: 1px solid #e4e1db;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 46px, rgba(225, 222, 214, .55) 47px);
}

.jlan-cashflow-month {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.jlan-cashflow-month i {
    display: block;
    width: 13px;
    min-height: 3px;
    border-radius: 4px 4px 0 0;
    background: #d9dfdf;
}

.jlan-cashflow-month i.collected {
    background: var(--room-teal);
}

.jlan-cashflow-month label {
    position: absolute;
    bottom: -23px;
    color: #8d96a1;
    font-size: 10px;
}

.jlan-cashflow-note {
    margin: 14px 0 0;
    color: #8b95a1;
    font-size: 11px;
}

.jlan-cashflow-breakdown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.jlan-cashflow-breakdown span {
    border: 1px solid #e5e0d7;
    border-radius: 8px;
    padding: 9px 10px;
    color: #7f8b9a;
    font-size: 11px;
}

.jlan-cashflow-breakdown strong {
    display: block;
    margin-top: 3px;
    color: #243955;
    font-size: 13px;
}

.jlan-cashflow-note strong {
    color: #42536a;
}

.jlan-attention-list {
    display: grid;
    gap: 10px;
}

.jlan-attention-list article {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #eee7dc;
    border-radius: 9px;
    padding: 12px 10px;
}

.jlan-attention-list b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--room-red-soft);
    color: var(--room-red);
}

.jlan-attention-list strong,
.jlan-attention-list small,
.jlan-attention-list em {
    display: block;
}

.jlan-attention-list small {
    margin-top: 3px;
    color: #8d96a1;
    font-size: 11px;
}

.jlan-attention-list em {
    font-style: normal;
    font-weight: 800;
    color: #344961;
    text-align: right;
}

.jlan-reconcile-panel dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.jlan-reconcile-panel dt {
    color: #243955;
    font-weight: 800;
}

.jlan-reconcile-panel dd {
    margin: -5px 0 7px;
    color: #7a8592;
    font-size: 12px;
}

.jlan-loanbook-panel {
    margin-top: 16px;
    padding: 0;
    overflow: hidden;
}

.jlan-table-top {
    padding: 18px;
    align-items: center;
}

.jlan-table-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.jlan-table-tools input,
.jlan-table-tools select {
    border: 1px solid #ddd8d0;
    border-radius: 7px;
    background: #fffdfa;
    padding: 9px 10px;
    color: #59697d;
}

.jlan-control-loanbook th[data-sort] {
    cursor: pointer;
}

.jlan-control-loanbook td small {
    display: block;
    margin-top: 4px;
    color: #8a95a1;
}

.jlan-control-room .jlan-status {
    white-space: nowrap;
}

.jlan-control-status-overdue {
    background: var(--room-red-soft);
    color: #b55749;
}

.jlan-control-status-due-soon {
    background: #fff2db;
    color: #a9782f;
}

.jlan-control-status-on-track,
.jlan-control-status-paid {
    background: var(--room-teal-soft);
    color: #2e8278;
}

.jlan-control-status-missing-agreement {
    background: #edf2ff;
    color: #315b9c;
}

.jlan-account-detail-modal,
.jlan-loan-detail-modal {
    width: min(1180px, calc(100vw - 32px));
}

.jlan-detail-section {
    margin-top: 18px;
}

.jlan-detail-section h2 {
    margin: 0 0 10px;
    color: #1a2c45;
    font-size: 18px;
}

.jlan-detail-list {
    display: grid;
    gap: 9px;
}

.jlan-detail-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #e5e0d7;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fffdfa;
}

.jlan-detail-list strong,
.jlan-detail-list small,
.jlan-detail-list em {
    display: block;
}

.jlan-detail-list small {
    margin-top: 3px;
    color: #8490a0;
    font-size: 11px;
}

.jlan-detail-list em {
    color: #243955;
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.jlan-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.jlan-mini-grid span,
.jlan-mini-grid strong {
    display: block;
    border: 1px solid #e5e0d7;
    background: #fffdfa;
    padding: 10px 12px;
}

.jlan-mini-grid span {
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    color: #7f8b9a;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.jlan-mini-grid strong {
    margin-top: -10px;
    border-radius: 0 0 8px 8px;
    color: #1a2c45;
}

.jlan-warning-list {
    margin: 12px 0 0;
    padding-left: 20px;
    color: #7a4c24;
}

.jlan-warning-list li {
    margin: 4px 0;
}

.jlan-timeline {
    display: grid;
    gap: 8px;
}

.jlan-timeline article {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border-left: 3px solid var(--room-teal);
    background: #fffdfa;
    padding: 10px 12px;
}

.jlan-timeline time,
.jlan-timeline small {
    color: #8490a0;
    font-size: 11px;
}

.jlan-timeline strong,
.jlan-timeline em {
    color: #1a2c45;
}

.jlan-timeline em {
    font-style: normal;
    font-weight: 800;
}

[data-control-empty] {
    display: none;
    padding: 18px;
}

@media (max-width: 1180px) {
    .jlan-portfolio-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .jlan-account-exposure,
    .jlan-control-grid,
    .jlan-control-hero,
    .jlan-mini-grid,
    .jlan-cashflow-breakdown {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .jlan-control-top,
    .jlan-section-head,
    .jlan-table-top {
        display: grid;
    }

    .jlan-portfolio-metrics,
    .jlan-account-exposure,
    .jlan-hero-stats {
        grid-template-columns: 1fr;
    }
}
