@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light;
  --canvas: #f3f3ec;
  --surface: #fff;
  --ink: #18201c;
  --muted: #5f6862;
  --line: #dedfd8;
  --pine: #10392e;
  --pine-dark: #0c332a;
  --pine-light: #215244;
  --green: #0c633b;
  --wash: #e1f0e1;
  --soft: #f3f5f1;
  --negative: #a03128;
  --rail: clamp(208px, 17.1vw, 263px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; line-height: 1.5; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #53a477; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { letter-spacing: -.036em; line-height: 1.18; }
h1 { font-size: clamp(2rem, 3vw, 2.78rem); font-weight: 760; }
h2 { font-size: clamp(1.28rem, 2vw, 1.88rem); font-weight: 740; }
h3 { font-size: 1.1rem; font-weight: 680; }
svg { flex: none; vertical-align: middle; }

.app-shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  background: var(--pine-dark); color: #f4f7f1; padding: 28px 11px 19px;
  min-width: 0; height: 100dvh; position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 34px;
}
.brand { display: inline-flex; align-items: center; gap: 15px; text-decoration: none; font-weight: 750; font-size: 1.59rem; letter-spacing: -.035em; }
.sidebar .brand { margin: 0 12px; }
.brand-mark { display: inline-grid; place-content: center; gap: 6px; width: 42px; height: 42px; border-radius: 8px; background: #f2f5ea; color: var(--pine); flex: none; }
.brand-mark i { display: block; width: 23px; height: 3px; border-radius: 2px; background: currentColor; }
.navigation { display: grid; align-content: start; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 12px 15px; min-height: 49px; border-radius: 10px; color: #eef5ef; font-weight: 550; text-decoration: none; line-height: 1.35; }
.nav-link:hover, .nav-link.selected { background: var(--pine-light); }
.sidebar-user { margin-top: auto; padding: 13px 12px 0; border-top: 1px solid #ffffff28; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .9rem; }
.signout { border: 0; border-radius: 8px; background: transparent; color: inherit; width: 38px; height: 38px; }
.signout:hover { background: var(--pine-light); }
.workspace { max-width: 1580px; width: 100%; padding: 21px clamp(17px, 1.7vw, 28px) 42px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 2px; margin-bottom: 20px; min-height: 48px; }
.page-header .button { flex: none; }

.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 650; font-size: .95rem; text-decoration: none; color: #fff; background: var(--pine); line-height: 1.3; text-align: center; }
.button:hover { background: var(--pine-light); }
.button > span[aria-hidden] { font-size: 1.3em; line-height: 1; }
.button.secondary { color: var(--pine); background: #fff; border-color: var(--line); }
.button.secondary:hover { background: var(--soft); border-color: #bfcac0; }
.button.danger { color: var(--negative); background: #fff; border-color: #e3beba; }
.button.danger:hover { background: #fff2ef; }
.button.compact, .button.small { padding: 6px 11px; min-height: 34px; font-size: .85rem; }
.text-link { color: var(--green); font-weight: 620; font-size: .92rem; }
.text-link:hover { color: var(--pine-dark); }
.arrow-link { display: grid; place-content: center; width: 37px; height: 37px; border-radius: 8px; text-decoration: none; color: var(--pine); }
.arrow-link:hover { background: var(--wash); }
.muted, .field-help { color: var(--muted); }
.field-help { font-size: .87rem; line-height: 1.48; }
.negative { color: var(--negative); }

.balance-hero { background: var(--pine); color: #f8fbf6; border-radius: 18px; padding: 25px clamp(24px, 3.2vw, 49px); display: grid; grid-template-columns: 1.02fr 1fr; align-items: center; min-height: 150px; }
.balance-main { padding-right: 19px; }
.balance-main h2 { font-size: clamp(1.17rem, 1.86vw, 1.76rem); font-weight: 620; }
.hero-amount { font-size: clamp(2.45rem, 4.35vw, 4.42rem); font-weight: 790; letter-spacing: -.052em; line-height: 1.14; margin-top: 5px; }
.hero-amount, .share strong, .metric-strip dd, .number, .calculation-lines dd, .forecast-lines dd { font-variant-numeric: tabular-nums; }
.share-group { border-left: 1px solid #e8f6e888; padding-left: clamp(18px, 3.7vw, 59px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.share p { font-size: clamp(.94rem, 1.43vw, 1.33rem); font-weight: 570; margin-bottom: 5px; }
.share strong { font-size: clamp(1.48rem, 2.55vw, 2.63rem); font-weight: 720; letter-spacing: -.045em; line-height: 1.16; display: block; overflow-wrap: anywhere; }
.share small, .share a { color: #d8eddb; font-size: .81rem; display: block; margin-top: 5px; }
.share a:hover { color: #fff; }
.metric-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid #cdd1c9; padding: 21px 0; margin-bottom: 23px; }
.metric-strip > div { padding: 0 clamp(13px, 2.1vw, 31px); min-width: 0; }
.metric-strip > div + div { border-left: 1px solid #cdd1c9; }
.metric-strip dt { font-size: clamp(.84rem, 1.28vw, 1.22rem); line-height: 1.25; }
.metric-strip dt a { text-decoration-color: #749786; }
.metric-strip dd { font-size: clamp(1.23rem, 2.1vw, 2.06rem); font-weight: 730; letter-spacing: -.04em; margin-top: 3px; overflow-wrap: anywhere; }

.overview-columns { display: grid; grid-template-columns: 1.28fr 1fr; gap: 18px; margin-bottom: 19px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: clamp(17px, 1.55vw, 24px); }
.panel + .panel { margin-top: 16px; }
.overview-columns .panel + .panel { margin-top: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading a { flex: none; }
.calculation h2 { margin-bottom: 12px; }
.calculation-lines { margin-bottom: 10px; }
.calculation-lines > div, .forecast-lines > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 3px; border-bottom: 1px solid var(--line); }
.calculation-lines dt { display: flex; gap: 10px; align-items: center; }
.calculation-lines dd, .forecast-lines dd { white-space: nowrap; }
.calculation-lines .highlight { background: var(--wash); color: var(--pine-dark); font-weight: 680; padding: 9px 10px; border: 0; border-radius: 7px; margin-top: 5px; }
.payment-list { list-style: none; margin: 0; padding: 0; }
.payment-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr) max-content; align-items: center; gap: 11px; padding: 8px 0; }
.payment-list li + li { border-top: 1px solid var(--line); }
.date-tile { display: grid; justify-items: center; align-content: center; min-height: 47px; line-height: 1.08; border-radius: 8px; background: var(--wash); color: var(--pine-dark); }
.date-tile strong { font-size: 1.16rem; }
.date-tile span { font-size: .71rem; font-weight: 670; margin-top: 3px; }
.payment-title { min-width: 0; overflow-wrap: anywhere; }
.payment-title a { font-weight: 670; text-decoration: none; }
.payment-title a:hover { text-decoration: underline; }
.payment-title small, .operation-title small { display: block; color: var(--muted); font-size: .8rem; }
.forecast { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.forecast summary { color: var(--pine); font-weight: 660; cursor: pointer; }
.forecast p { margin-top: 7px; }
.forecast-lines > div { padding: 5px 0; }
.forecast-lines > div:last-child { border-bottom: 0; }

.table-wrap { width: 100%; overflow-x: auto; }
.ledger-table { width: 100%; border-spacing: 0; font-size: .94rem; }
.ledger-table th, .ledger-table td { padding: 9px 11px; text-align: left; vertical-align: middle; }
.ledger-table th { background: #eeefeb; color: #3a443d; font-size: .85rem; font-weight: 670; }
.ledger-table th:first-child { border-radius: 7px 0 0 7px; }
.ledger-table th:last-child { border-radius: 0 7px 7px 0; }
.ledger-table td { border-bottom: 1px solid var(--line); }
.ledger-table tbody tr:last-child td { border-bottom: 0; }
.ledger-table time { white-space: nowrap; }
.ledger-table .number { text-align: right; }
.number { white-space: nowrap; }
.number.credit { color: var(--green); font-weight: 680; }
.operation-title { width: 47%; min-width: 175px; overflow-wrap: anywhere; }
.operation-title a { text-decoration: none; font-weight: 600; }
.operation-title a:hover { text-decoration: underline; }
.operation-action { text-align: right; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.filters { align-items: end; margin-bottom: 18px; }
.filters .field { flex: 1 1 130px; }
.filters .text-link { align-self: center; }
.pagination { display: flex; justify-content: end; align-items: center; gap: 10px; margin-top: 15px; }
.empty { color: var(--muted); padding: 15px 0; }
.status { display: inline-flex; white-space: nowrap; border-radius: 6px; background: #f0f1ec; color: #435147; padding: 3px 8px; font-size: .8rem; font-weight: 650; }
.status.actual { background: var(--wash); color: var(--pine); }
.status.plan { background: #f2ede1; color: #594c31; }
.status.overdue { background: #faece8; color: var(--negative); }

.form-panel { width: min(100%, 725px); }
.form-panel h2 + p, .form-panel > p + form { margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-grid > .field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; font-size: .91rem; }
.field > span:first-child, .field > label { color: var(--ink); font-weight: 650; }
input:not([type='checkbox']):not([type='radio']), select, textarea { color: var(--ink); background: #fff; border: 1px solid #cfd6cd; border-radius: 8px; padding: 9px 10px; min-height: 42px; width: 100%; min-width: 0; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--pine); width: 17px; height: 17px; margin: 0; }
textarea { resize: vertical; min-height: 76px; }
.check-field { display: flex; align-items: start; gap: 9px; padding: 5px 0; font-size: .91rem; }
.check-field input { margin-top: .19em; flex: none; }
.check-field.field-wide { display: grid; grid-template-columns: auto 1fr; }
.check-field .field-help { grid-column: 2; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.form-actions form { margin: 0; }
.archive-form { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.archive-form summary { color: var(--negative); cursor: pointer; }
.entry-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.entry-summary dt { color: var(--muted); }
.entry-summary dd { text-align: right; overflow-wrap: anywhere; }
.notice { background: var(--wash); border: 1px solid #c6dec9; color: var(--pine-dark); padding: 11px 15px; border-radius: 9px; margin: 0 0 16px; }
.notice.error { background: #fbefec; border-color: #e8c5be; color: var(--negative); }
.notice.warning { background: #f6efdf; border-color: #e4d7b8; color: #5f4a18; }
.setup-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.setup-notice p { font-size: .9rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split .panel + .panel { margin-top: 0; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.tabs a { display: block; padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 640; }
.tabs a[aria-current='page'], .tabs a:hover { background: var(--wash); color: var(--pine); }

.calendar-grid, .calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-weekdays { color: var(--muted); font-size: .85rem; font-weight: 630; }
.calendar-weekdays > * { padding: 7px; }
.calendar-day { min-height: 83px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.calendar-day.is-blank { background: var(--soft); }
.calendar-day.is-today { background: #f0f7ef; }
.calendar-day > h3 { font-size: .9rem; font-weight: 690; margin-bottom: 5px; }
.calendar-event { display: block; text-decoration: none; font-size: .76rem; line-height: 1.35; margin-bottom: 4px; padding: 4px 6px; background: var(--wash); color: var(--pine-dark); border-radius: 5px; overflow-wrap: anywhere; }
.calendar-event.plan { background: #f3eee3; color: #5b4e32; }
.calendar-event.overdue { background: #faece8; color: var(--negative); }
.calendar-event:hover { text-decoration: underline; }
.calendar-event > * { display: block; }
.calendar-agenda { margin-top: 16px; }
.calendar-header, .calendar-totals, .month-controls { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.calendar-header { justify-content: space-between; margin-bottom: 14px; }
.calendar-toolbar { margin-bottom: 13px; }
.calendar-totals { margin-bottom: 13px; }
.calendar-totals > * { padding-right: 13px; }
.calendar-totals strong { margin-left: 7px; }

.auth-shell { display: grid; align-content: center; width: min(440px, calc(100% - 32px)); min-height: 100dvh; margin: 0 auto; padding: 29px 0; }
.auth-brand { color: var(--pine); margin: 0 auto 21px; }
.auth-brand .brand-mark { color: #f3f7ed; background: var(--pine); }
.auth-shell .panel { padding: 25px; }
.auth-shell form { display: grid; gap: 14px; margin-top: 17px; }
.auth-shell .form-grid { grid-template-columns: 1fr; }
.auth-shell .form-actions { margin-top: 3px; }
.auth-shell .form-actions .button, .auth-shell button { width: 100%; }
.auth-shell .text-link { display: inline-block; margin-top: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .overview-columns { grid-template-columns: 1fr 1fr; gap: 12px; }
  .share-group { padding-left: 22px; }
  .payment-list li { grid-template-columns: 39px minmax(0, 1fr) max-content; gap: 7px; }
  .payment-list .number { font-size: .88rem; }
}

@media (max-width: 830px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 15px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
  .sidebar .brand { margin: 0; font-size: 1.26rem; gap: 9px; }
  .sidebar .brand-mark { width: 32px; height: 32px; gap: 4px; }
  .sidebar .brand-mark i { width: 17px; }
  .sidebar-user { padding: 0; border: 0; margin: 0; grid-area: 1 / 2; }
  .navigation { grid-area: 2 / 1 / 3 / 3; display: flex; flex-wrap: wrap; padding-bottom: 3px; }
  .nav-link { white-space: nowrap; flex: none; min-height: 38px; gap: 7px; padding: 7px 9px; font-size: .82rem; }
  .nav-link svg { width: 17px; height: 17px; }
  .workspace { padding-top: 16px; }
}

@media (max-width: 595px) {
  .workspace { padding-inline: 12px; }
  .page-header { min-height: 40px; margin-bottom: 14px; }
  .page-header h1 { font-size: 1.67rem; }
  .page-header .button { font-size: .84rem; padding: 7px 11px; min-height: 37px; }
  .balance-hero { grid-template-columns: 1fr; gap: 14px; min-height: 0; padding: 18px; border-radius: 14px; }
  .share-group { padding: 11px 0 0; border: 0; border-top: 1px solid #ffffff68; }
  .share strong { font-size: clamp(1.3rem, 5.6vw, 1.85rem); }
  .metric-strip { padding: 14px 0; margin-bottom: 14px; }
  .metric-strip > div { padding-inline: 8px; }
  .metric-strip dd { font-size: 1.12rem; }
  .metric-strip dt { font-size: .79rem; }
  .overview-columns, .split { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .ledger-table td, .ledger-table th { padding: 8px 7px; }
  .operation-title { min-width: 143px; }
  .recent-table td, .recent-table th { font-size: .8rem; }
  .recent-table .operation-title { min-width: 115px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .calendar-grid, .calendar-weekdays { display: none; }
  .calendar-agenda { margin-top: 6px; }
}

