/* cyrillic-ext */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("./assets/fonts/golos-400-900-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("./assets/fonts/golos-400-900-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("./assets/fonts/golos-400-900-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;
}

/* cyrillic-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/plex-400-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/plex-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/plex-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;
}

/* cyrillic-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/plex-600-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/plex-600-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/plex-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;
}

/* cyrillic-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/plex-700-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/plex-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/plex-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;
}

/* ===========================================================================
   SAVDO — фирменная система «Накладная».
   Индиго-графит как корпоративный цвет, охра — единственный сигнал действия,
   моноширинный шрифт для всех чисел: сумм, номеров заказов, дат и балансов.
   Чтобы вернуть прежнюю зелёную палитру, замените значения --ink и --signal.
   =========================================================================== */

:root {
  color-scheme: light;

  /* Фирменные: глубокая хвоя как корпоративный цвет, изумруд как
     единственный акцент. Изумруд взят в двух светлотах — тёмный для
     текста (проходит AA), яркий для заливок, полос и графика. */
  --ink: #0e3a2c;
  --ink-strong: #072319;
  --ink-soft: #4a6a5d;
  --ink-faint: #7e968a;
  --signal: #07734a;
  --signal-bright: #10a066;
  --signal-soft: #dff3e9;

  /* Поверхности */
  --paper: #f2f5f3;
  --surface: #ffffff;
  --surface-soft: #e6ede9;
  --line: #dbe4df;
  --line-strong: #c3d0c9;

  /* Операционные статусы: одна дисциплинированная шкала */
  --st-new: #2a5fa6;
  --st-new-soft: #e6edf8;
  --st-work: #9a6a08;
  --st-work-soft: #fbeed3;
  --st-transit: #5b46a0;
  --st-transit-soft: #eae5f8;
  --st-done: #0d7a51;
  --st-done-soft: #dcf0e6;
  --st-fail: #a8332e;
  --st-fail-soft: #f8e0de;

  /* Совместимость со старыми именами токенов */
  --accent: var(--signal);
  --accent-soft: var(--signal-soft);
  --yellow: var(--st-work);
  --yellow-soft: var(--st-work-soft);
  --green: var(--st-done);
  --green-soft: var(--st-done-soft);
  --blue: var(--st-new);
  --blue-soft: var(--st-new-soft);
  --danger: var(--st-fail);
  --danger-soft: var(--st-fail-soft);

  /* Высота и форма */
  --shadow: 0 1px 2px rgba(14, 58, 44, 0.05), 0 10px 28px rgba(14, 58, 44, 0.07);
  --shadow-sticky: 0 1px 0 rgba(14, 58, 44, 0.06), 0 8px 24px rgba(14, 58, 44, 0.05);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 9px;
  --radius-sm: 6px;

  --font-ui: "Golos Text", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;

  /* Кривая и длительность для всей моторики интерфейса */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  font-family: var(--font-ui);
  font-feature-settings: "ss01";
}

/* Все числа — моноширинные, с табличными цифрами: суммы в столбцах
   выравниваются, номер заказа читается как номер накладной. */
.order-number,
.order-sum,
.stat-card .value,
.status,
.eyebrow,
.finance-balance strong,
.finance-breakdown strong,
.orders-counter-card strong,
.compact-stats-grid strong,
.profile-stat strong,
.ranking-place,
.product-total strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}


.payment-details label.payment-choice input[type="radio"],
.payment-method-grid label.payment-choice input[type="radio"] {
  box-sizing: border-box;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  border-radius: 50%;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    linear-gradient(180deg, var(--ink) 0%, var(--ink) 46%, var(--paper) 46%, var(--paper) 100%);
}

.login-card {
  display: grid;
  width: min(100%, 420px);
  gap: 18px;
  padding: 28px 26px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: 0 24px 60px rgba(14, 58, 44, 0.3);
}

.login-card h1 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.login-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.login-brand {
  position: absolute;
  top: 28px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-hint {
  color: var(--ink-soft);
  font-size: 9px;
}

/* Шапка входа лежит на фирменной плашке — текст выворотный. */
.login-brand strong {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-brand span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  letter-spacing: 0.04em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--ink-strong);
  color: #fff;
  background: var(--ink);
}

.topbar .brand-copy strong {
  color: #fff;
}

.topbar .brand-copy span,
.topbar .profile-button-copy small {
  color: rgba(255, 255, 255, 0.55);
}

