/* ===== Общий современный UI: index + account ===== */
:root {
  --app-accent: #ff6a00;
  --app-accent-soft: #fff4eb;
  --app-primary: #2563eb;
  --app-primary-soft: #eff6ff;
  --app-success: #16a34a;
  --app-success-soft: #f0fdf4;
  --app-danger: #dc2626;
  --app-danger-soft: #fef2f2;
  --app-warning: #d97706;
  --app-warning-soft: #fffbeb;
  --app-info: #0891b2;
  --app-info-soft: #ecfeff;
  --app-text: #1f2937;
  --app-muted: #6b7280;
  --app-border: #e5e7eb;
  --app-bg: #f3f4f6;
  --app-card: #ffffff;
  --app-radius: 14px;
  --app-radius-sm: 10px;
  --app-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --app-nav-h: 48px;
  --app-order-bar-h: 40px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
}

body.app-body {
  background: var(--app-bg) !important;
  color: var(--app-text);
  padding-bottom: calc(var(--app-nav-h) + var(--safe-bottom) + 16px) !important;
  -webkit-tap-highlight-color: transparent;
}

body.app-body.has-order-bar {
  padding-bottom: calc(var(--app-nav-h) + var(--safe-bottom) + var(--app-order-bar-h) + 12px) !important;
}

/* Top navbar */
.app-topnav {
  background: var(--app-card) !important;
  box-shadow: 0 1px 0 var(--app-border) !important;
  min-height: 40px;
  padding-top: var(--safe-top);
}

.app-topnav .navbar-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--app-accent) !important;
  letter-spacing: -0.01em;
}

.app-topnav .nav-link {
  color: var(--app-text) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.45rem 0.75rem !important;
}

.app-topnav .nav-link:hover,
.app-topnav .nav-link.active {
  background: var(--app-accent-soft);
  color: var(--app-accent) !important;
}

/* Cards */
.app-body .card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
  background: var(--app-card);
}

.app-body .card-header {
  background: var(--app-card);
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  padding: 0.9rem 1rem;
}

.app-body .form-control,
.app-body .form-select {
  border-radius: var(--app-radius-sm);
  border-color: var(--app-border);
  min-height: 36px;
}

.app-body .form-control:focus,
.app-body .form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.app-body .btn {
  border-radius: var(--app-radius-sm);
  font-weight: 600;
  min-height: 36px;
}

.app-body .btn-sm {
  min-height: 32px;
}

.app-body .btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.app-body .btn-success {
  background: var(--app-success);
  border-color: var(--app-success);
}

/* ===== Bottom mobile nav ===== */
.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--app-border);
  padding: 2px 2px calc(2px + var(--safe-bottom));
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.05);
}

@media (max-width: 767.98px) {
  .app-bottom-nav {
    display: block;
  }

  .app-topnav .navbar-toggler {
    display: none !important;
  }

  .app-topnav .navbar-collapse {
    display: none !important;
  }
}

.app-bottom-nav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 2px;
  max-width: 560px;
  margin: 0 auto;
}

.app-bottom-nav__item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 2px 2px;
  border-radius: 0;
  color: var(--app-muted);
  text-decoration: none !important;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.05;
  transition: color 0.15s ease;
  background: transparent;
  border: none;
}

