:root {
    --navy-950: #0a192b;
    --navy-900: #10253f;
    --navy-800: #173653;
    --blue-600: #246bfd;
    --blue-500: #3d7cff;
    --blue-100: #eaf1ff;
    --green-600: #14966c;
    --green-100: #e8f7f1;
    --red-600: #df4b56;
    --red-100: #fff0f1;
    --amber-600: #c67b0a;
    --amber-100: #fff5df;
    --cyan-600: #148da0;
    --cyan-100: #e8f7fa;
    --slate-900: #172331;
    --slate-700: #405064;
    --slate-500: #718096;
    --slate-300: #cad2dc;
    --slate-200: #e4e9ef;
    --slate-100: #f1f4f7;
    --page: #f5f7fa;
    --white: #fff;
    --shadow-sm: 0 2px 10px rgba(25, 43, 67, .05);
    --shadow-md: 0 12px 35px rgba(25, 43, 67, .09);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--slate-900);
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .9rem;
}

a {
    color: var(--blue-600);
    text-decoration: none;
}

.btn {
    --bs-btn-font-weight: 700;
    --bs-btn-border-radius: 10px;
    min-height: 42px;
    padding: .55rem 1rem;
}

.btn-sm {
    min-height: 35px;
    border-radius: 8px;
}

.btn-lg {
    min-height: 50px;
    border-radius: 12px;
    font-size: .95rem;
}

.btn-primary {
    --bs-btn-bg: var(--blue-600);
    --bs-btn-border-color: var(--blue-600);
    --bs-btn-hover-bg: #165ae6;
    --bs-btn-hover-border-color: #165ae6;
    --bs-btn-active-bg: #1253d9;
}

.btn-dark {
    --bs-btn-bg: var(--navy-900);
    --bs-btn-border-color: var(--navy-900);
}

.btn-light {
    --bs-btn-bg: var(--slate-100);
    --bs-btn-border-color: var(--slate-100);
    --bs-btn-color: var(--slate-700);
}

.btn-soft-primary {
    background: var(--blue-100);
    color: var(--blue-600);
    border: 0;
}

.btn-icon {
    width: 42px;
    padding: 0;
    border: 1px solid var(--slate-200);
    background: var(--white);
    font-size: 1.4rem;
}

.form-label {
    margin-bottom: .45rem;
    color: var(--slate-700);
    font-size: .78rem;
    font-weight: 700;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 44px;
    border-color: var(--slate-200);
    border-radius: 9px;
    color: var(--slate-900);
    font-size: .88rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 .2rem rgba(36, 107, 253, .12);
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0 9px 9px 0;
}

.input-group > .form-control:first-child {
    border-radius: 9px 0 0 9px;
}

.input-group-text {
    background: var(--slate-100);
    color: var(--slate-700);
    font-weight: 700;
}

.form-text {
    color: var(--slate-500);
    font-size: .72rem;
}

.eyebrow {
    color: var(--blue-600);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 256px;
    background:
        radial-gradient(circle at 15% 0, rgba(61, 124, 255, .18), transparent 28%),
        var(--navy-950);
    color: var(--white);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    padding: 24px 18px 18px;
}

.brand,
.auth-brand,
.installer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
}

.brand {
    padding: 4px 8px 30px;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--blue-600);
    color: var(--white);
    box-shadow: 0 7px 18px rgba(36, 107, 253, .3);
    font-size: 1.25rem;
}

.brand strong,
.auth-brand strong,
.installer-brand strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.1;
}

.brand small,
.auth-brand small,
.installer-brand small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .5);
    font-size: .54rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-caption {
    margin: 0 12px 6px;
    color: rgba(255, 255, 255, .35);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 47px;
    padding: 0 13px;
    border-radius: 11px;
    color: rgba(255, 255, 255, .68);
    font-weight: 600;
    transition: .18s ease;
}

.sidebar-link i {
    width: 22px;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--white);
}

.sidebar-link.active {
    background: var(--blue-600);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(36, 107, 253, .24);
}

.sidebar-help {
    display: flex;
    gap: 11px;
    margin-top: auto;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}

