/* Шрифт Manrope — локальные woff2 (app/static/fonts/), подмножества cyrillic и latin */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/manrope-400-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;
  font-display: swap;
  src: url("/static/fonts/manrope-400-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;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/manrope-500-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: 500;
  font-display: swap;
  src: url("/static/fonts/manrope-500-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;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/manrope-600-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: 600;
  font-display: swap;
  src: url("/static/fonts/manrope-600-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;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/manrope-700-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: 700;
  font-display: swap;
  src: url("/static/fonts/manrope-700-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;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/static/fonts/manrope-800-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: 800;
  font-display: swap;
  src: url("/static/fonts/manrope-800-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;
}

/* Общий дизайн — по макету «app_пример верстки» */
:root {
  --dark: #0c2a61;
  --blue: #0a579a;
  --blue-10: #eaf2fa;
  --ink: #1a2433;
  --muted: #66748a;
  --line: #dde4ee;
  --bg: #f4f7fb;
  --green: #1e9e5a;
  --yellow: #e3a008;
  --red: #d92d20;
  --font-family: "Manrope", system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  display: flex;
  min-height: 100vh;
}
.logout-form { margin: 0; }
.logout-form button { margin: 0; }
.login-page { display: block; background: linear-gradient(135deg, #eef4fb, #f8fafc); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 20px 55px rgba(12, 42, 97, .12); }
.login-card h1 { margin: 24px 0 18px; color: var(--dark); font-size: 24px; }
.login-card label { font-size: 13px; font-weight: 700; }
.login-card input { margin-top: 6px; }
.login-card button { width: 100%; margin: 8px 0 0; }
.login-brand { display: flex; align-items: center; gap: 12px; color: var(--dark); }
.login-brand b, .login-brand small { display: block; }
.login-brand small { color: var(--muted); }
.login-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: var(--dark); color: #fff; font-weight: 800; }
.form-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: #fff1f0; color: var(--red); font-weight: 700; }

/* Сайдбар */
.side {
  width: 220px;
  background: var(--dark);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.side .logo .m {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #fff;
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.side .logo b {
  font-size: 14px;
  line-height: 1.2;
}
.side .logo span {
  display: block;
  font-size: 10px;
  color: #9db4d8;
  font-weight: 400;
}
.side nav {
  padding: 14px 10px;
  flex: 1;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 2px 0;
  padding: 10px 12px;
  color: #c3d2ea;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
}
.side nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side nav a.on {
  background: #17427f;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}
.nav-caption { margin: 20px 4px 7px; color: #8fa9cf; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; color: currentColor; opacity: .9; }
.nav-icon::before, .nav-icon::after { position: absolute; content: ""; }
.nav-icon-dashboard::before { inset: 2px; border: 1.6px solid currentColor; border-radius: 4px; }
.nav-icon-dashboard::after { top: 5px; left: 5px; width: 7px; height: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; }
.nav-icon-charges::before { inset: 2px 3px; border: 1.6px solid currentColor; border-radius: 3px; }
.nav-icon-charges::after { top: 6px; left: 6px; width: 6px; height: 4px; border-top: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; }
.nav-icon-clients::before { top: 2px; left: 6px; width: 6px; height: 6px; border: 1.6px solid currentColor; border-radius: 50%; }
.nav-icon-clients::after { bottom: 2px; left: 3px; width: 12px; height: 7px; border: 1.6px solid currentColor; border-radius: 8px 8px 3px 3px; }
.nav-icon-warehouses::before { bottom: 2px; left: 2px; width: 14px; height: 10px; border: 1.6px solid currentColor; border-radius: 1px; }
.nav-icon-warehouses::after { top: 2px; left: 3px; width: 11px; height: 11px; border-top: 1.6px solid currentColor; border-left: 1.6px solid currentColor; transform: rotate(45deg); }
.nav-icon-services::before { top: 3px; left: 3px; width: 12px; height: 12px; border: 1.6px solid currentColor; border-radius: 50%; }
.nav-icon-services::after { top: 7px; left: 7px; width: 4px; height: 4px; border: 1.6px solid currentColor; border-radius: 50%; }
.nav-icon-contracts::before { inset: 2px 4px; border: 1.6px solid currentColor; border-radius: 2px; }
.nav-icon-contracts::after { top: 6px; left: 7px; width: 5px; height: 1.6px; background: currentColor; box-shadow: 0 4px 0 currentColor; }
.nav-icon-help::before { inset: 2px; border: 1.6px solid currentColor; border-radius: 50%; }
.nav-icon-help::after { content: '?'; inset: 1px 0 0; text-align: center; color: currentColor; font-size: 11px; font-weight: 800; line-height: 16px; }
.help-page { width: 100%; max-width: none; display: grid; gap: 14px; }
.help-hero h2 { margin: 4px 0 5px; color: var(--dark); font-size: 28px; }
.help-hero p { max-width: 760px; margin: 4px 0; color: #536174; font-size: 14px; line-height: 1.5; }
.help-hero .help-lead { color: var(--dark); font-size: 17px; font-weight: 700; }
.help-section { padding: 18px 22px; }
.help-section h3 { margin: 0 0 10px; color: var(--dark); font-size: 21px; }
.help-section h4 { margin: 0 0 6px; color: var(--dark); font-size: 14px; }
.help-section p, .help-section li { color: #536174; font-size: 14px; line-height: 1.55; }
.help-section ol { margin: 5px 0 0; padding-left: 20px; }
.help-callout { margin: 12px 0; padding: 9px 12px; border-left: 3px solid #8db7dd; background: #f3f8fc; }
.help-kicker { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 760px) { .help-section { padding: 16px; } }
.side .foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: #9db4d8;
}

/* Основная часть */
.main {
  flex: 1;
  min-width: 0;
}
.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.top h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--dark);
}
.top .crumb {
  font-size: 12px;
  color: var(--muted);
}
.top .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.top .user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.top .user .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-10);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}
.wrap {
  padding: 22px 28px 40px;
  width: 100%;
}

/* Карточки и сетка */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.card .t {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card .v {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin-top: 6px;
}
.card .d {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 12px;
}
.row-actions-cell {
  position: relative; overflow: visible; padding: 0 !important; text-align: center;
  vertical-align: middle !important; line-height: 0;
}
.row-actions-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: 0 !important; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--muted); font-size: 14px;
  line-height: 1; vertical-align: middle; cursor: pointer;
}
.row-actions-toggle:hover, .row-actions-cell.open .row-actions-toggle {
  color: var(--blue); border-color: var(--blue); background: var(--blue-10);
}
.row-actions-menu {
  position: absolute; z-index: 30; top: 0; right: calc(100% + 6px); min-width: 150px;
  width: max-content; max-width: min(280px, calc(100vw - 16px));
  padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  box-shadow: 0 10px 24px rgba(28, 43, 67, .16); text-align: left;
}
.row-actions-menu a, .row-actions-menu button {
  display: block; width: 100%; margin: 0; padding: 6px 8px; border: 0; border-radius: 5px;
  background: transparent; color: var(--dark); font: inherit; font-size: 12px; line-height: 1.2; text-align: left;
  white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.row-actions-menu form { display: block; width: 100%; margin: 0; padding: 0; }
.row-actions-menu a:hover, .row-actions-menu button:hover { background: var(--blue-10); color: var(--blue); }
.panel .hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid2 > * {
  min-width: 0;
}
canvas {
  max-width: 100%;
}
.chart {
  position: relative;
  width: 100%;
}
.chart-sm {
  height: 210px;
}
.chart-lg {
  height: clamp(280px, 34vh, 390px);
}
.chart-donut {
  max-width: none;
}
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-charts-grid > .panel {
  margin-bottom: 0;
}
@media (min-width: 1200px) {
  .chart-sm {
    height: 190px;
  }
}
@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Кнопки */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  background: var(--blue);
  color: #fff;
}
.btn:hover {
  background: #084a82;
}
.btn.sec {
  background: var(--blue-10);
  color: var(--blue);
}
.btn.sec:hover {
  background: #d8e7f6;
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.warn {
  background: var(--yellow);
  color: #fff;
}
.btn.off {
  background: #e5eaf2;
  color: #9aa7bb;
  cursor: not-allowed;
}
.btn.sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Формы */
.frow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Единый компонент фильтров для дашбордов и реестров. */
.filter-panel {
  background: #fff;
  border: 1px solid #e2e7ed;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 30px rgba(22, 39, 64, 0.07);
}
.filter-form {
  display: flex;
  align-items: end;
  gap: 14px;
}
.filter-grid {
  display: grid;
  gap: 14px;
  align-items: end;
  flex: 1;
  min-width: 0;
}
.filter-grid.filters-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.filter-grid.filters-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.filter-grid .fld {
  min-width: 0;
}
.filter-grid .fld label {
  color: #536174;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.filter-grid .fld input,
.filter-grid .fld select {
  width: 100%;
  height: 38px;
  margin: 0;
  padding: 7px 10px;
  border-color: #d8dee7;
  border-radius: 8px;
  font-size: 12px;
}
.filter-grid .fld input:focus,
.filter-grid .fld select:focus {
  border-color: #70a4cf;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(10, 87, 154, 0.08);
}
.filter-client-picker { position: relative; }
.filter-client-picker input { padding-right: 30px !important; }
.filter-client-picker::after { position: absolute; top: 15px; right: 11px; width: 7px; height: 7px; border-right: 1.5px solid #617087; border-bottom: 1.5px solid #617087; content: ""; pointer-events: none; transform: rotate(45deg) translateY(-3px); }
.filter-client-options { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; left: 0; display: none; max-height: 380px; overflow-y: auto; border: 1px solid #d8dee7; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(22,39,64,.13); }
.filter-client-picker.open .filter-client-options { display: block; }
.filter-client-options button { display: block; width: 100%; min-height: 38px; margin: 0; padding: 9px 10px; border: 0; border-bottom: 1px solid #eef1f5; background: #fff; color: #233148; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.filter-client-options button:last-child { border-bottom: 0; }
.filter-client-options button:hover, .filter-client-options button:focus { background: #eef5fb; color: #0a579a; outline: 0; }
.filter-client-options button[hidden] { display: none; }
.filter-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.filter-actions .btn {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin: 0;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Панель действий реестров — соответствует макету начислений. */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.directory-toolbar { margin-bottom: 14px; }
.directory-summary { color: #66748a; font-size: 12px; font-weight: 600; }
.directory-add { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 14px; white-space: nowrap; }
.directory-table-panel { padding: 0; overflow: hidden; }
.warehouse-card-actions { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid #edf0f5; }
.warehouse-card-actions .btn { min-height: 34px; padding: 7px 12px; }
.segmented {
  display: flex;
  padding: 4px;
  gap: 2px;
  border-radius: 10px;
  background: #e9edf2;
}
.seg {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  color: #718095;
  font-size: 11px;
  white-space: nowrap;
}
.seg.active {
  background: #fff;
  color: #1f2f45;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}
.seg.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.seg small {
  margin-left: 4px;
  padding: 1px 4px;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-size: 8px;
}
.charges-add {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 14px;
  white-space: nowrap;
}
.charges-workflow { width: 380px; max-width: 100%; }
.charges-workflow .segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 36px; width: 100%; height: 44px; padding: 4px; align-items: stretch; }
.charges-workflow .seg { display: inline-flex; width: 100%; min-width: 0; height: 36px; min-height: 36px; margin: 0; align-self: stretch; justify-content: center; padding-inline: 8px; }
.charges-workflow .seg.action { background: #fff; color: #1f2f45; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); font-weight: 700; }
.download-template { text-decoration: none; }
.upload-xlsx { position: relative; cursor: pointer; }
.upload-xlsx input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.upload-xlsx:hover, .download-template:hover { background: #eef5fb; color: #0a579a; }
.clients-toolbar { margin-bottom: 16px; }
.clients-search {
  width: min(360px, 100%);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #d8dee7;
  border-radius: 9px;
  background: #fff;
  color: #8793a4;
}
.clients-search input { min-width: 0; height: 36px; min-height: 0; flex: 1; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12px; line-height: 36px; }
.clients-search input:focus { box-shadow: none; }
.clients-search button { display: none; }
.clients-add { min-height: 38px; padding-inline: 14px; white-space: nowrap; }
.clients-table-panel { padding: 0; overflow: hidden; }
.clients-table-panel .pager { justify-content: center; margin: 0; padding: 16px 18px 18px; }
.clients-panel-head { padding: 17px 18px 12px; }
.clients-panel-head h2 { margin: 0 0 2px; font-size: 14px; }
.clients-panel-head p { margin: 0; color: #8a95a5; font-size: 10px; }
.client-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(8,25,52,.48); backdrop-filter: blur(2px); }
.client-modal[hidden] { display: none; }
.client-modal-card { width: min(570px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #dfe5ec; border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(5,27,61,.28); transform: translateY(12px) scale(.985); opacity: 0; transition: transform .18s ease-out, opacity .18s ease-out; }
.client-modal.is-open { animation: modal-backdrop-in .18s ease-out both; }
.client-modal.is-open .client-modal-card { transform: translateY(0) scale(1); opacity: 1; }
.client-modal.is-closing { animation: modal-backdrop-out .16s ease-in both; }
.client-modal.is-closing .client-modal-card { transform: translateY(8px) scale(.99); opacity: 0; transition-duration: .16s; }
.client-modal-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.client-modal-head span { display: block; color: #7b899c; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.client-modal-head h2 { margin: 2px 0 0; color: #0c2a61; font-size: 18px; }
.client-modal-close { width: 32px; height: 32px; display: grid; flex: 0 0 32px; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 8px; background: #eef2f6; color: #64748a; font-size: 22px; line-height: 1; cursor: pointer; }
.client-modal-content { padding: 0 20px 20px; }
.client-form-grid { display: grid; gap: 13px; }
.client-form-grid .fld { gap: 0; }
.client-form-grid .fld label { color: #536174; font-size: 11px; font-weight: 700; letter-spacing: normal; text-transform: none; }
.client-form-grid .fld input, .client-form-grid .fld select { width: 100%; height: 38px !important; min-height: 38px !important; margin: 5px 0 0; padding: 8px 10px; border-color: #d8dee7; border-radius: 8px; font-size: 12px; line-height: 20px; }
.client-form-grid .fld textarea { width: 100%; min-height: 58px; margin: 5px 0 0; padding: 8px 10px; border-color: #d8dee7; border-radius: 8px; font-size: 12px; resize: vertical; }
.client-inn-action { display: flex; gap: 8px; align-items: end; }
.client-inn-action input { flex: 1; }
.client-inn-action .btn { height: 38px; min-height: 38px; margin: 5px 0 0; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.client-modal-dadata { display: grid; gap: 13px; }
.client-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.client-active { display: flex; align-items: center; gap: 7px; color: #536174; font-size: 11px; font-weight: 700; }
.client-active input { width: 14px !important; height: 14px !important; min-height: 14px !important; margin: 0; padding: 0; accent-color: #0a579a; }
.client-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #e2e7ed; }
.client-modal-actions .btn { width: auto; min-height: 36px; margin: 0; }
.directory-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(8,25,52,.48); backdrop-filter: blur(2px); }
.directory-modal[hidden] { display: none; }
.directory-modal.is-open { animation: modal-backdrop-in .18s ease-out both; }
.directory-modal.is-closing { animation: modal-backdrop-out .16s ease-in both; }
.directory-modal-card { width: min(520px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #dfe5ec; border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(5,27,61,.28); transform: translateY(12px) scale(.985); opacity: 0; transition: transform .18s ease-out, opacity .18s ease-out; }
.directory-modal.is-open .directory-modal-card { transform: translateY(0) scale(1); opacity: 1; }
.directory-modal.is-closing .directory-modal-card { transform: translateY(8px) scale(.99); opacity: 0; transition-duration: .16s; }
.directory-modal-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.directory-modal-head span { display: block; color: #7b899c; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.directory-modal-head h2 { margin: 2px 0 0; color: #0c2a61; font-size: 18px; }
.directory-modal-close { width: 32px; height: 32px; display: grid; flex: 0 0 32px; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 8px; background: #eef2f6; color: #64748a; font-size: 22px; line-height: 1; cursor: pointer; }
.directory-modal-content { padding: 0 20px 20px; }
.directory-form-grid { display: grid; gap: 13px; }
.directory-form-grid .fld { gap: 0; }
.directory-form-grid .fld label { color: #536174; font-size: 11px; font-weight: 700; letter-spacing: normal; text-transform: none; }
.directory-form-grid .fld input, .directory-form-grid .fld select { width: 100%; height: 38px !important; min-height: 38px !important; margin: 5px 0 0; padding: 8px 10px; border-color: #d8dee7; border-radius: 8px; font-size: 12px; line-height: 20px; }
.directory-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.directory-check { display: flex; align-items: center; gap: 7px; color: #536174; font-size: 11px; font-weight: 700; }
.directory-check input[type="checkbox"] { display: inline-block; flex: 0 0 16px; width: 16px !important; height: 16px !important; min-height: 16px !important; margin: 0; padding: 0; appearance: auto; accent-color: #0a579a; }
.directory-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #e2e7ed; }
.directory-modal-actions .btn { width: auto; min-height: 36px; margin: 0; }
.charge-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 25, 52, 0.48);
  backdrop-filter: blur(2px);
}
.charge-modal[hidden] { display: none; }
.modal-open { overflow: hidden; }
.charge-modal.is-open { animation: modal-backdrop-in .18s ease-out both; }
.charge-modal.is-closing { animation: modal-backdrop-out .16s ease-in both; }
.charge-modal-card {
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 27, 61, 0.28);
  transform: translateY(12px) scale(.985);
  opacity: 0;
  transition: transform .18s ease-out, opacity .18s ease-out;
}
.charge-modal.is-open .charge-modal-card { transform: translateY(0) scale(1); opacity: 1; }
.charge-modal.is-closing .charge-modal-card { transform: translateY(8px) scale(.99); opacity: 0; transition-duration: .16s; }
@keyframes modal-backdrop-in { from { background-color: rgba(8,25,52,0); } to { background-color: rgba(8,25,52,.48); } }
@keyframes modal-backdrop-out { from { background-color: rgba(8,25,52,.48); } to { background-color: rgba(8,25,52,0); } }
::view-transition-old(root) { animation: page-out .14s ease-in both; }
::view-transition-new(root) { animation: page-in .2s ease-out both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.charge-modal-head {
  min-height: 72px;
  padding: 18px 21px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0;
  background: #fff;
}
.charge-modal-head span {
  display: block;
  color: #7b899c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.charge-modal-head h2 {
  margin: 2px 0 0;
  color: #0c2a61;
  font-size: 18px;
}
.charge-modal-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #eef2f6;
  color: #64748a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.charge-modal-content {
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-gutter: stable;
  background: #fff;
}
@media (min-width: 901px) {
  .charge-modal-card { max-height: calc(100vh - 32px); }
  .charge-modal-content { overflow: visible; }
}
.charge-modal-form {
  padding: 0 21px 20px;
}
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px;
}
.modal-month,
.modal-division,
.modal-rate,
.modal-amount,
.modal-container { grid-column: span 3; }
.modal-quantity-pair {
  grid-column: span 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.modal-occupied-pm input,
.modal-quantity input { width: calc(10ch + 22px) !important; }
.modal-rate { grid-column: 7 / span 3; }
.modal-amount { grid-column: 10 / span 3; }
.modal-client { grid-column: span 6; }
.modal-service,
.modal-warehouse,
.modal-pad { grid-column: span 3; }
.modal-other-costs,
.modal-total-costs,
.modal-profit,
.modal-profit-per-m2 { grid-column: span 3; }
.charges-table { min-width: 1460px; }
.charges-table th { padding: 5px 6px; }
.charges-table td { padding: 4px 6px; line-height: 16px; }
.charges-table td.row-actions-cell { padding: 0 !important; vertical-align: middle !important; }
.charges-table-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--dark);
}
.charges-columns {
  position: relative; flex: 0 0 auto; height: 36px; margin: 0 0 20px;
  overflow: visible;
}
.charges-columns summary {
  cursor: pointer; list-style: none; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--dark); font-size: 12px; font-weight: 700;
}
.charges-columns summary::-webkit-details-marker { display: none; }
.charges-columns-menu {
  position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; width: 220px;
  display: none; gap: 7px; max-height: min(420px, calc(100vh - 120px)); overflow-y: auto;
  padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; box-shadow: 0 10px 24px rgba(28, 43, 67, .16); font-size: 12px;
}
.charges-columns[open] .charges-columns-menu { display: grid; }
.charges-columns-menu label { display: flex; align-items: center; gap: 7px; color: var(--dark); }
.charges-columns-actions { display: flex; gap: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.charges-columns-actions .btn { min-height: 28px; padding: 4px 7px; font-size: 11px; }
.charges-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 14px;
}
.charges-summary > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.charges-summary span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.charges-summary strong { color: var(--dark); font-size: 16px; font-variant-numeric: tabular-nums; }
.charges-sort { display: block; color: inherit; text-decoration: none; }
.charges-sort:hover { color: var(--blue); }
.charges-group-row th {
  position: sticky; top: 0; z-index: 5; padding-block: 7px; background: #f7f9fc;
  text-align: center; color: var(--dark); border-bottom: 1px solid var(--line);
}
.charges-table thead tr:nth-child(2) th {
  position: sticky; top: 30px; z-index: 5; background: #fff;
}
.charges-table .charges-actions-heading,
.charges-table .charges-sticky-actions {
  position: sticky; right: 0; z-index: 4; width: 48px; min-width: 48px; max-width: 48px;
  padding-inline: 4px !important; background: #fff; box-shadow: -2px 0 4px rgba(28, 43, 67, .08);
}
.charges-table .charges-actions-heading { z-index: 6; background: #f7f9fc; }
.charges-table .charges-sticky-actions.open { z-index: 5; }
.charges-table .charges-sticky-client {
  position: sticky; left: 0; z-index: 3; background: #fff; box-shadow: 2px 0 4px rgba(28, 43, 67, .08);
}
.charges-table thead .charges-sticky-client { z-index: 6; }
.charges-table tbody tr:hover .charges-sticky-client,
.charges-table tbody tr:hover .charges-sticky-actions { background: #f7fafd; }
@media (max-width: 1100px) {
  .charges-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .charges-table-toolbar { align-items: flex-start; }
  .charges-summary { grid-template-columns: 1fr 1fr; }
}
.modal-client-picker {
  position: relative;
}
.modal-client-picker input {
  padding-right: 34px;
}
.modal-client-picker::after {
  position: absolute;
  top: 20px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #617087;
  border-bottom: 1.5px solid #617087;
  content: "";
  pointer-events: none;
  transform: rotate(45deg) translateY(-3px);
}
.modal-client-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 39, 64, 0.13);
}
.modal-client-picker.open .modal-client-options {
  display: block;
}
.modal-client-options button {
  display: block;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  color: #233148;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.modal-client-options button:last-child {
  border-bottom: 0;
}
.modal-client-options button:hover,
.modal-client-options button:focus {
  background: #eef5fb;
  color: #0a579a;
  outline: 0;
}
.modal-client-options button[hidden] {
  display: none;
}
.modal-client-no-results { padding: 10px; color: #64748a; font-size: 12px; }
.modal-form-grid .fld {
  min-width: 0;
  gap: 0;
}
.modal-form-grid .fld input,
.modal-form-grid .fld select {
  width: 100%;
  height: 38px;
  min-height: 38px;
  margin-top: 5px;
  margin-bottom: 0;
  padding: 8px 10px;
  border-color: #d8dee7;
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
}
.modal-form-grid .fld input[readonly] {
  background: #f8fafc;
  color: #68778c;
}
.modal-form-grid input[type="month"] {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
  line-height: 20px;
}
.modal-form-grid input[type="month"]::-webkit-calendar-picker-indicator {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0.72;
  vertical-align: middle;
}
.modal-form-grid .fld label {
  color: #536174;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
.modal-hint {
  display: block;
  min-height: 13px;
  margin-top: 2px;
  color: #8d98a7;
  font-size: 9px;
  line-height: 13px;
}
.modal-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 11px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.modal-confirm input {
  width: auto !important;
}
.charge-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 15px;
  border-top: 1px solid #e2e7ed;
}
.charge-modal-form .charge-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-inline: -21px;
  padding-inline: 21px;
  background: rgba(255, 255, 255, .97);
}
.charge-modal-actions .btn {
  width: auto;
  min-height: 36px;
  padding-inline: 14px;
}
.filter-grid .btn.ghost {
  color: #5f6d7f;
  border-color: #e2e7ed;
}

/* Отдельный рабочий экран руководителя по согласованному макету. */
.dashboard-page {
  background: #f4f6f9;
}
.dashboard-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}
.dashboard-top {
  min-height: 74px;
  padding: 7px 10px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.dashboard-crumb {
  color: #6f829a;
  font-size: 11px;
  line-height: 16px;
}
.dashboard-top h1 {
  color: #08275b;
  font-size: 25px;
  line-height: 31px;
  font-weight: 800;
  letter-spacing: -0.7px;
}
.dashboard-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 3px;
}
.dashboard-status,
.dashboard-help {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe5ec;
  border-radius: 18px;
  background: #fff;
  color: #657b98;
  box-shadow: 0 1px 2px rgba(13, 42, 81, 0.03);
}
.dashboard-status {
  padding: 0 13px;
  font-size: 11px;
  white-space: nowrap;
}
.dashboard-status i {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #1e9e5a;
}
.dashboard-help {
  width: 34px;
  padding: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}
.dashboard-wrap {
  padding: 0 10px 36px;
}
.dashboard-page .filter-actions .dashboard-apply {
  background: #095aa4;
}
.dashboard-page .filter-actions .dashboard-apply:hover {
  background: #084d8c;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fld label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.fld input,
.fld select,
.fld textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  outline: 2px solid var(--blue-10);
  border-color: var(--blue);
}
.fld .note {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}
textarea {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* Таблицы */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f8;
}
tr:hover td {
  background: #f7fafd;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tr.err td {
  background: #fdf1f0;
}
tr.warnrow td {
  background: #fdf8ec;
}
tr.total td {
  font-weight: 800;
  border-top: 2px solid var(--line);
  background: #fff;
}

/* Бейджи */
.b {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.b-g {
  background: #e3f5ec;
  color: var(--green);
}
.b-y {
  background: #fdf3dc;
  color: #9a6f00;
}
.b-r {
  background: #fbe6e4;
  color: var(--red);
}
.b-bl {
  background: var(--blue-10);
  color: var(--blue);
}
.b-dark {
  background: var(--dark);
  color: #fff;
}
.b-gr {
  background: #eef1f6;
  color: var(--muted);
}

/* Уведомления */
.alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.alert.ok {
  background: #e3f5ec;
  border-color: var(--green);
}
.alert.wr {
  background: #fdf3dc;
  border-color: var(--yellow);
}
.alert.er {
  background: #fbe6e4;
  border-color: var(--red);
}

.charge-toast {
  position: fixed;
  z-index: 100;
  left: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 11px 16px;
  border: 1px solid #b9e2ca;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 39, 64, .16);
  color: #17633a;
  font-size: 13px;
  font-weight: 700;
  animation: toast-in .22s ease-out both;
  transition: opacity .25s ease, transform .25s ease;
}
.charge-toast::before {
  content: "✓";
  display: grid;
  width: 18px;
  height: 18px;
  margin-right: 9px;
  place-items: center;
  border-radius: 50%;
  background: #1d9a58;
  color: #fff;
  font-size: 12px;
}
.charge-toast.is-hidden { opacity: 0; transform: translateY(10px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .charge-toast { left: 14px; bottom: 14px; }
}

/* Раскрытая форма */
.inline-form {
  border: 1px dashed var(--blue);
  background: #f8fbfe;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.inline-form .ttl {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 10px;
}
.pager {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
}
.pager span,
.pager a {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}
.pager .cur {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
}
.tabs a {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tabs a.on {
  color: var(--dark);
  border-bottom-color: var(--blue);
}

/* Ошибки валидации в формах */
.fld-err input,
.fld-err select,
.fld-err textarea {
  border-color: var(--red);
  outline-color: var(--red);
}
.err-msg {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
}

/* Неактивные строки справочников */
tr.inactive td {
  color: var(--muted);
  background: #fafbfc;
}

.btn.danger {
  background: var(--red);
  color: #fff;
}
.btn.danger:hover {
  background: #b42318;
}

/* Блок склада с раскрывающимися площадками */
details.wh-block summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  list-style: none;
}
details.wh-block summary::-webkit-details-marker {
  display: none;
}
details.wh-block summary::before {
  content: "▸";
  color: var(--muted);
  font-weight: 400;
}
details.wh-block[open] summary::before {
  content: "▾";
}
details.wh-block summary .wh-name {
  color: var(--dark);
  text-decoration: none;
}
details.wh-block summary .wh-name:hover {
  text-decoration: underline;
}
details.wh-block summary .wh-meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
details.wh-block summary + .table-scroll {
  margin-top: 12px;
}
details.wh-block.inactive summary {
  color: var(--muted);
}
details.wh-block.inactive summary .wh-name {
  color: var(--muted);
}

/* Дашборд: мини-бары в таблице топ-10 */
.bar-cell {
  min-width: 160px;
}
.mbar {
  height: 8px;
  border-radius: 4px;
  background: var(--blue);
  display: inline-block;
  vertical-align: middle;
}

/* Мобильная версия: навигация не занимает рабочую область, широкие таблицы
   прокручиваются только внутри панели. */
@media (max-width: 768px) {
  body {
    display: block;
  }
  .side {
    width: 100%;
    height: auto;
    min-height: 0;
    position: static;
  }
  .side .logo {
    padding: 10px 16px;
  }
  .side .logo span,
  .side .foot {
    display: none;
  }
  .side nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }
  .side nav a {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .side nav a.on {
    border-bottom-color: #fff;
  }
  .top {
    padding: 10px 16px;
  }
  .top .crumb,
  .top .user {
    display: none;
  }
  .wrap {
    padding: 16px 12px 28px;
  }
  .panel {
    padding: 14px;
    border-radius: 10px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .card {
    padding: 12px;
  }
  .card .v {
    font-size: 18px;
  }
  .frow {
    align-items: stretch;
  }
  .frow .fld {
    flex: 1 1 calc(50% - 6px);
    min-width: 0 !important;
  }
  .frow .btn,
  .frow > a.btn {
    margin-top: 0 !important;
  }
  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .segmented {
    overflow-x: auto;
  }
  .charges-add {
    align-self: flex-end;
  }
  .modal-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-month,
  .modal-client,
  .modal-division,
  .modal-service,
  .modal-warehouse,
  .modal-pad,
  .modal-quantity-pair,
  .modal-occupied-pm,
  .modal-quantity,
  .modal-rate,
  .modal-amount,
  .modal-container,
  .modal-other-costs,
  .modal-total-costs,
  .modal-profit,
  .modal-profit-per-m2 {
    grid-column: span 1;
  }
  .filter-grid.filters-6,
  .filter-grid.filters-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
  .filter-actions {
    justify-content: flex-end;
  }
  .filter-actions .btn {
    width: 100%;
    text-align: center;
  }
  .table-scroll table {
    min-width: 620px;
  }
  .pager {
    overflow-x: auto;
    padding-bottom: 2px;
  }
  details.wh-block summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .frow .fld {
    flex-basis: 100%;
  }
  .filter-grid.filters-6,
  .filter-grid.filters-4 {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .charges-add {
    align-self: stretch;
    width: 100%;
  }
  .modal-form-grid {
    grid-template-columns: 1fr;
  }
  .chart-sm {
    height: 180px;
  }
  .chart-lg {
    height: 250px;
  }
  .frow .btn,
  .frow > a.btn {
    width: 100%;
    text-align: center;
  }
}

/* Charge modal sections: one consistent responsive grid for create and edit. */
.modal-form-grid { display: block; }
.modal-section { margin: 0; padding: 0 0 16px; }
.modal-section + .modal-section { padding-top: 14px; border-top: 1px solid #e2e7ed; }
.modal-section h3 {
  margin: 0 0 10px; color: #536174; font-size: 12px; font-weight: 800;
  letter-spacing: .02em; text-transform: uppercase;
}
.modal-section-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px;
}
.modal-main-grid .modal-month { grid-column: span 1; }
.modal-main-grid .modal-client { grid-column: span 2; }
.modal-main-grid .modal-service,
.modal-main-grid .modal-warehouse,
.modal-main-grid .modal-pad,
.modal-main-grid .modal-division,
.modal-main-grid .modal-container { grid-column: span 1; }
.modal-volume-grid > .fld { grid-column: span 1; }
.modal-volume-grid .modal-rate,
.modal-costs-grid > .fld,
.modal-result-grid > .fld { grid-column: span 1; }
.modal-section .modal-quantity-pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px;
}
.modal-section .modal-quantity-pair .fld { min-width: 0; }
.modal-section .modal-quantity-pair input { width: 100% !important; }
.modal-hint {
  display: block; min-height: 13px; margin-top: 2px; color: #8995a5;
  font-size: 10px; line-height: 13px;
}
.modal-pad select:disabled { color: #a0aaba; background: #f8fafc; cursor: not-allowed; }
@media (max-width: 900px) {
  .modal-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-main-grid .modal-client { grid-column: span 2; }
  .modal-volume-grid > .fld { grid-column: span 1; }
}
@media (max-width: 640px) {
  .charge-modal { padding: 12px; }
  .charge-modal-card { max-height: calc(100vh - 24px); }
  .charge-modal-head, .charge-modal-form { padding-inline: 15px; }
  .modal-section-grid { grid-template-columns: 1fr; }
  .modal-main-grid .modal-client,
  .modal-main-grid .modal-month,
  .modal-main-grid .modal-service,
  .modal-main-grid .modal-warehouse,
  .modal-main-grid .modal-pad,
  .modal-main-grid .modal-division,
  .modal-main-grid .modal-container,
  .modal-volume-grid > .fld,
  .modal-costs-grid > .fld,
  .modal-result-grid > .fld { grid-column: span 1; }
}
 .charge-import-preview { margin: 16px 0; }
.charge-import-summary { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.charge-import-summary > div { padding: 10px 12px; border: 1px solid var(--pico-muted-border-color, #d8e0eb); border-radius: 8px; background: #fff; }
.charge-import-summary span, .charge-import-summary strong { display: block; }
.charge-import-summary span { color: #64748b; font-size: .82rem; }
.charge-import-info { color: #64748b; font-size: .9rem; }
@media (max-width: 760px) { .charge-import-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); } }