.app-bottom-nav__item i {
  font-size: 1.15rem;
  line-height: 1;
  width: 44px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-bottom-nav__item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-bottom-nav__item:hover,
.app-bottom-nav__item:focus {
  color: var(--app-text);
  background: transparent;
}

.app-bottom-nav__item:hover i,
.app-bottom-nav__item:focus i {
  background: rgba(15, 23, 42, 0.05);
}

.app-bottom-nav__item.active {
  color: var(--app-text);
  background: transparent;
}

.app-bottom-nav__item.active i {
  color: #0369a1;
  background: #e0f2fe;
}

/* Нижнее меню баера — 4 пункта в ряд без «Ещё» */
.app-bottom-nav--buyer .app-bottom-nav__inner {
  max-width: 480px;
  gap: 0;
}
.app-bottom-nav--buyer .app-bottom-nav__item {
  font-size: 0.62rem;
  min-height: 48px;
  padding: 4px 2px 2px;
  gap: 2px;
}
.app-bottom-nav--buyer .app-bottom-nav__item i {
  font-size: 1.15rem;
}
.app-bottom-nav--buyer .app-bottom-nav__item.active i {
  color: #0369a1;
  background: #e0f2fe;
}

/* Dropup "Ещё" — прижато к правому краю, без Popper-кривизны */
.app-bottom-nav .dropup {
  flex: 1;
  position: static;
}

.app-bottom-nav .dropup > .app-bottom-nav__item {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  min-height: 48px;
  padding: 4px 2px 2px;
}

.app-bottom-nav .dropdown-menu,
.app-bottom-nav .dropdown-menu.show {
  position: absolute !important;
  inset: auto 8px calc(100% + 10px) auto !important;
  right: 8px !important;
  left: auto !important;
  bottom: calc(100% + 10px) !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  min-width: 190px;
  max-width: calc(100vw - 16px);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: var(--app-shadow);
  padding: 6px;
  z-index: 1060;
}

.app-bottom-nav .dropdown-item {
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-bottom-nav .dropdown-item.active,
.app-bottom-nav .dropdown-item:active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

/* ===== Action icon buttons (orders) ===== */
.action-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  margin: 0 1px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: none !important;
  font-size: 0.8rem !important;
  line-height: 1 !important;
  box-shadow: none !important;
  vertical-align: middle;
}
.action-btn i {
  font-size: 0.8rem !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.action-btn.action-open {
  background: var(--app-info-soft) !important;
  color: var(--app-info) !important;
}

.action-btn.action-edit {
  background: var(--app-primary-soft) !important;
  color: var(--app-primary) !important;
}

.action-btn.action-delete {
  background: var(--app-danger-soft) !important;
  color: var(--app-danger) !important;
}

.action-btn.action-archive {
  background: var(--app-warning-soft) !important;
  color: var(--app-warning) !important;
}

.action-btn.action-restore {
  background: var(--app-success-soft) !important;
  color: var(--app-success) !important;
}

.action-btn.action-comment {
  background: #f3f4f6 !important;
  color: var(--app-muted) !important;
}

.action-btn.action-comment.has-comment {
  background: #fef2f2 !important;
  color: var(--app-danger) !important;
}

.action-btn .pinduoduo-icon,
.action-btn .comment-icon-present,
.action-btn .comment-icon-absent {
  color: inherit !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.btn-comment-absent,
.btn-comment-present {
  background: transparent;
  border: none;
}

/* Order bar above bottom nav — компактная */
.fixed-bottom-btn {
  bottom: calc(var(--app-nav-h) + var(--safe-bottom) + 4px) !important;
  z-index: 1030 !important;
  max-width: 560px;
  width: calc(100% - 12px);
}

.app-body .fixed-bottom-btn .order-bar-select,
.app-body .fixed-bottom-btn button[name="send_order"],
.app-body #order-submit-btn {
  min-height: 0 !important;
}

.app-body .order-bar-select {
  display: none !important;
}

.app-body .order-bar-cargo {
  height: 34px !important;
  min-height: 34px !important;
  font-size: 0.7rem !important;
}

.app-body #order-submit-btn,
.app-body .fixed-bottom-btn button[name="send_order"] {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 0.82rem !important;
  flex-direction: row !important;
  gap: 8px !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
}

.app-body .order-bar-totals {
  font-size: 0.68rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  body.app-body,
  body.app-body.has-order-bar {
    padding-bottom: 24px !important;
  }

  .fixed-bottom-btn {
    bottom: 16px !important;
  }
}

/* ===== Unified modals ===== */
.app-body .modal-content {
  border: none;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.app-body .modal-header {
  border-bottom: 1px solid var(--app-border);
  padding: 1rem 1.1rem;
  background: var(--app-card);
}

.app-body .modal-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.app-body .modal-body {
  padding: 1.1rem;
}

.app-body .modal-footer {
  border-top: 1px solid var(--app-border);
  padding: 0.85rem 1.1rem;
  gap: 8px;
}

.app-body .modal-footer .btn {
  min-width: 100px;
}

@media (max-width: 576px) {
  .app-body .modal-dialog {
    margin: 0.75rem;
  }

  .app-body .modal-content {
    border-radius: 16px;
  }

  .app-body .modal-footer {
    flex-direction: column-reverse;
  }

  .app-body .modal-footer .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Hide legacy account mobile menu if leftover */
.mobile-menu.legacy-hidden,
.mobile-menu.d-md-none.legacy-replace {
  display: none !important;
}

/* Sidebar polish */
.app-body .sidebar {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 14px;
}

.app-body .sidebar .nav-link {
  color: var(--app-text);
  border-radius: 10px;
  margin-bottom: 4px;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
}

.app-body .sidebar .nav-link.active {
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

/* Mass actions — одна компактная строка */
.mass-actions-bar,
.mass-action-form > .mb-2.d-flex,
.mass-action-form .d-flex.flex-wrap.gap-2 {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  margin-bottom: 6px !important;
  align-items: stretch;
}

.mass-actions-bar .btn,
.mass-action-form > .mb-2.d-flex .btn,
.mass-action-form .d-flex.flex-wrap.gap-2 .btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 32px !important;
  height: 32px !important;
  padding: 3px 6px !important;
  font-size: 0.72rem !important;
  font-weight: 600;
  border-radius: 8px !important;
  white-space: nowrap;
  line-height: 1.1 !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabs */
.app-body .custom-tabs .nav-link.active {
  color: var(--app-accent) !important;
}

/* ===== App install + notifications ===== */
.app-topnav .container-fluid,
.navbar .container-fluid {
  position: relative;
}

.notif-bell-wrap {
  position: relative;
  margin-left: 8px;
  margin-right: 4px;
  flex-shrink: 0;
}

.app-topnav .container-fluid {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.notif-bell-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  position: relative;
}

.notif-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(320px, 92vw);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 2000;
  overflow: hidden;
}

.notif-dropdown__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
}

.notif-dropdown__list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: 10px 12px;
  text-decoration: none !important;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
}
.notif-item.is-unread {
  background: #fff7ed;
}
.notif-item__title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--app-accent);
}
.notif-item__body {
  font-size: 0.8rem;
  color: #374151;
  margin-top: 2px;
}
.notif-item__time {
  font-size: 0.68rem;
  color: #9ca3af;
  margin-top: 2px;
}

