@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;450;500;550;600;650;700;750;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #111310; --surface: #1a1d18; --surface-hover: #22261f; --line: #2b3027;
  --text: #f1f3ec; --muted: #92998a; --subtle: #6e7666; --accent: #c2ed83;
  --accent-dark: #202d18; --red: #e6a296; --radius: 20px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; font: 500 13px/1.55 var(--font); color: var(--text); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button { transition: background .16s, color .16s, transform .16s; }
button:active:not(:disabled) { transform: translateY(1px); }
button .icon { flex-shrink: 0; }
input, select { min-width: 0; }
input::placeholder { color: var(--subtle); opacity: 1; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
a { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: 0 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.positive { color: var(--accent); }
.negative { color: var(--red); }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.65px; text-transform: uppercase; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 12px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 12px; min-height: 44px; }
.button:hover { background: var(--surface-hover); }
.button.primary { color: #1c2915; background: var(--accent); border-color: transparent; }
.button.primary:hover { background: #d1f5a2; }
.button.ghost { background: transparent; }
.button.danger { background: #34231f; border-color: #523830; color: var(--red); }
.button .icon { width: 17px; height: 17px; flex-basis: 17px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: transparent; padding: 10px; width: 42px; height: 42px; color: var(--muted); }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.text-button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 8px 0 8px 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.text-button:hover { color: var(--accent); }
.text-button .icon { width: 14px; height: 14px; flex-basis: 14px; }
.app-shell { min-height: 100dvh; }
.sidebar { width: 226px; background: #161913; border-right: 1px solid var(--line); position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; padding: 34px 21px 22px; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); border: 0; background: none; padding: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: var(--accent); color: #24341a; font-size: 31px; font-weight: 650; line-height: 1; padding-bottom: 4px; font-family: Georgia, serif; flex-shrink: 0; }
.brand strong { display: block; font-size: 16px; font-weight: 750; letter-spacing: -.5px; }
.brand small { display: block; font-size: 9px; color: var(--subtle); letter-spacing: .7px; margin-top: 2px; }
.nav-label { padding: 46px 12px 12px; font-size: 9px; color: var(--subtle); font-weight: 700; letter-spacing: 1.5px; }
.desktop-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; border: 1px solid transparent; border-radius: 11px; padding: 13px 14px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; font-weight: 600; }
.nav-item:hover { background: #20251b; color: var(--text); }
.nav-item.active { background: #283320; color: var(--accent); border-color: #35442a; }
.nav-item.active::after { content: ''; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--accent); }
.sidebar-note { margin-top: auto; padding: 26px 13px 28px; color: var(--subtle); }
.sidebar-note > .icon { width: 27px; height: 27px; margin-bottom: 15px; color: #91a77c; }
.sidebar-note p { font-size: 16px; font-weight: 550; color: #b3bba9; line-height: 1.65; letter-spacing: -.3px; }
.sidebar-note small { display: block; margin-top: 13px; font-size: 10px; color: var(--subtle); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 21px 9px 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #30382a; border: 1px solid #424d38; border-radius: 50%; color: #c7d5ba; font-size: 12px; font-weight: 700; }
.sidebar-profile strong { display: block; font-size: 11px; }
.sidebar-profile small { font-size: 9px; color: var(--muted); }
.sidebar-profile > .icon { margin-left: auto; color: var(--subtle); width: 16px; }
.main { margin-left: 226px; padding: 32px 36px 28px; max-width: 1640px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.topbar-left { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; }
.topbar-left .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--accent); }
.topbar-caption-short { display: none; }
.status-dot { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.demo-badge { background: #293122; color: #b2c99b; font-size: 9px; padding: 3px 7px; border: 1px solid #3c4b30; border-radius: 5px; letter-spacing: .5px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions .icon-button { width: 34px; height: 34px; padding: 7px; border-color: transparent; }
.topbar-actions .icon { width: 17px; height: 17px; }
.topbar-date { color: var(--subtle); font-size: 10px; margin-right: 9px; }
.agent-shortcut { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 11px; background: #242f1d; border: 1px solid #38462c; border-radius: 10px; color: var(--accent); font-size: 11px; font-weight: 700; }
.agent-shortcut:hover, .agent-shortcut.active { background: #334429; }
.agent-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.agent-chat { min-width: 0; overflow: hidden; }
.agent-identity { display: flex; align-items: center; gap: 11px; }
.agent-mark { width: 42px; height: 42px; border-radius: 14px; background: #2e3b24; color: var(--accent); display: grid; place-items: center; }
.agent-mark .icon { width: 25px; height: 25px; }
.agent-read-label { display: flex; gap: 5px; align-items: center; color: var(--subtle); font-size: 9px; }
.agent-read-label .icon { width: 14px; height: 14px; flex-basis: 14px; }
.agent-welcome { padding: 28px 0 22px; }
.agent-welcome h3 { font-size: clamp(23px, 2.5vw, 34px); font-weight: 600; letter-spacing: -1px; line-height: 1.25; }
.agent-welcome p { color: var(--muted); font-size: 12px; max-width: 360px; line-height: 1.8; margin-top: 15px; }
.agent-examples { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 22px; }
.agent-examples button { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #20251b; color: #b4c1a7; font-size: 10px; }
.agent-examples button:hover { border-color: #607249; }
.agent-examples .icon { width: 14px; height: 14px; flex-basis: 14px; }
.agent-messages { display: grid; gap: 13px; }
.agent-message { padding: 13px 15px; border-radius: 13px; max-width: 95%; font-size: 12px; overflow-wrap: anywhere; }
.agent-message small { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.agent-message p { white-space: pre-wrap; line-height: 1.8; }
.user-message { justify-self: end; background: #2a3522; border: 1px solid #3b4a2f; }
.assistant-message { justify-self: start; background: #20241d; border: 1px solid var(--line); }
.agent-thinking { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--muted); font-size: 12px; }
.agent-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border: 1px solid #434f37; border-radius: 14px; background: #13180f; margin-top: 24px; }
.agent-composer:focus-within { border-color: var(--accent); }
.agent-composer textarea { background: transparent; border: 0; color: var(--text); width: 100%; min-width: 0; resize: vertical; max-height: 180px; min-height: 52px; outline: none; font-size: 13px; line-height: 1.7; }
.agent-composer textarea::placeholder { color: var(--subtle); }
.agent-composer .button { width: 42px; height: 42px; padding: 10px; min-height: 42px; flex-shrink: 0; }
.agent-caption { color: var(--subtle); font-size: 10px; line-height: 1.8; padding: 12px 3px 0; }
.agent-checks { display: grid; gap: 20px; min-width: 0; }
.audit-status { display: flex; align-items: center; gap: 11px; padding: 4px 0 19px; }
.audit-status > span { background: #2e3d24; color: var(--accent); padding: 9px; border-radius: 50%; }
.audit-status strong { font-size: 13px; font-weight: 650; }
.audit-status p { color: var(--muted); font-size: 10px; margin-top: 3px; }
.audit-status.needs-attention > span { color: #e8c899; background: #3e3323; }
.audit-accounts { border-top: 1px solid var(--line); padding-top: 5px; }
.audit-accounts > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; font-size: 11px; }
.audit-accounts span { color: var(--muted); }
.audit-accounts strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.audit-issues { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 15px; display: grid; gap: 13px; }
.audit-issue { display: flex; gap: 8px; color: #beae93; font-size: 10px; line-height: 1.8; }
.audit-issue .icon { width: 15px; height: 15px; flex-basis: 15px; margin-top: 1px; }
.audit-issue.issue-error { color: var(--red); }
.audit-repair { margin-top: 17px; width: 100%; }
.reconciliation-plan { margin-top: 20px; border: 1px solid #526540; background: #222c1c; border-radius: 14px; padding: 18px; }
.plan-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--accent); }
.plan-heading h3 { font-size: 13px; font-weight: 700; }
.plan-heading > span { width: 100%; font-size: 9px; color: var(--muted); padding-left: 28px; }
.plan-account { border-bottom: 1px solid #3c4a31; padding: 16px 0; }
.plan-account > div:first-child { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.plan-account strong { font-weight: 650; font-size: 12px; }
.plan-account > div:first-child > span { font-size: 9px; color: var(--muted); }
.plan-values { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-variant-numeric: tabular-nums; }
.plan-values > span { color: var(--muted); font-size: 13px; }
.plan-values > strong { font-size: 17px; color: var(--accent); }
.plan-values > .icon { width: 14px; height: 14px; flex-basis: 14px; color: #7c8f6d; }
.plan-account > p, .plan-repairs p { margin-top: 6px; font-size: 10px; color: var(--muted); }
.plan-repairs { padding-top: 15px; font-size: 11px; }
.plan-note { font-size: 10px; color: #a1b092; line-height: 1.8; margin-top: 15px; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.plan-actions .button { font-size: 11px; }
.agent-error { color: var(--red); margin-top: 15px; font-size: 12px; line-height: 1.7; }
.reconciliation-history > p { font-size: 11px; line-height: 1.8; }
.reconciliation-entry { padding: 11px 0; border-top: 1px solid var(--line); }
.reconciliation-entry > div, .reconciliation-entry p { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.reconciliation-entry > div > strong { font-size: 11px; }
.reconciliation-entry p { color: var(--muted); padding: 4px 0; }
.reconciliation-entry p strong { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 1150px) { .agent-layout { grid-template-columns: 1fr; } .agent-checks { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (max-width: 620px) { .agent-checks { grid-template-columns: 1fr; } .agent-read-label { display: none; } .agent-welcome { padding-top: 18px; } .agent-composer textarea { font-size: 16px; } .plan-account > div:first-child { flex-wrap: wrap; gap: 3px; } .agent-shortcut { padding: 6px 9px; } }
/* AI-агенты: витрина и диалог на тех же токенах, что и агент сверки */
.agents-hub { display: grid; gap: 14px; }
.agents-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agent-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 118px; padding: 20px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.agent-card:hover { background: var(--surface-hover); border-color: #46533a; }
.agent-card .agent-mark { flex-shrink: 0; }
.agent-card > .icon { width: 16px; height: 16px; flex-basis: 16px; color: var(--subtle); }
.agent-card-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.agent-card-body strong { font-size: 14px; font-weight: 650; }
.agent-card-body span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.agent-card-secondary { min-height: 0; padding: 14px 20px; }
.agent-card-secondary .agent-mark { width: 34px; height: 34px; border-radius: 11px; background: #262b21; color: var(--muted); }
.agent-card-secondary .agent-mark .icon { width: 19px; height: 19px; }
.agents-chat { max-width: 920px; }
.agents-chat .panel-header { margin-bottom: 14px; }
.agents-back { padding-left: 0; }
.agents-back .prev { transform: rotate(180deg); }
.agents-quick { padding-bottom: 18px; }
.agents-empty { font-size: 11px; line-height: 1.7; }
.agent-message.has-results { max-width: 100%; width: 100%; }
.result-card { margin-top: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #161a13; }
.result-card.level-warning { border-color: #4b4932; }
.result-card.level-error { border-color: #5a3b33; }
.result-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-card h4 { font-size: 11px; font-weight: 650; color: var(--muted); }
.result-badge { flex-shrink: 0; font-size: 9px; padding: 3px 7px; border-radius: 7px; background: #263020; color: var(--accent); }
.level-warning .result-badge { background: #33301f; color: #e3cf96; }
.level-error .result-badge { background: #3b2621; color: var(--red); }
.result-summary { margin-top: 7px; font-size: 12px; line-height: 1.7; white-space: normal; }
.result-rows { margin: 10px 0 0; border-top: 1px solid var(--line); }
.result-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid #23281f; font-size: 11px; }
.result-rows > div:last-child { border-bottom: 0; }
.result-rows dt { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.result-rows dt small { display: block; margin: 3px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.5; }
.result-rows dd { margin: 0; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-missing { display: flex; gap: 7px; margin-top: 10px; color: #d6c79f; font-size: 10px; line-height: 1.7; white-space: normal; }
.result-missing .icon { width: 14px; height: 14px; flex-basis: 14px; margin-top: 2px; }
.agents-chat .reconciliation-plan { margin-top: 12px; }
.plan-state { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--accent); font-size: 11px; }
.plan-state .icon { width: 15px; height: 15px; flex-basis: 15px; }
.agent-suggest { margin-top: 12px; font-size: 11px; }
.agents-chat .agent-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agents-chat .agent-error .button { font-size: 11px; padding: 8px 12px; min-height: 36px; }
@media (max-width: 1020px) { .agents-grid { grid-template-columns: 1fr; } .agent-card { min-height: 0; } }
@media (max-width: 620px) { .agent-card { padding: 16px; } .result-card { padding: 12px; } .result-rows > div { gap: 10px; } .agents-chat .agent-read-label { display: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 27px; }
.page-heading h1 { font-size: 30px; font-weight: 650; letter-spacing: -1.25px; }
.page-heading p { color: var(--muted); font-size: 11px; margin-top: 9px; }
.heading-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.month-picker { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; background: #191c16; padding: 2px; }
.month-picker button { display: grid; place-items: center; width: 28px; height: 34px; padding: 5px; background: none; border: 0; color: var(--muted); border-radius: 7px; }
.month-picker button:hover { background: var(--surface-hover); }
.month-picker .icon { width: 13px; height: 13px; flex-basis: 13px; }
.month-picker .prev { transform: rotate(180deg); }
.month-picker span { padding: 0 7px; font-size: 11px; white-space: nowrap; text-transform: capitalize; min-width: 106px; text-align: center; }
.summary-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); position: relative; overflow: hidden; min-width: 0; }
.stat-label { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.stat-label > .icon { width: 16px; height: 16px; flex-basis: 16px; opacity: .8; }
.stat-value { font-size: clamp(23px, 2.25vw, 33px); font-weight: 650; letter-spacing: -1.1px; margin: 13px 0 12px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value .currency { color: var(--subtle); font-weight: 450; font-size: .65em; letter-spacing: 0; margin-left: 3px; }
.stat-foot { font-size: 9px; color: var(--subtle); display: flex; gap: 6px; align-items: center; min-height: 18px; }
.stat-foot strong { color: #b9c3ae; font-weight: 500; }
.trend-badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; color: var(--accent); background: #2b3820; font-size: 9px; }
.trend-badge.bad { color: var(--red); background: #3b2a24; }
.trend-badge .icon { height: 10px; width: 10px; flex-basis: 10px; }
.balance-card { background: #26351e; border-color: #40532f; }
.balance-card::after { content: ''; position: absolute; width: 125px; height: 125px; border: 1px solid #41572f; border-radius: 50%; right: -45px; bottom: -55px; box-shadow: 0 0 0 16px #41572f15, 0 0 0 33px #41572f15; pointer-events: none; }
.balance-card .stat-label { color: #b8c5a9; }
.balance-card .stat-value { color: #d3f5a6; position: relative; z-index: 1; }
.balance-card .currency { color: #a8c289; }
.balance-card .stat-foot { color: #98ac84; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); gap: 20px; margin-bottom: 24px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.panel-header h2, .section-header h2 { font-size: 13px; font-weight: 650; letter-spacing: -.15px; }
.panel-header p { color: var(--subtle); font-size: 10px; margin-top: 5px; }
.segment-control { display: flex; background: #12150f; padding: 3px; border: 1px solid #292e24; border-radius: 8px; gap: 2px; }
.segment-control button { background: none; border: 0; padding: 6px 10px; border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }
.segment-control button.active { color: var(--text); background: #30372a; box-shadow: 0 1px 4px #0002; }
.chart-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 13px; }
.chart-summary strong { font-size: 25px; font-weight: 550; letter-spacing: -.8px; }
.chart-legend { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 9px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend-dot.previous { background: #647455; }
.line-chart { position: relative; height: 174px; margin-top: 5px; outline-offset: 7px; }
.line-chart > svg { width: 100%; height: 150px; overflow: visible; }
.chart-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--subtle); padding: 7px 3px 0; }
.chart-tooltip { position: absolute; z-index: 2; padding: 8px 11px; background: #30382a; border: 1px solid #556444; border-radius: 8px; font-size: 10px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 20px #0003; transform: translateX(-50%); }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip span { color: var(--muted); display: block; font-size: 9px; }
.budget-panel { display: flex; flex-direction: column; }
.budget-heading-icon { color: var(--accent); background: #2a3621; border-radius: 9px; padding: 8px; }
.budget-heading-icon .icon { width: 16px; height: 16px; }
.budget-amount { font-size: 29px; letter-spacing: -.9px; font-weight: 600; margin: 0 0 4px; }
.budget-caption { color: var(--muted); font-size: 10px; }
.progress-track { height: 7px; background: #30362a; border-radius: 8px; overflow: hidden; }
.progress-track > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.progress-track > span.over { background: var(--red); }
.budget-panel .progress-track { margin: 20px 0 8px; }
.budget-labels { display: flex; justify-content: space-between; color: var(--subtle); font-size: 9px; gap: 7px; }
.budget-labels strong { color: var(--muted); font-weight: 500; }
.budget-insight { display: flex; align-items: center; gap: 11px; margin-top: auto; padding-top: 20px; }
.budget-insight > .icon { color: #a4bf89; height: 18px; width: 18px; }
.budget-insight strong { display: block; font-size: 11px; font-weight: 600; }
.budget-insight p { font-size: 9px; color: var(--subtle); margin-top: 3px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-header h2 small { margin-left: 7px; padding: 2px 5px; border: 1px solid var(--line); color: var(--subtle); border-radius: 4px; font-size: 8px; font-weight: 500; }
.accounts-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 25px; }
.account-card { background: transparent; border: 1px solid var(--line); border-radius: 14px; text-align: left; padding: 15px 16px; display: grid; grid-template-columns: 32px 1fr 14px; align-items: center; gap: 11px; min-width: 0; }
.account-card:hover { border-color: #526244; background: var(--surface); }
.account-symbol { background: color-mix(in srgb, var(--account-color) 12%, transparent); color: var(--account-color); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; }
.account-symbol .icon { width: 17px; height: 17px; }
.account-card .account-name { font-size: 9px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; }
.account-card strong { display: block; font-size: 13px; margin-top: 3px; font-weight: 600; white-space: nowrap; letter-spacing: -.2px; }
.account-card > .icon { width: 12px; height: 12px; color: var(--subtle); }
.transactions-panel { padding-bottom: 9px; }
.transactions-panel .panel-header { margin-bottom: 8px; }
.transaction-head { display: grid; grid-template-columns: 1fr 90px 110px 18px; gap: 10px; font-size: 8px; color: var(--subtle); text-transform: uppercase; letter-spacing: .9px; padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.transaction-head > :nth-child(3) { text-align: right; }
.transaction-row { display: grid; grid-template-columns: 1fr 90px 110px 18px; gap: 10px; align-items: center; text-align: left; width: 100%; border: 0; border-bottom: 1px solid #282d23; padding: 14px 0; background: transparent; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-row:hover { background: #23281e; }
.transaction-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.category-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: color-mix(in srgb, var(--cat-color) 10%, transparent); color: var(--cat-color); flex-shrink: 0; }
.category-icon .icon { width: 17px; height: 17px; }
.transaction-description { min-width: 0; }
.transaction-description strong { display: block; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.transaction-description small { display: block; font-size: 9px; color: var(--subtle); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-account { color: var(--muted); font-size: 9px; }
.transaction-amount { text-align: right; font-size: 12px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transaction-amount small { display: block; color: var(--subtle); font-size: 8px; font-weight: 500; margin-top: 2px; }
.transaction-row > .icon { width: 12px; height: 12px; color: var(--subtle); }
.categories-panel .panel-header { margin-bottom: 15px; }
.category-summary { display: flex; gap: 22px; align-items: center; margin: 4px 0 19px; }
.donut { width: 110px; height: 110px; position: relative; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.donut-center strong { font-size: 22px; font-weight: 550; letter-spacing: -.5px; }
.donut-center span { font-size: 8px; color: var(--subtle); }
.category-summary-text { color: var(--muted); font-size: 10px; }
.category-summary-text strong { display: block; font-size: 12px; color: var(--text); margin: 4px 0 6px; font-weight: 550; }
.category-summary-text span { color: var(--subtle); font-size: 9px; }
.category-mini { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 10px; }
.category-mini .legend-dot { width: 6px; height: 6px; }
.category-mini .category-mini-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-mini strong { margin-left: auto; font-size: 10px; font-weight: 550; white-space: nowrap; }
.category-mini .percentage { color: var(--subtle); font-size: 9px; width: 29px; text-align: right; }
.page-footer { display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font-size: 9px; gap: 12px; padding: 5px 1px; }
.page-footer span { display: flex; align-items: center; gap: 6px; }
.page-footer .icon { width: 12px; height: 12px; flex-basis: 12px; }
.page-footer button { color: var(--subtle); font-size: 9px; padding: 0; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.mobile-nav { display: none; }
.notice { padding: 12px 15px; background: #2a2d1f; border: 1px solid #4b5035; border-radius: 12px; color: #d0d8ad; font-size: 11px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.notice .button { margin-left: auto; white-space: nowrap; padding: 7px 12px; min-height: 32px; }
.history-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 21px; }
.search-field { position: relative; flex: 1; min-width: 160px; }
.search-field > .icon { position: absolute; left: 14px; top: 13px; color: var(--subtle); width: 17px; height: 17px; }
.search-field input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--text); padding: 13px 15px 13px 42px; font-size: 12px; }
.filter-select { padding: 12px 30px 12px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 11px; max-width: 100%; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.filter-chips button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 8px 13px; font-size: 10px; color: var(--muted); }
.filter-chips button.active { color: var(--accent); background: #29371f; border-color: #445936; }
.day-label { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; color: var(--muted); padding: 22px 0 8px; }
.day-label:first-child { padding-top: 0; }
.history-panel { margin-bottom: 20px; }
.history-panel .transaction-row { padding: 16px 0; }
.history-count { color: var(--subtle); font-size: 10px; margin: 12px 0; }
.load-more { width: 100%; margin-top: 15px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state > .icon { margin: 0 auto 15px; width: 30px; height: 30px; color: #80946c; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-state p { font-size: 11px; margin: 8px auto 17px; max-width: 270px; }
.analytics-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 24px; }
.category-budget-row { display: grid; grid-template-columns: 35px 1fr 100px; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.category-budget-row:last-child { border: 0; }
.category-budget-row strong { font-size: 11px; font-weight: 550; }
.category-budget-row .progress-track { margin-top: 8px; height: 4px; }
.category-budget-amount { text-align: right; font-size: 11px; }
.category-budget-amount small { font-size: 8px; display: block; color: var(--subtle); margin-top: 4px; }
.monthly-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 13px; height: 220px; margin-top: 26px; align-items: end; }
.month-bars { display: flex; flex-direction: column; height: 100%; justify-content: end; min-width: 0; }
.bars { display: flex; align-items: end; justify-content: center; gap: 5px; height: 180px; border-bottom: 1px solid var(--line); }
.bar { width: 24%; max-width: 26px; border-radius: 5px 5px 0 0; background: #61764a; min-height: 2px; }
.bar.income { background: var(--accent); }
.month-bars span { text-align: center; color: var(--subtle); font-size: 9px; margin-top: 12px; }
.insight-row { display: flex; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.insight-row:last-child { border-bottom: 0; }
.insight-row > .icon { color: #acc28f; margin-top: 2px; }
.insight-row h3 { font-size: 12px; font-weight: 550; }
.insight-row p { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.7; }
.accounts-full { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.large-account { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden; }
.large-account-head { display: flex; gap: 12px; align-items: center; }
.large-account-head .account-symbol { width: 40px; height: 40px; border-radius: 12px; }
.large-account-head h2 { font-size: 13px; font-weight: 600; }
.large-account-head p { font-size: 9px; color: var(--muted); margin-top: 4px; }
.large-account-value { font-size: 32px; font-weight: 550; letter-spacing: -1px; margin: 25px 0 22px; }
.account-actions { display: flex; gap: 8px; }
.account-actions .button { font-size: 10px; padding: 9px 13px; min-height: 36px; }
.account-details { color: var(--muted); font-size: 10px; margin-top: 17px; }
.account-details strong { color: #d2d9c9; font-weight: 550; }
.initial-state { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; }
.initial-state .brand-mark { width: 55px; height: 55px; font-size: 43px; margin-bottom: 20px; border-radius: 18px; }
.initial-state h1 { font-size: 25px; font-weight: 600; letter-spacing: -.6px; }
.initial-state p { color: var(--muted); margin: 12px 0 25px; max-width: 370px; font-size: 12px; line-height: 1.8; }
.loader { width: 19px; height: 19px; border-radius: 50%; border: 2px solid #455637; border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.page-content { animation: enter .25s ease-out; }
dialog { background: #1c2019; color: var(--text); border: 1px solid #3a4332; border-radius: 25px; width: min(460px, calc(100% - 32px)); padding: 28px; max-height: min(90dvh, 850px); overflow-y: auto; box-shadow: 0 30px 100px #0008; }
dialog::backdrop { background: #070a06aa; backdrop-filter: blur(7px); }
.dialog-handle { display: none; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 23px; }
.dialog-header h2 { font-size: 18px; font-weight: 600; letter-spacing: -.4px; }
.dialog-header .icon-button { border-color: transparent; width: 32px; height: 32px; padding: 6px; }
.operation-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #12170f; border: 1px solid var(--line); padding: 4px; border-radius: 12px; }
.operation-types button { background: transparent; border: 0; padding: 10px 6px; color: var(--muted); border-radius: 8px; font-size: 12px; }
.operation-types button.active { background: #303e25; color: var(--accent); }
.amount-field { display: flex; align-items: center; justify-content: center; margin: 27px 0 6px; gap: 8px; }
.amount-field input { width: 100%; max-width: 290px; text-align: right; background: transparent; border: 0; padding: 0; color: var(--text); font-size: 46px; letter-spacing: -1.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.amount-field input:focus { outline: 0; }
.amount-field input::placeholder { color: #59614f; }
.amount-field span { font-size: 28px; color: var(--subtle); padding-right: 30px; }
.amount-caption { text-align: center; font-size: 10px; color: var(--subtle); margin-bottom: 25px; }
.form-field { display: block; margin-bottom: 16px; }
.form-field > span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.form-field input, .form-field select { width: 100%; padding: 13px 14px; border: 1px solid #363e2e; border-radius: 10px; color: var(--text); background: #171b14; font-size: 12px; min-height: 45px; }
.form-field input[type=date] { appearance: none; -webkit-appearance: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.category-choices { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
.category-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid #30382a; border-radius: 11px; padding: 13px 5px 11px; color: var(--muted); background: #181c15; font-size: 9px; line-height: 1.4; text-align: center; }
.category-choice .icon { width: 20px; height: 20px; color: var(--cat-color); }
.category-choice.active { border-color: #7d9b59; color: var(--accent); background: #2a3620; }
.form-submit { width: 100%; margin-top: 7px; min-height: 48px; font-size: 13px; }
.form-body { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-body:disabled { opacity: .65; }
.native-main .form-submit { display: none; }
.form-hint { color: var(--subtle); font-size: 9px; text-align: center; margin-top: 13px; }
.form-note { color: #cec49e; font-size: 10px; margin: -3px 0 17px; line-height: 1.65; }
.form-error { padding: 12px; font-size: 11px; color: #edb8ac; background: #392922; border: 1px solid #634537; border-radius: 10px; margin-bottom: 13px; }
.form-error:empty { display: none; }
.form-extra { margin: -3px 0 18px; }
.form-extra summary { color: var(--subtle); font-size: 10px; cursor: pointer; padding: 7px 0; }
.form-extra select { margin-top: 5px; }
.detail-icon { display: flex; justify-content: center; margin-bottom: 17px; }
.detail-icon .category-icon { width: 56px; height: 56px; border-radius: 17px; }
.detail-icon .icon { width: 27px; height: 27px; }
.detail-amount { font-size: 38px; font-weight: 550; letter-spacing: -1px; text-align: center; }
.detail-title { font-size: 13px; text-align: center; color: var(--muted); margin: 8px 0 25px; overflow-wrap: anywhere; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 13px 0; font-size: 11px; }
.detail-row span { color: var(--muted); }
.detail-row strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.detail-actions { margin-top: 17px; }
.detail-actions .button { width: 100%; }
.confirm-copy { color: var(--muted); font-size: 12px; line-height: 1.8; margin-bottom: 20px; }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-buttons .button { flex: 1; }
.toast { position: fixed; left: calc(50% + 113px); bottom: 26px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 13px 19px; background: #34422a; color: #e1f5cc; border: 1px solid #657f4e; border-radius: 13px; font-size: 12px; box-shadow: 0 8px 25px #0004; max-width: calc(100% - 32px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.toast.error { background: #402b24; border-color: #815747; color: #f4c4b9; }

@media (min-width: 1700px) { .main { margin-right: auto; margin-left: max(226px, calc((100% - 1414px) / 2)); } }
@media (max-width: 1200px) {
  .sidebar { width: 196px; padding-left: 15px; padding-right: 15px; }
  .main { margin-left: 196px; padding: 27px 26px; }
  .summary-grid { gap: 10px; }
  .stat-card { padding: 17px; }
  .stat-value { font-size: 25px; }
  .stat-foot { font-size: 8px; }
  .content-grid { gap: 15px; grid-template-columns: minmax(0, 1.65fr) minmax(255px, 1fr); }
  .panel { padding: 19px; }
  .account-card { padding: 13px 11px; gap: 8px; grid-template-columns: 30px 1fr; }
  .account-card > .icon { display: none; }
  .account-card strong { font-size: 11px; }
  .transaction-head, .transaction-row { grid-template-columns: 1fr 65px 90px 10px; gap: 7px; }
  .category-summary { gap: 14px; }
  .donut { width: 95px; height: 95px; }
  .page-heading h1 { font-size: 27px; }
  .heading-actions { gap: 8px; }
  .heading-actions .button { padding: 11px; }
  .toast { left: calc(50% + 98px); }
}
@media (max-width: 1020px) and (min-width: 761px) {
  .sidebar { width: 76px; padding: 25px 12px; align-items: center; }
  .sidebar .brand > span, .nav-label, .nav-item > span, .nav-item.active::after, .sidebar-note, .sidebar-profile > div:not(.avatar), .sidebar-profile > .icon { display: none; }
  .desktop-nav { margin-top: 45px; }
  .nav-item { padding: 13px; }
  .sidebar-profile { padding: 20px 0 0; margin-top: auto; }
  .main { margin-left: 76px; }
  .toast { left: calc(50% + 38px); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(19px + var(--tg-content-safe-area-inset-top, 0px)) 20px calc(108px + env(safe-area-inset-bottom, 0px)); }
  .topbar { margin-bottom: 25px; }
  .topbar-left { font-size: 11px; }
  .topbar-caption { display: none; }
  .topbar-caption-short { display: inline; }
  .topbar-date { display: none; }
  .topbar-actions { gap: 5px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 21px; gap: 19px; }
  .page-heading h1 { font-size: 29px; letter-spacing: -1.2px; }
  .page-heading p { font-size: 11px; margin-top: 7px; }
  .heading-actions { width: 100%; justify-content: space-between; }
  .heading-actions .button { min-height: 38px; padding: 8px 12px; font-size: 10px; }
  .month-picker { background: transparent; }
  .month-picker button { height: 31px; }
  .month-picker span { font-size: 11px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 22px; }
  .balance-card { grid-column: 1 / -1; padding: 22px; }
  .balance-card .stat-value { font-size: 38px; margin: 14px 0 13px; letter-spacing: -1.5px; }
  .balance-card .stat-foot { font-size: 10px; }
  .balance-card::after { width: 170px; height: 170px; right: -40px; bottom: -80px; box-shadow: 0 0 0 23px #41572f15, 0 0 0 47px #41572f15; }
  .summary-grid > .stat-card:last-child { display: none; }
  .stat-card { padding: 17px; border-radius: 17px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 26px; margin: 12px 0 10px; }
  .stat-foot { font-size: 9px; flex-wrap: wrap; gap: 4px; }
  .content-grid, .analytics-grid { grid-template-columns: 1fr; gap: 18px; margin-bottom: 22px; }
  .panel { padding: 20px; border-radius: 18px; }
  .panel-header h2, .section-header h2 { font-size: 13px; }
  .line-chart { height: 173px; }
  .chart-summary strong { font-size: 25px; }
  .chart-legend { gap: 9px; font-size: 8px; }
  .budget-panel .panel-header { margin-bottom: 12px; }
  .budget-amount { font-size: 28px; }
  .budget-insight { padding-top: 20px; }
  .budget-insight p { font-size: 10px; }
  .accounts-row { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: -20px; margin-right: -20px; padding: 0 20px; gap: 11px; margin-bottom: 24px; scroll-snap-type: x proximity; }
  .accounts-row::-webkit-scrollbar { display: none; }
  .account-card { min-width: 167px; padding: 16px 14px; gap: 11px; scroll-snap-align: start; }
  .account-card strong { font-size: 13px; }
  .account-card .account-name { font-size: 10px; }
  .transactions-panel { padding-bottom: 6px; }
  .transaction-head { display: none; }
  .transaction-row { grid-template-columns: minmax(0,1fr) auto; padding: 15px 0; gap: 10px; }
  .transaction-account, .transaction-row > .icon { display: none; }
  .transaction-description strong { font-size: 11px; }
  .transaction-description small { font-size: 9px; }
  .transaction-amount { font-size: 12px; }
  .transaction-amount small { font-size: 9px; }
  .category-summary { gap: 28px; }
  .donut { width: 119px; height: 119px; }
  .category-summary-text { font-size: 11px; }
  .category-summary-text strong { font-size: 14px; }
  .category-mini { font-size: 11px; margin-top: 15px; }
  .category-mini strong { font-size: 11px; }
  .page-footer { align-items: flex-start; flex-direction: column; gap: 7px; font-size: 9px; padding-top: 6px; }
  .page-footer > span:first-child { color: #929b86; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; bottom: 0; right: 0; z-index: 20; border-top: 1px solid #343c2c; background: #181d14f5; backdrop-filter: blur(20px); padding: 9px max(11px, env(safe-area-inset-left, 0px)) calc(10px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); }
  .mobile-nav > button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; background: none; border: 0; color: var(--subtle); font-size: 8px; padding: 5px 0 0; min-height: 45px; }
  .mobile-nav > button.active { color: var(--accent); }
  .mobile-nav > button > .icon { width: 20px; height: 20px; }
  .mobile-nav .nav-add { padding: 0; }
  .nav-add > span { display: grid; place-items: center; border-radius: 15px; background: var(--accent); width: 46px; height: 42px; color: #24341b; margin-top: -1px; }
  .nav-add .icon { width: 23px; height: 23px; }
  .toast { left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 28px); font-size: 11px; }
  .history-controls { gap: 9px; }
  .history-controls .search-field { flex-basis: 100%; }
  .history-controls select { flex: 1; }
  .filter-chips { gap: 5px; margin-bottom: 18px; }
  .filter-chips button { font-size: 9px; padding: 8px 11px; }
  .accounts-full { grid-template-columns: 1fr; gap: 16px; }
  .large-account-value { font-size: 32px; }
  .notice { font-size: 10px; align-items: flex-start; }
  dialog { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; max-height: calc(100dvh - max(15px, var(--tg-content-safe-area-inset-top, 0px))); border-radius: 25px 25px 0 0; padding: 12px 23px calc(25px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px))); border-bottom: 0; }
  .dialog-handle { display: block; width: 31px; height: 4px; border-radius: 6px; background: #555f49; margin: 0 auto 20px; }
  .dialog-header { margin-bottom: 19px; }
  .dialog-header h2 { font-size: 18px; }
  .amount-field { margin-top: 22px; }
  .amount-field input { font-size: 44px; }
  .form-field input, .form-field select { font-size: 16px; padding: 12px; }
  .form-field > span { font-size: 11px; }
  .category-choice { font-size: 9px; padding: 11px 4px; }
  .form-row { gap: 10px; }
  .form-hint { font-size: 10px; }
}
@media (max-width: 370px) {
  .agent-shortcut span { display: none; }
  .main { padding-left: 16px; padding-right: 16px; }
  .page-heading h1 { font-size: 26px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 23px; }
  .panel { padding: 16px; }
  .chart-legend { gap: 6px; }
  .chart-summary strong { font-size: 23px; }
  .transaction-description strong { font-size: 10px; }
  .transaction-amount { font-size: 11px; }
  dialog { padding-left: 18px; padding-right: 18px; }
  .account-actions .button { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
