@font-face {
  font-family: "Source Han Sans CN";
  src: url("/static/fonts/source-han-sans/SourceHanSansCN-VF.ttf.woff2") format("woff2");
  font-weight: 250 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #181818;
  --color-primary-deep: #000000;
  --color-secondary: #171717;
  --color-accent: #b9a482;
  --color-background: #ffffff;
  --color-foreground: #000000;
  --color-muted: #f2f2f2;
  --color-border: #dedede;
  --color-destructive: #a32a22;
  --color-cash-in: #151515;
  --color-cash-out: #b9a482;
  --white: #fff;
  --ink: #000000;
  --muted-ink: #555555;
  --light-ink: #686868;
  --cream: #ffffff;
  --shadow-sm: 0 1px 2px rgba(22,22,22, .04);
  --shadow-md: 0 5px 18px rgba(22,22,22, .07);
  --shadow-lg: 0 16px 36px rgba(22,22,22, .12);
  --radius: 12px;
  --rail-width: 238px;
  color-scheme: light;
  font-family: "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--color-background); }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--ink); background: var(--color-background); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button { border: 0; }
button, select, input[type="search"] { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(22,22,22, .2); outline-offset: 2px; }
button svg, .brand-mark svg, .breadcrumbs svg, .metric-icon svg, .project-icon svg, .row-open svg, .text-link svg, .dialog-close svg, .user-mini > svg, .search-control svg, .todo-add svg, .icon-button svg, .mobile-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { display: flex; min-height: 100vh; }
.side-rail { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--rail-width); flex-direction: column; padding: 24px 16px 16px; border-right: 1px solid #ececec; background: var(--cream); }
.brand-lockup { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 11px; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; color: var(--color-primary); }
.brand-mark svg { width: 36px; height: 36px; stroke: none; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy b { color: var(--color-primary-deep); font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 5px; color: var(--light-ink); font-size: 10px; letter-spacing: .08em; }
.rail-label { margin: 40px 13px 10px; color: #828282; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.rail-label-lower { margin-top: 34px; }
.primary-nav, .secondary-nav { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 13px; border-radius: 9px; color: #555555; background: transparent; text-align: left; transition: background-color 180ms ease, color 180ms ease; }
.nav-item:hover { color: var(--color-primary); background: #f4f4f4; }
.nav-item.is-active { color: var(--color-primary); background: #efefef; font-weight: 650; }
.nav-item.is-active::before { position: absolute; left: -16px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--color-primary); content: ""; }
.nav-item svg { flex: 0 0 18px; width: 18px; height: 18px; }
.rail-bottom { margin-top: auto; }
.secure-note { display: flex; align-items: center; gap: 7px; margin: 0 12px 14px; color: #7f7f7f; font-size: 11px; }
.secure-dot, .sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7e7e7e; box-shadow: 0 0 0 3px rgba(22,22,22, .12); }
.user-mini { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 10px 8px; border-top: 1px solid #f1f1f1; color: var(--ink); background: transparent; text-align: left; }
.user-mini:hover { background: #f7f7f7; }
.user-mini .avatar { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; color: var(--color-primary); background: #e8e8e8; font-size: 12px; font-weight: 700; }
.user-mini-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.25; }
.user-mini-copy b { overflow: hidden; color: #3f3f3f; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-mini-copy small { margin-top: 3px; color: #686868; font-size: 10px; }
.user-mini > svg { width: 15px; height: 15px; color: #686868; }

.main-content { width: calc(100% - var(--rail-width)); min-width: 0; margin-left: var(--rail-width); }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 4.2vw; border-bottom: 1px solid #ededed; background: rgba(22,22,22, .96); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: #686868; font-size: 12px; }
.breadcrumbs svg { width: 13px; height: 13px; color: #c2c2c2; }
.breadcrumbs b { color: #535353; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.sync-state { display: flex; align-items: center; gap: 8px; color: #808080; font-size: 11px; }
.sync-state.is-error { color: #a32a22; }
.demo-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid #dbdbdb; border-radius: 999px; color: #796347; background: #f9f9f9; font-size: 10px; font-weight: 700; }
.icon-button, .mobile-menu { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; color: #787878; background: transparent; transition: background-color 180ms ease, color 180ms ease; }
.icon-button:hover, .mobile-menu:hover { color: var(--color-primary); background: #f1f1f1; }
.icon-button svg, .mobile-menu svg { width: 18px; height: 18px; }
.notification-count { position: absolute; top: 1px; right: -1px; display: grid; width: 14px; height: 14px; place-items: center; border: 2px solid var(--color-background); border-radius: 50%; color: white; background: var(--color-accent); font-size: 8px; font-weight: 700; }
.mobile-menu { display: none; }
.content-wrap { width: min(1560px, 100%); margin: 0 auto; padding: 42px 4.2vw 28px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow, .panel-kicker { margin: 0; color: var(--color-secondary); font-size: 10px; font-weight: 750; letter-spacing: .16em; line-height: 1.3; }
.page-intro h1 { margin: 8px 0 6px; color: var(--color-primary-deep); font-size: clamp(28px, 3vw, 38px); font-weight: 670; letter-spacing: -.045em; line-height: 1.1; }
.page-subtitle { margin: 0; color: #777777; font-size: 13px; }
.intro-actions { display: flex; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 650; transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--color-primary); box-shadow: 0 4px 12px rgba(22,22,22, .18); }
.button-primary:hover { background: #353535; box-shadow: 0 6px 16px rgba(22,22,22, .22); }
.button:disabled { cursor: wait; opacity: .6; }
.button-ghost { border-color: #e1e1e1; color: #646464; background: #fff; }
.button-ghost:hover { color: var(--color-primary); border-color: #cbcbcb; background: #fafafa; }

.panel { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; margin-bottom: 20px; padding: 10px 16px 10px 18px; }
.toolbar-left { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.balance-panel { margin: 0 0 16px; padding: 16px 20px; }
.balance-panel h2 { margin: 0; font-size: 16px; }
.balance-panel p, .balance-panel dt { margin: 5px 0; color: #656565; font-size: 12px; }
.balance-panel dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 12px 0 0; }
.balance-panel dd { margin: 0; font-size: clamp(14px,2vw,20px); font-weight: 650; font-variant-numeric: tabular-nums; }
@media(max-width:700px) { .balance-panel dl { grid-template-columns: 1fr 1fr; } }
.toolbar-title { display: inline-flex; align-items: center; gap: 8px; color: var(--color-primary-deep); font-size: 12px; font-weight: 700; }
.toolbar-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--color-secondary); box-shadow: 0 0 0 4px #efefef; }
.toolbar-divider { width: 1px; height: 18px; background: #e9e9e9; }
.toolbar-hint { color: #828282; font-size: 11px; }
.filters { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.filter-control { display: flex; align-items: center; gap: 7px; padding-left: 8px; color: #828282; font-size: 11px; }
.filter-control select { min-height: 32px; padding: 0 27px 0 9px; border: 1px solid #e3e3e3; border-radius: 7px; color: #545454; background: #fdfdfd; font-size: 11px; outline: 0; }
.filter-control select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(22,22,22, .1); }
.filter-reset { margin-left: 5px; padding: 7px 5px; color: #818181; background: transparent; font-size: 11px; }
.filter-reset:hover { color: var(--color-primary); }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 34px; margin: -8px 0 12px; color: #747474; font-size: 11px; }
.loading-spinner { width: 14px; height: 14px; border: 2px solid #e1e1e1; border-top-color: var(--color-primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { position: relative; min-height: 144px; padding: 18px 19px 15px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.metric-card-button { display: block; width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
.metric-card-button:hover { border-color: #cdcdcd; background: #fdfdfd; box-shadow: var(--shadow-md); }
.metric-card::after { position: absolute; top: -40px; right: -50px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(22,22,22, .08), transparent 70%); content: ""; pointer-events: none; }
.metric-card .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { color: #7d7d7d; font-size: 11px; }
.metric-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--color-primary); background: #f3f3f3; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { display: block; margin-top: 9px; color: var(--color-primary-deep); font-size: clamp(20px, 2.05vw, 27px); font-weight: 600; letter-spacing: 0; line-height: 1.15; }
.metric-bottom { display: flex; align-items: center; justify-content: flex-start; gap: 8px; max-width: calc(100% - 82px); margin-top: 8px; }
.metric-change { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 5px; color: var(--color-cash-in); background: #f4f4f4; font-size: 10px; font-weight: 700; }
.metric-change.down { color: var(--color-cash-out); background: #f4f4f4; }
.metric-period { overflow: hidden; color: #828282; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sparkline { position: absolute; right: 17px; bottom: 13px; width: 82px; height: 27px; overflow: visible; }
.sparkline path { fill: none; stroke: var(--color-secondary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.sparkline .spark-fill { fill: rgba(22,22,22, .09); stroke: none; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); gap: 16px; margin-bottom: 16px; }
.chart-panel, .funding-panel { min-width: 0; min-height: 372px; padding: 20px 20px 15px; }
.cashflow-panel { grid-column: 1; }
.profit-panel { grid-column: 2; }
.funding-panel { grid-column: 1; }
.dashboard-grid > .todo-panel { grid-column: 2; grid-row: 2; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-header h2 { margin: 5px 0 3px; color: var(--color-primary-deep); font-size: 16px; font-weight: 700; letter-spacing: -.025em; }
.panel-header p { margin: 0; color: #828282; font-size: 11px; }
.legend-group { display: flex; align-items: center; gap: 13px; padding-top: 4px; color: #828282; font-size: 10px; white-space: nowrap; }
.legend-group > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-line { display: inline-block; width: 17px; height: 2px; border-radius: 2px; background: var(--color-primary); }
.legend-teal { background: var(--color-cash-in); }
.legend-coral { background: var(--color-cash-out); }
.legend-soft { opacity: .5; border: 1px dashed currentColor; background: transparent; }
.legend-box { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--color-secondary); }
.legend-current { background: var(--color-secondary); }
.legend-prior { background: #c2af90; }
.legend-dash { height: 0; border-top: 2px dashed var(--color-accent); background: transparent; }
.more-button { display: grid; width: 25px; height: 25px; place-items: center; padding-bottom: 7px; border-radius: 5px; color: #828282; background: transparent; font-size: 14px; letter-spacing: 2px; line-height: 1; }
.more-button:hover { color: var(--color-primary); background: #f4f4f4; }
.chart-container { width: 100%; min-width: 0; }
.chart-empty { display: flex; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: #828282; }
.chart-empty span { display: block; width: 32px; height: 24px; border: 1px solid #dedede; border-radius: 4px; background: linear-gradient(135deg, transparent 48%, #dedede 49%, #dedede 52%, transparent 53%), linear-gradient(45deg, transparent 46%, #dedede 47%, #dedede 50%, transparent 51%); }
.chart-empty b { color: #717171; font-size: 11px; font-weight: 600; }
.chart-empty small { color: #828282; font-size: 10px; }
.fallback-chart { display: block; width: 100%; height: 100%; }
.chart-lg { height: 258px; margin-top: 12px; }
.chart-md { height: 258px; margin-top: 12px; }
.chart-footer { display: flex; align-items: center; gap: 8px; color: #828282; font-size: 10px; }
.trend-badge { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 4px; color: var(--color-cash-in); background: #f4f4f4; font-weight: 700; }
.footer-note { margin-left: auto; color: #828282; }
.profit-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 5px; border-top: 1px solid #f1f1f1; }
.profit-summary div { display: flex; flex-direction: column; gap: 3px; }
.profit-summary span { color: #828282; font-size: 10px; }
.profit-summary b { color: var(--color-primary-deep); font-size: 15px; font-weight: 600; }
.profit-rate { text-align: right; }
.profit-rate b { color: var(--color-cash-in); }

.funding-panel { padding-bottom: 18px; }
.funding-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 23px; }
.funding-total div { display: flex; align-items: baseline; gap: 8px; }
.funding-total span, .funding-labels { color: #828282; font-size: 10px; }
.funding-total b { color: var(--color-primary-deep); font-size: 26px; font-weight: 600; line-height: 1; }
.funding-total > span { color: #757575; font-size: 10px; }
.progress-track { position: relative; height: 7px; margin-top: 15px; overflow: visible; border-radius: 999px; background: #f2f2f2; }
.progress-track > span { display: block; width: 43%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); transition: width 300ms ease; }
.progress-track > i { position: absolute; top: -4px; left: 43%; width: 2px; height: 15px; border-radius: 2px; background: var(--color-accent); transition: left 300ms ease; }
.funding-labels { display: flex; justify-content: space-between; margin-top: 9px; }
.funding-labels b { color: #6f6f6f; font-size: 10px; font-weight: 600; }
.funding-list { display: grid; gap: 10px; margin-top: 24px; }
.funding-item { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.funding-item:hover .funding-item-name { color: var(--color-primary); }
.funding-item .fund-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-secondary); }
.funding-item .fund-dot.amber { background: var(--color-accent); }
.funding-item .fund-dot.teal { background: var(--color-cash-in); }
.funding-item-name { overflow: hidden; color: #717171; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.funding-item b { color: #5e5e5e; font-size: 10px; font-weight: 600; }
.funding-item small { grid-column: 2 / span 2; color: #828282; font-size: 9px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: var(--color-primary); background: transparent; font-size: 11px; font-weight: 650; }
.text-link:hover { color: var(--color-accent); }
.text-link svg { width: 14px; height: 14px; transition: transform 180ms ease; }
.text-link:hover svg { transform: translateX(2px); }
.funding-panel > .text-link { margin-top: 19px; }

.workspace-grid { display: block; }
.projects-panel, .todo-panel { min-width: 0; padding: 20px 20px 14px; }
.projects-header { align-items: flex-end; margin-bottom: 16px; }
.projects-header h2 { margin-bottom: 4px; }
.projects-header p b { color: var(--color-primary); font-weight: 700; }
.table-tools { display: flex; align-items: center; gap: 15px; }
.search-control { display: flex; align-items: center; gap: 7px; min-width: 180px; padding: 0 8px; border-bottom: 1px solid #e3e3e3; color: #828282; }
.search-control:focus-within { border-color: var(--color-primary); }
.search-control svg { width: 14px; height: 14px; flex: 0 0 14px; }
.search-control input { width: 100%; min-height: 29px; border: 0; outline: 0; color: #545454; background: transparent; font-size: 11px; }
.search-control input::placeholder { color: #828282; }
.table-wrap { position:relative; max-width:100%; overflow-x:auto; }
@media(min-width:901px) and (max-width:1220px){.toolbar{flex-wrap:wrap}.toolbar .filters{flex-wrap:wrap}}
.project-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: auto; }
.project-table th { padding: 9px 9px; border-bottom: 1px solid #ededed; color: #828282; font-size: 10px; font-weight: 600; text-align: left; white-space: nowrap; }
.project-table th:first-child, .project-table td:first-child { padding-left: 2px; }
.project-table th[data-sort] { cursor: pointer; }
.sort-mark { color: #828282; font-size: 11px; }
.project-table th.is-sort { color: var(--color-primary); }
.project-table td { padding: 12px 9px; border-bottom: 1px solid #f3f3f3; color: #737373; font-size: 11px; vertical-align: middle; white-space: nowrap; }
.project-table tr { transition: background-color 180ms ease; }
.project-table tbody tr:hover { background: #fbfbfb; }
.project-table tbody tr:last-child td { border-bottom: 0; }
.project-name-cell { display: flex; align-items: center; gap: 9px; min-width: 155px; }
.project-icon { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border-radius: 7px; color: var(--color-primary); background: #f3f3f3; }
.project-icon.teal { color: var(--color-cash-in); background: #f4f4f4; }
.project-icon.amber { color: var(--color-accent); background: #f7f7f7; }
.project-icon svg { width: 14px; height: 14px; }
.project-name { display: flex; max-width: 180px; flex-direction: column; gap: 2px; overflow: hidden; }
.project-name b { overflow: hidden; color: #484848; font-size: 11px; font-weight: 650; text-overflow: ellipsis; }
.project-name small { color: #828282; font-size: 9px; }
.money-cell { color: #636363 !important; font-size: 10px !important; }
.rate-cell { display: flex; align-items: center; gap: 7px; }
.rate-bar { width: 42px; height: 4px; overflow: hidden; border-radius: 99px; background: #efefef; }
.rate-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-secondary); }
.rate-bar i.high { background: var(--color-accent); }
.status-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 5px; color: #676767; background: #f4f4f4; font-size: 9px; }
.status-tag::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-tag.planning { color: #796347; background: #f7f7f7; }
.status-tag.closing { color: #6c6c6c; background: #f1f1f1; }
.row-open { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 6px; color: #828282; background: transparent; }
.row-open:hover { color: var(--color-primary); background: #f1f1f1; }
.row-open svg { width: 14px; height: 14px; }
.project-cards { display: none; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding-top: 10px; color: #828282; font-size: 10px; }
.todo-panel { padding-bottom: 17px; }
.todo-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 6px; color: var(--color-primary); background: #f0f0f0; font-size: 10px; vertical-align: 2px; }
.todo-list { display: grid; gap: 0; margin-top: 19px; }
.todo-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 11px 0; border-bottom: 1px solid #f1f1f1; }
.todo-item:first-child { padding-top: 0; }
.todo-check { position: relative; display: grid; width: 18px; height: 18px; place-items: center; margin-top: 1px; border: 1px solid #d0d0d0; border-radius: 5px; color: #fff; background: #fff; }
.todo-check:hover { border-color: var(--color-primary); }
.todo-check.is-done { border-color: var(--color-cash-in); background: var(--color-cash-in); }
.todo-check.is-done::after { width: 8px; height: 4px; border-bottom: 1.5px solid white; border-left: 1.5px solid white; content: ""; transform: rotate(-45deg) translate(1px, -1px); }
.todo-copy { min-width: 0; }
.todo-copy { padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.todo-copy b { display: block; overflow: hidden; color: #616161; font-size: 11px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.todo-copy small { display: block; margin-top: 3px; overflow: hidden; color: #828282; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.todo-time { padding-top: 2px; color: #828282; font-size: 9px; white-space: nowrap; }
.todo-time.urgent { color: var(--color-cash-out); }
.todo-add { display: inline-flex; align-items: center; gap: 5px; margin-top: 17px; padding: 0; color: var(--color-primary); background: transparent; font-size: 11px; font-weight: 650; }
.todo-add span { font-size: 16px; font-weight: 400; line-height: 1; }
.todo-add:hover { color: var(--color-accent); }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 3px 0; color: #828282; font-size: 10px; }
.page-footer button { padding: 0; color: #828282; background: transparent; font-size: inherit; }
.page-footer button:hover { color: var(--color-primary); }
.empty-inline, .empty-table { padding: 24px 8px; color: #828282; font-size: 11px; text-align: center; }
.empty-table { padding: 25px 8px; }
.detail-list { display: grid; gap: 0; margin: 4px 0 2px; border-top: 1px solid #f1f1f1; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #f1f1f1; }
.detail-row div { min-width: 0; }
.detail-row b, .detail-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-row b { color: #616161; font-size: 12px; font-weight: 600; }
.detail-row small { margin-top: 2px; color: #828282; font-size: 10px; }
.detail-row strong { flex: 0 0 auto; color: var(--color-primary-deep); font-size: 11px; font-weight: 600; }
.dialog-error { margin-top: 12px !important; padding: 8px 10px; border-radius: 6px; color: #796347 !important; background: #f3f3f3; font-size: 11px !important; }
.role-picker p { margin: 0 0 10px; color: #7d7d7d; font-size: 12px; }
.role-option { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 11px; border: 1px solid #e9e9e9; border-radius: 8px; color: #616161; background: #fdfdfd; text-align: left; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
.role-option + .role-option { margin-top: 7px; }
.role-option:hover, .role-option.is-current { border-color: #cdcdcd; color: var(--color-primary); background: #f4f4f4; }
.role-option small { color: #828282; font-size: 10px; }

dialog { width: min(460px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 14px; background: transparent; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(22,22,22, .36); backdrop-filter: blur(3px); }
.dialog-card { position: relative; padding: 28px; border: 1px solid var(--color-border); border-radius: 14px; background: white; }
.dialog-close { position: absolute; top: 15px; right: 15px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; color: #828282; background: transparent; }
.dialog-close:hover { color: var(--color-primary); background: #f3f3f3; }
.dialog-close svg { width: 16px; height: 16px; }
.dialog-kicker { color: var(--color-secondary); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.dialog-card h2 { margin: 8px 0; color: var(--color-primary-deep); font-size: 20px; }
.dialog-card p { min-height: 48px; margin: 0 0 22px; color: #6b6b6b; font-size: 13px; line-height: 1.7; }

@media (max-width: 1260px) {
  :root { --rail-width: 218px; }
  .content-wrap, .topbar { padding-right: 3vw; padding-left: 3vw; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(270px, .9fr); }
  .cashflow-panel { grid-column: 1; }
  .profit-panel { grid-column: 2; }
  .funding-panel { grid-column: 1; }
  .dashboard-grid > .todo-panel { grid-column: 2; grid-row: 2; }
  .profit-panel, .funding-panel { min-height: 355px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.55fr) minmax(270px, .8fr); }
}
@media (max-width: 980px) {
  .toolbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .filters { justify-content: flex-start; flex-wrap: wrap; width: 100%; }
  .filter-control { padding-left: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .cashflow-panel, .profit-panel, .funding-panel, .dashboard-grid > .todo-panel { grid-column: auto; grid-row: auto; }
  .chart-panel, .funding-panel { min-height: 0; }
  .profit-panel { min-height: 345px; }
  .workspace-grid { gap: 16px; }
}
@media (max-width: 900px) {
  .side-rail { display: none; width: 246px; border-right: 1px solid #e4e4e4; box-shadow: 10px 0 30px rgba(22,22,22, .12); }
  body.nav-open .side-rail { display: flex; }
  body.nav-open::after { position: fixed; inset: 0; z-index: 10; background: rgba(22,22,22, .25); content: ""; }
  .main-content { width: 100%; margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { height: 58px; padding: 0 18px; }
  .sync-state { display: none; }
  .content-wrap { padding: 28px 16px 22px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 21px; }
  .page-intro h1 { font-size: 30px; }
  .intro-actions { width: 100%; }
  .intro-actions .button { flex: 1; }
  .toolbar { margin-bottom: 14px; }
  .toolbar-left { width: 100%; justify-content: space-between; }
  .toolbar-divider { display: none; }
  .toolbar-hint { margin-left: auto; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-control { justify-content: space-between; gap: 5px; padding: 0; }
  .filter-control select { min-width: 0; flex: 1; }
  .filter-reset { grid-column: span 2; justify-self: end; margin: 0; padding: 3px 0; }
  .metric-grid { gap: 10px; margin-bottom: 12px; }
  .metric-card { min-height: 133px; padding: 15px; }
  .metric-value { font-size: 21px; }
  .sparkline { right: 13px; bottom: 11px; }
  .chart-panel, .funding-panel, .projects-panel, .todo-panel { padding: 16px 15px 13px; }
  .chart-lg, .chart-md { height: 220px; }
  .dashboard-grid { display: flex; flex-direction: column; }
  .dashboard-grid > .todo-panel { order: -1; }
  .legend-group { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .legend-group > span { display: inline-flex; }
  .legend-group .more-button { display: grid; }
  .projects-header { align-items: flex-start; flex-direction: column; gap: 13px; }
  .table-tools { justify-content: space-between; width: 100%; }
  .search-control { flex: 1; }
  .desktop-link { display: none; }
  .table-wrap { display: none; }
  .project-cards { display: grid; gap: 8px; }
  .project-card { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid #f1f1f1; }
  .project-card-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .project-card .project-name { max-width: calc(100vw - 180px); }
  .project-card-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
  .project-card-metrics { grid-column: 1 / span 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 35px; color: #828282; font-size: 10px; }
  .project-card-metrics b { color: #666666; font-size: 10px; font-weight: 600; }
  .page-footer { align-items: flex-start; flex-direction: column; gap: 5px; padding-top: 21px; }
}
@media (max-width: 390px) {
  .content-wrap { padding-right: 12px; padding-left: 12px; }
  .topbar { padding: 0 12px; }
  .breadcrumbs span, .breadcrumbs svg { display: none; }
  .metric-card { min-height: 127px; padding: 13px 12px; }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 18px; }
  .metric-period { display: none; }
  .legend-group > span { display: none; }
  .funding-total { align-items: flex-start; flex-direction: column; gap: 6px; }
  .funding-total b { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.compact-brand {display:none;width:28px;height:28px;object-fit:contain}
@media(max-width:980px){.breadcrumbs .compact-brand {display:block}}

/* Ink and satin gold, shared by the dashboard and the entry forms. */
:root {
  --satin-gold: linear-gradient(106deg, #dfcfb1, #f4ead8 25%, #e9e0cf 52%, #d3c6b0);
  --page-inset: clamp(22px, 3.4vw, 60px);
  --radius: 8px;
  --shadow-sm: none;
}
.topbar { padding-inline: var(--page-inset); background: #000; border-bottom: 1px solid #424242; color: #fff; }
.masthead, .scope-toggle, .summary-heading, .period-heading, .ledger-hero header { display: flex; align-items: center; }
.masthead { gap: 12px; }
.masthead h1 { margin: 0; font-size: clamp(20px, 2vw, 28px); font-weight: 640; letter-spacing: -.035em; }
.scope-toggle { gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid #888; border-radius: 2em; color: #fff; background: transparent; }
.scope-toggle:hover, .scope-toggle[aria-expanded=true], .topbar .icon-button:hover, .topbar .mobile-menu:hover { background: #272727; color: #fff; }
.topbar .icon-button, .topbar .mobile-menu { color: white; }
.topbar .sync-state { color: #ddd; }
.topbar .sync-state.is-error { color: #ffc8b8; }
.topbar .sync-dot { background: #d2c09f; box-shadow: none; }
.topbar .demo-badge { border-color: #5a5143; color: #dbcdb5; background: transparent; }
.side-rail { --rail-width: 218px; color: #fff; background: #000; border-right-color: #323232; }
@media(min-width:901px) { :root { --rail-width: 218px; } }
.side-rail .brand-copy b, .side-rail .user-mini-copy b { color: #fff; }
.side-rail .rail-label, .side-rail .brand-copy small, .side-rail .user-mini-copy small { color: #b8b8b8; }
.side-rail .nav-item, .side-rail .user-mini { color: #e5e5e5; }
.side-rail .nav-item:hover, .side-rail .user-mini:hover { color: #fff; background: #222; }
.side-rail .nav-item.is-active { color: #000; background: #fff; }
.side-rail .user-mini { border-top-color: #383838; }
.side-rail .avatar { background: #e2d6c1; color: #111; }
.nav-item.is-active::before { background: #b9a482; }
.ledger-hero { position: relative; isolation: isolate; overflow: hidden; padding: 23px var(--page-inset) 27px; background: #000; color: #fff; }
.ledger-hero header, .period-heading, .summary-heading { justify-content: space-between; gap: 12px; }
.ledger-hero header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.ledger-hero header span { color: #d2d2d2; font-size: 12px; }
.ledger-hero dl { margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.ledger-hero dt { color: #ddd; font-size: 13px; }
.ledger-hero dd { margin: 2px 0 0; font-size: clamp(24px,2.4vw,38px); line-height: 1.25; font-weight: 470; letter-spacing: -.035em; overflow-wrap: anywhere; }
.ledger-hero .hero-primary { grid-column: 1/-1; padding: 0 0 20px; border-bottom: 1px solid #777; margin: 0 0 16px; }
.hero-primary dt { font-size: 16px; }
.hero-primary dd { font-size: clamp(59px,6.7vw,104px); font-weight: 490; line-height: 1.12; letter-spacing: -.055em; }
.ledger-hero dl > div:nth-child(n+3) { padding-left: 20px; border-left: 1px solid #555; }
.content-wrap { padding: 26px var(--page-inset) 32px; }
#dashboardFilters { margin: 0; border-radius: 0; padding: 14px var(--page-inset); flex-wrap: wrap; }
#dashboardFilters .filters { flex-wrap: wrap; }
#scopeNotice { margin: 0; border-radius: 0; padding: 30px var(--page-inset); }
.ledger-overview { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .9fr); gap: clamp(20px, 3vw, 50px); }
.ledger-overview section { min-width: 0; }
.summary-heading, .period-heading { min-height: 36px; margin: 0 0 12px; }
.summary-heading h2, .period-heading h2 { margin: 0; color: #000; font-size: clamp(19px,1.6vw,24px); letter-spacing: -.035em; line-height: 1.3; }
.summary-heading > span, .period-heading > span { color: #585858; font-size: 12px; }
.compare-labels, .compare-row { display: grid; grid-template-columns: minmax(84px,1.3fr) minmax(32px,1fr) minmax(44px,auto) minmax(44px,auto); column-gap: 10px; align-items: center; }
.compare-labels { color: #595959; font-size: 11px; padding: 2px 0 7px; }
.compare-labels > :first-child { grid-column: span 2; }
.in-key, .out-key { text-align: right; }
.in-key::before, .out-key::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 3px; background: #131313; }
.out-key::before { background: #bdab8d; }
.compare-row, .payable-row { width: 100%; min-height: 46px; padding: 9px 0; border-top: 1px solid #dfdfdf; background: #fff; color: #111; text-align: left; font-size: 13px; }
.compare-row:hover, .payable-row:hover { background: #f6f4f0; }
.compare-name, .payable-row > :first-child { line-height: 1.45; overflow-wrap: anywhere; }
.compare-bars { display: flex; flex-direction: column; gap: 4px; }
.compare-bars i { display: block; height: 6px; border-radius: 1px; background: #111; }
.compare-bars i + i { background: linear-gradient(100deg,#c2aa82,#e6d8bd,#beab8d); }
.compare-row b, .payable-row b { text-align: right; font-weight: 500; }
.payable-row { display: grid; grid-template-columns: 1fr auto 10px; align-items: center; gap: 12px; min-height: 58px; }
.payable-row b { white-space: nowrap; }
.satin-action, .work-dialog .w-btn.w-main { color: #13110e; background: var(--satin-gold); border: 1px solid #cdbfa8; box-shadow: inset 0 1px 0 #f8f3e9; }
.satin-action { display: block; margin: 18px 0 0 auto; min-height: 45px; padding: 0 28px; border-radius: 6px; font-weight: 650; font-size: 16px; }
.satin-action:hover, .work-dialog .w-btn.w-main:hover { filter: brightness(1.035); }
.period-heading { margin-top: 28px; padding-top: 22px; border-top: 1px solid #bcbcbc; }
.metric-card::after { display: none; }
.metric-period, .panel-header p { color: #616161; }
.metric-change.down { color: #695439; }
:focus-visible { outline: 2px solid #927449; outline-offset: 2px; }
@media (max-width: 1050px) { .ledger-overview { grid-template-columns: 1fr; gap: 24px; } }
@media (max-width: 900px) {
  :root { --page-inset: 19px; }
  .content-wrap { padding: 19px var(--page-inset) 26px; }
  .topbar { height: 62px; padding-inline: var(--page-inset); }
  .topbar-actions { gap: 5px; }
  .scope-toggle { font-size: 12px; min-height: 34px; padding: 0 10px; }
  .topbar .demo-badge { display: none; }
  .topbar .icon-button { display: none; }
  .topbar .sync-state.is-error { display: block; position: absolute; top: 63px; right: 10px; z-index: 2; padding: 3px 8px; background: #3b160e; }
  .masthead { gap: 8px; }
  .ledger-hero { padding-top: 17px; padding-bottom: 20px; }
  .ledger-hero dl { margin-top: 18px; }
  .ledger-hero dl > div:nth-child(n+3) { padding-left: 10px; }
  .ledger-hero dt { font-size: 12px; }
  .ledger-hero .hero-primary dt { font-size: 15px; }
  .hero-primary dd { font-size: clamp(54px,13.7vw,77px); }
  .satin-action { width: 100%; }
  .compare-labels, .compare-row { grid-template-columns: minmax(74px,1.2fr) minmax(30px,.85fr) minmax(40px,auto) minmax(40px,auto); gap: 6px; }
  .payable-row { min-height: 46px; }
  #dashboardFilters .filters { align-items: end; }
  .dashboard-grid .legend-group > span { display: inline-flex; }
  .cashflow-panel .panel-header { flex-wrap: wrap; }
}

.ledger-hero dd button { background: transparent; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; overflow-wrap: anywhere; max-width: 100%; }
.ledger-hero dd button:hover { text-decoration: underline; text-underline-offset: .14em; text-decoration-thickness: 1px; }
@media(max-width:900px) {
  .hero-primary dd { font-size: clamp(62px,17.5vw,84px); }
  .topbar .icon-button { display: grid; }
}

.annual-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0}
.annual-grid[hidden],#editTarget[hidden]{display:none}
.annual-panel{padding:18px;color:var(--ink);background:var(--surface,var(--white))}
.annual-panel p,.annual-goal small{color:var(--muted-ink);font-size:12px;line-height:1.6}
.annual-values,.annual-goal{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;margin:14px 0}
.annual-values dt,.annual-goal{font-size:13px}.annual-values dd{font-size:clamp(20px,3vw,30px);font-weight:650;margin:3px 0}
.annual-goal span{text-align:right}.annual-goal progress,.annual-goal small{grid-column:1/-1}
.annual-goal progress{width:100%;height:6px;accent-color:var(--color-primary)}
.annual-panel table{width:100%;border-collapse:collapse;font-size:13px;margin:14px 0;font-variant-numeric:tabular-nums}
.annual-panel th,.annual-panel td{padding:8px 3px;border-bottom:1px solid var(--color-border);text-align:right}
.annual-panel th:first-child{text-align:left}.annual-panel a{color:var(--color-primary)}
@media(max-width:850px){.annual-grid{grid-template-columns:minmax(0,1fr)}}