.app-install-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 12px 40px 12px 12px; /* справа место под крестик */
  box-shadow: 0 10px 28px rgba(255, 106, 0, 0.18);
  max-width: 560px;
  margin: 0 auto;
}

.app-install-banner__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.app-install-banner__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-install-banner__text strong {
  font-size: 0.9rem;
  color: #c2410c;
}
.app-install-banner__text span {
  font-size: 0.72rem;
  color: #6b7280;
  line-height: 1.25;
}

.app-install-banner__btn {
  border: none;
  background: #ff6a00;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 10px;
  padding: 8px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 2px;
}

.app-install-banner__close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: #9ca3af;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.app-ios-tip {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(130px + env(safe-area-inset-bottom, 0px));
  z-index: 1081;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9rem;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  text-align: left;
  line-height: 1.45;
}
.app-ios-tip--ok {
  background: linear-gradient(135deg, #ff6a00, #ea580c);
  font-weight: 600;
  text-align: center;
}
.app-ios-tip__ok {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: #ff6a00;
  color: #fff;
  font-weight: 700;
  min-height: 42px;
  cursor: pointer;
}

.app-promo-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1px solid #fed7aa;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(255, 106, 0, 0.08);
}
.app-promo-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.25);
}
.app-promo-card__body h5 {
  color: #c2410c;
  font-weight: 800;
  margin-bottom: 6px;
}
.app-promo-card__body p {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 10px;
}
.app-promo-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.app-promo-card__actions .btn-warning {
  background: #ff6a00;
  border-color: #ff6a00;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 576px) {
  .app-promo-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .app-install-banner {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== Язык: сегментный переключатель ===== */
.lang-switch {
  --ls-h: 32px;
  --ls-pad: 3px;
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  width: 92px;
  height: var(--ls-h);
  padding: var(--ls-pad);
  margin-left: 6px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border: 1px solid #dbe2ea;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.lang-switch__glider {
  position: absolute;
  top: var(--ls-pad);
  bottom: var(--ls-pad);
  left: var(--ls-pad);
  width: calc(50% - var(--ls-pad));
  border-radius: 999px;
  background: linear-gradient(145deg, #ff7a1a, #ff6a00);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.35);
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1);
  z-index: 0;
  pointer-events: none;
}
.lang-switch[data-lang="cn"] .lang-switch__glider {
  transform: translateX(100%);
}
.lang-switch__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  text-decoration: none !important;
  color: #64748b !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.lang-switch__btn:hover {
  color: #334155 !important;
}
.lang-switch__btn.is-active {
  color: #fff !important;
  background: transparent;
}
.lang-switch__code {
  position: relative;
  z-index: 1;
}
.app-topnav .navbar-brand {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 140px);
}
.app-topnav__lang {
  margin-left: auto;
  margin-right: 8px;
  display: flex;
  align-items: center;
}

