/* Товарка: світла тема, два розкладки (телефон з нижньою панеллю, десктоп з верхнім меню). Без темної теми. */
:root {
  --bg: #EEF0F4; --card: #FFFFFF; --ink: #16181D; --muted: #6B7280; --line: #E6E8EE; --field: #F4F5F9;
  --hero: #FF6B3D; --hero-ink: #1A0F08; --accent: #D4410E;
  --good: #15803D; --good-strong: #0A5C28; --good-bg: #DCFCE7;
  --bad: #DC2626; --bad-text: #B91C1C; --bad-bg: #FEE2E2;
  --warn-bg: #FFF3CC; --warn: #7A5A00; --info-bg: #DBEAFE; --info: #1D4ED8; --off-bg: #E5E7EB; --off: #4B5563;
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 10px 28px rgba(20, 24, 40, .06);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--hero); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--good); }
.pos2 { color: var(--good-strong); font-weight: 800; }
.neg { color: var(--bad); }

/* ---------- верхня панель ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; max-width: 1240px; margin: 0 auto; padding: 10px 14px 0; }
.brand { order: 0; flex: 1; font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; padding: 4px 0 8px; }
.brand:hover { text-decoration: none; }
.logout { order: 2; margin: 0; padding-bottom: 8px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 600 14px var(--font); padding: 8px 4px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.topnav { display: none; order: 1; }
.periodbar { order: 3; width: 100%; min-width: 0; }
.periodbar:empty { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; background: var(--field); color: var(--ink); font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease); }
.chip:hover { text-decoration: none; background: #E7EAF1; }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--ink); color: #fff; }

/* ---------- сторінка ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 14px 14px 40px; }
body.has-tabs { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.ptitle { font-size: 26px; margin: 8px 0 16px; }
.sect { font-size: 20px; margin: 28px 0 12px; }
.subsect { font-size: 15px; color: var(--muted); margin: 18px 0 4px; font-weight: 700; }
.backlink { margin: 4px 0 10px; font-weight: 600; }

/* ---------- нижня панель (телефон) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted);
  font-size: 11px; font-weight: 700; transition: color 160ms ease, transform 160ms var(--ease); }
.tabbar a:hover { text-decoration: none; }
.tabbar a:active { transform: scale(.95); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }

/* ---------- період ---------- */
.rangebox { margin: 4px 0 12px; }
.rangebox summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer;
  padding: 2px 4px; font-size: 14px; }
.rangebox summary::-webkit-details-marker { display: none; }
.rangebox-now { font-weight: 700; }
.rangebox-set { color: var(--accent); font-weight: 600; }
.rangeform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; background: var(--card); border-radius: var(--r-md); padding: 12px; }
.rangeform input[type=date] { width: auto; flex: 1 1 130px; }
.rangeform-dash { color: var(--muted); }

/* ---------- герой ---------- */
.hero { background: var(--hero); color: var(--hero-ink); border-radius: var(--r-lg); padding: 22px 20px 20px; }
.hero-label { margin: 0; font-size: 14px; font-weight: 600; opacity: .85; }
.hero-num { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin: 14px 0 22px; overflow-wrap: anywhere; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; margin: 0; padding-top: 16px; border-top: 1px solid rgba(26, 15, 8, .2); }
.hero-stats > div:last-child { grid-column: 1 / -1; }
.hero-stats dt { font-size: 13px; font-weight: 600; opacity: .78; }
.hero-stats dd { margin: 2px 0 0; font-size: 19px; font-weight: 800; }
.hero-note, .hero-tests { margin: 16px 0 0; font-size: 14px; font-weight: 600; }
.hero-tests { padding-top: 14px; border-top: 1px solid rgba(26, 15, 8, .2); }
.hero-note + .hero-tests, .hero-stats + .hero-tests { margin-top: 16px; }
.hero-calc { margin-bottom: 14px; }

