:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #fff;
  --ink: #182824;
  --muted: #50635d;
  --line: #e2e8e1;
  --brand: #155846;
  --brand-dark: #103c32;
  --brand-light: #dff1e7;
  --warm: #d59853;
  --rail: #172e27;
  --rail-width: 218px;
  --radius: 15px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b17732; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.18; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 17px; letter-spacing: -.02em; line-height: 1.35; }
h3 { font-size: 14px; }
form { margin: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 3; padding: 9px 14px; background: #fff; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.rail { width: var(--rail-width); position: fixed; inset: 0 auto 0 0; background: var(--rail); color: #ecf5ee; display: flex; flex-direction: column; padding: 25px 14px 18px; z-index: 1; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 9px 33px; font-size: 19px; font-weight: 750; letter-spacing: .01em; }
.brand small { display: block; color: #b5c9bf; font-size: 11px; font-weight: 500; letter-spacing: .12em; margin-top: 1px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: #d8eead; color: var(--rail); display: inline-flex; align-items: end; justify-content: center; gap: 3px; padding: 9px; flex: 0 0 auto; }
.brand-mark i { display: block; width: 4px; border-radius: 1px; background: currentColor; height: 7px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.rail nav a { color: #d5e2d9; padding: 10px 12px; min-height: 43px; border-radius: 8px; display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.rail nav a:hover { background: #233e34; }
.rail nav a[aria-current] { background: #2d5141; color: #f3fbea; font-weight: 700; }
.rail nav a > span { width: 18px; text-align: center; font-size: 18px; line-height: 1; color: #accdb6; }
.nav-count { margin-left: auto; color: #e5edb8; background: #365946; min-width: 22px; padding: 1px 5px; border-radius: 7px; text-align: center; }
.nav-separator { border-top: 1px solid #375046; margin: 12px 10px 8px; }
.rail-note { margin: auto 11px 0; padding-top: 26px; color: #b9ccbf; font-size: 12px; }
.rail-note span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: #c9e498; border-radius: 50%; }
.workspace { margin-left: var(--rail-width); min-width: 0; }
.topbar { min-height: 67px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.workspace-label { font-weight: 650; color: #4b5f55; }
.mobile-brand { display: none; }
.account, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account { gap: 17px; }
.notification-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.notification-link[aria-current], .notification-link:hover { color: var(--brand); }
.notification-link b, .unread-label { color: #144d3b; background: #dcefe2; padding: 2px 7px; border-radius: 9px; font-size: 11px; }
.bell { display: inline-block; position: relative; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 7px 7px 3px 3px; }
.bell::after { content: ""; position: absolute; width: 4px; height: 2px; background: currentColor; bottom: -4px; left: 2.5px; border-radius: 0 0 4px 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; line-height: 1.2; font-weight: 650; }
.user-chip small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 3px; }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 33px; height: 33px; color: #22503d; background: #e7efe0; flex: 0 0 auto; }
.quiet { border: none; background: transparent; color: var(--muted); min-height: 36px; padding: 4px 3px; white-space: nowrap; }
.quiet:hover { color: var(--brand); text-decoration: underline; }
.content { width: min(100%, 1480px); padding: 31px 32px 48px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 13px; margin-bottom: 22px; }
.page-heading p { margin-top: 8px; color: var(--muted); }
.page-heading p .tag { margin-left: 4px; }
.button { display: inline-flex; justify-content: center; align-items: center; border-radius: 8px; border: 1px solid transparent; min-height: 40px; padding: 7px 14px; line-height: 1.35; text-align: center; white-space: nowrap; font-weight: 650; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: #fff; border-color: #cdd9d0; color: #254c3d; }
.secondary:hover { background: #edf4ed; }
.text-link, .back-link { color: var(--brand); font-weight: 650; }
.text-link:hover, .back-link:hover, .row-link:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 14px; }
.messages { margin-bottom: 16px; border: 1px solid #b6d8c3; color: #174d3b; background: #e7f3e9; padding: 10px 14px; border-radius: 9px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { min-width: 0; padding: 19px 18px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.metric > span { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric strong { display: block; font-size: clamp(19px, 2.35vw, 35px); font-variant-numeric: tabular-nums; letter-spacing: -.05em; line-height: 1.17; margin: 9px 0 10px; overflow-wrap: anywhere; }
.metric strong small { font-size: .54em; margin-right: 2px; letter-spacing: 0; }
.metric p { color: var(--muted); font-size: 12px; }
.metric p a { color: var(--brand); }
.metric-main { color: #f4fbf1; background: linear-gradient(125deg, #153b31, #21634e); border-color: transparent; }
.metric-main > span, .metric-main p { color: #d9efe3; }
.metric-main strong small { color: #cbe8b4; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.income { background: #367b61; }
.expense { background: var(--warm); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(235px, 1fr); gap: 16px; margin-bottom: 18px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 17px 19px 13px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 2px; }
.chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 8px 20px 16px; column-gap: 5px; }
.chart-month { text-align: center; color: var(--muted); font-size: 12px; }
.chart-month > span { display: block; padding-top: 6px; }
.bars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 108px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 26px, #edf0eb 26px, #edf0eb 27px); }
.bar { width: min(25%, 16px); height: var(--bar); border-radius: 3px 3px 0 0; }
.bar-income { background: #367b61; }
.bar-expense { background: var(--warm); }
.bar.negative { background-image: repeating-linear-gradient(135deg, transparent 0 2px, #fff8 2px 4px); }
.position dl, .detail dl { margin: 0; padding: 0 19px 14px; }
.position dl > div, .detail dl > div { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding: 10px 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.position dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.position a:hover { color: var(--brand); text-decoration: underline; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 510px; border-collapse: collapse; text-align: left; }
th, td { padding: 10px 14px; border-top: 1px solid #e9ede6; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { background: #f7f9f5; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
td:first-child { width: 35%; }
tr:hover td { background: #fbfcf9; }
.row-link { font-weight: 650; color: #203b31; overflow-wrap: anywhere; }
.row-id { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.tag { display: inline-block; color: #4e5f54; background: #edf0eb; border-radius: 5px; padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.tag-in, .tag-posted { color: #1e5b42; background: #e4f1e8; }
.tag-pending { color: #6c4212; background: #f8edd9; }
.tag-returned { color: #7b362d; background: #f6e7e3; }
.date-cell { white-space: nowrap; color: var(--muted); }
.amount, .detail-amount { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: #21694f; }
.align-right { text-align: right; }
.empty { padding: 25px 20px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 16px 19px; }
.filters .field { margin-bottom: 0; flex: 1 1 115px; max-width: 245px; }
.filters .field:has(input[name=q]) { flex-basis: 160px; }
.filters .form-errors { width: 100%; }
.subtotal { display: flex; flex-wrap: wrap; gap: 7px 18px; padding: 0 19px 13px; color: var(--muted); font-size: 13px; }
.subtotal span:first-child { color: var(--ink); font-weight: 700; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px; color: var(--muted); }
.tabs { padding: 0 19px; display: flex; gap: 16px; }
.tabs a { color: var(--muted); padding: 12px 3px 10px; border-bottom: 2px solid transparent; }
.tabs a[aria-current] { border-color: var(--brand); color: var(--brand); font-weight: 750; }

.options-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 112px; padding: 18px; }
.option p { color: var(--muted); margin-top: 6px; }
.option > span { color: var(--brand); font-size: 23px; }
.option:hover { border-color: #74a492; background: #f9fcf8; }
.form-panel { max-width: 680px; padding: 20px; }
.form-panel .section-heading { padding: 0 0 15px; }
.field { margin-bottom: 15px; min-width: 0; }
.field label { display: block; margin-bottom: 5px; font-weight: 650; }
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 40px; border: 1px solid #cad7cf; border-radius: 7px; padding: 8px 10px; color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; }
.field input[type=file] { padding: 6px 8px; }
.field input[type=file]::file-selector-button { background: #e9f0e8; color: #234936; border: 0; padding: 5px 8px; margin-right: 8px; border-radius: 5px; }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.help ul { margin: 5px 0; padding-left: 18px; }
.field .errorlist, .form-errors { background: #faedeb; color: #843026; padding: 8px 10px 8px 27px; border-radius: 7px; margin: 7px 0; }
.form-errors .errorlist { margin: 0; padding: 0; }
.callout { display: flex; flex-wrap: wrap; gap: 8px 21px; padding: 12px 15px; max-width: 680px; margin-bottom: 15px; background: #e7f1e7; border: 1px solid #d8e6d9; border-radius: 10px; color: #234f3d; overflow-wrap: anywhere; }
.callout strong { margin-left: 5px; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-list { padding: 0 19px 16px; }
.evidence-list ul { margin: 5px 0 0; padding-left: 17px; }
.evidence-list li { margin: 5px 0; overflow-wrap: anywhere; }
.activity, .management-list, .notice-list { margin: 0; padding: 0; list-style: none; }
.activity { padding: 0 19px 14px; }
.activity > li, .management-list > li, .notice-list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.activity small, .management-list small { display: block; color: var(--muted); margin-top: 2px; }
.activity p { color: var(--muted); margin-top: 4px; }
.activity details { margin-top: 6px; }
.activity summary { cursor: pointer; color: var(--brand); }
.snapshot { font-size: 12px; color: var(--muted); background: #f5f7f3; margin-top: 6px; padding: 8px; border-radius: 5px; overflow-wrap: anywhere; }
.management-list, .notice-list { padding: 0 19px; }
.management-list li, .notice-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.notice-list li:first-child { border-top: 0; }
.notice-list time { color: var(--muted); white-space: nowrap; font-size: 12px; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(270px, 1fr) minmax(290px, 420px); gap: clamp(24px, 8vw, 125px); align-items: center; width: min(100% - 38px, 960px); margin: auto; }
.login-brand .brand-mark { width: 48px; height: 48px; margin-bottom: 14px; padding: 14px; }
.login-brand h1 { font-size: clamp(34px, 5vw, 59px); }
.login-brand p { color: var(--muted); margin-top: 12px; }
.trial-pill { display: inline-block; margin-top: 18px; background: #e5efe2; color: var(--brand); padding: 4px 9px; border-radius: 8px; }
.login-card { padding: 25px; box-shadow: 0 12px 32px #1b412311; }
.login-card h2 { font-size: 23px; margin-bottom: 17px; }
.login-card .primary { width: 100%; }

@media (max-width: 1050px) {
  :root { --rail-width: 188px; }
  .topbar { padding-inline: 23px; }
  .content { padding-inline: 23px; }
  .metric { padding-inline: 13px; }
}
@media (max-width: 820px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .rail { position: static; width: auto; padding: 8px 10px; overflow: visible; }
  .rail nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .rail nav a { min-height: 38px; padding: 6px 7px; gap: 4px; font-size: 12px; }
  .rail nav a > span { width: 13px; font-size: 14px; }
  .rail .brand, .rail-note, .nav-separator, .workspace-label { display: none; }
  .workspace { margin-left: 0; }
  .topbar { padding-inline: 13px; min-height: 52px; }
  .mobile-brand { display: inline; font-weight: 750; white-space: nowrap; }
  .account { gap: 11px; flex-wrap: nowrap; }
  .user-chip > span:last-child { display: none; }
  .content { padding: 20px 13px 32px; }
  .page-heading { margin-bottom: 17px; }
  .summary-grid { gap: 9px; margin-bottom: 14px; }
  .metric { padding: 13px 11px 12px; }
  .metric strong { font-size: 23px; }
  .overview-grid { gap: 13px; }
  .section-heading { padding-inline: 13px; }
  .legend { gap: 7px; }
  .options-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .filters { padding-inline: 12px; }
  .subtotal { padding-inline: 12px; }
  .ledger-table { display: block; min-width: 0; }
  .ledger-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ledger-table tbody { display: block; }
  .ledger-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 8px; border-top: 1px solid var(--line); padding: 10px 12px; }
  .ledger-table td { width: auto; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .ledger-table tr:hover td { background: transparent; }
  .ledger-table td:nth-child(1) { grid-area: 1 / 1; }
  .ledger-table td:nth-child(2) { grid-area: 2 / 1; }
  .ledger-table td:nth-child(3) { display: none; }
  .ledger-table td.cell-info { display: block; grid-area: 3 / 1; font-size: 12px; color: var(--muted); }
  .ledger-table td:nth-child(4) { grid-area: 2 / 2; font-size: 12px; text-align: right; }
  .ledger-table td:nth-child(5) { grid-area: 1 / 2; padding-top: 1px; }
  .notice-list li { display: block; }
  .notice-list time { display: block; margin-top: 4px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); min-height: auto; padding: 35px 0; gap: 18px; max-width: 430px; }
  .login-card { padding: 18px; }
}
