:root {
    --app-bg: #edf3fb;
    --app-bg-soft: #f7faff;
    --app-surface: #ffffff;
    --app-surface-muted: #f4f7fb;
    --app-border: #d7e1ee;
    --app-border-strong: #c4d2e5;
    --app-text: #16324f;
    --app-text-muted: #63758b;
    --app-heading: #0f2740;
    --app-accent: #245ea8;
    --app-accent-strong: #1a4a86;
    --app-success: #1f7a4f;
    --app-success-soft: #e9f7f0;
    --app-warning: #9b6a16;
    --app-warning-soft: #fff4db;
    --app-danger: #b14444;
    --app-danger-soft: #fdecec;
    --app-info-soft: #eaf2ff;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 2rem;
    --radius-sm: 0.65rem;
    --radius-md: 0.95rem;
    --radius-lg: 1.2rem;
    --shadow-sm: 0 8px 24px rgba(15, 39, 64, 0.06);
    --shadow-md: 0 14px 34px rgba(15, 39, 64, 0.09);
    --control-height: 2.44rem;
    --control-height-sm: 2.04rem;
    --table-row-height: 3rem;
}

html {
    font-size: 15.5px;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(36, 94, 168, 0.08), transparent 28%),
        linear-gradient(180deg, #f7faff 0%, var(--app-bg) 100%);
    color: var(--app-text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
}

.app-shell {
    color: var(--app-text);
}

.app-shell__content.container {
    max-width: 1360px;
    padding-top: var(--space-6);
    padding-bottom: var(--space-7);
}

h1,
h2,
h3,
h4,
h5,
h6,
.fw-semibold,
.fw-bold,
strong {
    color: var(--app-heading);
}

small,
.small,
.text-muted,
.form-text {
    color: var(--app-text-muted) !important;
}

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

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

.app-navbar {
    background: linear-gradient(135deg, #143f72 0%, #21589a 52%, #2c6cb6 100%) !important;
    box-shadow: 0 10px 26px rgba(16, 44, 78, 0.2);
}

.app-navbar .container {
    max-width: 1360px;
}

.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-navbar .nav-link {
    border-radius: 999px;
    padding: 0.5rem 0.85rem !important;
    color: rgba(255, 255, 255, 0.86) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff !important;
}

.app-navbar__user {
    padding: 0.35rem 0.35rem 0.35rem 0.9rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.page-header__title {
    margin: 0;
    font-size: clamp(1.4rem, 1.8vw, 1.78rem);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header__subtitle {
    margin-top: 0.28rem;
    max-width: 780px;
    font-size: 0.9rem;
    color: var(--app-text-muted);
}

.section-stack > * + * {
    margin-top: var(--space-4);
}

.card {
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--app-surface);
    overflow: hidden;
}

.card.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.card-header {
    background: linear-gradient(180deg, #fcfdff 0%, #f4f8fd 100%);
    border-bottom: 1px solid var(--app-border);
    padding: 0.72rem 1rem;
    font-weight: 600;
    color: var(--app-heading);
}

.card-body {
    padding: 1.08rem;
}

.card-footer {
    background: #f9fbfe;
    border-top: 1px solid var(--app-border);
    padding: 0.72rem 1rem;
}

.app-soft-card {
    background: linear-gradient(180deg, #fdfefe 0%, #f5f8fc 100%);
}

.kpi-card {
    background: linear-gradient(180deg, #fafdff 0%, #f1f6fc 100%);
}

.kpi-card .card-body,
.app-kpi-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
}

.app-kpi-value {
    font-size: clamp(1.14rem, 1.04rem + 0.42vw, 1.56rem);
    line-height: 1.1;
    font-weight: 700;
    color: var(--app-heading);
}

.app-kpi-meta {
    font-size: 0.83rem;
    color: var(--app-text-muted);
}

.app-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
}

.app-stat-panel {
    min-height: 100%;
    padding: 0.84rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-sm);
    background: var(--app-surface-muted);
}

.app-stat-panel__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--app-text-muted);
    margin-bottom: 0.3rem;
}

.app-stat-panel__value {
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--app-heading);
}

.app-stat-list {
    display: grid;
    gap: 0.8rem;
}

