:root {
    /* Keep Bulma in light mode even when the operating system uses dark mode. */
    --bulma-scheme-brightness: light;
    --bulma-scheme-main-l: 100%;
    --bulma-scheme-main-bis-l: 98%;
    --bulma-scheme-main-ter-l: 96%;
    --bulma-background-l: 96%;
    --bulma-border-weak-l: 93%;
    --bulma-border-l: 86%;
    --bulma-text-weak-l: 48%;
    --bulma-text-l: 29%;
    --bulma-text-strong-l: 21%;
    --bulma-scheme-invert-l: 4%;
    --bulma-scheme-main: hsl(221, 14%, 100%);
    --bulma-scheme-main-bis: hsl(221, 14%, 98%);
    --bulma-scheme-main-ter: hsl(221, 14%, 96%);
    --bulma-background: hsl(221, 14%, 96%);
    --bulma-border-weak: hsl(221, 14%, 93%);
    --bulma-border: hsl(221, 14%, 86%);
    --bulma-text-weak: hsl(221, 14%, 48%);
    --bulma-text: hsl(221, 14%, 29%);
    --bulma-text-strong: hsl(221, 14%, 21%);
    --bulma-scheme-invert: hsl(221, 14%, 4%);
    --app-primary: #176b5b;
    --app-primary-dark: #105347;
    --app-primary-soft: #e8f4f1;
    --app-sidebar: #123a35;
    --app-sidebar-muted: #a9c6c0;
    --app-background: #f4f7f6;
    --app-border: #dfe8e5;
    --app-text: #20332f;
    --app-muted: #647a75;
    --app-shadow: 0 16px 45px rgba(20, 54, 48, 0.12);
    --sidebar-width: 16.5rem;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
    background: var(--app-background);
}

body {
    min-height: 100vh;
    color: var(--app-text);
    background: var(--app-background);
}

a {
    color: var(--app-primary);
}

a:hover,
a:focus {
    color: var(--app-primary-dark);
}

[hidden] {
    display: none !important;
}

body.has-open-sidebar {
    overflow: hidden;
}

.button.is-primary,
.button.is-info {
    border-color: var(--app-primary);
    color: #fff;
    background-color: var(--app-primary);
}

.app-main .button {
    height: 2.4em;
    padding-right: 0.85em;
    padding-left: 0.85em;
    font-size: 0.875rem;
}

.app-main .button.is-small {
    height: 2.15em;
    font-size: 0.75rem;
}

.app-main .button .icon {
    font-size: 0.9em;
}

.button.is-filter-action {
    border-color: #29312f;
    color: #fff;
    background: #29312f;
    box-shadow: 0 0.2rem 0.55rem rgba(20, 27, 25, 0.14);
    font-weight: 700;
}

.button.is-filter-action:hover,
.button.is-filter-action:focus {
    border-color: #131817;
    color: #fff;
    background: #131817;
}

.input,
.textarea,
.select select {
    border-color: var(--app-border);
    color: var(--app-text);
    background-color: #fff;
}

.button.is-primary:hover,
.button.is-primary:focus,
.button.is-info:hover,
.button.is-info:focus {
    border-color: var(--app-primary-dark);
    color: #fff;
    background-color: var(--app-primary-dark);
}

.input:focus,
.input:focus-within,
.textarea:focus,
.select select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.125em rgba(23, 107, 91, 0.18);
}

.select:not(.is-multiple):not(.is-loading)::after {
    border-color: var(--app-primary);
}

.checkbox input,
.radio input {
    accent-color: var(--app-primary);
}

.tabs a {
    color: var(--app-muted);
}

.tabs a:hover,
.tabs a:focus {
    border-bottom-color: var(--app-primary);
    color: var(--app-primary);
}

.tabs li.is-active a,
.tabs.is-boxed li.is-active a {
    border-bottom-color: var(--app-primary);
    color: var(--app-primary);
}

.tabs.is-boxed li.is-active a {
    border-color: var(--app-border);
    border-bottom-color: #fff !important;
    background: #fff;
}

.app-content a:not(.button) {
    color: var(--app-primary);
}

