@font-face {
  font-family: Inter;
  src: url('../vendor/inter/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bs-body-font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  --bs-body-color: #192237;
  --bs-body-bg: #f7f8fc;
  --bs-secondary-color: #5d687e;
  --bs-link-color: #5140bd;
  --bs-link-color-rgb: 81, 64, 189;
  --bs-link-hover-color: #392793;
  --line: #e6e9f1;
  --purple: #5643ce;
  --muted: #5d687e;
  --panel: #fff;
}

body { min-width: 0; font-size: .9rem; }
a { text-underline-offset: .16em; }
h1, h2, h3, p, dd { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 750; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: .95rem; font-weight: 700; }
p { color: var(--muted); }
.skip-link { position: absolute; z-index: 1100; padding: .75rem; background: white; }
.app-shell { display: flex; min-height: 100vh; }
.app-body { flex: 1; min-width: 0; }
.side-panel { --bs-offcanvas-width: min(17rem, 90vw); background: var(--panel); }
.side-inner { display: flex; flex-direction: column; height: 100%; padding: 1.55rem 1rem 1.25rem; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin: 0 .3rem 2.5rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--bs-body-color); font-weight: 760; text-decoration: none; letter-spacing: -.025em; line-height: 1.3; }
.brand-subtitle { display: block; color: var(--muted); font-size: .73rem; font-weight: 550; letter-spacing: 0; }
.brand-icon { display: grid; flex: 0 0 auto; place-items: center; width: 2.65rem; height: 2.65rem; border-radius: .8rem; background: var(--purple); color: white; font-size: 1.2rem; }
.side-nav { display: grid; gap: .28rem; }
.side-nav a { display: flex; align-items: center; gap: .72rem; padding: .75rem .85rem; border-radius: .65rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.side-nav a i { font-size: 1rem; }
.side-nav a:hover { background: #f5f3fe; color: var(--purple); }
.side-nav a.active { background: #efebff; color: #4632ae; }
.local-indicator { display: flex; align-items: center; gap: .55rem; margin: auto .4rem 0; padding: .9rem 0 .1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .73rem; font-weight: 550; }
.local-indicator span { width: .45rem; height: .45rem; border-radius: 50%; background: #16966d; }
.topbar { display: flex; align-items: center; gap: .75rem; min-height: 4.15rem; padding: .7rem clamp(1rem, 3vw, 2.4rem); border-bottom: 1px solid var(--line); background: var(--panel); font-weight: 650; }
.topbar-date { display: flex; align-items: center; gap: .55rem; margin-left: auto; color: var(--muted); font-size: .79rem; font-weight: 550; }
.topbar .btn { padding: .35rem .55rem; }
.workspace { width: min(100%, 96rem); margin-inline: auto; padding: clamp(1rem, 3vw, 2.4rem); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.45rem; }
.page-heading p { margin-top: .35rem; }
.heading-actions, .form-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.heading-actions { flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .36rem; border-radius: .55rem; padding: .56rem .85rem; font-size: .82rem; font-weight: 650; }
.btn-sm { padding: .32rem .55rem; font-size: .75rem; }
.btn-primary { --bs-btn-bg: #5643ce; --bs-btn-border-color: #5643ce; --bs-btn-hover-bg: #4735b5; --bs-btn-hover-border-color: #4735b5; --bs-btn-active-bg: #3f2ca7; --bs-btn-active-border-color: #3f2ca7; --bs-btn-focus-shadow-rgb: 86, 67, 206; }
.btn-outline-secondary { --bs-btn-color: #45506a; --bs-btn-border-color: #d9ddeb; --bs-btn-hover-color: #4735b5; --bs-btn-hover-bg: #f0ecff; --bs-btn-hover-border-color: #d9d1fc; --bs-btn-active-bg: #4632ae; --bs-btn-active-border-color: #4632ae; background: var(--panel); }
.text-link, .back-link { display: inline-flex; align-items: center; gap: .35rem; color: #4c3ab7; font-weight: 650; text-decoration: none; }
.text-link:hover, .back-link:hover { text-decoration: underline; }
.back-link { margin-bottom: 1rem; }

.quick-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-bottom: 1.1rem; }
.quick-filter .field { min-width: min(100%, 14rem); }
.quick-filter .field:has(.field-errors) { align-self: flex-start; }
.form-control, .form-select { min-height: 2.4rem; border-color: #d9ddeb; border-radius: .55rem; background-color: var(--panel); font-size: .86rem; }
.form-control:focus, .form-select:focus { background-color: var(--panel); border-color: #8a76ed; box-shadow: 0 0 0 .2rem #5643ce29; }
.form-label { margin-bottom: .35rem; color: #46516a; font-size: .79rem; font-weight: 670; }
.form-text { font-size: .78rem; }
.field-errors { margin-top: .35rem; color: #a72739; font-size: .8rem; }
.errorlist { margin: 0; padding-left: 1rem; }
[aria-invalid='true'] { border-color: #b73448; }

.quick-entry-panel { container-type: inline-size; padding: 1.1rem; margin-bottom: 1.15rem; }
.quick-entry-panel h2 { margin-bottom: .8rem; }
.quick-entry-panel > p { margin-bottom: .65rem; }
.quick-entry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-items: start; }
.quick-entry-fields > .btn { margin-top: 1.53rem; min-height: 2.4rem; }
.quick-entry-note { margin-top: .7rem; color: var(--muted); font-size: .78rem; }
.quick-entry-note summary { width: fit-content; cursor: pointer; }
.quick-entry-note .field { margin-top: .55rem; }
.quick-entry-note .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@container (min-width: 32rem) {
  .quick-entry-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (min-width: 44rem) {
  .quick-entry-fields {
    grid-template-columns: minmax(6rem, 1.7fr) minmax(5.45rem, .9fr) minmax(5rem, 1fr) minmax(4.25rem, .75fr) minmax(5rem, .85fr) minmax(8rem, 1fr) max-content;
    gap: .5rem;
  }
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem; margin-bottom: 1.2rem; }
.two-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric, .panel { border: 1px solid var(--line); border-radius: .95rem; background: var(--panel); box-shadow: 0 2px 4px #19223705; }
.metric { min-width: 0; padding: 1rem 1.1rem; }
.metric h2 { margin-top: .55rem; color: #4e5970; font-size: .82rem; }
.metric-value { display: block; margin-top: .2rem; font-size: clamp(1.13rem, 2vw, 1.64rem); font-weight: 740; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric p { margin-top: .22rem; font-size: .74rem; }
.metric-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 2.12rem; height: 2.12rem; border-radius: .61rem; background: #efebff; color: #5140bd; font-size: 1rem; }
.metric-icon.green { background: #e5f7ef; color: #126849; }
.metric-icon.red { background: #fcebed; color: #a63547; }
.metric-icon.purple { background: #efebff; color: #5140bd; }
.balance-metric { border-color: #5745c7; background: linear-gradient(123deg, #4938b4, #6450d8); color: #fff; }
.balance-metric h2, .balance-metric p { color: #f2eeff; }
.balance-metric .metric-icon { background: #ffffff2b; color: #fff; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); align-items: stretch; gap: 1rem; margin-bottom: 1.2rem; }
.panel { min-width: 0; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1.14rem 1.2rem; }
.panel-header p { margin-top: .24rem; font-size: .78rem; }
.panel-header .text-link { font-size: .8rem; }
.chart-frame { position: relative; height: 13.6rem; margin: .15rem 1.15rem 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .85rem; margin: 0 1.2rem .6rem; color: var(--muted); font-size: .73rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.chart-legend i { width: .55rem; height: .55rem; border-radius: .16rem; }
.legend-income { background: #604bd5; }
.legend-expense { background: #a699ed; }
.chart-data { margin: .55rem 1.2rem .9rem; color: var(--muted); font-size: .75rem; }
.chart-data summary { width: fit-content; cursor: pointer; }
.compact-table { margin: .5rem 0 0; font-size: .75rem; white-space: nowrap; }
.forecast-chart { margin-bottom: 1.2rem; }
.forecast-chart .chart-frame { height: 17rem; margin-bottom: 1rem; }
.open-panel { display: flex; flex-direction: column; }
.open-summary { margin: .13rem 1.2rem .65rem; }
.open-summary > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.open-summary dt { display: inline-flex; align-items: center; gap: .47rem; color: #45506a; font-size: .79rem; font-weight: 620; }
.open-summary dd { font-size: .88rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.open-summary .metric-icon { width: 1.8rem; height: 1.8rem; font-size: .84rem; }
.open-panel .text-link { align-self: flex-start; margin: auto 1.2rem 1.08rem; padding-top: .35rem; font-size: .8rem; }

.table-panel { overflow: hidden; margin-bottom: 1.15rem; }
.entry-table { --bs-table-bg: var(--panel); --bs-table-color: #46516a; --bs-table-border-color: var(--line); margin-bottom: 0; font-size: .82rem; }
.entry-table thead th { background: #f7f8fc; color: #526078; font-size: .72rem; font-weight: 700; }
.entry-table td, .entry-table th { padding: .67rem .52rem; }
.entry-table td:first-child, .entry-table th:first-child { padding-left: 1.2rem; }
.entry-table td:last-child, .entry-table th:last-child { padding-right: 1.2rem; }
.entry-table tbody tr:last-child > * { border-bottom: 0; }
.entry-table tbody th { min-width: 8rem; font-weight: 670; }
.entry-table tbody th a { color: #222c42; text-decoration: none; overflow-wrap: anywhere; }
.entry-table tbody th a:hover { color: #4c3ab7; text-decoration: underline; }
.booking-name { display: flex; align-items: center; gap: .35rem; }
.entry-table .booking-edit-link { display: inline-grid; flex: none; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: .35rem; color: var(--purple); font-size: .76rem; }
.entry-table .booking-edit-link:hover, .entry-table .booking-edit-link[aria-expanded='true'] { background: #efebff; text-decoration: none; }
.booking-editor-row > td { --bs-table-bg: #f7f8fc; }
.booking-inline-form { max-width: 65rem; padding-block: .35rem; }
.booking-editor-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .65rem; }
.booking-editor-note { margin-top: .65rem; }
.table-secondary { display: block; color: var(--muted); font-size: .7rem; font-weight: 500; margin-top: .12rem; }
.amount-cell { color: #26324a !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.signed-money { font-variant-numeric: tabular-nums; }
.booking-open { font-weight: 750; }
.booking-inactive { --bs-table-bg: #f7f8fc; }
.booking-switch { display: inline-grid; place-items: center; min-width: 2.55rem; min-height: 2rem; padding: .2rem; border: 0; border-radius: .4rem; background: transparent; cursor: pointer; }
.booking-switch:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
#booking-results[aria-busy='true'] .booking-switch { cursor: progress; }
#booking-results[aria-busy='true'] .booking-edit-link, #booking-results[aria-busy='true'] .booking-inline-form [type='submit'] { cursor: progress; }
.booking-switch-error:not(:empty) { display: block; max-width: 10rem; margin-inline: auto; color: #a63547; font-size: .72rem; }
.booking-switch-track { display: flex; align-items: center; width: 2.05rem; height: 1.15rem; padding: .125rem; border-radius: 1rem; background: #68758b; }
.booking-switch-track::before { content: ''; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; }
.booking-switch[aria-checked='true'] .booking-switch-track { justify-content: flex-end; background: var(--purple); }
@media (forced-colors: active) {
  .booking-switch-track { border: 1px solid ButtonText; background: ButtonFace; }
  .booking-switch-track::before { background: ButtonText; }
}
.money-positive { color: #126849; }
.money-negative { color: #a63547; }
.booking-group-summary { justify-content: flex-start; list-style: none; cursor: pointer; }
.booking-group-summary::-webkit-details-marker { display: none; }
.booking-group-summary:hover { background: #f7f8fc; }
.booking-group-summary:focus-visible { outline: 2px solid var(--purple); outline-offset: -3px; border-radius: inherit; }
.booking-group-chevron { flex: none; color: var(--muted); font-size: .78rem; }
.booking-group[open] .booking-group-chevron { transform: rotate(90deg); }
.booking-group-title { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.booking-group-parent { display: block; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: normal; }
.booking-count { margin-left: auto; color: var(--muted); font-size: .78rem; text-align: right; }
.booking-group tfoot > tr > * { border-top: 1px solid var(--line); border-bottom: 0; background: #f7f8fc; font-weight: 700; }
.booking-overall { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 1.2rem; }
.booking-overall dl { display: flex; flex-wrap: wrap; gap: .6rem 1.7rem; margin: 0; }
.booking-overall dt { color: var(--muted); font-size: .75rem; font-weight: 600; }
.booking-overall dd { font-weight: 720; }
.status-pill { display: inline-block; margin: .12rem .14rem .12rem 0; padding: .23rem .49rem; border-radius: 5rem; background: #edf0f7; color: #414e69; font-size: .69rem; font-weight: 670; white-space: nowrap; }
.status-pill.paid { background: #e5f7ef; color: #126849; }
.status-pill.partial { background: #fff2d9; color: #795400; }
.status-pill.overdue { background: #fcebed; color: #a63547; }
.empty-state { display: grid; justify-items: center; gap: .44rem; padding: 1.55rem 1rem; text-align: center; }
.empty-state p { font-size: .82rem; }
.filter-panel { margin-bottom: 1.1rem; }
.filter-panel > summary { padding: .7rem 1.1rem; border-radius: inherit; color: #45506a; font-size: .83rem; font-weight: 650; cursor: pointer; }
.filter-panel > form { padding: .35rem 1.1rem 1.1rem; }
.filter-state { margin-left: .4rem; color: var(--purple); font-size: .74rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.form-actions { margin-top: 1rem; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1.15rem; padding: .9rem 1.2rem; color: var(--muted); }
.table-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem; }
.group-card { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; padding: 1.15rem; overflow-wrap: anywhere; }
.group-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .5rem; }
.detail-panel, .edit-panel { margin-bottom: 1.15rem; padding: 1.2rem; }
.entry-metadata { display: flex; flex-wrap: wrap; gap: 1.25rem 2.1rem; margin: .85rem 0 0; }
.entry-metadata dt { color: var(--muted); font-size: .77rem; font-weight: 600; }
.entry-metadata dd { margin-top: .23rem; font-weight: 620; }
.entry-note { margin-top: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.edit-panel { max-width: 43rem; }
.edit-panel p { margin: .5rem 0 .85rem; overflow-wrap: anywhere; }
.edit-fields { display: grid; gap: .9rem; }
.auth-panel { max-width: 30rem; margin: clamp(1rem, 6vw, 4rem) auto; }
.auth-panel h1 { margin-bottom: 1.2rem; }
.account-panel { display: grid; justify-items: start; gap: .55rem; margin-top: auto; padding: .75rem .75rem 0; }
.account-email { max-width: 100%; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.account-panel + .local-indicator { margin-top: .8rem; }
.share-list { display: grid; gap: .7rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.share-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; padding-top: .7rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

@media (min-width: 992px) {
  .side-panel { position: sticky; top: 0; flex: 0 0 13.7rem; height: 100vh; border-right: 1px solid var(--line); background: var(--panel) !important; }
}

@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .metric { padding-inline: .8rem; }
}

@media (max-width: 720px) {
  .metric-grid, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { flex: 0 1 auto; }
  .chart-frame { height: 12rem; }
  .forecast-chart .chart-frame { height: 14rem; }
}

@media (max-width: 400px) {
  .three-metrics { grid-template-columns: 1fr; }
  .quick-filter .field { flex: 1 1 100%; }
  .topbar-date { font-size: .68rem; }
}