.sidebar-help > i {
    color: #73d7b4;
    font-size: 1.2rem;
}

.sidebar-help strong,
.sidebar-help span {
    display: block;
}

.sidebar-help strong {
    margin-bottom: 4px;
    font-size: .72rem;
}

.sidebar-help span {
    color: rgba(255, 255, 255, .45);
    font-size: .62rem;
    line-height: 1.5;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 15px 6px 4px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.avatar {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: var(--white);
    font-size: .68rem;
    font-weight: 800;
}

.user-copy {
    min-width: 0;
    flex: 1;
}

.user-copy strong,
.user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    font-size: .71rem;
}

.user-copy span {
    margin-top: 2px;
    color: rgba(255, 255, 255, .4);
    font-size: .58rem;
}

.sidebar-mobile {
    width: 280px !important;
    background: var(--navy-950);
    color: var(--white);
}

.sidebar-mobile .sidebar-inner {
    min-height: calc(100vh - 72px);
    padding-top: 18px;
}

.main-content {
    width: calc(100% - 256px);
    min-width: 0;
    margin-left: 256px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 88px;
    padding: 16px 34px;
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, .91);
    backdrop-filter: blur(10px);
}

.page-title {
    color: var(--navy-900);
    font-size: 1.35rem;
    font-weight: 800;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    padding: 9px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    color: var(--slate-700);
    font-size: .75rem;
    font-weight: 700;
}

.company-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    min-height: 40px;
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    background: var(--white);
    color: var(--blue-600);
}

.company-switcher select {
    min-width: 0;
    max-width: 205px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--slate-900);
    font-size: .7rem;
    font-weight: 800;
}

.company-switcher.company-fixed strong {
    overflow: hidden;
    color: var(--slate-900);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-switcher + .topbar-date {
    margin-left: 0;
}

.page-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 34px 42px;
}

.app-alert {
    border: 0;
    border-radius: 11px;
    box-shadow: var(--shadow-sm);
}

.dashboard-welcome,
.page-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 23px;
}

.dashboard-welcome > div > p {
    color: var(--slate-500);
    font-weight: 600;
}

.dashboard-welcome h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: 1.45rem;
    font-weight: 800;
}

.page-actions p {
    margin: 0;
    color: var(--slate-500);
    font-weight: 500;
}

.master-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: max-content;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: .63rem;
    font-weight: 800;
}

.master-badge.compact {
    padding: 5px 8px;
    font-size: .56rem;
}

.management-form {
    padding: 0 22px 22px;
}

.metric-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-height: 133px;
    padding: 20px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.metric-card.metric-alert {
    border-color: #f3c7cb;
}

.metric-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    place-items: center;
    border-radius: 11px;
    font-size: 1.15rem;
}

.metric-icon.primary {
    background: var(--blue-100);
    color: var(--blue-600);
}

.metric-icon.info {
    background: var(--cyan-100);
    color: var(--cyan-600);
}

.metric-icon.danger {
    background: var(--red-100);
    color: var(--red-600);
}

.metric-icon.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.metric-icon.success {
    background: var(--green-100);
    color: var(--green-600);
}

.metric-copy {
    min-width: 0;
}

.metric-copy span,
.metric-copy strong,
.metric-copy small {
    display: block;
}

.metric-copy span {
    color: var(--slate-500);
    font-size: .71rem;
    font-weight: 700;
}

.metric-copy strong {
    margin: 7px 0 5px;
    color: var(--navy-900);
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -.025em;
}

.metric-copy small {
    color: var(--slate-500);
    font-size: .64rem;
    line-height: 1.35;
}

.content-card {
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
}

.card-toolbar h3 {
    margin: 0;
    color: var(--navy-900);
    font-size: 1rem;
    font-weight: 800;
}

.period-tabs {
    display: flex;
    gap: 4px;
    padding: 0 22px 12px;
    overflow-x: auto;
}

.period-tabs a {
    flex: 0 0 auto;
    padding: 8px 13px;
    border-radius: 8px;
    color: var(--slate-500);
    font-size: .72rem;
    font-weight: 700;
}