/* ---------- картки товарів ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.pcard { position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: box-shadow 200ms var(--ease), transform 200ms var(--ease); }
.pcard.is-minus::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--bad); }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pcard-head h3 { font-size: 19px; line-height: 1.25; }
.pcard-head h3 a { color: var(--ink); }
.pcard-head h3 a:hover { text-decoration: none; color: var(--accent); }
.pname { min-width: 0; }
.pkey { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; }
.plabel { margin-top: 14px; font-size: 14px; color: var(--muted); font-weight: 600; }
.pbig { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-top: 2px; }
.pstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; margin: 20px 0 18px; }
.pstats dt { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.pstats dd { margin: 3px 0 0; font-size: 17px; font-weight: 800; white-space: nowrap; }
.costs { display: grid; gap: 8px; }
.costrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; font-size: 14px; }
.costlabel { font-weight: 800; }
.costval { color: var(--muted); font-weight: 600; min-width: 0; }
.costval b { color: var(--ink); font-weight: 800; }
.costval b.pos { color: var(--good); }
.costval b.neg { color: var(--bad); }
.pending { margin: 16px 0 0; background: var(--warn-bg); color: var(--warn); border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px; font-weight: 600; }
.limitnote { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.todayline { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.pcard-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.pcard-foot::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: 6px; }
.pcard .pending + .pcard-foot, .pcard .costs + .pcard-foot { margin-top: 16px; }
.inl { display: inline; margin: 0; }
a.btn { display: inline-block; text-decoration: none; }
a.btn:hover { text-decoration: none; }
.act { background: none; border: 0; padding: 8px 0; font: 700 14px var(--font); color: var(--accent); cursor: pointer;
  transition: transform 160ms var(--ease), opacity 160ms ease; }
.act:hover { text-decoration: underline; }
.act:active { transform: scale(.96); }
.days { align-self: flex-end; color: var(--muted); font-size: 14px; font-weight: 600; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.ok, .pill.st-active { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad-text); }
.pill.st-test { background: var(--info-bg); color: var(--info); }
.pill.st-paused, .pill.st-archived { background: var(--off-bg); color: var(--off); }

/* ---------- панелі, таблиці ---------- */
.panel, .card { background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); margin: 14px 0; }
.panel h2 { font-size: 18px; margin-bottom: 8px; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; align-items: start; }
.rowline { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rowline:last-of-type { border-bottom: 0; }
.rowline b { font-weight: 800; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 14.5px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
td.profitcell { font-weight: 800; }
.tablewrap { overflow-x: auto; padding: 8px 14px; }

/* ---------- повідомлення, примітки ---------- */
.alert { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-sm); padding: 11px 14px; margin: 10px 0; font-size: 14px; font-weight: 600; }
.alert.err { background: var(--bad-bg); color: var(--bad-text); }
.alert.ok { background: var(--good-bg); color: var(--good); }
.alert ul { margin: 0; padding-left: 18px; }
.footnotes { margin-top: 32px; font-size: 13px; color: var(--muted); }
.footnotes p { margin: 0 0 6px; }
.footnotes ul { margin: 4px 0 0; padding-left: 18px; }
.foot-h { font-weight: 700; margin-top: 10px !important; }
.sync { margin-top: 14px; }
.sync-list { display: inline-flex; flex-wrap: wrap; gap: 2px 14px; margin-left: 4px; }
.stale { color: var(--bad-text); font-weight: 700; }

/* ---------- форми ---------- */
form.stack label, .fields label { display: block; margin: 12px 0 0; font-size: 14px; font-weight: 700; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: 500 16px var(--font); color: var(--ink);
  background: var(--field); border: 1px solid transparent; border-radius: var(--r-sm); transition: border-color 160ms ease, background-color 160ms ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hero); background: #fff; }
textarea { min-height: 96px; }
input:disabled, select:disabled, textarea:disabled { opacity: .65; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--hero); }
.btn { background: var(--off-bg); color: var(--ink); border: 0; border-radius: var(--r-sm); padding: 12px 18px; font: 700 15px var(--font);
  cursor: pointer; transition: transform 160ms var(--ease), background-color 160ms ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff; margin-top: 16px; }
