:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --ink: #252833;
  --muted: #858895;
  --line: #eceef2;
  --purple: #7860d5;
  --purple-soft: #f0ecfb;
  --green: #2d9a7e;
  --green-soft: #eaf7f1;
  --red: #d76d76;
  --red-soft: #fff0f1;
  --radius: 16px;
  --shadow: 0 3px 16px #22243b03;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
.oidc-login {
  text-decoration: none;
  margin-bottom: 20px;
}
.login-form .field[hidden],
.login-form button[hidden],
.chat-panel[hidden],
.chat-launcher[hidden] {
  display: none;
}
.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  border: 0;
  border-radius: 24px;
  background: var(--purple);
  color: white;
  padding: 14px 20px;
  box-shadow: 0 8px 30px #46317530;
  font-size: 12px;
  font-weight: 650;
}
.chat-panel {
  position: fixed;
  right: 20px;
  top: 100px;
  bottom: 82px;
  width: 370px;
  max-width: calc(100vw - 32px);
  z-index: 26;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 80px #33334d26;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.chat-heading h2 {
  font-size: 15px;
}
.chat-heading p {
  color: var(--purple);
  font-size: 10px;
  margin-top: 6px;
}
.chat-close {
  font-size: 25px;
}
.chat-explainer {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  padding: 14px 20px 0;
}
.chat-messages {
  flex: 1;
  min-height: 100px;
  overflow: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.8;
  padding: 12px;
  border-radius: 12px;
  background: #f5f3fb;
}
.chat-message.user {
  background: var(--purple);
  color: white;
  margin-left: 25px;
}
.chat-message.error {
  background: var(--red-soft);
  color: var(--red);
}
#chat-form {
  padding: 15px 20px 18px;
  border-top: 1px solid var(--line);
}
.chat-consent {
  font-size: 11px;
  padding: 8px;
  border: 0;
}
.chat-privacy {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  margin: 6px 0 12px;
}
#chat-question {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  max-height: 160px;
  min-height: 60px;
  font-size: 12px;
}
.chat-form-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.chat-status {
  color: var(--muted);
  font-size: 10px;
}
@media (max-width: 700px) {
  .chat-panel {
    top: 76px;
    right: 16px;
    bottom: 82px;
  }
  .chat-launcher {
    right: 16px;
    bottom: 18px;
  }
  .chat-heading {
    padding: 15px;
  }
  #chat-form {
    padding: 10px 15px;
  }
  .chat-privacy {
    max-height: 90px;
    overflow: auto;
  }
}
.share-link-field {
  margin-top: 22px;
}
.share-link-field input {
  font-size: 12px;
}
.share-revoke {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.wide-modal {
  max-width: 850px;
}
.import-table .control {
  min-width: 130px;
  display: block;
  margin-bottom: 6px;
}
.import-summary {
  background: var(--purple-soft);
  padding: 16px;
  border-radius: 10px;
  margin: 20px 0 10px;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.import-summary p {
  margin-top: 5px;
  color: #7a6b9e;
  font-size: 11px;
}
.import-table {
  overflow: auto;
  max-height: 300px;
}
#entity-form[data-type="csv-import"] .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
}
.import-table td {
  vertical-align: top;
}
.import-note {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 150px;
  max-width: 240px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin-top: 5px;
}
.bank-details {
  font-size: 11px;
  line-height: 1.8;
  color: #707482;
}
.bank-details summary {
  color: var(--purple);
  cursor: pointer;
}
.bank-details dl {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.bank-details dt {
  color: var(--muted);
}
.bank-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.shared-content {
  max-width: 1100px;
  margin: auto;
  padding: 38px 22px;
}
.shared-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 42px;
}
.shared-content h1 {
  overflow-wrap: anywhere;
}
.shared-stats {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.shared-content .item-title {
  white-space: normal;
  min-width: 120px;
  max-width: 500px;
  overflow-wrap: anywhere;
}
.shared-error {
  margin-top: 35px;
}
.shared-error-actions {
  display: flex;
  justify-content: center;
  padding-bottom: 25px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button {
  color: inherit;
}
a {
  color: var(--purple);
}
h1,
h2,
h3,
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #b6a6ed;
  outline-offset: 4px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #c5b6f3;
  outline-offset: 1px;
}
svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 36px 20px 20px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 24px;
  letter-spacing: -1px;
  font-weight: 750;
  padding-left: 9px;
}
.brand-mark {
  width: 35px;
  height: 35px;
  background: var(--purple);
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -3px;
  padding: 0 3px 5px 0;
}
.brand-dot {
  color: var(--purple);
}
.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
  color: #a0a2ad;
  margin: 47px 16px 15px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  background: none;
  width: 100%;
  padding: 13px 16px;
  color: #777b88;
  font-weight: 550;
  text-align: left;
  border-radius: 10px;
}
.nav button:hover {
  background: #f8f7fb;
}
.nav button.active {
  background: var(--purple-soft);
  color: var(--purple);
}
.nav .nav-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--purple);
}
.sidebar-bottom {
  margin-top: auto;
}
.local-note {
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  margin: 40px 3px 22px;
}
.local-note .note-heading {
  font-size: 12px;
  font-weight: 650;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}
