:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #18243a;
  background: #f4f6fa;
  font-size: 16px;
  font-weight: 450;
  --ink: #18243a;
  --muted: #627087;
  --border: #e3e9f0;
  --brand: #087c68;
  --brand-dark: #076853;
  --nav: #101d30;
  --mint: #e0f6ef;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #119e87; outline-offset: 2px; }
svg { display: block; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.boot { display: grid; min-height: 100dvh; place-items: center; padding: 1rem; color: var(--muted); text-align: center; }

.layout { --sidebar-width: 226px; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); z-index: 3; padding: 26px 14px 17px; background: var(--nav); color: #b5c2d5; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 42px; color: #fff; }
.brand-mark { background: #30d4b1; color: #0d3031; display: grid; width: 39px; height: 39px; border-radius: 11px; place-items: center; flex: none; box-shadow: inset 0 0 0 1px #ffffff4a; }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 1.17rem; font-weight: 750; letter-spacing: .045em; line-height: 1.35; }
.brand small, .profile small { display: block; font-size: .75rem; color: #a5b4c8; line-height: 1.4; margin-top: 3px; }
.nav-label { margin: 0 12px 11px; color: #92a1b7; font-size: .78rem; letter-spacing: .085em; }
#nav { display: flex; flex-direction: column; gap: 5px; }
#nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 11px 12px; border-radius: 9px; font-size: .92rem; font-weight: 580; white-space: nowrap; }
#nav a:hover { background: #ffffff0a; color: #fff; }
#nav a.active { color: #7eebd1; background: #183b42; box-shadow: inset 0 0 0 1px #9be7d516; }
#nav a.active::before { content: ''; position: absolute; width: 3px; height: 18px; left: 0; background: #4adbbb; border-radius: 0 3px 3px 0; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #334155; padding: 15px 5px 0; }
.profile { display: flex; align-items: center; gap: 9px; font-size: .88rem; }
.profile strong { color: #e6edf8; font-weight: 650; }
.profile-icon { background: #25364d; color: #c4d2e6; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.profile .icon-button { margin-left: auto; color: #b4c3d7; }
.profile .icon-button:hover { background: #28394e; color: #fff; }

.shell { margin-left: var(--sidebar-width); min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 69px; padding: 0 32px; border-bottom: 1px solid var(--border); background: #fff; }
.location, .top-actions, .heading-actions { display: flex; gap: 12px; align-items: center; }
.location { color: #637185; font-size: .88rem; }
.location strong { color: var(--ink); font-weight: 650; }
.location svg { width: 18px; height: 18px; }
.breadcrumb-divider { color: #a1acbb; }
.mobile-brand { display: none; }
.demo-tag { color: #80570b; background: #fbf1da; border: 1px solid #f3e6c5; display: inline-flex; gap: 6px; align-items: center; border-radius: 20px; padding: 5px 10px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.demo-tag i { background: #b27810; width: 6px; height: 6px; border-radius: 50%; }

.page { display: grid; gap: 20px; padding: 27px 32px 44px; max-width: 1640px; margin: 0 auto; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 1px; }
.page-heading h1 { font-size: clamp(1.55rem, 2.4vw, 2rem); line-height: 1.2; font-weight: 760; letter-spacing: .02em; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; min-height: 40px; padding: 8px 13px; white-space: nowrap; font-size: .875rem; font-weight: 650; line-height: 1.2; }
.button svg { width: 17px; height: 17px; }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 1px 2px #013b301c; }
.button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.secondary { background: #fff; color: #344258; border-color: #dce5ed; box-shadow: 0 1px 2px #0c26330a; }
.button.secondary:hover { background: #f6faf9; border-color: #a8ccc2; }
.icon-button { min-height: 36px; width: 36px; padding: 0; border: 0; color: #627087; background: transparent; }
.icon-button:hover { background: #edf2f7; color: var(--ink); }
.button.text-button { background: none; color: var(--brand-dark); min-height: 36px; padding: 5px 8px; }
.button.text-button:hover { background: #e8f7f2; }
.button.danger { background: #ad303b; color: #fff; }
.button.danger:hover { background: #932732; }
.text-link { color: var(--brand-dark); font-weight: 680; font-size: .875rem; }
.text-link:hover { text-decoration: underline; }
.ink-green { color: #087a65; }
.ink-red, .button.ink-red { color: #a83240; }

select, input:not([type="checkbox"]), textarea { color: var(--ink); border: 1px solid #dbe3ed; border-radius: 8px; background: #fff; padding: 9px 11px; min-height: 40px; min-width: 0; }
input::placeholder, textarea::placeholder { color: #68778a; }
select { appearance: none; padding-right: 33px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 5.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23546378' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { resize: vertical; }
.period { display: inline-flex; align-items: center; gap: 0; border: 1px solid #dce5ed; background: #fff; border-radius: 8px; color: #536279; padding-left: 11px; }
.period svg { width: 17px; height: 17px; }
.period select { border: 0; font-size: .875rem; min-height: 38px; font-weight: 620; padding-left: 8px; }

.hero { position: relative; isolation: isolate; display: flex; gap: 22px; justify-content: space-between; align-items: end; overflow: hidden; min-height: 164px; padding: 23px 25px; border-radius: 14px; background: linear-gradient(110deg, #103634 0%, #104c44 51%, #11604e 100%); color: white; box-shadow: 0 7px 19px #1953481b; }
.hero-ring { pointer-events: none; z-index: -1; position: absolute; border: 1px solid #b3fae42e; border-radius: 50%; aspect-ratio: 1; right: 5%; top: 68%; transform: translate(50%,-50%); background: #b5ffdd05; }
.ring-outer { width: 500px; }
.ring-mid { width: 383px; }
.ring-inner { width: 255px; }
.hero-caption { display: flex; align-items: center; gap: 9px; color: #d1f1e9; font-size: .92rem; font-weight: 650; }
.hero-caption svg { width: 18px; height: 18px; color: #67e0c4; }
.hero-amount { display: block; margin: 8px 0 11px; font-size: clamp(1.95rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 740; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero-breakdown { display: flex; column-gap: 17px; row-gap: 7px; flex-wrap: wrap; color: #c5e6df; font-size: .8125rem; }
.hero-breakdown b { margin-left: 4px; color: #f5fffc; white-space: nowrap; }
.cash-hero { flex: none; min-width: 205px; color: #d9f4ea; background: #e5fff017; padding: 12px 16px; border: 1px solid #caffeb35; border-radius: 10px; }
.cash-hero div { font-size: .86rem; }
.cash-hero strong { display: block; margin: 4px 0 5px; color: #fff; font-size: 1.45rem; font-weight: 740; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cash-hero small { display: block; font-size: .75rem; color: #d3ede6; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.metrics.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px 13px; box-shadow: 0 2px 4px #1a315005; }
.metric-head { display: flex; align-items: center; gap: 9px; color: #536178; font-weight: 630; font-size: .875rem; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; }
.metric-icon svg { width: 19px; height: 19px; }
.mint { background: #e5f7f0; color: #087a65; }
.orange { background: #fff1e5; color: #ab540f; }
.blue { background: #eaf0ff; color: #315eb5; }
.violet { background: #eeeafd; color: #6541b5; }
.metric > strong { display: block; margin-top: 10px; font-variant-numeric: tabular-nums; font-size: clamp(1.18rem, 1.95vw, 1.67rem); font-weight: 735; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric > small { display: block; margin-top: 4px; color: var(--muted); font-size: .7875rem; line-height: 1.38; }

.overview-grid { display: grid; align-items: stretch; gap: 16px; grid-template-columns: minmax(0,1.8fr) minmax(275px,1fr); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 2px 4px #1a315005; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 17px 19px 14px; }
.panel-head h2 { font-size: 1.0625rem; font-weight: 735; line-height: 1.3; }
.panel-head p { color: var(--muted); font-size: .815rem; line-height: 1.45; margin-top: 5px; }
.chart-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #526075; white-space: nowrap; font-size: .76rem; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 50%; background: #0b9e84; }
.chart-legend span:nth-child(2) i { background: #7190e9; }
.chart-area { position: relative; padding: 2px 13px 8px 5px; }
#trend { display: block; width: 100%; height: 215px; }
.chart-tip { position: absolute; top: 8px; right: 18px; pointer-events: none; background: #122339; color: #fff; border-radius: 7px; box-shadow: 0 3px 13px #13233035; padding: 8px 11px; font-size: .8rem; }
.chart-tip > * { display: block; line-height: 1.45; }
.balances-panel { display: flex; flex-direction: column; }
.segments { display: inline-flex; width: fit-content; padding: 3px; border: 1px solid #e4eaf0; border-radius: 8px; background: #f0f3f8; }
.segments button { border: 1px solid transparent; background: transparent; color: #526179; padding: 7px 16px; min-height: 35px; border-radius: 6px; font-size: .875rem; font-weight: 640; }
.segments button.selected { background: white; color: var(--brand-dark); border-color: #e4eaf0; box-shadow: 0 1px 2px #172c4212; }
.segments.small { margin: 0 19px; }
.segments.small button { padding: 5px 14px; min-height: 30px; }
.balance-list { display: grid; gap: 11px; padding: 12px 19px 7px; }
.balance-list .blank { min-height: 100px; }
.balance-meta { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; font-size: .86rem; font-weight: 700; flex: none; }
.avatar-0 { color: #0a705d; background: #e1f6ee; }
.avatar-1 { color: #305db5; background: #eaf0ff; }
.avatar-2 { color: #6846b6; background: #f0ebfd; }
.avatar svg { width: 17px; height: 17px; }
.balance-meta > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.balance-meta strong { font-size: .875rem; }
.balance-meta small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.balance-meta b { font-size: .875rem; font-weight: 730; font-variant-numeric: tabular-nums; }
.balance-row progress { appearance: none; display: block; height: 5px; width: calc(100% - 42px); margin: 5px 0 0 auto; border-radius: 999px; background: #eef2f7; border: 0; color: #1faf93; }
.balance-row progress::-webkit-progress-bar { background: #eef2f7; border-radius: 999px; }
.balance-row progress::-webkit-progress-value { background: #20ab90; border-radius: 999px; }
.balance-row progress::-moz-progress-bar { background: #20ab90; border-radius: 999px; }
.panel-link { margin: auto 19px 12px; padding: 6px 0 2px; }

.table-wrap { overflow-x: auto; border-radius: 0 0 12px 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { background: #f7f9fc; white-space: nowrap; color: #56657b; font-weight: 650; padding: 10px 12px; border-block: 1px solid #eaf0f5; }
td { padding: 10px 12px; border-bottom: 1px solid #edf1f5; color: #344359; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); font-weight: 660; }
td small { display: block; margin-top: 3px; font-size: .76rem; color: var(--muted); }
.row-date, .numeric, .table-action { white-space: nowrap; font-variant-numeric: tabular-nums; }
.align-right, .table-action { text-align: right; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; white-space: nowrap; font-size: .775rem; line-height: 1.2; font-weight: 655; }
.pill.green { background: #e3f7ef; color: #08634c; }
.pill.blue { background: #e9efff; color: #2a57a7; }
.pill.amber { background: #fcf1d9; color: #805607; }
.pill.neutral { background: #edf1f6; color: #536279; }
.blank { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 18px; gap: 8px; color: var(--muted); min-height: 129px; font-size: .9rem; }
.blank svg { color: #657d90; width: 25px; height: 25px; }
.blank .button svg { width: 16px; height: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 19px 13px; font-size: .875rem; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid #dbe3ed; border-radius: 8px; padding-left: 10px; color: #68778a; min-width: min(265px,100%); }
.search svg { width: 17px; height: 17px; }
.search input[type="search"] { border: 0; min-height: 38px; flex: 1; width: 100%; padding-left: 0; }

.settlement-list { padding: 0 19px 16px; }
.settlement-group { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.settlement-group + .settlement-group { margin-top: 9px; }
.group-summary { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 11px; padding: 11px; background: #f7f9fc; }
.group-summary h3 { font-size: 1rem; overflow-wrap: anywhere; }
.group-summary small, .group-breakdown small { display: block; color: var(--muted); font-size: .77rem; margin-top: 3px; }
.group-summary > strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.group-breakdown > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 8px 11px 8px 17px; color: #33445a; font-size: .875rem; }
.group-breakdown > div + div { border-top: 1px solid #edf1f5; }
.group-breakdown span { overflow-wrap: anywhere; }
.group-breakdown b { font-variant-numeric: tabular-nums; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chips { padding: 0 19px 13px; }
.chips > div:not(.blank) { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: .9rem; }
.chips strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chips > div + div { border-top: 1px solid var(--border); }

dialog { color: var(--ink); width: min(525px, calc(100% - 30px)); max-height: min(92dvh, 850px); padding: 0; border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 18px 66px #07172e40; overflow: hidden; }
dialog.wide { width: min(790px, calc(100% - 30px)); }
dialog::backdrop { background: #0d1b30a0; }
#modal-form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head, .dialog-foot { display: flex; align-items: center; padding: 13px 18px; gap: 9px; }
.dialog-head { border-bottom: 1px solid var(--border); justify-content: space-between; }
.dialog-head h2 { font-size: 1.13rem; }
.dialog-foot { border-top: 1px solid var(--border); justify-content: flex-end; }
.dialog-foot-start { margin-right: auto; }
.dialog-body { padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; color: #344258; font-size: .875rem; font-weight: 620; }
.field input, .field select, .field textarea { width: 100%; font-weight: 460; font-size: 1rem; }
.field .span-all, .span-all { grid-column: 1 / -1; }
.field input[readonly] { background: #f3f6fa; color: #536179; }
.field-help { color: var(--muted); font-size: .875rem; line-height: 1.55; margin: 10px 0; }
.import-help { margin-top: 0; }
.form-section { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-top: 12px; }
.form-section h3, .detail-heading { font-size: .95rem; line-height: 1.4; }
.form-section > h3 { margin-bottom: 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.supply-fields { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.75fr) minmax(0,.9fr) minmax(0,1.1fr); gap: 8px; flex: 1; min-width: 0; }
.supply-line { display: flex; align-items: end; gap: 5px; }
.supply-line + .supply-line { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.supply-line .icon-button { flex: none; margin-bottom: 2px; }
.charge-picks { max-height: 240px; overflow-y: auto; }
.charge-pick { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: .875rem; }
.charge-pick > label:first-child { display: flex; gap: 9px; align-items: center; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.charge-pick small { display: block; font-size: .76rem; margin-top: 4px; color: var(--muted); }
.charge-pick input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--brand); flex: none; }
.pick-amount { flex: 0 0 min(130px,40%); }
.pick-amount input { width: 100%; }
.pick-amount input:disabled { background: #f3f6fa; color: #68778a; }
.payment-total { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--brand-dark); font-size: .94rem; }
.dialog-body > .field { margin-top: 10px; }
.file-field { margin-top: 16px; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 0; }
.details dt { color: var(--muted); margin-bottom: 4px; font-size: .79rem; }
.details dd { overflow-wrap: anywhere; margin: 0; font-size: .95rem; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.detail-heading { margin: 14px 0 7px; }
.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.detail-list small { display: block; margin-top: 3px; color: var(--muted); font-size: .77rem; }
.form-error { background: #fff1f1; color: #9f2936; border: 1px solid #f2d1d6; border-radius: 8px; padding: 9px; margin-top: 10px; font-size: .88rem; line-height: 1.5; }
.toast { position: fixed; z-index: 5; bottom: 24px; right: 25px; max-width: min(420px,calc(100% - 30px)); background: #162a3d; color: #fff; border-radius: 9px; box-shadow: 0 4px 20px #0e233348; padding: 12px 16px; font-size: .9rem; }
.login { display: grid; min-height: 100dvh; place-items: center; padding: 20px; background: radial-gradient(ellipse at 35% 10%, #e5f8f1, #f4f6fa 56%); }
.login-card { width: min(100%,390px); padding: 24px; border: 1px solid var(--border); border-radius: 13px; background: white; box-shadow: 0 12px 42px #18324614; }
.login-card h1 { margin-top: 10px; }
.login-card > p:not(.form-error) { color: var(--muted); margin: 6px 0 20px; }
.login-card .button { width: 100%; margin-top: 14px; }

@media (max-width: 1120px) {
  .layout { --sidebar-width: 196px; }
  .topbar { padding-inline: 22px; }
  .page { padding-inline: 22px; }
  .metrics { gap: 10px; }
  .metric { padding-inline: 11px; }
  .hero-breakdown { column-gap: 9px; }
}

@media (max-width: 920px) {
  .overview-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cash-hero { min-width: 160px; }
  .settings-grid { grid-template-columns: 1fr; }
  .panel-head { padding-inline: 15px; }
  .table-wrap th, .table-wrap td { padding-inline: 9px; }
}

@media (max-width: 740px) {
  .sidebar { inset: auto 0 0; width: 100%; padding: 3px 3px max(3px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #fff; color: #53637a; box-shadow: 0 -4px 20px #1024390c; }
  .sidebar .brand, .nav-label { display: none; }
  .sidebar-foot { position: absolute; top: -49px; right: 7px; padding: 0; border: 0; }
  .profile > span { display: none; }
  .profile .icon-button:not([hidden]) { width: 39px; height: 39px; background: #fff; color: #536179; border: 1px solid var(--border); box-shadow: 0 2px 9px #12243a14; }
  #nav { flex-direction: row; gap: 0; }
  #nav a { flex: 1; min-width: 0; min-height: 49px; gap: 4px; justify-content: center; flex-direction: column; padding: 5px 1px; font-size: .735rem; border-radius: 7px; }
  #nav a.active, #nav a:hover { color: var(--brand-dark); background: #e9f8f3; }
  #nav a.active::before { display: none; }
  #nav svg { width: 18px; height: 18px; }
  .shell { margin-left: 0; }
  .topbar { height: 58px; padding-inline: 13px; }
  .topbar .location { display: none; }
  .top-actions { gap: 7px; }
  .mobile-brand { display: flex; gap: 7px; align-items: center; font-size: .97rem; font-weight: 745; white-space: nowrap; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
  .mobile-brand .brand-mark svg { width: 17px; height: 17px; }
  .quick-add { padding-inline: 8px; }
  .demo-tag { padding: 4px 7px; }
  .demo-tag i { display: none; }
  .page { padding: 16px 13px calc(76px + env(safe-area-inset-bottom)); gap: 14px; }
  .page-heading { align-items: start; }
  .page-heading p { margin-top: 5px; }
  .heading-actions { gap: 6px; }
  .period { padding-left: 7px; }
  .period select { padding-left: 5px; }
  .overview-grid { gap: 14px; }
  .panel-head { padding: 13px 13px 10px; }
  .segments.small { margin-inline: 13px; }
  .balance-list { padding-inline: 13px; }
  .panel-link { margin-inline: 13px; }
  .toolbar, .settlement-list, .chips { padding-inline: 13px; }
  .toast { bottom: calc(63px + env(safe-area-inset-bottom)); right: 12px; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 10px; padding: 12px 13px; border-top: 1px solid var(--border); }
  tbody tr:nth-child(even) { background: #f8fafc; }
  tbody tr:last-child { border-radius: 0 0 12px 12px; }
  .table-wrap tbody td { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; }
  tbody td:not(.table-action)::before { display: block; content: attr(data-label); color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
  tbody td.table-action { align-self: end; }
}

@media (max-width: 475px) {
  .hero { display: grid; align-items: start; gap: 12px; padding: 16px 13px; }
  .hero-breakdown { column-gap: 10px; }
  .hero-ring { right: -7%; }
  .cash-hero { display: grid; align-items: center; grid-template-columns: 1fr auto; padding: 8px 10px; gap: 4px; }
  .cash-hero strong { margin: 0; font-size: 1.14rem; }
  .cash-hero small { grid-column: 1 / -1; }
  .metrics.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics.three .metric:last-child { grid-column: 1 / -1; }
  .metric { padding: 10px; }
  .metric-icon { width: 29px; height: 29px; }
  .metric-head { gap: 6px; }
  .metric > strong { margin-top: 7px; }
  .group-summary { grid-template-columns: auto 1fr auto; }
  .group-summary .button { grid-column: 2 / -1; justify-self: end; min-height: 34px; }
  .group-summary > strong { font-size: .95rem; }
  .supply-fields { grid-template-columns: 1fr 1fr; }
  .dialog-head, .dialog-foot, .dialog-body { padding-inline: 12px; }
  .dialog-foot .button { min-height: 44px; }
  .form-grid { gap: 8px; }
  .chart-legend { gap: 7px; }
  #trend { height: 175px; }
}

@media (max-width: 350px) {
  .demo-tag { display: none; }
  .heading-actions .button { padding-inline: 7px; }
  .metric-head { font-size: .8rem; }
  .chart-legend { font-size: .71rem; }
  .supply-line { align-items: start; }
}

.relation-panel { overflow: hidden; }
.relation-panel > .panel-head { border-bottom: 1px solid var(--border); }
.relation-panel select { max-width: 160px; font-size: .875rem; }
.route-legend { display: flex; flex-wrap: wrap; gap: 8px 19px; color: var(--muted); font-size: .875rem; }
.route-legend span { display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.route-legend i { width: 20px; height: 2px; border-radius: 999px; background: #a9b7c9; }
.route-legend span:first-child i { height: 3px; background: #0ca68c; }
.relation-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(58px,.52fr) minmax(0,1fr);
  align-items: start;
  padding: 16px 20px 20px;
  background: radial-gradient(circle, #dce5ed 1px, transparent 1px) 0 0 / 16px 16px #f8fafc;
}
#relations { position: absolute; inset: 0; height: 100%; width: 100%; pointer-events: none; z-index: 2; }
.relation-column { display: grid; gap: 12px; min-width: 0; }
.relation-column.client { grid-column: 1; }
.relation-column.supplier { grid-column: 3; }
.relation-column-head { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.relation-column-head h2 { font-size: 1rem; line-height: 1.3; white-space: nowrap; }
.relation-column-head h2 span { margin-left: 3px; color: #566e84; font-size: .8rem; font-weight: 600; }
.relation-column-head .button { background: #f8fafc; }
.relation-party { padding: 10px 0 0; border: 1px solid #deE7ef; border-radius: 10px; background: #fff; box-shadow: 0 2px 5px #233c5910; }
.relation-party header { display: flex; align-items: center; gap: 8px; padding: 0 10px 9px; }
.relation-party header > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.relation-party h3 { font-weight: 690; font-size: .96rem; }
.relation-party small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.relation-party header .button { padding-inline: 5px; }
.relation-items { display: grid; gap: 5px; padding: 0 9px; }
.relation-node { display: flex; align-items: center; gap: 2px; border: 1px solid #e5ebf3; border-radius: 6px; background: #f7f9fc; min-width: 0; }
.relation-node.linked { border-color: #d3e3e5; background: #f4faf8; }
.relation-node.chosen { border-color: #35a892; background: #e7f8f2; }
.node-label, .node-edit { color: #294258; background: none; border: 0; min-width: 0; }
.node-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex: 1; min-height: 37px; text-align: left; padding: 5px 2px 5px 9px; font-size: .875rem; }
.node-label strong { min-width: 0; overflow-wrap: anywhere; }
.node-label span { color: #086853; white-space: nowrap; font-size: .81rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.node-label .unpriced { color: #69798b; font-weight: 500; }
.node-edit { display: grid; flex: none; place-items: center; padding: 3px; width: 28px; height: 34px; border-radius: 6px; }
.node-edit svg { width: 14px; height: 14px; }
.node-edit:hover, .node-label:hover { background: #e7f6f1; }
.relation-party footer { padding: 3px 8px; }
.no-node { margin: 2px 0; padding: 8px; color: var(--muted); font-size: .83rem; }
.route-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 18px 15px; gap: 7px; }
.route-list-item { display: flex; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; color: #314358; font-size: .875rem; }
.route-list-item > div, .route-list-item > strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.route-list-item small { display: block; color: var(--muted); margin-top: 3px; font-size: .76rem; }
.route-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9b7c9; flex: none; }
.route-dot.live { background: #0ca68c; }
.route-state { font-size: .77rem; color: #68798a; white-space: nowrap; }
.route-state.running { font-weight: 650; color: #087962; }
.dialog-body > .route-list { grid-template-columns: 1fr; padding: 0; }
.monitor-toolbar, .account-scope { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: .875rem; }
.monitor-toolbar label, .account-scope label { display: flex; align-items: center; gap: 7px; }
.monitor-toolbar input { accent-color: var(--brand); width: 17px; height: 17px; }
.account-scope label > span { font-weight: 650; }
.account-scope select { max-width: min(48vw,270px); min-width: 130px; }
.job-progress { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.job-progress progress { width: 76px; height: 9px; accent-color: var(--brand); }

.profit-toolbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 12px 16px; }
.profit-range-toolbar, .profit-source { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; }
.profit-dates, .profit-source { color: var(--muted); font-size: .83rem; }
.profit-source label { display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.profit-source input { accent-color: var(--brand); width: 16px; height: 16px; }
.profit-month input { font-size: .875rem; }
.profit-report { min-width: 0; display: grid; gap: 14px; }
.profit-formula { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.profit-day { border-top: 2px solid #b3dbd1; }
.profit-day-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 12px 16px; }
.profit-day-title { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.profit-day-title h2 { font-size: 1.04rem; font-variant-numeric: tabular-nums; }
.profit-day-title small { display: block; color: var(--muted); font-size: .77rem; margin-top: 3px; }
.profit-day-totals { display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.profit-day-totals > div { background: #edf7f4; border-radius: 7px; padding: 5px 9px; min-width: 92px; }
.profit-day-totals > div:last-child { background: #eef3fb; }
.profit-day-totals span { display: block; color: var(--muted); font-size: .74rem; }
.profit-day-totals strong { display: block; font-size: .94rem; margin-top: 2px; }
.profit-day td, .profit-day th { padding-inline: 8px; }
.profit-day th:first-child, .profit-day td:first-child { padding-left: 16px; }
.profit-day th:last-child, .profit-day td:last-child { padding-right: 16px; }
.profit-day tr:not(.profit-note-row) td:first-child { min-width: 115px; }
.profit-day td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.profit-empty { padding: 9px 16px 13px; color: var(--muted); font-size: .84rem; }
.profit-note-row td { background: #fbfcfd; color: var(--muted); font-size: .78rem; white-space: normal; overflow-wrap: anywhere; }

.daily-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 7px; color: var(--muted); font-size: .85rem; }
.daily-accounts { display: grid; gap: 17px; min-width: 0; }
.daily-businesses { display: grid; gap: 11px; padding: 0 16px 16px; }
.daily-business { min-width: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.daily-business-head, .daily-unpaid-head, .daily-detail-toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 10px 13px; }
.daily-business-head { background: #f8fafc; }
.daily-business-head h3 { font-size: 1.05rem; }
.daily-business-head p, .daily-detail-grid header p { color: var(--muted); font-size: .82rem; line-height: 1.45; margin-top: 4px; }
.daily-unpaid-head { font-size: .88rem; border-top: 1px solid var(--border); padding-block: 5px; }
.daily-unpaid-head span { color: var(--muted); font-weight: 550; margin-left: 4px; }
.daily-balances { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; padding: 10px 13px; gap: 10px; }
.daily-balances > div { border-radius: 7px; background: #f3f7fa; padding: 7px 9px; min-width: 0; }
.daily-balances > div:first-child { background: #eaf5f0; }
.daily-balances dt { color: var(--muted); font-size: .76rem; }
.daily-balances dd { margin: 3px 0 0; font-weight: 680; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.daily-none { color: var(--muted); padding: 8px 13px 13px; font-size: .83rem; }
dialog.extended { width: min(1120px,calc(100vw - 24px)); }
.daily-detail-toolbar { padding: 0 0 12px; font-size: .86rem; }
.daily-detail-toolbar label { display: flex; align-items: center; gap: 7px; }
.daily-detail-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(226px,1fr); align-items: start; gap: 13px; }
.daily-detail-grid > section, .daily-detail-grid > aside { min-width: 0; border: 1px solid var(--border); border-radius: 9px; }
.daily-detail-grid header { padding: 10px 13px; }
.daily-detail-grid h3 { font-size: 1rem; }
.daily-detail-grid td { font-size: .82rem; }
.daily-payments { display: grid; gap: 7px; padding: 0 10px 10px; }
.daily-payment-record { display: grid; gap: 5px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; color: #263b4f; }
.daily-payment-record > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px; }
.daily-payment-record span, .daily-payment-record small { font-size: .77rem; }
.daily-payment-record small { color: var(--muted); overflow-wrap: anywhere; }
.daily-payment-record > button { justify-self: end; min-height: 28px; }

@media (max-width: 740px) {
  #nav.six-tabs a span { text-align: center; white-space: normal; line-height: 1.12; }
  .profit-toolbar { padding: 10px; }
  .profit-range-toolbar .segments button { padding-inline: 9px; }
  .profit-day-head { padding: 10px; gap: 8px; }
  .profit-day-totals { order: 3; width: 100%; gap: 8px; }
  .profit-day-totals > div { flex: 1; }
  .profit-day .table-wrap td { white-space: normal; }
  .profit-day .profit-note-row td { grid-column: 1 / -1; }
  .daily-detail-grid { grid-template-columns: 1fr; }
  .daily-detail-grid > aside { grid-row: 1; }
  .daily-businesses { padding-inline: 9px; }
  .daily-balances { gap: 5px; padding-inline: 8px; }
  .daily-balances > div { padding-inline: 5px; }
  .daily-balances dd { font-size: .91rem; }
}

@media (max-width: 740px) {
  .relation-layout { grid-template-columns: minmax(0,1fr) minmax(22px,.24fr) minmax(0,1fr); padding: 10px 8px 13px; }
  .relation-column { gap: 9px; }
  .relation-column-head { flex-wrap: wrap; }
  .relation-column-head .button { min-height: 30px; padding: 4px; font-size: .78rem; }
  .relation-column-head h2 { font-size: .89rem; }
  .relation-party header { flex-wrap: wrap; gap: 5px; padding-inline: 6px; }
  .relation-party header .avatar { width: 24px; height: 24px; border-radius: 6px; }
  .relation-party header .avatar svg { width: 13px; height: 13px; }
  .relation-party header .button { min-height: 24px; font-size: .75rem; }
  .relation-party h3 { font-size: .83rem; }
  .relation-party small { font-size: .68rem; }
  .relation-items { padding: 0 5px; }
  .node-label { align-items: start; flex-direction: column; justify-content: center; gap: 2px; padding: 4px; font-size: .82rem; min-height: 40px; }
  .node-label span { font-size: .73rem; }
  .node-edit { width: 22px; min-height: 33px; }
  .relation-party footer { padding: 2px 3px; }
  .relation-party footer .button { font-size: .77rem; padding-inline: 5px; min-height: 32px; }
  .route-list { grid-template-columns: 1fr; padding: 0 12px 12px; }
  .account-scope { gap: 6px 8px; }
  .account-scope select { max-width: 36vw; min-width: 95px; }
}