.btn.primary:hover { background: #2A2E36; }
.btn.wide { width: 100%; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
details.card > summary { cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 6px; }
.inline3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.inline4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.inline3 input, .inline4 input, .inline4 select { margin-top: 0; }
.centerbox { max-width: 440px; margin: 24px auto; padding: 28px 22px; text-align: center; }
.widget { margin: 22px 0 6px; display: flex; justify-content: center; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
.calc-empty { text-align: left; }

/* ---------- ручні ліміти на картці ---------- */
.lim { display: inline-block; vertical-align: top; }
.lim > summary { display: inline-block; list-style: none; cursor: pointer; border-bottom: 1px dashed var(--muted);
  transition: color 160ms ease; }
.lim > summary::-webkit-details-marker { display: none; }
.lim > summary:hover, .lim[open] > summary { color: var(--ink); border-bottom-color: var(--ink); }
.manual { display: inline-block; font-size: 11px; font-weight: 700; color: var(--info); background: var(--info-bg);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.limform { display: block; width: min(244px, calc(100vw - 110px)); margin: 8px 0 4px; }
.limin { display: flex; gap: 6px; }
.limin input, .limin select { margin-top: 0; padding: 10px 12px; }
.limin input { flex: 1 1 auto; min-width: 0; }
.limin select { flex: 0 0 66px; width: 66px; padding-left: 8px; padding-right: 4px; }
.limbtns { display: flex; gap: 6px; margin-top: 8px; }
.limbtns .btn { flex: 1 1 0; margin-top: 0; padding: 10px 6px; font-size: 14px; }

/* ---------- витрати ---------- */
.hero-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.herochip { display: inline-block; background: #fff; border-radius: 999px; padding: 1px 11px; color: var(--ink); }
.herochip.pos { color: var(--good); }
.herochip.neg { color: var(--bad); }
.exp-hero { margin-top: 6px; }
.exp-hero .hero-num { margin-bottom: 20px; }
.exp-stats > div:last-child { grid-column: auto; }
.reclist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.rec.panel { margin: 0; }
.rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rec-head h3 { font-size: 18px; line-height: 1.25; }
.rec-sum { flex: none; font-size: 20px; font-weight: 800; white-space: nowrap; }
.rec-sum span { font-size: 13px; color: var(--muted); font-weight: 600; }
.rec-acts { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.recact > summary { list-style: none; cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; padding: 9px 0; }
.recact > summary::-webkit-details-marker { display: none; }
.recact[open] > summary { color: var(--ink); }
.recform { padding-bottom: 10px; }
.recform label { display: block; margin-top: 10px; font-size: 14px; font-weight: 700; }
.recform .btn.primary { width: 100%; margin-top: 14px; }
table.hist tr.is-ended td { color: var(--muted); }
table.hist td, table.hist th { padding: 10px 8px; }
.oneoff { align-items: center; }
.oneoff-r { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

/* ---------- 768+: верхнє меню, дві колонки ---------- */
@media (min-width: 768px) {
  .top-in { padding: 12px 24px 0; }
  .brand { flex: none; padding-bottom: 10px; }
  .topnav { display: flex; gap: 4px; flex: 1; padding-bottom: 10px; }
  .topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 15px; transition: background-color 160ms ease, color 160ms ease; }
  .topnav a:hover { text-decoration: none; color: var(--ink); background: var(--field); }
  .topnav a.on { color: var(--ink); background: var(--field); }
  .logout { padding-bottom: 10px; }
  .tabbar { display: none; }
  body.has-tabs { padding-bottom: 0; }
  .page { padding: 24px 24px 56px; }
  .ptitle { font-size: 30px; }
  .hero { padding: 28px 32px 26px; }
  .hero-num { font-size: 64px; margin: 18px 0 28px; }
  .hero-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-top: 20px; }
  .hero-stats > div:last-child { grid-column: auto; }
  .hero-stats dd { font-size: 21px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
  .pcard { padding: 24px; }
  .exp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reclist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .recform .btn.primary { width: auto; }
  .fields { grid-template-columns: 1fr 1fr; }
  .inline3 { grid-template-columns: 1.2fr 1fr 1fr; }
  .inline4 { grid-template-columns: 1fr 1.2fr 1.2fr .9fr; }
  .btn.wide { width: auto; }
  .centerbox { margin: 64px auto; padding: 36px 32px; }
}

/* ---------- 1024+: все в один ряд, 3 колонки ---------- */
@media (min-width: 1024px) {
  .top-in { flex-wrap: nowrap; padding-bottom: 0; align-items: center; }
  .top-in > * { padding-bottom: 0; }
  .brand, .topnav, .logout { padding-bottom: 0; }
  .periodbar { order: 2; width: auto; margin-left: auto; }
  .logout { order: 3; }
  .top-in { padding-top: 10px; padding-bottom: 10px; }
  .chips { padding: 0; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: 420px minmax(0, 1fr); }
  .pgrid .panel { margin-top: 0; }
  .calc { grid-template-columns: 440px minmax(0, 1fr); }
  .calc-form { margin-top: 0; }
  .calc-out > :first-child { margin-top: 0; }
  .pbig { font-size: 36px; }
}

@media (hover: hover) and (pointer: fine) {
  .pcard:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 16px 36px rgba(20, 24, 40, .1); }
}

@media (max-width: 380px) {
  .pstats dd { font-size: 16px; }
  .hero-num { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .pcard:hover, .chip:active, .btn:active, .act:active, .tabbar a:active { transform: none !important; }
}

/* ---------- смужка уваги на огляді ---------- */
.attstrip { display: block; margin: 4px 0 14px; padding: 14px 16px; background: var(--card); border-radius: var(--r-md); border-left: 4px solid var(--bad);
  color: var(--ink); box-shadow: var(--shadow); transition: transform 160ms var(--ease), box-shadow 200ms var(--ease); }
.attstrip:hover { text-decoration: none; }
.attstrip:active { transform: scale(.99); }
.attstrip-h { display: block; font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.attstrip ul { margin: 0; padding-left: 18px; font-size: 14px; }
.attstrip li { margin: 3px 0; }
.attstrip li.warn, .attstrip li.info { color: var(--ink); }
.attstrip-more { display: block; margin-top: 8px; color: var(--accent); font-weight: 700; font-size: 13.5px; }

/* ---------- сторінка «Рішення» ---------- */
.lead-note { margin: -8px 0 6px; }
.dcard { background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); margin: 14px 0; }
.dcard > h2 { font-size: 19px; margin-bottom: 4px; }
.dcard > p.small { margin: 2px 0 12px; }
.dcard .k { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dcard .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.dcard .big { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.chart-h { font-size: 15px; margin: 14px 0 4px; }
.delta { font-weight: 700; }

.attlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.att { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--field); }
.att.high { background: var(--bad-bg); }
.att.warn { background: var(--warn-bg); }
.att-pill { align-self: start; }
.att-pill.high { background: var(--bad); color: #fff; }
.att-pill.warn { background: var(--warn); color: #fff; }
.att-pill.info { background: var(--info-bg); color: var(--info); }
.att-text { font-size: 14.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.att-go { grid-column: 2; font-size: 13.5px; font-weight: 700; }
.calm { margin: 10px 0 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--good-bg); color: var(--good-strong); font-weight: 600; }
.calm-mark { display: inline-block; font-weight: 800; margin-right: 4px; }

.vgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 10px; }
.vcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.vhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vhead h3 { font-size: 18px; }
.vpill { flex: none; padding: 8px 18px; border-radius: 999px; font-size: 16px; font-weight: 800; white-space: nowrap; }
.vpill.good { background: var(--good-bg); color: var(--good-strong); }
.vpill.bad { background: var(--bad-bg); color: var(--bad-text); }
.vpill.warn { background: var(--warn-bg); color: var(--warn); }
.vpill.neutral { background: var(--off-bg); color: var(--ink); }
.reasons { margin: 0; padding-left: 18px; font-size: 14px; }
.reasons li { margin: 3px 0; }
.vstats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin: 0; }
.vstats dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.vstats dd { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.vstats dd.sub { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.vlink { font-weight: 700; font-size: 14px; margin-top: auto; }

.chartbox { margin-top: 6px; }
.bchart { display: block; width: 100%; height: auto; max-width: 560px; }
.bchart .axis { stroke: var(--line); stroke-width: 1; }
.bchart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.bchart .bar { fill: var(--hero); }
.bchart .bar.faded { fill: var(--hero); opacity: .38; }
.bchart .val { font: 700 11px var(--font); fill: var(--ink); }
.bchart .wk { font: 600 10px var(--font); fill: var(--muted); }
.tabview { margin-top: 4px; font-size: 13.5px; }
.tabview summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
.tabview .tablewrap { padding: 4px 0; }

.closegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.closegrid > div { background: var(--field); border-radius: var(--r-sm); padding: 12px 14px; }
.closegrid b { display: block; font-size: 22px; font-weight: 800; margin-top: 2px; }

.optable th, .optable td, .qtable th, .qtable td { padding: 10px 8px; }
.dcard .tablewrap { padding: 0; margin: 0 -4px; }
.optable tr.op-best td { background: var(--good-bg); }
.optable tr.op-worst td { background: var(--bad-bg); }
.sbar { display: flex; width: 120px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--field); gap: 2px; }
.sbar i { display: block; height: 100%; }
.sbar .s-trash { background: #6B7280; }
.sbar .s-rej { background: var(--bad); }
.sbar .s-ok { background: var(--good); }
.sbar .s-new { background: #9CA3AF; opacity: .5; }

.cashgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 10px; }
.cashtile { background: var(--field); border-radius: var(--r-md); padding: 16px; }
.cashlist { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; }
.cashlist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cashlist li:last-child { border-bottom: 0; }
.monthhead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 8px 0 14px; }
.monthhead .big { font-size: 38px; }
.monthcmp b { font-size: 20px; font-weight: 800; }
.monthlist { margin: 0 0 12px; }
.monthlist > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.monthlist > div:last-child { border-bottom: 0; }
.monthlist dt { color: var(--muted); font-weight: 600; }
.monthlist dd { margin: 0; font-weight: 800; white-space: nowrap; }

@media (min-width: 768px) {
  .dcard { padding: 24px; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cashgrid { grid-template-columns: 1fr 1fr; }
  .monthhead { grid-template-columns: 1fr 1fr; align-items: end; }
  .att { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .att-go { grid-column: auto; white-space: nowrap; }
}
@media (min-width: 1024px) {
  .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .tabbar { padding-left: 2px; padding-right: 2px; }
  .tabbar a { font-size: 10px; min-width: 0; letter-spacing: -.01em; }
}
@media (max-width: 480px) {
  .qtable th, .qtable td { padding: 10px 5px; font-size: 13.5px; }
  .sbar { width: 48px; }
  .optable th, .optable td { padding: 10px 6px; font-size: 13.5px; }
}

/* сторінка входу */
.centerbox form.stack { text-align: left; }
.centerbox form.stack .btn { display: block; width: 100%; margin-top: 16px; }