/* ===== File input RU/CN ===== */
.lang-file-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.lang-file {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid #fdba74;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.lang-file__btn {
  border: 0;
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  cursor: pointer;
}
.lang-file__btn:hover { background: #e5e7eb; }
.lang-file__name {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fffaf5;
}
.lang-file__name.has-file { color: #1f2937; font-weight: 600; }

@media (max-width: 576px) {
  .lang-switch {
    width: 84px;
    --ls-h: 30px;
  }
  .lang-switch__btn { font-size: 0.68rem; }
}

/* ===== Масштаб интерфейса ===== */
.ui-scale {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.ui-scale__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ui-scale__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ui-scale__title i { color: #ff6a00; }
.ui-scale__value {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ff6a00;
  background: #fff4eb;
  border-radius: 999px;
  padding: 2px 8px;
}
.ui-scale__hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.35;
}
.ui-scale__seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: #eef2f7;
  border-radius: 10px;
  padding: 4px;
}
.ui-scale__btn {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.ui-scale__btn:hover { color: #111827; background: rgba(255,255,255,.55); }
.ui-scale__btn.is-on {
  background: #fff;
  color: #c2410c;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

@media (max-width: 420px) {
  .ui-scale__btn { font-size: 0.66rem; padding: 8px 2px; }
}

/* ===== Профиль баера ===== */
.bp-profile { display: flex; flex-direction: column; gap: 8px; }
.bp-card {
  background: #fff; border-radius: 16px; padding: 12px 10px;
}
.bp-card__title { font-weight: 800; font-size: 0.95rem; margin-bottom: 8px; color: #111827; }
.bp-hint { font-size: 0.75rem; color: #6b7280; margin: 0 0 8px; line-height: 1.35; }
.bp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bp-rate { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.bp-rate__edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.bp-rate__market {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 0.85rem;
}
.bp-rate__preview {
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}
@media (max-width: 576px) {
  .bp-rate__edit { grid-template-columns: 1fr; }
}
.bp-wh { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.bp-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bp-photos__item { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #f3f4f6; }
.bp-photos__item img { width: 100%; height: 100%; object-fit: cover; }
.bp-photos__item .btn { position: absolute; top: 2px; right: 2px; padding: 0 6px; line-height: 1.2; }
.bp-stats {
  margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #f3f4f6;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 0.82rem;
}
.bp-cargo-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bp-cargo { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 0.72rem; }
.bp-cargo th { color: #6b7280; font-weight: 600; padding: 0 2px 4px; white-space: nowrap; }
.bp-cargo td { padding: 0 2px; vertical-align: middle; }
.bp-cargo .form-control { min-width: 0; padding: 4px 6px; font-size: 0.72rem; }

.buyer-public {
  display: grid; gap: 8px; margin-top: 8px;
}
.buyer-public__row { display: flex; gap: 10px; font-size: 0.82rem; }
.buyer-public__row strong { min-width: 7.5rem; color: #6b7280; font-weight: 600; }
.buyer-public__photos { display: flex; flex-wrap: wrap; gap: 6px; }
.buyer-public__photos img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #f3f4f6;
}

/* ===== Масштаб интерфейса ===== */
.ui-scale {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.ui-scale__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ui-scale__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ui-scale__title i { color: var(--app-accent); }
.ui-scale__value {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--app-accent);
  background: var(--app-accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}
.ui-scale__hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--app-muted);
  line-height: 1.35;
}
.ui-scale__seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: #eef2f7;
  padding: 4px;
  border-radius: 10px;
}
.ui-scale__btn {
  border: 0;
  background: transparent;
  border-radius: 8px;
  min-height: 34px;
  font-size: 0.72rem;
  font-weight: 750;
  color: #64748b;
  cursor: pointer;
  padding: 4px 2px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ui-scale__btn:hover { color: #0f172a; background: rgba(255,255,255,.7); }
.ui-scale__btn.is-on {
  background: #fff;
  color: #c2410c;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}

@media (max-width: 420px) {
  .ui-scale__seg { gap: 2px; }
  .ui-scale__btn { font-size: 0.66rem; min-height: 32px; }
}

/* ===== Mobile app shell: как нативное приложение ===== */
:root {
  --app-gutter: 2px;
  --app-bg: #f2f4f7;
  --app-card: #ffffff;
  --app-radius: 16px;
  --app-shadow: none;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body.app-body,
body {
  overflow-x: hidden !important;
  max-width: 100vw;
  overscroll-behavior-x: none;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 767.98px) {
  body.app-body {
    background: var(--app-bg) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: calc(var(--app-nav-h) + var(--safe-bottom) + 6px) !important;
  }

  .app-topnav {
    box-shadow: none !important;
    border-bottom: 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-left: var(--app-gutter);
    padding-right: var(--app-gutter);
  }

  .app-topnav .container-fluid,
  .navbar .container-fluid {
    padding-left: var(--app-gutter) !important;
    padding-right: var(--app-gutter) !important;
    gap: 4px;
  }

  .container,
  .container-fluid,
  .app-screen,
  .content-area,
  .cab-wrap {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: var(--app-gutter) !important;
    padding-right: var(--app-gutter) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .container.mt-4,
  .container.my-4,
  .container.mt-3,
  .container-fluid.mt-2,
  .app-screen.mt-2 {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-x: 0;
  }

  .row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Без «сайтовых» рамок */
  .app-body .card,
  .card,
  .buyer-client-card,
  .cab-card,
  .bo-order,
  .bo-empty,
  .ui-scale {
    border: none !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    background: var(--app-card);
  }

  .card-header,
  .card-body,
  .card-footer {
    border: none !important;
    background: transparent !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .card-header {
    padding-top: 6px !important;
    padding-bottom: 2px !important;
    font-weight: 700;
  }

  .card-body {
    padding-top: 2px !important;
    padding-bottom: 6px !important;
  }

  .table-excel th,
  .table-excel td {
    padding: 2px 3px !important;
  }
  .bo-table.table-excel th,
  .bo-table.table-excel td {
    padding: 1px 2px !important;
  }
  .bo-table-wrap {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .mass-action-form { margin-bottom: 2px !important; }

  .card .card {
    background: #f7f8fa !important;
    border-radius: 12px !important;
  }

  .table-responsive,
  .bo-table-wrap,
  .table-excel {
    max-width: 100%;
  }

  .bo-table-wrap,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .table-excel {
    width: 100% !important;
  }

  .sidebar {
    display: none !important;
  }

  .app-bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    border-top: 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
    padding: 2px var(--app-gutter) calc(2px + var(--safe-bottom));
  }

  .alert {
    border: none !important;
    border-radius: 12px !important;
  }

  .form-control,
  .form-select {
    border-radius: 12px !important;
  }

  .btn {
    border-radius: 12px !important;
  }

  /* Списки/товары — без вылезания */
  .product-name,
  .name-column,
  .buyer-client-card__name,
  .bo-order__main {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Товары: чекбоксы скрыты — выделение long-press / двойной тап */
  .tab-content table.table thead th:first-child,
  .tab-content table.table tbody td:first-child {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }
  .tab-content table.table tbody tr[id^="product-"] {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color .15s ease, box-shadow .15s ease;
  }
  .tab-content table.table tbody tr[id^="product-"].is-selected {
    background: #dbeafe !important;
    box-shadow: inset 3px 0 0 #2563eb;
  }
  .tab-content table.table tbody tr[id^="product-"].is-selected > * {
    background: transparent !important;
  }
  .tab-content table.table tbody tr[id^="product-"].is-press-flash {
    background: #bfdbfe !important;
  }
}


