@import url("tokens.css");
@import url("layout.css");


*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a:not(.btn) {
  text-decoration: none;
}

.app-main a:not(.btn):not(.stat-card):not(.nav-link):not(.page-link):not(.shops-tabs__item):not(.warehouse-tabs__item):not(.product-stock-chip--link):not(.stock-loc-badge--link):not(.warehouse-add-mode__item):not(.warehouse-head-add-btn):not(.page-breadcrumbs__link) {
  color: var(--blue);
}

a.stat-card,
a.stat-card:hover,
a.stat-card:focus {
  text-decoration: none;
  color: var(--text);
}

a.stat-card .stat-label,
a.stat-card strong,
a.stat-card small {
  text-decoration: none;
}

.card-body p,
.card-body strong,
.table td,
.table th {
  text-decoration: none;
}

[data-theme="dark"] .app-main a:not(.btn):not(.stat-card):not(.nav-link):not(.page-link):not(.shops-tabs__item):not(.warehouse-tabs__item):not(.product-stock-chip--link):not(.stock-loc-badge--link):not(.warehouse-add-mode__item):not(.warehouse-head-add-btn):not(.page-breadcrumbs__link):hover {
  color: #79b8ff;
}

[data-theme="light"] .app-main a:not(.btn):not(.stat-card):not(.nav-link):not(.page-link):not(.shops-tabs__item):not(.warehouse-tabs__item):not(.product-stock-chip--link):not(.stock-loc-badge--link):not(.warehouse-add-mode__item):not(.warehouse-head-add-btn):not(.page-breadcrumbs__link):hover {
  color: #3a74b0;
}

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

/* ——— Page head ——— */

.page-head {
  --app-head-tools-slot: 40px;
  --app-head-tools-gap: 8px;
  --app-head-tools-offset: calc(16px + 2 * var(--app-head-tools-slot) + var(--app-head-tools-gap));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  /* margin-bottom: 1.75rem; */
  margin-bottom: 0.75rem;
}

.page-head__main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.page-head__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.page-head__title-leading {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.65rem;
  min-width: 0;
}

.page-head__title-leading > .page-head__title-text {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
}

.page-head__title-actions {
  flex-shrink: 0;
  line-height: 1;
}

.page-head--warehouse .page-head__title-aside {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.75rem;
}

.page-head--warehouse .page-head-action-btn {
  white-space: nowrap;
}

.page-head--warehouse {
  margin-bottom: 0.35rem;
}

.page-head--warehouse-add {
  margin-bottom: 1.35rem;
}

.page-head--warehouse .page-head__title-leading {
  gap: 1rem;
}

.page-head--warehouse .page-head__title-row {
  align-items: center;
  gap: 1.25rem;
}

.page-head--warehouse .page-head__title-actions {
  display: flex;
  align-items: center;
}

.warehouse-head-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 0.8125rem;
  line-height: 1.2;
}

.warehouse-head-stats__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  white-space: nowrap;
}

.warehouse-head-stats__sep {
  width: 1px;
  height: 1.1rem;
  background: var(--line);
  flex-shrink: 0;
}

.warehouse-head-stats__value {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.warehouse-head-stats__item--avail .warehouse-head-stats__value {
  color: var(--green);
}

.warehouse-head-stats__label {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8125rem;
}

.warehouse-head-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 1.75rem;
}

@media (min-width: 861px) {
  .page-head--warehouse .warehouse-head-toolbar {
    width: calc(100% + var(--app-head-tools-offset));
    margin-right: calc(-1 * var(--app-head-tools-offset));
  }
}

.warehouse-head-toolbar__aside {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.75rem;
  margin-left: auto;
}

.page-head__title-aside {
  flex-shrink: 0;
  margin-left: auto;
}