.topbar .profile-button {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.topbar .profile-button.active {
  border-color: var(--signal);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.topbar .avatar {
  color: var(--ink-strong);
  background: var(--signal);
}

.topbar-notification-button {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.topbar-notification-button.active {
  border-color: var(--signal);
  background: rgba(255, 255, 255, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.brand-button:focus-visible {
  outline: 3px solid rgba(192, 115, 26, 0.38);
  outline-offset: 5px;
  border-radius: 10px;
}

.brand-button.active .brand-mark {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-strong);
  background: var(--signal);
  box-shadow: none;
}

.brand-mark svg {
  width: 23px;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-copy span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(52vw, 250px);
  padding: 6px 11px 6px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: white;
  box-shadow: 0 6px 18px rgba(14, 58, 44, 0.08);
  cursor: pointer;
}

.profile-button.active {
  border-color: var(--green);
  box-shadow: 0 8px 22px rgba(14, 58, 44, 0.14);
}

.profile-button-copy {
  min-width: 0;
  text-align: left;
}

.profile-button-copy strong,
.profile-button-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-button-copy strong {
  font-size: 10px;
}

.profile-button-copy small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 8px;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: white;
  background: linear-gradient(145deg, #0e3a2c, #072319);
  box-shadow: 0 18px 45px rgba(14, 58, 44, 0.2);
}

.profile-hero-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  top: -100px;
  right: -55px;
  border-radius: 50%;
  background: rgba(235, 200, 76, 0.2);
}

.profile-identity {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.profile-identity h2 {
  margin: 7px 0 3px;
  font-size: clamp(20px, 5vw, 27px);
  letter-spacing: -0.03em;
}

.profile-identity p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.profile-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dceee7;
  font-size: 9px;
  font-weight: 800;
}

.profile-status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fd69f;
  box-shadow: 0 0 0 4px rgba(95, 214, 159, 0.12);
  content: "";
}

.profile-login {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-login span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.profile-login strong {
  font-size: 12px;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.profile-stat {
  min-width: 0;
  padding: 15px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  background: white;
}

.profile-stat span,
.profile-stat strong {
  display: block;
}

.profile-stat span {
  min-height: 25px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.3;
}

.profile-stat strong {
  margin-top: 6px;
  font-size: clamp(14px, 4vw, 20px);
}

.profile-balance-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: var(--radius-xl);
  color: white;
  background: linear-gradient(145deg, var(--ink), #285b4d);
  box-shadow: 0 16px 36px rgba(14, 58, 44, 0.18);
}

.profile-balance-card span,
.profile-balance-card strong,
.profile-balance-card small {
  display: block;
}

.profile-balance-card > div > span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-balance-card > div > strong {
  margin: 6px 0;
  font-size: 28px;
}

.profile-balance-card > div > small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  line-height: 1.5;
}

.profile-balance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.profile-balance-breakdown > span {
  padding: 10px 7px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.09);
}

.profile-balance-breakdown small {
  min-height: 22px;
  font-size: 7px;
}

.profile-balance-breakdown strong {
  margin-top: 3px;
  font-size: 10px;
}

.profile-section {
  margin-bottom: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
}

.profile-detail-list {
  display: grid;
}

.profile-detail-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-detail-list > div:last-child {
  border-bottom: 0;
}

.profile-detail-list span {
  color: var(--ink-soft);
  font-size: 10px;
}

.profile-detail-list strong {
  font-size: 11px;
  text-align: right;
}

.profile-avatar-large {
  position: relative;
  z-index: 1;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 22px;
  font-weight: 900;
}

.profile-logout {
  margin: 4px 0 16px;
}

.settings-copy {
  margin: 12px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.integration-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 10px;
}

.integration-result.success {
  color: var(--green);
  background: var(--green-soft);
}

.integration-result.error {
  color: var(--danger);
  background: var(--danger-soft);
}

@media (max-width: 520px) {
  .target-card .finance-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .target-card .finance-breakdown > div:last-child {
    grid-column: 1 / -1;
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.content {
  width: min(100%, 1180px);
  min-width: 0;
  margin: 0 auto;
  padding: 22px 16px 36px;
}

.content > *,
.app-shell,
.topbar,
.welcome > div,
.section-head > div {
  min-width: 0;
}

.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 9px;
  padding-left: 11px;
  border-left: 2px solid var(--signal);
  color: var(--signal);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 7px;
  font-size: clamp(25px, 6.4vw, 38px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.028em;
}

.welcome p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.date-chip {
  display: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  min-height: 116px;
  padding: 15px 15px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.stat-card.featured {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

/* Тонкая охряная линия сверху вместо декоративного пятна: она отмечает
   карточку, за которой закреплён показатель дня. */
.stat-card.featured::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--signal);
  content: "";
}

.stat-card .label {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 30px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.stat-card.featured .label {
  color: rgba(255, 255, 255, 0.68);
}

.stat-card .value {
  position: relative;
  z-index: 1;
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(21px, 5.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.stat-card .change {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.stat-card.featured .change {
  color: var(--signal);
}

.stat-card .change.negative {
  color: var(--danger);
}

.stat-card .change.neutral {
  color: var(--ink-soft);
}

.stat-card.featured .change.negative {
  color: #ffb5ad;
}

.stat-card.featured .change.neutral {
  color: rgba(255, 255, 255, 0.62);
}

.section {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.text-button {
  padding: 7px 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 0 -16px 15px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.order-scope-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 15px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.orders-counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.orders-counter-card {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  background: white;
  box-shadow: 0 7px 20px rgba(14, 58, 44, 0.045);
}

.orders-counter-card.total {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.orders-counter-card span,
.orders-counter-card strong {
  display: block;
}

.orders-counter-card span {
  min-height: 25px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.3;
}

.orders-counter-card.total span {
  color: rgba(255, 255, 255, 0.68);
}

.orders-counter-card strong {
  margin-top: 5px;
  font-size: 22px;
}

.order-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.order-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 46px 0 43px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  box-shadow: 0 8px 22px rgba(14, 58, 44, 0.05);
  font-size: 11px;
  font-weight: 700;
  outline: none;
}

.order-search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(48, 125, 101, 0.1);
}

.order-search-icon,
.order-search-clear {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.order-search-icon {
  left: 14px;
  pointer-events: none;
}

.order-search-clear {
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-soft);
  cursor: pointer;
}

.order-search-icon svg,
.order-search-clear svg {
  width: 17px;
  height: 17px;
}

.order-search-clear[hidden] {
  display: none;
}

.scope-tab {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.scope-tab.active {
  color: white;
  background: var(--ink);
  box-shadow: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.order-list {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 11px;
}

.order-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  padding: 15px 15px 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

/* Корешок накладной: статус читается боковым зрением, без чтения метки. */
.order-card::before,
.warehouse-order::before,
.delivery-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--line-strong);
  content: "";
}

.order-card:has(.status.new)::before { background: var(--st-new); }
.order-card:has(.status.confirmed)::before,
.order-card:has(.status.packed)::before { background: var(--st-work); }
.order-card:has(.status.courier)::before,
.order-card:has(.status.tomorrow)::before { background: var(--st-transit); }
.order-card:has(.status.delivered)::before { background: var(--st-done); }
.order-card:has(.status.rejected)::before,
.order-card:has(.status.returned)::before,
.order-card:has(.status.no_answer)::before { background: var(--st-fail); }

.warehouse-order:has(.status.new)::before,
.delivery-card:has(.status.new)::before { background: var(--st-new); }
.warehouse-order:has(.status.confirmed)::before,
.warehouse-order:has(.status.packed)::before,
.delivery-card:has(.status.confirmed)::before,
.delivery-card:has(.status.packed)::before { background: var(--st-work); }
.warehouse-order:has(.status.courier)::before,
.warehouse-order:has(.status.tomorrow)::before,
.delivery-card:has(.status.courier)::before,
.delivery-card:has(.status.tomorrow)::before { background: var(--st-transit); }
.warehouse-order:has(.status.delivered)::before,
.delivery-card:has(.status.delivered)::before { background: var(--st-done); }
.warehouse-order:has(.status.rejected)::before,
.warehouse-order:has(.status.no_answer)::before,
.delivery-card:has(.status.rejected)::before,
.delivery-card:has(.status.no_answer)::before { background: var(--st-fail); }

.order-top,
.order-bottom,
.person-line {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-number {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.new {
  color: var(--st-new);
}

.status.confirmed,
.status.packed {
  color: var(--st-work);
}

.status.courier,
.status.tomorrow {
  color: var(--st-transit);
}

.status.delivered {
  color: var(--st-done);
}

.status.rejected,
.status.returned,
.status.no_answer {
  color: var(--st-fail);
}

.person-line {
  justify-content: flex-start;
  margin: 16px 0 13px;
}

.person-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.person-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.person-copy strong,
.person-copy span {
  display: block;
}

.person-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.person-copy .order-customer-label {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.order-sum {
  max-width: 38%;
  flex: 0 1 auto;
  margin-left: auto;
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.order-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.order-bottom strong {
  color: var(--ink);
}

.order-info-list {
  display: grid;
  gap: 9px;
  margin: 4px 0 13px;
  padding: 13px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.order-info-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 10px;
  line-height: 1.4;
}

.order-info-row span {
  color: var(--ink-soft);
}

.order-info-row strong,
.order-info-row a {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.primary-button,
.secondary-button,
.action-button,
.danger-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.action-button:focus-visible,
.danger-button:focus-visible,
.chip:focus-visible,
.scope-tab:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.primary-button svg,
.secondary-button svg,
.action-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.primary-button {
  border: 1px solid var(--ink);
  color: white;
  background: var(--ink);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--ink-strong);
}

.primary-button:disabled {
  border-color: #b3c2ba;
  color: #78897f;
  background: #dde5e0;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
}

.danger-button {
  border: 1px solid var(--danger);
  color: white;
  background: var(--danger);
}

.danger-button:disabled {
  border-color: #d8b9b6;
  color: #8b7471;
  background: #eadbd9;
  cursor: not-allowed;
}

.full-button {
  width: 100%;
}

.team-add-button {
  margin-bottom: 14px;
}

.user-delete-button {
  margin-top: 8px;
}

.order-edit-button {
  margin-top: 12px;
}

.courier-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.courier-actions .order-details-button {
  margin-top: 0;
}

.courier-actions .secondary-button {
  margin-top: 0;
}

.order-details-button + .order-edit-button {
  margin-top: 8px;
}

.order-delete-button {
  margin-top: 8px;
}

.clear-archive-button {
  margin: 0 0 14px;
}

.payment-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  cursor: pointer;
}

.payment-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.payment-choice span {
  font-size: 11px;
  font-weight: 800;
}

.compact-payment-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid #cbd8d2;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7faf8, #eef5f1);
  cursor: pointer;
}

.compact-payment-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compact-check {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #bdc9c3;
  transition: 160ms ease;
}

.compact-check::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(20, 50, 42, 0.2);
  content: "";
  transition: 160ms ease;
}

.compact-payment-toggle input:checked + .compact-check {
  background: var(--ink);
}

.compact-payment-toggle input:checked + .compact-check::after {
  transform: translateX(14px);
}

.compact-payment-toggle strong,
.compact-payment-toggle small {
  display: block;
}

.inline-toggle {
  width: fit-content;
  margin-top: 9px;
  padding: 8px 10px;
}

.compact-stats-grid {
  margin-top: 10px;
}

.compact-payment-toggle strong {
  font-size: 11px;
}

.compact-payment-toggle small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.payment-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.payment-details[hidden],
.receipt-field[hidden] {
  display: none;
}

.receipt-field {
  grid-column: 1 / -1;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}

.reward-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.reward-choice {
  cursor: pointer;
}

.reward-choice input {
  position: absolute;
  opacity: 0;
}

.reward-choice span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 11px;
  font-weight: 850;
}

.reward-choice input:checked + span {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.payment-note {
  margin: 12px 0;
  padding: 11px 13px;
  border-radius: 12px;
  color: #765e24;
  background: var(--yellow-soft);
  font-size: 10px;
  font-weight: 750;
}

.report-list {
  display: grid;
  gap: 14px;
}

.ranking-settings-form {
  margin-bottom: 16px;
}

.ranking-same-toggle {
  margin: 14px 0;
}

.ranking-admin-groups {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.ranking-reward-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.ranking-editor-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.ranking-editor-head strong,
.ranking-editor-head span {
  display: block;
}

.ranking-editor-head strong {
  font-size: 13px;
}

.ranking-editor-head span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.compact-field {
  width: 105px;
  flex: 0 0 auto;
}

.ranking-reward-rows {
  display: grid;
  gap: 9px;
}

.ranking-reward-row {
  display: grid;
  grid-template-columns: 34px minmax(105px, 0.7fr) minmax(140px, 1.3fr);
  gap: 9px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.ranking-reward-row[hidden],
#courier-reward-editor[hidden] {
  display: none;
}

.ranking-reward-row .ranking-place {
  align-self: center;
}

.ranking-reward-row .field {
  margin: 0;
}

.ranking-prize-banner {
  margin-bottom: 16px;
  padding: 17px;
  border: 1px solid #ead296;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff8df, #ffedbd);
  box-shadow: 0 12px 28px rgba(155, 113, 22, 0.1);
}

.ranking-prize-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.ranking-prize-head small,
.ranking-prize-head strong,
.ranking-prize-head span {
  display: block;
}

.ranking-prize-head small,
.ranking-prize-head span {
  color: #765e24;
  font-size: 9px;
  font-weight: 750;
}

.ranking-prize-head strong {
  margin: 4px 0;
  color: #49370e;
  font-size: 14px;
}

.ranking-prize-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ranking-prize-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(73, 55, 14, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.ranking-prize-item.gold {
  background: linear-gradient(145deg, #fff7cf, #f3d36e);
}

.ranking-prize-item.silver {
  background: linear-gradient(145deg, #ffffff, #dfe5e7);
}

.ranking-prize-item.bronze {
  background: linear-gradient(145deg, #fff3e8, #dca779);
}

.ranking-medal {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.gold .ranking-medal {
  background: #bd8414;
}

.silver .ranking-medal {
  background: #78868b;
}

.bronze .ranking-medal {
  background: #a76536;
}

.ranking-prize-item small,
.ranking-prize-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-prize-item small {
  color: rgba(14, 58, 44, 0.68);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.ranking-prize-item strong {
  margin-top: 3px;
  font-size: 10px;
}

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

.ranking-card {
  display: grid;
  grid-template-columns: 34px 44px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
}

.ranking-card.place-1 {
  border-color: #dfbd62;
  background: linear-gradient(135deg, #fffaf0, #fff4d3);
}

.ranking-card.place-2 {
  background: linear-gradient(135deg, #ffffff, #f0f3f2);
}

.ranking-card.place-3 {
  background: linear-gradient(135deg, #ffffff, #f8eee8);
}

.ranking-card.current-person {
  box-shadow: 0 0 0 2px var(--ink), var(--shadow);
}

.ranking-place {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 900;
}

.place-1 .ranking-place {
  color: white;
  background: #c8901e;
}

.place-2 .ranking-place {
  color: white;
  background: #7d8b90;
}

.place-3 .ranking-place {
  color: white;
  background: #a76536;
}

.ranking-person strong,
.ranking-person span,
.ranking-results strong,
.ranking-results span,
.ranking-income strong,
.ranking-income span {
  display: block;
}

.ranking-person strong {
  font-size: 11px;
}

.ranking-person span,
.ranking-results span,
.ranking-income span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.ranking-results,
.ranking-income {
  text-align: right;
}

.ranking-results strong,
.ranking-income strong {
  font-size: 12px;
}

@media (max-width: 520px) {
  .ranking-prize-grid {
    grid-template-columns: 1fr;
  }

  .ranking-reward-row {
    grid-template-columns: 32px 1fr;
  }

  .ranking-reward-row .field:last-child {
    grid-column: 2;
  }

  .ranking-card {
    grid-template-columns: 30px 40px minmax(0, 1fr) auto;
  }

  .ranking-income {
    grid-column: 3 / -1;
  }
}

.event-form {
  margin-bottom: 18px;
}

.event-balance-note {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 10px;
  color: #765e24;
  background: var(--yellow-soft);
  font-size: 10px;
  font-weight: 750;
}

.event-list {
  display: grid;
  gap: 14px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow);
}

.event-card.completed {
  opacity: 0.78;
}

.event-photo {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: var(--surface-soft);
}

.event-card-body {
  padding: 17px;
}

.event-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.event-card-head h2 {
  margin: 7px 0 0;
  font-size: 18px;
}

.event-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.event-status.active {
  color: var(--green);
  background: var(--green-soft);
}

.event-status.completed {
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.event-price {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 12px;
  color: #765e24;
  background: var(--yellow-soft);
  font-size: 12px;
}

.event-details {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.event-details span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 9px;
}

.event-details svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--green);
}

.event-details b {
  color: var(--ink);
}

.event-people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.event-people-group {
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.event-people-group.accepted {
  background: var(--green-soft);
}

.event-people-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 9px;
}

.event-people-title span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-weight: 900;
}

.event-people-list {
  display: grid;
  gap: 6px;
}

.event-people-list > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-people-list b {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  font-size: 7px;
}

.event-people-list small {
  color: var(--ink-soft);
  font-size: 8px;
}

.event-response,
.event-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.event-response span,
.event-response strong {
  display: block;
}

.event-response span {
  color: var(--ink-soft);
  font-size: 8px;
}

.event-response strong {
  margin-top: 3px;
  font-size: 11px;
}

.event-response-actions,
.event-admin-actions {
  display: flex;
  gap: 8px;
}

.event-response-actions button,
.event-admin-actions button {
  min-height: 39px;
  padding: 0 12px;
  font-size: 9px;
}

@media (max-width: 440px) {
  .event-response {
    align-items: stretch;
    flex-direction: column;
  }

  .event-response-actions button {
    flex: 1;
  }
}

.receipt-preview {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.receipt-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.payment-details .payment-choice input,
.payment-method-grid .payment-choice input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
}

.floating-action {
  position: fixed;
  z-index: 25;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  box-shadow: 0 16px 28px rgba(217, 93, 63, 0.34);
  cursor: pointer;
}

.floating-action svg {
  width: 22px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 -8px 24px rgba(14, 58, 44, 0.05);
}

.bottom-nav.nav-count-5 {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav.nav-count-6 {
  grid-template-columns: repeat(6, 1fr);
}

.bottom-nav.nav-count-7 {
  gap: 1px;
  padding-right: 6px;
  padding-left: 6px;
  grid-template-columns: repeat(7, 1fr);
}

.bottom-nav.nav-count-5 .nav-item,
.bottom-nav.nav-count-6 .nav-item,
.bottom-nav.nav-count-7 .nav-item {
  padding-right: 2px;
  padding-left: 2px;
  font-size: 8px;
}

.bottom-nav.nav-count-6 .nav-item,
.bottom-nav.nav-count-7 .nav-item {
  font-size: 7px;
}

.bottom-nav.nav-count-7 .nav-item {
  padding-right: 1px;
  padding-left: 1px;
  border-radius: 11px;
  letter-spacing: -0.02em;
}

.bottom-nav.nav-count-6 .nav-item svg,
.bottom-nav.nav-count-7 .nav-item svg {
  width: 17px;
  height: 17px;
}

.bottom-nav.nav-count-7 .nav-item svg {
  width: 16px;
  height: 16px;
}

.nav-item {
  display: grid;
  min-height: 55px;
  place-items: center;
  gap: 3px;
  padding: 5px;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item.active {
  color: #fff;
  background: var(--ink);
  font-weight: 700;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.quick-card {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.quick-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;

  margin: 6px auto 16px;

  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.quick-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

.quick-card strong,
.quick-card > span:not(.quick-icon) {
  display: block;
}

.quick-card strong {
  font-size: 12px;
}

.quick-card > span:not(.quick-icon) {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.create-order-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(21, 139, 102, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-soft), #fff);
}

.create-order-shortcut > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.create-order-shortcut h2,
.create-order-shortcut p {
  margin: 0;
}

.create-order-shortcut p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.create-order-shortcut-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--accent);
}

.create-order-shortcut-icon svg {
  width: 20px;
}

.chart-card {
  padding: 18px 18px 15px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  color: white;
}

.chart-head strong,
.chart-head span {
  display: block;
}

.chart-head strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.chart-head span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.chart-head-average {
  text-align: right;
}

.chart-head-average strong {
  color: var(--signal-bright);
  font-size: 12px;
}

.chart-head-average span {
  margin: 0 0 3px;
  font-size: 9px;
}

.chart-plot {
  position: relative;
  height: 128px;
}

.chart-bars {
  display: flex;
  height: 100%;
  align-items: flex-end;
  gap: 7px;
}

.chart-bar {
  position: relative;
  flex: 1;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, 0.16);
  transform-origin: bottom;
}

/* Лучший день недели читается сразу, сегодняшний — акцентом. */
.chart-bar.best {
  background: rgba(255, 255, 255, 0.34);
}

.chart-bar.today {
  background: var(--signal-bright);
}

.chart-bar-value {
  position: absolute;
  bottom: 100%;
  left: 50%;
  /* Подложка выбивает линию среднего из-под подписи, чтобы та не перечёркивалась. */
  padding: 0 3px;
  margin-bottom: 5px;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-bar.today .chart-bar-value {
  color: #fff;
}

/* Линия среднего за неделю: показывает, лучше или хуже обычного идёт день. */
.chart-average {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px dashed rgba(16, 160, 102, 0.75);
}

.chart-labels {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.chart-labels span {
  flex: 1;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  text-align: center;
}

.chart-labels span.today {
  color: var(--signal-bright);
  font-weight: 700;
}

.form-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.add-product-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 2px;
  border: 1px dashed #aebeb6;
  border-radius: 10px;
  color: var(--accent);
  background: #fbfdfb;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.add-product-button svg {
  width: 17px;
  height: 17px;
}

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

.product-editor-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 110px;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.product-editor-row .field {
  align-content: start;
}

.product-editor-row input {
  min-height: 44px;
  background: white;
}

.remove-product {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #efc5c5;
  border-radius: 50%;
  color: var(--danger);
  background: white;
  box-shadow: 0 5px 12px rgba(14, 58, 44, 0.1);
  cursor: pointer;
}

.remove-product[hidden] {
  display: none;
}

.remove-product svg {
  width: 13px;
  height: 13px;
}

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

.field label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfdfb;
}

.readonly-field {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 750;
}

.field-hint {
  color: var(--danger);
  font-size: 9px;
  line-height: 1.4;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(14, 58, 44, 0.08);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding: 15px;
  border-radius: 10px;
  background: var(--yellow-soft);
}

.form-summary span {
  color: #765e24;
  font-size: 11px;
  font-weight: 700;
}

.form-summary strong {
  font-size: 18px;
}

.warehouse-order,
.delivery-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow);
}

.warehouse-main,
.delivery-main {
  padding: 18px;
}

.product-lines {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  padding: 13px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.product-line {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.product-line strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.product-line.product-total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 850;
}

.product-lines.compact {
  margin-top: 0;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 13px;
  border-top: 1px solid var(--line);
  background: #fbfdfb;
}

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

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

.warehouse-courier-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
}

.warehouse-courier-field span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.warehouse-courier-field select {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.card-actions.warehouse-actions .primary {
  grid-column: 1 / -1;
}

.product-line a {
  color: inherit;
}

.action-button {
  min-height: 43px;
  border: 1px solid var(--line);
  background: white;
}

.action-button.primary {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.action-button:disabled {
  border-color: #b3c2ba;
  color: #78897f;
  background: #dde5e0;
  cursor: not-allowed;
}

.courier-banner {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: white;
  background: var(--ink);
}

.courier-banner::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--signal);
  content: "";
}

.courier-banner span,
.courier-banner strong {
  position: relative;
  z-index: 1;
  display: block;
}

.courier-banner span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.courier-banner strong {
  margin: 7px 0;
  font-size: 31px;
  letter-spacing: -0.05em;
}

.courier-balance-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 12px;
}

.courier-balance-grid > div + div {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.courier-balance-grid strong {
  font-size: clamp(20px, 6vw, 30px);
}

.delivery-address {
  margin: 15px 0;
  padding: 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  background: var(--yellow-soft);
}

.delivery-address small,
.delivery-address strong {
  display: block;
}

.delivery-address small {
  margin-bottom: 5px;
  color: #806821;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.delivery-address strong {
  font-size: 12px;
  line-height: 1.4;
}

.contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.contact-actions a {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.contact-actions a:nth-child(3) {
  grid-column: 1 / -1;
}

.delivery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.delivery-actions button:first-child {
  grid-column: 1 / -1;
}

.empty-state {
  padding: 34px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  text-align: center;
  background: var(--surface);
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(12, 32, 27, 0.55);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 540px);
  min-width: 0;
  max-height: min(86vh, 740px);
  padding: 20px;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(12, 32, 27, 0.3);
  animation: modal-in 180ms ease-out;
}

.order-edit-modal {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

@keyframes modal-in {
  from {
    transform: translateY(25px);
    opacity: 0;
  }
}

.modal-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-head > div {
  min-width: 0;
}

.modal-head h2,
.modal-head p {
  overflow-wrap: anywhere;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.reason-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.reason-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.reason-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.reason-option input {
  accent-color: var(--ink);
}

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

.role-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  background: white;
  cursor: pointer;
}

.role-option.active {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.role-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.role-current {
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 800;
}

.role-logout-button {
  margin-top: 14px;
}

.courier-choice-list,
.notification-list {
  display: grid;
  gap: 9px;
}

.courier-choice {
  min-width: 0;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  background: white;
  cursor: pointer;
}

.courier-choice:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.courier-load {
  max-width: 42%;
  overflow: hidden;
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notification-section {
  margin-top: 0;
  margin-bottom: 24px;
}

.notification-count {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 10px;
  font-weight: 850;
}

.notification-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #f0d3c8;
  border-radius: 10px;
  background: var(--accent-soft);
}

.notification-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--accent);
}

.notification-icon svg {
  width: 19px;
}

.notification-card strong,
.notification-card span {
  display: block;
}

.notification-card strong {
  font-size: 11px;
  line-height: 1.35;
}

.notification-card div > span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.finance-list {
  display: grid;
  gap: 12px;
}

.instagram-account-form {
  margin-bottom: 24px;
}

.instagram-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 13px;
  border: 1px dashed #c4d0ca;
  border-radius: 10px;
  background: var(--surface-soft);
}

.instagram-preview.modal-preview {
  margin-top: 0;
}

.instagram-preview strong,
.instagram-preview span,
.instagram-account-copy strong,
.instagram-account-copy a,
.instagram-account-copy span {
  display: block;
}

.instagram-preview strong {
  font-size: 12px;
}

.instagram-preview div > span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.instagram-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid white;
  border-radius: 12px;
  color: white;
  background:
    linear-gradient(145deg, #7b2cbf 0%, #d62976 45%, #f77737 75%, #fcaf45 100%);
  box-shadow: 0 7px 18px rgba(214, 41, 118, 0.2);
  font-size: 14px;
  font-weight: 900;
}

.instagram-avatar.preview {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.instagram-avatar.partner-avatar {
  background: linear-gradient(145deg, #0e3a2c 0%, #1f7a68 55%, #4bb89a 100%);
  box-shadow: 0 7px 18px rgba(14, 58, 44, 0.2);
}

.partner-card.partner-inactive {
  opacity: 0.62;
}

.partner-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 8px 25px rgba(14, 58, 44, 0.045);
}

.partner-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.partner-filter-label svg {
  width: 16px;
  height: 16px;
}

.partner-filter select {
  min-width: 0;
  flex: 1;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.partner-filter select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.instagram-account-list {
  display: grid;
  gap: 11px;
}

.instagram-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 8px 25px rgba(14, 58, 44, 0.045);
}

.instagram-account-copy {
  min-width: 0;
  flex: 1;
}

.instagram-account-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instagram-account-copy a {
  margin-top: 3px;
  overflow: hidden;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instagram-account-copy span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.instagram-account-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.instagram-account-actions .icon-button {
  width: 34px;
  height: 34px;
}

.instagram-account-actions svg {
  width: 16px;
  height: 16px;
}

.target-list {
  display: grid;
  gap: 14px;
}

.target-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow);
}

.target-card.ending {
  border-color: #e1bd59;
  background: linear-gradient(135deg, #fffdf6, #fff3cf);
}

.target-card.expired {
  border-color: #d99393;
  background: linear-gradient(135deg, #fffafa, var(--danger-soft));
}

.target-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.target-account-copy {
  min-width: 0;
  flex: 1;
}

.target-account-copy strong,
.target-account-copy span {
  display: block;
}

.target-account-copy strong {
  font-size: 12px;
}

.target-account-copy span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-status {
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.target-card.ending .target-status {
  color: #765e24;
  background: var(--yellow-soft);
}

.target-card.expired .target-status {
  color: var(--danger);
  background: white;
}

.target-period {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.target-card .finance-breakdown {
  grid-template-columns: repeat(5, 1fr);
}

.danger-icon {
  color: var(--danger);
}

.finance-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 8px 25px rgba(14, 58, 44, 0.045);
}

.finance-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.finance-balance {
  min-width: 0;
  max-width: 42%;
  margin-left: auto;
  text-align: right;
}

.finance-balance small,
.finance-balance strong {
  display: block;
}

.finance-balance small {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-balance strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.finance-balance.negative strong {
  color: var(--danger);
}

.finance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 14px 0;
}

.finance-breakdown div {
  padding: 10px 7px;
  border-radius: 11px;
  text-align: center;
  background: var(--surface-soft);
}

.finance-breakdown span,
.finance-breakdown strong {
  display: block;
}

.finance-breakdown span {
  min-height: 22px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.25;
}

.finance-breakdown strong {
  margin-top: 4px;
  font-size: 11px;
}

.finance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.balance-preview,
.payment-confirmation {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 10px;
  background: var(--yellow-soft);
}

.balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-preview span,
.payment-confirmation span {
  color: #765e24;
  font-size: 10px;
  font-weight: 800;
}

.balance-preview strong,
.payment-confirmation strong {
  display: block;
  font-size: 22px;
}

.payment-confirmation strong {
  margin: 6px 0;
  font-size: 30px;
}

.payment-confirmation p {
  margin: 0;
  color: #765e24;
  font-size: 10px;
}

.role-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--ink);
}

.role-copy strong,
.role-copy span {
  display: block;
}

.role-copy strong {
  font-size: 12px;
}

.role-copy span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.toast-root {
  position: fixed;
  z-index: 200;
  top: calc(82px + env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  width: min(100%, 430px);
  padding: 13px 15px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  box-shadow: 0 16px 35px rgba(14, 58, 44, 0.28);
  font-size: 11px;
  font-weight: 750;
  animation: toast-in 200ms ease-out;
}

@keyframes toast-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

@media (min-width: 700px) {
  .content {
    padding: 32px 28px 48px;
  }

  .date-chip {
    display: block;
  }

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

  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-grid.two-column {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

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

  .modal-backdrop {
    align-items: center;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .brand-copy span {
    display: none;
  }

  .profile-button {
    max-width: 58vw;
  }

  .content {
    padding: 18px 14px 36px;
  }

  .page-orders,
  .page-targets,
  .page-create {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  .page-orders .welcome,
  .page-targets .welcome,
  .page-create .welcome {
    margin-bottom: 18px;
  }

  .page-orders h1,
  .page-targets h1,
  .page-create h1 {
    font-size: clamp(29px, 9vw, 36px);
  }

  .page-orders .orders-counter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .page-orders .orders-counter-card.total {
    grid-column: 1 / -1;
  }

  .page-orders .orders-counter-card {
    min-height: 88px;
    padding: 14px 12px;
  }

  .page-orders .orders-counter-card span {
    min-height: 0;
    font-size: 10px;
  }

  .page-orders .orders-counter-card strong {
    font-size: 25px;
  }

  .page-orders .order-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page-orders .order-number {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .page-orders .status {
    flex: 0 0 auto;
  }

  .page-targets .stats-grid {
    gap: 10px;
  }

  .page-targets .stat-card {
    min-height: 118px;
    padding: 15px;
  }

  .page-targets .stat-card .label {
    min-height: 0;
    font-size: 10px;
  }

  .page-targets .stat-card .value {
    font-size: clamp(22px, 7vw, 28px);
    overflow-wrap: anywhere;
  }

  .page-targets .target-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page-targets .target-account-copy {
    flex: 1 1 calc(100% - 55px);
  }

  .page-targets .target-status {
    margin-left: 49px;
    font-size: 9px;
  }

  .page-targets .target-period {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
  }

  .page-create .form-card,
  .page-targets .target-form {
    width: 100%;
    overflow: visible;
  }

  .page-create .field input,
  .page-create .field select,
  .page-create .field textarea,
  .page-targets .field input,
  .page-targets .field select,
  .page-targets .field textarea {
    min-height: 52px;
    font-size: 16px;
  }

  .page-create .field label,
  .page-targets .field label {
    font-size: 11px;
  }

  .page-create .form-summary {
    gap: 10px;
    flex-wrap: wrap;
  }

  .page-create .form-summary strong {
    font-size: 20px;
  }

  .filter-row {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .welcome {
    align-items: flex-start;
  }

  .welcome p:last-child,
  .section-head p {
    overflow-wrap: anywhere;
  }

  .order-card,
  .warehouse-main,
  .delivery-main,
  .form-card,
  .finance-card,
  .target-card {
    padding: 14px;
  }

  .person-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .order-sum {
    max-width: 100%;
    flex: 1 0 calc(100% - 49px);
    margin-left: 49px;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .person-line.no-avatar .order-sum {
    flex-basis: 100%;
    margin-left: 0;
  }

  .warehouse-order,
  .delivery-card {
    width: 100%;
  }

  .order-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .order-bottom strong,
  .order-bottom span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .order-info-row {
    grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.2fr);
  }

  .field-row,
  .finance-actions,
  .payment-method-grid,
  .event-people-grid {
    grid-template-columns: 1fr;
  }

  .card-actions,
  .card-actions.warehouse-actions {
    grid-template-columns: 1fr;
  }

  .card-actions.warehouse-actions .primary,
  .warehouse-courier-field {
    grid-column: 1;
  }

  .warehouse-courier-field select {
    min-height: 62px;
    font-size: 15px;
  }

  .delivery-actions,
  .contact-actions {
    flex-wrap: wrap;
  }

  .delivery-actions > *,
  .contact-actions > * {
    min-width: 0;
    flex: 1 1 130px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal {
    max-height: calc(100dvh - 16px);
    padding: 16px;
    border-radius: 12px;
  }

  .modal-head {
    gap: 10px;
  }

  .bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav.nav-count-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bottom-nav.nav-count-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .bottom-nav.nav-count-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .create-order-shortcut {
    align-items: stretch;
    flex-direction: column;
  }

  .create-order-shortcut .primary-button {
    width: 100%;
  }

  .product-editor-row {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    padding: 12px;
  }

  .product-name-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  .orders-counter-grid,
  .stats-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .orders-counter-card span {
    min-height: 0;
  }

  .profile-button-copy small {
    display: none;
  }

  .order-info-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .order-info-row strong,
  .order-info-row a {
    text-align: left;
  }
}

@media (min-width: 1020px) {
  .app-shell {
    padding-bottom: 38px;
    padding-left: 220px;
  }

  .topbar {
    padding-right: 30px;
    padding-left: 30px;
  }

  .bottom-nav {
    top: 76px;
    right: auto;
    width: 220px;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 7px;
    padding: 28px 14px;
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  .bottom-nav.nav-count-5 {
    grid-template-columns: 1fr;
  }

  .bottom-nav.nav-count-6 {
    grid-template-columns: 1fr;
  }

  .bottom-nav.nav-count-7 {
    gap: 7px;
    padding-right: 14px;
    padding-left: 14px;
    grid-template-columns: 1fr;
  }

  .bottom-nav.nav-count-7 .nav-item {
    padding: 0 15px;
    border-radius: 13px;
    font-size: 11px;
    letter-spacing: normal;
  }

  .bottom-nav.nav-count-7 .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .nav-item {
    display: flex;
    min-height: 48px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 15px;
    font-size: 11px;
  }

  .floating-action {
    right: 30px;
    bottom: 30px;
  }
}

.courier-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.courier-actions .secondary-button {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 100%;
  height: 54px;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
}


/* SAVDO fixes: top bell and quick access cards */
.topbar-notification-button {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin-left: auto;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
}

.topbar-notification-button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.topbar-notification-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

.topbar-notification-button.active {
  background: var(--surface-soft);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.quick-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quick-icon {
  display: grid !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  max-width: 42px;
  flex: 0 0 42px;
  margin: 0 auto 14px !important;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.quick-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

.quick-card strong {
  display: block;
  width: 100%;
  color: var(--ink);
  font-size: 12px;
  text-align: center;
}

.quick-card > span:not(.quick-icon) {
  display: block;
  width: 100%;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

/* ===========================================================================
   Моторика. Правила: анимируются только transform и opacity; появление
   секций проигрывается один раз при переходе в раздел, а не на каждой
   фоновой перерисовке; всё выключается при prefers-reduced-motion.
   =========================================================================== */

.primary-button,
.secondary-button,
.danger-button,
.action-button,
.chip,
.scope-tab,
.nav-item,
.quick-card,
.order-details-button {
  transition: transform 0.12s var(--ease), background-color 0.14s ease,
    border-color 0.14s ease, color 0.14s ease;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.action-button:active,
.chip:active,
.scope-tab:active,
.nav-item:active,
.quick-card:active,
.order-details-button:active {
  transform: scale(0.975);
}

.order-card,
.stat-card,
.quick-card,
.delivery-card,
.warehouse-order {
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

@media (hover: hover) {
  .order-card:hover,
  .quick-card:hover,
  .delivery-card:hover,
  .warehouse-order:hover {
    border-color: var(--line-strong);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes savdo-section-in {
    from {
      opacity: 0;
      transform: translate3d(0, 9px, 0);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes savdo-bar-in {
    from {
      opacity: 0.3;
      transform: scaleY(0.02);
    }
    to {
      opacity: 1;
      transform: scaleY(1);
    }
  }

  .page-enter > * {
    animation: savdo-section-in 300ms var(--ease) backwards;
  }

  .page-enter > *:nth-child(2) {
    animation-delay: 45ms;
  }

  .page-enter > *:nth-child(3) {
    animation-delay: 85ms;
  }

  .page-enter > *:nth-child(4) {
    animation-delay: 120ms;
  }

  .page-enter > *:nth-child(5) {
    animation-delay: 150ms;
  }

  .page-enter > *:nth-child(n + 6) {
    animation-delay: 175ms;
  }

  .chart-bar {
    animation: savdo-bar-in 420ms var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 40ms);
  }

  .toast {
    animation: savdo-section-in 220ms var(--ease);
  }
}

/* --- Роли и доступы -------------------------------------------------------- */

.role-card .settings-copy {
  margin: 12px 0 0;
}

.role-card.builtin {
  background: var(--surface);
  opacity: 0.9;
}

.role-section {
  margin-top: 13px;
}

.role-section-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.role-chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 10px;
  font-weight: 600;
}

.role-chip.accent {
  border-color: var(--signal);
  color: var(--signal);
  background: var(--signal-soft);
}

.role-chip.muted {
  border-style: dashed;
  color: var(--ink-faint);
}

.role-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.role-actions + .danger-button {
  margin-top: 8px;
}

.role-base-grid {
  display: grid;
  gap: 8px;
}

.role-option-list {
  display: grid;
  gap: 7px;
  max-height: 300px;
  overflow-y: auto;
  padding: 3px;
}

.role-base-option,
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.role-base-option input,
.role-option input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--signal);
}

.role-base-option strong,
.role-option strong {
  display: block;
  font-size: 13px;
}

.role-base-option small,
.role-option small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.role-base-option:has(input:checked),
.role-option:has(input:checked) {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.role-base-option:focus-within,
.role-option:focus-within {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* Пункты редактора ролей — это <label> внутри .field, поэтому им нужно
   снять оформление служебной подписи поля (капс, разрядка, мелкий кегль). */
.role-base-option,
.role-option,
.role-base-option strong,
.role-option strong,
.role-base-option small,
.role-option small {
  letter-spacing: normal;
  text-transform: none;
}

.field .role-base-option strong,
.field .role-option strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field .role-base-option small,
.field .role-option small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.role-hint {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.field + .field {
  margin-top: 18px;
}

/* --- Склад товаров ---------------------------------------------------------- */

.inventory-main {
  display: flex;
  gap: 13px;
  margin: 14px 0 0;
}

.inventory-photo {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface-soft);
}

.inventory-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.inventory-photo.placeholder svg {
  width: 30px;
  height: 30px;
}

.inventory-photo.preview {
  width: 100%;
  height: 150px;
  margin-top: 9px;
  flex: none;
}

.inventory-facts {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.inventory-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.inventory-facts > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inventory-facts span {
  color: var(--ink-soft);
  font-size: 11px;
}

.inventory-facts strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.inventory-facts strong.negative {
  color: var(--st-fail);
}

.inventory-supplier {
  margin-top: 14px;
}

.inventory-supplier .role-chip {
  cursor: pointer;
}

.inventory-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.movement-card::before {
  background: var(--st-done);
}

.movement-card.out::before {
  background: var(--st-transit);
}

.movement-card .order-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 14px;
}

.secondary-button:disabled {
  border-color: var(--line);
  color: var(--ink-faint);
  background: var(--surface-soft);
  cursor: not-allowed;
}
