/*
 * Shared visual system for the authenticated application and sign-in screen.
 * Business logic remains in the existing PHP pages.
 */

:root {
    --app-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --app-canvas: #f3f6f5;
    --app-surface: #ffffff;
    --app-surface-muted: #f7f9f8;
    --app-ink: #233039;
    --app-muted: #64727a;
    --app-border: #d7dfdc;
    --app-border-strong: #c4cfcb;
    --app-accent: #2f7d50;
    --app-accent-dark: #24653f;
    --app-accent-soft: #e9f3ed;
    --app-sidebar: #202a2f;
    --app-sidebar-deep: #172126;
    --app-sidebar-line: rgba(255, 255, 255, 0.09);
    --app-danger: #b24444;
    --app-danger-soft: #f9ecec;
    --app-warning: #9a671d;
    --app-warning-soft: #fff5df;
    --app-info: #326b87;
    --app-shadow: 0 1px 2px rgba(24, 39, 32, 0.06), 0 8px 24px rgba(24, 39, 32, 0.04);
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--app-canvas);
    color: var(--app-ink);
    font-family: var(--app-font-sans);
    font-size: 15px;
    line-height: 1.55;
}

button,
input,
select,
textarea {
    font-family: var(--app-font-sans);
    font-size: inherit;
    line-height: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: inherit;
    letter-spacing: 0;
}

a {
    color: var(--app-accent-dark);
}

a:hover,
a:focus {
    color: #184e30;
}

::selection {
    background: #cfe5d7;
    color: var(--app-ink);
}

/* Header */

#top_header.app-header {
    background: var(--app-surface) !important;
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 0 rgba(24, 39, 32, 0.02);
    height: 64px;
    padding: 0;
}

#top_header.app-header .container {
    height: 100%;
}

.app-header__inner {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: space-between;
    min-width: 0;
}

.app-brand {
    align-items: center;
    color: var(--app-ink);
    display: inline-flex;
    gap: 11px;
    min-width: 0;
}

.app-brand:hover,
.app-brand:focus {
    color: var(--app-ink);
}

.app-brand__mark {
    align-items: center;
    background: var(--app-accent);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 36px;
    font-size: 12px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
}

.app-brand__name {
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user {
    align-items: center;
    color: var(--app-muted);
    display: flex;
    gap: 9px;
    min-width: 0;
}

.app-user > .icon-user {
    color: var(--app-accent);
    font-size: 15px;
}

.app-user__name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user__logout {
    align-items: center;
    border-left: 1px solid var(--app-border);
    color: var(--app-muted);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    margin-left: 4px;
    width: 36px;
}

.app-user__logout:hover,
.app-user__logout:focus {
    color: var(--app-danger);
}

/* Navigation */

body.side_fixed {
    padding-left: 44px;
}

body.side_fixed_open {
    padding-left: 220px;
}

#side_fixed_nav {
    background: var(--app-sidebar);
    box-shadow: 2px 0 14px rgba(15, 25, 29, 0.12);
    width: 44px;
}

body.side_fixed_open #side_fixed_nav {
    width: 220px;
}

.side_nav_actions {
    border-bottom: 1px solid var(--app-sidebar-line);
    height: 64px;
}

.side_nav_actions #side_fixed_nav_toggle {
    align-items: center;
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    height: 64px;
    justify-content: center;
    padding: 0;
    width: 44px;
}

.side_nav_actions #side_fixed_nav_toggle:hover,
.side_nav_actions #side_fixed_nav_toggle:focus {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.side_nav_actions #toogle_nav_visible {
    margin-top: 20px;
}

#text_nav_side_fixed {
    padding-bottom: 24px;
}

#text_nav_side_fixed > li {
    border: 0;
    box-shadow: none;
}

#text_nav_side_fixed > li:last-child {
    border: 0;
    box-shadow: none;
}

#text_nav_side_fixed a {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

#text_nav_side_fixed > li > a {
    background: var(--app-sidebar-deep);
    border-bottom: 1px solid var(--app-sidebar-line);
    font-weight: 600;
    line-height: 48px;
}

body.side_fixed_open #text_nav_side_fixed .parent_active > a {
    background: var(--app-sidebar-deep) !important;
    color: #fff;
}