.app-content a:not(.button):hover,
.app-content a:not(.button):focus {
    color: var(--app-primary-dark);
}

.app-content .tabs a {
    color: var(--app-muted);
}

.app-content .tabs li.is-active a {
    color: var(--app-primary);
}

.pagination-link.is-current {
    border-color: var(--app-primary);
    color: #fff;
    background: var(--app-primary);
}

.notification.is-info,
.notification.is-info.is-light {
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
}

.notification.is-success,
.notification.is-success.is-light {
    color: var(--app-primary-dark);
    background: #d9f2e9;
}

.table thead th {
    color: var(--app-text);
}

.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
    background: #f7fbfa;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.7rem;
    padding: 0.15rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-badge::before {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.status-badge.is-active {
    border-color: #a8ddcf;
    color: #0b654f;
    background: #daf3eb;
}

.status-badge.is-inactive {
    border-color: #f0b9b9;
    color: #a12626;
    background: #fde8e8;
}

.status-badge.is-closed {
    border-color: #ffa3a3;
    color: #b00909;
    background: #ffd4d4;
}

.status-badge.is-neutral {
    border-color: #ecd39f;
    color: #805b13;
    background: #fff4d6;
}

.button.is-table-action {
    height: 2.2em;
    padding-right: 0.75em;
    padding-left: 0.75em;
    border-color: #b9d9d2;
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
    box-shadow: 0 0.15rem 0.4rem rgba(23, 107, 91, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
}

.button.is-table-action:hover,
.button.is-table-action:focus {
    border-color: var(--app-primary);
    color: #fff;
    background: var(--app-primary);
}

.button.is-table-action .icon {
    font-size: 0.85em;
}

.table-actions-cell {
    white-space: nowrap;
}

.table-actions {
    justify-content: flex-end;
    gap: 0.4rem;
    margin-bottom: 0 !important;
}

.table-actions .button,
.table-actions form {
    margin: 0 !important;
}

.brand-mark {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    color: #fff;
    background: var(--app-primary);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand-name,
.brand-subtitle {
    display: block;
}

.brand-name {
    color: var(--app-text);
    font-weight: 700;
    line-height: 1.25;
}

.brand-subtitle {
    margin-top: 0.15rem;
    color: var(--app-muted);
    font-size: 0.75rem;
    line-height: 1.25;
}

/* Authentication */
.auth-page {
    background:
        radial-gradient(circle at 15% 15%, rgba(23, 107, 91, 0.12), transparent 34rem),
        var(--app-background);
}

.auth-main {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 27rem);
    padding: 2.25rem;
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: var(--app-shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--app-border);
}

.auth-heading {
    margin: 1.75rem 0 1.5rem;
}

.auth-heading .title {
    margin-bottom: 0.4rem;
    color: var(--app-text);
}

.auth-heading p,
.auth-help {
    color: var(--app-muted);
}

.auth-form .field:not(:last-child) {
    margin-bottom: 1.15rem;
}

.auth-form .label {
    color: var(--app-text);
    font-size: 0.88rem;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-options .checkbox {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.auth-options input {
    margin-right: 0.35rem;
    accent-color: var(--app-primary);
}

.auth-submit {
    min-height: 2.75rem;
    font-weight: 700;
}

.auth-help {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Application shell */
.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: #fff;
    background: var(--app-sidebar);
}

.sidebar-brand {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-mark {
    color: var(--app-sidebar);
    background: #fff;
}

.sidebar-brand .brand-name {
    color: #fff;
}

.sidebar-brand .brand-subtitle {
    color: var(--app-sidebar-muted);
}

.sidebar-close {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 1.7rem;
    cursor: pointer;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.9rem;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
    scrollbar-width: thin;
}

.sidebar-menu::-webkit-scrollbar {
    width: 0.4rem;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.28);
}

.sidebar-menu .menu-label {
    margin: 0 0.75rem 0.65rem;
    color: var(--app-sidebar-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.11em;
}

.sidebar-menu .menu-list > li > a,
.sidebar-menu .menu-parent {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.3rem;
    padding: 0.72rem 0.8rem;
    border: 0;
    border-radius: 0.65rem;
    color: #dbe9e6;
    background: transparent;
    font-family: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.sidebar-menu .menu-list > li > a:hover,
.sidebar-menu .menu-list > li > a:focus,
.sidebar-menu .menu-list > li > a.is-active,
.sidebar-menu .menu-parent:hover,
.sidebar-menu .menu-parent:focus,
.sidebar-menu .menu-parent.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.menu-item-label {
    min-width: 0;
    flex: 1;
}

.submenu-chevron {
    color: var(--app-sidebar-muted);
    font-size: 0.65rem;
    transition: transform 160ms ease;
}

.menu-parent[aria-expanded="true"] .submenu-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    margin: 0.15rem 0 0.65rem 2.1rem;
    padding-left: 0.7rem;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-submenu a {
    display: block;
    margin-bottom: 0.12rem;
    padding: 0.48rem 0.7rem;
    border-radius: 0.5rem;
    color: var(--app-sidebar-muted);
    font-size: 0.82rem;
}

.sidebar-submenu a:hover,
.sidebar-submenu a:focus,
.sidebar-submenu a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.menu-mark {
    display: inline-flex;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: #d7ebe7;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.72rem;
    font-weight: 800;
}

.sidebar-menu a.is-active .menu-mark,
.sidebar-menu .menu-parent.is-active .menu-mark {
    color: var(--app-primary-dark);
    background: #fff;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--app-primary-dark);
    background: #fff;
    font-weight: 800;
}

.sidebar-user-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.sidebar-user-details strong,
.sidebar-user-details span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-details strong {
    color: #fff;
    font-size: 0.87rem;
}

.sidebar-user-details span {
    color: var(--app-sidebar-muted);
    font-size: 0.72rem;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 5rem;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.75rem;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.96);
}

.sidebar-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.55rem;
    border: 1px solid var(--app-border);
    border-radius: 0.55rem;
    background: #fff;
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    margin: 0.24rem 0;
    border-radius: 2px;
    background: var(--app-text);
}

.header-title {
    min-width: 0;
    flex: 1;
}

.header-title p:last-child {
    overflow: hidden;
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-eyebrow {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logout-form {
    margin: 0;
}

.app-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.5rem 1.75rem 2.5rem;
}

.app-breadcrumb {
    margin-bottom: 1rem !important;
}

.app-breadcrumb span {
    display: flex;
    align-items: center;
    padding: 0 0.75em;
    color: var(--app-muted);
}

.toast-stack {
    position: fixed;
    z-index: 100;
    top: 5.75rem;
    right: 1rem;
    display: grid;
    width: min(24rem, calc(100vw - 2rem));
    gap: 0.75rem;
    pointer-events: none;
}

.toast-stack:empty {
    display: none;
}

.app-toast {
    margin: 0 !important;
    border: 1px solid currentColor;
    border-radius: 0.75rem;
    box-shadow: var(--app-shadow);
    pointer-events: auto;
    animation: toast-enter 180ms ease-out;
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-panel {
    min-width: 0;
}

.page-panel > .section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
}

.page-panel .container {
    width: 100%;
    max-width: none !important;
}

.data-page-header {
    align-items: center;
    margin-bottom: 1.5rem !important;
}

.data-page-header .title {
    margin-bottom: 0;
}

.data-toolbar {
    margin-bottom: 1.75rem !important;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.04);
}

.data-toolbar .columns {
    align-items: flex-end;
    margin-bottom: 0;
}

.data-toolbar .field:last-child,
.data-toolbar .buttons:last-child {
    margin-bottom: 0;
}

.data-toolbar .label {
    margin-bottom: 0.4rem;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.per-page-control .select,
.per-page-control select {
    min-width: 7rem;
}

@media screen and (min-width: 769px) {
    .data-toolbar .columns {
        display: flex;
        flex-wrap: wrap;
    }
}

.report-actions {
    margin: 0;
}

.report-quick-filters {
    margin: 1rem 0 0 !important;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border);
}

.report-customer-stack {
    display: grid;
    gap: 1.5rem;
    margin-top: 0.25rem;
}

.report-customer-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-customer-summary .summary-card strong a {
    color: inherit;
    text-decoration: none;
}

.report-customer-summary .summary-card strong a:hover,
.report-customer-summary .summary-card strong a:focus-visible {
    color: var(--app-primary);
}

.report-accordion {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.04);
}

.report-accordion__heading {
    margin: 0;
}

.report-accordion__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 1.15rem 1.25rem;
    border: 0;
    background: linear-gradient(180deg, #f7faf8 0%, #fff 100%);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.report-accordion__toggle:hover,
.report-accordion__toggle:focus-visible {
    background: rgba(20, 83, 45, 0.04);
    outline: none;
}

.report-accordion.is-open .report-accordion__toggle {
    border-bottom: 1px solid var(--app-border);
}

.report-accordion__toggle .section-eyebrow {
    display: block;
    margin-bottom: 0.15rem;
}

.report-accordion__title {
    display: block;
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.report-accordion__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.report-accordion__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(20, 83, 45, 0.08);
    color: var(--app-primary);
    transition: transform 0.18s ease;
}

.report-accordion.is-open .report-accordion__chevron {
    transform: rotate(180deg);
}

.report-accordion__panel[hidden] {
    display: none;
}

.report-accordion__table {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.report-empty-state {
    padding: 2.5rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
}

.data-toolbar .buttons {
    margin-bottom: 0;
}

form.is-inline {
    display: inline-block;
    margin: 0;
}

.data-toolbar .label.is-invisible {
    visibility: hidden;
}

.sidebar-overlay {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: none;
    border: 0;
    background: rgba(9, 25, 22, 0.55);
}

.table-container {
    margin-top: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.table-container .table {
    margin-bottom: 0;
    background: transparent;
}

.table-container .table th,
.table-container .table td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.table-container .table thead th {
    border-bottom: 1px solid var(--app-border);
    background: #f7fbfa;
    white-space: nowrap;
}

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

.table-container .table tbody tr:only-child td[colspan] {
    padding: 2rem 1rem;
    color: var(--app-muted);
    text-align: center;
}

.pagination {
    margin-top: 1.25rem;
}

/* Shared create/edit form layout (customers, loans, payments, settings) */
.customer-form-page,
.app-form-page {
    width: 100%;
    max-width: none;
    margin: 0;
}

.form-page-header {
    margin-bottom: 1.25rem;
}

.form-page-header .title {
    margin-bottom: 0.35rem;
}

.form-page-header > p:last-child {
    color: var(--app-muted);
    font-size: 0.7rem;
}

.customer-form-card,
.app-form-card {
    margin-bottom: 0 !important;
    padding: 1.5rem;
    border: 1px solid var(--app-border);
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.04);
}

.customer-form-grid,
.app-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.customer-form-grid .field,
.app-form-grid .field {
    min-width: 0;
    margin-bottom: 0;
}

.customer-form-grid .field.is-full,
.app-form-grid .field.is-full {
    grid-column: 1 / -1;
}

.customer-form-grid .control.has-icons-left .icon,
.app-form-grid .control.has-icons-left .icon {
    color: var(--app-primary);
}

.customer-form-grid .textarea,
.app-form-grid .textarea {
    min-height: 6rem;
    resize: vertical;
}

.customer-form-actions,
.app-form-actions {
    justify-content: flex-end;
    margin: 1.25rem 0 0 !important;
    padding-top: 1.25rem;
    border-top: 1px solid var(--app-border);
}

.app-form-grid .select {
    width: 100%;
}

.app-form-summary {
    margin: 0 !important;
    grid-column: 1 / -1;
}

.customer-combobox {
    position: relative;
}

.customer-combobox .control > .icon {
    color: var(--app-primary);
}

.customer-combobox .control {
    position: relative;
}

.customer-combobox .control .input {
    padding-right: 4.5rem;
}

.customer-picker-toggle {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    display: inline-flex;
    width: 2.5rem;
    height: 100%;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid var(--app-border);
    border-radius: 0 0.375rem 0.375rem 0;
    background: #f7faf8;
    color: var(--app-primary);
    cursor: pointer;
}

.customer-picker-toggle:hover,
.customer-picker-toggle:focus-visible {
    background: var(--app-primary-soft);
    outline: none;
}

.customer-combobox.is-open .customer-picker-toggle i {
    transform: rotate(180deg);
}

.customer-combobox .customer-search-spinner {
    right: 2.6rem !important;
}

.customer-search-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    max-height: 18rem;
    overflow-y: auto;
    border: 1px solid var(--app-border);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: var(--app-shadow);
}

.customer-search-option {
    display: grid;
    width: 100%;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.customer-search-option:last-child {
    border-bottom: 0;
}

.customer-search-option:hover,
.customer-search-option:focus,
.customer-search-option.is-active {
    outline: 0;
    background: var(--app-primary-soft);
}

.customer-search-option strong {
    font-size: 0.9rem;
}

.customer-search-option span {
    color: var(--app-muted);
    font-size: 0.78rem;
}

.customer-search-message {
    padding: 0.9rem;
    color: var(--app-muted);
    font-size: 0.82rem;
}

/* Customer detail */
.customer-detail-page {
    display: grid;
    gap: 1.5rem;
}

.customer-detail-page .button {
    height: 2.45em;
    padding-right: 0.9em;
    padding-left: 0.9em;
    font-size: 0.9rem;
}

.customer-detail-page .button.is-small {
    height: 2.2em;
    font-size: 0.8rem;
}

.customer-detail-page .button .icon {
    font-size: 0.9em;
}

.customer-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.customer-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.customer-avatar {
    display: inline-flex;
    width: 4rem;
    height: 4rem;
    flex: 0 0 4rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.1rem;
    color: #fff;
    background: var(--app-primary);
    font-size: 1.45rem;
    font-weight: 800;
}

.customer-kicker,
.section-eyebrow {
    margin-bottom: 0.2rem;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.customer-identity .title {
    margin-bottom: 0.35rem;
}

.customer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-muted);
}

.customer-meta i {
    width: 1rem;
    color: var(--app-primary);
    text-align: center;
}

.customer-actions {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
}

.customer-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.summary-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.summary-card:hover,
a.summary-card:focus-visible {
    border-color: rgba(23, 107, 91, 0.35);
    box-shadow: 0 0.45rem 1.25rem rgba(20, 54, 48, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.summary-icon {
    display: inline-flex;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.summary-card div {
    display: grid;
    min-width: 0;
}

.summary-card span:not(.summary-icon) {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.summary-card strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 1.15rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-card em {
    color: var(--app-muted);
    font-size: 0.75rem;
    font-style: normal;
}

.summary-card.is-outstanding .summary-icon {
    color: #9a5b12;
    background: #fff3e4;
}

.customer-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.customer-side-panel {
    margin: 0 !important;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.customer-side-empty,
.customer-loans-empty {
    padding: 1.75rem 1rem;
}

.customer-loans-empty .button {
    margin-top: 0.75rem;
}

.customer-payment-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.customer-payment-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--app-border);
}

.customer-payment-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.customer-payment-list li > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.customer-payment-list strong {
    color: var(--app-text);
    font-size: 0.95rem;
}

.customer-payment-list span,
.customer-payment-list time {
    color: var(--app-muted);
    font-size: 0.78rem;
}

.customer-payment-list time {
    flex: 0 0 auto;
    white-space: nowrap;
}

.customer-loan-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.customer-loan-card {
    display: grid;
    gap: 0.9rem;
    padding: 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.customer-loan-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.customer-loan-card__number {
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.customer-loan-card__number:hover,
.customer-loan-card__number:focus-visible {
    color: var(--app-primary);
}

.customer-loan-card__period {
    margin: 0.2rem 0 0;
    color: var(--app-muted);
    font-size: 0.8rem;
}

.customer-loan-card__amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.customer-loan-card__amounts div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.customer-loan-card__amounts span {
    color: var(--app-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.customer-loan-card__amounts strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-loan-card__progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.customer-loan-card__progress .progress {
    margin-bottom: 0;
    height: 0.55rem;
}

.customer-loan-card__actions {
    margin-bottom: 0 !important;
}

/* Dashboard */
.dashboard-page {
    width: 100%;
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-hero .title {
    margin-bottom: 0.35rem;
}

.dashboard-hero__subtitle {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.dashboard-hero__actions {
    margin-bottom: 0 !important;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-kpi {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.85rem;
    padding: 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-kpi:hover,
.dashboard-kpi:focus-visible {
    border-color: rgba(23, 107, 91, 0.35);
    box-shadow: 0 0.45rem 1.25rem rgba(20, 54, 48, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.dashboard-kpi div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.dashboard-kpi span:not(.summary-icon) {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.dashboard-kpi strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 1.2rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-kpi em {
    color: var(--app-muted);
    font-size: 0.75rem;
    font-style: normal;
}

.dashboard-kpi.is-accent {
    border-color: rgba(23, 107, 91, 0.28);
    background: linear-gradient(180deg, #f3faf8 0%, #fff 70%);
}

.dashboard-kpi.is-outstanding .summary-icon {
    color: #9a5b12;
    background: #fff3e4;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.dashboard-metric {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.dashboard-metric:hover,
.dashboard-metric:focus-visible {
    border-color: rgba(23, 107, 91, 0.3);
    outline: none;
}

.dashboard-metric__icon {
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 2.1rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    color: var(--app-primary);
    background: var(--app-primary-soft);
    font-size: 0.85rem;
}

.dashboard-metric div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.dashboard-metric span {
    color: var(--app-muted);
    font-size: 0.72rem;
}

.dashboard-metric strong {
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-panel {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.dashboard-panel .section-heading {
    margin-bottom: 1rem;
}

.dashboard-panel__aside {
    display: grid;
    gap: 0.1rem;
    text-align: right;
}

.dashboard-panel__aside span {
    color: var(--app-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-panel__aside strong {
    color: var(--app-text);
    font-size: 1rem;
}

.dashboard-chart-wrap {
    position: relative;
    height: 16.5rem;
}

.dashboard-empty {
    padding: 2rem 1rem;
}

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

.dashboard-activity li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--app-border);
}

.dashboard-activity li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-activity__main,
.dashboard-activity__side {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.dashboard-activity__side {
    text-align: right;
}

.dashboard-activity__title {
    color: var(--app-text);
    font-weight: 650;
    text-decoration: none;
}

.dashboard-activity__title:hover,
.dashboard-activity__title:focus-visible {
    color: var(--app-primary);
}

.dashboard-activity__meta,
.dashboard-activity__side span {
    color: var(--app-muted);
    font-size: 0.78rem;
}

.dashboard-activity__side strong {
    color: var(--app-text);
    font-size: 0.95rem;
}

.dashboard-shortcuts {
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.dashboard-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-shortcut {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 1rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    background: #f8fbfa;
    color: var(--app-text);
    text-align: center;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-shortcut i {
    color: var(--app-primary);
    font-size: 1.1rem;
}

.dashboard-shortcut:hover,
.dashboard-shortcut:focus-visible {
    border-color: rgba(23, 107, 91, 0.35);
    background: #fff;
    outline: none;
}

.customer-profile-card {
    margin: 0 !important;
    padding: 1.5rem;
    border: 1px solid var(--app-border);
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading .title {
    margin-bottom: 0;
}

.customer-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.profile-item {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.7rem;
    background: #f9fbfa;
}

.profile-item.is-full {
    grid-column: 1 / -1;
}

.profile-item dt {
    margin-bottom: 0.35rem;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.profile-item dt i {
    width: 1rem;
    margin-right: 0.25rem;
    color: var(--app-primary);
    text-align: center;
}

.profile-item dd {
    color: var(--app-text);
    overflow-wrap: anywhere;
}

.customer-loans-section {
    min-width: 0;
    scroll-margin-top: 1.25rem;
}

.loan-customer-groups {
    display: grid;
    gap: 1rem;
}

.loan-customer-group {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.04);
}

.loan-customer-group__heading {
    display: flex;
    align-items: stretch;
    margin: 0;
    border-bottom: 1px solid transparent;
    background: linear-gradient(180deg, #f7faf8 0%, #fff 100%);
}

.loan-customer-group.is-open .loan-customer-group__heading {
    border-bottom-color: var(--app-border);
}

.loan-customer-group__toggle {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 1rem 0.35rem 1rem 1.15rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.loan-customer-group__toggle:hover,
.loan-customer-group__toggle:focus-visible {
    background: rgba(20, 83, 45, 0.04);
    outline: none;
}

.loan-customer-group__identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.loan-customer-group__avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(20, 83, 45, 0.12);
    color: var(--app-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.loan-customer-group__copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.loan-customer-group__name {
    display: block;
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.loan-customer-group__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 400;
}

.loan-customer-group__meta i {
    margin-right: 0.25rem;
}

.loan-customer-group__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
}

.loan-customer-group__stat {
    display: grid;
    gap: 0.1rem;
}

.loan-customer-group__stat > span:first-child {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.loan-customer-group__stat strong {
    color: var(--app-text);
    font-size: 0.95rem;
}

.loan-customer-group__stat small {
    color: var(--app-muted);
    font-weight: 500;
}

.loan-customer-group__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(20, 83, 45, 0.08);
    color: var(--app-primary);
    transition: transform 0.18s ease;
}

.loan-customer-group.is-open .loan-customer-group__chevron {
    transform: rotate(180deg);
}

.loan-customer-group__profile {
    align-self: center;
    flex: 0 0 auto;
    margin: 0 1rem 0 0;
}

.loan-customer-group__panel[hidden] {
    display: none;
}

.loan-customer-group__table {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.loan-customer-group__table .table th,
.loan-customer-group__table .table td {
    padding: 0.75rem 1rem;
}

.loan-customer-group__actions {
    justify-content: flex-end;
    margin-bottom: 0 !important;
}

.loan-history-heading {
    margin-bottom: 0;
}

.table-primary,
.table-secondary {
    display: block;
}

.table-secondary {
    margin-top: 0.15rem;
    color: var(--app-muted);
}

.empty-table-state {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
}

.empty-table-state i {
    margin-bottom: 0.25rem;
    color: var(--app-primary);
    font-size: 1.5rem;
}

.empty-table-state span {
    color: var(--app-muted);
}

.customer-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid #f2c7c3;
    border-radius: 0.85rem;
    background: #fff8f7;
}

.customer-danger-zone .title {
    margin-bottom: 0.25rem;
    color: #9f2d25;
}

.customer-danger-zone p {
    color: #79504d;
}

.customer-danger-zone form {
    flex: 0 0 auto;
}

form.box {
    background: #ffffff1c;
    border-color: #ccc;
}

/* Loan detail */
.loan-detail-page {
    display: grid;
    gap: 1.5rem;
}

.loan-detail-page .button {
    height: 2.45em;
    padding-right: 0.9em;
    padding-left: 0.9em;
    font-size: 0.9rem;
}

.loan-hero {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.loan-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.loan-identity-icon {
    display: inline-flex;
    width: 4rem;
    height: 4rem;
    flex: 0 0 4rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.1rem;
    color: #fff;
    background: var(--app-primary);
    font-size: 1.35rem;
}

.loan-identity-copy {
    min-width: 0;
}

.loan-identity .title {
    margin-bottom: 0.4rem;
    overflow-wrap: anywhere;
}

.loan-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    color: var(--app-muted);
}

.loan-meta > span:not(.tag) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.loan-meta i {
    color: var(--app-primary);
}

.loan-actions {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
}

.loan-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.loan-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.loan-details-card,
.borrower-card {
    margin: 0 !important;
    padding: 1.5rem;
    border: 1px solid var(--app-border);
    box-shadow: 0 0.25rem 1rem rgba(20, 54, 48, 0.035);
}

.repayment-percent {
    color: var(--app-primary);
    font-size: 0.82rem;
}

.repayment-progress {
    height: 0.6rem;
    margin-bottom: 1.25rem !important;
    background: var(--app-primary-soft);
}

.loan-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.borrower-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--app-border);
}

.borrower-avatar {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 3.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    color: #fff;
    background: var(--app-primary);
    font-weight: 800;
}

.borrower-identity > div {
    display: grid;
    min-width: 0;
    gap: 0.25rem;
}

.borrower-identity strong,
.borrower-identity a {
    overflow-wrap: anywhere;
}

.borrower-identity a i {
    margin-right: 0.25rem;
}

.closed-loan-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: #fff;
}

.closed-loan-icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.closed-loan-summary .title {
    margin-bottom: 0.4rem;
}

.loan-payments-section {
    min-width: 0;
}

li ul.sidebar-submenu {
    padding: 0 0 0 15px;
}

li ul.sidebar-submenu li:not(:last-child) {
    border-bottom: 1px dotted #30655e;
}

@media screen and (max-width: 768px) {
    .auth-main {
        align-items: stretch;
        padding: 0;
    }

    .auth-card {
        width: 100%;
        min-height: 100vh;
        padding: 1.5rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand {
        padding-top: 0.5rem;
    }

    .app-sidebar {
        width: min(88vw, var(--sidebar-width));
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .has-open-sidebar .app-sidebar {
        transform: translateX(0);
    }

    .has-open-sidebar .sidebar-overlay {
        display: block;
    }

    .sidebar-close,
    .sidebar-toggle {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .app-header {
        min-height: 4.5rem;
        padding: 0.65rem 1rem;
    }

    .header-eyebrow {
        display: none;
    }

    .app-content {
        padding: 1rem 1rem 2rem;
    }

    .customer-hero,
    .customer-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-actions .button {
        flex: 1 1 auto;
    }

    .customer-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-overview-grid,
    .customer-loan-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid,
    .dashboard-secondary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    .dashboard-shortcut-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-hero__actions {
        width: 100%;
    }

    .dashboard-hero__actions .button {
        flex: 1 1 auto;
    }

    .customer-profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-item.is-full {
        grid-column: auto;
    }

    .customer-danger-zone form .button {
        width: 100%;
    }

    .customer-form-grid,
    .app-form-grid {
        grid-template-columns: 1fr;
    }

    .customer-form-grid .field.is-full,
    .app-form-grid .field.is-full,
    .app-form-summary {
        grid-column: auto;
    }

    .customer-form-actions .button,
    .app-form-actions .button {
        flex: 1 1 auto;
    }

    .loan-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .loan-actions .button {
        flex: 1 1 auto;
    }

    .loan-customer-group__heading {
        flex-wrap: wrap;
    }

    .loan-customer-group__toggle {
        padding-right: 1.15rem;
    }

    .loan-customer-group__profile {
        margin: 0 1rem 1rem;
    }

    .loan-customer-group__stats {
        width: 100%;
        justify-content: space-between;
    }

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

    .report-customer-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media screen and (max-width: 520px) {
    .loan-detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid,
    .dashboard-secondary-grid,
    .dashboard-shortcut-grid,
    .report-customer-summary {
        grid-template-columns: 1fr;
    }
}

/* Flatpickr date picker */
.control.has-icons-left .flatpickr-input.input,
.control.has-icons-left input.flatpickr-input {
    padding-left: 2.5em;
}

.flatpickr-calendar {
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    box-shadow: var(--app-shadow);
    overflow: hidden;
    font-family: inherit;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays,
span.flatpickr-weekday {
    color: var(--app-text);
    fill: var(--app-text);
    background: #fff;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--app-primary);
    fill: var(--app-primary);
}

.flatpickr-day {
    border-radius: 0.45rem;
    color: var(--app-text);
}

.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    border-color: var(--app-primary-soft);
    background: var(--app-primary-soft);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    border-color: var(--app-primary);
    color: #fff;
    background: var(--app-primary);
}

.flatpickr-day.today {
    border-color: var(--app-primary);
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
    border-color: var(--app-primary);
    color: #fff;
    background: var(--app-primary);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #b7c4c0;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .app-sidebar {
        transition: none;
    }

    .submenu-chevron {
        transition: none;
    }

    .app-toast {
        animation: none;
    }

    .app-toast.is-leaving {
        transition: none;
    }
}