.period-tabs a:hover,
.period-tabs a.active {
    background: var(--navy-900);
    color: var(--white);
}

.date-filter {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 22px 16px;
    padding: 14px;
    border-radius: 10px;
    background: var(--slate-100);
}

.date-filter > div {
    flex: 1;
}

.loan-list {
    border-top: 1px solid var(--slate-200);
}

.loan-row {
    display: grid;
    grid-template-columns: 50px minmax(150px, 1fr) minmax(120px, .7fr) minmax(170px, auto);
    align-items: center;
    gap: 16px;
    min-height: 81px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--slate-100);
    color: inherit;
    transition: .16s ease;
}

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

.loan-row:hover {
    background: #fafbfd;
}

.date-tile {
    display: grid;
    width: 46px;
    height: 52px;
    place-content: center;
    border-radius: 10px;
    text-align: center;
}

.date-tile strong,
.date-tile span {
    display: block;
}

.date-tile strong {
    font-size: 1.1rem;
    line-height: 1;
}

.date-tile span {
    margin-top: 4px;
    font-size: .53rem;
    font-weight: 800;
}

.date-tile.success {
    background: var(--green-100);
    color: var(--green-600);
}

.date-tile.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.date-tile.danger {
    background: var(--red-100);
    color: var(--red-600);
}

.loan-row-client strong,
.loan-row-client span,
.loan-row-value strong,
.loan-row-value span {
    display: block;
}

.loan-row-client strong,
.loan-row-value strong {
    color: var(--slate-900);
    font-size: .8rem;
    font-weight: 800;
}

.loan-row-client span,
.loan-row-value span {
    margin-top: 4px;
    color: var(--slate-500);
    font-size: .64rem;
}

.loan-row-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.loan-row-status > i {
    color: var(--slate-300);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: max-content;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .63rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge.success {
    background: var(--green-100);
    color: var(--green-600);
}

.status-badge.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.status-badge.danger {
    background: var(--red-100);
    color: var(--red-600);
}

.status-badge.secondary {
    background: var(--slate-100);
    color: var(--slate-500);
}

.activity-list {
    padding: 0 22px 10px;
}

.activity-item {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid var(--slate-100);
    color: inherit;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-icon,
.transaction-icon {
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.activity-icon {
    width: 36px;
    height: 36px;
    font-size: .88rem;
}

.activity-icon.info,
.transaction-icon.info {
    background: var(--cyan-100);
    color: var(--cyan-600);
}

.activity-icon.success,
.transaction-icon.success {
    background: var(--green-100);
    color: var(--green-600);
}

.activity-icon.warning,
.transaction-icon.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.activity-icon.primary,
.transaction-icon.primary {
    background: var(--blue-100);
    color: var(--blue-600);
}

.activity-icon.secondary,
.transaction-icon.secondary {
    background: var(--slate-100);
    color: var(--slate-500);
}

.activity-copy {
    min-width: 0;
}

.activity-copy strong,
.activity-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-copy strong {
    color: var(--slate-900);
    font-size: .71rem;
}

.activity-copy small {
    margin-top: 3px;
    color: var(--slate-500);
    font-size: .59rem;
}

.activity-value {
    color: var(--slate-700);
    font-size: .68rem;
}

.empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 55px 20px;
    text-align: center;
}

.empty-state.compact {
    padding: 36px 20px;
}

.empty-state > span {
    display: grid;
    width: 53px;
    height: 53px;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 50%;
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: 1.35rem;
}

.empty-state h4 {
    margin: 0 0 6px;
    color: var(--navy-900);
    font-size: .9rem;
    font-weight: 800;
}

.empty-state p {
    max-width: 330px;
    margin: 0 0 15px;
    color: var(--slate-500);
    font-size: .72rem;
}

.list-filters {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 200px auto;
    gap: 10px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--slate-200);
}

.search-control,
.input-icon {
    position: relative;
}

.search-control > i,
.input-icon > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 14px;
    translate: 0 -50%;
    color: var(--slate-500);
}

.search-control .form-control,
.input-icon .form-control {
    padding-left: 39px;
}