#text_nav_side_fixed > li > a > span {
    color: #fff;
    font-size: 15px;
    margin-left: 14px;
    margin-right: 16px;
}

#text_nav_side_fixed > li > ul {
    background: transparent;
    padding: 7px 0 18px 10px;
}

#text_nav_side_fixed ul li + li {
    border: 0;
    box-shadow: none;
}

#text_nav_side_fixed ul a {
    border-radius: 4px 0 0 4px;
    font-size: 13px;
    line-height: 30px;
    padding: 2px 14px 2px 0;
    text-indent: 14px;
}

#text_nav_side_fixed ul a:hover,
#text_nav_side_fixed ul a:focus {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

#text_nav_side_fixed .link_active > a {
    background: rgba(47, 125, 80, 0.3);
    color: #fff;
    font-weight: 600;
}

#text_nav_side_fixed .link_active > a:after {
    background: #61b47d;
    border: 0;
    bottom: 6px;
    content: "";
    height: auto;
    left: 0;
    right: auto;
    top: 6px;
    width: 3px;
}

#text_nav_side_fixed .nav_group {
    margin-top: 4px;
}

#text_nav_side_fixed .nav_group > ul {
    background: rgba(5, 12, 15, 0.18);
    margin: 0 0 5px 6px;
    padding: 4px 0;
}

#text_nav_side_fixed .sidebar_group_toggle {
    color: rgba(255, 255, 255, 0.58) !important;
    cursor: pointer;
    display: block;
    font-size: 13px !important;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 30px !important;
    overflow: hidden;
    padding: 3px 30px 3px 0 !important;
    position: relative;
    text-indent: 14px !important;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

#text_nav_side_fixed .sidebar_group_toggle:hover,
#text_nav_side_fixed .nav_group.parent_active > .sidebar_group_toggle {
    color: #fff !important;
}

#text_nav_side_fixed .sidebar_group_toggle i {
    right: 13px !important;
    top: 11px !important;
    transition: transform 160ms ease;
}

#text_nav_side_fixed .nav_group.parent_active > .sidebar_group_toggle i {
    transform: rotate(180deg);
}

#mobile_navigation {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: 10px 20px;
}

#mobile_navigation select {
    background-color: var(--app-surface);
    border: 1px solid var(--app-border-strong);
    border-radius: 4px;
    color: var(--app-ink);
    font-size: 15px;
    height: 40px;
    width: 100%;
}

/* Breadcrumbs and layout */

#breadcrumbs {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    margin: 0;
    min-height: 42px;
}

#breadcrumbs ul {
    align-items: center;
    display: flex;
    min-height: 42px;
}

#breadcrumbs li {
    float: none;
}

#breadcrumbs li a,
#breadcrumbs li span {
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 500;
}

#breadcrumbs li:last-child span {
    color: var(--app-ink);
}

#breadcrumbs li a:after {
    border: 0;
    color: #9aa6a0;
    content: "/";
    height: auto;
    right: -15px;
    top: -1px;
    width: auto;
}

#breadcrumbs li a {
    margin-right: 24px;
}

.main_section {
    margin-top: 22px;
    padding-bottom: 24px;
}

#main_content,
#main_content_outer {
    min-width: 0;
}

.row + .row {
    margin-top: 22px;
}

/* Panels */

.panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    margin-bottom: 0;
}

.panel + .panel {
    margin-top: 22px;
}

.panel-default {
    border-color: var(--app-border);
}

.panel .panel-heading {
    align-items: center;
    background: var(--app-surface-muted);
    border-bottom: 1px solid var(--app-border);
    border-radius: 5px 5px 0 0;
    display: flex;
    height: auto;
    min-height: 45px;
    padding: 10px 15px;
}

