/* Светлая кремовая тема, как у дашборда checkbot. Тёмной темы нет: пользователь выбрал светлую. */
:root {
  --bg: #FCF6E5; --card: #FFFDF8; --line: #EADFC4; --line-2: #F3EBD8; --chip: #F3EBD3; --side: #F7EFD9;
  --ink: #0F172A; --muted: #475569; --faint: #64748B;
  --accent: #2563EB; --accent-ink: #fff; --accent-bg: #E3ECFD;
  --warn: #C2410C; --warn-bg: #FFF1E4; --good: #047857; --good-bg: #E8F7EF; --bad: #DC2626; --bad-bg: #FEF2F2;
  --shadow: 0 1px 2px rgba(120, 90, 30, .06), 0 1px 3px rgba(120, 90, 30, .07);
  --radius: 16px;
  --side-w: 232px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent-bg); color: var(--ink); }

.app { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; padding-top: max(16px, env(safe-area-inset-top)); }
.app.wide { max-width: 1240px; }
.app.with-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; margin: 8px 0 18px; }
h2 { font-size: 17px; font-weight: 650; margin: 0 0 8px; }
h2.sec {
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650;
  margin: 26px 4px 10px;
}
.count { font-weight: 500; color: var(--faint); font-size: .9em; margin-left: 4px; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
.link { color: var(--accent); font-size: 15px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--faint); }
.small { font-size: 14px; }
.center { text-align: center; }
.measure { max-width: 75ch; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.late { color: var(--bad); font-weight: 600; }
.good { color: var(--good); font-weight: 600; }
code { background: var(--chip); padding: 1px 6px; border-radius: 6px; }

.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 8px 0 18px; }
.page-head h1 { margin: 0; }
.page-head .btn { align-self: center; }