.list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 22px;
    background: #fafbfd;
    color: var(--slate-500);
    font-size: .66rem;
}

.list-summary strong {
    color: var(--slate-900);
}

.app-table {
    margin: 0;
}

.app-table thead th {
    padding: 11px 16px;
    border-bottom-color: var(--slate-200);
    background: var(--white);
    color: var(--slate-500);
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table thead th:first-child,
.app-table tbody td:first-child {
    padding-left: 22px;
}

.app-table thead th:last-child,
.app-table tbody td:last-child {
    padding-right: 22px;
}

.app-table tbody td {
    padding: 14px 16px;
    border-bottom-color: var(--slate-100);
    color: var(--slate-700);
    font-size: .72rem;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: #fafbfd;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.client-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: .78rem;
    font-weight: 800;
}

.client-avatar.large {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 14px;
    font-size: 1.15rem;
}

.client-cell strong,
.client-cell small,
.cell-stack strong,
.cell-stack small,
.cell-stack span {
    display: block;
}

.client-cell strong,
.cell-stack strong {
    color: var(--slate-900);
    font-size: .72rem;
}

.client-cell small,
.cell-stack small {
    margin-top: 3px;
    color: var(--slate-500);
    font-size: .6rem;
}

.table-actions {
    display: inline-flex;
    gap: 5px;
}

.sticky-form {
    position: sticky;
    top: 20px;
}

.sticky-form form {
    padding: 0 22px 22px;
}

.loan-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--slate-500);
    font-size: .7rem;
    font-weight: 600;
}

.loan-breadcrumb a {
    color: var(--slate-700);
}

.loan-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 22px 24px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.loan-client-hero {
    display: flex;
    align-items: center;
    gap: 15px;
}

.loan-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.loan-title-line h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: 1.25rem;
    font-weight: 800;
}

.loan-client-hero p {
    margin: 4px 0 7px;
    color: var(--slate-500);
    font-size: .68rem;
}

.client-quick-links {
    display: flex;
    gap: 14px;
    color: var(--slate-700);
    font-size: .65rem;
    font-weight: 700;
}

.client-quick-links a {
    color: var(--green-600);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 22px 22px;
}

.loan-action-card {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 82px;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 11px;
    background: var(--white);
    color: var(--slate-900);
    text-align: left;
    transition: .18s ease;
}

.loan-action-card:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-md);
    translate: 0 -2px;
}

.loan-action-card .action-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    font-size: 1rem;
}

.loan-action-card.info .action-icon {
    background: var(--cyan-100);
    color: var(--cyan-600);
}

.loan-action-card.success .action-icon {
    background: var(--green-100);
    color: var(--green-600);
}

.loan-action-card.warning .action-icon {
    background: var(--amber-100);
    color: var(--amber-600);
}

.loan-action-card.dark .action-icon {
    background: var(--navy-900);
    color: var(--white);
}

.loan-action-card strong,
.loan-action-card small {
    display: block;
}

.loan-action-card strong {
    margin-bottom: 3px;
    font-size: .72rem;
}

.loan-action-card small {
    color: var(--slate-500);
    font-size: .57rem;
    line-height: 1.4;
}

.loan-action-card > i {
    color: var(--slate-300);
}

.paid-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border: 1px solid #c4eadc;
    border-radius: 14px;
    background: var(--green-100);
    color: var(--green-600);
}

.paid-banner > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--green-600);
    color: var(--white);
    font-size: 1.2rem;
}

.paid-banner strong {
    font-size: .82rem;
}

.paid-banner p {
    margin: 3px 0 0;
    font-size: .68rem;
}

.record-count {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: .61rem;
    font-weight: 700;
}

.transaction-timeline {
    padding: 0 22px 8px;
}

.transaction-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 13px;
    padding: 16px 0;
    border-top: 1px solid var(--slate-100);
}

.transaction-icon {
    width: 40px;
    height: 40px;
}

.transaction-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.transaction-heading > div > strong,
.transaction-heading > div > span {
    display: block;
}

.transaction-heading > div > strong {
    color: var(--slate-900);
    font-size: .75rem;
}

