:root {
  --page: #eef3ec;
  --surface: #ffffff;
  --surface-soft: #f7faf6;
  --ink: #18211d;
  --muted: #657069;
  --line: #dce5da;
  --line-strong: #c8d5c5;
  --accent: #bce84c;
  --accent-strong: #a7d638;
  --accent-soft: #effbd1;
  --green: #2d714d;
  --green-soft: #e6f6ea;
  --yellow: #946800;
  --yellow-soft: #fff5ce;
  --red: #b83b49;
  --red-soft: #fff0f1;
  --blue: #3e68c7;
  --blue-soft: #edf2ff;
  --shadow: 0 18px 55px rgba(24, 33, 29, 0.08);
  --shadow-small: 0 7px 24px rgba(24, 33, 29, 0.07);
  --radius-xl: 28px;
  --radius: 20px;
  --radius-small: 13px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(188, 232, 76, 0.2), transparent 24rem),
    var(--page);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(117, 156, 21, 0.35);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(200, 213, 197, 0.85);
  background: rgba(238, 243, 236, 0.93);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1460px);
  min-height: 70px;
  margin: 0 auto;
  padding: 10px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  filter: drop-shadow(0 5px 9px rgba(24, 33, 29, 0.12));
}

.brand__copy {
  display: grid;
  line-height: 1.1;
}

.brand__copy strong {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand__copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.session-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a0aaa3;
}

.status-dot.is-ok {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.status-dot.is-busy {
  background: #86ad22;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease;
}

.telegram-link:hover {
  background: #29352f;
  transform: translateY(-1px);
}

.shell {
  width: min(100%, 1460px);
  margin: 0 auto;
  padding: 30px 28px 42px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #567010;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.launch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  gap: 44px;
  align-items: center;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid rgba(188, 232, 76, 0.7);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 5%, rgba(188, 232, 76, 0.45), transparent 32%),
    var(--surface);
  box-shadow: var(--shadow);
}

.launch-card__intro h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(35px, 4vw, 58px);
  font-weight: 880;
  letter-spacing: -0.052em;
  line-height: 1;
}

.launch-card__intro > p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 18px;
}

.launch-card__note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 590px;
  color: #4f5d54;
  font-size: 13px;
}

.launch-card__note > span:first-child {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.job-form {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-small);
}

.field {
  display: grid;
  gap: 7px;
}

.field__label {
  color: #435048;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.search-field input,
.result-filter__search input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.search-field input:focus,
.result-filter__search input:focus {
  border-color: #8db226;
  box-shadow: 0 0 0 4px rgba(188, 232, 76, 0.24);
}

.field input::placeholder,
.search-field input::placeholder,
.result-filter__search input::placeholder {
  color: #9ca59f;
}

.field--token {
  margin-bottom: 8px;
}

.token-control {
  position: relative;
  display: block;
}

.token-control input {
  padding-right: 94px;
}

.token-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: #46534b;
  font-size: 12px;
  font-weight: 800;
}

.token-guidance {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #dbe7c0;
  border-radius: 11px;
  background: #f7fbe9;
  color: #59645c;
  font-size: 11px;
  line-height: 1.45;
}

.token-guidance a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #49640d;
  font-weight: 850;
  text-underline-offset: 3px;
}

.token-guidance a:hover {
  color: #2e4300;
}

.date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 17px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 820;
  line-height: 1.15;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--primary {
  background: var(--ink);
  color: #fff;
}

.button--primary:hover:not(:disabled) {
  background: #2b3831;
}

.button--secondary {
  border-color: var(--line-strong);
  background: #fff;
}

.button--small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.button--full {
  width: 100%;
}

.job-form .button--primary {
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--ink);
}

.job-form .button--primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.job-form__hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.form-message,
.global-message {
  border: 1px solid #efc7cc;
  border-radius: 12px;
  background: var(--red-soft);
  color: #842a35;
}

.form-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.global-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 15px 17px;
}

.global-message > div {
  display: grid;
  gap: 3px;
}

.global-message strong {
  font-size: 14px;
}

.global-message span {
  font-size: 13px;
}