/* Блоки */
.card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 14px; box-shadow: var(--shadow); min-width: 0;
}
a.card { transition: border-color .15s ease-out; }
a.card:hover { border-color: #D9C9A0; }
.card.notice { border-color: var(--warn); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-head h1, .card-head h2 { margin: 0; }
.big { font-size: 32px; font-weight: 700; line-height: 1.15; margin: 2px 0 4px; }
.stack > * + * { margin-top: 14px; }
.sums { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 4px; }
.sums b { font-size: 20px; margin-left: 4px; }
.foot { margin: 12px 0 0; }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid > .card { margin: 0; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* на телефоне плитки по две в ряд, первая (и последняя, если осталась одна) — во всю ширину */
@media (max-width: 699px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tiles > :first-child, .tiles > :last-child:nth-child(even) { grid-column: span 2; }
  .tiles .card { padding: 14px 16px; }
  .tile .label, .tile .sub { font-size: 13px; }
}
.tiles-wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.two { grid-template-columns: 1fr; align-items: start; }

.tile { display: flex; flex-direction: column; gap: 2px; container-type: inline-size; }
.tile .label { color: var(--faint); font-size: 14px; }
.tile .value { font-size: min(28px, 12.5cqi); font-weight: 650; line-height: 1.2; margin: 2px 0; letter-spacing: -.01em; white-space: nowrap; }
.tile .value .of { font-size: 18px; font-weight: 500; color: var(--faint); }
.tile .sub { color: var(--faint); font-size: 14px; }
.tile.warn { background: var(--warn-bg); border-color: #F5C9A3; }
.tile.warn .value, .tile.warn .label { color: var(--warn); }

.bar { display: block; height: 7px; border-radius: 4px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.bar > i.over { background: var(--bad); }

/* Месяц: группа статей раскрывается в список */
.board .grp { break-inside: avoid; }
.grp summary { list-style: none; cursor: pointer; }
.grp summary::-webkit-details-marker { display: none; }
.grp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.grp-head .t { font-weight: 650; }
.grp summary:hover .t { color: var(--accent); }
.grp[open] summary { margin-bottom: 8px; }

/* Долги: карточка с фактами */
.debt .card-head .t { font-weight: 650; }
.debts { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin: 12px 0 0; font-size: 15px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; text-align: right; white-space: nowrap; }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}
.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

.line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--line-2);
}
a.line:hover .t { color: var(--accent); }
.card > .line:first-of-type, .card-head + .line, .cols > .line:first-child { border-top: 0; }
.line > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.line.off { opacity: .55; }
.t { font-weight: 600; overflow-wrap: anywhere; }
.amt { font-weight: 600; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.amt small { font-weight: 400; }
.note { font-style: italic; }
.day { font-size: 13px; color: var(--faint); margin: 16px 0 0; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.day:first-of-type { margin-top: 8px; }

/* Список, который на широком экране раскладывается в две колонки (по строкам) */
.cols { column-gap: 40px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--faint); vertical-align: 1px; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* Статьи: группы карточками, добавление в одну строку */
.groups { columns: 290px 3; column-gap: 18px; }
.groups > .card { break-inside: avoid; margin-bottom: 18px; }
.card.off { opacity: .6; }
.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 44px;
}
.inline-add input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inline-add.sub { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.inline-add.sub .btn { min-width: 44px; font-size: 20px; }

/* Формы */
.field { display: block; font-size: 14px; color: var(--faint); }
.field input, .field select, .pay input, .pay select {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
.field input:focus, .field select:focus, .pay input:focus, .pay select:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.amount-input { font-size: 30px !important; font-weight: 700; }
.hint { display: block; margin-top: 4px; font-size: 13px; }
form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
fieldset.terms { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; }
fieldset.terms legend { color: var(--faint); font-size: 14px; padding: 0 6px; }
fieldset[data-debt-only] { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  font: inherit; font-weight: 600; color: var(--ink); background: var(--chip); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; text-align: center; transition: background-color .15s ease-out, border-color .15s ease-out;
}
.btn:hover { background: #EDE2C6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1D4ED8; border-color: #1D4ED8; }
.btn-danger { color: var(--bad); background: transparent; border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--line-2); }
form.stack > .btn { width: 100%; }
button.btn:disabled { opacity: .6; cursor: default; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; max-width: 480px; }
.tab { flex: 1; text-align: center; padding: 9px 10px; border-radius: 10px; background: var(--chip); color: var(--muted); font-weight: 600; }
.tab:hover { background: #EDE2C6; }
.tab.on { background: var(--accent); color: var(--accent-ink); }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; }
.filters .btn { grid-column: 1 / -1; }
.pager { display: flex; justify-content: space-between; margin-top: 12px; }

.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-weight: 600; }
.flash-ok { background: var(--good-bg); color: var(--good); }
.flash-err { background: var(--bad-bg); color: var(--bad); }

/* Календарь */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.monthnav h1 { margin: 0; text-align: center; }
.board h2.sec:first-child { margin-top: 10px; }
/* Диаграмма: полоски по группам */
.chart-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.chart-bar .tabs { margin: 0; flex: 1 1 320px; }
.chart-bar .tabs-sm { flex: 0 1 200px; }
button.tab { font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.cbar { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-2); }
.card-head + .cbar { border-top: 0; }
.cbar > input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.cbar summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.cbar summary::-webkit-details-marker { display: none; }
.cbar-t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar summary:hover .cbar-t { color: var(--accent); }
.cbar-v { font-weight: 600; white-space: nowrap; text-align: right; }
.cbar-v small { font-weight: 500; color: var(--faint); margin-left: 8px; }
.cbar-track { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.cbar-track > i { display: block; height: 100%; border-radius: 5px; background: var(--bad); } /* расходы — красным, как суммы */
.inc .cbar-track > i { background: var(--good); } /* доходы — зелёным */
.cbar.off .cbar-t, .cbar.off .cbar-v { color: var(--faint); font-weight: 500; }
.cbar details[open] summary { margin-bottom: 6px; }
.cbar details .line { padding-left: 0; }

/* Платежи: сетка месяца */
.cal-card { padding: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-w { font-size: 12px; font-weight: 600; color: var(--faint); text-align: center; padding: 2px 0 4px; }
.cal-d { min-height: 64px; border-radius: 8px; background: var(--bg); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d.empty { background: none; }
.cal-d.weekend { background: var(--line-2); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d.vac { background: #E0F2FE; }
.vac-who { display: none; font-weight: 600; color: #0369A1; }
.vac-key { display: inline-block; padding: 2px 5px; border-radius: 6px; font-size: 12px; background: #E0F2FE; color: #0369A1; }
.cal-n { font-size: 12px; font-weight: 600; color: var(--faint); line-height: 1.2; }
.cal-d.today .cal-n { color: var(--accent); }
.ev { display: block; border-radius: 6px; padding: 2px 5px; font-size: 12px; line-height: 1.3; background: var(--chip); color: var(--ink); min-width: 0; }
.ev:hover { box-shadow: 0 0 0 1px var(--accent); }
.ev.in { background: var(--good-bg); color: var(--good); }
.ev.late { background: var(--bad-bg); color: var(--bad); }
.ev.paid { opacity: .55; }
.ev.skipped { opacity: .35; text-decoration: line-through; }
.ev-t, .ev-a { display: none; }
.ev-s { font-weight: 600; white-space: nowrap; }
.cal-legend .ev { display: inline-block; margin-right: 4px; }
@media (min-width: 1024px) {
  .cal-card { padding: 16px; }
  .cal { gap: 6px; }
  .cal-d { min-height: 104px; padding: 6px; }
  .ev { padding: 3px 7px; }
  .ev-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ev-a { display: block; font-weight: 600; white-space: nowrap; }
  .ev-s { display: none; }
  .vac-who { display: inline; }
}

.item {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px;
  scroll-margin-top: 16px; box-shadow: var(--shadow); break-inside: avoid;
}
.item:target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.item.paid { background: #FBF7EC; box-shadow: none; }
.item.paid .t, .item.paid .amt { color: var(--muted); }
.item.skipped { opacity: .6; box-shadow: none; }
.item-head { display: flex; justify-content: space-between; gap: 12px; }
.pay { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 10px; }
.pay input, .pay select { margin-top: 0; font-size: 16px; }
.pay .btn { min-height: 42px; }
.pay.done { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.pay.done .btn { min-height: 36px; padding: 0 12px; font-size: 15px; }
.edit { grid-column: 1 / -1; }
.edit summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 4px 0; }
.edit-fields { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 6px; }
.edit-fields input[type=date] { grid-column: 1 / -1; }
.edit-fields .btn { grid-column: 1 / -1; }
.plan-diff { margin-top: 4px; font-weight: 600; }

/* Вход */
.login { max-width: 380px; margin: 12vh auto 0; }
.login h1 { text-align: center; margin-bottom: 18px; }

/* Навигация: на телефоне — панель внизу, на широком экране — колонка слева */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(120, 90, 30, .06);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.nav .brand, .nav .wide-only { display: none; }
.nav-i {
  flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 500; color: var(--faint); padding: 2px 0; min-height: 52px; justify-content: center;
}
.nav-i svg {
  width: 56px; height: 30px; padding: 3px 16px; border-radius: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: background-color .15s ease-out;
}
.nav-i:hover { color: var(--ink); }
.nav-i.on { color: var(--accent); font-weight: 650; }
.nav-i.on svg { background: var(--accent-bg); }
.nav-i.add { color: var(--ink); font-weight: 600; }
.nav-i.add svg { background: var(--accent); stroke: var(--accent-ink); stroke-width: 2.2; }
.nav-i.add:hover svg { background: #1D4ED8; }

@media (min-width: 700px) {
  .app { padding: 28px 24px 40px; }
  .app.with-nav { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr 1fr; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; }
  .cols > .line:nth-child(2) { border-top: 0; }
  .board { columns: 2 320px; column-gap: 18px; }
  .board h2.sec { break-after: avoid; }
}

@media (min-width: 1024px) {
  .app, .app.with-nav { padding: 32px 36px 48px; }
  .with-nav { margin-left: var(--side-w); }
  .app.wide.with-nav { margin-left: max(var(--side-w), calc((100vw - 1240px) / 2 + var(--side-w) / 2)); }
  .app.with-nav:not(.wide) { margin-left: calc(var(--side-w) + max(0px, (100vw - var(--side-w) - 640px) / 2)); }
  h1 { font-size: 28px; }
  .two { grid-template-columns: 1.25fr 1fr; gap: 18px; }
  .two.even { grid-template-columns: 1fr 1fr; }
  .grid { gap: 18px; margin-bottom: 18px; }
  .tiles-wide { align-items: stretch; grid-auto-rows: 1fr; }
  .tile .value { font-size: min(30px, 12.5cqi); }
  .board { columns: 3 300px; }
  .split { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
  .split > aside { position: sticky; top: 24px; display: grid; gap: 14px; }
  .split .filters { grid-template-columns: 1fr; }
  .split .card { margin: 0; }

  .nav {
    top: 0; right: auto; width: var(--side-w); flex-direction: column; justify-content: flex-start; gap: 2px;
    background: var(--side); border-top: 0; border-right: 1px solid var(--line); box-shadow: none; padding: 22px 14px;
  }
  .nav .brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; padding: 0 10px 20px; }
  .nav .brand img { border-radius: 8px; }
  .nav .wide-only { display: flex; }
  .nav-i {
    flex: none; max-width: none; flex-direction: row; gap: 12px; min-height: 44px; padding: 0 10px;
    font-size: 16px; color: var(--muted); border-radius: 10px; justify-content: flex-start;
  }
  .nav-i svg { width: 22px; height: 22px; padding: 0; border-radius: 0; background: none !important; }
  .nav-i:hover { background: var(--line-2); }
  .nav-i.on { background: var(--accent-bg); color: var(--accent); }
  /* «Внести» на широком экране — главная кнопка над списком разделов */
  .nav-i.add {
    order: -1; margin-bottom: 14px; background: var(--accent); color: var(--accent-ink); justify-content: center;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .25), 0 2px 6px rgba(37, 99, 235, .18);
  }
  .nav-i.add svg { stroke: var(--accent-ink); }
  .nav-i.add:hover, .nav-i.add.on { background: #1D4ED8; color: var(--accent-ink); }
  .nav .brand { order: -2; }
  /* Внизу колонки: аватар и имя, по нажатию — меню «Сменить пользователя / Выйти» */
  .nav-user { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); position: relative; flex-direction: column; }
  .nav-user summary {
    display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
    list-style: none; color: var(--ink); font-weight: 600;
  }
  .nav-user summary::-webkit-details-marker { display: none; }
  .nav-user summary:hover, .nav-user[open] summary { background: var(--line-2); }
  .nav-user .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-user summary svg { width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .nav-user:not([open]) summary svg { transform: rotate(180deg); }
  .avatar {
    flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px;
  }
  .user-menu {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); display: grid; padding: 6px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 4px 16px rgba(120, 90, 30, .12);
  }
  .user-menu button {
    font: inherit; font-size: 15px; text-align: left; background: none; border: 0; border-radius: 8px;
    padding: 9px 10px; color: var(--ink); cursor: pointer;
  }
  .user-menu button:hover { background: var(--line-2); }
}

/* Выписка: группы операций с одним выбором на группу */
.board.stmt > .card { break-inside: avoid; }
.pick {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.pick:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Доходы: таблица «строка × месяц»; на телефоне прокручивается внутри карточки */
.mtx-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.mtx { border-collapse: collapse; width: 100%; font-size: 15px; }
.mtx th, .mtx td { padding: 8px 10px; border-top: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.mtx th:first-child, .mtx td:first-child { text-align: left; white-space: normal; min-width: 180px; padding-left: 0; }
.mtx thead th { color: var(--faint); font-weight: 600; font-size: 13px; border-top: 0; }
.mtx tfoot td { font-weight: 650; }
.mtx td.none { color: var(--line); }
.mtx a:hover { color: var(--accent); }
.acc-pick { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.acc-pick .field { flex: 1 1 260px; }

/* Отчёт для печати: на экране — лист по центру, при печати — только отчёт на A4 */
.report { max-width: 900px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; }
.report-bar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.report-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 8px; }
.report-head h1 { margin: 0 0 4px; }
.report-head p { margin: 2px 0; }
.report-total { font-size: 18px; margin-top: 8px !important; }
.report h2 { font-size: 17px; margin: 22px 0 8px; }
.rtab { border-collapse: collapse; width: 100%; font-size: 14px; }
.rtab th, .rtab td { padding: 6px 8px; border-top: 1px solid var(--line-2); text-align: right; vertical-align: top; }
.rtab th:first-child, .rtab td:first-child { text-align: left; padding-left: 0; }
.rtab th:last-child, .rtab td:last-child { padding-right: 0; white-space: nowrap; }
.rtab thead th { color: var(--faint); font-weight: 600; font-size: 12px; border-top: 0; }
.rtab tr.grp td { font-weight: 650; }
.rtab td.ind { padding-left: 16px; }
.rtab tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.rtab.ops { table-layout: fixed; }
.rtab.ops .c-date { width: 64px; } .rtab.ops .c-acc { width: 24%; } .rtab.ops .c-who { width: 12%; } .rtab.ops .c-sum { width: 120px; }
.rtab.ops td:nth-child(2), .rtab.ops th:nth-child(2) { text-align: left; }
.rtab.ops td:nth-child(3), .rtab.ops td:nth-child(4), .rtab.ops th:nth-child(3), .rtab.ops th:nth-child(4) { text-align: left; color: var(--muted); }
.rsec { margin-top: 14px; break-inside: avoid-page; }
.rsec h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin: 0 0 4px; }
.rsec h3 span { white-space: nowrap; }
@media (max-width: 640px) {
  .report { padding: 18px 14px; }
  .rtab.ops td:nth-child(3), .rtab.ops th:nth-child(3), .rtab.ops td:nth-child(4), .rtab.ops th:nth-child(4), .rtab.ops .c-acc, .rtab.ops .c-who { display: none; }
}
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .nav, .flash, .no-print { display: none !important; }
  .app, .app.with-nav, .app.wide.with-nav { max-width: none; margin: 0; padding: 0; }
  .report { max-width: none; border: 0; border-radius: 0; padding: 0; }
  .rtab thead { display: table-header-group; }
  .rtab tr { break-inside: avoid; }
  .rtab.ops td:nth-child(3), .rtab.ops th:nth-child(3), .rtab.ops td:nth-child(4), .rtab.ops th:nth-child(4) { display: table-cell; }
  .rtab.ops .c-acc, .rtab.ops .c-who { display: table-column; }
}