.app-stat-list__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    align-items: baseline;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(215, 225, 238, 0.9);
}

.app-stat-list__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.app-stat-list__label {
    color: var(--app-text-muted);
}

.app-stat-list__value {
    font-weight: 700;
    color: var(--app-heading);
    text-align: right;
}

.form-label {
    margin-bottom: 0.26rem;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--app-heading);
}

.form-control,
.form-select {
    box-sizing: border-box;
    height: var(--control-height);
    min-height: var(--control-height);
    border-radius: 0.72rem;
    border: 1px solid var(--app-border-strong);
    background-color: #fff;
    color: var(--app-text);
    box-shadow: none;
    font-size: 0.9rem;
    line-height: 1.25;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: 0.74rem;
    padding-right: 0.74rem;
}

.form-control-sm,
.form-select-sm,
.btn-sm,
.finance-multi-filter-toggle.btn-sm {
    box-sizing: border-box;
    height: var(--control-height-sm);
    min-height: var(--control-height-sm);
    border-radius: 0.62rem;
    font-size: 0.84rem;
    padding-top: 0.24rem;
    padding-bottom: 0.24rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(36, 94, 168, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(36, 94, 168, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 0.72rem;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0.42rem 0.82rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-width: 1px;
    line-height: 1.2;
}

.btn-sm {
    height: var(--control-height-sm);
    min-height: var(--control-height-sm);
    padding: 0.24rem 0.68rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.btn-group-sm > .btn,
.btn-group-sm > .btn-group > .btn {
    box-sizing: border-box;
    height: var(--control-height-sm);
    min-height: var(--control-height-sm);
    padding: 0.24rem 0.68rem;
    font-size: 0.8rem;
    border-radius: 0.62rem;
}

.btn-primary {
    background: linear-gradient(180deg, #2e6bb1 0%, #245ea8 100%);
    border-color: #245ea8;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #275f9c 0%, #1d4e88 100%);
    border-color: #1d4e88;
}

.btn-outline-primary {
    color: var(--app-accent);
    border-color: rgba(36, 94, 168, 0.28);
    background: rgba(255, 255, 255, 0.95);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(36, 94, 168, 0.08);
    color: var(--app-accent-strong);
    border-color: rgba(36, 94, 168, 0.46);
}

.btn-outline-secondary,
.btn-light {
    border-color: var(--app-border-strong);
    color: var(--app-text);
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-light:hover {
    background: #f3f7fc;
    color: var(--app-heading);
    border-color: #b8c7da;
}

.btn-success {
    background: #2a8a5b;
    border-color: #2a8a5b;
}

.btn-danger {
    background: #bf4a4a;
    border-color: #bf4a4a;
}

.badge {
    border-radius: 999px;
    padding: 0.38em 0.64em;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.bg-success {
    background-color: #2b8c5c !important;
}

.bg-secondary {
    background-color: #6f8195 !important;
}

.bg-warning {
    background-color: #c79330 !important;
    color: #fff !important;
}

.bg-success-subtle {
    background-color: var(--app-success-soft) !important;
}

.bg-secondary-subtle {
    background-color: #eef3f8 !important;
}

.text-success {
    color: var(--app-success) !important;
}

.text-danger {
    color: var(--app-danger) !important;
}

.alert {
    border: 1px solid var(--app-border);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.alert-info {
    background: var(--app-info-soft);
    border-color: #d4e2fb;
    color: #25476e;
}

.alert-warning {
    background: #fff6df;
    border-color: #f2deb0;
    color: #7e5c15;
}

.alert-danger {
    background: #fff1f1;
    border-color: #f0c8c8;
    color: #8e3535;
}

.table-responsive {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow-x: auto;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #f7faff;
    --bs-table-hover-bg: #eef4fb;
    margin-bottom: 0;
    color: var(--app-text);
    font-size: 0.87rem;
}

.table > :not(caption) > * > * {
    padding: 0.72rem 0.88rem;
    border-bottom-color: var(--app-border);
    vertical-align: middle;
}

.table > thead {
    vertical-align: middle;
}

.table > thead > tr > th {
    background: #f5f8fc;
    color: var(--app-heading);
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.15;
    white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
    font-size: 0.85rem;
    line-height: 1.35;
}

.table-sm > :not(caption) > * > * {
    padding: 0.56rem 0.72rem;
}

.table-sm > thead > tr > th {
    font-size: 0.71rem;
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
}

.table-sm > tbody > tr > td,
.table-sm > tbody > tr > th {
    font-size: 0.83rem;
}

.table tbody tr:hover {
    --bs-table-accent-bg: #eef4fb;
}

.table td.text-end,
.table th.text-end,
.table .text-end {
    font-variant-numeric: tabular-nums;
}

.table.table-bordered {
    border-color: var(--app-border);
}

.table.table-bordered > :not(caption) > * > * {
    border-color: var(--app-border);
}

.table .btn-group-sm {
    flex-wrap: nowrap;
}

.table .btn-group-sm > .btn,
.table .btn-sm {
    min-height: 1.9rem;
    padding-top: 0.16rem;
    padding-bottom: 0.16rem;
}

.table .btn-group-sm > .btn {
    white-space: nowrap;
}

.app-pagination-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.app-pagination-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.pagination,
.app-pagination {
    gap: 0.24rem;
}

.app-pagination {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.pagination .page-link,
.app-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    height: 2rem;
    padding: 0.28rem 0.6rem;
    border-radius: 0.62rem;
    border-color: var(--app-border);
    background: #fbfcfe;
    color: var(--app-text);
    text-align: center;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pagination .page-link:hover,
.app-pagination .page-link:hover {
    background: #f3f7fc;
    border-color: #cbd8e6;
    color: var(--app-heading);
}

.pagination .page-item.active .page-link,
.app-pagination .page-item.active .page-link {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
    box-shadow: 0 0 0 0.16rem rgba(55, 126, 194, 0.14);
}

.pagination .page-item.disabled .page-link,
.app-pagination .page-item.disabled .page-link {
    background: #f7f9fc;
    border-color: var(--app-border);
    color: #90a0b3;
    opacity: 1;
}

.app-pagination__ellipsis .page-link {
    min-width: 1.9rem;
    padding-left: 0.38rem;
    padding-right: 0.38rem;
}

.progress {
    background-color: #e6edf6;
    border-radius: 999px;
}

.modal-content {
    border: 1px solid var(--app-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border);
    padding: 0.8rem 0.95rem;
}

.modal-body {
    padding: 0.95rem;
}

.modal-title {
    font-size: 0.98rem;
    line-height: 1.2;
}

.finance-multi-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
}

.finance-multi-filter-label {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-multi-filter-caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 0.28rem solid transparent;
    border-right: 0.28rem solid transparent;
    border-top: 0.34rem solid currentColor;
    opacity: 0.55;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.finance-multi-filter-toggle[aria-expanded="true"] .finance-multi-filter-caret {
    transform: rotate(180deg);
    opacity: 0.8;
}

.js-filter-panel {
    position: relative;
}

form.js-finance-filters.card,
form.js-finance-filters.card .card-body {
    overflow: visible;
}

.finance-filter-panel-menu {
    position: absolute;
    z-index: 1085;
    top: calc(100% + 0.35rem);
    left: 0;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.js-filter-panel.is-open .finance-filter-panel-menu {
    display: block !important;
}

.js-multi-filter .finance-filter-panel-menu {
    box-shadow: var(--shadow-md);
}

.dropdown-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-heading);
}

.app-inline-note {
    padding: 0.74rem 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-sm);
    background: var(--app-surface-muted);
    font-size: 0.86rem;
}

.operating-day-summary-overview td {
    background: #fbfcfe;
}

.operating-day-summary-table thead th {
    background: #f6f9fc;
}

.operating-day-summary-row--income td {
    background: #f4fbf6;
}

.operating-day-summary-row--expense td {
    background: #fff8f4;
}

.operating-day-confirm-summary {
    display: grid;
    gap: 0.55rem;
}

.operating-day-confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-sm);
    background: var(--app-surface-muted);
}

.operating-day-confirm-item__label {
    color: var(--app-muted);
    font-size: 0.84rem;
}

.operating-day-confirm-item__value {
    text-align: right;
    font-size: 0.88rem;
    color: var(--app-heading);
}

.transaction-modal-dialog {
    max-width: min(1120px, calc(100vw - 1.75rem));
}

.transaction-modal-dialog .modal-content {
    max-height: min(92vh, 980px);
    overflow: hidden;
}

.transaction-modal-header {
    flex: 0 0 auto;
    padding-top: 0.72rem;
    padding-bottom: 0.62rem;
    border-bottom: 1px solid rgba(214, 224, 235, 0.95);
}

.transaction-batch-panel {
    display: grid;
    gap: 0.8rem;
}

.transaction-batch-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.transaction-batch-list {
    display: grid;
    gap: 0.7rem;
}

.transaction-batch-empty {
    padding: 0.9rem 1rem;
    border: 1px dashed #c8d4e2;
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    color: var(--app-muted);
    font-size: 0.84rem;
    text-align: center;
}

.transaction-line-item {
    position: relative;
    padding: 0.72rem 2.8rem 0.66rem 0.72rem;
    border: 1px solid var(--app-border);
    border-radius: 0.7rem;
    background: #fbfcfe;
}

.transaction-line-item--invalid {
    border-color: rgba(177, 68, 68, 0.45);
    box-shadow: 0 0 0 0.14rem rgba(177, 68, 68, 0.08);
}

.transaction-line-item__grid {
    display: grid;
    gap: 0.56rem;
    align-items: end;
}

.transaction-line-item--fixed .transaction-line-item__grid {
    grid-template-columns: minmax(7rem, 0.9fr) minmax(7rem, 0.9fr) minmax(10rem, 1.18fr) minmax(4.8rem, 0.7fr) minmax(5.3rem, 0.78fr) minmax(5.8rem, 0.86fr) minmax(9.5rem, 1.12fr);
    grid-template-areas: "entry payment product quantity unit amount description";
}

.transaction-line-item--variable .transaction-line-item__grid {
    grid-template-columns: minmax(7rem, 0.9fr) minmax(7rem, 0.9fr) minmax(11rem, 1.38fr) minmax(6rem, 0.96fr) minmax(9.5rem, 1.12fr);
    grid-template-areas: "entry payment product amount description";
}

.transaction-line-item__field {
    min-width: 0;
}

.transaction-line-item__field--entry {
    grid-area: entry;
}

.transaction-line-item__field--payment {
    grid-area: payment;
}

.transaction-line-item__field--product {
    grid-area: product;
}

.transaction-line-item__field--quantity {
    grid-area: quantity;
}

.transaction-line-item__field--unit-price {
    grid-area: unit;
}

.transaction-line-item__field--amount {
    grid-area: amount;
}

.transaction-line-item__field--description {
    grid-area: description;
}

.transaction-line-item__field .form-label {
    margin-bottom: 0.24rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--app-heading);
}

.transaction-line-item__field--product,
.transaction-line-item__field--description {
    min-width: 0;
}

.transaction-line-item__field--remove {
    position: absolute;
    top: 0.14rem;
    right: 0.14rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    z-index: 2;
}

.transaction-line-item__field--remove .form-label {
    display: none;
}

.transaction-line-item__remove {
    min-width: 1.88rem;
    min-height: 1.36rem;
    padding: 0.08rem 0.26rem;
    margin-left: auto;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1;
    border-color: rgba(177, 68, 68, 0.25);
    color: #9e3d3d;
    background: rgba(177, 68, 68, 0.04);
    border-radius: 999px;
}

.transaction-line-item__remove:hover,
.transaction-line-item__remove:focus {
    border-color: rgba(177, 68, 68, 0.38);
    color: #892f2f;
    background: rgba(177, 68, 68, 0.08);
}

.transaction-line-item__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.58rem;
    padding-top: 0.48rem;
    border-top: 1px dashed rgba(199, 210, 222, 0.9);
}

.transaction-line-item__hint {
    min-width: 0;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.transaction-line-item__total {
    white-space: nowrap;
    color: var(--app-heading);
    font-size: 0.8rem;
}

.transaction-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.transaction-modal-body {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.85rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 0;
    padding-top: 0.78rem;
    padding-bottom: 0.62rem;
}

.transaction-modal-hint-wrap {
    min-height: 100%;
}

.transaction-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    padding-left: 0.95rem !important;
    padding-right: 0.95rem !important;
    background: #fff;
    border-top: 1px solid rgba(214, 224, 235, 0.95);
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.04);
}

.transaction-modal-footer__actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-left: auto;
    flex: 0 0 auto;
}

