.view-home, .view-bill-query, .view-invoice-folder {
  --ledger-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-family: var(--ledger-font); letter-spacing: 0;
}
.view-home .main, .view-bill-query .main, .view-invoice-folder .main { padding: 28px 32px 40px; background: #fff; }
.view-home .content, .view-bill-query .content, .view-invoice-folder .content { max-width: 1440px; }
.view-home .sidebar, .view-bill-query .sidebar, .view-invoice-folder .sidebar { background: #fcfafb; }
.view-home .brand h1, .view-bill-query .brand h1, .view-invoice-folder .brand h1 { font: 650 17px/1.5 var(--ledger-font); letter-spacing: 0; }
.view-home .brand h1 > span, .view-bill-query .brand h1 > span, .view-invoice-folder .brand h1 > span { display: block; }
.view-home .nav-cta, .view-bill-query .nav-cta, .view-invoice-folder .nav-cta { background: var(--rose); box-shadow: none; }
.view-home .sidebar-foot strong, .view-bill-query .sidebar-foot strong, .view-invoice-folder .sidebar-foot strong { font-family: var(--ledger-font); }
.ledger-page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.ledger-page-header h2 { margin: 0; font: 650 25px/1.4 var(--ledger-font); letter-spacing: 0; color: #29242b; }
.ledger-page-header p { margin: 5px 0 0; color: #807680; font-size: 12px; line-height: 1.5; }
.ledger-header-title, .ledger-header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ledger-header-title > div { min-width: 0; }
.ledger-page-header .btn, .ledger-filter-reset { min-height: 40px; padding: 8px 14px; font: 600 13px/1.4 var(--ledger-font); border-radius: 6px; box-shadow: none; white-space: nowrap; }
.ledger-page-header .btn-ghost, .ledger-filter-reset { color: #5a5059; background: #fff; border-color: #e3dfe4; }
.ledger-page-header .btn-primary { background: var(--rose); color: #fff; }
.ledger-page-header .btn:hover, .ledger-filter-reset:hover { filter: brightness(.97); transform: none; }
.ledger-page-header svg, .ledger-section-heading svg, .ledger-stat svg, .ledger-row svg, .ledger-icon-button svg, .ledger-filter-reset svg { flex: none; width: 18px; height: 18px; vertical-align: middle; }
.ledger-icon-button { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 5px; color: #716570; background: transparent; }
.ledger-icon-button:hover { background: var(--rose-soft); color: var(--rose-dark); }
.ledger-back { display: none; }
.ledger-period { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ledger-period > label { font-size: 13px; font-weight: 500; color: #706771; }
.ledger-period > .btn-link { font-size: 12px; padding: 4px 8px; }
.ledger-month-control { display: flex; align-items: center; border: 1px solid #e4dfe4; border-radius: 6px; background: #fff; }
.ledger-month-control input { border: 0; width: 148px; min-width: 0; min-height: 36px; padding: 5px 7px; background: transparent; color: #332b33; font: 500 13px/1.5 var(--ledger-font); }
.ledger-stats { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); border-top: 1px solid #eee8ec; border-bottom: 1px solid #eee8ec; background: #fff; padding: 22px 0; }
.ledger-stat { min-width: 0; padding: 0 24px; border-left: 1px solid #eee8ec; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.ledger-stat:first-child { padding-left: 0; border-left: 0; }
.ledger-stat > span { display: flex; align-items: center; gap: 7px; color: #786d77; font-size: 12px; white-space: nowrap; }
.ledger-stat > span svg { color: #a294a0; width: 16px; height: 16px; }
.ledger-stat:nth-child(3) > span svg { color: #258773; }
.ledger-stat:nth-child(4) > span svg { color: #527bbb; }
.ledger-stat > strong { margin: 0; color: #342c35; font: 600 28px/1.15 var(--ledger-font); font-variant-numeric: tabular-nums; letter-spacing: 0; overflow-wrap: anywhere; }
.ledger-stat > strong > small { margin-left: 5px; font: 400 12px var(--ledger-font); color: #8b818a; }
.ledger-stat.primary .total { margin: 0; font: 600 34px/1.15 var(--ledger-font); font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--rose-dark); background: none; -webkit-text-fill-color: currentColor; }
.ledger-stat > small { color: #9a8f98; font-size: 11px; }
.ledger-home-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 32px; margin-top: 28px; }
.ledger-todos { margin-top: 24px; padding: 16px 18px; border: 1px solid #eee8ec; border-radius: 8px; background: #fffdfd; }
.todo-list { display: grid; gap: 6px; }
.todo-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.todo-item:hover { background: var(--rose-soft); }
.todo-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.todo-main { min-width: 0; flex: 1; }
.todo-main strong, .todo-main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.todo-main strong { font: 600 14px/1.5 var(--ledger-font); color: #352c34; }
.todo-main small { color: #958993; font-size: 12px; }
.todo-action { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--rose-dark); font-size: 12px; }
.invoice-month { margin-top: 26px; }
.invoice-search { width: min(320px, 100%); }
.invoice-month-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 4px; border: 0; border-bottom: 1px solid #eee8ec; background: transparent; color: #352c34; font: 600 16px/1.5 var(--ledger-font); text-align: left; cursor: pointer; }
.invoice-month-toggle small { color: #958993; font: 12px/1.4 var(--ledger-font); font-weight: 400; }
.invoice-month-toggle svg { margin-left: auto; width: 18px; height: 18px; color: #958993; transition: transform .18s ease; }
.invoice-month.is-open .invoice-month-toggle svg { transform: rotate(180deg); }
.invoice-grid { margin-top: 12px; }
.invoice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.invoice-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid #eee8ec; border-radius: 8px; background: #fff; min-width: 0; }
.invoice-type { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: var(--rose-soft); color: var(--rose-dark); font: 700 11px var(--mono); }
.invoice-main { min-width: 0; flex: 1; }
.invoice-main strong, .invoice-main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.invoice-main strong { font: 600 14px/1.5 var(--ledger-font); color: #352c34; }
.invoice-main small { color: #958993; font-size: 12px; }
.invoice-actions { flex: none; display: flex; flex-direction: column; gap: 4px; }
.ledger-home-columns > section { min-width: 0; }
.ledger-breakdown { padding-left: 28px; border-left: 1px solid #eee8ec; }
.ledger-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; margin-bottom: 12px; }
.ledger-section-heading h3 { margin: 0; font: 600 16px/1.5 var(--ledger-font); color: #352c34; }
.ledger-section-heading > span { color: #958993; font-size: 11px; }
.ledger-section-heading .btn-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; min-height: 32px; }
.ledger-section-heading .btn-link svg { width: 15px; height: 15px; }
.ledger-category-list { display: grid; gap: 24px; padding-top: 12px; }
.ledger-category-item { min-width: 0; }
.ledger-category-item > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 12px; }
.ledger-category-item > div:first-child > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #645962; }
.ledger-category-item strong { flex: none; color: #3e343d; font: 500 13px var(--ledger-font); font-variant-numeric: tabular-nums; }
.ledger-category-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 2px; background: var(--category-color); }
.ledger-category-track { height: 6px; overflow: hidden; border-radius: 2px; background: #f2eff2; }
.ledger-category-track > span { display: block; height: 100%; background: var(--category-color); border-radius: 2px; }
.ledger-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 28px 16px; text-align: center; gap: 10px; color: #a398a1; }
.ledger-empty > svg { width: 30px; height: 30px; stroke-width: 1.3; }
.ledger-empty strong { color: #786d77; font-size: 14px; font-weight: 500; }
.ledger-empty p { max-width: 420px; margin: 0; color: #948892; font-size: 12px; line-height: 1.7; }
.ledger-list { min-width: 0; border-top: 1px solid #eee8ec; }
.ledger-list-head, .ledger-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 120px 140px 60px 18px; column-gap: 18px; align-items: center; }
.ledger-list-head { min-height: 42px; padding: 10px 14px; background: #faf8fa; color: #978994; font-size: 11px; }
.ledger-list-head > span:nth-child(4) { text-align: right; }
.ledger-list-head > span:nth-child(5) { text-align: center; }
.ledger-row { width: 100%; min-width: 0; min-height: 82px; padding: 14px; border: 0; border-bottom: 1px solid #eee8ec; background: #fff; text-align: left; transition: background .15s; }
.ledger-row:hover, .ledger-row:focus-visible { background: #fff6fa; }
.ledger-row-date { color: #8b7f89; font-size: 12px; font-variant-numeric: tabular-nums; }
.ledger-row-main { min-width: 0; }
.ledger-row-main > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/1.5 var(--ledger-font); color: #342b33; }
.ledger-row-note { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 5px; font-size: 12px; color: #a0909b; }
.ledger-row-mobile-meta { display: none; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #958590; font-size: 11px; }
.ledger-row-mobile-meta > span { margin: 0 6px; }
.ledger-row-category { min-width: 0; font-size: 12px; color: #746670; }
.ledger-row-category > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row-status { display: block; margin-top: 5px; color: #958590; font-size: 10px; }
.ledger-row-status.is-saved { color: #328773; }
.ledger-row-amount { text-align: right; font: 600 15px var(--ledger-font); font-variant-numeric: tabular-nums; white-space: nowrap; color: #44343f; }
.ledger-row-receipts { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: #ab9da7; }
.ledger-row-receipts svg { width: 13px; height: 13px; }
.ledger-row-arrow { color: #c0b3bd; }
.ledger-row-arrow svg { width: 16px; height: 16px; }
.is-compact .ledger-row { grid-template-columns: minmax(0, 1fr) auto 16px; column-gap: 12px; row-gap: 4px; min-height: 78px; padding: 14px 0; }
.is-compact .ledger-row-date, .is-compact .ledger-row-category, .is-compact .ledger-row-note { display: none; }
.is-compact .ledger-row-main { grid-column: 1; grid-row: 1 / span 2; }
.is-compact .ledger-row-mobile-meta { display: block; }
.is-compact .ledger-row-amount { grid-column: 2; grid-row: 1; }
.is-compact .ledger-row-receipts { grid-column: 2; grid-row: 2; justify-content: flex-end; }
.is-compact .ledger-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
.ledger-query-filters { padding: 20px 0 22px; border-top: 1px solid #eee8ec; border-bottom: 1px solid #eee8ec; }
.ledger-query-search-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 16px; }
.ledger-query-select-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 16px; align-items: end; margin-top: 16px; }
.ledger-filter-field { display: block; min-width: 0; }
.ledger-filter-field > span { display: block; margin-bottom: 7px; color: #867781; font-size: 12px; }
.ledger-input { display: block; width: 100%; min-width: 0; height: 40px; padding: 8px 11px; border: 1px solid #e7e0e6; border-radius: 6px; background-color: #fff; color: #4b3f49; font: 400 13px/22px var(--ledger-font); }
.ledger-input:focus { border-color: var(--rose); outline: 3px solid #c02f6214; outline-offset: 0; }
.ledger-input::placeholder { color: #b0a3ad; }
.ledger-filter-field select { padding-right: 28px; }
.ledger-search { position: relative; min-width: 0; }
.ledger-search > svg { position: absolute; left: 11px; top: 11px; width: 17px; height: 17px; color: #b0a2ac; pointer-events: none; }
.ledger-search > input { padding-left: 36px; }
.ledger-filter-reset { height: 40px; }
.ledger-query-results { margin-top: 20px; }
.ledger-results-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 14px; color: #8f808b; font-size: 12px; }
.ledger-results-summary strong { margin-left: 4px; color: #40313b; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger-results-summary > span:last-child strong { margin-left: 10px; font-size: 20px; color: var(--rose-dark); }
.ledger-page-header p, .ledger-stat > small, .ledger-section-heading > span,
.ledger-row-date, .ledger-row-note, .ledger-row-mobile-meta, .ledger-row-status,
.ledger-filter-field > span, .ledger-results-summary, .ledger-list-head,
.ledger-empty p { color: #786d77; }
.ledger-input::placeholder { color: #7d727a; }
.ledger-row-status.is-saved { color: #23705f; }
.ledger-row-receipts, .ledger-row-arrow { color: #887885; }
@media (max-width: 1100px) {
  .view-home .main, .view-bill-query .main, .view-invoice-folder .main { padding: 24px; }
  .ledger-stat { padding-inline: 16px; }
  .ledger-home-columns { gap: 24px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .ledger-breakdown { padding-left: 20px; }
  .ledger-list-head, .ledger-row { grid-template-columns: 92px minmax(0, 1fr) 96px 114px 40px 16px; column-gap: 12px; }
}
@media (max-width: 767px) {
  .view-home .main, .view-bill-query .main, .view-invoice-folder .main { padding: 22px 16px 32px; }
  .ledger-page-header { margin-bottom: 20px; align-items: flex-start; }
  .ledger-page-header h2 { font-size: 23px; }
  .ledger-page-header p { font-size: 11px; }
  .ledger-page-header .btn { padding-inline: 11px; min-height: 38px; font-size: 12px; gap: 5px; }
  .view-bill-query .ledger-page-header { flex-wrap: wrap; gap: 14px; }
  .view-invoice-folder .ledger-page-header { flex-wrap: wrap; gap: 14px; }
  .ledger-header-actions { width: 100%; justify-content: flex-end; }
  .ledger-back { display: inline-grid; width: 32px; height: 32px; border: 1px solid #e7e0e6; }
  .ledger-period { gap: 8px; margin-bottom: 14px; }
  .ledger-period > label { font-size: 12px; }
  .ledger-month-control input { width: 130px; }
  .ledger-period > .btn-link { margin-left: auto; padding-inline: 0; }
  .ledger-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
  .ledger-stat { padding: 16px 8px; gap: 8px; }
  .ledger-stat.primary { grid-column: 1 / -1; padding: 18px 0; border-bottom: 1px solid #eee8ec; }
  .ledger-stat:nth-child(2) { border-left: 0; padding-left: 0; }
  .ledger-stat > span { gap: 4px; font-size: 10px; }
  .ledger-stat > span svg { width: 13px; height: 13px; }
  .ledger-stat > strong { font-size: 23px; }
  .ledger-stat.primary .total { font-size: 32px; }
  .ledger-stat > strong > small { font-size: 10px; }
  .ledger-home-columns { grid-template-columns: 1fr; gap: 26px; margin-top: 22px; }
  .ledger-todos { padding: 12px; }
  .invoice-grid { grid-template-columns: 1fr; }
  .invoice-search { width: 100%; }
  .ledger-breakdown { border-left: 0; padding-left: 0; }
  .ledger-section-heading { margin-bottom: 8px; }
  .ledger-section-heading h3 { font-size: 15px; }
  .ledger-empty { min-height: 170px; }
  .ledger-query-filters { padding: 16px 0; }
  .ledger-query-search-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ledger-filter-search { grid-column: 1 / -1; }
  .ledger-query-select-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
  .ledger-input { font-size: 16px; height: 42px; padding-inline: 9px; }
  .ledger-search > input { padding-left: 34px; }
  .ledger-filter-reset { height: 42px; }
  .ledger-results-summary { flex-wrap: wrap; gap: 8px; }
  .ledger-results-summary > span:last-child strong { font-size: 18px; }
  .ledger-list-head { display: none; }
  .ledger-row, .is-compact .ledger-row { grid-template-columns: minmax(0, 1fr) auto 14px; column-gap: 8px; row-gap: 4px; padding: 14px 0; }
  .ledger-row-date, .ledger-row-category, .ledger-row-note { display: none; }
  .ledger-row-main { grid-column: 1; grid-row: 1 / span 2; }
  .ledger-row-mobile-meta { display: block; }
  .ledger-row-amount { grid-column: 2; grid-row: 1; font-size: 14px; }
  .ledger-row-receipts { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .ledger-row-arrow { grid-column: 3; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) {
  .ledger-row { transition: none; }
}
