@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #1c2433;
  --muted: #64748b;
  --line: #e7e5e4;
  --menu: #1eb3a8;
  --menu-hover: #168f87;
  --menu-soft: #d7f4f1;
  --brand: #3d5470;
  --card: rgba(255, 255, 255, 0.92);
  --shadow: 0 12px 40px rgba(31, 41, 51, 0.07);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  color: var(--ink);
  font: 16px/1.45 Manrope, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(820px 380px at 8% -8%, rgba(30, 179, 168, 0.14), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(78, 88, 100, 0.12), transparent 46%),
    linear-gradient(180deg, #f5f7f9 0%, #e8edf1 100%);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(78, 88, 100, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 88, 100, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
}

body > * { position: relative; z-index: 1; }

h1, h2, h3 { letter-spacing: -0.03em; }
h1 { margin: 0; font-size: 28px; font-weight: 800; }
h2 { margin: 22px 0 10px; font-size: 20px; font-weight: 800; }

a { color: inherit; }

button, input, select { font: inherit; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--menu), var(--menu-hover));
  color: white;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 143, 135, 0.25);
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0) scale(0.98); }

button.ghost {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.05);
}

input, select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--menu);
  box-shadow: 0 0 0 3px rgba(30, 179, 168, 0.2);
}

input[type="file"] {
  height: auto;
  min-height: 40px;
  padding: 8px 10px;
}

label { display: block; font-size: 13px; font-weight: 700; }

.app { display: flex; min-height: 100vh; align-items: stretch; }

.side {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 272px;
  flex: none;
  min-height: 100vh;
  overflow: hidden;
  color: #f5f5f4;
  background-color: #3a434d;
  background-image:
    radial-gradient(circle at 16% 10%, rgba(30, 179, 168, 0.32), transparent 38%),
    radial-gradient(circle at 90% 88%, rgba(255, 255, 255, 0.08), transparent 40%);
  box-shadow: 8px 0 32px rgba(31, 41, 51, 0.18);
}

.side::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 48px 48px;
}

.side > * { position: relative; z-index: 1; }

.side-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--menu), #7ee0d8, rgba(30, 179, 168, 0.3));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 20px 16px 12px;
  color: inherit;
  text-decoration: none;
}