.progress-card {
  margin-top: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.progress-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.progress-card__heading h2 {
  margin-bottom: 5px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.progress-card__heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.status-label,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.status-label.is-ok {
  border-color: #b9dfc5;
  background: var(--green-soft);
  color: var(--green);
}

.status-label.is-busy {
  border-color: #d8eaa7;
  background: var(--accent-soft);
  color: #526b12;
}

.status-label.is-warning {
  border-color: #efdc9a;
  background: var(--yellow-soft);
  color: var(--yellow);
}

.status-label.is-error {
  border-color: #efc7cc;
  background: var(--red-soft);
  color: var(--red);
}

.progress-track {
  width: 100%;
  height: 9px;
  margin-top: 21px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8ede6;
  accent-color: var(--accent-strong);
}

.progress-track::-webkit-progress-bar {
  border-radius: 999px;
  background: #e8ede6;
}

.progress-track::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb52b, var(--accent));
}

.progress-track::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb52b, var(--accent));
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 0;
  margin: 19px 0 12px;
  list-style: none;
}

.stage-list li {
  position: relative;
  padding: 8px 8px 8px 25px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.stage-list li::before {
  position: absolute;
  top: 11px;
  left: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b7c0ba;
  content: "";
}

.stage-list li.is-done {
  background: var(--green-soft);
  color: var(--green);
}

.stage-list li.is-done::before {
  background: var(--green);
}

.stage-list li.is-active {
  background: var(--accent-soft);
  color: #526b12;
}

.stage-list li.is-active::before {
  background: #7ea122;
  box-shadow: 0 0 0 3px rgba(188, 232, 76, 0.38);
}

.stage-list li.is-error {
  background: var(--red-soft);
  color: var(--red);
}

.stage-list li.is-error::before {
  background: var(--red);
}

.delete-job-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: #c0c9c2;
  text-underline-offset: 3px;
}

.delete-job-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.workspace {
  margin-top: 22px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-heading {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 24px;
}

/* Дата и склады — одна пара. Выравниваем по ВЕРХУ: у даты снизу есть
   пояснение, и при выравнивании по низу подписи разъезжались по высоте. */
.workspace-filters {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}

.workspace-filters .result-filter__title {
  min-height: 15px;
}

.workspace-heading h2 {
  margin-bottom: 5px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.workspace-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-filter {
  position: relative;
  width: min(100%, 370px);
  flex: 0 0 370px;
}

.result-filter--date {
  width: min(100%, 210px);
  flex: 0 1 210px;
}

.result-filter--date select {
  width: 100%;
  height: 55px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 780;
  outline: none;
}

.result-filter--date select:focus {
  border-color: #8db226;
  box-shadow: 0 0 0 4px rgba(188, 232, 76, 0.24);
}

.result-filter--date select:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

.result-filter__note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.result-filter__title {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-filter__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 55px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  text-align: left;
}

.result-filter__trigger > span:first-child {
  display: grid;
  min-width: 0;
}

.result-filter__trigger strong,
.result-filter__trigger small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-filter__trigger strong {
  font-size: 14px;
}

.result-filter__trigger small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.result-filter__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 100%;
  min-width: 330px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(24, 33, 29, 0.18);
}

.result-filter__search input {
  min-height: 42px;
  font-size: 13px;
}

.result-filter__toolbar,
.result-filter__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-filter__toolbar {
  margin: 9px 1px;
}

.result-filter__toolbar button,
.result-filter__footer button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #4e6810;
  font-size: 12px;
  font-weight: 820;
}

.result-filter__options {
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.result-filter__option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 7px 10px;
  border-bottom: 1px solid #edf1ec;
  cursor: pointer;
  font-size: 13px;
}

.result-filter__option:last-child {
  border-bottom: 0;
}

.result-filter__option:hover,
.result-filter__option.is-selected {
  background: var(--accent-soft);
}

.result-filter__option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #72931c;
}

.result-filter__empty {
  margin: 9px 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.result-filter__footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.result-filter__footer button {
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
}

.tabs {
  display: flex;
  gap: 5px;
  margin: 24px -2px 0;
  padding: 5px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--surface-soft);
  scrollbar-width: thin;
}

.tab {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 13px rgba(24, 33, 29, 0.14);
}

.panel {
  padding-top: 23px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.metric-card {
  min-height: 145px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-soft);
}