.panel .panel-heading .panel-title {
    color: var(--app-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.panel .panel-heading > .btn,
.panel .panel-heading > .btn-group {
    margin-bottom: 0;
    margin-left: auto;
    margin-top: 0;
}

.panel-body {
    padding: 18px;
}

.panel-footer {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
}

.panel-danger {
    border-color: #e6c3c3;
}

.panel-danger > .panel-heading {
    background: var(--app-danger-soft);
    border-color: #e6c3c3;
    color: #7f2d2d;
}

.panel-danger > .panel-heading .panel-title {
    color: #7f2d2d;
}

.panel-success {
    border-color: #bdd9c7;
}

.panel-success > .panel-heading {
    background: var(--app-accent-soft);
    border-color: #bdd9c7;
}

/* Forms and controls */

label {
    color: #3f4d55;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form_sep + .form_sep {
    margin-top: 16px;
}

.transaction-form-actions {
    align-items: center;
    border-top: 1px dashed var(--app-border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 16px;
    padding-top: 10px;
}

.transaction-form-actions .btn {
    margin: 0;
}

.form-control,
select.form-control {
    background-color: var(--app-surface);
    border: 1px solid var(--app-border-strong);
    border-radius: 4px;
    box-shadow: none;
    color: var(--app-ink);
    font-family: var(--app-font-sans);
    font-size: 15px;
    line-height: 1.4;
    height: 40px;
    padding: 9px 10px;
}

textarea.form-control {
    height: auto;
    min-height: 96px;
}

.form-control:hover {
    border-color: #a8b6b0;
}

.form-control:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(47, 125, 80, 0.12);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    background: #eef1f0;
    border-color: var(--app-border);
    color: #65716c;
}

.input-lg {
    border-radius: 4px;
    font-size: 16px;
    height: 46px;
}

.input-group-addon {
    background: var(--app-surface-muted);
    border-color: var(--app-border-strong);
    color: var(--app-muted);
}

.select2-container,
.select2-drop,
.ms-container,
.dataTables_wrapper {
    font-family: var(--app-font-sans);
}

.select2-container .select2-choice {
    border-color: var(--app-border-strong);
    border-radius: 4px;
    font-size: 15px;
    height: 40px;
    line-height: 38px;
}

.help-block,
.text-muted {
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.45;
}

/* Transaction suggestions */

.transaction-suggestion-list {
    border: 1px solid var(--app-border);
    border-radius: 4px;
    overflow: hidden;
}

.transaction-suggestion {
    align-items: center;
    appearance: none;
    background: var(--app-surface);
    border: 0;
    color: var(--app-ink);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 88px minmax(0, 1fr) 72px;
    min-height: 58px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.transaction-suggestion + .transaction-suggestion {
    border-top: 1px solid var(--app-border);
}

.transaction-suggestion:hover,
.transaction-suggestion:focus {
    background: var(--app-surface-muted);
    outline: 0;
}

.transaction-suggestion:focus {
    box-shadow: inset 3px 0 0 var(--app-accent);
}

.transaction-suggestion.is-selected {
    background: var(--app-accent-soft);
    box-shadow: inset 3px 0 0 var(--app-accent);
}

.transaction-suggestion__house {
    align-items: center;
    color: var(--app-accent-dark);
    display: flex;
    gap: 7px;
}

.transaction-suggestion__house strong {
    font-size: 18px;
    line-height: 1;
}

.transaction-suggestion__details {
    display: block;
    min-width: 0;
}

.transaction-suggestion__name,
.transaction-suggestion__evidence {
    display: block;
    overflow-wrap: anywhere;
}

.transaction-suggestion__name {
    font-weight: 600;
}

.transaction-suggestion__evidence {
    color: var(--app-muted);
    font-size: 13px;
    margin-top: 2px;
}

.transaction-suggestion__confidence {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
}

.transaction-suggestion__confidence--strong {
    color: var(--app-accent-dark);
}

.transaction-suggestion__confidence--likely {
    color: var(--app-info);
}

.transaction-suggestion__confidence--possible {
    color: var(--app-warning);
}

.transaction-suggestion-empty {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 4px;
    color: var(--app-muted);
    padding: 11px 12px;
}

.transaction-category-suggestion-list {
    border: 1px solid var(--app-border);
    border-radius: 4px;
    overflow: hidden;
}

.transaction-category-suggestion {
    align-items: center;
    appearance: none;
    background: var(--app-surface);
    border: 0;
    color: var(--app-ink);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr) 72px;
    min-height: 62px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.transaction-category-suggestion + .transaction-category-suggestion {
    border-top: 1px solid var(--app-border);
}

.transaction-category-suggestion:hover,
.transaction-category-suggestion:focus {
    background: var(--app-surface-muted);
    outline: 0;
}

.transaction-category-suggestion:focus {
    box-shadow: inset 3px 0 0 var(--app-accent);
}

.transaction-category-suggestion.is-selected {
    background: var(--app-accent-soft);
    box-shadow: inset 3px 0 0 var(--app-accent);
}

.transaction-category-suggestion__category {
    align-items: flex-start;
    color: var(--app-accent-dark);
    display: flex;
    gap: 8px;
    min-width: 0;
}

.transaction-category-suggestion__category > span {
    display: block;
    min-width: 0;
}

.transaction-category-suggestion__category strong,
.transaction-category-suggestion__category small,
.transaction-category-suggestion__evidence {
    display: block;
    overflow-wrap: anywhere;
}

.transaction-category-suggestion__category strong {
    color: var(--app-ink);
    font-size: 14px;
    line-height: 1.35;
}

.transaction-category-suggestion__category small {
    color: var(--app-muted);
    font-size: 12px;
    margin-top: 2px;
}

.transaction-category-suggestion__details {
    display: block;
    min-width: 0;
}

.transaction-category-suggestion__evidence {
    color: var(--app-muted);
    font-size: 13px;
}

.transaction-category-suggestion__confidence {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
}

.transaction-category-suggestion__confidence--strong {
    color: var(--app-accent-dark);
}

.transaction-category-suggestion__confidence--likely {
    color: var(--app-info);
}

.transaction-category-suggestion__confidence--possible {
    color: var(--app-warning);
}

.transaction-category-suggestion-empty {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 4px;
    color: var(--app-muted);
    padding: 11px 12px;
}

/* Buttons */

.btn {
    border-radius: 4px;
    font-family: var(--app-font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 34px;
    padding: 7px 13px;
}

.btn-sm {
    min-height: 30px;
    padding: 5px 10px;
}

.btn-lg {
    min-height: 44px;
    padding: 10px 16px;
}

.btn-default {
    background: var(--app-surface);
    border-color: var(--app-border-strong);
    color: #35434a;
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active {
    background: #edf2f0;
    border-color: #a9b8b2;
    color: var(--app-ink);
}

.btn-primary {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: var(--app-accent-dark);
    border-color: var(--app-accent-dark);
    color: #fff;
}

.btn-danger {
    background: var(--app-danger);
    border-color: var(--app-danger);
}

.btn-success {
    background: var(--app-accent);
    border-color: var(--app-accent);
}

/* Tables and lists */

.table {
    color: var(--app-ink);
    font-family: var(--app-font-sans);
    font-size: 14px;
    line-height: 1.45;
}

.table > thead > tr > th {
    background: #edf2f0;
    border-bottom: 1px solid var(--app-border-strong);
    color: #415058;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    padding: 11px 12px;
    text-transform: none;
    vertical-align: middle;
}

.table > tbody > tr > td,
.table > tfoot > tr > td {
    border-top-color: #e2e8e5;
    padding: 11px 12px;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
    background: #fbfcfb;
}

.table-hover > tbody > tr:hover > td,
.table-striped > tbody > tr:hover > td {
    background: #eef6f1;
}

.table a {
    font-weight: 600;
}

.table-responsive,
.app-table-responsive {
    border: 0;
    margin: 0;
    overflow-x: auto;
    width: 100%;
}

.app-table-responsive > .table {
    margin-bottom: 0;
    min-width: 680px;
}

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

.dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
    padding: 12px 4px;
}

.dataTables_wrapper .table {
    min-width: 680px;
}

.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    font-family: var(--app-font-sans);
    font-size: 14px;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px;
}

.pagination > li > a,
.pagination > li > span {
    border-color: var(--app-border);
    color: #425149;
    font-size: 14px;
    min-width: 34px;
    text-align: center;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus,
.panel-footer .pagination > li.active > a {
    background: var(--app-accent);
    border-color: var(--app-accent);
}

.member-print-heading {
    display: none;
}

.member-page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.member-print-action {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Interest calculation audit */

.interest-audit__metrics {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    margin: -18px -18px 18px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.interest-audit__metric {
    display: grid;
    min-width: 0;
    gap: 3px;
    padding: 12px 14px;
    border-right: 1px solid var(--app-border);
}

.interest-audit__metric:last-child {
    border-right: 0;
}

.interest-audit__metric span {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 600;
}

.interest-audit__metric strong {
    overflow-wrap: anywhere;
    color: var(--app-ink);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.interest-audit__metric--interest strong {
    color: var(--app-warning);
}

.interest-audit__metric--received strong {
    color: var(--app-accent-dark);
}

.interest-audit__metric--total strong {
    color: var(--app-danger);
}

.interest-audit__rule {
    padding: 12px 14px;
    border-left: 4px solid var(--app-info);
    background: #edf5f8;
    color: #344b57;
    line-height: 1.6;
}

.interest-audit__notice {
    margin: 0;
}

.interest-audit__title {
    margin: 20px 0 8px;
    color: var(--app-ink);
    font-size: 15px;
    font-weight: 700;
}

.interest-audit__table {
    border: 1px solid var(--app-border);
    border-radius: 4px;
}

.interest-audit__table > .table {
    min-width: 820px;
}

.interest-audit__table .text-right {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.interest-audit__table tfoot th {
    padding: 10px 12px;
    border-top: 1px solid var(--app-border-strong);
    background: var(--app-surface-muted);
}

.interest-audit__deferred td {
    color: var(--app-muted);
}

.interest-audit__equation {
    white-space: nowrap;
    color: var(--app-muted);
    font-variant-numeric: tabular-nums;
}

.interest-audit__footnote {
    margin: 10px 0 0;
    color: var(--app-muted);
    font-size: 13px;
}

/* Feedback and overlays */

.alert {
    border-radius: 4px;
    border-width: 1px 1px 1px 4px;
}

.alert-success {
    background: var(--app-accent-soft);
    border-color: #a7cfb5;
}

.alert-warning {
    background: var(--app-warning-soft);
    border-color: #e2bf7a;
}

.alert-danger {
    background: var(--app-danger-soft);
    border-color: #ddb0b0;
}

.modal-content {
    border: 0;
    border-radius: 6px;
    box-shadow: 0 16px 50px rgba(19, 31, 36, 0.24);
}

.modal-header {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
    border-radius: 6px 6px 0 0;
}

/* Dashboard */

.dashboard-panel .panel-heading {
    justify-content: space-between;
}

.dashboard-panel .panel-body {
    padding: 16px;
}

.dashboard-house-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
}

.house-link.btn {
    align-items: center;
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-ink);
    display: flex;
    font-size: 15px;
    justify-content: center;
    margin: 0;
    min-height: 48px;
    padding: 8px;
}

.house-link.btn:hover,
.house-link.btn:focus {
    background: var(--app-accent-soft);
    border-color: #9dc8ac;
    color: var(--app-accent-dark);
}

/* Footer */

#footer_space {
    height: 92px;
}

#footer {
    background: #edf1ef;
    border-top: 1px solid var(--app-border);
    box-shadow: none;
    color: var(--app-muted);
    font-size: 13px;
    height: 46px;
    line-height: 46px;
    margin-top: -46px;
}

.app-footer__inner {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.app-footer__site {
    color: #4d5b62;
    font-weight: 600;
}

/* Sign in */

body.login-page {
    align-items: center;
    background: var(--app-canvas);
    display: flex;
    min-height: 100vh;
    padding: 32px 20px;
}

body.login-page:before {
    background: var(--app-accent);
    content: "";
    height: 5px;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
}

.login-page .login_wrapper {
    margin: 0 auto;
    position: relative;
    width: 400px;
}

.login-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.login-brand__mark {
    align-items: center;
    background: var(--app-accent);
    border-radius: 6px;
    color: #fff;
    display: flex;
    flex: 0 0 42px;
    font-size: 13px;
    font-weight: 700;
    height: 42px;
    justify-content: center;
}

.login-brand__name {
    color: var(--app-ink);
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.login-brand__context {
    color: var(--app-muted);
    display: block;
    font-size: 13px;
    margin-top: 2px;
}

.login-page .login_panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    padding: 24px;
    position: relative;
}

.login-page .login_head {
    margin-bottom: 20px;
}

.login-page .login_head h1 {
    color: var(--app-ink);
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
    margin: 0;
}

.login-page .login_submit {
    padding-top: 4px;
}

.login-error {
    background: var(--app-danger-soft);
    border: 1px solid #e3baba;
    border-radius: 4px;
    color: #842f2f;
    margin-top: 16px;
    padding: 10px 12px;
}

/* Responsive adjustments */

@media (max-width: 991px) {
    body.side_fixed,
    body.side_fixed_open {
        padding-left: 0;
    }

    #top_header.app-header {
        height: 60px;
    }

    #mobile_navigation {
        display: block;
    }

    .main_section {
        margin-top: 16px;
    }

    .interest-audit__metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .interest-audit__metric {
        border-bottom: 1px solid var(--app-border);
    }
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    #top_header.app-header {
        height: 60px;
    }

    #top_header.app-header [class*="col-xs"] {
        margin-bottom: 0;
    }

    .app-brand {
        gap: 8px;
        max-width: calc(100% - 94px);
    }

    .app-brand__mark {
        flex-basis: 32px;
        height: 32px;
    }

    .app-brand__name {
        font-size: 15px;
    }

    .app-user {
        gap: 0;
    }

    .app-user > .icon-user,
    .app-user__name {
        display: none;
    }

    .app-user__logout {
        border-left: 0;
        margin-left: 0;
    }

    #mobile_navigation {
        padding: 9px 14px;
    }

    #breadcrumbs {
        min-height: 38px;
    }

    #breadcrumbs ul {
        margin-left: 0;
        min-height: 38px;
    }

    .main_section {
        padding-bottom: 12px;
    }

    .main_section > #main_content_outer {
        float: none;
    }

    .row + .row {
        margin-top: 16px;
    }

    [class*="col-sm"],
    [class*="col-md"],
    [class*="col-lg"],
    [class*="col-xs"] {
        margin-bottom: 14px;
    }

    .panel + .panel {
        margin-top: 16px;
    }

    .panel .panel-heading {
        min-height: 42px;
        padding: 9px 12px;
    }

    .panel-body {
        padding: 14px;
    }

    .interest-audit__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: -14px -14px 16px;
    }

    .interest-audit__metric {
        padding: 10px 12px;
    }

    .transaction-suggestion {
        gap: 8px;
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .transaction-suggestion__confidence {
        grid-column: 2;
        text-align: left;
    }

    .transaction-category-suggestion {
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) 70px;
    }

    .transaction-category-suggestion__details {
        grid-column: 1 / -1;
    }

    .transaction-category-suggestion__confidence {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
    }

    .app-table-responsive > .table,
    .dataTables_wrapper .table {
        min-width: 620px;
    }

    .dashboard-panel .panel-body {
        padding: 12px;
    }

    .dashboard-house-grid {
        gap: 8px;
        grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    }

    .house-link.btn {
        min-height: 44px;
    }

    #footer_space {
        height: 76px;
    }

    #footer {
        height: auto;
        line-height: 22px;
        margin-top: -58px;
        padding: 8px 0;
    }

    .app-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    body.login-page {
        padding: 24px 16px;
    }

    .login-page .login_wrapper {
        padding: 0;
        width: 100%;
    }

    .login-page .login_panel {
        padding: 20px;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    body.member-transactions-page {
        min-width: 0 !important;
        padding-left: 0 !important;
        background: #ffffff !important;
        color: #000000;
        font-family: var(--app-font-sans);
        font-size: 9pt;
        line-height: 1.35;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body.member-transactions-page #top_header,
    body.member-transactions-page #mobile_navigation,
    body.member-transactions-page #breadcrumbs,
    body.member-transactions-page #side_fixed_nav,
    body.member-transactions-page #footer,
    body.member-transactions-page #footer_space,
    body.member-transactions-page .member-page-actions,
    body.member-transactions-page .alert,
    body.member-transactions-page .member-transactions-table th:last-child,
    body.member-transactions-page .member-transactions-table td:last-child,
    body.member-transactions-page .member-summary-table a {
        display: none !important;
    }

    body.member-transactions-page #wrapper_all,
    body.member-transactions-page .main_section,
    body.member-transactions-page #main_content_outer,
    body.member-transactions-page #main_content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    body.member-transactions-page .row {
        margin: 0 !important;
    }

    body.member-transactions-page .col-sm-12 {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    body.member-transactions-page .member-print-heading {
        display: block;
        margin: 0 0 12px;
        padding: 0 0 10px;
        border-bottom: 2px solid #263238;
    }

    body.member-transactions-page .member-print-heading p {
        margin: 0 0 2px;
        font-size: 8.5pt;
        font-weight: 700;
        text-transform: uppercase;
    }

    body.member-transactions-page .member-print-heading h1 {
        margin: 0;
        font-size: 16pt;
        line-height: 1.2;
    }

    body.member-transactions-page .member-print-heading span {
        display: block;
        margin-top: 4px;
        font-size: 8.5pt;
    }

    body.member-transactions-page .panel,
    body.member-transactions-page .interest-audit__table {
        overflow: visible !important;
        border: 1px solid #aeb8b3;
        border-radius: 0;
        box-shadow: none;
    }

    body.member-transactions-page .panel + .panel {
        margin-top: 12px;
    }

    body.member-transactions-page .panel .panel-heading {
        min-height: 0;
        padding: 6px 8px;
        border-radius: 0;
        background: #e9eeeb !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    body.member-transactions-page .panel .panel-heading .panel-title {
        font-size: 10pt;
        line-height: 1.25;
    }

    body.member-transactions-page .panel-body {
        padding: 10px;
    }

    body.member-transactions-page .table-responsive,
    body.member-transactions-page .app-table-responsive {
        width: 100% !important;
        overflow: visible !important;
        border-radius: 0;
    }

    body.member-transactions-page .table,
    body.member-transactions-page .app-table-responsive > .table,
    body.member-transactions-page .dataTables_wrapper .table {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0;
        border-collapse: collapse;
        font-family: var(--app-font-sans);
        font-size: 8pt;
        line-height: 1.3;
    }

    body.member-transactions-page .table thead {
        display: table-header-group;
    }

    body.member-transactions-page .table tfoot {
        display: table-footer-group;
    }

    body.member-transactions-page .table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.member-transactions-page .table > thead > tr > th,
    body.member-transactions-page .table > tbody > tr > td,
    body.member-transactions-page .table > tfoot > tr > th {
        padding: 3.5pt 4pt !important;
        border: 1px solid #cbd2ce !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 8pt !important;
        line-height: 1.3;
        text-transform: none;
    }

    body.member-transactions-page .table > thead > tr > th,
    body.member-transactions-page .table > tfoot > tr > th {
        background: #e9eeeb !important;
        font-weight: 700;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(1),
    body.member-transactions-page .member-transactions-table td:nth-child(1) {
        width: 4%;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(2),
    body.member-transactions-page .member-transactions-table td:nth-child(2) {
        width: 7%;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(3),
    body.member-transactions-page .member-transactions-table td:nth-child(3),
    body.member-transactions-page .member-transactions-table th:nth-child(4),
    body.member-transactions-page .member-transactions-table td:nth-child(4) {
        width: 9%;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(5),
    body.member-transactions-page .member-transactions-table td:nth-child(5) {
        width: 14%;
        white-space: nowrap;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(6),
    body.member-transactions-page .member-transactions-table td:nth-child(6) {
        width: 37%;
    }

    body.member-transactions-page .member-transactions-table th:nth-child(7),
    body.member-transactions-page .member-transactions-table td:nth-child(7) {
        width: 20%;
    }

    body.member-transactions-page .interest-audit__metrics {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        margin: -10px -10px 10px;
    }

    body.member-transactions-page .interest-audit__metric {
        padding: 6px 7px;
        border-bottom: 0;
    }

    body.member-transactions-page .interest-audit__metric span {
        font-size: 8pt;
    }

    body.member-transactions-page .interest-audit__metric strong {
        font-size: 9pt;
    }

    body.member-transactions-page .interest-audit__rule {
        padding: 7px 9px;
        border-left-width: 3px;
        background: #eef3f1 !important;
        color: #000000;
        font-size: 8.5pt;
        line-height: 1.4;
    }

    body.member-transactions-page .interest-audit__title {
        margin: 10px 0 5px;
        font-size: 9.5pt;
        break-after: avoid;
        page-break-after: avoid;
    }

    body.member-transactions-page .interest-audit__footnote {
        margin-top: 5px;
        color: #333333;
        font-size: 8pt;
    }

    body.member-transactions-page .interest-audit__equation {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.member-transactions-page a {
        color: #000000 !important;
        text-decoration: none !important;
    }
}