.transaction-heading > div > span {
    margin-top: 3px;
    color: var(--slate-500);
    font-size: .58rem;
}

.transaction-amount {
    color: var(--green-600);
    font-size: .74rem;
}

.transaction-amount.addition {
    color: var(--amber-600);
}

.transaction-details {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.transaction-details span {
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--slate-100);
    color: var(--slate-700);
    font-size: .58rem;
}

.transaction-note {
    margin: 8px 0 0;
    padding-left: 9px;
    border-left: 2px solid var(--slate-200);
    color: var(--slate-500);
    font-size: .63rem;
}

.transaction-documents {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.transaction-document {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
}

.transaction-document > a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    color: var(--slate-700);
    font-size: .59rem;
    font-weight: 700;
}

.transaction-document > a > i {
    color: var(--blue-600);
    font-size: .84rem;
}

.transaction-document small {
    margin-left: 4px;
    color: var(--slate-500);
    font-size: .54rem;
}

.transaction-document form {
    border-left: 1px solid var(--slate-200);
}

.transaction-document button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--slate-500);
    font-size: .63rem;
}

.transaction-document button:hover {
    background: var(--red-100);
    color: var(--red-600);
}

.details-list {
    margin: 0;
    padding: 0 22px 14px;
}

.details-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 11px 0;
    border-top: 1px solid var(--slate-100);
}

.details-list dt {
    color: var(--slate-500);
    font-size: .65rem;
    font-weight: 600;
}

.details-list dd {
    max-width: 65%;
    margin: 0;
    color: var(--slate-900);
    font-size: .66rem;
    font-weight: 700;
    text-align: right;
}

.contract-notes {
    margin: 0 22px 20px;
    padding: 13px;
    border-radius: 9px;
    background: var(--slate-100);
}

.contract-notes strong {
    font-size: .64rem;
}

.contract-notes p {
    margin: 5px 0 0;
    color: var(--slate-500);
    font-size: .63rem;
    line-height: 1.55;
}

.upload-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px dashed var(--slate-300);
    border-radius: 11px;
    background: #fafbfd;
}

.upload-section.compact-upload {
    gap: 10px;
    padding: 12px;
}

.upload-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-section-heading > span {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-100);
    color: var(--blue-600);
}

.upload-section-heading strong,
.upload-section-heading small {
    display: block;
}

.upload-section-heading strong {
    color: var(--navy-900);
    font-size: .68rem;
}

.upload-section-heading small {
    margin-top: 2px;
    color: var(--slate-500);
    font-size: .56rem;
}

.upload-section input[type="file"] {
    min-height: 40px;
    padding: .38rem .5rem;
    background: var(--white);
    font-size: .67rem;
}

.upload-section input[type="file"]::file-selector-button {
    margin: -.38rem .6rem -.38rem -.5rem;
    padding: .58rem .7rem;
    border: 0;
    border-right: 1px solid var(--slate-200);
    background: var(--slate-100);
    color: var(--slate-700);
    font-weight: 700;
}

.attached-documents {
    padding: 18px 22px 22px;
    border-top: 1px solid var(--slate-200);
}

.attached-documents-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.attached-documents-heading strong {
    color: var(--navy-900);
    font-size: .72rem;
}

.attached-documents-heading span {
    display: grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: .59rem;
    font-weight: 800;
}

.contract-documents {
    padding: 0 22px 15px;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 0;
    border-top: 1px solid var(--slate-100);
}

.document-link {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    gap: 10px;
    color: inherit;
}

.document-file-icon {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: .95rem;
}

.document-link > span:last-child {
    min-width: 0;
}

.document-link strong,
.document-link small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-link strong {
    color: var(--slate-900);
    font-size: .64rem;
}

.document-link small {
    margin-top: 3px;
    color: var(--slate-500);
    font-size: .54rem;
}

.document-delete {
    width: 34px;
    padding: 0;
}

.document-empty {
    padding-top: 18px;
    padding-bottom: 28px;
}

.modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    box-shadow: 0 24px 70px rgba(10, 25, 43, .2);
}

.modal-header,
.modal-footer {
    padding: 18px 22px;
    border-color: var(--slate-200);
}