.transaction-batch-summary {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.transaction-batch-summary__item {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.transaction-batch-summary__label {
    display: inline;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted);
}

.transaction-batch-summary__value {
    display: inline;
    margin-top: 0;
    font-size: 0.76rem;
    color: var(--app-heading);
    font-weight: 700;
    white-space: nowrap;
}

.app-collapse-toggle {
    border: 0;
    background: transparent;
    color: var(--app-heading) !important;
    font-weight: 600;
    min-height: auto;
    padding-top: 0.82rem !important;
    padding-bottom: 0.82rem !important;
}

.card-header > .d-flex,
.card-header > [class*="justify-content-"] {
    align-items: center !important;
}

.card-header form.d-flex,
.card-header form.row {
    align-items: center !important;
    margin-bottom: 0;
}

.card-header .btn,
.card-header .form-control,
.card-header .form-select {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.card-header .row.g-2 > .col-auto,
.card-header .row.g-3 > .col-auto {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-header .row.g-2 > .col-auto.align-self-end,
.card-header .row.g-3 > .col-auto.align-self-end {
    align-self: center !important;
}

form.app-toolbar-form--labeled.row,
.app-filter-grid {
    align-items: flex-end !important;
}

.app-filter-grid > [class*="col-"],
form.app-toolbar-form--labeled.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.app-page-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: flex-end;
}

.app-toolbar-inline {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}

.a4-sheet {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14mm;
}

.report-sheet {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.report-sheet__header {
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(215, 225, 238, 0.9);
}

.report-section-title {
    margin-bottom: 0.7rem;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--app-heading);
}

.report-summary-table > tbody > tr > th,
.report-summary-table > tbody > tr > td {
    background: #fcfdff;
}

.report-summary-table > tbody > tr > th {
    width: 58%;
    color: var(--app-heading);
    font-weight: 600;
}

.report-row--neutral > * {
    background: #f8fbff !important;
}

.report-row--income > * {
    background: rgba(31, 122, 79, 0.08) !important;
}

.report-row--expense > * {
    background: rgba(177, 68, 68, 0.08) !important;
}

.report-row--profit > * {
    background: rgba(36, 94, 168, 0.08) !important;
}

.report-row--strong > * {
    font-weight: 700;
}

.report-entries-wrap {
    border-radius: var(--radius-sm);
}

.report-empty-state {
    background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
}

.report-main-wrap {
    border-radius: var(--radius-sm);
}

.report-main-table,
.report-dual-table {
    margin-bottom: 0;
}

.report-main-table > tbody > tr > th,
.report-main-table > tbody > tr > td {
    background: #fcfdff;
}

.report-main-table > tbody > tr > th {
    width: 72%;
    color: var(--app-heading);
    font-weight: 600;
}

.report-dual-table {
    table-layout: fixed;
}

.report-dual-table__label-col {
    width: 36%;
}

.report-dual-table__amount-col {
    width: 14%;
}

.report-dual-table > :not(caption) > * > * {
    padding: 0.46rem 0.58rem;
}

.report-dual-table > thead > tr:first-child > th {
    background: #eef4fb;
    text-align: center;
    font-size: 0.72rem;
}

.report-dual-table > thead > tr:last-child > th {
    background: #f5f8fc;
    font-size: 0.69rem;
}

.report-dual-cell {
    vertical-align: top;
    background: #fcfdff;
}

.report-dual-cell--empty {
    background: #fbfcfe;
    opacity: 0.72;
}

.report-cell--neutral {
    background: #f7fbff !important;
}

.report-cell--income {
    background: rgba(31, 122, 79, 0.11) !important;
}

.report-cell--expense {
    background: rgba(177, 68, 68, 0.11) !important;
}

.report-cell--profit {
    background: rgba(36, 94, 168, 0.12) !important;
}

.report-dual-cell--total {
    font-weight: 700;
}

.report-dual-cell--group {
    box-shadow: inset 3px 0 0 rgba(15, 39, 64, 0.08);
}

.report-dual-cell--level-1.report-dual-cell--group {
    box-shadow: inset 4px 0 0 rgba(15, 39, 64, 0.12);
}

.report-dual-label {
    display: block;
    padding-left: calc(var(--report-tree-level, 0) * 0.9rem);
    color: var(--app-heading);
}

.report-dual-detail {
    display: block;
    margin-top: 0.12rem;
    padding-left: calc(var(--report-tree-level, 0) * 0.9rem);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.28;
    color: #4f6178;
}

.report-dual-delta {
    display: block;
    margin-top: 0.08rem;
    padding-left: calc(var(--report-tree-level, 0) * 0.9rem);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: 0.01em;
}

.report-dual-delta--positive {
    color: #1f6b46;
}

.report-dual-delta--negative {
    color: #a04343;
}

.report-dual-delta--neutral {
    color: #66768a;
}

.report-dual-cell--level-0 {
    font-size: 0.85rem;
}

.report-dual-cell--level-1 {
    font-size: 0.81rem;
}

.report-dual-cell--level-2,
.report-dual-cell--level-3,
.report-dual-cell--level-4 {
    font-size: 0.78rem;
}

.report-dual-cell--level-0 .report-dual-label,
.report-dual-cell--total .report-dual-label {
    font-weight: 700;
}

.report-dual-cell--group .report-dual-label {
    font-weight: 650;
}

.report-dual-cell--leaf .report-dual-label {
    font-weight: 560;
    color: var(--app-text);
}

.report-dual-footer__label,
.report-dual-footer__amount {
    font-size: 0.86rem;
    font-weight: 700;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
}

@media (max-width: 991.98px) {
    .app-shell__content.container {
        padding-top: 1.25rem;
        padding-bottom: 1.75rem;
    }

    .card-header,
    .card-body,
    .card-footer,
    .modal-body,
    .modal-header,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-header__title {
        font-size: 1.45rem;
    }

    .table > :not(caption) > * > * {
        padding-left: 0.72rem;
        padding-right: 0.72rem;
    }

    .transaction-line-item--fixed .transaction-line-item__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-areas:
            "entry payment product amount description description"
            "quantity unit . . . .";
        gap: 0.52rem;
    }

    .transaction-line-item--variable .transaction-line-item__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-template-areas:
            "entry payment product amount description";
        gap: 0.52rem;
    }
}