.brand b, .top-titles b, .login-card h2 {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand small, .top-titles span {
  display: block;
  margin-top: 2px;
  color: inherit;
  opacity: 0.55;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.logo {
  flex: none;
  border-radius: 999px;
  background: #050533;
  object-fit: cover;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 20px; }

.side-nav a, .tabbar a {
  text-decoration: none;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
}

.item .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.item svg, .tab svg { width: 16px; height: 16px; }

.item:hover { background: rgba(255, 255, 255, 0.1); color: white; }

.item.on {
  background: var(--menu);
  color: white;
  box-shadow: 0 8px 18px rgba(30, 179, 168, 0.35);
}

.item.on .ico { background: rgba(255, 255, 255, 0.2); }

.maincol { flex: 1; min-width: 0; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 30px rgba(31, 41, 51, 0.04);
  backdrop-filter: blur(16px);
}

.top-titles b { font-size: 14px; }
.top-titles span { color: #a8a29e; opacity: 1; letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 500; }

.top-user { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.top-user form { margin: 0; }
.who { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }

.brand-mobile { display: none; padding: 0; }
.brand-mobile b { font-size: 14px; }
.brand-mobile small { color: #78716c; opacity: 1; letter-spacing: 0.12em; }

main { padding: 16px 16px 28px; max-width: 1180px; }

.toolbar, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.tool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 0;
}

.file, .filters label, .login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.file { font-size: 13px; font-weight: 700; }
.file input { width: min(100%, 280px); }
.filters label { min-width: min(100%, 220px); }
.filters select { min-width: min(100%, 220px); }

.banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(30, 179, 168, 0.28);
  border-radius: 16px;
  background: var(--menu-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  outline: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.card b { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }

.table-wrap {
  overflow-x: auto;
  margin: 0 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  outline: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--card);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; min-width: 640px; border-collapse: collapse; background: transparent; }

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(30, 179, 168, 0.06); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td button, td button.ghost { min-height: 36px; padding: 0 12px; }
table.stack { min-width: 0; }
table.stack td { overflow-wrap: anywhere; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0 16px; }
.error { margin: 0; color: #8e2f3c; font-size: 14px; font-weight: 700; }

.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 -8px 30px rgba(31, 41, 51, 0.1);
  backdrop-filter: blur(12px);
}

.tab {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 4px 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.tab span:last-child { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.tab.on { color: var(--menu-hover); }
.tab svg { width: 18px; height: 18px; }

.login-screen {
  display: grid;
  min-height: 100vh;
}

.login-hero {
  position: relative;
  display: none;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 36px 48px;
  color: white;
  background-color: #3a434d;
  background-image:
    radial-gradient(circle at 16% 10%, rgba(30, 179, 168, 0.32), transparent 38%),
    radial-gradient(circle at 90% 88%, rgba(255, 255, 255, 0.08), transparent 40%);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-hero > * { position: relative; z-index: 1; }
.login-hero .brand { padding: 0; }
.hero-copy { max-width: 520px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--menu-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.login-hero h1 { font-size: 48px; line-height: 1.05; font-weight: 800; }
.login-hero p { max-width: 420px; color: rgba(255, 255, 255, 0.65); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
}
.hero-foot { margin: 0; color: rgba(255, 255, 255, 0.35); font-size: 14px; }

.login-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.login-card {
  width: min(100%, 440px);
  margin: 0;
  padding: 28px 24px;
  border: 1px solid white;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 80px rgba(31, 41, 51, 0.12);
}

.login-card .brand { padding: 0 0 18px; color: var(--ink); }
.login-card h2 { margin: 12px 0 4px; font-size: 24px; }
.login-card .muted { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.login-card label { margin-top: 14px; }
.login-card button { width: 100%; margin-top: 18px; min-height: 44px; }

.mark { display: flex; align-items: center; gap: 8px; }
.mark i:first-child { width: 6px; height: 6px; border-radius: 999px; background: var(--menu); }
.mark i:last-child { width: 40px; height: 4px; border-radius: 999px; background: rgba(30, 179, 168, 0.7); }

.objects-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 22px 0 10px;
}

.objects-head h2 { margin: 0; }

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.gap-tabs { margin: 0 0 14px; }

.questions-table .q-date,
.questions-table .q-topic,
.questions-table .q-status { white-space: nowrap; width: 1%; }

.questions-table { width: 100%; }
.questions-table .q-text { width: 48%; min-width: 320px; }
.questions-table .q-reply { width: 34%; min-width: 280px; }
.questions-table .reply-form textarea { width: 100%; min-height: 90px; box-sizing: border-box; }
@media (max-width: 1023px) { .questions-table .q-text, .questions-table .q-reply { min-width: 0; width: auto; } }

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.05);
}

.seg-btn:hover { border-color: var(--menu); color: var(--menu-hover); }

.seg-btn.on {
  border-color: transparent;
  background: linear-gradient(180deg, var(--menu), var(--menu-hover));
  color: white;
  box-shadow: 0 8px 20px rgba(22, 143, 135, 0.25);
}

.seg-btn.on:hover { color: white; }

.seg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 179, 168, 0.35);
}

@media (min-width: 1024px) {
  .login-screen { grid-template-columns: 1.05fr 0.95fr; }
  .login-hero { display: flex; }
  .login-card { padding: 36px; }
  main { padding: 36px 36px 48px; }
  .top { padding: 14px 28px; }
}

@media (max-width: 1023px) {
  .side { display: none; }
  .brand-mobile { display: flex; }
  .top-titles { display: none; }
  .tabbar { display: flex; }
  main { padding-bottom: 108px; }
  .objects-head { align-items: stretch; }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 0; min-height: 48px; padding: 0 10px; }
  .toolbar, .tool, .filters { flex-direction: column; align-items: stretch; }
  .toolbar button, .tool button, .filters button, .file input, .filters select { width: 100%; }
  td button, td button.ghost { width: auto; }
  table.stack, table.stack tbody, table.stack tr { display: block; width: 100%; }
  table.stack td { display: block; }
  table.stack th { display: none; }
  table.stack td button, table.stack td button.ghost { width: 100%; margin-top: 8px; }
  table.stack td .z-row-acts button,
  table.stack td .z-row-acts button.ghost,
  table.stack td .z-row-acts a.ghost {
    width: auto !important; margin-top: 0 !important;
  }
  .top { padding-top: max(14px, env(safe-area-inset-top)); }
  .tab { font-size: 9px; padding: 4px 1px; }
}

.card small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.chart-card {
  margin: 8px 0 16px;
  padding: 12px 12px 4px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.chart-card svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.legend i { width: 10px; height: 10px; border-radius: 999px; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--menu-soft);
  color: var(--menu-hover);
  font-size: 11px;
  font-weight: 800;
}
.bar { height: 8px; border-radius: 999px; background: #e7e5e4; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--menu); }
.hints { margin: 0 0 12px; padding-left: 18px; }
.hints li { margin: 6px 0; }
.ref { color: var(--brand); font-weight: 700; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--menu-hover); }
td select.mini { width: 100%; min-width: 148px; height: 36px; }
td form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; }
.sort-mobile { display: contents; }

@media (max-width: 1023px) {
  .tab { font-size: 9px; gap: 2px; padding: 4px 1px; }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

@media (min-width: 1024px) {
  .sort-mobile { display: none; }
}

tr.ops-open { cursor: pointer; }
tr.ops-open:focus-visible td { box-shadow: inset 0 0 0 2px var(--menu); }

.ops-back {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(31, 41, 51, 0.46);
}

.ops-back.show { display: flex; }

.ops-card {
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: min(92vh, 920px);
  padding: 18px 18px 12px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 41, 51, 0.28);
}

.ops-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ops-head h3 { margin: 0 0 4px; font-size: 20px; overflow-wrap: anywhere; }
.ops-head .muted { margin: 0; }
.ops-close { min-height: 44px; }
.ops-seg { margin: 14px 0; }
.ops-filters { margin-bottom: 8px; }
.ops-filters input { width: 100%; min-height: 44px; }
.ops-totals { margin: 0 0 10px; font-weight: 700; }
.ops-body { overflow: auto; min-height: 0; }
.ops-empty { margin: 12px 4px 20px; color: var(--muted); font-weight: 700; }
.ops-card table { min-width: 0; }
.ops-table td:first-child,
.ops-table td.num { white-space: nowrap; }
td.num.in { color: #2e7d4f; }
td.num.out { color: #8e2f3c; }
body.ops-lock { overflow: hidden; }

@media (max-width: 1023px) {
  .ops-back { padding: 0; }
  .ops-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 16px 14px max(12px, env(safe-area-inset-bottom));
  }
  .ops-head { align-items: stretch; flex-direction: column; }
  .ops-close { width: 100%; }
  .ops-seg .seg-btn { flex: 1 1 0; }
}

.sum-wrap { margin: 0 0 8px; }
.sum-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sum-card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.sum-card h3 { margin: 14px 0 8px; font-size: 16px; }
.sum-card h3:first-child { margin-top: 0; }
.sum-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sum-hero {
  margin: 4px 0 8px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.sum-lines { list-style: none; margin: 0 0 10px; padding: 0; }
.sum-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}
.sum-lines b, .sum-figures b, .sum-party b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-note, .sum-dates, .sum-transfers, .sum-range { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.sum-flow .seg, .sum-custom { margin-top: 10px; }
.sum-custom { display: flex; flex-wrap: wrap; gap: 10px; }
.sum-custom[hidden] { display: none; }
.sum-custom label { flex: 1 1 140px; }
.sum-figures { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.sum-figures span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.sum-figures b { display: block; margin-top: 2px; font-size: clamp(20px, 3vw, 28px); }
.sum-figures b.in, .sum-lines b.in { color: #2e7d4f; }
.sum-figures b.out, td.num.out { color: #8e2f3c; }
.sum-party {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  box-shadow: none;
}
.sum-party span { min-width: 0; overflow-wrap: anywhere; }
.sum-party:hover { border-color: var(--menu); color: var(--menu-hover); transform: none; }
.sum-legend { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.sum-legend i { width: 12px; height: 12px; border-radius: 4px; }
.sum-legend i.in { background: #2e7d4f; }
.sum-legend i.out { margin-left: 8px; background: #8e2f3c; }
.sum-chart { display: block; width: 100%; height: auto; }
.sum-warn {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.sum-warn[hidden] { display: none; }

@media (max-width: 1023px) {
  .sum-wrap, .sum-grid, .sum-card { min-width: 0; max-width: 100%; }
  .sum-flow .seg-btn {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 0;
    padding: 0 8px;
  }
  .sum-party {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    white-space: normal;
  }
  .sum-party span {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sum-party b { font-size: 15px; }
}

@media (min-width: 720px) {
  .sum-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .sum-grid { grid-template-columns: 1.15fr 0.85fr; }
  .sum-cash, .sum-flow { grid-column: 1 / -1; }
}

.brand small { letter-spacing: 0.01em; text-transform: none; font-size: 12px; white-space: normal; opacity: 0.72; }
.top-logo { display: flex; padding: 0; }
.top-logo .logo { width: 36px; height: 36px; }
@media (max-width: 1023px) { .top-logo { display: none; } }
.top { flex-wrap: wrap; align-items: flex-start; }
.top-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; }
.top-title b { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.book-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.book-pill svg { width: 16px; height: 16px; flex: none; }
.book-pill span { color: var(--ink); font-weight: 800; }
.top-user { flex-wrap: wrap; justify-content: flex-end; }
.head-form { margin: 0; }
button.who {
  background: transparent;
  color: var(--ink);
  border: 0;
  box-shadow: none;
  padding: 0 2px;
  min-height: 36px;
}
button.who:hover { transform: none; color: var(--menu-hover); }
.cash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-width: 0; }
.cash-total { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; }
.cash-total span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cash-total b { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.cash-total small { color: var(--muted); font-size: 12px; font-weight: 650; }
.cash-bits { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cash-bits span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.cash-bits b { font-size: 15px; font-weight: 800; }
.cash-more {
  display: none;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--menu-hover);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}
.cash-more:hover { transform: none; }
dialog.profile {
  width: min(520px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.profile::backdrop { background: rgba(28, 36, 51, 0.45); }
.profile-sheet { display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 100%; }
.profile-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--menu), var(--menu-hover));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.profile-who { min-width: 0; flex: 1; }
.profile-who h2, .profile-section h3 { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.profile-who h2 { font-size: 22px; }
.profile-who p { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.profile-id > .ghost { flex: none; width: auto; white-space: normal; }
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.profile-section h3 { font-size: 16px; }
.profile-section label { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.profile-section input, .profile-section select { width: 100%; max-width: 100%; min-width: 0; }
.profile-result { margin: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-weight: 700; }
.profile-result:empty { display: none; }
.profile-result.is-ok { color: #2e7d4f; }
.profile-result.is-error { color: #8e2f3c; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.profile-actions button { flex: 1 1 140px; min-width: 0; white-space: normal; }
.user-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.user-card header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; font-weight: 800; }
.user-card header b, .user-card header span, .user-card p { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.user-card p { margin: 0; color: var(--muted); font-weight: 650; }
.staff-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; }
.staff-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.staff-card header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.staff-card .avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 16px; }
.staff-id { min-width: 0; flex: 1; }
.staff-id b, .staff-id span, .staff-card p { display: block; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.staff-id b { font-size: 16px; }
.staff-id span, .staff-card p { color: var(--muted); font-size: 13px; font-weight: 650; }
.staff-card p { margin: 0; }
.staff-card h3 { margin: 0; font-size: 16px; }
.staff-card label { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.staff-card input, .staff-card select { width: 100%; max-width: 100%; min-width: 0; }
@media (min-width: 900px) {
  .staff-list { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 1023px) {
  .top-user { width: 100%; justify-content: flex-start; }
  .head-form button, button.who { width: auto; }
  .cash-total b { font-size: 22px; }
  .cash-more { display: inline-flex; }
  .cash-bits { display: none; flex-direction: column; width: 100%; }
  .cash-head.is-open .cash-bits { display: flex; }
  .top-title b { font-size: 16px; }
}

dialog.upload {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.upload::backdrop { background: rgba(28, 36, 51, 0.45); }
dialog.upload form { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; }
dialog.upload h2 { margin: 0; font-size: 22px; white-space: normal; overflow-wrap: anywhere; }
.upload-hint { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 128px;
  margin: 0;
  padding: 18px 16px;
  border: 1.5px dashed var(--menu);
  border-radius: 18px;
  background: var(--menu-soft);
  text-align: center;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.drop span, .drop b { display: block; max-width: 100%; font-weight: 650; color: var(--muted); }
.drop b { margin-top: 4px; color: var(--menu-hover); font-size: 13px; letter-spacing: 0.01em; }
.drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop.is-drag { background: #fff; border-style: solid; }
.upload-file { margin: 0; min-width: 0; font-weight: 800; overflow-wrap: anywhere; white-space: normal; }
.upload-file.is-empty { color: var(--muted); font-weight: 650; }
.upload-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upload-progress[hidden] { display: none; }
.upload-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--menu), var(--menu-hover));
}
.upload-state { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; white-space: normal; }
.upload-result { margin: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.upload-result:empty { display: none; }
.upload-result.is-ok { color: #2e7d4f; font-weight: 800; }
.upload-result.is-error { color: #8e2f3c; font-weight: 700; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-actions button { flex: 1 1 140px; min-width: 0; white-space: normal; }
dialog.upload button:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
button.upload-open { white-space: normal; }
.upload-cards { display: grid; gap: 16px; margin: 8px 0 16px; }
.upload-card {
  min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  outline: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--card);
  box-shadow: var(--shadow);
}
.upload-card h3 { margin: 0 0 8px; font-size: 18px; white-space: normal; overflow-wrap: anywhere; }
.upload-card p { margin: 0 0 8px; white-space: normal; overflow-wrap: anywhere; }
.upload-card .toolbar { margin: 8px 0; }
.upload-card .book-pill { margin: 0 0 8px; max-width: 100%; }
.upload-card .head-form { display: inline-block; margin: 0 0 8px; }
.acts-summary { margin: 0 0 8px; font-weight: 800; white-space: normal; }
.acts-missing { margin: 0 0 12px; white-space: normal; overflow-wrap: anywhere; }
.acts-status.is-found { color: #2e7d4f; font-weight: 800; }
.acts-status.is-missing, .acts-status.is-error { color: #8e2f3c; font-weight: 800; }
.acts-status.is-scan { color: #64748b; font-weight: 800; }
#acts-out { min-width: 0; }
#acts-out .num { white-space: normal; }
tr.act-open { cursor: pointer; }
tr.act-open:hover td { background: rgba(30, 179, 168, 0.06); }
dialog.act-detail {
  width: min(1480px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.act-detail::backdrop { background: rgba(28, 36, 51, 0.45); }
.detail-sheet { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.detail-head h2 { margin: 0; font-size: 22px; white-space: normal; overflow-wrap: anywhere; }
#detail-sub, #detail-totals { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.detail-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-filter {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  white-space: normal;
}
.detail-filter.on {
  background: linear-gradient(180deg, var(--menu), var(--menu-hover));
  color: #fff;
  border-color: transparent;
}
.acts-pair.is-match { color: #2e7d4f; font-weight: 800; }
.acts-pair.is-act, .acts-pair.is-book { color: #9a3412; font-weight: 800; }
.acts-pair.is-amount { color: #8e2f3c; font-weight: 800; }
.detail-table { min-width: 0; }
.detail-table .table-wrap { margin: 0; }
.nowrap { white-space: nowrap; }
@media (min-width: 1024px) {
  #acts-out table { min-width: 1180px; }
  #acts-out td, #acts-out th { overflow-wrap: normal; word-break: normal; }
  .detail-table table { width: 100%; min-width: 0; table-layout: fixed; }
  .detail-table th { white-space: normal; letter-spacing: 0.03em; }
  .detail-table th, .detail-table td {
    padding: 8px 6px;
    font-size: 12px;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .detail-table th:nth-child(1), .detail-table td:nth-child(1) { width: 11%; }
  .detail-table th:nth-child(3), .detail-table td:nth-child(3) { width: 13%; }
  .detail-table th:nth-child(8), .detail-table td:nth-child(8),
  .detail-table th:nth-child(9), .detail-table td:nth-child(9) { width: 12%; }
  .detail-table th:nth-child(11), .detail-table td:nth-child(11) { width: 10%; }
}
@media (max-width: 1023px) {
  .upload-card .head-form, .upload-card .head-form button { width: 100%; white-space: normal; }
}
@media (max-width: 640px) {
  dialog.upload {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
    padding: 16px;
    border-radius: 18px;
  }
  .upload-actions { flex-direction: column; align-items: stretch; }
  .upload-actions button { width: 100%; flex: none; }
  dialog.profile {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }
  .profile-id { flex-wrap: wrap; }
  .profile-actions { flex-direction: column; align-items: stretch; }
  .profile-actions button { width: 100%; flex: none; }
}

@media (max-width: 1023px) {
  dialog.act-detail {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  }
  .detail-head, .detail-filters, .detail-sheet .upload-actions { flex-direction: column; align-items: stretch; }
  .detail-filter, .detail-sheet .upload-actions button { width: 100%; }
  .tabbar { flex-wrap: wrap; row-gap: 4px; }
  .tab { flex: 1 1 22%; max-width: 25%; font-size: 11px; line-height: 1.15; padding: 4px 3px; }
  .tab span:last-child { overflow-wrap: normal; word-break: keep-all; }
  main { padding-bottom: 176px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button { transition: none; }
  .upload-bar span { transition: none; }
}

.acct-cards { display: none; }
.fold-toggle { display: none; }

@media (max-width: 768px) {
  .page-bank { overflow-x: clip; }
  .page-bank .side { display: none; }
  .page-bank .tabbar { display: flex; }
  .page-bank .maincol { flex: 1 1 auto; width: auto; max-width: none; min-width: 0; }
  .page-bank .top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: none;
  }
  .page-bank .top-logo { display: none; }
  .page-bank .brand-mobile { display: flex; padding: 0; }
  .page-bank main, .page-bank .top-main, .page-bank .top-user, .page-bank .cash-head, .page-bank .cash-total {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }
  .page-bank .cash-more { display: none; }
  .page-bank .cash-total b { font-size: 32px; line-height: 1.05; white-space: nowrap; }
  .page-bank .cash-total span { font-size: 13px; }
  .page-bank .cash-bits {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .page-bank .cash-bits div { display: flex; justify-content: space-between; gap: 12px; }
  .page-bank .cash-bits b { font-size: 18px; }
  .page-bank .acct-cards { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 100%; }
  .page-bank .table-wrap:has(table.bank-accounts),
  .page-bank table.bank-accounts { display: none; }
  .page-bank .sum-grid, .page-bank .sum-figures { grid-template-columns: 1fr; }
  .page-bank table.review-table {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .page-bank table.review-table thead { display: none; }
  .page-bank table.review-table tbody,
  .page-bank table.review-table tr { display: block; width: 100%; }
  .page-bank table.review-table tr {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }
  .page-bank table.review-table td {
    display: block;
    width: auto;
    padding: 4px 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .page-bank table.review-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .page-bank .fold-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    color: var(--menu-hover);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }
  .page-bank .fold-toggle input { width: 18px; height: 18px; }
  .page-bank .fold-less { display: none; }
  .page-bank .fold:has(input:checked) .fold-more { display: none; }
  .page-bank .fold:has(input:checked) .fold-less { display: inline; }
  .page-bank .fold > .sum-note,
  .page-bank .fold > .muted {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .page-bank .fold:has(input:checked) > .sum-note,
  .page-bank .fold:has(input:checked) > .muted {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

.op-account { margin: 0 0 12px; font-weight: 750; overflow-wrap: anywhere; }
.op-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 28px; }
.op-line {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr) auto;
  grid-template-areas: "date party sum" "purpose purpose purpose";
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.op-date { grid-area: date; font-weight: 750; font-variant-numeric: tabular-nums; }
.op-party { grid-area: party; font-weight: 750; overflow-wrap: anywhere; }
.op-sum { grid-area: sum; text-align: right; white-space: nowrap; font-size: 16px; }
.op-sum.in { color: #2e7d4f; }
.op-sum.out { color: #8e2f3c; }
.op-purpose { grid-area: purpose; color: var(--muted); font-size: 13px; line-height: 1.35; }
.op-detail { margin: 8px 0 28px; }
.op-detail dt { margin-top: 12px; color: #64748b; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.op-detail dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.op-detail dd.num { font-size: 22px; font-weight: 800; }
.op-detail dd.num.in { color: #2e7d4f; }
.op-detail dd.num.out { color: #8e2f3c; }
.op-detail dd.op-full { font-weight: 650; line-height: 1.4; }
.op-status { font-size: 18px; }
.ops-flow { margin: 0 0 12px; }
@media (max-width: 768px) {
  .page-bank .op-line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "date sum" "party party" "purpose purpose";
  }
  .page-bank .ops-flow { width: 100%; }
  .page-bank .ops-flow .seg-btn { flex: 1 1 0; padding: 0 8px; }
}

.page-bank a.acct-card,
.page-bank button.acct-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  box-shadow: var(--shadow);
}
.page-bank a.acct-card:hover,
.page-bank button.acct-card:hover { transform: none; border-color: var(--menu); }
.page-bank article.acct-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.acct-bank { font-size: 16px; font-weight: 800; }
.acct-org, .acct-date { color: var(--muted); font-size: 13px; font-weight: 700; }
.acct-num { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.acct-bal { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }

/* Суммы поступлений/списаний: мягкий зелёный / бордовый (только сумма, не строка) */
td.num.in, td.num.out, .op-sum.in, .op-sum.out, dd.num.in, dd.num.out { font-weight: 600; }
td.num.in > *, td.num.out > * { color: inherit; }
td.num.in { color: #2e7d4f; background: rgba(46, 125, 79, 0.07); }
td.num.out { color: #8e2f3c; background: rgba(142, 47, 60, 0.07); }
.sum-top-in .sum-party b { color: #2e7d4f; }
.sum-top-out .sum-party b { color: #8e2f3c; }

/* Дашборд: весь контент main на всю ширину рядом с сайдбаром */
.page-dash main { max-width: none; }
.page-dash main > * { max-width: none; width: 100%; box-sizing: border-box; }

.saldo-sum.in { color: #2e7d4f; }
.saldo-sum.out { color: #8e2f3c; }

/* Ответы Максима на вопросы ассистента и комментарии к сальдо */
.reply-form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.reply-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid #c9c2b4; border-radius: 6px; resize: vertical; }
.reply-form .btn { align-self: flex-start; padding: 6px 14px; border-radius: 6px; border: 1px solid #2e5b8e; background: #2e5b8e; color: #fff; cursor: pointer; font: inherit; }
.reply-label { font-size: 12px; color: #6b6458; }
.q-who { font-size: 12px; }
.q-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: #e6eef7; color: #2e5b8e; }
.q-badge.q-answered { background: #fff3c4; color: #7a5b00; }
.q-badge.q-closed { background: #e4f1e8; color: #2e7d4f; }
@media (max-width: 760px) { .reply-form { min-width: 0; width: 100%; } .reply-form .btn { align-self: stretch; padding: 10px; } }

/* full-width Дыры / Сальдо / Вопросы (desktop only) */
@media (min-width: 1024px) {
  main:has(.gaps-head) { max-width: none; padding-left: 20px; padding-right: 20px; }
  .saldo-table { width: 100%; }
  .saldo-table .s-reason { min-width: 280px; }
  .saldo-table .q-reply { min-width: 300px; width: 28%; }
  .saldo-table .reply-form textarea { width: 100%; box-sizing: border-box; }
}

.inv-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inv-filter input[type=search] { min-width: 240px; flex: 1 1 240px; }
.inv-filter input[name=min], .inv-filter input[name=max] { width: 110px; }
.inv-filter select { max-width: 260px; }
@media (min-width: 1024px) {
  main:has(.invoices-table) { max-width: none; padding-left: 20px; padding-right: 20px; }
  .invoices-table { width: 100%; }
  .invoices-table .inv-payee { min-width: 220px; }
}

/* Сотрудники: список + модальное окно */
main:has(.staff-table) { max-width: none; padding-left: 20px; padding-right: 20px; }
.staff-toolbar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.staff-table { width: 100%; }
.staff-row-id { display: flex; align-items: center; gap: 10px; }
.staff-row-id .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; flex: none; }
.staff-actions { white-space: nowrap; text-align: right; width: 1%; }
.staff-lock { font-size: 12px; }
.btn-sm { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; margin-left: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-sm:hover { border-color: var(--menu); }
.btn-sm.primary { background: var(--menu); border-color: var(--menu); color: #fff; }
.btn-sm.danger { color: #b42318; border-color: #f1c0bb; }
.btn-sm.danger:hover { background: #fdecea; }
.staff-dialog { border: none; border-radius: 16px; padding: 20px; width: min(440px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.staff-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.staff-dialog h3 { margin: 0 0 12px; }
.staff-dialog label { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-weight: 650; font-size: 13px; }
.staff-dialog input, .staff-dialog select { width: 100%; box-sizing: border-box; min-height: 40px; }
.staff-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.staff-dialog .new-only { display: none; }
.staff-dialog.is-new .new-only { display: flex; }
.staff-dialog.is-new .edit-only { display: none; }
@media (max-width: 1023px) {
  main:has(.staff-table) { padding-left: 12px; padding-right: 12px; }
  .staff-actions { text-align: left; width: auto; }
  .staff-actions .btn-sm:first-child { margin-left: 0; }
}

/* inv filters v2 */
.inv-filter { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:10px 0; padding:10px 12px; background:var(--card); border:1px solid var(--line); border-radius:14px; }
.inv-filter > *, .inv-filter input, .inv-filter select, .inv-filter button { height:40px; min-height:40px; box-sizing:border-box; margin:0; }
.inv-filter input, .inv-filter select { padding:0 10px; }
.inv-filter .inv-q { flex:1 1 220px; min-width:200px; }
.inv-filter .inv-pair { display:flex; align-items:center; gap:6px; flex:0 0 auto; padding:0 4px 0 10px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.inv-filter .inv-pair span { color:var(--muted); font-size:13px; white-space:nowrap; }
.inv-filter .inv-pair input { border:0; height:38px; min-height:38px; background:transparent; box-shadow:none; padding:0 4px; }
.inv-filter .inv-pair input[type=date] { width:135px; }
.inv-filter .inv-pair input[name=min], .inv-filter .inv-pair input[name=max] { width:90px; }
.inv-filter label.inv-exact { display:inline-flex !important; flex-direction:row; align-items:center; gap:6px; min-width:0; margin:0; font-size:14px; white-space:nowrap; color:var(--ink); font-weight:500; }
.inv-filter label.inv-exact input { width:16px; height:16px; min-height:16px; padding:0; accent-color:var(--menu); }
.inv-filter select { min-width:0; max-width:240px; width:auto; }
.inv-filter button { padding:0 16px; width:auto; }
@media (max-width:720px){ .inv-filter > * { flex:1 1 100%; } .inv-filter .inv-pair input { flex:1; width:auto !important; min-width:0; } .inv-filter select { max-width:none; } .inv-filter label.inv-exact { flex:0 0 auto; } }

/* invoices modal */
.invoices-table tr.inv-row { cursor:pointer; }
.invoices-table tr.inv-row:hover td { background:var(--menu-soft); }
.inv-dialog { width:min(560px, calc(100vw - 24px)); }
.inv-dialog h3 { overflow-wrap:anywhere; }
.inv-dl { display:grid; grid-template-columns:minmax(120px, 38%) 1fr; gap:6px 14px; margin:0; max-height:65vh; overflow:auto; }
.inv-dl dt { color:var(--muted); font-size:13px; font-weight:600; }
.inv-dl dd { margin:0; overflow-wrap:anywhere; }
@media (max-width:520px){ .inv-dl { grid-template-columns:1fr; } .inv-dl dd { margin-bottom:6px; } }

/* closing docs */
.invoices-table tr.inv-closed td { background:#ecf8f1; }
.invoices-table tr.inv-closed:hover td { background:#dcf2e6; }
.invoices-table tr.inv-closed td:first-child { box-shadow:inset 3px 0 0 #34b37a; }
.inv-legend { display:flex; align-items:center; gap:8px; margin:4px 0 8px; color:var(--muted); font-size:13px; }
.inv-swatch { width:14px; height:14px; border-radius:4px; background:#ecf8f1; border:1px solid #34b37a; display:inline-block; }

/* invoice docs */
.inv-docs { margin-top:14px; border-top:1px solid var(--line); padding-top:10px; }
.inv-docs h4 { margin:0 0 8px; font-size:14px; }
.inv-doc { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:6px 0; border-bottom:1px dashed var(--line); }
.inv-doc-name { flex:1 1 200px; overflow-wrap:anywhere; font-weight:600; font-size:14px; }
.inv-doc-meta { font-size:12px; }
.inv-doc a.btn-sm, .inv-docs a.btn-sm { text-decoration:none; display:inline-flex; align-items:center; }
.inv-possible { display:block; font-size:13px; padding:2px 0; overflow-wrap:anywhere; }
.inv-dialog .inv-dl { max-height:45vh; }
.invoices-table tr.inv-hasdoc td:last-child::after { content:" 📄"; }
.inv-dl:focus { outline:none; }

.inv-more { display:block; margin:12px auto; }
.inv-hint { margin-top:-4px; font-size:13px; }
.invoices-table td.money { text-align:right; white-space:nowrap; }
.inv-more[hidden], .inv-hint[hidden] { display:none !important; }
.invoices-table td.inv-date { white-space:nowrap; }

/* modal v2 */
.inv-dialog { width:min(900px, 95vw); max-height:94vh; overflow:auto; scrollbar-width:thin; padding:18px 22px; }
.inv-dialog h3 { margin:0 0 10px; font-size:18px; }
.inv-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 24px; }
.inv-f { display:grid; grid-template-columns:150px 1fr; gap:8px; align-items:baseline; padding:3px 0; border-bottom:1px solid var(--line); min-width:0; }
.inv-f.wide { grid-column:1 / -1; }
.inv-k { color:var(--muted); font-size:12px; font-weight:600; }
.inv-v { font-size:14px; overflow-wrap:anywhere; white-space:normal; }
.inv-f.empty .inv-v { color:var(--muted); }
.inv-foot { grid-column:1 / -1; color:var(--muted); font-size:12px; margin-top:4px; }
.inv-docs { margin-top:10px; padding-top:8px; }
.inv-doc { flex-wrap:nowrap; gap:10px; }
.inv-doc-name { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inv-doc-meta { white-space:nowrap; }
.inv-dialog .dialog-actions { margin-top:10px; }
@media (max-width:700px){ .inv-grid { grid-template-columns:1fr; } .inv-f { grid-template-columns:120px 1fr; } .inv-doc { flex-wrap:wrap; } .inv-doc-name { white-space:normal; flex-basis:100%; } }

/* mobile menu (<=700px): tabbar -> dropdown from header */
.menu-toggle { display:none; }
@media (max-width: 700px) {
  .top { position: sticky; padding-right: 64px; }
  .menu-toggle { display:inline-flex; align-items:center; justify-content:center; position:absolute; top:max(12px, env(safe-area-inset-top)); right:12px;
    width:42px; height:42px; min-height:42px; padding:0; border-radius:12px; font-size:22px; line-height:1;
    background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:0 2px 8px rgba(31,41,51,.08); z-index:41; }
  .menu-toggle:hover { transform:none; }
  .app .tabbar, .page-bank .tabbar { display:none !important; }
  .app.menu-open .tabbar { display:flex !important; flex-direction:column; flex-wrap:nowrap; position:fixed; top:64px; bottom:auto; left:auto; right:12px;
    width:min(280px, calc(100vw - 24px)); max-height:calc(100vh - 80px); overflow:auto; padding:6px; row-gap:2px;
    border:1px solid var(--line); border-radius:14px; box-shadow:0 16px 40px rgba(31,41,51,.18); background:#fff; z-index:40; }
  .app.menu-open .tabbar .tab { flex:0 0 auto; flex-direction:row; justify-content:flex-start; gap:10px; padding:10px 12px; border-radius:10px; font-size:15px; min-height:0; }
  .app.menu-open .tabbar .tab span, .app.menu-open .tabbar .tab small { text-align:left; }
  main, .page-bank main { padding-bottom: 24px !important; }
}
@media (max-width:700px){ .app.menu-open .tabbar .tab, .app.menu-open .tabbar .tab * { white-space:nowrap; max-width:none; width:auto; } }

/* invoices improvements */
.invoices-table tr.inv-old td { background:#fdf0ee; }
.invoices-table tr.inv-old:hover td { background:#fbe1dd; }
.invoices-table tr.inv-old td:first-child { box-shadow:inset 3px 0 0 #e0705f; }
.inv-swatch.old { background:#fdf0ee; border-color:#e0705f; margin-left:12px; }
.inv-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:4px 0 10px; }
.inv-chips #inv-saved { display:contents; }
.inv-chip { height:32px; min-height:32px; padding:0 12px; border-radius:999px; font-size:13px; background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:none; }
.inv-chip:hover { background:var(--menu-soft); transform:none; }
.inv-chip.xlsx { margin-left:auto; background:linear-gradient(180deg, var(--menu), var(--menu-hover)); color:#fff; border:0; }
.inv-chip.saved { display:inline-flex; align-items:center; padding:0; overflow:hidden; }
.inv-chip.saved button { background:none; border:0; box-shadow:none; color:var(--ink); height:30px; min-height:30px; padding:0 8px 0 12px; font-size:13px; }
.inv-chip.saved button.x { padding:0 10px 0 4px; color:var(--muted); }
.inv-totals { display:flex; flex-wrap:wrap; gap:10px; margin:6px 0; }
.inv-tot { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:8px 14px; display:flex; flex-direction:column; min-width:140px; }
.inv-tot span { color:var(--muted); font-size:12px; font-weight:600; }
.inv-tot b { font-size:18px; }
.inv-tot.warn b { color:#c2410c; }
.inv-break { margin:6px 0 10px; }
.inv-break summary { cursor:pointer; color:var(--brand); font-weight:600; font-size:14px; }
.inv-break-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:8px; }
.inv-mini { width:100%; font-size:13px; border-collapse:collapse; }
.inv-mini td, .inv-mini th { padding:4px 8px; border-bottom:1px solid var(--line); text-align:left; }
.inv-mini td.money { text-align:right; white-space:nowrap; }
.inv-mini tbody tr:hover td { background:var(--menu-soft); }
@media (max-width:700px) {
  .inv-break-grid { grid-template-columns:1fr; }
  .inv-chip.xlsx { margin-left:0; }
  .invoices-table thead { display:none; }
  .invoices-table, .invoices-table tbody { display:block; width:100%; }
  .invoices-table tr.inv-row { display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:10px 12px; margin:0 0 8px; border:1px solid var(--line); border-radius:12px; background:#fff; }
  .invoices-table tr.inv-row td { display:none; padding:0; border:0; background:transparent !important; box-shadow:none !important; }
  .invoices-table tr.inv-row td::before { content:none !important; }
  .invoices-table tr.inv-row td.inv-date { display:block; grid-column:1; color:var(--muted); font-size:12px; }
  .invoices-table tr.inv-row td.money { display:block; grid-column:2; grid-row:1 / span 2; align-self:center; font-weight:700; font-size:15px; }
  .invoices-table tr.inv-row td.inv-payee { display:block; grid-column:1; font-weight:600; min-width:0; font-size:15px; }
  .invoices-table tr.inv-closed { background:#ecf8f1 !important; border-left:3px solid #34b37a !important; }
  .invoices-table tr.inv-old { background:#fdf0ee !important; border-left:3px solid #e0705f !important; }
}
.inv-break-grid table { width:100%; font-size:13px; border-collapse:collapse; }
.inv-break-grid td, .inv-break-grid th { padding:4px 8px; border-bottom:1px solid var(--line); text-align:left; }
.inv-break-grid td.money { text-align:right; white-space:nowrap; }
.inv-break-grid tbody tr:hover td { background:var(--menu-soft); }
.inv-break-grid > * { min-width:0; }
@media (max-width:700px){
  .inv-wrap { overflow:visible !important; border:0 !important; box-shadow:none !important; background:transparent !important; }
  .inv-wrap .invoices-table { min-width:0 !important; width:100% !important; }
  .invoices-table tr.inv-row td.inv-payee { min-width:0 !important; }
  .invoices-table tr.inv-row { box-sizing:border-box; width:100%; }
  .inv-legend { flex-wrap:wrap; }
}
@media (max-width:700px){
  .page-invoices main { min-width:0; overflow-x:hidden; }
  .inv-filter { min-width:0; }
  .inv-filter .inv-pair { min-width:0; max-width:100%; box-sizing:border-box; }
  .inv-filter .inv-pair input[type=date] { width:auto !important; flex:1 1 0; min-width:0; }
  .inv-wrap { max-width:100%; }
}

/* saldo summary + object card */
.sal-summary { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:10px 0; }
.sal-col { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; min-width:0; }
.sal-col h3 { margin:0 0 8px; font-size:15px; display:flex; justify-content:space-between; gap:8px; }
.sal-col.in h3 b { color:#15803d; } .sal-col.out h3 b { color:#c2410c; }
.sal-col table { width:100%; font-size:13px; border-collapse:collapse; }
.sal-col td, .sal-col th { padding:4px 6px; border-bottom:1px solid var(--line); text-align:left; }
.sal-col td.money { text-align:right; white-space:nowrap; }
.sal-zero { font-size:13px; }
.obj-title { margin:4px 0; }
.obj-chart { width:100%; max-width:900px; height:200px; display:block; margin:6px 0 10px; }
.obj-chart .bar { fill:var(--menu); } .obj-chart g:hover .bar { fill:var(--menu-hover); }
.obj-chart text { font-size:10px; fill:var(--muted); }
a.obj-btn { display:inline-flex; align-items:center; text-decoration:none; height:34px; }
a.obj-link { color:inherit; font-weight:600; text-decoration:none; border-bottom:1px dashed var(--muted); }
a.obj-link:hover { color:var(--menu-hover); }
@media (max-width:700px){ .sal-summary { grid-template-columns:1fr; } }

.obj-chart { display:flex; align-items:flex-end; gap:10px; height:auto; min-height:200px; overflow-x:auto; padding:6px 0; }
.ob-col { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; min-width:64px; }
.ob-bar { width:36px; background:linear-gradient(180deg, var(--menu), var(--menu-hover)); border-radius:6px 6px 2px 2px; }
.ob-val { font-size:11px; color:var(--ink); margin-bottom:4px; white-space:nowrap; }
.ob-m { font-size:11px; color:var(--muted); margin-top:4px; }
.sal-col .table-wrap { overflow:visible !important; border:0 !important; box-shadow:none !important; background:transparent !important; padding:0 !important; margin:0 !important; }
.sal-col table { min-width:0 !important; }

/* daily, budget, dup, remind */
.daily { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:12px; margin:8px 0 14px; align-items:stretch; }
@media (max-width: 1100px) { .daily { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .daily { grid-template-columns: 1fr; } }
.daily-c {
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:10px 12px; min-width:0;
  height:14.25rem; min-height:14.25rem; max-height:14.25rem; /* одна высота со «Вопросы ассистента» */
  overflow:hidden; display:flex; flex-direction:column;
  position:relative;
  box-sizing:border-box;
}
.daily-c h3 {
  margin:0 0 4px; font-size:13px; flex:0 0 auto;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.daily-c ul { margin:0; padding-left:16px; font-size:12px; overflow:auto; flex:1 1 auto; min-height:0; }
.daily-c li { margin:1px 0; overflow-wrap:anywhere; }
.daily-c .big { font-size:20px; margin-right:6px; }
.daily-c p { margin:4px 0 0; font-size:12px; flex:0 0 auto; }
.daily-c > .muted { flex:0 0 auto; margin:0 0 2px; font-size:11px; }
.daily-tasks { height:auto; min-height:14.25rem; max-height:none; }

/* Вопросы ассистента — бейдж как непрочитанные в мессенджере */
.daily-unread {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:1.35rem; height:1.35rem; padding:0 6px;
  border-radius:999px; background:#e53935; color:#fff;
  font-size:11px; font-weight:800; line-height:1;
  box-shadow:0 0 0 0 rgba(229,57,53,.55);
  animation:daily-unread-pulse 1.6s ease-out infinite;
}
.daily-unread[data-count="0"] { display:none; }
@keyframes daily-unread-pulse {
  0%   { transform:scale(1);    box-shadow:0 0 0 0   rgba(229,57,53,.55); }
  40%  { transform:scale(1.12); box-shadow:0 0 0 8px rgba(229,57,53,0); }
  100% { transform:scale(1);    box-shadow:0 0 0 0   rgba(229,57,53,0); }
}
.daily-aq {
  border-color:rgba(229,57,53,.28);
  box-shadow:0 4px 14px rgba(229,57,53,.08);
}
.daily-aq:not(:has(.daily-unread:not([data-count="0"]))) {
  border-color:var(--line); box-shadow:none;
}

/* Остальные карточки — мягкое «дыхание» + появление */
.daily-c--soft {
  animation:daily-soft-in .55s ease-out both, daily-soft-breathe 3.6s ease-in-out .55s infinite;
}
.daily-c--soft:nth-child(1) { animation-delay:0s, .55s; }
.daily-c--soft:nth-child(2) { animation-delay:.06s, .61s; }
.daily-c--soft:nth-child(4) { animation-delay:.12s, .67s; }
.daily-c--soft:nth-child(5) { animation-delay:.18s, .73s; }
.daily-c--soft:nth-child(6) { animation-delay:.24s, .79s; }
.daily-c--soft .big {
  display:inline-block;
  animation:daily-num-glow 2.8s ease-in-out infinite;
}
@keyframes daily-soft-in {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes daily-soft-breathe {
  0%, 100% { box-shadow:0 2px 8px rgba(26,163,154,.04); border-color:var(--line); }
  50%      { box-shadow:0 6px 18px rgba(26,163,154,.14); border-color:rgba(26,163,154,.35); }
}
@keyframes daily-num-glow {
  0%, 100% { filter:none; transform:scale(1); }
  50%      { filter:drop-shadow(0 0 4px rgba(26,163,154,.35)); transform:scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .daily-unread, .daily-c--soft, .daily-c--soft .big { animation:none !important; }
}
.bdg { display:inline-block; font-size:11px; font-weight:700; padding:1px 6px; border-radius:999px; vertical-align:middle; }
.bdg.b80, b.b80 { background:#fff4d6; color:#a16207; } .bdg.b100, b.b100 { background:#fde2dd; color:#b42318; }
b.b80, b.b100 { padding:0 5px; border-radius:6px; }
.bwarn { padding:10px 14px; border-radius:12px; margin:8px 0; font-weight:600; }
.bwarn.b80 { background:#fff4d6; color:#854d0e; border:1px solid #f5d27a; } .bwarn.b100 { background:#fde2dd; color:#9f1d12; border:1px solid #f1a598; }
.invoices-table tr.inv-dup td { box-shadow:inset 0 2px 0 #f59e0b, inset 0 -2px 0 #f59e0b; }
.invoices-table tr.inv-dup td:first-child { box-shadow:inset 3px 0 0 #f59e0b, inset 0 2px 0 #f59e0b, inset 0 -2px 0 #f59e0b; }
.inv-swatch.dup { background:#fff; border:2px solid #f59e0b; margin-left:12px; }
.inv-tot.dup b { color:#b45309; }
.inv-totals a.obj-btn { align-self:center; }
.rem-text { width:100%; min-height:320px; box-sizing:border-box; font:13px/1.45 ui-monospace, Menlo, monospace; padding:12px; border-radius:12px; border:1px solid var(--line); background:#fff; }
@media (max-width:700px){ .invoices-table tr.inv-dup { outline:2px solid #f59e0b; } }

.ob-pair { display:flex; align-items:flex-end; gap:3px; }
.ob-pair .ob-bar { width:18px; }
.ob-bar.s1 { background:linear-gradient(180deg, #7cc4f5, #3d8fd1); }
h3 .muted { font-weight:500; }
/* bank wide */
@media (min-width: 1024px) {
  .page-bank main { max-width:none; padding-left:20px; padding-right:20px; }
  .page-bank main .sum-wrap, .page-bank main > .table-wrap, .page-bank main .ops-card { max-width:none; box-sizing:border-box; }
}
@media (min-width: 1280px) {
  .page-bank .sum-wrap { max-width:none !important; width:100% !important; }
  .page-bank .sum-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) !important; }
}


tr.cb-nost td { background:#fff7e6; } tr.cb-nost td.muted, tr.cb-nost td:nth-child(4) { color:#a16207; }
tr.cb-calc td:first-child, tr.cb-man td:first-child { font-weight:600; }
.cash-manual { margin:8px 0; }

/* Вопросы ассистента: статус обработки, уведомление о сохранении */
.q-badge.q-pending { background: #fff3c4; color: #7a5b00; }
.q-badge.q-clarify { background: #fde3d3; color: #9a3d0b; }
.q-when { font-size: 12px; margin-top: 4px; }
.q-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: rgba(0,0,0,.08); font-size: 12px; text-align: center; }
.questions-table tr { transition: opacity .3s ease; }
.questions-table tr.q-gone { opacity: 0; }
.q-flash { margin: 10px 0; padding: 10px 14px; border-radius: 8px; background: #e4f1e8; color: #1f5e3a; border: 1px solid #b9dcc5; }
.q-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 10px; background: #1f5e3a; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 1000; font-size: 14px; line-height: 1.4; }
.q-toast.show { opacity: 1; transform: translate(-50%, 0); }
.q-toast.bad { background: #9a2b1b; }
@media (max-width: 760px) { .q-toast { bottom: 84px; } }

/* Ввод в Затраты */
.z-form { border: 1px solid #e3ded3; border-radius: 10px; padding: 14px 16px; background: #fff; margin: 12px 0 20px; }
.z-form h3 { margin: 0 0 10px; }
.z-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.z-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.z-field input, .z-field select, .z-field textarea { font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid #c9c2b4; border-radius: 6px; box-sizing: border-box; width: 100%; background: #fff; }
.z-field.has-err input, .z-field.has-err select, .z-field.has-err textarea { border-color: #b3261e; }
.z-ferr { color: #b3261e; font-style: normal; font-size: 12px; }
.z-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.z-actions .btn { padding: 8px 16px; border-radius: 6px; border: 1px solid #2e5b8e; background: #2e5b8e; color: #fff; cursor: pointer; font: inherit; }
.z-dups { background: #fff3c4; border: 1px solid #e8d48a; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; color: #5a4300; }
.z-dups ul { margin: 6px 0; padding-left: 18px; }
.z-check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.z-flash { margin: 10px 0; padding: 10px 14px; border-radius: 8px; background: #e4f1e8; color: #1f5e3a; border: 1px solid #b9dcc5; }
.z-flash.bad { background: #fbe4e1; color: #8a1f14; border-color: #efb9b1; }
.z-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: #e6eef7; color: #2e5b8e; }
.z-badge.z-queued { background: #fff3c4; color: #7a5b00; }
.z-badge.z-processing { background: #e6eef7; color: #2e5b8e; }
.z-badge.z-done { background: #e4f1e8; color: #2e7d4f; white-space: normal; }
.z-badge.z-error { background: #fbe4e1; color: #8a1f14; }
.z-badge.z-cancelled { background: #eee; color: #666; }
.z-err, .z-warn { font-size: 12px; margin-top: 4px; }
.z-err { color: #8a1f14; }
.z-warn { color: #9a3d0b; font-weight: 600; }
.z-dupmark { display: inline-block; margin-left: 4px; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #fde3d3; color: #9a3d0b; }
.z-inline { display: inline; margin: 0 0 0 6px; }
.z-row-acts { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.z-row-acts .z-inline { display:contents; margin:0; }
.z-row-acts .btn-sm,
.z-row-acts a.ghost,
.z-row-acts button.ghost {
  flex:0 0 auto; width:auto !important; margin:0 !important; white-space:nowrap;
}
.z-table td .ghost, .z-table td button.ghost { font-size: 13px; }
.z-ref { columns: 3 220px; margin: 4px 0 12px; padding-left: 18px; }
@media (max-width: 760px) { .z-grid { grid-template-columns: 1fr; } }
.z-dups .z-check { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; text-align: left; }
.z-dups .z-check input[type=checkbox] { width: 18px; height: 18px; min-width: 18px; flex: 0 0 auto; margin: 0; padding: 0; }

/* План / факт (20.10.2026) */
.pf-bar { display:inline-block; width:90px; height:8px; background:#e8edf1; border-radius:6px; overflow:hidden; vertical-align:middle; }
.pf-bar i { display:block; height:100%; background:var(--menu, #1aa39a); }
.pf-bar.mid i { background:#eab308; } .pf-bar.over i { background:#dc2626; }
.pf-pct { font-size:12px; font-weight:700; margin-left:6px; } .pf-pct.over { color:#b42318; } .pf-pct.mid { color:#a16207; }
.pf-exec { white-space:nowrap; } .pf-exec small { display:block; font-size:11px; }
.pf-neg { color:#b42318 !important; }
.pf-set { font-size:13px; }
.pf-note { font-size:13px; }
.pf-section { margin-top:22px; }
.pf-headrow { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.pf-btns { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:8px 0; }
.pf-table { width:100%; } .pf-table td, .pf-table th { vertical-align:top; }
.pf-table.pf-narrow { max-width:640px; }
.pf-hint { display:block; font-size:11px; font-weight:400; }
.pf-total td { font-weight:800; border-top:2px solid var(--line); }
.pf-sub td { color:var(--muted); }
.pf-other td:first-child b { color:#7c5e10; }
.pf-types summary { font-size:11px; color:var(--muted); cursor:pointer; }
.pf-types ul { list-style:none; padding:0; margin:4px 0; font-size:12px; }
.pf-types li { display:flex; justify-content:space-between; gap:12px; }
.pf-vers { margin:6px 0; font-size:13px; } .pf-ver { display:inline-block; padding:2px 8px; margin-left:4px; border-radius:999px; border:1px solid var(--line); text-decoration:none; }
.pf-ver.on { background:var(--menu, #1aa39a); color:#fff; border-color:transparent; }
.pf-in { width:140px; text-align:right; padding:5px 8px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.pf-in.pf-small { width:70px; }
.pf-pctbox { display:inline-flex; gap:6px; align-items:center; font-size:13px; }
.pf-reason { display:flex; flex-direction:column; gap:4px; margin:12px 0; max-width:640px; font-size:13px; font-weight:600; }
.pf-reason input { padding:8px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.pf-box { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 16px; margin:18px 0; }
.pf-box summary { cursor:pointer; }
.pf-up { cursor:pointer; }
.pf-cash th, .pf-cash td { white-space:nowrap; font-size:13px; } .pf-cash tbody th { text-align:left; }
.pf-cash .pf-fut { background:#f6f7f9; } .pf-cash .pf-cur { box-shadow:inset 0 -2px 0 var(--menu, #1aa39a); }
.pf-cash tr.pf-bp td, .pf-cash tr.pf-bf td { font-weight:700; }
.pf-tabs { margin-bottom:6px; }
.objects-table .pf-bar { width:56px; }
.objects-table td.pf-dash, .objects-table td.pf-exec { white-space:nowrap; }
@media (min-width:1024px) { .page-dash .objects-table td, .page-dash .objects-table th { padding-left:8px; padding-right:8px; } .page-dash .objects-table td { font-size:13px; } }
.page-planning td.money, .pf-table td.money { white-space:nowrap; }

/* длинные названия не наезжают на суммы (20.10.2026) */
.sum-party, .sum-lines li { white-space: normal; align-items: center; }
.sum-party span, .sum-lines li span {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.25;
}
.sum-party b, .sum-lines li b { flex: 0 0 auto; white-space: nowrap; margin-left: 12px; text-align: right; }
.inv-tot span, .inv-tot b { overflow-wrap: anywhere; }
.inv-tot b { white-space: nowrap; }

/* Планирование: таблица объектов на всю ширину (20.10.2026) */
.page-planning main { max-width: none; }
.page-planning .objects-table, .page-dash .objects-table { width: 100%; max-width: none; }
.page-planning .objects-table td:last-child, .page-dash .objects-table td:last-child { white-space: nowrap; }
@media (min-width:1024px) { .page-planning .objects-table td, .page-planning .objects-table th { padding-left:8px; padding-right:8px; } .page-planning .objects-table td { font-size:13px; } }
.page-planning .table-wrap .objects-table th { white-space: normal; } .page-planning .table-wrap .objects-table td, .page-planning .table-wrap .objects-table th { padding-left:6px; padding-right:6px; }
@media (min-width:1024px) and (max-width:1440px) { .page-planning .table-wrap .objects-table td { font-size:12.5px; } .page-planning .table-wrap .objects-table th { font-size:11px; } .page-planning .objects-table .pf-bar { width:40px; } }

/* Сводка: незакрытые задачи (20.10.2026) */
.daily-tasks { grid-column: 1 / -1; }
.daily-tasks li { margin: 3px 0; }
.daily-tasks .ot-t { font-weight: 700; }
.daily-tasks .ot-more { display: inline; }
.daily-tasks .ot-more summary { display: inline; cursor: pointer; color: var(--brand); }

/* Несколько смет на объект (20.10.2026) */
.pf-smetas td, .pf-smetas th { font-size: 12px; padding: 4px 6px; }
.pf-smetas tr.pf-off td { color: var(--muted); text-decoration: line-through; }
.pf-smetas tr.pf-off td:last-child { text-decoration: none; }
.pf-smetas .pf-tog { white-space: nowrap; font-size: 12px; padding: 3px 8px; }
.pf-box, .pf-box form, .pf-box .table-wrap { min-width: 0; max-width: 100%; }
.pf-box .table-wrap:has(.pf-smetas) { overflow-x: auto; }

/* План денег: остаток к распределению (20.10.2026) */
.pf-ost { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:flex-end; margin:10px 0; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--card); position:sticky; bottom:0; z-index:2; }
.pf-ost > div { display:flex; flex-direction:column; }
.pf-ost span { color:var(--muted); font-size:12px; font-weight:600; }
.pf-ost b { font-size:16px; white-space:nowrap; }
.pf-ost b.neg { color:#b42318; } .pf-ost b.ok { color:#2e7d4f; }
.pf-ost .pf-note { flex-basis:100%; margin:0; }
#pf-delyear[hidden] { display: none; }
/* БДР / БДДС (20.10.2026) */
.rep-filter { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; margin:8px 0 12px; }
.rep-filter select { max-width:100%; padding:6px 8px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.rep-table { width:100%; }
.rep-table tbody th { min-width:200px; white-space:normal; font-weight:500; }
.rep-table tr.rep-sec th { background:#eef1f4; font-weight:800; text-transform:none; padding-top:8px; }
.rep-table tr.rep-plan td, .rep-table tr.rep-plan th { color:#5a6572; font-style:italic; }
.rep-table tr.rep-bal td, .rep-table tr.rep-bal th { font-weight:700; background:#fafbfc; }
.rep-table td.rep-y { font-weight:800; border-left:2px solid var(--line); }
.rep-table tr.rep-item th { padding-left:18px; }
.rep-note { margin-top:10px; max-width:78ch; }
.calc-spend { color: var(--muted); font-style: italic; font-weight: 500; }
@media (max-width:720px) { .rep-table tbody th { min-width:140px; font-size:12px; } .rep-table td { font-size:12px; } }
.rep-table tbody th, .rep-table thead th:first-child { position:sticky; left:0; background:#fff; z-index:1; }
.rep-table tr.rep-sec th { position:static; }
/* Черновики / В работе (20.10.2026) */
.z-badge.z-draft { background:#eef1f4; color:#3a434d; }
.z-badge.z-queued { background:#e6f6f4; color:#0f766e; }
.z-bulk { margin:6px 0 10px; }
.z-keep { margin-left:14px; font-weight:600; }
.z-table input.z-pick, #z-pick-all { width:18px; height:18px; }
@media (max-width:720px) { .z-keep { margin:10px 0 0; } }
.z-keep { display:inline-flex; flex-direction:row; align-items:center; gap:8px; white-space:nowrap; }
.z-keep input, .z-table input.z-pick, #z-pick-all { width:18px !important; height:18px; min-height:0; padding:0; margin:0; flex:none; }

/* --- styled modal (bmConfirm) --- */
body.bm-lock { overflow: hidden; }
.bm-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(28,36,51,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: bm-fade .15s ease-out; }
.bm-card { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgba(28,36,51,.25); padding: 22px 22px 18px; color: var(--ink); font: inherit; animation: bm-pop .18s ease-out; }
.bm-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: var(--brand); }
.bm-text { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.bm-list { overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 10px; -webkit-overflow-scrolling: touch; }
.bm-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.bm-row:last-child { border-bottom: 0; }
.bm-row:nth-child(even) { background: #fafaf9; }
.bm-row-main { min-width: 0; }
.bm-obj { margin-left: 8px; color: var(--brand); }
.bm-what { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.bm-sum { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.bm-total { display: flex; justify-content: space-between; padding: 4px 12px 12px; font-size: 15px; }
.bm-total b { font-variant-numeric: tabular-nums; color: var(--menu-hover); }
.bm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.bm-btn { min-height: 42px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.bm-primary { background: var(--menu); border-color: var(--menu); color: #fff; }
.bm-primary:hover, .bm-primary:focus-visible { background: var(--menu-hover); border-color: var(--menu-hover); }
.bm-danger { background: #d92d20; border-color: #d92d20; color: #fff; }
.bm-danger:hover, .bm-danger:focus-visible { background: #b42318; }
.bm-secondary { background: #fff; color: var(--ink); }
.bm-secondary:hover { border-color: var(--menu); }
.bm-btn:focus-visible { outline: 3px solid var(--menu-soft); outline-offset: 2px; }
@keyframes bm-fade { from { opacity: 0; } }
@keyframes bm-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 560px) { .bm-backdrop { align-items: flex-end; padding: 0; } .bm-card { border-radius: 18px 18px 0 0; max-height: 88vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); } .bm-actions .bm-btn { flex: 1; } }

/* 2026-10-22: «Ввод в Затраты» на всю свободную ширину */
main:has(> .z-page) { max-width: none; }
.z-page { width: 100%; max-width: none; }
@media (min-width: 1100px) { .z-page .z-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 2026-10-22: ответы по «На проверку» */
.ra-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 260px; margin: 0; }
.ra-form select, .ra-form input[type=text] { font: inherit; font-size: 14px; padding: 4px 6px; border: 1px solid #c9c2b4; border-radius: 6px; background: #fff; }
.ra-form select { flex: 1 1 150px; } .ra-form input[type=text] { flex: 1 1 140px; min-width: 0; }
.ra-form .ra-msg { flex-basis: 100%; font-size: 12px; }
.review-table tr:has(.ra-done) { background: #ecfdf5; }
.ra-done .ra-msg { color: #0f766e; }
@media (max-width: 1023px) { .ra-form { min-width: 0; width: 100%; } .ra-form select, .ra-form input[type=text] { font-size: 16px; flex-basis: 100%; } }

main:has(.veh-wide){max-width:none}.veh-tbl{width:100%}.veh-chart .obj-chart{width:100%}.veh-chart .ob-col{flex:1}
td.money.amt-in{color:#15803d;font-weight:600}td.money.amt-out{color:#b42318}
.veh-chart .obj-chart{max-width:none;min-height:180px}.veh-chart .ob-pair .ob-bar{width:clamp(14px,2.2vw,40px)}
.page-dash main:has(.veh-wide) > *{max-width:none}
main:has(.veh-wide), main:has(.veh-wide) > *{max-width:none !important}
a.back-btn{
  display:inline-flex;align-items:center;gap:8px;
  margin:0 0 4px;padding:10px 16px;min-height:40px;
  border-radius:12px;border:1px solid rgba(26,163,154,.35);
  background:linear-gradient(180deg,#1eb3a8,var(--menu,#1aa39a));
  color:#fff !important;text-decoration:none !important;
  font-weight:750;font-size:15px;letter-spacing:-0.01em;
  box-shadow:0 4px 14px rgba(26,163,154,.28);
  transition:filter .15s,transform .15s,box-shadow .15s;
}
a.back-btn:hover{filter:brightness(1.08);transform:translateY(-1px);box-shadow:0 6px 18px rgba(26,163,154,.34)}
a.back-btn:focus-visible{outline:3px solid rgba(26,163,154,.45);outline-offset:2px}
p:has(> a.back-btn:only-child){margin:0 0 12px}

.ob-legend{font-size:14px;font-weight:500;color:var(--text,#1f2937);margin-left:10px;display:inline-flex;align-items:center;gap:6px}.ob-legend .sw{display:inline-block;width:14px;height:14px;border-radius:3px;margin-left:8px}.ob-legend .sw.s0{background:linear-gradient(180deg,var(--menu),var(--menu-hover))}.ob-legend .sw.s1{background:linear-gradient(180deg,#7cc4f5,#3d8fd1)}


/* 2026-10-23: «Что изменилось» на всю ширину, читаемее */
.page-changes main,
main:has(.changes-wide),
main:has(.changes-wide) > * { max-width: none !important; }
.page-changes main { width: 100%; }
@media (min-width: 1024px) {
  .page-changes main,
  main:has(.changes-wide) { padding-left: 20px; padding-right: 20px; }
}
.changes-wide { width: 100%; max-width: none; }
.changes-table { width: 100%; min-width: 0; table-layout: fixed; }
.changes-table th, .changes-table td {
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.45;
  vertical-align: top;
}
.changes-table th { font-size: 12px; }
.changes-table .chg-date { width: 7.5rem; white-space: nowrap; }
.changes-table .chg-kind { width: 8.5rem; white-space: nowrap; }
.changes-table .chg-doc { width: 7rem; overflow-wrap: anywhere; }
.changes-table .chg-party { width: 14%; overflow-wrap: anywhere; font-weight: 650; }
.changes-table .chg-object { width: 12%; overflow-wrap: anywhere; }
.changes-table .chg-purpose { width: 22%; overflow-wrap: anywhere; color: #334155; font-size: 14px; line-height: 1.4; }
.changes-table .chg-diff { width: auto; }
.chg-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  line-height: 1.3;
}
.chg-badge-added { background: #ecfdf5; color: #047857; }
.chg-badge-changed { background: #eff6ff; color: #1d4ed8; }
.chg-badge-removed { background: #fef2f2; color: #b91c1c; }
.chg-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chg-item {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr);
  gap: 8px 14px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed #eef2f7;
}
.chg-item:last-child { border-bottom: 0; padding-bottom: 0; }
.chg-item:first-child { padding-top: 0; }
.chg-k {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.chg-v {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.chg-old { color: #94a3b8; }
.chg-arrow { color: #94a3b8; font-weight: 700; }
.chg-new { color: var(--ink); font-weight: 700; }
.chg-row.chg-added td:first-child { box-shadow: inset 3px 0 0 #34b37a; }
.chg-row.chg-changed td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
.chg-row.chg-removed td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
@media (max-width: 1023px) {
  .changes-table { table-layout: auto; }
  .changes-table .chg-date,
  .changes-table .chg-kind,
  .changes-table .chg-doc,
  .changes-table .chg-party,
  .changes-table .chg-object,
  .changes-table .chg-purpose,
  .changes-table .chg-diff { width: auto; }
  .chg-item { grid-template-columns: 1fr; gap: 2px; }
  .chg-row.chg-added td:first-child,
  .chg-row.chg-changed td:first-child,
  .chg-row.chg-removed td:first-child { box-shadow: none; }
  .chg-row.chg-added { border-left: 3px solid #34b37a; }
  .chg-row.chg-changed { border-left: 3px solid #3b82f6; }
  .chg-row.chg-removed { border-left: 3px solid #ef4444; }
}
@media (min-width: 1024px) and (max-width: 1280px) {
  .changes-table .chg-party { width: 13%; }
  .changes-table .chg-object { width: 11%; }
  .changes-table .chg-purpose { width: 20%; }
  .chg-item { grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr); }
}

/* signed amounts: amount-pos / amount-neg (23.10.2026) */
.amount-pos, td.money.amount-pos, td.num.amount-pos, b.amount-pos, .inv-tot.amount-pos b, .pf-ost b.amount-pos, .pf-ost b.ok {
  color: #15803d !important; font-weight: 600;
}
.amount-neg, td.money.amount-neg, td.num.amount-neg, b.amount-neg, .inv-tot.amount-neg b, .pf-ost b.amount-neg, .pf-ost b.neg, .pf-neg {
  color: #b42318 !important; font-weight: 600;
}
/* aliases → единая палитра */
td.money.amt-in, .amt-in { color: #15803d; font-weight: 600; }
td.money.amt-out, .amt-out { color: #b42318; font-weight: 600; }
.saldo-sum.in, .sal-col.in h3 b { color: #15803d; }
.saldo-sum.out, .sal-col.out h3 b { color: #b42318; }
td.num.in, .op-sum.in, dd.num.in, .sum-figures b.in, .sum-lines b.in { color: #15803d; }
td.num.out, .op-sum.out, dd.num.out, .sum-figures b.out, .sum-lines b.out { color: #b42318; }

/* taxes tab 23.10.2026 */
.tax-table .tax-src { display: block; font-weight: 400; }
.tax-table td.money { white-space: nowrap; }

/* taxes tab current quarter + alerts 23.10.2026 */
.tax-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.tax-card { background: var(--card, #f7faf9); border: 1px solid #d7e2df; border-radius: 10px; padding: 12px 14px; }
.tax-card .money { font-size: 1.25rem; font-weight: 700; margin-top: 4px; }
.tax-alert { border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; }
.tax-alert.bad { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; }
.tax-alert.ok { background: #ecfdf3; border: 1px solid #abeFC6; color: #067647; }
.tax-alert ul { margin: 6px 0 0 18px; }
.tax-alert-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.tax-alert-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.tax-alert-fields input { min-width: 140px; padding: 6px 8px; }
.tax-flag { color: #b42318; font-weight: 700; }
.tax-details { margin: 8px 0 16px; }


/* Планирование: цветные вкладки БДР / БДДС / Налоги (23.10.2026) */
.pf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.pf-tabs .pf-tab-bdr {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}
.pf-tabs .pf-tab-bdr:hover { border-color: #2563eb; color: #1e40af; background: #bfdbfe; }
.pf-tabs .pf-tab-bdr.on {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}
.pf-tabs .pf-tab-bdds {
  background: #dcfce7;
  border-color: #4ade80;
  color: #14532d;
}
.pf-tabs .pf-tab-bdds:hover { border-color: #16a34a; color: #166534; background: #bbf7d0; }
.pf-tabs .pf-tab-bdds.on {
  background: linear-gradient(180deg, #22c55e, #15803d);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.32);
}
.pf-tabs .pf-tab-taxes {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
}
.pf-tabs .pf-tab-taxes:hover { border-color: #ea580c; color: #c2410c; background: #fed7aa; }
.pf-tabs .pf-tab-taxes.on {
  background: linear-gradient(180deg, #f59e0b, #c2410c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}
.pf-tabs .pf-tab-plan.on,
.pf-tabs .pf-tab-cash.on {
  /* прочие вкладки объекта — общий стиль .seg-btn.on */
}

/* Налоги: список отчётов + модалка + нормальный поток страницы */
.page-planning.page-taxes main,
.page-planning main {
  display: block;
  min-width: 0;
  max-width: none;
}
.tax-reports-wrap { margin: 8px 0 18px; }
.tax-reports .tax-report-row { cursor: pointer; }
.tax-reports .tax-report-row:hover { background: rgba(245, 158, 11, 0.08); }
.tax-badge.now {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}
.tax-current { margin: 8px 0 16px; }
.tax-alert-settings-row { margin: 10px 0 8px; }
.tax-alert-form {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  max-width: none;
}
#tax-alert-modal .tax-alert-form {
  margin-top: 4px;
}
.tax-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.tax-modal:not([hidden]) { display: flex; }
.tax-modal[hidden] { display: none !important; }
.tax-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.tax-modal-card {
  position: relative; z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.tax-modal-x {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent;
  font-size: 28px; line-height: 1; cursor: pointer; color: #64748b;
}
body.tax-modal-open { overflow: hidden; }
.tax-modal-list { margin: 12px 0 0; padding-left: 18px; }
.tax-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tax-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tax-card .money { font-size: 20px; font-weight: 800; margin-top: 4px; }
.tax-alert { border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.tax-alert.bad { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.tax-alert.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.tax-flag { color: #b45309; font-weight: 800; }
@media (max-width: 720px) {
  .tax-cards { grid-template-columns: 1fr; }
}


/* Исходящий НДС → список поступлений (23.10.2026) */
.tax-card-clickable {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  border-color: #fdba74;
  background: #fff7ed;
}
.tax-card-clickable:hover,
.tax-card-clickable:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
  background: #ffedd5;
}
.tax-card-hint { display: block; margin-top: 4px; color: #c2410c; font-weight: 600; }
.tax-out-cell { cursor: pointer; color: #c2410c; text-decoration: underline dotted; }
.tax-out-cell:hover { color: #9a3412; }
.tax-ops-modal { z-index: 90; }
.tax-ops-card { width: min(960px, 100%); }
.tax-ops-table { width: 100%; font-size: 14px; }
.tax-ops-table th, .tax-ops-table td { vertical-align: top; }
.tax-ops-purpose { max-width: 280px; word-break: break-word; }
.tax-ops-body .table-wrap { max-height: min(60vh, 520px); overflow: auto; }


/* Неразнесённые поступления (23.10.2026) */
.daily-unmatched .big.amount-neg { color:#b42318; }
.daily-unmatched li .muted { font-size:12px; }


/* Пометки на /unmatched-receipts */
.ua-mark { min-width: 140px; vertical-align: top; }
.ua-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ua-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 650;
}
.ua-comment, .ua-when { font-size: 12px; max-width: 200px; }
.ua-btn {
  appearance: none; border: 1px solid #cbd5e1; background: #fff; color: #0f172a;
  border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.ua-btn:hover { background: #f8fafc; }
.ua-btn-done { border-color: #6ee7b7; background: #ecfdf5; }
.ua-dialog { width: min(480px, calc(100vw - 24px)); }
.ua-dialog .ua-summary { margin: 0 0 12px; font-size: 14px; }
.ua-dialog label select, .ua-dialog label input { margin-top: 4px; }
.btn-sm.primary { background: #2563eb; color: #fff; border-color: #2563eb; }


/* CTA: планирование затрат компании на /planning */
.pf-company-cta-wrap { margin-top: 1.25rem; }
.pf-company-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--menu), var(--menu-hover));
  color: #fff !important;
  text-decoration: none !important;
  border: 0;
  box-shadow: 0 2px 10px rgba(22, 143, 135, 0.28);
  transition: background .15s ease, box-shadow .15s ease, filter .15s ease;
}
.pf-company-cta:hover,
.pf-company-cta:focus-visible {
  background: linear-gradient(180deg, var(--menu-hover), #127a73);
  color: #fff !important;
  text-decoration: none !important;
  filter: brightness(0.97);
  box-shadow: 0 4px 14px rgba(22, 143, 135, 0.38);
  outline: none;
}
.pf-company-cta-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.pf-company-cta-sub {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0.88;
  color: #fff;
}

/* Справка БДДС/БДР — кнопка + dialog (28.10.2026) */
.rep-help-wrap { margin: 8px 0 12px; }
.rep-help-btn { min-height: 36px; }
dialog.rep-help-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(640px, calc(100vw - 24px));
  max-height: min(86vh, 720px);
  box-shadow: 0 20px 60px rgba(31, 41, 51, 0.28);
}
dialog.rep-help-dialog::backdrop { background: rgba(28, 36, 51, 0.45); backdrop-filter: blur(2px); }
.rep-help-sheet { display: flex; flex-direction: column; gap: 0; margin: 0; max-height: min(86vh, 720px); }
.rep-help-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 1; border-radius: 16px 16px 0 0;
}
.rep-help-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.rep-help-x { min-height: 36px; min-width: 36px; padding: 0 8px; font-size: 18px; line-height: 1; }
.rep-help-body {
  padding: 12px 16px; overflow: auto; max-width: none; font-size: 13px; line-height: 1.45;
}
.rep-help-body p { margin: 0 0 12px; }
.rep-help-body p:last-child { margin-bottom: 0; }
.rep-help-sheet .dialog-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 16px 14px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: #fff; border-radius: 0 0 16px 16px;
}

/* Период на /bank/ops (28.10.2026) */
.ops-period { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.ops-period-seg { flex-wrap: wrap; }
.ops-period-form {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.ops-period-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ops-period-form input[type=date] { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
.ops-period-range { margin: 0; font-size: 13px; }
.ops-data-period { margin: -4px 0 12px; font-size: 13px; font-weight: 650; }

/* Назначение в «На проверку» (28.10.2026) */
.review-table td.ra-purpose {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .page-bank table.review-table td.ra-purpose { max-width: none; }
}