.modal-body {
    padding: 20px 22px;
}

.modal-title {
    color: var(--navy-900);
    font-size: 1.08rem;
    font-weight: 800;
}

.operation-summary {
    margin-bottom: 18px;
    padding: 15px;
    border-radius: 10px;
}

.operation-summary span,
.operation-summary strong,
.operation-summary small {
    display: block;
}

.operation-summary span {
    font-size: .64rem;
    font-weight: 700;
}

.operation-summary strong {
    margin: 4px 0;
    font-size: 1.3rem;
    font-weight: 800;
}

.operation-summary small {
    font-size: .62rem;
    line-height: 1.45;
}

.operation-summary.info {
    background: var(--cyan-100);
    color: var(--cyan-600);
}

.operation-summary.success {
    background: var(--green-100);
    color: var(--green-600);
}

.operation-summary.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.operation-summary.dark {
    background: var(--navy-900);
    color: var(--white);
}

.operation-summary.dark small {
    color: rgba(255, 255, 255, .6);
}

.calculated-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 17px;
    padding: 12px 0;
    border-block: 1px solid var(--slate-200);
}

.calculated-total span {
    color: var(--slate-500);
    font-size: .7rem;
}

.calculated-total strong {
    color: var(--navy-900);
    font-size: 1rem;
}

.auth-page {
    background: var(--navy-950);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr);
    min-height: 100vh;
}

.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 42px clamp(38px, 6vw, 90px);
    background:
        radial-gradient(circle at 18% 70%, rgba(36, 107, 253, .23), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(20, 150, 108, .12), transparent 24%),
        var(--navy-950);
    color: var(--white);
}

.auth-panel::after {
    position: absolute;
    right: -150px;
    bottom: -150px;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(255, 255, 255, .025), 0 0 0 110px rgba(255, 255, 255, .018);
    content: "";
}

.auth-copy {
    max-width: 510px;
    margin: auto 0;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 22px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    color: #93e2c6;
    font-size: .68rem;
    font-weight: 700;
}

.auth-copy h1 {
    margin-bottom: 20px;
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1.07;
}

.auth-copy p {
    max-width: 460px;
    color: rgba(255, 255, 255, .55);
    font-size: .93rem;
    line-height: 1.75;
}

.auth-feature {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.auth-feature > i {
    color: #79a7ff;
    font-size: 1.35rem;
}

.auth-feature span,
.auth-feature strong {
    display: block;
}

.auth-feature span {
    color: rgba(255, 255, 255, .45);
    font-size: .65rem;
}

.auth-feature strong {
    margin-bottom: 3px;
    color: var(--white);
    font-size: .73rem;
}

.login-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 40px;
    background: #f7f9fb;
}

.login-card {
    width: min(100%, 410px);
}

.login-heading {
    margin-bottom: 28px;
}

.login-heading h2 {
    margin-bottom: 8px;
    color: var(--navy-900);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.login-heading > p:last-child {
    margin: 0;
    color: var(--slate-500);
    font-size: .78rem;
}

.input-icon .password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 6px;
    width: 38px;
    height: 36px;
    translate: 0 -50%;
    border: 0;
    background: transparent;
    color: var(--slate-500);
}

.input-icon .form-control[type="password"],
.input-icon .form-control[type="text"] {
    padding-right: 45px;
}

.mobile-login-icon {
    display: none;
}

.login-security {
    margin: 22px 0 0;
    color: var(--slate-500);
    font-size: .62rem;
    text-align: center;
}

.login-security i {
    margin-right: 5px;
    color: var(--green-600);
}

.installer-page {
    background:
        radial-gradient(circle at 20% 0, rgba(36, 107, 253, .1), transparent 30%),
        var(--page);
}

.installer-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 40px 20px;
}