.metric-card:first-child {
  border-color: rgba(188, 232, 76, 0.9);
  background: linear-gradient(145deg, var(--accent-soft), #fff);
}

.metric-card > span,
.metric-card > strong,
.metric-card > small {
  display: block;
}

.metric-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card > strong {
  margin: 16px 0 8px;
  overflow: hidden;
  font-size: clamp(25px, 2.4vw, 38px);
  font-weight: 880;
  letter-spacing: -0.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card > small {
  color: var(--muted);
  font-size: 11px;
}

.metric-card--placeholder {
  opacity: 0.62;
}

.distribution-card,
.dynamics-card {
  margin-top: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.panel-heading h3 {
  margin-bottom: 3px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-heading--tools,
.panel-heading--actions {
  align-items: flex-end;
}

.panel-heading--tools > div:first-child,
.panel-heading--actions > div:first-child {
  margin-right: auto;
}

.panel-heading--subsection {
  margin-top: 24px;
}

.panel-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.warehouse-distribution {
  display: grid;
  gap: 10px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(130px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.distribution-row__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-row progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: #edf1eb;
  accent-color: #93bb2c;
}

.distribution-row progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #edf1eb;
}

.distribution-row progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, #75991a, var(--accent));
}

.distribution-row progress::-moz-progress-bar {
  border-radius: 99px;
  background: linear-gradient(90deg, #75991a, var(--accent));
}

.distribution-row__value {
  min-width: 94px;
  color: #465149;
  font-size: 12px;
  font-weight: 820;
  text-align: right;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #eaf0e8;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: #667169;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdfb;
}

.cell-name,
.cell-sub {
  display: block;
}

.cell-name {
  font-weight: 800;
}

.cell-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.table-empty,
.empty-state {
  padding: 27px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.search-field {
  width: min(100%, 280px);
}

.search-field input {
  min-height: 40px;
  font-size: 13px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.product-actions > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 220px;
  margin-right: auto;
}

.product-actions strong {
  font-size: 12px;
}

.product-actions span {
  color: var(--muted);
  font-size: 10px;
}

.access-card {
  max-width: 520px;
  margin: 0 auto 22px;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.access-card h1 {
  margin: 6px 0 10px;
  font-size: 22px;
}

.access-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.access-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.access-form input {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-card__bot {
  display: inline-block;
  margin-top: 16px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cost-steps {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.cost-steps__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.cost-steps__head strong {
  font-size: 14px;
}

.cost-steps__list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cost-steps__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.cost-steps__list li > div {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.cost-steps__list b {
  font-size: 13px;
}

.cost-steps__list small {
  color: var(--muted);
  font-size: 11px;
}

.cost-steps__num {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 820;
}

.cost-steps__hint {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 640px) {
  .cost-steps__list li {
    flex-wrap: wrap;
  }

  .cost-steps__head {
    flex-wrap: wrap;
  }
}

.risk-note {
  margin: 6px 0 0;
  padding-left: 16px;
  position: relative;
  color: var(--muted);
  font-size: 11.5px;
}

.risk-note::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

/* Концентрация остатка на одном складе — красным по всей строке. */
.product-breakdown__cell.is-risk,
tbody tr.is-risk td {
  color: var(--red);
  background: var(--red-soft);
}

.product-breakdown__cell.is-risk strong,
tbody tr.is-risk td .cell-name {
  color: var(--red);
}

.warehouse-chip.is-risk {
  border-color: #f0c2c6;
  background: var(--red-soft);
  color: var(--red);
}

.source-hint {
  margin: -4px 0 14px;
  padding: 9px 12px;
  border: 1px solid #efdc9a;
  border-radius: 11px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 750;
}

.source-hint--draft {
  border-color: #cfe59a;
  background: rgba(188, 232, 76, 0.18);
  color: #4a6111;
}

.supply-list {
  display: grid;
  gap: 9px;
}

.supply-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.supply-card__summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
}

.supply-card__toggle {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(170px, 1.4fr) minmax(130px, 0.9fr) minmax(90px, 0.6fr) 24px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.supply-card__toggle:hover {
  background: var(--surface-soft);
}

.supply-card__toggle > span:not(.supply-card__chevron) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.supply-card__toggle small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.supply-card__toggle strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supply-card__chevron {
  color: #607069;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.supply-card__details {
  border-top: 1px solid var(--line);
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.switch-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #72931c;
}

.product-list {
  display: grid;
  gap: 10px;
}

.product-card {
  display: grid;
  grid-template-columns: 74px minmax(190px, 1.15fr) minmax(300px, 1.35fr) minmax(205px, 0.8fr) auto;
  gap: 15px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-small);
}

.product-thumb {
  display: grid;
  width: 68px;
  height: 78px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, #f3f6f1, #e9efe7);
  color: #89938c;
  font-size: 10px;
  font-weight: 800;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb.is-placeholder::after {
  content: "Нет фото";
}

.product-card__identity {
  min-width: 0;
}

.product-card__identity h4 {
  margin-bottom: 5px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card__identity p {
  margin-bottom: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card__identity small {
  color: #4d5a51;
  font-size: 10px;
  font-weight: 750;
}

.product-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-card__metric {
  display: grid;
  gap: 3px;
}

.product-card__metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.product-card__metric strong {
  font-size: 15px;
  font-weight: 860;
}

.product-cost-editor {
  display: grid;
  gap: 5px;
}

.product-cost-editor > label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.product-cost-editor > div {
  display: flex;
  gap: 5px;
}

.product-cost-editor input {
  width: min(100%, 120px);
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  font-size: 12px;
}

.product-cost-editor input:focus {
  border-color: #8db226;
  box-shadow: 0 0 0 3px rgba(188, 232, 76, 0.2);
}

.product-cost-editor input.is-draft {
  border-color: #8db226;
  background: rgba(188, 232, 76, 0.14);
}

.product-cost-editor input.is-invalid {
  border-color: var(--red, #d0342c);
  background: rgba(208, 52, 44, 0.08);
}

.product-card .warehouse-chips {
  grid-column: 2 / 5;
  grid-row: 2;
}

.warehouse-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.warehouse-chip {
  display: inline-flex;
  max-width: 160px;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  overflow: hidden;
  border: 1px solid #d8e7ad;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4c6117;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card__toggle {
  grid-column: 5;
  grid-row: 2;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: #4d5a51;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.product-breakdown {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.product-breakdown__grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) repeat(5, minmax(96px, 0.6fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}

.product-breakdown__cell {
  padding: 8px 10px;
  background: #fff;
  font-size: 11px;
}

.product-breakdown__cell.is-heading {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dynamics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.segmented-control__item {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.segmented-control__item.is-active {
  background: var(--ink);
  color: #fff;
}

.dynamics-layout {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 17px;
  min-height: 350px;
}

.dynamics-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 350px;
  overflow-y: auto;
}

.dynamics-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #48544c;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.dynamics-legend__item:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.dynamics-legend__item[aria-pressed="false"] {
  opacity: 0.48;
}

.dynamics-legend__item[aria-pressed="false"] > span:last-child {
  text-decoration: line-through;
}

.dynamics-legend__dot,
.dynamics-table__dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--series-color, #657069);
}

.series-color-0 { background: #34871d; }
.series-color-1 { background: #1d60bc; }
.series-color-2 { background: #d5584d; }
.series-color-3 { background: #9d58ba; }
.series-color-4 { background: #d27900; }
.series-color-5 { background: #972767; }
.series-color-6 { background: #8c8300; }
.series-color-7 { background: #0b999b; }

.dynamics-chart {
  position: relative;
  min-width: 0;
  min-height: 350px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, #fcfdfc, #f7faf6);
}

.dynamics-chart svg {
  display: block;
  width: 100%;
  height: 350px;
  touch-action: manipulation;
}

.dynamics-chart__empty {
  display: grid;
  min-height: 350px;
  place-items: center;
  padding: 25px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.dynamics-grid-line {
  stroke: #dde5dc;
  stroke-width: 1;
}

.dynamics-zero-line {
  stroke: #a8b3aa;
  stroke-width: 1.2;
}

.dynamics-axis-label {
  fill: #77827a;
  font-size: 10px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.dynamics-series-line {
  fill: none;
  stroke: var(--series-color, #657069);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dynamics-series-area {
  stroke: none;
}

.dynamics-series-orphan {
  fill: var(--series-color, #657069);
}

.dynamics-series-label {
  fill: var(--ink);
  font-size: 10.5px;
  font-weight: 750;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.dynamics-crosshair {
  stroke: #9aa79d;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.dynamics-series-marker {
  fill: #fff;
  stroke: var(--series-color, #657069);
  stroke-width: 2.5;
  pointer-events: none;
}

.dynamics-hit {
  fill: transparent;
  cursor: crosshair;
}

.dynamics-hit:focus {
  fill: rgba(24, 33, 29, 0.05);
  outline: none;
}

.dynamics-tooltip {
  position: absolute;
  z-index: 5;
  width: max-content;
  min-width: 190px;
  max-width: min(270px, calc(100% - 16px));
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(24, 33, 29, 0.96);
  box-shadow: 0 10px 28px rgba(24, 33, 29, 0.2);
  color: #fff;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.dynamics-tooltip__date {
  margin-bottom: 2px;
  color: #cbd4ce;
  font-size: 10px;
}

.dynamics-tooltip > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.dynamics-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 3px;
}

.dynamics-tooltip__row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd4ce;
}

.dynamics-tooltip__row span i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.dynamics-tooltip__row b {
  font-weight: 850;
}

.dynamics-tooltip__row b.number-positive {
  color: #c9ed70;
}

.dynamics-tooltip__row b.number-negative {
  color: #ff9aa5;
}

.dynamics-tooltip__hint {
  display: block;
  margin-top: 8px;
  color: #aeb9b1;
  font-size: 9px;
}

.dynamics-table__warehouse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.number-positive {
  color: var(--green);
  font-weight: 800;
}

.number-negative {
  color: var(--red);
  font-weight: 800;
}

.report-list {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.report-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.report-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.report-card strong {
  font-size: 13px;
}

.report-card small {
  color: var(--muted);
  font-size: 11px;
}

.report-origin {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  white-space: nowrap;
}

.report-origin.is-original {
  background: var(--green-soft);
  color: var(--green);
}

@media (max-width: 640px) {
  .report-card {
    flex-wrap: wrap;
  }
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.footer a {
  font-weight: 800;
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  max-width: min(430px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid #bfd0bb;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 17px 50px rgba(24, 33, 29, 0.24);
  font-size: 13px;
  font-weight: 740;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: #dc8993;
  background: #7f2631;
}

@media (max-width: 1120px) {
  .launch-card {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
    gap: 28px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card {
    grid-template-columns: 74px minmax(180px, 1fr) minmax(285px, 1.2fr) minmax(195px, 0.8fr);
  }

  .product-card .warehouse-chips {
    grid-column: 2 / 4;
  }

  .product-card__toggle {
    grid-column: 4;
  }
}

@media (max-width: 860px) {
  .site-header__inner,
  .shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .session-status {
    display: none;
  }

  .launch-card {
    grid-template-columns: 1fr;
  }

  .launch-card__intro h1 {
    max-width: 680px;
  }

  .workspace-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .result-filter {
    width: 100%;
    flex-basis: auto;
  }

  .result-filter__panel {
    right: auto;
    left: 0;
  }

  .panel-heading--tools,
  .panel-heading--actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .panel-heading--tools > div:first-child,
  .panel-heading--actions > div:first-child {
    width: 100%;
  }

  .panel-action-group,
  .product-actions {
    width: 100%;
  }

  .product-actions {
    flex-wrap: wrap;
  }

  .product-actions > div:first-child {
    width: 100%;
  }

  .supply-card__toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 24px;
  }

  .supply-card__chevron {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .search-field {
    width: min(100%, 360px);
  }

  .dynamics-layout {
    grid-template-columns: 1fr;
  }

  .dynamics-legend {
    flex-flow: row wrap;
    max-height: none;
  }

  .dynamics-legend__item {
    min-height: 26px;
  }
}

@media (max-width: 650px) {
  body {
    font-size: 15px;
  }

  .site-header__inner {
    min-height: 62px;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand__copy small {
    display: none;
  }

  .telegram-link {
    min-height: 36px;
    padding: 0 11px;
    font-size: 11px;
  }

  .shell {
    padding-top: 17px;
    padding-bottom: 30px;
  }

  .launch-card,
  .workspace {
    padding: 18px;
    border-radius: 21px;
  }

  .launch-card__intro h1 {
    font-size: 35px;
  }

  .launch-card__intro > p:not(.eyebrow) {
    font-size: 16px;
  }

  .job-form {
    padding: 16px;
  }

  .date-fields {
    grid-template-columns: 1fr;
  }

  .progress-card {
    padding: 18px;
  }

  .progress-card__heading {
    flex-direction: column;
    gap: 10px;
  }

  .stage-list {
    grid-template-columns: 1fr;
  }

  .stage-list li {
    min-height: 33px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 120px;
  }

  .distribution-row {
    grid-template-columns: minmax(110px, 1fr) auto;
    gap: 8px;
  }

  .distribution-row progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-heading:not(.panel-heading--tools):not(.panel-heading--actions) {
    flex-direction: column;
  }

  .product-card {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 11px;
  }

  .product-thumb {
    width: 62px;
    height: 72px;
  }

  .product-card__metrics {
    grid-column: 2 / 4;
  }

  .product-cost-editor {
    grid-column: 1 / -1;
  }

  .product-card .warehouse-chips {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .product-card__toggle {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .supply-card__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .supply-card__toggle {
    grid-template-columns: 1fr 1fr;
  }

  .supply-card__chevron {
    display: none;
  }

  .product-breakdown__grid {
    grid-template-columns: 1fr 1fr;
  }

  .product-breakdown__cell.is-heading {
    display: none;
  }

  .dynamics-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dynamics-chart,
  .dynamics-chart svg,
  .dynamics-chart__empty {
    min-height: 300px;
    height: 300px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