.local-note .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}
.local-note p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.profile {
  border-top: 1px solid var(--line);
  padding: 20px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eeeaf8;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-name {
  font-size: 12px;
  font-weight: 650;
  max-width: 106px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.profile .icon-button {
  margin-left: auto;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 83px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  background: #ffffffb0;
  gap: 16px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9395a1;
  font-size: 12px;
}
.breadcrumb strong {
  font-weight: 500;
  color: #515462;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.private-badge {
  color: #858995;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.private-badge .icon {
  width: 13px;
  height: 13px;
}
.content {
  max-width: 1540px;
  margin: auto;
  padding: 35px 42px 28px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 11px;
  color: var(--purple);
  font-weight: 650;
  letter-spacing: 0.2px;
  margin-bottom: 9px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.9px;
  font-weight: 680;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.button {
  border: 1px solid #e4e5eb;
  border-radius: 9px;
  padding: 10px 14px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 550;
  min-height: 38px;
  white-space: nowrap;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button:hover {
  background: #f7f7fb;
}
.button.primary {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
  box-shadow: 0 3px 7px #7860d51c;
}
.button.primary:hover {
  background: #6951c4;
}
.button.danger {
  background: #d75e6b;
  border-color: #d75e6b;
  color: white;
}
.button .icon {
  width: 16px;
  height: 16px;
}
.button.small {
  padding: 7px 10px;
  min-height: 31px;
  font-size: 11px;
}
.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--purple);
}
.icon-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9699a5;
  flex-shrink: 0;
}
.icon-button:hover {
  background: var(--purple-soft);
  color: var(--purple);
}
.icon-button .icon {
  width: 16px;
  height: 16px;
}
.month-picker {
  display: flex;
  gap: 5px;
  align-items: center;
  background: white;
  border: 1px solid #e4e5eb;
  padding: 3px 5px;
  border-radius: 9px;
}
.month-picker input {
  border: none;
  background: transparent;
  font-size: 12px;
  color: #565966;
  width: 137px;
  padding: 5px;
}
.month-picker .icon-button {
  width: 25px;
  height: 28px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #777b88;
  font-size: 11px;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--purple-soft);
  color: var(--purple);
}
.stat-icon .icon {
  width: 16px;
  height: 16px;
}
.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}
.stat-icon.red {
  background: var(--red-soft);
  color: var(--red);
}
.stat-icon.orange {
  background: #fff5e9;
  color: #d5a156;
}
.stat-value {
  font-size: 27px;
  letter-spacing: -1px;
  font-weight: 650;
  margin-top: 13px;
  white-space: nowrap;
}
.stat-bottom {
  font-size: 10px;
  margin-top: 11px;
  color: #9295a0;
  display: flex;
  gap: 5px;
  align-items: center;
  line-height: 1.4;
}
.stat-bottom .icon {
  width: 12px;
  height: 12px;
}
.positive {
  color: var(--green) !important;
}
.negative {
  color: var(--red) !important;
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 0;
}
.card h2 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.15px;
}
.card-description {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin-top: 5px;
}
.card-content {
  padding: 22px 24px;
}
.card-pill {
  font-size: 10px;
  color: #9698a3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  white-space: nowrap;
}
.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  color: #9194a0;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  flex-shrink: 0;
}
.sankey-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 8px 0;
}
.sankey-scroll:focus-visible {
  outline: 2px solid #c5b6f3;
  outline-offset: -3px;
}
.sankey {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
  min-height: 235px;
}
.sankey text {
  font-family: inherit;
}
.sankey-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: #9598a3;
  padding: 0 24px 20px;
}
.sankey-caption span {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sankey-caption .icon {
  width: 12px;
  height: 12px;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  padding: 45px 25px;
  min-height: 240px;
}
.empty-icon {
  width: 49px;
  height: 49px;
  background: #f4f1fc;
  color: #9a86db;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
}
.empty-icon .icon {
  width: 23px;
  height: 23px;
}
.empty h3 {
  font-size: 13px;
  font-weight: 600;
}
.empty p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 300px;
  margin: 8px 0 17px;
}
.empty.compact {
  min-height: 205px;
  padding: 24px;
}
.row-list {
  padding: 7px 24px 15px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 0;
  border-bottom: 1px solid #f1f2f5;
}
.list-row:last-child {
  border-bottom: none;
}
.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--purple-soft);
  color: var(--purple);
  flex-shrink: 0;
}
.item-icon.green {
  background: var(--green-soft);
  color: var(--green);
}
.item-icon.red {
  background: var(--red-soft);
  color: var(--red);
}
.item-icon.blue {
  background: #eef3fc;
  color: #7898c9;
}
.item-icon.orange {
  background: #fff5e9;
  color: #d4a05a;
}
.item-icon .icon {
  width: 17px;
  height: 17px;
}
.item-info {
  min-width: 0;
  flex: 1;
}
.item-title {
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.item-sub {
  font-size: 10px;
  color: #979aa5;
  margin-top: 5px;
  line-height: 1.5;
}
.item-value {
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.item-value small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #a0a2ad;
  margin-top: 5px;
}
.card-footer {
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-footer strong {
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--purple);
  font-size: 11px;
  background: none;
  border: none;
  padding: 3px 0;
  white-space: nowrap;
}
.text-link .icon {
  width: 13px;
  height: 13px;
}
.table-wrap {
  overflow-x: auto;
  padding: 8px 24px 12px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
th {
  color: #9a9da8;
  font-size: 10px;
  font-weight: 500;
  padding: 13px 12px 12px 0;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 12px 15px 0;
  border-bottom: 1px solid #f2f3f6;
}
tr:last-child td {
  border-bottom: none;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
.table-title {
  display: flex;
  align-items: center;
  gap: 11px;
}
.table-title .item-info {
  max-width: 240px;
}
.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.actions-cell {
  width: 72px;
  text-align: right;
}
.muted {
  color: var(--muted);
}
.tag {
  font-size: 10px;
  border: 1px solid #efedf5;
  background: #faf9fd;
  color: #8a7cae;
  padding: 4px 8px;
  border-radius: 5px;
  display: inline-block;
}
.tag.green {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}
.tag.gray {
  background: #f4f5f7;
  color: #9295a0;
  border-color: transparent;
}
.tag.red {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #a3a5af;
  margin-top: 28px;
  padding: 0 2px;
  gap: 15px;
}
.footer span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.footer .icon {
  width: 11px;
  height: 11px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search > .icon {
  position: absolute;
  left: 12px;
  top: 11px;
  color: #a3a5af;
  width: 16px;
  height: 16px;
}
.search input {
  padding-left: 38px;
  width: 100%;
}
.control {
  border: 1px solid #e5e7ee;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #5e6270;
  min-height: 39px;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.account-card {
  padding: 23px;
}
.account-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.account-top h3 {
  font-size: 13px;
  font-weight: 600;
}
.account-top .account-actions {
  margin-left: auto;
  display: flex;
}
.account-card .balance {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.account-card .account-foot {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.allocation-row {
  margin-bottom: 21px;
}
.allocation-row:last-child {
  margin-bottom: 0;
}
.allocation-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 10px;
}
.allocation-label span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress {
  height: 7px;
  background: #f2f2f8;
  border-radius: 5px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 5px;
}
.insight {
  padding: 18px 20px;
  border: 1px solid #e8e3f7;
  background: #f5f2fd;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  color: #8370b5;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 20px;
}
.insight .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}
.insight strong {
  color: #655293;
  display: block;
}
.chart {
  height: 210px;
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 15px 0 5px;
}
.chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}
.chart-bars {
  height: 155px;
  display: flex;
  gap: 5px;
  align-items: flex-end;
  width: 100%;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.chart-bar {
  width: 15px;
  max-width: 35%;
  border-radius: 4px 4px 0 0;
  background: #aa97e9;
  min-height: 2px;
}
.chart-bar.expense {
  background: #e7dff8;
}
.chart-label {
  font-size: 10px;
  color: #9699a5;
}
.group-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.group-selector {
  padding: 10px;
}
.group-option {
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  gap: 11px;
  text-align: left;
  padding: 15px 12px;
  border-radius: 10px;
  align-items: center;
}
.group-option:hover {
  background: #f8f7fb;
}
.group-option.active {
  background: var(--purple-soft);
}
.group-option .item-title {
  white-space: normal;
}
.group-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.group-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 3px;
  flex-wrap: wrap;
}
.group-toolbar h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
  flex: 1;
}
.member-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 23px;
}
.member-card {
  flex: 1;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 16px;
}
.member-card .avatar {
  margin-bottom: 12px;
}
.member-card .name {
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 8px;
}
.member-card .balance {
  font-size: 16px;
  font-weight: 650;
}
.member-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.debt-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.debt-row:last-child {
  border: 0;
}
.debt-row .debt-description {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.debt-row .icon {
  color: #a8a2b9;
  width: 14px;
  height: 14px;
}
.split-detail {
  font-size: 10px;
  max-width: 360px;
  white-space: normal;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 4px;
}
.mobile-menu {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 25px 100px #22223e26;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  color: var(--ink);
}
dialog::backdrop {
  background: #24243866;
  backdrop-filter: blur(4px);
}
.modal-header {
  padding: 24px 26px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.modal-header h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
}
.modal-body {
  padding: 24px 26px;
}
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fcfcfe;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label,
.field-label {
  font-size: 12px;
  font-weight: 550;
  color: #626574;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e2e4eb;
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
  font-size: 13px;
  color: var(--ink);
  min-height: 41px;
}
.field textarea {
  resize: vertical;
  min-height: 85px;
}
.field small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.field.full {
  grid-column: 1/-1;
}
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 3px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.check-label input {
  accent-color: var(--purple);
  width: 15px;
  min-height: 15px;
  margin: 0;
}
.error-message {
  color: #c95965;
  background: #fff1f2;
  border: 1px solid #f6dce0;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.error-message:empty {
  display: none;
}
.confirm-text {
  font-size: 13px;
  color: #777b88;
  line-height: 1.8;
}
.initial-loading {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}
#toasts {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #30313d;
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 5px 24px #2223;
  line-height: 1.6;
  animation: appear 0.2s ease-out;
}
.toast.error {
  background: #aa4c59;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.login-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-hero {
  background: #efebfa;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 65px;
  overflow: hidden;
  position: relative;
}
.login-hero:after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border: 1px solid #d6cdef;
  border-radius: 50%;
  right: -180px;
  bottom: -250px;
  pointer-events: none;
}
.login-hero h1 {
  font-size: 47px;
  line-height: 1.2;
  letter-spacing: -2px;
  max-width: 450px;
}
.login-hero h1 span {
  color: var(--purple);
}
.login-hero p {
  color: #9387b2;
  font-size: 14px;
  line-height: 1.9;
  max-width: 360px;
  margin-top: 22px;
}
.login-hero .hero-art {
  margin: 45px 0;
  display: flex;
  gap: 15px;
  transform: rotate(-4deg);
}
.hero-art .mini-card {
  padding: 23px;
  border-radius: 16px;
  background: #ffffffc9;
  min-width: 180px;
  box-shadow: 0 8px 25px #75618e08;
}
.mini-card small {
  color: #a49ab8;
  font-size: 10px;
}
.mini-card b {
  display: block;
  font-size: 23px;
  font-weight: 600;
  margin: 13px 0 15px;
  letter-spacing: -0.7px;
}
.mini-bars {
  height: 47px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}
.mini-bars i {
  display: block;
  width: 13px;
  background: #c3b2ed;
  border-radius: 3px;
}
.mini-card:last-child {
  transform: translateY(28px);
}
.hero-bottom {
  font-size: 11px;
  color: #a296b9;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-bottom .icon {
  width: 14px;
  height: 14px;
}
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form {
  width: 100%;
  max-width: 340px;
}
.login-form h2 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
}
.login-form > p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 30px;
}
.login-form .button {
  width: 100%;
  margin-top: 6px;
  min-height: 43px;
}
.login-form .login-hint {
  font-size: 10px;
  color: #a2a3ae;
  text-align: center;
  margin-top: 22px;
  line-height: 1.8;
}
.login-mobile-brand {
  display: none;
}
.overview-bottom {
  margin-top: 22px;
}
.full-card {
  margin-top: 22px;
}
.section-note {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 18px;
}
.subscriptions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.subscription-card {
  padding: 23px;
}
.subscription-card.inactive {
  opacity: 0.65;
}
.subscription-card .sub-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.sub-top h3 {
  font-size: 13px;
  font-weight: 600;
}
.sub-top .icon-button {
  margin-left: auto;
}
.subscription-price {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1px;
}
.subscription-price small {
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}
.subscription-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
}
.subscription-actions {
  display: flex;
  gap: 7px;
  margin-top: 18px;
}
.subscription-actions .button:first-child {
  flex: 1;
}
.subscription-grid-header {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.noscript-message {
  padding: 30px;
  text-align: center;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 42px;
  }
  .stat {
    padding: 24px;
  }
  .grid-main {
    grid-template-columns: minmax(0, 1.8fr) minmax(330px, 1fr);
  }
  .sankey {
    min-height: 265px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 205px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .app {
    grid-template-columns: 205px 1fr;
  }
  .content {
    padding: 28px 26px;
  }
  .topbar {
    padding: 0 26px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 17px;
  }
  .stat-value {
    font-size: 23px;
  }
  .stat-top {
    font-size: 10px;
  }
  .account-grid,
  .subscriptions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 17px;
  }
  .card-head {
    padding: 20px 20px 0;
  }
  .card-content {
    padding: 20px;
  }
  .row-list {
    padding-left: 20px;
    padding-right: 20px;
  }
  .group-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-value {
    font-size: 28px;
  }
  .page-header {
    align-items: flex-start;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page-header .subtitle {
    max-width: 290px;
  }
  .group-layout {
    grid-template-columns: 1fr;
  }
  .group-selector {
    display: flex;
    overflow: auto;
    gap: 6px;
  }
  .group-option {
    width: auto;
    min-width: 175px;
  }
  .group-option .item-icon {
    display: none;
  }
  .private-badge {
    display: none;
  }
  .sankey {
    max-height: 350px;
  }
}
@media (max-width: 700px) {
  .app {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 232px;
    box-shadow: 10px 0 70px #2222;
  }
  .app.menu-open .sidebar {
    transform: translateX(0);
  }
  .app.menu-open:after {
    content: "";
    position: fixed;
    inset: 0;
    background: #25253555;
    z-index: 19;
  }
  .topbar {
    height: 64px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
  }
  .mobile-menu {
    display: inline-flex;
  }
  .breadcrumb {
    gap: 9px;
    min-width: 0;
  }
  .breadcrumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-actions {
    flex-shrink: 0;
  }
  .topbar-actions > .button[data-action="import-data"] {
    font-size: 0;
    gap: 0;
  }
  .breadcrumb > span,
  .breadcrumb > .icon {
    display: none;
  }
  .topbar-actions > .button {
    padding: 7px 10px;
    font-size: 11px;
    min-height: 33px;
  }
  .content {
    padding: 26px 19px;
  }
  .page-header {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 23px;
  }
  .page-header .subtitle {
    max-width: none;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .header-actions > .button {
    margin-left: auto;
  }
  .header-actions .month-picker:only-child {
    margin-left: auto;
  }
  h1 {
    font-size: 25px;
  }
  .eyebrow {
    font-size: 10px;
  }
  .stats {
    gap: 11px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 15px;
    border-radius: 12px;
  }
  .stat-value {
    font-size: 24px;
    margin-top: 11px;
  }
  .stat-bottom {
    font-size: 9px;
    min-height: 14px;
  }
  .stat-top {
    font-size: 10px;
  }
  .stat-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }
  .stat-icon .icon {
    width: 14px;
    height: 14px;
  }
  .card {
    border-radius: 13px;
  }
  .card-head {
    padding: 20px 18px 0;
  }
  .card-content {
    padding: 20px 18px;
  }
  .card h2 {
    font-size: 13px;
  }
  .card-description {
    font-size: 10px;
  }
  .card-pill {
    font-size: 9px;
  }
  .table-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
  .row-list {
    padding: 5px 18px 14px;
  }
  .sankey-caption {
    padding-left: 18px;
    padding-right: 18px;
    font-size: 9px;
  }
  .sankey {
    min-height: 200px;
  }
  .account-grid,
  .subscriptions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .footer {
    align-items: flex-start;
    font-size: 9px;
    line-height: 1.6;
  }
  .footer > span:last-child {
    display: none;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-hero {
    display: none;
  }
  .login-main {
    padding: 40px 26px;
  }
  .login-mobile-brand {
    display: block;
    margin-bottom: 60px;
  }
  .login-mobile-brand .brand {
    padding: 0;
  }
  .login-form {
    max-width: 360px;
  }
  .modal-header {
    padding: 21px;
  }
  .modal-body {
    padding: 21px;
  }
  .modal-footer {
    padding: 16px 21px;
  }
  .form-grid {
    gap: 0 12px;
  }
  .debt-row {
    align-items: flex-start;
  }
  .debt-row .button {
    font-size: 10px;
  }
  .member-grid {
    padding: 18px;
    gap: 10px;
  }
  .member-card {
    min-width: 115px;
  }
  .group-toolbar h2 {
    width: 100%;
    flex: auto;
  }
  .legend {
    font-size: 9px;
    gap: 8px;
  }
  .chart {
    gap: 10px;
  }
  .filters .control {
    flex: 1;
  }
  .search {
    min-width: 100%;
    flex-basis: 100%;
  }
  .subscription-price {
    font-size: 27px;
  }
  .overview-bottom .table-wrap th:nth-child(3),
  .overview-bottom .table-wrap td:nth-child(3) {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