.installer-card {
    width: min(100%, 680px);
    padding: 32px;
    border: 1px solid var(--slate-200);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.installer-brand {
    margin-bottom: 30px;
    color: var(--navy-900);
}

.installer-brand small {
    color: var(--slate-500);
}

.installer-heading {
    margin-bottom: 25px;
}

.installer-heading h1,
.installation-done h1 {
    color: var(--navy-900);
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.installer-heading > p:last-child,
.installation-done > p {
    color: var(--slate-500);
    font-size: .78rem;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    color: var(--navy-900);
    font-size: .76rem;
    font-weight: 800;
}

.form-section-title span {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: .65rem;
}

.installation-done {
    padding: 25px 0 10px;
    text-align: center;
}

.done-icon {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-600);
    font-size: 2rem;
}

@media (max-width: 1199.98px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sticky-form {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        min-height: 76px;
        padding: 13px 22px;
    }

    .page-content {
        padding: 24px 22px 36px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        display: none;
    }

    .login-panel {
        padding: 28px 20px;
    }

    .mobile-login-icon {
        display: grid;
        width: 48px;
        height: 48px;
        place-items: center;
        margin-bottom: 25px;
        border-radius: 13px;
        background: var(--blue-600);
        color: var(--white);
        box-shadow: 0 10px 24px rgba(36, 107, 253, .2);
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.1rem;
    }

    .page-content {
        padding: 20px 15px 32px;
    }

    .company-switcher {
        max-width: 155px;
        margin-left: auto;
    }

    .company-switcher select {
        max-width: 110px;
    }

    .company-switcher.company-fixed {
        display: none;
    }

    .dashboard-welcome,
    .page-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .dashboard-welcome h2 {
        font-size: 1.25rem;
    }

    .dashboard-welcome .btn,
    .page-actions .btn {
        width: 100%;
    }

    .metric-card {
        min-height: 120px;
    }

    .loan-row {
        grid-template-columns: 46px 1fr auto;
        gap: 11px;
        padding-inline: 15px;
    }

    .loan-row-value {
        display: none;
    }

    .loan-row-status {
        align-items: flex-end;
        flex-direction: column;
        gap: 7px;
    }

    .loan-row-status > i {
        display: none;
    }

    .list-filters {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .list-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding-inline: 16px;
    }

    .app-table thead th:first-child,
    .app-table tbody td:first-child {
        padding-left: 16px;
    }

    .app-table thead th:last-child,
    .app-table tbody td:last-child {
        padding-right: 16px;
    }

    .loan-hero {
        align-items: flex-start;
        padding: 17px;
    }

    .loan-hero > .btn {
        width: 40px;
        min-height: 40px;
        padding: 0;
        font-size: 0;
    }

    .loan-hero > .btn i {
        font-size: 1rem;
    }

    .loan-title-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .loan-title-line h2 {
        font-size: 1.05rem;
    }

    .client-quick-links {
        flex-direction: column;
        gap: 4px;
    }

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

    .date-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .installer-card {
        padding: 24px 18px;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding-inline: 15px;
    }

    .topbar .eyebrow {
        display: none;
    }

    .company-switcher {
        max-width: 118px;
        padding-inline: 7px;
    }

    .company-switcher > i {
        display: none;
    }

    .company-switcher select {
        max-width: 102px;
    }

    .metric-card {
        padding: 17px;
    }

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

    .loan-row-status {
        grid-column: 2;
        align-items: flex-start;
    }

    .date-tile {
        grid-row: span 2;
    }

    .card-toolbar {
        padding-inline: 17px;
    }

    .activity-list,
    .transaction-timeline,
    .details-list {
        padding-inline: 17px;
    }

    .period-tabs {
        padding-inline: 17px;
    }

    .transaction-heading {
        flex-direction: column;
        gap: 7px;
    }

    .loan-client-hero {
        align-items: flex-start;
    }

    .client-avatar.large {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }
}

@media print {
    body {
        background: var(--white);
        font-size: 10pt;
    }

    .sidebar,
    .topbar,
    .d-print-none,
    .loan-breadcrumb,
    .app-alert {
        display: none !important;
    }

    .main-content {
        width: 100%;
        margin: 0;
    }

    .page-content {
        max-width: none;
        padding: 0;
    }

    .content-card,
    .metric-card,
    .loan-hero {
        break-inside: avoid;
        box-shadow: none;
    }
}