@media (max-width: 767.98px) {
    #transactionModal .modal-dialog.transaction-modal-dialog.modal-dialog-centered {
        display: block;
        min-height: 0;
        margin-top: 0.45rem;
        margin-bottom: 0.45rem;
    }

    .page-header {
        align-items: stretch;
    }

    .app-page-actions,
    .app-toolbar-inline,
    form.app-toolbar-form--labeled.row {
        width: 100%;
    }

    .app-page-actions > *:not(.app-toolbar-mobile-inline),
    .app-toolbar-inline > * {
        width: 100%;
    }

    .app-toolbar-mobile-inline {
        width: 100%;
    }

    .app-toolbar-mobile-inline > .btn {
        flex: 1 1 0;
    }

    .app-filter-grid > [class*="col-"],
    form.app-toolbar-form--labeled.row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .app-filter-grid .btn,
    .app-filter-grid .form-control,
    .app-filter-grid .form-select,
    .app-filter-grid .finance-multi-filter-toggle,
    form.app-toolbar-form--labeled.row .btn,
    form.app-toolbar-form--labeled.row .form-control,
    form.app-toolbar-form--labeled.row .form-select {
        width: 100%;
    }

    .page-header__title {
        font-size: 1.24rem;
    }

    .operating-day-confirm-item {
        flex-direction: column;
        align-items: stretch;
    }

    .operating-day-confirm-item__value {
        text-align: left;
    }

    .transaction-modal-dialog {
        max-width: calc(100vw - 0.8rem);
        margin: 0.4rem auto;
    }

    .transaction-modal-dialog .modal-content {
        max-height: calc(100dvh - 0.9rem);
    }

    .transaction-modal-header {
        padding-top: 0.66rem;
        padding-bottom: 0.54rem;
    }

    .transaction-modal-body {
        padding-top: 0.68rem;
        padding-bottom: 0.54rem;
    }

    .transaction-batch-panel__header {
        align-items: stretch;
        gap: 0.55rem;
    }

    .transaction-batch-panel__header > .btn {
        width: auto;
        align-self: flex-start;
    }

    .transaction-line-item,
    .transaction-line-item__meta {
        gap: 0.55rem;
    }

    .transaction-line-item {
        padding: 0.6rem 2.2rem 0.58rem 0.58rem;
    }

    .transaction-line-item--fixed .transaction-line-item__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "entry payment"
            "product product"
            "quantity unit"
            "amount description";
        gap: 0.48rem;
        align-items: end;
    }

    .transaction-line-item--variable .transaction-line-item__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "entry payment"
            "product product"
            "amount description";
        gap: 0.48rem;
        align-items: end;
    }

    .transaction-line-item__remove {
        width: auto;
        min-width: 1.78rem;
        min-height: 1.28rem;
        padding: 0.08rem 0.24rem;
        margin-top: 0;
        margin-left: auto;
        font-size: 0.52rem;
    }

    .transaction-line-item__meta {
        flex-direction: column;
        align-items: stretch;
    }

    .transaction-line-item__total {
        white-space: normal;
    }

    .transaction-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        padding-top: 0.42rem !important;
        padding-bottom: 0.42rem !important;
        padding-left: 0.72rem !important;
        padding-right: 0.72rem !important;
    }

    .transaction-batch-summary {
        width: 100%;
        justify-content: space-between;
        gap: 0.4rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .transaction-batch-summary::-webkit-scrollbar {
        display: none;
    }

    .transaction-modal-footer__actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        margin-left: 0;
    }

    .transaction-modal-footer__actions > .btn {
        width: 100%;
    }

    .report-main-table > tbody > tr > th {
        width: auto;
    }

    .report-dual-table__label-col,
    .report-dual-table__amount-col {
        width: auto;
    }

    .report-dual-table > :not(caption) > * > * {
        padding: 0.42rem 0.5rem;
    }

    .a4-sheet {
        padding: 0.65rem;
        border-radius: var(--radius-sm);
    }

    .report-sheet__header {
        padding-bottom: 0.45rem;
        margin-bottom: 0.5rem !important;
    }

    .report-section-title {
        margin-bottom: 0.45rem;
    }

    .report-dual-label,
    .report-dual-detail,
    .report-dual-delta {
        padding-left: calc(var(--report-tree-level, 0) * 0.62rem);
    }

    .app-pagination-footer {
        justify-content: flex-start;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .transaction-batch-summary__label {
        font-size: 0.6rem;
    }

    .transaction-batch-summary__value {
        font-size: 0.7rem;
    }

    .pagination .page-link,
    .app-pagination .page-link {
        min-width: 1.95rem;
        height: 1.88rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        border-radius: 0.56rem;
        font-size: 0.82rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .no-print,
    .navbar,
    .alert,
    .btn,
    .card-header,
    .container > .d-flex,
    .page-header {
        display: none !important;
    }

    .container,
    .app-shell__content.container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .a4-sheet {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 10mm;
        width: 210mm;
        min-height: 297mm;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .a4-sheet .table {
        font-size: 0.82rem;
    }

    .a4-sheet .table > :not(caption) > * > * {
        padding: 0.42rem 0.5rem;
    }

    .a4-sheet .table > thead > tr > th {
        font-size: 0.68rem;
    }

    .report-sheet {
        padding: 8mm;
    }

    .report-section-title {
        margin-bottom: 0.45rem;
        font-size: 0.78rem;
    }

    .report-sheet__header {
        margin-bottom: 0.55rem !important;
        padding-bottom: 0.45rem;
    }

    .report-dual-detail {
        font-size: 0.66rem;
        margin-top: 0.08rem;
    }

    .report-dual-delta {
        font-size: 0.63rem;
        margin-top: 0.06rem;
    }

    .report-dual-footer__label,
    .report-dual-footer__amount {
        font-size: 0.8rem;
    }

    .report-row--neutral > *,
    .report-row--income > *,
    .report-row--expense > *,
    .report-row--profit > * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .report-cell--neutral,
    .report-cell--income,
    .report-cell--expense,
    .report-cell--profit {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