.page-head h1,
.content-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.page-head__title-text {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head .muted {
  display: block;
  margin-top: 4px;
  max-width: 42rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.page-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 10px;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.page-breadcrumbs__link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.page-breadcrumbs__link:hover {
  color: var(--blue);
}

.page-breadcrumbs__sep {
  color: var(--muted);
  opacity: 0.5;
  user-select: none;
}

.page-breadcrumbs__current {
  color: var(--violet);
  font-weight: 600;
  max-width: min(55vw, 28rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ——— Colorful stats ——— */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px 14px 11px;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

a.stat-card:hover {
  transform: translateY(-2px);
  border-color: #484f58;
  color: var(--text);
}

.stat-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.4rem;
}

.stat-icon {
  display: grid;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
}

.stat-card--green { border-top: 3px solid var(--green); }
.stat-card--green .stat-icon { background: rgba(63, 185, 80, 0.15); color: var(--green); }

.stat-card--blue { border-top: 3px solid var(--blue); }
.stat-card--blue .stat-icon { background: rgba(88, 166, 255, 0.15); color: var(--blue); }

.stat-card--amber { border-top: 3px solid var(--amber); }
.stat-card--amber .stat-icon { background: rgba(210, 153, 34, 0.15); color: var(--amber); }

.stat-card--violet { border-top: 3px solid var(--violet); }
.stat-card--violet .stat-icon { background: rgba(163, 113, 247, 0.15); color: var(--violet); }

.stat-label {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 0.35rem;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.stat-card strong {
  display: block;
  margin-top: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card--compact {
  padding: 8px 10px 7px;
}

.stat-card--compact .stat-card__head {
  margin-bottom: 0.25rem;
  gap: 0.45rem;
}

.stat-card--compact .stat-icon {
  width: 26px;
  height: 26px;
  font-size: 12px;
  border-radius: 6px;
}

.stat-card--compact .stat-label {
  padding-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.25;
}

.stat-card--compact strong {
  font-size: 1.0625rem;
}

.stat-card__amount-sep {
  color: var(--muted);
  font-weight: 600;
}

.stat-card__revenue,
.stat-card__profit {
  white-space: nowrap;
}

.stat-card__profit {
  color: var(--green);
  font-weight: 700;
}

.stat-card__legend-profit {
  color: var(--green);
  font-weight: 500;
}

.stat-card--compact small {
  margin-top: 1px;
  font-size: 0.6875rem;
}

.dashboard-grid-row {
  align-items: stretch;
}

.dashboard-grid-row > [class*="col-"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-grid-sidebar,
.dashboard-grid-main {
  min-width: 0;
}

.dashboard-hero-row {
  align-items: stretch;
}

.dashboard-hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
}

.dashboard-hero-queues {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-hero-stats {
  min-height: 0;
  flex: 0 0 auto;
}

/* Мобильный: Сегодня/Всё время → график → В работе/Поставщики */
@media (max-width: 991.98px) {
  .dashboard-hero-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-hero-row > .dashboard-grid-sidebar,
  .dashboard-hero-row > .dashboard-grid-sidebar > .dashboard-hero-sidebar {
    display: contents;
  }

  .dashboard-hero-row .dashboard-hero-stats {
    order: 1;
    /* display:contents у колонки съедает gutter у row g-3 */
    margin-top: 1rem;
    width: 100%;
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    box-sizing: border-box;
  }

  .dashboard-hero-row .dashboard-grid-main {
    order: 2;
  }

  .dashboard-hero-row .dashboard-hero-queues {
    order: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    box-sizing: border-box;
  }
}

.dashboard-hero-stats .stat-card--compact {
  flex: 0 0 auto;
}

.dashboard-attention {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-attention .card-body {
  flex: 1 1 auto;
}

.dashboard-suppliers-summary {
  flex: 0 0 auto;
}

.dashboard-suppliers-summary__list > li + li {
  border-top: 1px solid var(--line);
}

.dashboard-suppliers-summary__all {
  text-decoration: none;
}

.dashboard-suppliers-summary__all:hover {
  color: var(--blue) !important;
  text-decoration: underline;
}

.dashboard-suppliers-summary__go {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dashboard-suppliers-summary .dashboard-attention__label {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-suppliers-summary .dashboard-attention__row:hover .dashboard-attention__label {
  color: var(--text);
}

.dashboard-suppliers-summary .dashboard-attention__row:hover .dashboard-suppliers-summary__go {
  opacity: 1;
  color: var(--blue);
  transform: translateX(2px);
}

.dashboard-attention__list > li + li {
  border-top: 1px solid var(--line);
}

.dashboard-attention__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 0.9rem;
  color: inherit;
  text-decoration: none;
}

.dashboard-attention__row:hover {
  background: var(--table-hover-bg);
}

.dashboard-attention__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-attention__count {
  min-width: 1.75rem;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-attention__count--zero {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-attention__count--warning { color: var(--amber); }
.dashboard-attention__count--danger { color: var(--red); }
.dashboard-attention__count--info { color: var(--blue); }

.dashboard-attention__row--active .dashboard-attention__label {
  color: var(--text);
}

/* ——— Charts (Chart.js) ——— */

.chart-card .card-body {
  padding: 12px 14px 10px 12px;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap--tall {
  height: 300px;
}

.chart-card.chart-card--daily {
  overflow: visible;
}

.chart-card--daily .card-body {
  overflow: visible;
}

.chart-card--daily {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-card--daily .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.chart-card--daily .chart-wrap--tall {
  flex: 1 1 auto;
  min-height: 320px;
  height: auto;
  overflow: visible;
}

.chart-card--daily .chart-wrap--tall canvas {
  display: block;
}

.chart-card .card-header {
  padding: 0.65rem 0.85rem 0.45rem;
}

.chart-card .card-title {
  font-size: 0.9375rem;
  line-height: 1.35;
}


.chart-daily-tooltip {
  position: fixed;
  z-index: 1080;
  min-width: 15.5rem;
  max-width: 17.5rem;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.12s ease;
}

[data-theme="dark"] .chart-daily-tooltip {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.chart-daily-tooltip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--tooltip-arrow-x, 0px));
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  transform: rotate(45deg);
  background: var(--panel);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.chart-daily-tooltip--flip {
  transform: translate(-50%, 14px);
}

.chart-daily-tooltip--flip::after {
  top: -6px;
  bottom: auto;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.chart-daily-tooltip__head {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.chart-daily-tooltip__hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px dashed var(--border-strong);
}

.chart-daily-tooltip__hero-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text, inherit);
}

.chart-daily-tooltip__hero-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.chart-daily-tooltip__value--profit-positive {
  color: var(--green);
}

.chart-daily-tooltip__value--profit-negative {
  color: var(--red);
}

.chart-daily-tooltip__value--muted {
  color: var(--muted);
}

.chart-daily-tooltip__key {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.chart-daily-tooltip__row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.8125rem;
}

.chart-daily-tooltip__row--key {
  padding: 0.28rem 0.35rem;
  border-radius: 8px;
  background: var(--surface-muted);
}

.chart-daily-tooltip__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.2rem;
  border-radius: 50%;
}

.chart-daily-tooltip__dot--blue {
  background: var(--blue);
}

.chart-daily-tooltip__dot--cyan {
  background: var(--cyan);
}

.chart-daily-tooltip__dot--green {
  background: var(--green);
}

.chart-daily-tooltip__label {
  flex: 1;
  min-width: 0;
  color: var(--muted);
}

.chart-daily-tooltip__row--key .chart-daily-tooltip__label {
  color: var(--text, inherit);
  font-weight: 500;
}

.chart-daily-tooltip__value {
  flex-shrink: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text, inherit);
}

.chart-daily-tooltip__value--key {
  font-weight: 700;
}

.chart-daily-tooltip__value--cost {
  color: var(--violet);
}

.chart-daily-tooltip__details {
  display: grid;
  gap: 0.28rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
}

.chart-daily-tooltip__details .chart-daily-tooltip__label {
  font-size: 0.75rem;
}

.chart-daily-tooltip__details .chart-daily-tooltip__value {
  font-size: 0.75rem;
}

.chart-daily-tooltip__footer {
  display: flex;
  justify-content: center;
  margin-top: 0.55rem;
}

.chart-daily-tooltip__orders {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 32%, transparent);
  text-decoration: none;
}

a.chart-daily-tooltip__orders--link {
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

a.chart-daily-tooltip__orders--link:hover,
a.chart-daily-tooltip__orders--link:focus-visible {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 24%, transparent);
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  text-decoration: none;
}

/* Итоги за выбранный период графика */
.chart-daily-summary {
  margin-bottom: 0.55rem;
  padding: 0.6rem 0.8rem 0.55rem;
  border-radius: 0.6rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 94%, var(--bg, transparent)) 0%,
    color-mix(in srgb, var(--panel) 82%, transparent) 100%
  );
  border: 1px solid var(--border);
}

.chart-daily-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-strong);
}

.chart-daily-summary__hero {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.chart-daily-summary__label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.chart-daily-summary__profit {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.chart-daily-summary__profit--positive {
  color: var(--green);
}

.chart-daily-summary__profit--negative {
  color: var(--red, #f85149);
}

.chart-daily-summary__profit--muted {
  color: var(--muted);
}

.chart-daily-summary__orders {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
  white-space: nowrap;
}

.chart-daily-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.3rem 0.85rem;
}

.chart-daily-summary__metric {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.4rem;
  row-gap: 0.05rem;
  align-items: baseline;
  min-width: 0;
}

.chart-daily-summary__dot {
  grid-row: 1 / span 2;
  align-self: center;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-daily-summary__dot--blue { background: var(--blue); }
.chart-daily-summary__dot--cyan { background: var(--cyan); }
.chart-daily-summary__dot--green { background: var(--green); }
.chart-daily-summary__dot--amber { background: var(--amber); }
.chart-daily-summary__dot--violet { background: var(--violet); }

.chart-daily-summary__metric-label {
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.2;
}

.chart-daily-summary__metric-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-daily-summary__metric-value--cost {
  color: var(--violet);
}

@media (max-width: 575.98px) {
  .chart-daily-summary {
    padding: 0.55rem 0.65rem 0.5rem;
  }

  .chart-daily-summary__profit {
    font-size: 1.15rem;
  }

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

.dashboard-period-select {
  width: auto;
  min-width: 5rem;
  max-width: 5.75rem;
  font-size: 0.75rem;
}

.dashboard-finance__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.dashboard-finance__hero {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px dashed var(--border-strong);
}

.dashboard-finance__profit {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.dashboard-finance__breakdown {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
}

.dashboard-finance__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.dashboard-finance__line-label {
  color: var(--muted);
}

.dashboard-finance__line-value {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--text, inherit);
}

.dashboard-finance__line--sub .dashboard-finance__line-value {
  color: var(--red);
}

.dashboard-finance__line--total {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-strong);
}

.dashboard-finance__line--total .dashboard-finance__line-label,
.dashboard-finance__line--total .dashboard-finance__line-value {
  font-weight: 600;
  color: var(--text, inherit);
}

.dashboard-finance__line.is-hidden {
  display: none;
}

.dashboard-widget-table--top th.dashboard-widget-table__qty-col,
.dashboard-widget-table--top td.dashboard-widget-table__qty-col {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.dashboard-widget-table--top th.dashboard-widget-table__money-col,
.dashboard-widget-table--top td.dashboard-widget-table__money-col {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.35rem;
}

.dashboard-widget-table--top th.dashboard-widget-table__actions-col,
.dashboard-widget-table--top td.dashboard-widget-table__actions-col {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-left: 0.5rem;
  padding-right: 0.75rem;
  vertical-align: middle;
}

.dashboard-top-orders-btn {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.dashboard-widget-table--top .dashboard-top-profit {
  font-weight: 600;
  color: var(--success, #1a7f37);
}

.dashboard-widget-table--top thead th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted, #656d76);
  font-weight: 600;
  vertical-align: bottom;
}

.dashboard-widget-table .dashboard-widget__product {
  display: block;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .dashboard-widget-table--top {
    table-layout: fixed;
    width: 100%;
  }

  .dashboard-widget-table--top thead {
    display: none;
  }

  .dashboard-widget-table--top tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 0.65rem;
    row-gap: 0.35rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-widget-table--top tbody td {
    border: 0;
    padding: 0;
    width: auto !important;
    white-space: nowrap;
    vertical-align: middle;
  }

  .dashboard-widget-table--top tbody td.dashboard-widget-table__product-col {
    grid-column: 1 / -1;
    white-space: normal;
    min-width: 0;
  }

  .dashboard-widget-table--top .dashboard-widget__product {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .dashboard-widget-table--top tbody td.dashboard-widget-table__qty-col {
    grid-column: 1;
    justify-self: start;
    font-size: 0.8125rem;
    color: var(--muted);
  }

  .dashboard-widget-table--top tbody td.dashboard-widget-table__qty-col::before {
    content: "Шт. ";
    font-weight: 500;
  }

  .dashboard-widget-table--top tbody td.dashboard-widget-table__money-col:nth-child(3) {
    display: none;
  }

  .dashboard-widget-table--top tbody td.dashboard-top-profit {
    grid-column: 2;
    justify-self: end;
    font-size: 0.8125rem;
  }

  .dashboard-widget-table--top tbody td.dashboard-widget-table__actions-col {
    grid-column: 3;
    justify-self: end;
    padding-right: 0;
  }

  .dashboard-top-orders-btn {
    padding: 0.2rem 0.5rem;
  }
}

.dashboard-widget-table--lowstock th:last-child {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.dashboard-widget-table__stock-qty {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  vertical-align: top;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--danger, #cf222e);
}

.form-control--catalog-locked,
.form-control--catalog-locked:disabled,
.form-control--catalog-locked[readonly] {
  background-color: var(--surface-muted);
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  cursor: default;
}

.product-publication-meta__item {
  margin-bottom: 0.75rem;
}

.product-publication-meta__item:last-child {
  margin-bottom: 0;
}

.product-publication-meta__label {
  margin-bottom: 0.2rem;
}

.product-publication-meta__value {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

.product-delivery-type-aside {
  font-size: 0.875rem;
  line-height: 1.35;
  text-align: right;
}

.product-delivery-type-aside__value {
  color: var(--text);
  font-weight: 600;
}

.product-delivery-type-aside--manual .product-delivery-type-aside__value {
  color: var(--amber);
}

.product-delivery-type-aside .field-hint {
  margin-left: 0.4rem;
}

.product-is-active-label .field-hint {
  margin-left: 0.4rem;
}

.product-code-delivery-mode {
  width: 100%;
  max-width: 100%;
}

.code-delivery-mode-segmented {
  display: flex;
  width: 100%;
}

.code-delivery-mode-segmented .code-group-pick-segmented__option {
  flex: 1 1 0;
  min-width: 0;
}

.code-delivery-mode-segmented .code-group-pick-segmented__label {
  padding: 0.35rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.product-delivery-option-pane {
  height: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.product-delivery-option-pane__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.product-delivery-till-mode {
  display: flex;
  width: 100%;
}

.product-delivery-till-mode .code-group-pick-segmented__option {
  flex: 1 1 0;
  min-width: 0;
}

.product-delivery-till-mode .code-group-pick-segmented__label {
  padding: 0.35rem 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.code-delivery-format-block {
  margin-top: 0;
}

.code-delivery-format-block__title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.code-delivery-as-is-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.code-delivery-as-is-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.code-delivery-as-is-row__label {
  color: var(--muted);
  font-size: 0.75rem;
}

.code-delivery-as-is-row__value,
.code-delivery-as-is-row__sent code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  word-break: break-all;
}

.code-delivery-as-is-row__arrow {
  color: var(--muted);
  font-size: 0.75rem;
}

.code-delivery-as-is-row__sent {
  color: var(--text);
}

.code-delivery-as-is-row__sent code {
  font-weight: 600;
}

.code-delivery-format-sample {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.code-delivery-format-sample--live .code-delivery-format-sample__part {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
}

.code-delivery-format-sample__part.is-dimmed {
  opacity: 0.45;
}

.code-delivery-format-sample__sep--static .code-delivery-separator-input {
  pointer-events: none;
  color: var(--muted);
}

.code-delivery-format-sample__part {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  border-right: 1px solid var(--line);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.code-delivery-format-sample__part.is-highlight {
  background: color-mix(in srgb, var(--blue) 12%, var(--bg-elevated));
  color: var(--text);
  font-weight: 600;
}

.code-delivery-format-sample__sep {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.15rem;
  background: var(--bg-elevated);
  border-right: 1px solid var(--line);
}

.code-delivery-format-sample__sep .code-delivery-separator-input {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 4rem;
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 0.5rem 0.2rem;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: center;
  box-shadow: none;
}

.code-delivery-format-sample__sep .code-delivery-separator-input:focus {
  outline: none;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.code-delivery-format-sample__part:last-child {
  border-right: 0;
}

.code-delivery-send-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 6%, var(--bg-elevated));
  font-size: 0.8125rem;
  line-height: 1.35;
}

.code-delivery-send-result__label {
  color: var(--muted);
}

.code-delivery-send-result__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.code-delivery-send-result--full .code-delivery-send-result__value {
  font-weight: 500;
}

.warehouse-codes-editor {
  position: relative;
}

.warehouse-codes-editor__tool {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--bg-elevated);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0.88;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.warehouse-codes-editor__tool:hover,
.warehouse-codes-editor__tool[aria-expanded="true"] {
  opacity: 1;
  color: var(--text);
  border-color: var(--border-strong);
}

.warehouse-codes-replace-panel {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  width: min(17.5rem, calc(100% - 0.9rem));
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.warehouse-codes-replace-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.35rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.warehouse-codes-replace-panel__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.warehouse-codes-replace-panel__close {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.warehouse-codes-replace-panel__close:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.warehouse-codes-replace-panel__body {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
}

.warehouse-codes-textarea {
  resize: vertical;
  min-height: 16rem;
  max-height: 70vh;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  padding-right: 2.75rem;
}

.activate-till-field-group .activate-till-value-input {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  text-align: center;
}

.activate-till-field-group .activate-till-unit-select {
  flex: 1 1 7.5rem;
  width: auto;
  min-width: 7.5rem;
  max-width: none;
  color: var(--text);
  background-color: var(--bg-elevated);
}

.activate-till-field-group .activate-till-clear-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 40px;
}

.dashboard-recent-orders {
  font-size: 0.875rem;
}

.dashboard-recent-orders thead th {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.dashboard-recent-orders tbody td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.dashboard-recent-orders__id-col {
  width: 3.5rem;
  padding-left: 0.75rem !important;
  padding-right: 0.25rem !important;
  text-align: left;
}

.mp-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.mp-cell__label {
  font-size: 0.8125rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}

.platform-icon {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.platform-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--platform-color, #6b7280);
  flex-shrink: 0;
}

.platform-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.platform-cell__label {
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text, inherit);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.supplier-platform-icons--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.supplier-catalog-kind-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.supplier-catalog-kind-btn.is-active {
  font-weight: 600;
}

.supplier-catalog-service-card .card-body {
  min-height: 8.5rem;
}

.supplier-catalog-table {
  width: 100%;
  table-layout: auto;
}

.supplier-catalog-table th:first-child,
.supplier-catalog-name-cell {
  min-width: 12rem;
}

.supplier-catalog-table__platform-col {
  width: 13rem;
  max-width: 15rem;
  min-width: 11rem;
  vertical-align: middle;
}

.supplier-catalog-table__price-col {
  width: 7.5rem;
  white-space: nowrap;
}

.supplier-catalog-table__steam-col {
  width: 7.5rem;
  max-width: 9rem;
  min-width: 6rem;
  vertical-align: middle;
  white-space: nowrap;
}

.supplier-catalog-steam__price {
  font-weight: 600;
  font-size: 0.8125rem;
}

.supplier-catalog-table__stock-col {
  width: 4.75rem;
  text-align: center;
  white-space: nowrap;
}

.supplier-catalog-table th.supplier-catalog-table__stock-col {
  text-align: center;
}

.supplier-catalog-table__id-col {
  max-width: 10rem;
}

.supplier-catalog-table__actions-col {
  width: 5.5rem;
  white-space: nowrap;
}

.supplier-catalog-table__actions-col--cart {
  width: 7.5rem;
  min-width: 7.5rem;
}

.supplier-catalog-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-end;
  vertical-align: middle;
}

.supplier-catalog-actions.btn-group > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.supplier-catalog-actions .supplier-cart-add-btn {
  min-width: 2.15rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.supplier-catalog-actions .supplier-cart-add-btn i {
  font-size: 0.8125rem;
  pointer-events: none;
}

.supplier-catalog-name-cell {
  min-width: 12rem;
}

.supplier-catalog-name-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.supplier-catalog-fav {
  flex: 0 0 auto;
  margin-top: 0.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
  cursor: pointer;
}

.supplier-catalog-fav:hover,
.supplier-catalog-fav:focus-visible {
  color: var(--warning, #d97706);
}

.supplier-catalog-fav.is-active {
  color: var(--warning, #d97706);
}

.supplier-catalog-row--missing {
  opacity: 0.78;
}

.supplier-catalog-fav i {
  font-size: 0.9rem;
  pointer-events: none;
}

.supplier-catalog-name-row .supplier-catalog-name-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  position: relative;
}

.supplier-catalog-name-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: 100%;
}

.supplier-catalog-steam-link {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1;
  text-decoration: none;
}

.supplier-catalog-steam-link:hover,
.supplier-catalog-steam-link:focus-visible {
  color: #66c0f4;
}

.supplier-catalog-steam-link i {
  font-size: 0.95rem;
  pointer-events: none;
}

.supplier-catalog-name-row .supplier-catalog-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.supplier-catalog-name__text {
  pointer-events: none;
}

[data-catalog-tip]::after {
  content: attr(data-catalog-tip);
  position: absolute;
  z-index: 5000;
  left: 0;
  top: calc(100% + 6px);
  max-width: min(24rem, 90vw);
  padding: 0.35rem 0.55rem;
  border-radius: 0.375rem;
  background: var(--tooltip-bg, #1f2937);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  display: none;
  pointer-events: none;
}

[data-catalog-tip]:hover::after,
[data-catalog-tip]:focus-within::after {
  display: block;
}

.catalog-tip--rich[data-catalog-tip]::after {
  max-width: min(22rem, 92vw);
  padding: 0.5rem 0.65rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

/* Обрезанное имя в чипе склада — подсказка в одну строку, не по ширине чипа */
.product-stock-chip__name-tip.catalog-tip--rich[data-catalog-tip]::after {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  width: max-content;
  max-width: min(24rem, 90vw);
}

.supplier-catalog-name {
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link, #2563eb);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.supplier-catalog-name:hover,
.supplier-catalog-name:focus-visible {
  color: var(--link-hover, #1d4ed8);
  text-decoration: underline;
  outline: none;
}

.supplier-catalog-name--static,
.supplier-catalog-name--static:hover,
.supplier-catalog-name--static:focus-visible {
  color: var(--muted, #6b7280);
  cursor: default;
  text-decoration: none;
}

.supplier-platform-icons {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.supplier-platform-fallback {
  display: inline-block;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--muted);
}

.supplier-region-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  max-width: 7.25rem;
}

.supplier-region-badge {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 7rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: var(--surface-2, #eef2f7);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-transform: none;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.supplier-region-badge--more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  -webkit-line-clamp: unset;
  white-space: nowrap;
  overflow: visible;
  overflow-wrap: normal;
  word-break: normal;
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, var(--surface-2, #eef2f7));
  color: var(--primary, #2563eb);
  cursor: help;
}

.supplier-region-badge--more .supplier-region-badge__label {
  line-height: 1.2;
}

.supplier-region-popover {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  z-index: 200;
  width: min(22rem, calc(100vw - 2rem));
  min-width: 16rem;
  max-height: 18rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  pointer-events: auto;
}

.supplier-region-popover--floating {
  position: fixed !important;
  z-index: 4000 !important;
}

.supplier-region-popover__title {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.supplier-region-popover__list {
  margin: 0;
  padding: 0 0.35rem 0 1.1rem;
  max-height: 14.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #f1f5f9;
  scrollbar-width: thin;
  scrollbar-color: #64748b #0f172a;
}

.supplier-region-popover__list::-webkit-scrollbar {
  width: 8px;
}

.supplier-region-popover__list::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 999px;
}

.supplier-region-popover__list::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 999px;
  border: 2px solid #0f172a;
}

.supplier-region-popover__list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.supplier-region-popover__list li {
  margin: 0.15rem 0;
  color: #f1f5f9;
  overflow-wrap: anywhere;
}

.supplier-catalog-table__type-col {
  width: 6.5rem;
  max-width: 8rem;
  white-space: nowrap;
  vertical-align: middle;
}

.supplier-catalog-meta-chips {
  align-items: center;
}

.supplier-catalog-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 7.5rem;
  padding: 0.14rem 0.42rem;
  border-radius: 4px;
  background: var(--surface-2, #eef2f7);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: middle;
}

.supplier-catalog-table__region-col,
.supplier-region-badges {
  overflow: visible;
}

.supplier-catalog-table__region-col {
  width: 7.5rem;
  max-width: 8.5rem;
}

.supplier-catalog-table td {
  overflow: visible;
  vertical-align: middle;
}

.supplier-catalog-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.2;
}

.supplier-catalog-price--inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  vertical-align: baseline;
}

.supplier-catalog-price--inline .supplier-catalog-price__orig {
  font-weight: 500;
}

.supplier-catalog-price--inline .supplier-catalog-price__rub {
  font-size: inherit;
}

.supplier-catalog-price__orig {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.supplier-catalog-price__rub {
  font-size: 0.6875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: help;
  border-bottom: 1px dotted color-mix(in srgb, var(--muted) 55%, transparent);
}

.supplier-catalog-stock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
}

.supplier-catalog-stock--ok {
  color: var(--success, #1a7f37);
  background: color-mix(in srgb, var(--success, #1a7f37) 12%, transparent);
}

.supplier-catalog-stock--medium {
  color: #9a6700;
  background: color-mix(in srgb, #d4a72c 18%, transparent);
}

.supplier-catalog-stock--low,
.supplier-catalog-stock--empty {
  color: var(--danger, #cf222e);
  background: color-mix(in srgb, var(--danger, #cf222e) 12%, transparent);
}

.supplier-catalog-stock--unknown {
  color: var(--muted);
  font-weight: 500;
  background: transparent;
  padding: 0;
}


.supplier-catalog-filters-card {
  position: relative;
  z-index: 30;
}

.supplier-orders-card__header {
  flex-wrap: nowrap;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
}

.supplier-orders-card__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.supplier-orders-card__toolbar .form-select.supplier-orders-status-filter {
  width: auto;
  min-width: 8.25rem;
  max-width: 10.5rem;
  min-height: 32px;
  height: 32px;
  padding: 0 2rem 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  background-position: right 0.65rem center;
  background-size: 12px 9px;
}

/* Пункты списка — обычные; жирный только выбранный (иначе наследуют 600 с кнопки select). */
.supplier-orders-card__toolbar .form-select.supplier-orders-status-filter option {
  font-weight: 400;
}

.supplier-orders-card__toolbar .form-select.supplier-orders-status-filter option:checked {
  font-weight: 600;
}

.supplier-orders-card .table-sm th,
.supplier-orders-card .table-sm td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.supplier-orders-table .supplier-orders-actions-col {
  width: 1%;
  white-space: nowrap;
  min-width: 12.5rem;
}

.supplier-order-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.2;
}

.supplier-order-price__total {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.supplier-order-price__unit {
  font-variant-numeric: tabular-nums;
}

.supplier-purchase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}

.supplier-purchase-card__title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  line-height: 1.25;
}

.supplier-purchase-card__title-lead {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.supplier-purchase-card__product-meta {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, inherit);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.supplier-purchase-card__product-meta[hidden] {
  display: none !important;
}

.supplier-purchase-card__title:has(.supplier-purchase-card__product-meta[hidden]) .supplier-purchase-card__title-lead {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

.supplier-purchase-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--card-bg, #fff) 88%, var(--bg, #f3f5f8));
}

.supplier-purchase-summary__cell {
  min-width: 0;
}

.supplier-purchase-summary__cell--total {
  padding-left: 0.85rem;
  border-left: 1px solid color-mix(in srgb, var(--border, #d8dee8) 80%, transparent);
}

.supplier-purchase-summary__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.supplier-purchase-summary__value {
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--text, inherit);
}

.supplier-purchase-summary__value .supplier-purchase-money,
.supplier-balance-money .supplier-purchase-money {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.supplier-purchase-summary__value .supplier-purchase-money__main {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.supplier-balance-money .supplier-purchase-money__main {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.supplier-purchase-summary__cell--total .supplier-purchase-money__main {
  font-size: 1.28rem;
}

.supplier-purchase-summary__value .supplier-purchase-money__sub,
.supplier-balance-money .supplier-purchase-money__sub {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

/* title снимается mmInitTooltips → data-bs-title; подчёркивание нужно в обоих случаях */
.supplier-purchase-summary__value .supplier-purchase-money__sub[title],
.supplier-purchase-summary__value .supplier-purchase-money__sub[data-bs-title],
.supplier-balance-money .supplier-purchase-money__sub[title],
.supplier-balance-money .supplier-purchase-money__sub[data-bs-title] {
  cursor: help;
  border-bottom: 1px dotted color-mix(in srgb, var(--muted) 50%, transparent);
}

@media (max-width: 575.98px) {
  .supplier-purchase-summary {
    grid-template-columns: 1fr;
  }

  .supplier-purchase-summary__cell--total {
    padding-left: 0;
    padding-top: 0.65rem;
    border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--border, #d8dee8) 80%, transparent);
  }
}

.supplier-purchase-qty-wrap {
  position: relative;
  width: 100%;
}

.supplier-purchase-qty-input {
  width: 100%;
  padding-right: 9.75rem;
}

.supplier-purchase-qty-input::-webkit-outer-spin-button,
.supplier-purchase-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.supplier-purchase-qty-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.supplier-purchase-qty-presets {
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 2px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--line) 18%, var(--bg-elevated));
  transform: translateY(-50%);
  pointer-events: none;
}

.supplier-purchase-qty-chip {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.28rem 0.42rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  pointer-events: auto;
}

.supplier-purchase-qty-chip:hover:not(:disabled),
.supplier-purchase-qty-chip:focus-visible:not(:disabled) {
  background: var(--card-bg, #fff);
  color: var(--text);
}

.supplier-purchase-qty-chip:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.supplier-procurement-ref-group .supplier-procurement-verify {
  white-space: nowrap;
}


.supplier-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.supplier-filter-bar__end {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Без видимых фильтров — избранное и корзина слева, не у правого края */
.supplier-filter-bar:not(:has(> .supplier-filter-drop:not(.d-none))):not(:has(> .supplier-filter-price:not(.d-none))):not(:has(> #supplier-filter-with-text)):not(:has(> #supplier-filter-preorder)) .supplier-filter-bar__end {
  margin-left: 0;
}

.supplier-filter-price {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
  height: 1.875rem;
  min-height: 1.875rem;
  padding: 0 0.55rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  background: var(--card-bg, #fff);
}

.supplier-filter-price.is-active {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
}

.supplier-filter-price__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  padding-left: 0.15rem;
  line-height: 1;
}

.supplier-filter-price__sep {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
}

.supplier-filter-price__input.form-control,
.supplier-filter-price__input.form-control-sm,
.supplier-filter-price__input {
  width: 4.5rem;
  height: 1.35rem !important;
  min-height: 1.35rem !important;
  max-height: 1.35rem;
  margin: 0;
  border: 0 !important;
  border-radius: 999px;
  background: transparent;
  box-shadow: none !important;
  padding: 0 0.35rem !important;
  font-size: 0.8125rem !important;
  line-height: 1.35rem !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.supplier-filter-price__input::-webkit-outer-spin-button,
.supplier-filter-price__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.supplier-filter-price__input:focus {
  box-shadow: none !important;
  background: var(--surface-muted, rgba(15, 23, 42, 0.04));
}

.supplier-filter-stock__input.form-control,
.supplier-filter-stock__input.form-control-sm,
.supplier-filter-stock__input {
  width: 3.25rem;
}

.supplier-filter-favorites {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.875rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  color: var(--text, inherit);
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
}

.supplier-filter-favorites:hover,
.supplier-filter-favorites:focus-visible {
  border-color: var(--warning, #d97706);
  color: var(--warning, #d97706);
}

.supplier-filter-favorites.is-active {
  border-color: color-mix(in srgb, var(--warning, #d97706) 45%, var(--border, #d8dee8));
  background: color-mix(in srgb, var(--warning, #d97706) 12%, var(--card-bg, #fff));
  color: var(--warning, #d97706);
}

.supplier-filter-favorites__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning, #d97706) 18%, transparent);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}

.supplier-filter-cart:hover,
.supplier-filter-cart:focus-visible,
.supplier-filter-cart.is-active {
  border-color: color-mix(in srgb, var(--primary, #0d6efd) 45%, var(--border, #d8dee8));
  background: color-mix(in srgb, var(--primary, #0d6efd) 10%, var(--card-bg, #fff));
  color: var(--primary, #0d6efd);
}

.supplier-filter-cart .supplier-filter-favorites__count {
  background: color-mix(in srgb, var(--primary, #0d6efd) 18%, transparent);
}

.supplier-cart-wrap {
  position: relative;
  display: inline-flex;
}

.supplier-cart-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.7rem 0.75rem 0.75rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 0.65rem;
  background: var(--card-bg, #fff);
  box-shadow: 0 0.65rem 1.5rem rgba(15, 23, 42, 0.14);
}

.supplier-cart-popover__head {
  margin-bottom: 0.55rem;
  padding: 0 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text, inherit);
}

.supplier-cart-popover__list {
  max-height: 14rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.supplier-cart-popover__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--border, #d8dee8) 80%, transparent);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--muted, #6c757d) 5%, var(--card-bg, #fff));
}

.supplier-cart-popover__item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.supplier-cart-popover__item-name {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-cart-popover__item-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.supplier-cart-popover__item-price {
  font-weight: 600;
  color: var(--text, inherit);
}

.supplier-cart-popover__item-unit {
  color: var(--muted, #6c757d);
}

.supplier-cart-popover__remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #6c757d);
  line-height: 1;
  cursor: pointer;
}

.supplier-cart-popover__remove:hover,
.supplier-cart-popover__remove:focus-visible {
  background: color-mix(in srgb, var(--danger, #dc3545) 12%, transparent);
  color: var(--danger, #dc3545);
}

.supplier-cart-popover__remove i {
  font-size: 0.7rem;
  pointer-events: none;
}

.supplier-cart-popover__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border, #d8dee8);
}

.supplier-cart-checkout__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.supplier-cart-checkout__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.supplier-cart-checkout__title-icon {
  color: var(--primary, #0d6efd);
  font-size: 0.95rem;
}

.supplier-cart-checkout__products {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 22rem;
  overflow: auto;
}

.supplier-cart-checkout__loading {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.875rem;
}

.supplier-cart-checkout__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 1.75rem;
  align-items: center;
  gap: 0.55rem 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--border, #d8dee8) 80%, transparent);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--card-bg, #fff) 92%, var(--bg, #f3f5f8));
}

.supplier-cart-checkout__line--blocked {
  border-color: color-mix(in srgb, var(--danger, #dc3545) 35%, var(--border, #d8dee8));
  background: color-mix(in srgb, var(--danger, #dc3545) 6%, var(--card-bg, #fff));
}

.supplier-cart-checkout__line--blocked .supplier-cart-checkout__line-name {
  color: var(--muted, #6c757d);
}

.supplier-cart-checkout__line-meta--blocked {
  color: var(--danger, #dc3545);
  font-weight: 500;
}

.supplier-cart-checkout__line--blocked .cart-checkout-qty {
  opacity: 0.55;
}

.supplier-cart-checkout__line-info {
  min-width: 0;
}

.supplier-cart-checkout__line-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-cart-checkout__line-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted, #6c757d);
}

.supplier-cart-checkout__line-qty .form-control {
  max-width: 4.5rem;
}

.supplier-cart-checkout__remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #6c757d);
  cursor: pointer;
}

.supplier-cart-checkout__remove:hover,
.supplier-cart-checkout__remove:focus-visible {
  background: color-mix(in srgb, var(--danger, #dc3545) 12%, transparent);
  color: var(--danger, #dc3545);
}

.supplier-cart-checkout__remove i {
  font-size: 0.7rem;
  pointer-events: none;
}

.supplier-cart-checkout-preview.card {
  min-height: 0;
}

.supplier-cart-checkout-preview__item {
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #d8dee8) 75%, transparent);
}

.supplier-cart-checkout-preview__item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.supplier-cart-checkout-preview__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 22rem;
  overflow: auto;
}

.supplier-cart-checkout-preview__spoiler {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--border, #d8dee8) 80%, transparent);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--muted, #6c757d) 4%, var(--card-bg, #fff));
  overflow: hidden;
}

.supplier-cart-checkout-preview__spoiler > summary {
  list-style: none;
}

.supplier-cart-checkout-preview__spoiler > summary::-webkit-details-marker {
  display: none;
}

.supplier-cart-checkout-preview__spoiler-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  user-select: none;
}

.supplier-cart-checkout-preview__spoiler-summary:hover {
  background: color-mix(in srgb, var(--muted, #6c757d) 8%, transparent);
}

.supplier-cart-checkout-preview__spoiler-chevron {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--muted, #6c757d);
  transition: transform 0.15s ease;
}

.supplier-cart-checkout-preview__spoiler[open] > .supplier-cart-checkout-preview__spoiler-summary .supplier-cart-checkout-preview__spoiler-chevron {
  transform: rotate(90deg);
}

.supplier-cart-checkout-preview__spoiler-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.supplier-cart-checkout-preview__spoiler-body {
  padding: 0 0.75rem 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #d8dee8) 70%, transparent);
}

.supplier-cart-checkout-preview__spoiler-body .supplier-product-summary__card {
  margin-top: 0.75rem;
}

#cart-checkout-summary {
  margin-top: 1rem;
}

#cart-checkout-qty-total {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  /* Как блок «К списанию»: место под две строки (сумма + курс) */
  min-height: calc(1.2rem * 1.2 + 0.12rem + 0.8125rem);
  display: flex;
  align-items: center;
}

.supplier-product-modal__footer {
  position: relative;
  z-index: 3;
  background: var(--card-footer-bg, var(--panel));
}

#supplier-product-copy-link-btn i {
  pointer-events: none;
}

.supplier-product-raw-card .card-header {
  border-bottom: 1px solid var(--line);
}

.supplier-filter-bar__clear {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-decoration: none;
}

.supplier-filter-bar__clear:hover {
  text-decoration: underline;
}

.supplier-filter-drop {
  position: relative;
}

.supplier-filter-drop__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-sizing: border-box;
  height: 1.875rem;
  min-height: 1.875rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  color: var(--text, inherit);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.supplier-filter-drop__toggle:hover {
  border-color: var(--primary, #2563eb);
}

.supplier-filter-drop.is-open .supplier-filter-drop__toggle,
.supplier-filter-drop.is-active .supplier-filter-drop__toggle {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
}

.supplier-filter-drop__icon {
  font-size: 0.7rem;
  color: var(--muted);
}

.supplier-filter-drop__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

.supplier-filter-drop__chevron {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.supplier-filter-drop.is-open .supplier-filter-drop__chevron {
  transform: rotate(180deg);
}

.supplier-filter-drop.is-open {
  z-index: 60;
}

.supplier-filter-drop__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 70;
  width: min(18rem, calc(100vw - 2rem));
  max-height: 18rem;
  display: none;
  flex-direction: column;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 12px;
  background: var(--card-bg, #fff);
  color: var(--text, #2c3440);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.supplier-filter-drop.is-open .supplier-filter-drop__panel {
  display: flex;
}

.supplier-filter-drop__head {
  padding: 0.65rem 0.85rem 0.35rem;
}

.supplier-filter-drop__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.supplier-filter-drop__search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem 0.5rem;
}

.supplier-filter-drop__search-icon {
  flex: 0 0 auto;
  width: 0.875rem;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.supplier-filter-drop__search {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 0.65rem;
  border-radius: 999px;
}

.supplier-filter-drop__options {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  /* Не растягивать пустоту: иначе при сбое высоты панели — белая дыра + скролл. */
  flex: 0 1 auto;
  min-height: 0;
  padding: 0.25rem 0.5rem 0.5rem;
  overflow: auto;
}

.supplier-filter-drop__panel--floating {
  position: fixed !important;
  z-index: 5000 !important;
  display: flex !important;
  height: auto !important;
  max-height: 18rem;
}

.supplier-filter-drop__panel--floating .supplier-filter-drop__options {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 12rem;
  overflow-y: auto;
}

.supplier-filter-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.supplier-filter-option:hover {
  background: var(--surface-muted);
}

.supplier-filter-option.is-hidden {
  display: none;
}

.supplier-filter-tree {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.supplier-filter-tree.is-hidden {
  display: none;
}

.supplier-filter-tree__children {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin-left: 0.85rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--border, #e2e8f0);
}

.supplier-filter-option--group .supplier-filter-option__text {
  font-weight: 600;
}

.supplier-filter-option__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.supplier-filter-option__box {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 4px;
  background: var(--card-bg, #fff);
  position: relative;
}

.supplier-filter-option__input:checked + .supplier-filter-option__box {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
}

.supplier-filter-option__input:checked + .supplier-filter-option__box::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.3rem;
  width: 0.28rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.supplier-filter-option__text {
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--text, #2c3440);
}

[data-theme="dark"] .supplier-filter-drop__panel {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.supplier-product-summary__card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.supplier-product-summary__body {
  min-width: 0;
  flex: 1 1 auto;
}

.supplier-product-summary__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
}

.supplier-product-summary__img {
  display: block;
  width: 7.5rem;
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  object-fit: cover;
  background: var(--bs-secondary-bg, #f3f4f6);
}

.supplier-product-desc {
  margin-top: 0.5rem;
}

.supplier-product-desc__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.supplier-product-desc__summary::-webkit-details-marker,
.supplier-product-desc__summary::marker {
  display: none;
  content: '';
}

.supplier-product-desc__summary::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 0.3rem;
  height: 0.3rem;
  margin-top: -0.05rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.supplier-product-desc[open] > .supplier-product-desc__summary::before {
  margin-top: 0;
  transform: rotate(45deg);
}

.supplier-product-desc__summary:hover {
  color: var(--text);
}

.supplier-product-desc__summary:hover::before {
  opacity: 1;
}

.supplier-product-desc__body {
  margin-top: 0.35rem;
  max-height: 8rem;
  overflow: auto;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.supplier-product-steam {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.supplier-product-steam__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.supplier-product-steam__media img {
  width: 140px;
  max-width: 40vw;
  height: auto;
  border-radius: 0.35rem;
  display: block;
}

.supplier-product-steam__body {
  min-width: 0;
  flex: 1;
}

.supplier-product-steam__name {
  font-weight: 600;
}

.supplier-product-steam__price-final {
  font-weight: 600;
}

.supplier-product-steam__discount {
  color: #198754;
  font-weight: 600;
  margin-left: 0.25rem;
}

.supplier-product-steam__price-was {
  text-decoration: line-through;
  color: var(--muted);
  margin-left: 0.25rem;
}

.supplier-product-steam__muted {
  font-size: 0.875rem;
  color: var(--muted);
}

.supplier-product-wholesale {
  margin-top: 0.55rem;
}

.supplier-product-wholesale__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.supplier-product-wholesale__summary::-webkit-details-marker,
.supplier-product-wholesale__summary::marker {
  display: none;
  content: '';
}

.supplier-product-wholesale__summary::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 0.3rem;
  height: 0.3rem;
  margin-top: -0.05rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.supplier-product-wholesale[open] > .supplier-product-wholesale__summary::before {
  margin-top: 0;
  transform: rotate(45deg);
}

.supplier-product-wholesale__summary:hover {
  color: var(--text);
}

.supplier-product-wholesale__summary:hover::before {
  opacity: 1;
}

.supplier-product-wholesale__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 14%, transparent);
}

.supplier-product-wholesale__body {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.supplier-product-wholesale__offer {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 14%, transparent);
}

.supplier-product-wholesale__offer.is-empty {
  opacity: 0.72;
}

.supplier-product-wholesale__merchant {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin-bottom: 0.3rem;
}

.supplier-product-wholesale__name {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.supplier-product-wholesale__stock {
  font-size: 0.6875rem;
  line-height: 1.25;
  color: var(--muted);
}

.supplier-product-wholesale__stock--ok {
  color: var(--green, #3fb950);
}

.supplier-product-wholesale__stock--empty {
  color: var(--muted);
}

.supplier-product-wholesale__tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.supplier-product-wholesale__tier {
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 4.75rem;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  background: var(--panel, var(--bs-body-bg, #fff));
  border: 1px solid color-mix(in srgb, var(--muted) 16%, transparent);
  white-space: nowrap;
}

.supplier-product-wholesale__qty {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.supplier-product-wholesale__price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.supplier-product-wholesale__rub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: help;
}

.supplier-product-wholesale__empty {
  font-size: 0.75rem;
  color: var(--muted);
}

.supplier-catalog-table__min-col,
.supplier-catalog-table__sold-col {
  white-space: nowrap;
  width: 1%;
}

.supplier-order-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
}

.supplier-order-modal__header {
  align-items: center;
  gap: 0.5rem;
}

.supplier-order-modal__title {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: auto;
}

.supplier-order-modal__refresh {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.supplier-order-modal__header .btn-close {
  flex: 0 0 auto;
  margin: 0;
}

.supplier-order-summary__label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.supplier-order-keys {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.supplier-order-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.supplier-order-key__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  flex: 1 1 auto;
  min-width: 0;
}

.supplier-order-key__copy {
  flex: 0 0 auto;
  padding-inline: 0.45rem;
}

.supplier-order-keys-bulk {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 0.5rem 0.75rem;
}

.supplier-order-keys-bulk__summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  user-select: none;
}

.supplier-order-keys-bulk__summary:hover {
  color: var(--primary, #0d6efd);
}

.supplier-order-keys-bulk[open] .supplier-order-keys-bulk__summary {
  margin-bottom: 0.5rem;
}

/* Не display:none: иначе colspan пустой строки ломает ширину таблицы */
.supplier-orders-card:not(.supplier-orders-card--bulk) .supplier-orders-bulk-col {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}

.supplier-orders-card:not(.supplier-orders-card--bulk) .supplier-orders-bulk-col * {
  display: none;
}

.supplier-orders-card--bulk .supplier-orders-bulk-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
  vertical-align: middle;
}

.supplier-orders-card--bulk .supplier-orders-bulk-col .form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  float: none;
  vertical-align: middle;
}

.supplier-orders-bulk-enter-btn--hidden {
  display: none !important;
}

.supplier-order-keys-bulk__textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.35;
  resize: vertical;
  min-height: 8rem;
  max-height: 20rem;
}

.supplier-order-keys-bulk__textarea--large {
  min-height: 12rem;
  max-height: min(50vh, 32rem);
}

.supplier-order-product {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.supplier-order-product-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.2rem;
  max-width: 100%;
  min-width: 0;
  vertical-align: top;
}

.supplier-order-product-inline .supplier-order-product-link-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 1.35rem);
}

.supplier-order-product-id-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.05rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1;
  cursor: pointer;
}

.supplier-order-product-id-copy:hover,
.supplier-order-product-id-copy:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--line) 35%, transparent);
  outline: none;
}

.supplier-order-product-id-copy i {
  pointer-events: none;
  font-size: 0.6875rem;
}

.supplier-order-product-link-wrap {
  display: inline-block;
  max-width: 100%;
  position: relative;
}

.supplier-order-product-link {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue, #2563eb);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.supplier-order-product-link__text {
  display: inline;
}

.supplier-order-product-link:hover,
.supplier-order-product-link:focus-visible {
  text-decoration: underline;
}

.dashboard-recent-orders__mp-col {
  width: 9rem;
  max-width: 11rem;
}

.order-marketplace-id,
.dashboard-recent-orders__order-id {
  display: inline-block;
  font-size: 0.8125rem;
  padding: 0.12rem 0.4rem;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
}

a:hover .order-marketplace-id,
a:focus-visible .order-marketplace-id {
  border-color: rgba(88, 166, 255, 0.45);
  background: var(--panel-hover);
}

.dashboard-recent-orders__money-col {
  text-align: right;
  white-space: nowrap;
}

.dashboard-recent-orders__status-col {
  white-space: nowrap;
}

.dashboard-recent-orders__codes-col {
  width: 2.5rem;
  text-align: center;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

.dashboard-recent-orders__codes-ok {
  color: var(--green, #1a7f37);
  font-weight: 600;
}

.dashboard-recent-orders__codes-pending {
  color: var(--amber, #9a6700);
}

.dashboard-recent-orders__codes-cancelled {
  color: var(--text-muted, #6c757d);
}

.dashboard-recent-orders__tail-col {
  width: 1%;
  white-space: nowrap;
  padding-right: 1rem !important;
}

.dashboard-recent-orders__tail {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.dashboard-recent-orders__date {
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dashboard-recent-orders__tail .btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.8125rem;
}

.stat-card--alert {
  box-shadow: 0 0 0 1px rgba(210, 153, 34, 0.45), var(--shadow);
  animation: stat-pulse 2s ease-in-out infinite;
}

@keyframes stat-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(210, 153, 34, 0.35), var(--shadow); }
  50% { box-shadow: 0 0 0 2px rgba(210, 153, 34, 0.65), var(--shadow); }
}

/* ——— Cards ——— */

.card {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.card.supplier-catalog-filters-card,
.card.supplier-catalog-filters-card .card-body {
  overflow: visible;
}

.card.supplier-catalog-table-card {
  position: relative;
  z-index: 1;
}

.supplier-catalog-table-card > .supplier-catalog-table-wrap.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.card-body {
  padding: 18px;
}

.card-body.p-0 {
  padding: 0 !important;
}

.card-footer {
  padding: 12px 18px;
  background: var(--card-footer-bg);
  border-top: 1px solid var(--line);
}

.card-footer--split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-danger {
  border-color: rgba(248, 81, 73, 0.4);
}

/* ——— Tables ——— */

.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-color: var(--text);
  --bs-table-striped-bg: var(--table-striped-bg);
  --bs-table-hover-color: var(--text);
  --bs-table-hover-bg: var(--table-hover-bg);
  --bs-table-active-color: var(--text);
  border-collapse: collapse;
}

.table > :not(caption) > * > * {
  color: var(--text);
  background-color: transparent;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-color-type: var(--text);
  --bs-table-bg-type: var(--table-striped-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 9999px var(--table-striped-bg);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-color-state: var(--text);
  color: var(--text);
  box-shadow: inset 0 0 0 9999px var(--table-hover-bg);
}

.table thead th {
  color: var(--muted) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-strong);
  padding: 12px 10px;
  background-color: var(--table-head-bg) !important;
  box-shadow: none;
}

.table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table-sm td,
.table-sm th {
  padding: 11px 12px;
  line-height: 1.4;
}

.table td .btn,
.table td a.btn,
.table td button.btn {
  color: var(--bs-btn-color);
}

.table td .btn:hover,
.table td a.btn:hover,
.table td button.btn:hover {
  color: var(--bs-btn-hover-color);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* flex на самом td/th ломает сетку таблицы */
td.table-actions,
th.table-actions {
  display: table-cell;
  vertical-align: middle;
}

.table-actions .btn {
  margin-right: 0;
}

.table-actions form {
  display: inline-flex;
  margin: 0;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.35em;
  opacity: 0.35;
  vertical-align: middle;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.sortable-th.sort-asc::after {
  opacity: 0.9;
  transform: rotate(-135deg) translateY(1px);
}

.sortable-th.sort-desc::after {
  opacity: 0.9;
  transform: rotate(45deg) translateY(-1px);
}

/* ——— Buttons (fix hover text) ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

button.btn {
  color: var(--bs-btn-color);
}

button.btn:hover,
button.btn:focus-visible {
  color: var(--bs-btn-hover-color);
}

button.btn:active:not(:disabled) {
  color: var(--bs-btn-active-color, var(--bs-btn-hover-color, var(--bs-btn-color)));
}

a.btn:active:not(:disabled) {
  color: var(--bs-btn-active-color, var(--bs-btn-hover-color, var(--bs-btn-color)));
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-xs {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

a.btn {
  color: var(--bs-btn-color);
  text-decoration: none;
}

a.btn:hover,
a.btn:focus-visible {
  color: var(--bs-btn-hover-color);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1f6feb;
  --bs-btn-border-color: #1f6feb;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #388bfd;
  --bs-btn-hover-border-color: #388bfd;
  background-color: var(--bs-btn-bg);
  border: 1px solid var(--bs-btn-border-color);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
}

.btn-outline-primary {
  --bs-btn-color: var(--blue);
  --bs-btn-border-color: rgba(88, 166, 255, 0.45);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1f6feb;
  --bs-btn-hover-border-color: #1f6feb;
}

.btn-outline-secondary {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-bg: var(--panel);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--panel-hover);
  --bs-btn-hover-border-color: var(--btn-outline-secondary-hover-border);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--panel-hover);
  --bs-btn-active-border-color: var(--btn-outline-secondary-hover-border);
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-bg: var(--panel);
  --bs-btn-disabled-border-color: var(--line);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible,
.btn-outline-secondary:active:not(:disabled) {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
}

.btn-outline-success {
  --bs-btn-color: var(--green);
  --bs-btn-border-color: rgba(63, 185, 80, 0.45);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #238636;
  --bs-btn-hover-border-color: #238636;
}

.btn-outline-danger {
  --bs-btn-color: var(--red);
  --bs-btn-border-color: rgba(248, 81, 73, 0.45);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #da3633;
  --bs-btn-hover-border-color: #da3633;
}

.btn-outline-info {
  --bs-btn-color: #1f6feb;
  --bs-btn-border-color: rgba(31, 111, 235, 0.45);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1f6feb;
  --bs-btn-hover-border-color: #1f6feb;
  --bs-btn-active-color: #fff;
}

.btn-success {
  --bs-btn-color: #fff;
  --bs-btn-bg: #238636;
  --bs-btn-border-color: #238636;
  --bs-btn-hover-color: #fff;
}

.btn-info {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1f6feb;
  --bs-btn-border-color: #1f6feb;
  --bs-btn-hover-color: #fff;
}

.btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: #9e6a03;
  --bs-btn-border-color: #9e6a03;
  --bs-btn-hover-color: #fff;
}

.btn-secondary {
  --bs-btn-color: var(--text);
  --bs-btn-bg: var(--panel-hover);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--border-strong);
  --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--border-strong);
  --bs-btn-active-border-color: var(--border-strong);
  background-color: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.btn-secondary:active:not(:disabled) {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
}

/* ——— Forms ——— */

.form-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
  background-color: var(--bg-elevated);
  color: var(--text);
}

.form-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 2.25rem 8px 12px;
  background-color: var(--bg-elevated);
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 14px 10px;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background-color: var(--surface-muted);
  color: var(--text);
  border-color: var(--line);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

.form-control:disabled::placeholder,
.form-control[readonly]::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
  background-color: var(--bg-elevated);
  color: var(--text);
}

.form-select:focus {
  background-image: var(--select-arrow);
}

/*
 * Скруглённый список опций — только CSS (Chrome/Edge 134+).
 * Safari/Firefox пока показывают системный список — это нормальный fallback.
 */
@supports (appearance: base-select) {
  .form-select,
  .form-select::picker(select) {
    appearance: base-select;
  }

  /* base-select рисует кнопку как flex — без этого текст «плывёт» вверх */
  .form-select {
    display: flex;
    align-items: center;
  }

  .form-select::picker-icon {
    display: none;
  }

  .form-select::picker(select) {
    margin-top: 4px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    box-shadow: var(--shadow);
  }

  [data-theme="dark"] .form-select::picker(select) {
    background: var(--panel);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  }

  .form-select option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 0.45rem 0.6rem;
    border-radius: 7px;
    font-size: inherit;
    text-align: left;
    color: var(--text);
    background: transparent;
    cursor: pointer;
  }

  .form-select option::checkmark {
    display: none;
    content: none;
  }

  .form-select option:hover,
  .form-select option:focus-visible {
    background: var(--table-hover-bg);
  }

  .form-select option:checked {
    background: var(--nav-active-bg);
    font-weight: 600;
  }

  .form-select option:disabled {
    opacity: 0.45;
    cursor: default;
  }

  .form-select optgroup {
    padding: 0.2rem 0;
    font-weight: 600;
    color: var(--muted);
  }

  /* Пункты внутри категории — с отступом, как дерево */
  .form-select optgroup option {
    padding-left: 1.15rem;
  }

  /* Компактный список у маленьких select (период на главной и т.п.) */
  .form-select-sm::picker(select),
  .dashboard-period-select::picker(select) {
    padding: 0.25rem;
    border-radius: 8px;
  }

  .form-select-sm option,
  .dashboard-period-select option {
    min-height: 0;
    padding: 0.32rem 0.55rem;
    border-radius: 6px;
    line-height: 1.3;
    font-size: 0.875rem;
  }

  .form-select-sm optgroup option,
  .dashboard-period-select optgroup option {
    padding-left: 1.05rem;
  }
}

/* file input — единый вид в светлой/тёмной теме, без белой кнопки и наложения при hover */
.form-control[type="file"] {
  padding: 0.35rem 0.75rem;
  line-height: 1.5;
  overflow: hidden;
}

.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
  margin: 0 0.75rem 0 0;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-hover);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]:hover::-webkit-file-upload-button {
  background: var(--panel);
  border-color: var(--border-strong);
  color: var(--text);
}

.form-control[type="file"]:focus::file-selector-button,
.form-control[type="file"]:focus::-webkit-file-upload-button {
  background: var(--panel-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

[data-theme="dark"] .form-control[type="file"] {
  color-scheme: dark;
}

[data-theme="dark"] .form-control[type="file"]::file-selector-button,
[data-theme="dark"] .form-control[type="file"]::-webkit-file-upload-button {
  background: var(--panel-hover);
  color: var(--text);
  border-color: var(--line);
}

[data-theme="dark"] .form-control[type="file"]:hover::file-selector-button,
[data-theme="dark"] .form-control[type="file"]:hover::-webkit-file-upload-button {
  background: #30363d;
  border-color: var(--border-strong);
  color: var(--text);
}

.form-select.dashboard-period-select {
  min-height: 0;
  height: 1.75rem;
  padding: 0 1.35rem 0 0.4rem;
  line-height: 1.75rem;
  border-radius: 6px;
  background-position: right 0.45rem center;
  background-size: 12px 8px;
}

.form-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.form-text {
  color: var(--muted) !important;
  font-size: 12px;
  margin-top: 6px;
}

.form-check-input {
  background-color: var(--bg-elevated);
  border-color: var(--border-strong);
}

.form-check-input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
}

.form-check-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.2);
}

/* Bootstrap switch: unchecked thumb is rgba(0,0,0,.25) — invisible on dark track */
[data-theme="dark"] .form-switch .form-check-input {
  background-color: var(--border-strong);
  border-color: var(--line);
}

[data-theme="dark"] .form-switch .form-check-input:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23e6edf3'/%3e%3c/svg%3e");
}

[data-theme="dark"] .form-switch .form-check-input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}

.form-check-label {
  color: var(--text);
}

.app-main .bg-light,
.bg-light {
  background-color: var(--bg-elevated) !important;
  color: var(--text);
  border-color: var(--line) !important;
}

.app-main .bg-white,
.bg-white {
  background-color: var(--bg-elevated) !important;
  color: var(--text);
}

.table-light {
  --bs-table-bg: var(--table-head-bg);
  --bs-table-color: var(--muted);
}

.table-light > :not(caption) > * > * {
  background-color: var(--table-head-bg) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

.list-group-item {
  background-color: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background-color: var(--panel-hover);
  color: var(--text);
}

.list-group-flush > .list-group-item {
  border-left: 0;
  border-right: 0;
}

.devtools-table-list .list-group-item.active {
  color: var(--text) !important;
  font-weight: 600;
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  box-shadow: inset 3px 0 0 var(--blue);
}

.devtools-db-table {
  width: max-content;
  min-width: 100%;
}

.devtools-db-table th {
  white-space: nowrap;
  vertical-align: bottom;
}

.devtools-db-table th.devtools-db-col-id,
.devtools-db-table td.devtools-db-col-id {
  width: 1%;
  min-width: 4.5rem;
  white-space: nowrap;
  vertical-align: top;
}

.devtools-db-table th.devtools-db-col-dt,
.devtools-db-table td.devtools-db-col-dt {
  white-space: nowrap;
  vertical-align: top;
}

.devtools-db-table th.devtools-db-col-compact,
.devtools-db-table td.devtools-db-col-compact {
  white-space: nowrap;
  vertical-align: top;
}

.devtools-db-table th.devtools-db-col-text,
.devtools-db-table td.devtools-db-col-text {
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.devtools-db-sort-link {
  color: inherit;
  text-decoration: none;
}

.devtools-db-sort-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.devtools-db-sort-link-active {
  color: var(--blue);
  font-weight: 600;
}

.devtools-subnav.nav-tabs {
  margin-top: -0.25rem;
  padding-left: 0;
  border-bottom-color: var(--line);
}

.devtools-subnav .nav-link {
  font-size: 0.8125rem;
  padding: 0.4rem 0.85rem;
}

.modal-content {
  background-color: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.modal-header,
.modal-footer {
  border-color: var(--line);
}

.modal-title {
  color: var(--text);
}

.btn-close {
  filter: var(--bs-btn-close-filter);
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
  background-color: rgba(210, 153, 34, 0.18) !important;
  color: var(--amber) !important;
}

.badge.bg-info,
.badge.bg-info.text-dark {
  background-color: rgba(88, 166, 255, 0.18) !important;
  color: var(--blue) !important;
}

.accordion-button {
  background-color: var(--panel);
  color: var(--text);
}

.accordion-button:not(.collapsed) {
  background-color: var(--panel-hover);
  color: var(--text);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.2);
}

[data-theme="dark"] .accordion-button::after {
  filter: brightness(0) invert(1);
  opacity: 0.55;
}

.input-group {
  align-items: stretch;
}

.input-group > .form-control,
.input-group > .form-select {
  flex: 1 1 auto;
  width: 1%;
}

.input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background-color: var(--panel-hover);
  border: 1px solid var(--line);
}

.input-group > :not(:first-child) {
  margin-left: -1px;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child),
.input-group > .input-group-text:not(:last-child),
.input-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child),
.input-group > .input-group-text:not(:first-child),
.input-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group {
  isolation: isolate;
}

.input-group > .form-control:focus,
.input-group > .form-select:focus {
  z-index: 3;
}

.input-group > .input-group-text {
  z-index: 2;
}

/* ——— Alerts ——— */

.alert {
  border-radius: 8px;
  border-width: 1px;
}

.alert-dismissible {
  isolation: isolate;
}

.alert-danger {
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.12);
  color: #ffaba8;
}

.alert-success {
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.12);
  color: #7ee787;
}

.alert-warning {
  border-color: rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.12);
  color: #e3b341;
}

.alert-info {
  border-color: rgba(88, 166, 255, 0.4);
  background: rgba(88, 166, 255, 0.12);
  color: #79b8ff;
}

.alert-light {
  border-color: var(--line);
  background: var(--bg-elevated);
  color: var(--text);
}

.alert-secondary {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.warehouse-context-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
}

.warehouse-context-banner strong {
  color: var(--text);
}

.text-success { color: var(--green) !important; }
.text-warning { color: var(--amber) !important; }
.text-danger { color: var(--red) !important; }
.text-info { color: var(--blue) !important; }

/* ——— Badges ——— */

.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 5px 10px;
}

.bg-success { background-color: rgba(63, 185, 80, 0.18) !important; color: var(--green) !important; }
.bg-warning { background-color: rgba(210, 153, 34, 0.18) !important; color: var(--amber) !important; }
.bg-danger { background-color: rgba(248, 81, 73, 0.18) !important; color: var(--red) !important; }
.bg-info { background-color: rgba(88, 166, 255, 0.18) !important; color: var(--blue) !important; }
.bg-secondary { background-color: rgba(139, 148, 158, 0.18) !important; color: var(--muted) !important; }
.bg-primary { background-color: rgba(88, 166, 255, 0.18) !important; color: var(--blue) !important; }

/* ——— Nav tabs / pills ——— */

.settings-tabs,
.nav-tabs {
  border-bottom: 1px solid var(--line);
  gap: 4px;
  width: 100%;
}

.settings-tabs.nav-fill > .nav-item {
  flex: 1 1 0;
  min-width: 0;
}

.settings-tabs .nav-link,
.nav-tabs .nav-link {
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: 10px 10px;
  font-weight: 600;
}

.settings-tabs.nav-fill .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .settings-tabs.nav-fill > .nav-item {
    flex: 1 1 calc(33.333% - 4px);
  }
}

@media (max-width: 575.98px) {
  .settings-tabs.nav-fill > .nav-item {
    flex: 1 1 calc(50% - 4px);
  }

  .settings-tabs.nav-fill .nav-link {
    font-size: 0.8125rem;
    padding: 8px 6px;
  }

  .settings-tabs.nav-fill .nav-link .me-1 {
    margin-right: 0.2rem !important;
  }
}

.settings-tabs .nav-link:hover,
.nav-tabs .nav-link:hover {
  color: var(--blue);
}

.settings-tabs .nav-link.active,
.nav-tabs .nav-link.active {
  color: var(--blue);
  background: var(--panel);
  border-color: var(--line) var(--line) var(--panel);
}

.settings-shell {
  width: 100%;
  max-width: 920px;
}

.settings-shell .settings-tabs {
  border-bottom: none;
  width: auto;
  margin-bottom: 1rem;
  gap: 0.35rem;
}

.settings-shell .settings-tabs .nav-item {
  flex: 0 0 auto;
}

.settings-shell .settings-tabs.nav-pills .nav-link {
  margin-right: 0;
  font-size: 0.875rem;
  padding: 0.45rem 0.85rem;
}

.settings-shell__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-shell__body > .card:only-child {
  margin-bottom: 0;
}

/* ——— Shops / warehouse page tabs (segmented) ——— */

.shops-tabs,
.warehouse-tabs {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  max-width: 28rem;
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.warehouse-tabs {
  margin-top: 0.25rem;
}

.page-head--warehouse .warehouse-tabs--head {
  margin-top: 0;
  margin-bottom: 0;
  max-width: 15rem;
}

.shops-tabs__item,
.warehouse-tabs__item {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.shops-tabs__item:hover:not(.is-active),
.warehouse-tabs__item:hover:not(.is-active) {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--line);
}

.shops-tabs__item.is-active,
.shops-tabs__item.is-active:hover,
.warehouse-tabs__item.is-active,
.warehouse-tabs__item.is-active:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.warehouse-add-mode {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-elevated);
}

.warehouse-add-card__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.warehouse-add-card .card-header {
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.warehouse-add-mode__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.warehouse-add-mode__item:hover:not(.is-active) {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--line);
}

.warehouse-add-mode__item.is-active,
.warehouse-add-mode__item.is-active:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.shops-tabs__item:focus-visible,
.warehouse-tabs__item:focus-visible {
  outline: 2px solid rgba(88, 166, 255, 0.55);
  outline-offset: 2px;
}

.shops-tabs__item i {
  font-size: 0.8125rem;
  opacity: 0.9;
}

.shops-tabs__item.is-active i,
.shops-tabs__item.is-active span {
  color: #fff;
  opacity: 1;
}

.shops-tabs__item span {
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .shops-tabs,
  .warehouse-tabs {
    max-width: none;
  }

  .shops-tabs__item,
  .warehouse-tabs__item {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
  }
}

.shops-work .settings-block-lead {
  color: var(--text);
  opacity: 0.78;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.page-nav__link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.page-nav__link:hover {
  color: var(--blue);
}

.page-nav__link .fas {
  font-size: 0.75rem;
  margin-right: 0.2rem;
  opacity: 0.75;
}

.page-nav__sep {
  color: var(--line);
  user-select: none;
}

.supplier-connection-form .settings-block-title .fas {
  color: var(--muted);
}

.supplier-connection-fields .settings-divider {
  margin: 1rem 0;
}

.supplier-purchase-form__sections {
  gap: 1.15rem;
}

.supplier-connections-page .supplier-connections-grid {
  align-items: stretch;
}

.supplier-connection-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.supplier-connection-card:hover {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.supplier-connection-card--inactive {
  opacity: 0.88;
}

.supplier-connection-card.h-100 {
  display: flex;
  flex-direction: column;
}

.supplier-connection-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.75rem;
}

.supplier-connection-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
}

.supplier-connection-card__badge-link {
  color: inherit;
  text-decoration: none;
}

.supplier-connection-card__badge-link:hover .supplier-type-badge {
  color: var(--blue);
}

.supplier-connection-card__badge-link:hover .supplier-type-badge .fas {
  color: var(--blue);
}

.supplier-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.supplier-type-badge .fas {
  width: 1rem;
  text-align: center;
  color: var(--blue);
}

.supplier-connection-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.15rem;
}

.supplier-connection-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0;
}

.supplier-connection-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.supplier-connection-card__meta-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.supplier-connection-card__meta-row dd {
  margin: 0;
  color: var(--text);
}

.supplier-connection-card__meta-row dd.tabular-nums,
.supplier-connection-card__meta-row .tabular-nums {
  font-variant-numeric: tabular-nums;
}

.supplier-connection-card__title-link {
  color: var(--text);
  text-decoration: none;
}

.supplier-connection-card__title-link:hover {
  color: var(--blue);
}

.supplier-connection-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.supplier-connection-card__drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-size: 0.85rem;
  opacity: 0.7;
}

.supplier-connection-card__drag:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  opacity: 1;
}

.supplier-connection-card__drag:active {
  cursor: grabbing;
}

.supplier-connection-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}

.supplier-connection-card__delete {
  margin: 0;
}

.supplier-connection-card-col--dragging {
  opacity: 0.45;
}

.supplier-connection-card-col--drop-target > .supplier-connection-card {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 2px;
}

.supplier-connection-card--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 9.5rem;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.supplier-connection-card--add:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 6%, transparent);
}

.supplier-connection-card__add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.9rem;
}

.supplier-connection-card__add-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.supplier-connection-card--empty {
  border-style: dashed;
}

.supplier-catalog-auto-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.supplier-catalog-auto-interval .form-label {
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.supplier-catalog-auto-interval .form-select {
  width: 100%;
  max-width: 14rem;
}

.shops-work__switch .form-check-label {
  font-weight: 500;
}

.settings-id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.settings-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.8125rem;
}

.settings-id-chip__label {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.settings-id-chip code {
  font-size: 0.8125rem;
  color: var(--text);
  background: transparent;
  padding: 0;
}

.shops-work .settings-subsection-title {
  color: var(--text);
  opacity: 0.62;
}

.shops-work .settings-kv dt {
  color: var(--text);
  opacity: 0.62;
}

.shops-work .settings-kv dd {
  color: var(--text);
}

.shops-work__chat-ai {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.shops-work__chat-templates {
  margin-top: 0.75rem;
}

.chat-templates-editor__row {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.chat-templates-editor__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chat-templates-editor__row + .chat-templates-editor__row {
  margin-top: 0.25rem;
}

.chat-templates-editor__legend ul {
  margin-bottom: 0;
}

.chat-templates-editor__legend li + li {
  margin-top: 0.15rem;
}

/* Список подключений на странице «Магазины» */
.shops-connections-table .mp-icon {
  width: 20px;
  height: 20px;
}

.shops-connections__name-col {
  min-width: 7rem;
}

.shops-connections__name-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.shops-connections__name-link:hover {
  color: var(--blue);
}

.shops-connections__mp-col {
  width: 9.5rem;
  white-space: nowrap;
}

.shops-connections__status-col {
  width: 6.5rem;
  white-space: nowrap;
}

.shops-connections__actions-col {
  width: auto;
  min-width: 10.5rem;
  white-space: nowrap;
  vertical-align: middle;
}

.shops-connections-table .table-actions {
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.shops-connections-table .table-actions .btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.8125rem;
}

.shops-connections__row--selected {
  background: var(--nav-active-bg);
}

.shops-connections__row--selected .shops-connections__name-link {
  color: var(--blue);
}

.shops-connection-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.shops-connection-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.shops-connection-form .card-body {
  flex: 1 1 auto;
}

.shops-connection-form .card-footer {
  margin-top: auto;
}

/* ——— Settings blocks (вкладки настроек) ——— */

.settings-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 1rem 1.15rem;
}

.settings-col-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-subsection {
  margin-bottom: 0;
}

.settings-subsection--muted .settings-subsection-title,
.settings-subsection--muted .settings-block-lead {
  color: var(--muted);
}

.settings-subsection-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.settings-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
  opacity: 1;
}

.settings-block-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.settings-block-title .fas {
  width: 1.1rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.settings-block-lead {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.settings-hints {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-hints li + li {
  margin-top: 0.25rem;
}

.settings-steps {
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-steps li + li {
  margin-top: 0.35rem;
}

.settings-kv {
  margin: 0.85rem 0 0;
}

.settings-kv dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 0.65rem;
}

.settings-kv dt:first-child {
  margin-top: 0;
}

.settings-kv dd {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  word-break: break-all;
}

.settings-kv dd code {
  font-size: inherit;
}

.settings-conn-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-conn-hint .fas {
  color: var(--blue);
  margin-top: 2px;
}

.settings-conn-hint a {
  font-weight: 600;
}

.settings-orders-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  padding-left: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.settings-orders-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.settings-orders-nav-link:hover {
  color: var(--blue);
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.settings-orders-nav-link--muted {
  color: var(--muted);
}

.settings-mp-section {
  scroll-margin-top: 12px;
  margin-bottom: 1.75rem;
}

.settings-mp-section:last-child {
  margin-bottom: 0;
}

.settings-mp-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.settings-mp-heading .fas {
  width: 1.15rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.settings-mp-section--soon .settings-mp-heading,
.settings-mp-section--soon .settings-block-lead {
  color: var(--muted);
}

.settings-block--soon {
  background: var(--panel);
  border-style: dashed;
}

.settings-block--featured {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--panel) 100%);
}

.settings-block--compact {
  padding: 0.9rem 1rem;
}

.ym-orders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1rem;
  align-items: start;
}

.ym-orders-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ym-orders-aside-hint {
  margin: 0;
  font-size: 0.8125rem;
}

.settings-copy-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.settings-copy-field .form-control {
  flex: 1 1 12rem;
  min-width: 0;
}

.settings-copy-field .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.settings-steps--boxed {
  margin-top: 1rem;
  padding: 0.85rem 1rem 0.85rem 2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.settings-event-tags-label {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.settings-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-event-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  letter-spacing: 0.01em;
}

.settings-event-tag--muted {
  opacity: 0.45;
  border-style: dashed;
}

.settings-event-tag--optional:not(.settings-event-tag--muted) {
  border-color: var(--blue);
}

@media (max-width: 991.98px) {
  .ym-orders-grid {
    grid-template-columns: 1fr;
  }
}

.nav-pills .nav-link {
  color: var(--muted) !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  font-weight: 600;
  margin-right: 6px;
}

.nav-pills .nav-link:hover {
  color: var(--text) !important;
  background: var(--panel-hover);
  border-color: var(--border-strong);
}

.nav-pills .nav-link.active,
.nav-pills .nav-link.active:hover {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

/* ——— Page help spoilers ——— */

.page-help-spoiler {
  --help-accent: var(--blue);
  border: 1px solid var(--border-strong) !important;
  border-left: 4px solid var(--help-accent) !important;
  border-radius: 10px !important;
  background: var(--panel) !important;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.06) !important;
  overflow: hidden;
}

.page-help-spoiler.border-info { --help-accent: var(--blue); }
.page-help-spoiler.border-warning { --help-accent: var(--amber); }
.page-help-spoiler.border-success { --help-accent: var(--green); }

.page-help-spoiler .spoiler-header {
  display: flex !important;
  align-items: center;
  width: 100%;
  cursor: pointer;
  user-select: none;
  background: var(--panel) !important;
  border-bottom: 1px solid transparent;
  color: var(--text);
}

.page-help-spoiler .spoiler-header[aria-expanded="true"] {
  border-bottom-color: var(--border-strong);
}

.page-help-spoiler .spoiler-header:hover {
  background: var(--panel-hover) !important;
}

.page-help-spoiler .card-body {
  background: var(--panel);
  border-top: 0;
  color: var(--text);
}

.page-help-spoiler .spoiler-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.page-help-spoiler .spoiler-header[aria-expanded="true"] .spoiler-chevron {
  transform: rotate(-135deg);
}

.page-help-group {
  border: 1px solid var(--border-strong) !important;
  background: var(--panel) !important;
}

.page-help-group .card-header {
  background: var(--panel-hover) !important;
  color: var(--text);
  border-bottom-color: var(--line) !important;
}

[data-theme="dark"] .page-help-group .card-header {
  background: rgba(255, 255, 255, 0.04) !important;
}

.page-help-group .accordion-button {
  background: var(--panel);
  color: var(--text);
  box-shadow: none !important;
}

.page-help-group .accordion-button:not(.collapsed) {
  background: var(--panel-hover);
  color: var(--text);
}

.page-help-group .accordion-body {
  background: var(--panel);
  color: var(--text);
}

/* ——— Filter bar ——— */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px;
}

.filter-bar .filter-toolbar-form {
  flex: 1 1 420px;
  min-width: 0;
}

.orders-product-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
}

.orders-product-filter__name {
  font-weight: 500;
}

.orders-attention-filter__value {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  background: var(--nav-active-bg, rgba(74, 134, 197, 0.1));
  border: 1px solid var(--nav-active-border, rgba(74, 134, 197, 0.2));
}

.orders-product-filter__clear {
  margin-left: auto;
}

.orders-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
}

.orders-bulk-toolbar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  flex: 1 1 280px;
}

.orders-bulk-toolbar__count {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.orders-bulk-toolbar__link {
  font-size: 0.875rem;
  text-decoration: none;
}

.orders-bulk-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 575.98px) {
  .warehouse-bulk-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .warehouse-bulk-toolbar .orders-bulk-toolbar__main {
    flex: 0 0 auto;
  }

  .warehouse-bulk-toolbar .orders-bulk-toolbar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .warehouse-bulk-toolbar .orders-bulk-toolbar__actions .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.8125rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Bulk: «Выбрать» у фильтров; панель только в режиме выбора */
.warehouse-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.warehouse-list-toolbar .filter-toolbar-form,
.warehouse-groups-toolbar .filter-toolbar-form {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.warehouse-list-toolbar .filter-toolbar-form {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
}

.warehouse-groups-toolbar .filter-toolbar-form {
  width: 100%;
  min-width: 0;
}

.warehouse-list-toolbar .filter-selects-inline,
.warehouse-groups-toolbar .filter-selects-inline,
.warehouse-list-toolbar .filter-bar-btn,
.warehouse-groups-toolbar .filter-bar-btn {
  flex: 0 0 auto;
}

.warehouse-list-toolbar .warehouse-bulk-enter-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.warehouse-list-toolbar .filter-search-wrap,
.warehouse-groups-toolbar .filter-search-wrap {
  flex: 1 1 12rem;
  min-width: 9rem;
}

/* Обёртка: нативный select рисует текст поверх padding — маска со стрелкой перекрывает хвост */
.warehouse-list-toolbar .warehouse-entity-select,
.warehouse-groups-toolbar .warehouse-entity-select {
  position: relative;
  flex: 0 1 calc(var(--mm-select-ch, 20) * 1ch + 2.25rem);
  width: calc(var(--mm-select-ch, 20) * 1ch + 2.25rem);
  max-width: 100%;
  min-width: 0;
}

.warehouse-list-toolbar .warehouse-entity-select::after,
.warehouse-groups-toolbar .warehouse-entity-select::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 2.1rem;
  border-radius: 0 7px 7px 0;
  background-color: var(--bg-elevated);
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 14px 10px;
  pointer-events: none;
  z-index: 1;
}

.warehouse-list-toolbar .filter-select--warehouse-entity,
.warehouse-groups-toolbar .filter-select--warehouse-entity {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-right: 2.25rem;
  background-image: none;
  box-sizing: border-box;
}

.warehouse-list-toolbar .warehouse-entity-select:focus-within::after,
.warehouse-groups-toolbar .warehouse-entity-select:focus-within::after {
  background-color: var(--bg-elevated);
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-bulk-bar,
.orders-list-card:not(.orders-list-card--bulk) .orders-bulk-bar {
  display: none;
}

.warehouse-bulk-bar,
.orders-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated, var(--panel));
}

.warehouse-bulk-bar .warehouse-bulk-toolbar,
.orders-bulk-bar .orders-bulk-toolbar {
  flex: 1 1 auto;
  width: 100%;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.warehouse-bulk-enter-btn--hidden,
.orders-bulk-enter-btn--hidden {
  display: none !important;
}

.orders-bulk-sync-form {
  display: inline-flex;
}

/* Не display:none: иначе colspan пустой строки ломает ширину таблицы */
.orders-list-card:not(.orders-list-card--bulk) .orders-bulk-col {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}

.orders-list-card:not(.orders-list-card--bulk) .orders-bulk-col * {
  display: none;
}

.orders-list-card--bulk .orders-bulk-col {
  width: 42px;
  text-align: center;
  vertical-align: middle;
}

.orders-list-card--bulk .orders-bulk-col .form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  float: none;
  vertical-align: middle;
}

.orders-list-card--bulk .orders-bulk-col--empty {
  background: transparent;
}

.orders-table-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.orders-table-head-actions .table-head-action-form {
  display: inline-flex;
}

/* Не display:none: иначе colspan «Нет записей» ломает ширину таблицы */
.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-bulk-col {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-bulk-col * {
  display: none;
}

.warehouse-list-card--bulk [data-sortable="warehouse-list"] {
  table-layout: auto;
}

.warehouse-list-card--bulk .warehouse-bulk-col {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.5rem !important;
  padding-right: 0.35rem !important;
}

.warehouse-list-card--bulk .warehouse-bulk-col .form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  float: none;
  vertical-align: middle;
}

.warehouse-list-card--bulk .warehouse-bulk-col--empty {
  background: transparent;
}

/* В auto-режиме max-width:0 у «Принадлежит» ломает колонку — снимаем */
.warehouse-list-card--bulk .warehouse-code-table__where {
  max-width: none;
  width: auto;
  min-width: 11rem;
}

.order-buyer-cell {
  max-width: 11rem;
  font-size: 0.875rem;
}

.order-buyer-cell__link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.orders-table-actions-head,
.table-head-action-head {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: right;
  padding: 8px 10px;
}

.table-head-action-head--wide {
  min-width: 10.5rem;
}

.product-list-table thead .table-head-action-head,
[data-sortable="orders"] thead .table-head-action-head {
  background: var(--card-footer-bg);
}

.orders-import-form,
.table-head-action-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.orders-table-actions-head .orders-import-btn.btn,
.table-head-action-head .table-head-action-btn.btn {
  min-height: 28px;
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.table-head-action-head .orders-bulk-enter-btn.orders-bulk-enter-btn--hidden {
  display: none;
}

.orders-table-actions-head .orders-import-btn .fa-download,
.table-head-action-head .table-head-action-btn .fa-sync {
  font-size: 11px;
}

.orders-import-group,
.offers-sync-group {
  position: static;
}

.orders-import-group .orders-import-toggle,
.offers-sync-group .offers-sync-toggle {
  min-width: 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.orders-import-group .orders-import-toggle::after,
.offers-sync-group .offers-sync-toggle::after {
  margin-left: 0;
}

.orders-import-menu,
.offers-sync-menu {
  z-index: 1080;
  min-width: 10.5rem;
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
}

.orders-import-menu .dropdown-item,
.offers-sync-menu .dropdown-item {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
}

.card-body.table-responsive:has(.orders-import-group),
.card-body.table-responsive:has(.offers-sync-group) {
  overflow: visible;
}

@media (max-width: 991.98px) {
  .card-body.table-responsive:has(.orders-import-group),
  .card-body.table-responsive:has(.offers-sync-group) {
    overflow-x: auto;
    overflow-y: visible;
  }
}

.filter-toolbar {
  padding: 12px 16px;
}

.filter-toolbar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.filter-bar-btn {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 0.875rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.filter-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
}

.filter-search-wrap--with-action {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.filter-search-wrap--with-action:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--blue) 20%, transparent);
}

.filter-search-wrap--with-action .filter-search {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-right: 0.5rem;
  border-radius: 0;
}

.filter-search-wrap--with-action .filter-search-action {
  flex: 0 0 auto;
  align-self: stretch;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  min-height: 34px;
  padding: 0 0.85rem;
  white-space: nowrap;
  background: var(--panel-hover);
  color: var(--text);
}

.filter-search-wrap--with-action .filter-search-action:hover,
.filter-search-wrap--with-action .filter-search-action:focus-visible {
  background: var(--table-hover-bg);
  color: var(--text);
}

.filter-search {
  width: 100%;
  min-height: 36px;
  padding-left: 2.1rem;
}

.filter-select {
  flex: 0 1 220px;
  min-width: 160px;
  max-width: 280px;
  height: 36px;
  max-height: 36px;
  min-height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-date-range-wrap {
  flex-shrink: 0;
}

.filter-date-range {
  position: relative;
  min-width: 10.5rem;
  max-width: 14rem;
}

.filter-date-range__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 36px;
  padding-right: 0.65rem;
  text-align: left;
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--line);
}

.filter-date-range__toggle:hover,
.filter-date-range__toggle:focus {
  background: var(--panel-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-date-range__icon {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.filter-date-range__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.filter-date-range__label.is-placeholder {
  color: var(--muted);
}

.filter-date-range__caret {
  flex: 0 0 auto;
  font-size: 0.65rem;
  color: var(--muted);
}

.filter-date-range__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1080;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-date-range__modes {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.filter-date-range__mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text);
}

.filter-date-range__fields--range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-date-range__fields--range .filter-date-range__field {
  min-width: 0;
  flex: 1 1 0;
}

.filter-date-range__field {
  position: relative;
  display: block;
  min-width: 0;
}

.filter-date-range__field-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-date-range__field-placeholder {
  position: absolute;
  left: 2.1rem;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.2;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-date-range__field:not(.is-empty) .filter-date-range__field-placeholder {
  display: none;
}

.filter-date-range__field .form-control {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding-left: 2.1rem;
}

/* iOS: пустой type=date без текста/иконки — своя подпись; выравнивание выбранной даты */
.filter-date-range__field input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

.filter-date-range__field.is-empty input[type="date"]::-webkit-datetime-edit {
  color: transparent;
}

.filter-date-range__field.is-empty input[type="date"]::-webkit-date-and-time-value {
  color: transparent;
}

.filter-date-range__field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.filter-date-range__sep {
  color: var(--muted);
  flex: 0 0 auto;
}

.filter-date-range__actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.filter-selects-inline {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.filter-selects-inline .filter-select {
  flex: 0 1 auto;
  width: 12rem;
  min-width: 140px;
  max-width: 16rem;
  height: 36px;
  max-height: 36px;
  min-height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— Logs panel (?page=diagnostics) ——— */

.logs-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.logs-panel__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.logs-panel__stat {
  font-weight: 600;
  color: var(--text);
}

.logs-panel__stat--muted {
  font-weight: 500;
  color: var(--muted);
}

.logs-panel__filters .form-select {
  width: auto;
  min-width: 7rem;
  max-width: 11rem;
}

.logs-panel__filters .logs-panel__toggle {
  flex-shrink: 0;
}

.logs-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.logs-panel__toggle.is-on {
  border-color: rgba(74, 134, 197, 0.4);
  background: rgba(74, 134, 197, 0.07);
}

[data-theme="dark"] .logs-panel__toggle.is-on {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.1);
}

.logs-panel__toggle-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.logs-panel__switch {
  padding-left: 2.5em;
  min-height: 1.35rem;
}

.logs-panel__switch .form-check-input {
  width: 2.1em;
  height: 1.15em;
  cursor: pointer;
}

.logs-panel__keep {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.logs-panel__keep-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}

.logs-panel__keep .form-select {
  width: auto;
  min-width: 7rem;
}

.logs-panel__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.logs-panel__filters,
.logs-panel__export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0;
}

.logs-panel__filters .form-select,
.logs-panel__export .form-select {
  width: auto;
  min-width: 7rem;
  max-width: 11rem;
}

.logs-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin-left: auto;
}

.logs-panel__actions > a,
.logs-panel__actions > form {
  margin: 0;
}

.logs-panel__clear {
  margin: 0;
}

@media (max-width: 767.98px) {
  .logs-panel__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-items: stretch;
  }

  .logs-panel__filters {
    display: contents;
  }

  .logs-panel__filters .form-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .logs-panel__filters .form-select[name="level"] {
    grid-column: 1;
    grid-row: 1;
  }

  .logs-panel__filters .form-select[name="source"] {
    grid-column: 2;
    grid-row: 1;
  }

  .logs-panel__filters .form-select[name="limit"] {
    grid-column: 1;
    grid-row: 2;
  }

  .logs-panel__toggle {
    grid-column: 2;
    grid-row: 2;
    justify-content: space-between;
    min-height: calc(1.5em + 0.5rem + 2px);
  }

  .logs-panel__actions {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .logs-panel__actions > a,
  .logs-panel__actions > form {
    display: flex;
    min-width: 0;
  }

  .logs-panel__actions .btn {
    width: 100%;
    justify-content: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
}

.logs-pagination {
  margin: 0;
}

/* ——— Pagination ——— */

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-pagination-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.list-pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.list-pagination-per-page .form-select {
  min-height: 32px;
  padding: 4px 1.75rem 4px 8px;
}

.pagination .page-link {
  color: var(--muted);
  background: var(--bg-elevated);
  border-color: var(--line);
  min-width: 34px;
  text-align: center;
}

.pagination .page-link:hover {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--border-strong);
}

.pagination .page-link:focus {
  box-shadow: none;
  outline: none;
  z-index: auto;
}

.pagination .page-link:active {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--border-strong);
  box-shadow: none;
}

.pagination .page-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  box-shadow: none;
}

.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus,
.pagination .page-item.active .page-link:active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: none;
}

.pagination .page-item.disabled .page-link {
  color: var(--muted);
  background: var(--panel);
  opacity: 0.65;
}

/* ——— Logs ——— */

.log-table {
  table-layout: fixed;
  width: 100%;
}

.log-table__col-time { width: 13rem; }
.log-table__col-level { width: 6.5rem; }
.log-table__col-source { width: 12rem; }
.log-table__col-message { width: auto; min-width: 10rem; }

.log-table .log-error td { background: rgba(248, 81, 73, 0.08); }
.log-table .log-warning td { background: rgba(210, 153, 34, 0.08); }
.log-table .log-debug td { color: var(--muted); }

.log-table__time {
  white-space: nowrap;
}

.log-table__level {
  white-space: nowrap;
}

.log-table__level .badge {
  font-size: 0.7rem;
  padding: 0.25em 0.5em;
}

.log-table__source {
  white-space: nowrap;
}

.log-table__message-cell {
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}

.log-source-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.log-source-badge--app {
  color: var(--text);
  background: rgba(139, 148, 158, 0.15);
  border-color: rgba(139, 148, 158, 0.25);
}

.log-source-badge--cron {
  color: #6b5b2e;
  background: rgba(180, 140, 40, 0.14);
  border-color: rgba(180, 140, 40, 0.28);
}

[data-theme="dark"] .log-source-badge--cron {
  color: #d4b86a;
  background: rgba(212, 184, 106, 0.12);
  border-color: rgba(212, 184, 106, 0.25);
}

.log-source-badge--telegram {
  color: #2aabee;
  background: rgba(42, 171, 238, 0.12);
  border-color: rgba(42, 171, 238, 0.25);
}

.log-source-badge--yandex {
  color: #fc3f1d;
  background: rgba(252, 63, 29, 0.1);
  border-color: rgba(252, 63, 29, 0.22);
}

.log-source-badge--ozon {
  color: #005bff;
  background: rgba(0, 91, 255, 0.1);
  border-color: rgba(0, 91, 255, 0.22);
}

.log-source-badge--wb {
  color: #cb11ab;
  background: rgba(203, 17, 171, 0.1);
  border-color: rgba(203, 17, 171, 0.22);
}

.log-table__message-cell .log-table__message {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.log-table__text {
  font-size: 0.875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
}

.log-table__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.log-kv {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.35;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--line);
}

.log-kv__k {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.log-kv__v {
  color: var(--text);
  word-break: break-all;
}

.log-kv__link {
  text-decoration: none;
}

.log-kv__link:hover {
  text-decoration: underline;
}

.log-json-details {
  font-size: 0.8125rem;
}

.log-json-details__summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}

.log-json-details__summary:hover {
  color: var(--text);
}

.log-json-details__body {
  margin-top: 0.35rem;
  position: relative;
}

.log-json-details__body .log-json-copy {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  padding: 0.15rem 0.4rem;
  line-height: 1;
}

.log-json-details__pre {
  max-height: min(40vh, 18rem);
  margin: 0;
  padding-right: 2.25rem;
  font-size: 0.75rem;
}

.log-json-details__hint {
  margin: 0 0 0.25rem;
  padding-right: 2.25rem;
}

.log-json-copy.is-copied {
  border-color: var(--bs-success);
  color: var(--bs-success);
}

/* ——— Setup (setup.php) ——— */

.setup-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.setup-page .card {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.setup-page .form-control,
.setup-page .form-select {
  background-color: var(--bg-elevated);
  border-color: var(--line);
  color: var(--text);
}

.setup-page .form-label {
  color: var(--muted);
}

.setup-page .cron-setup-card {
  border-color: var(--line);
}

.setup-page .cron-setup-card .card-header {
  background: var(--bg-elevated);
  border-color: var(--line);
}

.setup-page .cron-setup-card__lead a {
  color: var(--link);
}

.help-page .cron-setup-anchor {
  scroll-margin-top: 1.25rem;
}

.cron-setup-spoiler__summary .fa-clock {
  flex-shrink: 0;
}

.cron-setup-spoiler__body {
  padding-top: 0.15rem;
}

.cron-setup-card .card-header {
  background: var(--bg-elevated);
}

.cron-setup-card__lead {
  color: var(--text);
  line-height: 1.55;
}

/* ——— Login ——— */

.login-body {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  background: var(--bg);
}

@media (max-width: 860px) {
  .login-body {
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    box-sizing: border-box;
  }
}

[data-theme="dark"] .login-body {
  background: radial-gradient(ellipse at top, #1a2332 0%, var(--bg) 55%);
}

[data-theme="light"] .login-body {
  background: radial-gradient(ellipse at top, #e8eef8 0%, var(--bg) 55%);
}

.login-shell {
  width: min(420px, calc(100% - 32px));
}

.login-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
}

.login-card input:focus {
  outline: none;
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.login-card .btn-primary {
  width: 100%;
  min-height: 42px;
}

.login-card label.login-remember {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.login-card label.login-remember input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #1f6feb;
  cursor: pointer;
}

.login-card__hint {
  margin: 0;
  text-align: center;
  font-size: 13px;
}

.login-card__hint a {
  color: var(--muted);
  text-decoration: none;
}

.login-card__hint a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ——— Account ——— */

.account-page {
  max-width: 920px;
}

.account-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr 1fr;
  }

  .account-section--wide {
    grid-column: 1 / -1;
  }
}

.account-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-section__lead {
  color: var(--muted);
  font-size: 13px;
}

.account-dl {
  display: grid;
  gap: 14px;
}

.account-dl dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-dl dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.account-2fa-setup {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .account-2fa-setup {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

.account-2fa-setup__qr {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  width: fit-content;
}

.account-2fa-setup__qr img {
  display: block;
}

.account-2fa-setup__steps ol {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.account-2fa-code-input {
  max-width: 320px;
}

.form-error {
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 8px;
  background: rgba(248, 81, 73, 0.12);
  padding: 10px 12px;
  color: #ffaba8;
  font-weight: 600;
}

/* ——— Misc ——— */

pre {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px;
}

code {
  color: var(--blue);
  background: transparent;
}

code.order-marketplace-id,
code.dashboard-recent-orders__order-id {
  background: var(--surface-muted);
}

h2, h3, strong, b {
  font-weight: 700;
}

.accordion-item {
  background: var(--panel);
  border-color: var(--line) !important;
}

/* ——— Theme toggle ——— */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  user-select: none;
  margin-bottom: 4px;
}

.theme-toggle--center {
  margin-top: 4px;
  margin-bottom: 0;
}

.theme-toggle-icon {
  flex-shrink: 0;
  width: 1em;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.theme-toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.theme-toggle-track input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle-thumb {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-hover);
  border: 1px solid var(--border-strong);
  transition: background 0.2s ease;
}

.theme-toggle-thumb::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.theme-toggle-track input:checked + .theme-toggle-thumb::after {
  transform: translateX(20px);
}

.theme-toggle-track input:focus-visible + .theme-toggle-thumb {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ——— Light theme: алерты и бейджи ——— */

[data-theme="light"] .alert-danger {
  border-color: #ffd0d0;
  background: #fff2f2;
  color: var(--red);
}

[data-theme="light"] .alert-success {
  border-color: #bfe8d8;
  background: #e8f6f1;
  color: var(--green);
}

[data-theme="light"] .alert-warning {
  border-color: #f0d49a;
  background: #fff5de;
  color: var(--amber);
}

[data-theme="light"] .alert-info {
  border-color: #b8d0f5;
  background: #eef4fd;
  color: var(--blue);
}

[data-theme="light"] .form-error {
  border-color: #ffd0d0;
  background: #fff2f2;
  color: var(--red);
}

[data-theme="light"] .bg-success { background-color: #e6f3ec !important; color: var(--green) !important; }
[data-theme="light"] .bg-warning { background-color: #f8f1e4 !important; color: var(--amber) !important; }
[data-theme="light"] .bg-danger { background-color: #faecec !important; color: var(--red) !important; }
[data-theme="light"] .bg-info { background-color: #eaf1f8 !important; color: var(--blue) !important; }
[data-theme="light"] .bg-secondary { background-color: #eef1f5 !important; color: var(--muted) !important; }
[data-theme="light"] .bg-primary { background-color: #eaf1f8 !important; color: var(--blue) !important; }

[data-theme="light"] .stat-card {
  border-color: var(--border-strong);
}

[data-theme="light"] a.stat-card:hover {
  border-color: #b0bcc9;
}

[data-theme="light"] .stat-card--green .stat-icon { background: rgba(61, 143, 106, 0.12); }
[data-theme="light"] .stat-card--blue .stat-icon { background: rgba(74, 134, 197, 0.12); }
[data-theme="light"] .stat-card--amber .stat-icon { background: rgba(184, 134, 46, 0.12); }
[data-theme="light"] .stat-card--violet .stat-icon { background: rgba(125, 101, 168, 0.12); }

/* ——— Responsive ——— */

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  html.pwa-standalone body {
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  }

  .app-layout-inner {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 1030;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: calc(10px + var(--safe-top)) 12px 10px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .app-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
    overflow: visible;
  }

  .app-sidebar__head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    overflow: visible;
  }

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

  .brand small {
    display: none;
  }

  .mobile-sidebar-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }

  .mobile-sidebar-more:hover {
    color: var(--text);
    background: var(--panel-hover);
  }

  .sidenav,
  .sidebar-foot {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    align-items: stretch;
    gap: 4px;
    padding:
      4px
      max(4px, var(--safe-right))
      max(6px, calc(4px + var(--safe-bottom)))
      max(4px, var(--safe-left));
    border-top: 1px solid var(--line);
    background: var(--bg-elevated);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  [data-theme="dark"] .mobile-bottom-nav {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  }

  .mobile-bottom-nav__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 8px;
    color: var(--muted) !important;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
  }

  .mobile-bottom-nav__item i {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-bottom-nav__item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav__item:hover {
    color: var(--text) !important;
    background: var(--panel-hover);
  }

  .mobile-bottom-nav__item.is-active {
    color: var(--blue) !important;
    background: var(--nav-active-bg);
  }

  .mobile-app-more__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-app-more__body .sidebar-version {
    margin-top: auto;
  }

  .app-main {
    padding-bottom: var(--mobile-bottom-nav-offset);
  }

  /* На мобильном уведомление — сверху под шапкой, на всю ширину экрана. */
  .mm-toast-container {
    top: calc(var(--mobile-header-offset) + 12px);
    bottom: auto;
    left: max(12px, var(--safe-left));
    right: max(12px, var(--safe-right));
    max-width: none;
  }

  .mm-toast,
  .mm-toast--notify {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .mm-toast {
    transform: translateY(-12px) scale(0.98);
  }

  .mm-toast--show {
    transform: translateY(0) scale(1);
  }

  .shell {
    padding: 16px;
  }

  .page-head h1,
  .page-head__title-text {
    font-size: 24px;
  }

  .page-head--warehouse .page-head__title-row {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  .page-head--warehouse .page-head__title-leading {
    width: 100%;
  }

  .page-head--warehouse .page-head__title-actions {
    margin-left: auto;
  }

  .warehouse-add-card .card-header .card-title {
    flex: 1 1 100%;
    width: 100%;
  }

  .warehouse-add-card__toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .warehouse-add-card__toolbar .page-head-action-btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .warehouse-add-card__toolbar .warehouse-add-mode {
    flex: 0 0 auto;
    margin-left: auto;
  }

  @media (max-width: 420px) {
    .warehouse-add-card__toolbar {
      flex-direction: column;
      align-items: stretch;
    }

    .warehouse-add-card__toolbar .page-head-action-btn,
    .warehouse-add-card__toolbar .warehouse-add-mode {
      width: 100%;
      margin-left: 0;
    }

    .warehouse-add-card__toolbar .warehouse-add-mode__item {
      flex: 1;
    }
  }

  .warehouse-head-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .warehouse-head-toolbar .warehouse-tabs--head {
    max-width: none;
    width: 100%;
  }

  .warehouse-head-toolbar__aside {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .warehouse-head-toolbar .page-head-action-btn {
    width: 100%;
    justify-content: center;
  }

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

/* ——— In-app notifications (bell) ——— */

.app-head-tools {
  display: flex;
  align-items: flex-start;
  gap: var(--app-head-tools-gap);
  flex-shrink: 0;
}

@media (min-width: 861px) {
  .app-head-tools {
    min-width: calc(2 * var(--app-head-tools-slot) + var(--app-head-tools-gap));
  }
}

.app-notifications {
  position: relative;
  top: auto;
  right: auto;
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 2;
}

.app-notifications:has(.app-notifications__menu.show),
.app-notifications:has(> .app-notifications__btn.show) {
  z-index: 1100;
}

.app-notifications--sidebar {
  display: none;
}

.app-notifications--page-head {
  z-index: 2;
}

.app-notifications--page-head .app-notifications__menu.show {
  z-index: 1100;
}

body.modal-open .app-notifications--page-head,
body.modal-open .app-notifications--sidebar {
  z-index: 1;
}

body.modal-open .app-sidebar {
  z-index: 1025;
}

@media (max-width: 860px) {
  .app-notifications--page-head {
    display: none !important;
  }

  .app-notifications--sidebar {
    display: block;
  }

  .app-notifications--sidebar .app-notifications__menu,
  .app-notifications__menu--portaled {
    position: fixed !important;
    top: var(--app-notifications-panel-top) !important;
    left: max(12px, var(--safe-left)) !important;
    right: max(12px, var(--safe-right)) !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: var(--app-notifications-panel-max-height, min(70vh, 24rem)) !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0;
    border-radius: 12px;
    border-top: 1px solid var(--line);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
    z-index: 1100;
  }

  .app-notifications__menu--portaled {
    display: none;
  }

  .app-notifications__menu--portaled.show {
    display: flex;
    flex-direction: column;
  }

  .app-notifications-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1095;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .app-notifications-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  [data-theme="dark"] .app-notifications-backdrop {
    background: rgba(0, 0, 0, 0.55);
  }

  body.app-notifications-panel-open {
    overflow: hidden;
  }

  [data-theme="dark"] .app-notifications--sidebar .app-notifications__menu,
  [data-theme="dark"] .app-notifications__menu--portaled {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  .app-notifications--sidebar .app-notifications__list,
  .app-notifications__menu--portaled .app-notifications__list {
    max-height: none;
  }

  .mobile-app-more.offcanvas {
    top: var(--safe-top);
    bottom: var(--safe-bottom);
    height: auto;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    z-index: 1070;
  }

  .mobile-app-more .offcanvas-header {
    padding-top: 0.75rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .mobile-app-more .offcanvas-body {
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Модалки: не залезают под островок и home indicator */
  .modal {
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  }

  .modal-dialog.modal-fullscreen-md-down,
  .modal-dialog.modal-fullscreen-sm-down,
  .modal-dialog.modal-fullscreen {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 !important;
  }

  .modal-dialog.modal-fullscreen-md-down .modal-content,
  .modal-dialog.modal-fullscreen-sm-down .modal-content,
  .modal-dialog.modal-fullscreen .modal-content {
    height: 100%;
    max-height: 100%;
    border-radius: 12px;
    overflow: hidden;
  }

  .modal-dialog:not(.modal-fullscreen-md-down):not(.modal-fullscreen-sm-down):not(.modal-fullscreen) {
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 0.5rem);
    margin-top: 0;
    margin-bottom: 0;
  }

  .modal-dialog:not(.modal-fullscreen-md-down):not(.modal-fullscreen-sm-down):not(.modal-fullscreen) .modal-content {
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 0.5rem);
    overflow-y: auto;
  }

  .modal-dialog-centered {
    min-height: calc(100% - 0.5rem);
  }

  /* Карточки «Сегодня» / «За всё время»: столбиком только на узком экране */
  .dashboard-hero-stats .stat-card__amount {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    line-height: 1.2;
  }

  .dashboard-hero-stats .stat-card__amount-sep,
  .dashboard-hero-stats .stat-card__legend-sep {
    display: none;
  }

  .dashboard-hero-stats .stat-card__legend {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    line-height: 1.2;
  }

  .dashboard-hero-stats .stat-card__profit {
    font-size: 0.9375rem;
  }
}

.app-notifications__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-notifications__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--panel);
  pointer-events: none;
}

.app-notifications--unread .app-notifications__dot {
  animation: app-notifications-dot-pulse 2s ease-in-out infinite;
}

@keyframes app-notifications-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-notifications--unread .app-notifications__dot {
    animation: none;
  }
}

.app-notifications__btn:hover,
.app-notifications__btn.show {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--nav-active-border);
}

.app-notifications__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-notifications__btn .fas {
  font-size: 1rem;
}

.app-notifications__menu {
  min-width: 240px;
  max-width: min(320px, calc(100vw - 2rem));
  max-height: min(70vh, 24rem);
  overflow: hidden;
  margin-top: 0.5rem;
  padding-bottom: 0;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-notifications__menu.show {
  display: flex;
  flex-direction: column;
  z-index: 1100;
}

.app-notifications__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(calc(70vh - 2.75rem), calc(24rem - 2.75rem));
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}

.app-notifications__list::-webkit-scrollbar {
  width: 5px;
}

.app-notifications__list::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.2rem 0;
}

.app-notifications__list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 999px;
}

.app-notifications__list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 60%, transparent);
}

.app-notifications__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  color: var(--text);
  font-weight: 600;
  padding-bottom: 0.35rem;
}

.app-notifications__header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.app-notifications__close {
  flex-shrink: 0;
  margin: 0;
  padding: 0.35rem;
  opacity: 0.65;
}

.app-notifications__close:hover {
  opacity: 1;
}

@media (min-width: 861px) {
  .app-notifications__close {
    display: none;
  }
}

.app-notifications__header > span {
  min-width: 0;
}

.app-notifications__mark-all {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-notifications__mark-all:hover {
  color: var(--blue);
  text-decoration: underline;
}

.app-notifications__menu .dropdown-header {
  color: var(--text);
  font-weight: 600;
}

.app-notifications__empty {
  padding: 0.35rem 1rem 0.15rem;
}

.app-notifications__list .app-notifications__item {
  padding-left: 1rem;
  padding-right: 0.65rem;
}

/* ——— Background tasks (header list) ——— */

.app-background-tasks {
  position: relative;
  top: auto;
  right: auto;
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 2;
}

.app-background-tasks--inactive {
  visibility: hidden;
  pointer-events: none;
}

.app-background-tasks:has(.app-background-tasks__menu.show),
.app-background-tasks:has(> .app-background-tasks__btn.show) {
  z-index: 1100;
}

.app-background-tasks--sidebar {
  display: none;
}

.app-background-tasks--page-head {
  z-index: 2;
}

.app-background-tasks--page-head .app-background-tasks__menu.show {
  z-index: 1100;
}

body.modal-open .app-background-tasks--page-head,
body.modal-open .app-background-tasks--sidebar {
  z-index: 1;
}

@media (max-width: 860px) {
  .app-background-tasks--page-head {
    display: none !important;
  }

  .app-background-tasks--sidebar:not(.app-background-tasks--inactive) {
    display: block;
  }

  .app-background-tasks--sidebar .app-background-tasks__menu {
    position: fixed !important;
    top: var(--app-background-tasks-panel-top, calc(56px + var(--safe-top))) !important;
    left: max(12px, var(--safe-left)) !important;
    right: max(12px, var(--safe-right)) !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(70vh, 24rem) !important;
    margin: 0 !important;
    margin-top: 0 !important;
    border-radius: 12px;
    border-top: 1px solid var(--line);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
    z-index: 1100;
  }
}

.app-background-tasks__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-background-tasks__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--panel);
  pointer-events: none;
}

.app-background-tasks__btn:hover,
.app-background-tasks__btn.show {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--nav-active-border);
}

.app-background-tasks__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-background-tasks__btn .fas {
  font-size: 1rem;
}

.app-background-tasks__menu {
  min-width: 260px;
  max-width: min(340px, calc(100vw - 2rem));
  max-height: min(70vh, 24rem);
  overflow: hidden;
  margin-top: 0.5rem;
  padding-bottom: 0;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-background-tasks__menu.show {
  display: flex;
  flex-direction: column;
  z-index: 1100;
}

.app-background-tasks__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(calc(70vh - 2.75rem), calc(24rem - 2.75rem));
  padding-bottom: 0.35rem;
}

.app-background-tasks__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  color: var(--text);
  font-weight: 600;
  padding-bottom: 0.35rem;
}

.app-background-tasks__header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.app-background-tasks__close {
  flex-shrink: 0;
  margin: 0;
  padding: 0.35rem;
  opacity: 0.65;
}

.app-background-tasks__close:hover {
  opacity: 1;
}

@media (min-width: 861px) {
  .app-background-tasks__close {
    display: none;
  }
}

.app-background-tasks__empty {
  padding: 0.35rem 1rem 0.15rem;
}

.app-background-tasks__item {
  white-space: normal;
}

.app-background-tasks__item.dropdown-item:hover,
.app-background-tasks__item.dropdown-item:focus,
.app-background-tasks__item.dropdown-item:focus-visible,
.app-background-tasks__item.dropdown-item:active,
.app-background-tasks__item.dropdown-item.active {
  background-color: var(--panel-hover);
  color: var(--text);
}

.app-background-tasks__item-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.app-background-tasks__item-body {
  font-size: 0.8125rem;
  line-height: 1.35;
}

/* ——— Toast notifications ——— */

.mm-toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.mm-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}

.mm-toast--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mm-toast .fas {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 1rem;
}

.mm-toast--success {
  border-color: rgba(63, 185, 80, 0.35);
  background: linear-gradient(135deg, var(--panel) 0%, rgba(63, 185, 80, 0.1) 100%);
}

.mm-toast--success .fas {
  color: var(--green);
}

.mm-toast--error {
  border-color: rgba(248, 81, 73, 0.35);
  background: linear-gradient(135deg, var(--panel) 0%, rgba(248, 81, 73, 0.1) 100%);
}

.mm-toast--error .fas {
  color: var(--red);
}

@media (max-width: 720px) {
  .mm-toast-container {
    right: max(12px, var(--safe-right));
    left: max(12px, var(--safe-left));
    max-width: none;
  }

  .shell {
    padding: 16px;
  }

  .page-head h1,
  .page-head__title-text {
    font-size: 24px;
  }

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

/* ——— Пакетная загрузка на склад ——— */
.warehouse-dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--bs-border-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--bs-tertiary-bg);
  transition: border-color 0.15s, background 0.15s;
}

.warehouse-dropzone:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.warehouse-dropzone--active,
.warehouse-dropzone:hover {
  border-color: var(--blue);
  background: var(--nav-active-bg);
}

.warehouse-dropzone__icon {
  font-size: 1.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.warehouse-dropzone--compact {
  padding: 0.85rem 0.75rem;
}

.warehouse-dropzone--compact .warehouse-dropzone__icon {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.warehouse-dropzone--compact .warehouse-dropzone__hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0;
}

.warehouse-preview {
  margin-bottom: 1rem;
}

.warehouse-upload-progress {
  margin-bottom: 1rem;
}

/* ——— Карточка заказа: инфо слева, позиции справа ——— */
.order-view-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.order-view-grid__sidebar {
  order: 1;
}

.order-view-grid__items {
  order: 2;
}

.order-view-grid__items.card,
.order-view-grid__items .card-body {
  overflow: visible;
}

.order-view-spoiler-chevron {
  transition: transform 0.2s ease;
}

.order-view-spoiler-toggle[aria-expanded="true"] .order-view-spoiler-chevron {
  transform: rotate(180deg);
}

.order-raw-json {
  max-height: min(70vh, 32rem);
  overflow: auto;
  background: var(--bs-tertiary-bg);
  border-radius: 0;
  color: var(--text);
}

@media (min-width: 992px) {
  .order-view-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    grid-template-areas: "sidebar items";
    align-items: start;
  }

  .order-view-grid__items {
    grid-area: items;
  }

  .order-view-grid__sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0.75rem;
    align-self: start;
  }
}

.order-chat-modal-dialog {
  max-width: 36rem;
}

@media (max-width: 860px) {
  #order-chat-modal .order-chat-modal-dialog.modal-fullscreen-md-down {
    width: calc(100% - 1.5rem) !important;
    max-width: calc(100% - 1.5rem) !important;
    height: calc(100% - 1.5rem) !important;
    max-height: calc(100% - 1.5rem) !important;
    margin: 0.75rem auto !important;
  }

  #order-chat-modal .order-chat-modal.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    border-radius: 12px;
  }

  #order-chat-modal .order-chat-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  #order-chat-modal .order-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
  }

  #order-chat-modal .modal-footer {
    flex-shrink: 0;
    padding-bottom: max(0.85rem, calc(0.5rem + var(--safe-bottom)));
  }
}

.order-chat-modal .modal-body {
  min-height: min(60vh, 28rem);
  max-height: min(70vh, 32rem);
}

.order-chat-modal .modal-header {
  padding: 0.85rem 1.125rem;
}

.order-chat-modal .modal-footer {
  padding: 0.85rem 1.125rem;
}

.order-chat-modal .order-chat-token-warning,
.order-chat-modal .order-chat-notice,
.order-chat-modal .order-chat-remind-fulfill {
  padding-left: 1.125rem;
  padding-right: 1.125rem;
}

.order-chat-messages {
  overflow-y: auto;
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg);
}

.order-chat-empty {
  margin: auto 0;
  text-align: center;
}

.order-chat-bubble {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.order-chat-bubble--out {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--bg-elevated));
}

.order-chat-bubble--in {
  align-self: flex-start;
}

.order-chat-bubble--system {
  align-self: center;
  max-width: 96%;
  padding: 0.35rem 0.55rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted, #6c757d);
  background: color-mix(in srgb, var(--text-muted, #6c757d) 6%, var(--bg-elevated));
}

.order-chat-bubble--system .order-chat-bubble__text {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.order-chat-bubble--system .order-chat-bubble__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-chat-bubble__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  color: var(--text-muted, #6c757d);
}

.order-chat-bubble__sender {
  font-weight: 600;
}

.order-chat-bubble__text {
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}

.order-chat-bubble__text strong {
  font-weight: 700;
}

.order-chat-bubble__file {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.order-chat-compose {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.order-chat-compose__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  resize: vertical;
  min-height: 2.5rem;
}

.order-chat-compose__aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  width: auto;
}

.order-chat-compose__suggest,
.order-chat-compose__templates-btn,
.order-chat-compose__send {
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.order-chat-compose__templates {
  display: flex;
}

.order-chat-compose__templates-menu {
  min-width: 12rem;
  max-width: min(20rem, 85vw);
}

.order-chat-compose__templates-menu .dropdown-item {
  white-space: normal;
  font-size: 0.8125rem;
}

.order-chat-pending__inner {
  padding-inline-end: 1.5rem;
}

.order-chat-pending code {
  font-size: 0.9em;
}

#order-fulfill-form.order-fulfill-highlight {
  outline: 2px solid var(--bs-warning);
  outline-offset: 4px;
  border-radius: 0.375rem;
}

.order-meta {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.order-meta__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-meta__label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.field-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  opacity: 0.75;
  cursor: help;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}

.field-hint:hover,
.field-hint:focus-visible {
  opacity: 1;
  color: var(--accent, #0d6efd);
  outline: none;
}

.field-hint i {
  font-size: 0.8125rem;
  pointer-events: none;
}

.field-hint-tooltip .tooltip-inner {
  max-width: 16rem;
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.field-hint-tooltip {
  pointer-events: none;
}

.mm-tooltip-disabled-wrap .btn:disabled,
.mm-tooltip-disabled-wrap input:disabled,
.mm-tooltip-disabled-wrap select:disabled,
.mm-tooltip-disabled-wrap textarea:disabled,
.supplier-catalog-warm-wrap .btn:disabled {
  pointer-events: none;
}

.supplier-catalog-warm-wrap .btn.supplier-catalog-warm-btn--stale {
  --bs-btn-color: var(--warning, #d97706);
  --bs-btn-border-color: var(--warning, #d97706);
  --bs-btn-bg: color-mix(in srgb, var(--warning, #d97706) 10%, var(--panel, #fff));
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--warning, #d97706);
  --bs-btn-hover-border-color: var(--warning, #d97706);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--warning, #d97706);
  --bs-btn-active-border-color: var(--warning, #d97706);
  animation: supplier-catalog-warm-stale-pulse 2.2s ease-in-out infinite;
}

@keyframes supplier-catalog-warm-stale-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning, #d97706) 35%, transparent);
  }

  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning, #d97706) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .supplier-catalog-warm-wrap .btn.supplier-catalog-warm-btn--stale {
    animation: none;
  }
}

.field-hint-tooltip--rich {
  --bs-tooltip-bg: var(--panel);
  --bs-tooltip-color: var(--text);
  --bs-tooltip-max-width: 22rem;
  pointer-events: none;
}

.field-hint-tooltip--rich .tooltip-inner {
  max-width: 22rem;
  padding: 0.65rem 0.75rem;
  pointer-events: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field-hint-tooltip--rich .tooltip-inner p {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.field-hint-tooltip--rich .tooltip-inner p:last-child {
  margin-bottom: 0;
}

.field-hint-tooltip--rich .tooltip-inner a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  word-break: break-all;
}

.field-hint-tooltip--rich .tooltip-inner a:hover {
  color: var(--bs-link-hover-color, var(--blue));
  opacity: 1;
}

.product-delivery-type-aside .field-hint {
  margin-left: 0.2rem;
  vertical-align: -0.1em;
}

.orders-import-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 14rem;
}

.orders-import-status.is-running {
  color: var(--text, inherit);
}

/* ——— Финансы в карточке заказа ——— */
.order-finance {
  margin: 0;
}

.order-finance__hero {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
}

.order-finance__hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.order-finance__hero-value {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.order-finance__hero-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: -0.15rem 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
}

.order-finance__hero-subline-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.order-finance__hero-subline-value--profit {
  color: var(--green);
}

.order-finance__hero-subline-value--loss {
  color: var(--red);
}

.order-finance__hero-value--profit {
  color: var(--green);
}

.order-finance__hero-value--loss {
  color: var(--red);
}

.order-finance__hero-value--muted {
  color: var(--muted);
}

.order-finance__hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.order-finance__hero-foot strong {
  color: var(--text, inherit);
  font-weight: 600;
}

.order-finance__hero-sep {
  opacity: 0.5;
}

.order-finance__hero-note {
  width: 100%;
  font-size: 0.75rem;
  font-style: italic;
}

.order-finance__breakdown {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  display: grid;
  gap: 0.65rem;
}

.order-finance__group {
  display: grid;
  gap: 0.3rem;
}

.order-finance__group + .order-finance__group {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-strong);
}

.order-finance__group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.order-money-cell {
  line-height: 1.35;
}

.orders-col-gmv__short {
  display: none;
}

.order-money-cell__main {
  display: block;
}

.order-money-cell__sub {
  margin-top: 0.1rem;
  line-height: 1.25;
}

.order-finance__group-note {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  padding-left: 0.05rem;
}

.order-finance__tree {
  display: grid;
  gap: 0.2rem;
}

.order-finance__tree-block {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--panel));
  border: 1px solid var(--line);
}

.order-finance__tree-block + .order-finance__tree-block {
  margin-top: 0.45rem;
}

.order-finance__tree-block--plain {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.order-finance__tree-block--plain .order-finance__line {
  margin: 0;
}

.order-finance__tree-children {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.order-finance__tree-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.28rem 0 0.28rem 0.35rem;
  font-size: 0.78125rem;
}

.order-finance__tree-row + .order-finance__tree-row {
  border-top: 1px dashed var(--line);
}

.order-finance__branch {
  position: relative;
  width: 1rem;
  height: 1rem;
  align-self: center;
}

.order-finance__branch::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 50%;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: 0.55rem;
  border-bottom-left-radius: 3px;
}

.order-finance__tree-row .order-finance__line-label,
.order-finance__tree-row .order-finance__line-value {
  min-width: 0;
}

.order-finance__line--parent .order-finance__line-label,
.order-finance__line--parent .order-finance__line-value {
  font-weight: 600;
  color: var(--text, inherit);
}

.order-finance__line--parent.order-finance__line--muted .order-finance__line-label {
  font-weight: 500;
  color: var(--muted);
}

.order-finance__line--child {
  font-size: 0.78125rem;
}

.order-finance__line--child:not(.order-finance__tree-row) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-finance__line--child .order-finance__line-label {
  color: var(--muted);
}

.order-finance__line--emph .order-finance__line-label,
.order-finance__line--emph .order-finance__line-value {
  font-weight: 600;
  color: var(--text, inherit);
}

.order-finance__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.order-finance__line-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  min-width: 0;
}

.order-finance__line-value {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--text, inherit);
}

.order-finance__line--add .order-finance__line-value {
  color: var(--green);
}

.order-finance__line--sub .order-finance__line-value {
  color: var(--red);
}

.order-finance__line--muted .order-finance__line-value {
  color: var(--muted);
  font-weight: 400;
}

.order-finance__line--total {
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-strong);
}

.order-finance__line--total .order-finance__line-label,
.order-finance__line--total .order-finance__line-value {
  font-weight: 600;
  color: var(--text, inherit);
}

.orders-import-modal .modal-body {
  padding: 0 1.25rem 1.35rem;
}

.orders-import-modal__message {
  margin-bottom: 1rem;
  line-height: 1.5;
  color: var(--text, inherit);
}

.orders-import-modal__message.is-multiline {
  white-space: pre-line;
}

.orders-import-modal__progress {
  height: 1.375rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 35%, var(--card-bg, #fff));
  border: 1px solid var(--line);
  overflow: hidden;
}

.orders-import-modal__progress.is-indeterminate .progress-bar {
  width: 35% !important;
  animation: orders-import-indeterminate 1.2s ease-in-out infinite;
}

@keyframes orders-import-indeterminate {
  0% { margin-left: 0; }
  50% { margin-left: 65%; }
  100% { margin-left: 0; }
}

.orders-import-modal__progress .progress-bar {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.375rem;
  min-width: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.45rem;
  color: #fff;
}

.orders-import-modal__progress:not(.is-indeterminate):not(.is-complete) .progress-bar[aria-valuenow="0"] {
  min-width: 0;
  padding-right: 0;
}

.orders-import-modal__progress.is-complete {
  border-color: var(--bs-success, #198754);
  background: var(--bs-success, #198754);
}

.orders-import-modal__progress.is-complete .progress-bar {
  width: 100% !important;
  min-width: 100% !important;
  justify-content: center;
  padding-right: 0;
  background-color: var(--bs-success, #198754) !important;
  --bs-progress-bar-bg: var(--bs-success, #198754);
  background-image: none !important;
  color: #fff !important;
}

.order-meta__value {
  flex: 1 1 auto;
  margin: 0;
  text-align: right;
  word-break: break-word;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.35;
}

.order-meta__value .mp-cell {
  justify-content: flex-end;
}

.order-meta .mp-cell__label {
  font-size: inherit;
  color: inherit;
  white-space: normal;
}

.order-meta__sub {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.order-meta__value .badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.32em 0.55em;
  vertical-align: middle;
}

/* Доставка покупателю — outline/pill, чтобы не путать со статусом заказа на МП (solid badge). */
.order-delivery-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.28em 0.62em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}

.order-delivery-badge--sent {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
  border-color: color-mix(in srgb, var(--green) 38%, transparent);
}

.order-delivery-badge--pending {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
}

.order-delivery-badge--error {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 38%, transparent);
}

.order-delivery-badge--skipped {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  border-color: color-mix(in srgb, var(--muted) 28%, var(--line));
}

.order-delivery-badge__note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

@media (max-width: 575.98px) {
  .order-meta__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }

  .order-meta__value {
    text-align: left;
    font-size: 0.9375rem;
  }
}

.order-items-tree__group {
  border-bottom: 1px solid var(--line);
}

.order-items-tree__group:last-child {
  border-bottom: 0;
}

.order-items-tree__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
}

.order-items-tree__item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.order-items-tree__item-title {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-items-tree__item-title--link {
  display: block;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.order-items-tree__item-title--link:hover {
  color: var(--blue);
}

.order-items-tree__offer {
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.order-items-tree__item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.order-items-tree__dot {
  opacity: 0.5;
}

.order-items-tree__item-bind {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.order-items-tree__replace .dropdown-menu {
  min-width: 10.5rem;
  z-index: 1080;
  padding: 0.25rem 0;
  background: var(--card-bg);
  border-color: var(--border-strong);
  color: var(--text);
}

.order-items-tree__replace-btn {
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: none;
}

.order-items-tree__replace-btn:hover,
.order-items-tree__replace-btn:focus,
.order-items-tree__replace-btn.show,
.order-items-tree__replace-btn[aria-expanded="true"] {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--border-strong);
}

.order-items-tree__replace .dropdown-item {
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--text);
  padding: 0.4rem 0.85rem;
}

.order-items-tree__replace .dropdown-item:hover,
.order-items-tree__replace .dropdown-item:focus {
  color: var(--text);
  background: var(--panel-hover);
}

.order-items-tree__replace .dropdown-divider {
  border-color: var(--line);
  opacity: 1;
}

.order-items-tree__code {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 1rem 0.45rem 1.5rem;
  border-top: 1px dashed var(--line);
  background: var(--bs-tertiary-bg);
}

.order-items-tree__code--empty {
  grid-template-columns: 1.25rem minmax(0, 1fr);
}

.order-items-tree__code--no-source {
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
}

.order-items-tree__branch {
  position: relative;
  width: 1rem;
  height: 1rem;
}

.order-items-tree__branch::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 50%;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: 0.55rem;
  border-bottom-left-radius: 3px;
}

.order-items-tree__code-value {
  min-width: 0;
}

.order-items-tree__code-value .digital-code-badge {
  display: inline-flex;
  max-width: 100%;
}

.order-items-tree__code-source {
  white-space: nowrap;
}

.order-items-tree__code-time {
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 767.98px) {
  .order-items-tree__code {
    grid-template-columns: 1.25rem minmax(0, 1fr);
  }

  .order-items-tree__code-source,
  .order-items-tree__code-time {
    grid-column: 2;
  }

  .order-items-tree__code-time {
    text-align: left;
  }
}

.order-codes-table {
  table-layout: fixed;
  width: 100%;
}

.order-codes-table__code code {
  font-size: 0.8125rem;
  word-break: break-all;
}

.order-codes-table__product {
  min-width: 10rem;
  max-width: 0;
  width: 28%;
}

.order-codes-table__product .stock-loc-row__name {
  display: block;
}

.order-codes-table__source {
  max-width: 0;
  width: 22%;
}

.order-code-bind {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.order-code-bind__sep {
  color: var(--muted);
}

/* ——— Цепочка доставки заказа ——— */

.order-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-pipeline__step {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.order-pipeline__step:last-child {
  border-bottom: 0;
}

.order-pipeline__icon {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: var(--bs-tertiary-bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

.order-pipeline__step--done .order-pipeline__icon {
  background: rgba(61, 143, 106, 0.15);
  color: var(--green);
  border-color: rgba(61, 143, 106, 0.35);
}

.order-pipeline__step--warn .order-pipeline__icon {
  background: rgba(184, 134, 46, 0.15);
  color: var(--amber);
  border-color: rgba(184, 134, 46, 0.35);
}

.order-pipeline__step--cancelled .order-pipeline__icon {
  background: var(--surface-2, #f1f3f5);
  color: var(--text-muted, #6c757d);
  border-color: var(--border, #dee2e6);
}

.order-pipeline__step--cancelled .order-pipeline__detail {
  color: var(--text-muted, #6c757d);
}

.order-pipeline__body {
  flex: 1;
  min-width: 0;
}

.order-pipeline__label {
  font-weight: 600;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.order-pipeline__detail {
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-word;
  line-height: 1.35;
}

.order-view-delivery-card .card-body {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Список товаров: таблица */
.product-list-table {
  table-layout: fixed;
  width: 100%;
}

.product-list-col--name { width: 38%; }
.product-list-col--status { width: 10%; }
.product-list-col--stock { width: 14%; }
.product-list-col--sales { width: 8%; }
.product-list-col--price { width: 8%; }
.product-list-col--actions { width: 22%; }

.product-list-table tbody > tr > * {
  background-color: var(--card-bg, #fff);
  box-shadow: none;
}

.product-list-table tbody .product-list__sales-cell {
  text-align: right;
  vertical-align: middle !important;
  white-space: nowrap;
}

.product-list-table thead th {
  vertical-align: middle;
}

.product-sales-cell {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  line-height: 1.2;
}

.product-sales-cell--btn {
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.product-sales-cell--btn:hover,
.product-sales-cell--btn:focus-visible {
  background: var(--panel-hover);
}

.product-sales-cell__today {
  font-weight: 500;
  color: var(--muted);
}

.product-sales-cell__today--active {
  font-weight: 600;
  color: var(--violet);
}

.product-sales-cell__sep {
  color: var(--muted);
  opacity: 0.55;
  font-size: 0.75rem;
}

.product-sales-cell__total {
  color: var(--muted);
  font-size: 0.8125rem;
}

.product-sales-modal__heading {
  min-width: 0;
  padding-right: 0.5rem;
}

.product-sales-modal__product {
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.product-sales-modal__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.product-sales-modal__period {
  flex: 1 1 8rem;
  min-width: 7.5rem;
}

.product-sales-modal__date {
  flex: 1 1 8.5rem;
  min-width: 8rem;
}

.product-sales-modal__date .filter-date-range {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.product-sales-modal__list {
  display: flex;
  flex-direction: column;
}

.product-list-table .product-list__price-cell {
  text-align: right;
  overflow: visible;
}

.product-list-table .product-list__price-cell .product-list__price-btn {
  margin: 0;
  padding: 0.125rem 0.25rem;
}

.product-list-table tbody .product-stock-cell,
.product-list-table .product-list__price-cell,
.product-list-table .product-list__actions-cell {
  white-space: nowrap;
}

.product-list-table .product-list__actions-cell {
  vertical-align: middle;
  min-width: 10.5rem;
  overflow: visible;
}

.product-list__more-btn {
  width: 1.85rem;
  padding-left: 0;
  padding-right: 0;
}

.product-list__more .dropdown-menu {
  min-width: 10.5rem;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
}

.product-list__more .dropdown-item {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  letter-spacing: normal;
}

.product-list__name-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-left: 0.5rem;
}

.product-list__name-wrap {
  display: inline;
  max-width: 100%;
}

.product-list__market-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.75;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.product-list__market-link:hover,
.product-list__market-link:focus-visible {
  opacity: 1;
  color: var(--blue);
  border-color: rgba(74, 134, 197, 0.35);
  background: rgba(74, 134, 197, 0.06);
}

.product-list__market-link i {
  font-size: 0.625rem;
}

.product-list__meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.product-list__meta .mp-cell__label {
  font-size: 0.75rem;
}

.product-list-table .product-list__name-cell .stock-loc-row__name {
  display: inline;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.875rem;
}

.product-list__article {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 400;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  border: 1px solid rgba(125, 101, 168, 0.28);
  background: rgba(125, 101, 168, 0.08);
  color: var(--violet);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

button.product-list__article {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  line-height: inherit;
  text-align: left;
}

button.product-list__article:hover {
  border-color: rgba(125, 101, 168, 0.45);
  background: rgba(125, 101, 168, 0.12);
}

.product-list__article.is-copied {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
}

[data-theme="dark"] .product-list__article {
  border-color: rgba(163, 113, 247, 0.32);
  background: rgba(163, 113, 247, 0.12);
}

[data-theme="dark"] button.product-list__article:hover {
  border-color: rgba(163, 113, 247, 0.48);
  background: rgba(163, 113, 247, 0.16);
}

[data-theme="dark"] .product-list__article.is-copied {
  background: rgba(63, 185, 80, 0.12);
}

.product-list-table .product-list__status-col {
  white-space: normal;
}

.product-list__status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  line-height: 1.3;
  max-width: 9rem;
  white-space: normal;
  text-align: left;
}

.product-list__price {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
}

.product-list__price-btn {
  border: 0;
  background: transparent;
  padding: 0.125rem 0.25rem;
  margin: -0.125rem -0.25rem;
  border-radius: var(--radius-sm, 0.375rem);
  cursor: pointer;
  color: inherit;
  line-height: inherit;
  max-width: 100%;
}

.product-list__price-btn:hover,
.product-list__price-btn:focus-visible {
  background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08);
  outline: none;
}

.product-list__price-hint {
  font-size: 0.6875rem;
  color: var(--blue);
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, width 0.15s ease, margin 0.15s ease;
}

.product-list__price-btn:hover .product-list__price-hint,
.product-list__price-btn:focus-visible .product-list__price-hint {
  opacity: 1;
  width: 0.75rem;
  margin-right: 0.125rem;
  overflow: visible;
}

.product-price-modal__body {
  max-height: min(70vh, 28rem);
  overflow: auto;
}

.product-price-modal__list {
  display: flex;
  flex-direction: column;
}

.product-price-modal__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.product-price-modal__row:last-child {
  border-bottom: 0;
}

.product-price-modal__group {
  border-bottom: 1px solid var(--line);
}

.product-price-modal__group:last-child {
  border-bottom: 0;
}

.product-price-modal__row--group-head {
  border-bottom: 0;
  padding: 0;
}

.product-price-modal__group-items {
  margin-top: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.35rem 0 0.15rem 0.75rem;
  border-left: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.product-price-modal__row--group-item {
  border-bottom: 0;
  padding: 0.2rem 0;
  gap: 0.25rem 0.75rem;
}

.product-price-modal__row--group-item .product-price-modal__label {
  font-size: 0.8125rem;
}

.product-price-modal__row--group-item .product-price-modal__value {
  font-size: 0.8125rem;
  color: var(--muted);
}

.product-price-modal__row--indent {
  padding-left: 1.25rem;
}

.product-price-modal__row--indent .product-price-modal__label {
  font-size: 0.8125rem;
}

.product-price-modal__label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}

.product-price-modal__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.product-price-modal__value--strong {
  font-weight: 600;
  color: var(--text);
}

.product-price-modal__note {
  grid-column: 1 / -1;
}

.product-price-modal__hint {
  border-bottom: 1px solid var(--line);
}

.product-price-modal__foot {
  background: var(--card-footer-bg);
  border-color: var(--line) !important;
  color: var(--muted);
}

.product-list__price-amount {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.product-list__price-cur {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

/* Таблица групп на складе */
.warehouse-groups-table {
  table-layout: fixed;
  width: 100%;
}

.warehouse-group-notes {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warehouse-groups-col--name {
  width: 11%;
}

.warehouse-groups-col--cost {
  width: 10%;
}

.warehouse-groups-col--num {
  width: 7%;
}

.warehouse-groups-col--sold {
  width: 7%;
}

.warehouse-groups-col--added {
  width: 8.5rem;
}

.warehouse-groups-col--products {
  width: 40%;
}

.warehouse-groups-col--actions {
  width: 11.5rem;
}

/* Колонка «Товары» в списке групп */
.group-linked-products-cell {
  text-align: left;
  vertical-align: middle !important;
  width: auto;
  min-width: 0;
  max-width: none;
}

.group-linked-products {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.group-linked-products__chip {
  width: 100%;
  max-width: 100%;
  min-height: 2.25rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
  justify-content: flex-start;
  text-align: left;
}

.group-linked-products__chip .product-stock-chip__name-tip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.group-linked-products__chip .product-stock-chip__more {
  margin-left: 0;
  flex-shrink: 0;
}

.group-linked-products__chip .product-stock-chip__name {
  font-size: 0.875rem;
}

.group-linked-products__chip .product-stock-chip__icon {
  margin-left: auto;
}

.group-linked-products-modal__body-wrap {
  overflow: hidden;
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.group-linked-products-modal__group {
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}

.group-linked-products-modal__table thead th {
  border-top: none;
}

.group-linked-products-modal__table tbody tr:last-child td {
  border-bottom: none;
}

.group-linked-products-modal__actions-col {
  width: 6.5rem;
}

.group-linked-products-modal__name a {
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Колонка «Склад» в списке товаров: единая капсула (чип + полоска + число) */
.product-list-table tbody .product-stock-cell {
  text-align: left;
  vertical-align: middle !important;
  width: 13rem;
  min-width: 13rem;
  max-width: 13rem;
  white-space: normal;
}

.product-stock-cell {
  text-align: left;
}

.product-list-table .product-stock {
  width: 100%;
}

.product-list-table .product-stock-chip--unified {
  width: 100%;
  gap: 0.25rem;
}

.product-list-table .product-stock-chip--unified .product-stock-chip__name-tip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 8rem;
}

.product-list-table .product-stock-chip--unified .product-stock-chip__more {
  margin-left: 0;
  margin-right: 0.1rem;
}

.product-stock-chip__tail {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  margin-left: auto;
}

.product-stock-chip__meter-bar {
  width: 1.25rem;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  flex-shrink: 0;
}

.product-stock-chip__meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.product-stock-chip__meter-fill--low {
  background: var(--orange);
}

.product-stock-chip__meter-fill--empty {
  background: transparent;
}

.product-stock-chip__meter-value {
  min-width: 1.75rem;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  line-height: 1;
  flex-shrink: 0;
}

.product-stock-chip__meter-value--ok {
  color: var(--green);
}

.product-stock-chip__meter-value--low {
  color: var(--orange);
}

.product-stock-chip__meter-value--empty {
  color: var(--red);
}

.product-stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 1.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.8125rem;
  line-height: 1.2;
  color: inherit;
  text-decoration: none;
  vertical-align: middle;
  overflow: visible;
}

.product-stock-chip--btn {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  justify-content: flex-start;
  text-align: left;
}

.product-stock-chip--link:hover,
.product-stock-chip--btn:hover {
  background: var(--table-hover-bg);
  border-color: var(--border-strong);
}

.product-stock-chip--direct {
  gap: 0.35rem;
}

.product-stock-chip__name-tip {
  position: relative;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
}

.product-stock-chip__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
  font-weight: 500;
  line-height: 1.2;
}

.product-stock-chip__more {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: var(--nav-active-bg);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.product-stock-chip__stat {
  flex-shrink: 0;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.product-stock-chip__stat strong {
  color: var(--green);
  font-weight: 600;
}

.product-stock-chip__stat--avail strong {
  min-width: 1.5em;
  text-align: right;
}

.product-stock-chip__sold {
  color: var(--muted);
}

a.product-stock-chip--link .product-stock-chip__sold {
  color: var(--muted);
}

.product-stock-chip__sep {
  color: var(--muted);
  margin: 0 0.1rem;
}

.product-stock-chip__icon {
  flex-shrink: 0;
  font-size: 0.625rem;
  color: var(--muted);
  opacity: 0.75;
}

.product-stock-modal__body-wrap {
  overflow: hidden;
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.product-stock-modal__product {
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}

.product-stock-modal__table thead th {
  border-top: none;
}

.product-stock-modal__sold-head {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  width: 100%;
}

.product-stock-modal__table tfoot td {
  border-bottom: none;
  background: var(--card-footer-bg);
  font-size: 0.8125rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.product-stock-modal__total-label {
  color: var(--muted);
  font-weight: 500;
}

.product-stock-modal__total-avail {
  color: var(--green);
  font-weight: 600;
}

.product-stock-modal__total-sold-product {
  font-weight: 600;
}

.product-stock-modal__total-sold-group {
  color: var(--bs-secondary-color);
}

.product-stock-modal__total-sold {
  font-weight: 600;
}

.product-stock-modal__table .product-stock-modal__cost {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.product-stock-modal__actions-col {
  width: 6.75rem;
}

.product-stock-modal__name a {
  font-weight: 500;
}

.product-stock-modal__name-inner {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.product-stock-modal__name-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-stock-modal__notes-hint,
.code-group-notes-hint {
  font-size: inherit;
  color: var(--muted);
  opacity: 0;
  width: 0;
  height: 1.125rem;
  min-height: 1.125rem;
  overflow: hidden;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: opacity 0.15s ease, width 0.15s ease, margin 0.15s ease, color 0.15s ease;
}

.product-stock-modal__notes-hint i,
.code-group-notes-hint i {
  font-size: 0.8125rem;
  line-height: 1;
}

.product-stock-modal__name-inner:hover .product-stock-modal__notes-hint,
.product-stock-modal__name-inner:focus-within .product-stock-modal__notes-hint,
.product-stock-modal__notes-hint:focus-visible,
.warehouse-group-name-inner:hover .code-group-notes-hint,
.warehouse-group-name-inner:focus-within .code-group-notes-hint,
.code-group-notes-hint:focus-visible,
.code-group-link-card__name-row:hover .code-group-link-card__notes-hint,
.code-group-link-card__name-row:focus-within .code-group-link-card__notes-hint,
.code-group-link-card__notes-hint:focus-visible {
  color: var(--accent, #0d6efd);
  opacity: 1;
  width: 1.125rem;
  margin-left: 0.35rem;
  overflow: visible;
}

.code-group-notes-hint--visible {
  opacity: 1;
  width: 1.125rem;
  margin-left: 0.35rem;
  overflow: visible;
}

.product-stock-modal__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.product-stock-modal__btn {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.product-stock-modal__toolbar {
  position: relative;
}

.product-stock-modal__alert {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.product-stock-modal__btn--unlink {
  color: var(--red);
}

.product-stock-modal__btn--unlink:hover,
.product-stock-modal__btn--unlink:focus-visible {
  color: #fff;
  background-color: var(--red);
  border-color: var(--red);
}

/* Источник кода: группа / товар */
.stock-loc-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.stock-loc-row__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.stock-loc-row__name {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

a.stock-loc-row__name:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* Склад · список кодов */
[data-sortable="warehouse-list"] {
  table-layout: fixed;
  width: 100%;
  font-size: 0.9375rem;
}

[data-sortable="warehouse-list"] thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

/* Ширины колонок на th/td (без colgroup — как у заказов) */
.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__code-col,
.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__code-cell {
  width: 12.5rem;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__where {
  width: 34%;
  min-width: 11rem;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__status {
  width: 6.5rem;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__added {
  width: 8.5rem;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__order {
  width: 4.25rem;
}

.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__actions-col,
.warehouse-list-card:not(.warehouse-list-card--bulk) .warehouse-code-table__actions {
  width: 5.25rem;
}

[data-sortable="warehouse-list"] .warehouse-code-table__where {
  text-align: left;
}

[data-sortable="warehouse-list"] .warehouse-code-table__added,
[data-sortable="warehouse-list"] thead .warehouse-code-table__added {
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

[data-sortable="warehouse-list"] tbody .warehouse-code-table__added {
  font-size: 0.8125rem;
}

.warehouse-code-table__code-cell,
.warehouse-code-table__code-col {
  vertical-align: middle;
  padding-right: 0.5rem !important;
  white-space: nowrap;
  overflow: hidden;
}

.warehouse-code-table__where {
  vertical-align: middle;
  min-width: 0;
  max-width: 0;
  padding-left: 0.5rem !important;
  overflow: hidden;
}

.warehouse-code-table__where .warehouse-code-loc {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-content: flex-start;
  text-align: left;
}

.warehouse-code-loc .stock-loc-badge {
  flex-shrink: 0;
}

.warehouse-code-loc .product-stock-chip__name-tip {
  flex: 1 1 auto;
  min-width: 0;
}

.warehouse-code-table__code-cell .digital-code-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 0.25rem 0.55rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.warehouse-code-table__code-cell .digital-code-badge__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  font-size: 0.9375rem;
}

.warehouse-code-status {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.warehouse-code-status--free {
  color: #2d6b4a;
  background: rgba(61, 143, 106, 0.12);
}

[data-theme="dark"] .warehouse-code-status--free {
  color: #6ecf9a;
  background: rgba(61, 143, 106, 0.18);
}

.warehouse-code-status--used {
  color: var(--muted);
  background: var(--surface-muted);
}

.warehouse-code-table__actions {
  vertical-align: middle;
}

.warehouse-code-table__actions .btn {
  padding: 0.28rem 0.45rem;
  line-height: 1;
  font-size: 0.8125rem;
}

.warehouse-code-table__actions .btn + .btn {
  margin-left: 0.2rem;
}

.warehouse-code-subline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--muted);
}

.warehouse-code-subline__kind {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cyan);
}

.warehouse-code-subline__sep {
  flex-shrink: 0;
  opacity: 0.45;
}

.warehouse-code-subline__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.warehouse-code-subline__name:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.digital-code-badge {
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(74, 154, 163, 0.28);
  background: rgba(74, 154, 163, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.digital-code-badge:hover {
  border-color: rgba(74, 154, 163, 0.45);
  background: rgba(74, 154, 163, 0.14);
}

[data-theme="dark"] .digital-code-badge {
  border-color: rgba(57, 197, 207, 0.32);
  background: rgba(57, 197, 207, 0.1);
}

[data-theme="dark"] .digital-code-badge:hover {
  border-color: rgba(57, 197, 207, 0.48);
  background: rgba(57, 197, 207, 0.16);
}

.digital-code-badge__text {
  color: var(--cyan);
  word-break: break-all;
  white-space: normal;
  min-width: 0;
  pointer-events: none;
}

.stock-loc-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
}

.stock-loc-badge--group {
  color: var(--cyan);
  background: rgba(74, 154, 163, 0.12);
  border: 1px solid rgba(74, 154, 163, 0.28);
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-loc-badge--group.stock-loc-badge--link {
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.stock-loc-badge--group.stock-loc-badge--link:hover {
  color: var(--cyan);
  background: rgba(74, 154, 163, 0.2);
  border-color: rgba(74, 154, 163, 0.45);
}

[data-theme="dark"] .stock-loc-badge--group {
  background: rgba(57, 197, 207, 0.12);
  border-color: rgba(57, 197, 207, 0.28);
}

[data-theme="dark"] .stock-loc-badge--group.stock-loc-badge--link:hover {
  background: rgba(57, 197, 207, 0.18);
  border-color: rgba(57, 197, 207, 0.4);
}

.stock-loc-badge--product {
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
}

.stock-loc-badge--product.stock-loc-badge--link {
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stock-loc-badge--product.stock-loc-badge--link:hover {
  color: var(--text);
  background: var(--table-hover-bg);
  border-color: var(--border-strong);
}

.stock-loc-badge--orphan {
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border-strong);
}

.stock-loc-badge--group-kind {
  color: var(--cyan);
  background: rgba(74, 154, 163, 0.12);
  border: 1px solid rgba(74, 154, 163, 0.28);
}

[data-theme="dark"] .stock-loc-badge--group-kind {
  background: rgba(57, 197, 207, 0.12);
  border-color: rgba(57, 197, 207, 0.28);
}

a.product-stock-chip--link .stock-loc-badge--group-kind,
button.product-stock-chip--btn .stock-loc-badge--group-kind {
  color: var(--cyan) !important;
  background: rgba(74, 154, 163, 0.14);
  border: 1px solid rgba(74, 154, 163, 0.32);
}

a.product-stock-chip--link:hover .stock-loc-badge--group-kind,
button.product-stock-chip--btn:hover .stock-loc-badge--group-kind {
  color: var(--cyan) !important;
  background: rgba(74, 154, 163, 0.22);
  border-color: rgba(74, 154, 163, 0.45);
}

[data-theme="dark"] a.product-stock-chip--link .stock-loc-badge--group-kind,
[data-theme="dark"] button.product-stock-chip--btn .stock-loc-badge--group-kind {
  color: #5ed4dc !important;
  background: rgba(57, 197, 207, 0.14);
  border-color: rgba(57, 197, 207, 0.32);
}

a.product-stock-chip--link .stock-loc-badge--product,
button.product-stock-chip--btn .stock-loc-badge--product {
  color: var(--muted) !important;
  background: var(--panel);
  border: 1px solid var(--line);
}

.code-group-fields-row .cost-field-group .cost-field-amount {
  min-width: 0;
}

/* Привязка групп в карточке товара */
.code-group-links-panel {
  border: 1px solid var(--line);
  border-radius: var(--bs-border-radius);
  background: var(--panel);
  overflow: visible;
}

.code-group-links-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.code-group-links-toolbar__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.code-group-links-toolbar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--nav-active-bg);
  color: var(--blue);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.code-group-links-summary__badge {
  flex-shrink: 0;
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
}

.code-group-links-summary__add {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

button.code-group-links-summary__add {
  cursor: pointer;
}

.code-group-links-summary__add:hover {
  background: var(--nav-active-bg);
  color: var(--blue);
}

.code-group-links-add--summary {
  position: static;
  flex-shrink: 0;
}

.code-group-links-body {
  padding: 0.65rem;
}

.code-group-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.1rem;
}

.code-group-links-list:not(:empty) {
  margin-bottom: 0.15rem;
}

.code-group-links-empty {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}

.code-group-links-add {
  position: relative;
}

.stock-target-picker {
  position: relative;
}

.stock-target-picker__trigger {
  display: flex;
  align-items: center;
  width: 100%;
  /* Как у выбранного (имя + meta), пустой плейсхолдер центрируется */
  min-height: calc(0.875rem * 1.25 + 0.6875rem * 1.2 + 0.5rem + 2px);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  cursor: pointer;
  color: var(--text);
}

.stock-target-picker__label {
  display: block;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
}

.stock-target-picker__label.is-placeholder {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25;
}

.stock-target-picker__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 400;
  color: var(--text);
}

.stock-target-picker__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--muted);
}

.code-group-links-picker--in-modal {
  z-index: 1065;
}

.code-group-links-picker {
  position: fixed;
  z-index: 1070;
  min-width: 20rem;
  max-width: calc(100vw - 1rem - var(--safe-left) - var(--safe-right));
  box-sizing: border-box;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.code-group-links-picker.code-group-links-picker--stock-target {
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
}

[data-theme="dark"] .code-group-links-picker {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.code-group-links-picker__search {
  font-size: 0.8125rem;
}

.code-group-links-picker__list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  max-height: 16rem;
  overflow-y: auto;
}

.code-group-links-picker__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.code-group-links-picker__option:hover,
.code-group-links-picker__option:focus-visible {
  background: var(--table-hover-bg);
  outline: none;
}

.code-group-links-picker__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-group-links-picker__meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
}

.code-group-links-picker__empty {
  padding: 0.5rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.code-group-link-item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.code-group-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  flex-shrink: 0;
  color: var(--muted);
  cursor: grab;
  font-size: 0.75rem;
  opacity: 0.65;
}

.code-group-drag-handle:active {
  cursor: grabbing;
}

.code-group-link-card {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.code-group-link-card.is-linked {
  border-color: rgba(74, 134, 197, 0.45);
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px rgba(74, 134, 197, 0.12);
}

.code-group-link-card__inner {
  flex: 1 1 auto;
  min-width: 0;
}

.code-group-link-card__name-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.15rem;
}

.code-group-link-card__name {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-group-link-card__notes-hint {
  flex-shrink: 0;
  margin-left: 0;
}

.code-group-link-card__meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
}

.code-group-link-card__cost {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.code-group-link-card__cost:hover {
  color: var(--blue);
  text-decoration: underline;
}

.code-group-link-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.code-group-link-remove:hover {
  color: var(--danger, #dc3545);
  background: rgba(220, 53, 69, 0.1);
}

.code-group-link-add-codes {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.code-group-link-add-codes:hover {
  color: var(--blue);
  background: rgba(74, 134, 197, 0.12);
}

.code-group-links-list:not(.code-group-links-list--reorderable) .code-group-link-item {
  gap: 0;
}

.code-group-links-footnote {
  margin: 0.45rem 0 0;
  font-size: 0.6875rem;
  color: var(--muted);
}

.code-group-pick-mode__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.code-group-pick-segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elevated);
}

.code-group-pick-segmented__option {
  margin: 0;
  cursor: pointer;
}

.code-group-pick-segmented__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.code-group-pick-segmented__label {
  display: block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted);
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.code-group-pick-segmented__option:hover .code-group-pick-segmented__label {
  color: var(--text);
}

.code-group-pick-segmented__option input:checked + .code-group-pick-segmented__label {
  background: var(--blue);
  color: #fff;
}

.code-group-pick-segmented__option input:focus-visible + .code-group-pick-segmented__label {
  outline: 2px solid rgba(88, 166, 255, 0.55);
  outline-offset: 1px;
}

.product-code-source-segmented {
  flex-wrap: wrap;
}

.product-code-source-segmented__option--soon,
.product-code-source-segmented__option--disabled {
  cursor: not-allowed;
}

.product-code-source-segmented__option--soon .code-group-pick-segmented__label,
.product-code-source-segmented__option--disabled .code-group-pick-segmented__label {
  color: var(--muted);
  opacity: 0.72;
}

.product-code-source-segmented__option--soon:hover .code-group-pick-segmented__label,
.product-code-source-segmented__option--disabled:hover .code-group-pick-segmented__label {
  color: var(--muted);
}

.product-code-source-soon {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  vertical-align: middle;
}

.product-code-restock {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elevated);
}

.product-code-restock__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.product-code-restock__summary::-webkit-details-marker {
  display: none;
}

.product-code-restock__summary:hover {
  background: rgba(88, 166, 255, 0.06);
}

.product-code-restock__title {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.product-code-restock__aside {
  flex: 0 1 auto;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.product-code-restock__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}

.product-code-restock__toggle-close {
  display: none;
}

.product-code-restock[open] .product-code-restock__toggle-open {
  display: none;
}

.product-code-restock[open] .product-code-restock__toggle-close {
  display: inline;
}

.product-code-restock__chevron {
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

.product-code-restock[open] .product-code-restock__chevron {
  transform: rotate(90deg);
}

.product-code-restock__body {
  padding: 0 0.65rem 0.5rem;
}

/* Вложена в рамку «Пополнение» — без второй карточки и лишнего padding card-body */
.product-code-restock__body .supplier-procurement-card {
  margin-bottom: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.product-code-restock__body .supplier-procurement-card > .card-body {
  padding: 0;
}

.product-code-restock__body .supplier-procurement-card .mb-3 {
  margin-bottom: 0.65rem;
}

.product-code-restock__body .supplier-procurement-card .mb-3:has(+ .supplier-procurement-catalog) {
  margin-bottom: 0;
}

.product-code-restock__body .supplier-procurement-card .form-text.mt-2 {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.product-code-restock__body .supplier-procurement-card .supplier-procurement-message.mt-2 {
  margin-top: 0.35rem;
}

.code-group-links-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
}

/* ——— Notifications settings ——— */

.notify-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
}

.notify-settings__events,
.notify-settings__channels {
  min-width: 0;
}

.notify-settings__channels {
  position: sticky;
  top: 1rem;
}

.notify-settings__channels-intro {
  padding-bottom: 0.85rem;
}

.notify-channel-tab-form {
  border-top: 1px solid var(--line);
}

.notify-channel-tab-form__body {
  padding-top: 1rem;
}

.notify-channel-tabs {
  gap: 0.35rem;
}

.notify-channel-tabs .nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
}

@media (max-width: 991.98px) {
  .notify-settings {
    grid-template-columns: 1fr;
  }

  .notify-settings__channels {
    position: static;
  }
}

.notify-channel-card .card-body {
  padding-top: 1rem;
}

/* ——— Push settings (full-width view) ——— */

.push-settings {
  max-width: 720px;
}

.push-devices-list {
  display: flex;
  flex-direction: column;
}

.push-device-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
}

.push-device-item:first-child {
  border-top: none;
}

.push-device-item__main {
  flex: 1;
  min-width: 0;
}

.push-device-item__title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.push-device-item__ua {
  word-break: break-word;
  margin-bottom: 0.25rem;
}

.settings-spoiler {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.settings-spoiler > summary {
  list-style: none;
}

.settings-spoiler > summary::-webkit-details-marker {
  display: none;
}

.settings-spoiler__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.settings-spoiler__summary:hover {
  background: var(--table-hover-bg);
}

.settings-spoiler__chevron {
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.settings-spoiler[open] .settings-spoiler__chevron {
  transform: rotate(90deg);
}

.settings-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.16);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.35);
  white-space: nowrap;
}

[data-theme="light"] .settings-status-badge {
  background: rgba(61, 143, 106, 0.12);
  border-color: rgba(61, 143, 106, 0.28);
}

.proxy-usage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.proxy-usage-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.proxy-usage-strip__item:hover {
  background: var(--panel-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.proxy-usage-strip__item .fas,
.proxy-usage-strip__item .fab {
  color: var(--muted);
  font-size: 0.8rem;
}

.proxy-usage-strip__empty {
  font-size: 0.8125rem;
  color: var(--muted);
}

.proxy-usage-strip__empty a {
  font-weight: 600;
}

.settings-spoiler__body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--line);
}

.settings-spoiler[open] .settings-spoiler__body {
  padding-top: 0.85rem;
}

.notify-matrix {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.notify-matrix__head,
.notify-matrix__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--notify-channel-cols, 2), 4.75rem);
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.notify-matrix--cols-2 {
  --notify-channel-cols: 2;
}

.notify-matrix--cols-3 {
  --notify-channel-cols: 3;
}

.notify-matrix__head {
  padding: 0.55rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--table-hover-bg);
  border-bottom: 1px solid var(--line);
}

.notify-matrix__channel-col {
  text-align: center;
}

.notify-matrix__group-title {
  padding: 0.55rem 0.85rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.notify-matrix__row {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--line);
}

.notify-matrix__event {
  min-width: 0;
  font-size: 0.9375rem;
}

.notify-matrix__channel {
  text-align: center;
}

.notify-matrix__stock-extra {
  padding: 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}

.app-notifications__item {
  white-space: normal;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  color: var(--text);
}

.app-notifications__item:hover,
.app-notifications__item:focus,
.app-notifications__item:active,
.app-notifications__item.active {
  color: var(--text);
  background: var(--panel-hover);
}

.app-notifications__item--unread {
  background: var(--table-hover-bg);
}

.app-notifications__item--unread:hover,
.app-notifications__item--unread:focus,
.app-notifications__item--unread:active,
.app-notifications__item--unread.active {
  color: var(--text);
  background: var(--table-hover-bg);
}

.app-notifications__item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
}

.app-notifications__item-title-text {
  flex: 1;
  min-width: 0;
}

.app-notifications__count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.45rem;
  min-width: 1.25rem;
  text-align: center;
  background: var(--blue);
  color: #fff !important;
  border: none;
}

.app-notifications__item-body {
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.35;
}

.app-notifications__item-time {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.mm-toast--notify {
  align-items: flex-start;
  gap: 0.65rem;
}

@media (min-width: 861px) {
  .mm-toast--notify {
    max-width: 22rem;
  }
}

.mm-toast__notify-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.mm-toast__close {
  flex-shrink: 0;
  align-self: flex-start;
  margin: -2px -4px 0 0;
  padding: 0.2rem 0.35rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.mm-toast__close:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.12);
}

.mm-toast__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mm-toast__notify-text strong {
  font-size: 0.875rem;
}

.mm-toast__notify-text span {
  font-size: 0.8125rem;
  color: var(--muted);
}

.notify-toggles__item + .notify-toggles__item {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.notify-toggles__sample {
  display: inline-block;
  width: 1.35rem;
  text-align: center;
}

.notify-toggles__hint {
  margin: 0.25rem 0 0 1.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 860px) {
  .notify-matrix .notify-toggles__hint {
    display: none;
  }
}

/* ——— Diagnostics (?page=diagnostics) ——— */

.diagnostics-spoiler__summary {
  font-size: 0.9375rem;
}

.diagnostics-spoiler__icon {
  color: var(--muted);
  font-size: 0.85rem;
}

.diagnostics-spoiler__title {
  flex: 1;
}

.diagnostics-spoiler__badge {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.diagnostics-spoiler__body .card {
  border: none;
  box-shadow: none;
}

.diagnostics-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.diagnostics-stats .stat-card strong {
  font-size: 1.35rem;
}

.diagnostics-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.diagnostics-banner i {
  margin-top: 0.1rem;
  font-size: 1.1rem;
}

.diagnostics-banner--ok {
  border: 1px solid rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
}

[data-theme="light"] .diagnostics-banner--ok {
  background: rgba(61, 143, 106, 0.1);
  border-color: rgba(61, 143, 106, 0.28);
  color: #2d6a4f;
}

.diagnostics-panel {
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.9rem 1rem 1rem;
}

.diagnostics-panel__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.diagnostics-panel__head > i {
  width: 1.25rem;
  text-align: center;
  color: var(--muted);
}

.diagnostics-panel__head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.diagnostics-panel__count {
  display: inline-block;
  min-width: 1.35rem;
  margin-left: 0.15rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.diagnostics-panel__lead {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.diagnostics-panel__empty {
  font-size: 0.875rem;
  color: var(--muted);
}

.diagnostics-panel--danger {
  border-color: rgba(248, 81, 73, 0.35);
}

.diagnostics-panel--danger .diagnostics-panel__head > i {
  color: var(--red);
}

.diagnostics-panel--warning {
  border-color: rgba(210, 153, 34, 0.35);
}

.diagnostics-panel--warning .diagnostics-panel__head > i {
  color: var(--amber);
}

.diagnostics-panel--info {
  border-color: rgba(88, 166, 255, 0.35);
}

.diagnostics-panel--info .diagnostics-panel__head > i {
  color: var(--blue);
}

.diagnostics-panel--ok {
  border-color: rgba(63, 185, 80, 0.28);
}

.diagnostics-panel--ok .diagnostics-panel__head > i {
  color: var(--green);
}

.diagnostics-panel--muted .diagnostics-panel__head > i {
  color: var(--muted);
}

.diagnostics-path-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.diagnostics-path-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
}

.diagnostics-path-list--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
}

.diagnostics-path-list--cols-3 .diagnostics-path-list__line {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.diagnostics-path-list--cols-3 .diagnostics-path-list__meta {
  white-space: normal;
}

.diagnostics-path-list__body {
  min-width: 0;
  flex: 1;
}

.diagnostics-path-list__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.diagnostics-hash-pair {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.diagnostics-hash-pair__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.diagnostics-hash-pair__label {
  flex: 0 0 3.25rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
}

.diagnostics-hash-pair code {
  font-size: 0.72rem;
  word-break: break-all;
}

.diagnostics-path-list__icon {
  flex-shrink: 0;
  width: 0.9rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.diagnostics-path-list__icon--dir {
  color: var(--amber);
}

.diagnostics-path-list__meta {
  flex-shrink: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
}

.diagnostics-env-group {
  margin-bottom: 0.75rem;
}

.diagnostics-env-group:last-child {
  margin-bottom: 0;
}

.diagnostics-env-group h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.diagnostics-env-group--error h4 {
  color: var(--red);
}

.diagnostics-env-group--warning h4 {
  color: var(--amber);
}

.diagnostics-env-group ul,
.diagnostics-env-ok ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.diagnostics-env-ok summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--muted);
  user-select: none;
}

.diagnostics-env-ok[open] summary {
  margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
  .diagnostics-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .diagnostics-path-list--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .diagnostics-stats {
    grid-template-columns: 1fr;
  }

  .diagnostics-path-list,
  .diagnostics-path-list--cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ——— Mobile: таблицы и фильтры (с 860px — вместе с горизонтальным меню) ——— */

@media (max-width: 860px) {
  .log-table-wrap.table-responsive {
    overflow: visible;
  }

  .log-table {
    table-layout: auto;
  }

  .log-table colgroup {
    display: none;
  }

  .log-table thead {
    display: none;
  }

  .log-table tbody .log-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
  }

  .log-table tbody .log-row.log-error {
    background: rgba(248, 81, 73, 0.08);
  }

  .log-table tbody .log-row.log-warning {
    background: rgba(210, 153, 34, 0.08);
  }

  .log-table tbody .log-row.log-debug {
    color: var(--muted);
  }

  .log-table tbody .log-row > td {
    display: block;
    border: 0;
    padding: 0;
    width: auto;
    background: transparent !important;
  }

  .log-table__time {
    flex: 1 1 100%;
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
  }

  .log-table__level,
  .log-table__source {
    flex: 0 0 auto;
  }

  .log-table__message-cell {
    flex: 1 1 100%;
    min-width: 0;
    margin-top: 0.25rem;
  }

  .log-table tbody tr:not(.log-row) > td {
    display: table-cell;
    padding: 1rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .filter-toolbar-form {
    flex: 0 0 auto;
    width: 100%;
  }

  .filter-toolbar-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search-wrap {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .filter-select {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
  }

  .filter-date-range-wrap {
    width: 100%;
  }

  .filter-date-range {
    max-width: none;
    width: 100%;
  }

  .filter-date-range__panel {
    left: 0;
    right: 0;
    width: auto;
  }

  .filter-selects-inline {
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-selects-inline .filter-select {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .card > .table-responsive,
  .card-body.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .supplier-catalog-table-card > .supplier-catalog-table-wrap.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
  }

  .supplier-catalog-table-card > .supplier-catalog-table-wrap.table-responsive .supplier-catalog-table {
    width: max-content;
    min-width: 100%;
  }

  .card-body.table-responsive .product-list-table {
    width: max-content;
    min-width: 100%;
  }

  .card-body.table-responsive [data-sortable="warehouse-list"] {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .warehouse-groups-table,
  [data-sortable="orders"] {
    table-layout: auto;
    width: 100%;
  }

  .product-list-table {
    table-layout: auto;
    width: 100%;
  }

  /* Товары: статус, цена — в карточке товара; артикул под названием */
  .product-list-table col.product-list-col--status,
  .product-list-table col.product-list-col--price,
  .product-list-table thead .product-list__status-col,
  .product-list-table tbody .product-list__status-col,
  .product-list-table thead .product-list__price-cell,
  .product-list-table tbody .product-list__price-cell {
    display: none !important;
  }

  .product-list-col--name { width: auto; }
  .product-list-col--stock { width: 7.25rem; }
  .product-list-col--sales { width: 4.25rem; }
  .product-list-col--actions { width: 5.5rem; }

  .product-list-table .product-list__name-cell {
    min-width: 6.5rem;
    max-width: none;
  }

  .product-list-table .product-list__name-cell .stock-loc-row__name {
    display: inline;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }

  .product-list-table tbody .product-stock-cell {
    min-width: 7.25rem;
    width: 7.25rem;
    max-width: 7.25rem;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
    overflow: visible;
  }

  .product-list-table .product-stock {
    width: 100%;
    overflow: visible;
  }

  .product-list-table .product-stock-chip__meter-bar {
    display: none;
  }

  .product-list-table .product-stock-chip {
    min-height: 2rem;
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.35rem;
    gap: 0.2rem;
    justify-content: flex-start;
    overflow: visible;
  }

  .product-list-table .product-stock-chip--unified .stock-loc-badge {
    flex-shrink: 1;
    min-width: 0;
    max-width: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.625rem;
    padding: 0.1rem 0.3rem;
  }

  .product-list-table .product-stock-chip__name-tip,
  .product-list-table .product-stock-chip__more,
  .product-list-table .product-stock-chip__icon {
    display: none !important;
  }

  .product-list-table .product-stock-chip__tail {
    margin-left: auto;
    flex-shrink: 0;
    gap: 0;
  }

  .product-list-table .product-stock-chip__meter-value {
    flex-shrink: 0;
    min-width: 1.35rem;
    padding-left: 0.15rem;
  }

  .product-list-table .product-stock-chip--direct,
  .product-list-table .product-stock-chip--unified {
    justify-content: flex-start;
  }

  .product-list-table tbody .product-list__actions-cell {
    min-width: 5.5rem;
    white-space: normal;
  }

  .product-list-table .product-list__actions-cell .btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .product-list-table .product-list__codes-btn-label {
    display: none;
  }

  .product-list-table .product-list__sync-btn-label {
    display: none;
  }

  .product-list-table .product-list__codes-btn {
    min-width: 2rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    justify-content: center;
  }

  .product-list-table thead .table-head-action-head,
  .product-list-table thead .table-head-action-head--wide {
    min-width: 0;
    width: auto;
    max-width: 2.25rem;
    padding-left: 0.1rem;
    padding-right: 0.45rem;
    overflow: hidden;
  }

  .product-list-table thead .table-head-action-form {
    display: flex;
    justify-content: flex-end;
    max-width: 100%;
    padding-right: 0.15rem;
  }

  .product-list-table thead .table-head-action-head .table-head-action-btn.btn {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .product-list-table thead .table-head-action-head .table-head-action-btn .fa-sync {
    font-size: 11px;
    margin: 0;
  }

  .product-list-table th,
  .product-list-table td {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    vertical-align: middle;
  }

  .product-list-table tbody td {
    font-size: 0.8125rem;
  }

  /* Склад · группы */
  .warehouse-groups-table col.warehouse-groups-col--sold,
  .warehouse-groups-table col.warehouse-groups-col--products,
  .warehouse-groups-table .warehouse-groups-table__sold,
  .warehouse-groups-table .group-linked-products-cell {
    display: none;
  }

  .warehouse-groups-table td:first-child {
    min-width: 6.5rem;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .warehouse-groups-table td:first-child a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .warehouse-groups-table th:nth-child(3),
  .warehouse-groups-table td:nth-child(3) {
    width: 3rem;
    white-space: nowrap;
  }

  .warehouse-groups-table td:last-child {
    white-space: nowrap;
  }

  .warehouse-groups-table td:last-child .btn {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    font-size: 0.75rem;
  }

  /* Склад · список кодов */
  [data-sortable="warehouse-list"] .warehouse-code-table__order {
    display: none;
  }

  [data-sortable="warehouse-list"] .warehouse-code-table__where {
    max-width: none;
    min-width: 6rem;
  }

  [data-sortable="warehouse-list"] .warehouse-code-table__code-cell,
  [data-sortable="warehouse-list"] .warehouse-code-table__code-col {
    width: 10rem;
    min-width: 8.5rem;
    max-width: 10.5rem;
  }

  [data-sortable="warehouse-list"] .warehouse-code-table__code-cell .digital-code-badge {
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  [data-sortable="warehouse-list"] .warehouse-code-table__code-cell .digital-code-badge__text {
    display: block;
    width: 100%;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-pills {
    flex-wrap: wrap;
  }

  .nav-pills .nav-link {
    margin-right: 0;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem;
  }

  /* Заказы: ID / доход / позиции скрыты; сумма и маркетплейс (лого) видны.
     Классы, не nth-child: иначе колонка «Выбрать» сдвигает индексы. */
  [data-sortable="orders"] .orders-col-id,
  [data-sortable="orders"] .orders-col-profit,
  [data-sortable="orders"] .orders-col-items {
    display: none;
  }

  [data-sortable="orders"] .orders-col-gmv {
    display: table-cell;
    white-space: nowrap;
    text-align: right;
  }

  [data-sortable="orders"] .orders-col-gmv__full {
    display: none;
  }

  [data-sortable="orders"] .orders-col-gmv__short {
    display: inline;
  }

  [data-sortable="orders"] .mp-cell__label {
    display: none;
  }

  [data-sortable="orders"] thead th.orders-col-mp {
    width: 2.25rem;
    min-width: 2.25rem;
    max-width: 2.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    font-size: 0;
    line-height: 0;
    color: transparent;
    overflow: hidden;
  }

  [data-sortable="orders"] tbody td.orders-col-mp {
    width: 2.25rem;
    min-width: 2.25rem;
    max-width: 2.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    text-align: center;
    vertical-align: middle;
  }

  [data-sortable="orders"] .orders-col-mp .mp-cell {
    justify-content: center;
  }

  [data-sortable="orders"] .orders-col-date {
    white-space: nowrap;
    width: 1%;
  }

  /* Колонка действий: --wide (min 10.5rem) + «Выбрать»/«Импорт» раздували ячейку —
     в строках иконки уезжали вправо, между датой и кнопками пустота. */
  [data-sortable="orders"] .orders-col-actions,
  [data-sortable="orders"] thead th.orders-col-actions.table-head-action-head--wide {
    width: 1%;
    min-width: 0 !important;
    white-space: nowrap;
    padding-left: 0.2rem !important;
    padding-right: 0.3rem !important;
    vertical-align: middle;
  }

  [data-sortable="orders"] thead th.orders-col-actions .orders-table-head-actions {
    gap: 0.2rem;
  }

  [data-sortable="orders"] thead #orders-bulk-enter-btn {
    font-size: 0;
    line-height: 0;
    width: 2rem;
    padding: 0.35rem 0;
  }

  [data-sortable="orders"] thead #orders-bulk-enter-btn::before {
    content: '\f0ae';
    font-family: var(--fa-style-family, 'Font Awesome 6 Free');
    font-weight: 900;
    font-size: 0.8125rem;
    line-height: 1;
    speak: never;
  }

  [data-sortable="orders"] thead #orders-import-btn {
    font-size: 0;
    line-height: 0;
    width: 2rem;
    padding: 0.35rem 0;
  }

  [data-sortable="orders"] thead #orders-import-btn > i {
    font-size: 0.8125rem;
    line-height: 1;
    margin: 0;
    width: auto;
  }

  [data-sortable="orders"] .order-marketplace-id {
    font-size: 0.6875rem;
  }

  [data-sortable="orders"] .order-list-action-btn .order-list-action-btn__label,
  .dashboard-recent-orders .order-list-action-btn .order-list-action-btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  [data-sortable="orders"] .order-list-action-btn,
  .dashboard-recent-orders .order-list-action-btn {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  [data-sortable="orders"] th,
  [data-sortable="orders"] td {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.8125rem;
  }
}

/* ——— PWA install banner (mobile) ——— */

.pwa-install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(3.25rem + var(--safe-bottom));
  z-index: 1055;
  padding: 0 max(0.65rem, var(--safe-right)) max(0.5rem, var(--safe-bottom)) max(0.65rem, var(--safe-left));
  pointer-events: none;
}

.login-body .pwa-install-banner {
  bottom: var(--safe-bottom);
}

.pwa-install-banner__inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding: 0.75rem 2.25rem 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

[data-theme="dark"] .pwa-install-banner__inner {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.pwa-install-banner__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #58a6ff, #a371f7);
  grid-row: span 2;
}

.pwa-install-banner__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.pwa-install-banner__text strong {
  font-size: 0.875rem;
  line-height: 1.25;
}

.pwa-install-banner__text span {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
}

.pwa-install-banner__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.pwa-install-banner__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pwa-install-banner__close:hover {
  background: var(--table-hover-bg);
  color: var(--text);
}

@media (min-width: 992px) {
  .pwa-install-banner {
    display: none;
  }
}

/* ——— AI settings (mockup) ——— */

.ai-settings-card__header {
  padding-bottom: 0.75rem;
}

.ai-settings-card__intro {
  padding-top: 1rem;
  padding-bottom: 0.85rem;
}

.ai-assistant-toggle-row {
  width: 100%;
}

.ai-settings-card__connection-tab .nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
}

.ai-assistant-toggle-row__status {
  flex-shrink: 0;
}

.ai-settings-card__badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ai-settings-card__notice {
  padding: 0.65rem 1rem;
}

.ai-settings-card__panel {
  border-top: 1px solid var(--line);
}

.ai-settings-section-tab--soon {
  opacity: 0.92;
}

.ai-settings-section-tab__soon {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-left: 0.25rem;
}

.notify-channel-tabs .nav-link.active .ai-settings-section-tab__soon,
.notify-channel-tabs .nav-link.active:hover .ai-settings-section-tab__soon,
.notify-channel-tabs .nav-link:active .ai-settings-section-tab__soon {
  color: rgba(255, 255, 255, 0.82);
}

.ai-settings-fields--disabled {
  opacity: 0.55;
}

.ai-chat-settings-hints {
  margin-bottom: 0.75rem;
}

.ai-chat-settings-hints__title {
  font-weight: 600;
  color: var(--text);
}

.ai-chat-tone-preset {
  flex: 0 0 auto;
  max-width: 8.5rem;
}

.ai-settings-chat-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.85rem;
}

.ai-settings-chat-preview__bubble {
  max-width: 85%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.ai-settings-chat-preview__bubble--customer {
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.ai-settings-chat-preview__bubble--partner {
  background: rgba(46, 160, 67, 0.1);
  border: 1px solid rgba(46, 160, 67, 0.22);
}

.ai-settings-chat-preview__messages {
  max-height: 14rem;
  overflow-y: auto;
  margin-bottom: 0.65rem;
}

.ai-playground-msg {
  display: flex;
  margin-bottom: 0.75rem;
}

.ai-playground-msg--partner {
  justify-content: flex-end;
}

.ai-playground-msg .ai-settings-chat-preview__bubble {
  position: relative;
  margin-bottom: 0;
  max-width: 88%;
}

.ai-playground-msg--editing-wrap .ai-settings-chat-preview__bubble {
  max-width: 100%;
}

.ai-playground-msg__toolbar {
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1;
}

.ai-playground-msg:hover .ai-playground-msg__toolbar,
.ai-playground-msg:focus-within .ai-playground-msg__toolbar {
  opacity: 1;
}

.ai-playground-msg__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
}

.ai-playground-msg__action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
}

.ai-playground-msg__action--danger:hover {
  color: var(--bs-danger);
}

.ai-playground-msg__text {
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 0.25rem;
}

.ai-playground-msg--editing .ai-playground-msg__sender-select {
  max-width: 9rem;
  margin-bottom: 0.35rem;
}

.ai-playground-msg__edit {
  margin-bottom: 0.35rem;
  resize: vertical;
}

.ai-playground-msg__edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.ai-playground-customer-preset .form-label-sm {
  font-size: 0.75rem;
  color: var(--muted);
}

.ai-playground-add-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.ai-playground-add-message__role {
  width: auto;
  min-width: 7.25rem;
  max-width: 8.5rem;
  flex: 0 0 auto;
}

.ai-playground-add-message__input {
  flex: 1 1 10rem;
  min-width: 0;
}

.ai-playground-add-message__btn {
  flex: 0 0 auto;
}

.ai-playground-order .settings-spoiler__body {
  padding-top: 0.25rem;
}

.ai-settings-chat-preview__sender {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.ai-settings-chat-preview__compose textarea {
  resize: none;
  margin-bottom: 0.5rem;
}

.ai-settings-chat-preview__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ai-settings-chat-preview__reply {
  margin-left: auto;
}

.ai-settings-chat-mode .form-check-label {
  line-height: 1.45;
}

.ai-settings-chat-mode__auto {
  opacity: 0.72;
}

/* Пошаговое удаление товара / группы */
.catalog-delete-modal__body {
  min-height: 8rem;
}

.catalog-delete-modal__progress {
  font-weight: 500;
}

.catalog-delete-step__list {
  padding-left: 1.15rem;
}

.catalog-delete-step__list li + li {
  margin-top: 0.35rem;
}

.catalog-delete-step--confirm .catalog-delete-step__list {
  color: var(--text);
}

.catalog-delete-modal__footer {
  gap: 0.5rem;
}

.warehouse-group-name-inner {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.warehouse-group-name-inner__link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.warehouse-group-name-inner .code-group-notes-hint {
  cursor: pointer;
}

/* ——— Product edit (гибрид: аккордеон + сайдбар) ——— */

.product-edit-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.product-edit-topbar__title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--text) 75%, var(--muted));
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-edit-topbar__title-text {
  min-width: 0;
}

.product-edit-topbar__title .product-list__market-link {
  flex: 0 0 auto;
  margin-left: 0;
  vertical-align: middle;
}

.product-edit-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.product-edit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.2;
}

.product-edit-chip strong {
  color: var(--text);
  font-weight: 600;
}

.product-edit-chip i {
  font-size: 0.7rem;
  opacity: 0.85;
}

.product-edit-chip--ok strong {
  color: var(--green);
}

.product-edit-chip--muted {
  opacity: 0.55;
}

.product-edit-chip--copy {
  cursor: pointer;
  border-style: dashed;
  background: transparent;
  transition: border-color 0.12s, background 0.12s;
}

.product-edit-chip--copy:hover {
  border-color: var(--blue);
  background: var(--nav-active-bg);
  color: var(--text);
}

.product-edit-chip--copy.is-copied {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
}

.product-edit-chip--copy.is-copied strong {
  color: var(--green);
}

.product-edit-jumpnav-wrap {
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 0.5rem 0;
  background: linear-gradient(var(--bg) 65%, transparent);
}

.product-edit-jumpnav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.product-edit-jumpnav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.product-edit-jumpnav__btn i {
  font-size: 0.7rem;
  opacity: 0.85;
}

.product-edit-jumpnav__btn:hover {
  color: var(--text);
  background: var(--panel-hover);
  border-color: var(--line);
}

.product-edit-jumpnav__btn.is-active {
  color: var(--blue);
  background: var(--nav-active-bg);
  border-color: rgba(88, 166, 255, 0.35);
}

.product-edit-jumpnav__count {
  min-width: 1.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.product-edit-jumpnav__count--warn {
  background: rgba(210, 153, 34, 0.15);
  border-color: rgba(210, 153, 34, 0.45);
  color: #d29922;
}

.product-edit-accordion {
  width: 100%;
}

.product-edit-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 0.75rem;
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}

.product-edit-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  user-select: none;
}

.product-edit-section > summary::-webkit-details-marker {
  display: none;
}

.product-edit-section[open] > summary {
  border-bottom-color: var(--line);
  background: var(--bg-elevated);
}

.product-edit-section__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--blue);
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.product-edit-section[open] .product-edit-section__icon {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.product-edit-section__main {
  flex: 1;
  min-width: 0;
}

.product-edit-section__hint {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.15rem;
}

.product-edit-section__aside {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 0.25rem;
}

.product-edit-section__hint-btn {
  flex-shrink: 0;
  margin-right: 0.15rem;
  line-height: 1;
}

.product-edit-section__hint-btn .field-hint {
  vertical-align: middle;
}

.product-edit-section__chevron {
  color: var(--muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.product-edit-section[open] .product-edit-section__chevron {
  transform: rotate(180deg);
}

.product-edit-section__body {
  padding: 1.15rem 1.15rem 1.25rem;
}

.product-edit-section__body .supplier-procurement-card {
  margin-bottom: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.product-edit-section__body > .supplier-procurement-card > .card-body {
  padding: 0;
}

.supplier-procurement-catalog__card {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(74, 134, 197, 0.4);
  border-radius: 10px;
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px rgba(74, 134, 197, 0.1);
}

.supplier-procurement-catalog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(74, 134, 197, 0.18);
}

.supplier-procurement-catalog__footer--buy-only {
  justify-content: flex-start;
}

.supplier-procurement-catalog__footer .supplier-procurement-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.35rem;
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
}

.supplier-procurement-catalog__footer .supplier-procurement-apply-cost {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  white-space: nowrap;
  font-size: 0.8125rem;
  line-height: 1.15;
}

.supplier-procurement-catalog__footer .supplier-procurement-apply-cost:disabled {
  opacity: 0.72;
}

.supplier-procurement-catalog__name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.supplier-procurement-catalog__price {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.5rem;
  align-items: start;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(74, 134, 197, 0.18);
}

.supplier-procurement-catalog__price-body {
  min-width: 0;
}

.supplier-procurement-catalog__price-values {
  min-width: 0;
}

.supplier-procurement-catalog__price-dual {
  align-items: flex-start;
}

.supplier-procurement-catalog__price-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.supplier-procurement-catalog__price-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.supplier-procurement-catalog__price-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.supplier-procurement-catalog__stock {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.5rem;
  align-items: baseline;
  margin-top: 0.35rem;
}

.supplier-procurement-catalog__stock-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.supplier-procurement-catalog__stock-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.supplier-procurement-catalog__stock-value--zero {
  color: var(--danger, #dc3545);
}

.supplier-procurement-catalog__name--ref {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-weight: 600;
}

.supplier-procurement-catalog__metric-value--loading {
  display: inline-flex;
  align-items: center;
  min-height: 1.1rem;
  font-weight: 600;
}

.supplier-procurement-catalog__metric-spinner {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(74, 134, 197, 0.22);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: supplier-procurement-metric-spin 0.75s linear infinite;
}

.supplier-procurement-catalog__metric-value--empty {
  color: var(--muted);
  font-weight: 600;
}

@keyframes supplier-procurement-metric-spin {
  to {
    transform: rotate(360deg);
  }
}

.supplier-procurement-message--error {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.supplier-procurement-cost-highlight {
  animation: supplier-procurement-cost-flash 2.2s ease;
}

@keyframes supplier-procurement-cost-flash {
  0%,
  100% {
    box-shadow: none;
  }

  20%,
  60% {
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.35);
  }
}

.product-edit-section__quick-group {
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.15rem;
}

.product-edit-section__quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0;
  padding: 0.2rem 0.55rem;
  min-height: 1.55rem;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--blue);
  text-decoration: none;
  vertical-align: middle;
}

.product-edit-section__quick:hover {
  background: var(--nav-active-bg);
  color: var(--blue);
}

.product-edit-section:not(.product-edit-section--has-groups) .product-edit-section__quick--groups {
  display: none !important;
}

.product-edit-section--has-groups .product-edit-section__quick--stock {
  display: none !important;
}

.product-edit-side-sticky {
  position: sticky;
  top: 1rem;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-edit-publish-card {
  border: 2px solid var(--blue);
}

.product-edit-publish-card > .card-header {
  background: rgba(88, 166, 255, 0.08);
}

.product-edit-publish-mp-status .product-list__status {
  max-width: none;
  white-space: nowrap;
}

.product-edit-side-sticky > .product-edit-section {
  margin-bottom: 0;
}

.product-edit-note-section .product-edit-section__body {
  padding-top: 0.85rem;
  padding-bottom: 1rem;
}

.product-edit-save-fab {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1045;
  padding: 0.7rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
}

.product-edit-save-fab.is-dirty,
#product-edit-save-main.is-dirty {
  box-shadow: 0 0 0 2px rgba(26, 127, 55, 0.35);
}

.product-edit-save-fab.is-dirty {
  background: #1a7f37;
}

@media (max-width: 991.98px) {
  .product-edit-side-sticky {
    position: static;
  }

  #product-edit-form {
    padding-bottom: 3.75rem;
  }

  .product-edit-save-fab {
    display: flex;
    left: 0;
    right: 0;
    bottom: var(--mobile-bottom-nav-offset);
    width: auto;
    margin: 0;
    padding: 0.8rem max(1rem, var(--safe-right)) 0.8rem max(1rem, var(--safe-left));
    border-radius: 0;
    border-top: 1px solid var(--line);
    font-size: 0.9375rem;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
  }

  [data-theme="dark"] .product-edit-save-fab {
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.42);
  }

  .product-edit-save-main-wrap {
    display: none;
  }
}


