/* Salesdoc-like: teal accent, clean admin */
:root {
  /* ERP «приход» — sea-green accent (reference UI) */
  --teal: #138d75;
  --teal-dark: #0d6b59;
  --teal-light: #e6f5f1;
  --text: #1a1a1a;
  --muted: #5c6f6d;
  --border: #d4e5e2;
  --card: #fff;
  --danger: #c62828;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: #f0f4f3;
  min-height: 100vh;
}

a { color: #007167; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  color: #fff;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-brand img {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
}
.topbar-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 13px;
}
.topbar-lang__link {
  color: #546e7a;
  text-decoration: none;
  font-weight: 600;
}
.topbar-lang__link--active {
  color: var(--teal, #00897b);
}
.topbar-lang__sep {
  opacity: 0.4;
}
.login-lang {
  text-align: right;
  margin-bottom: 8px;
  font-size: 13px;
}
.login-lang a {
  color: var(--teal, #00897b);
  font-weight: 600;
  text-decoration: none;
}
.login-lang a.active {
  text-decoration: underline;
}
.login-lang span {
  margin: 0 6px;
  opacity: 0.4;
}
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  row-gap: 6px;
  font-size: 14px;
}
.topbar-actions a { color: #fff; opacity: .95; }

/* Переключатель темы ERP / полное меню */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 8px;
}
.theme-switcher__label {
  font-size: 12px;
  opacity: 0.85;
}
.theme-switcher__btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.theme-switcher__btn:hover {
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}
.theme-switcher__btn--active {
  background: #fff !important;
  color: var(--teal-dark) !important;
  border-color: #fff !important;
}
.theme-switcher__btn--compact {
  font-size: 12px;
  padding: 5px 10px;
}
.theme-switcher--erp .theme-switcher__btn--compact:not(.theme-switcher__btn--active) {
  opacity: 0.95;
}
.theme-switcher--erp {
  flex-shrink: 0;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Тема «biz» — светлый хедер и полное меню (как в референс CRM) */
body.theme-biz {
  background: #f0f2f7;
}
body.theme-biz .topbar--biz {
  background: #fff;
  color: #263238;
  border-bottom: 1px solid #e4e8ef;
  box-shadow: 0 1px 4px rgba(15, 34, 58, 0.06);
}
body.theme-biz .topbar--biz h1 {
  color: #1565c0;
  font-weight: 700;
}
body.theme-biz .topbar-brand--biz img {
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.2);
}
body.theme-biz .topbar-actions--biz {
  gap: 14px;
}
body.theme-biz .topbar-user {
  font-size: 14px;
  color: #455a64;
}
body.theme-biz .topbar-logout {
  color: #1565c0;
  font-weight: 600;
  text-decoration: none;
}
body.theme-biz .topbar-logout:hover {
  text-decoration: underline;
}
body.theme-biz .topbar-link {
  color: #1565c0;
  font-weight: 600;
  text-decoration: none;
}
body.theme-biz .topbar-link:hover {
  text-decoration: underline;
}
body.theme-biz .theme-switcher__label {
  color: #78909c;
  opacity: 1;
}
body.theme-biz .theme-switcher__btn {
  color: #37474f;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
}
body.theme-biz .theme-switcher__btn:hover {
  background: #eeeeee;
}
body.theme-biz .theme-switcher__btn--active {
  background: #1976d2 !important;
  color: #fff !important;
  border-color: #1976d2 !important;
}
body.theme-biz .shell--biz {
  min-height: calc(100vh - 52px);
}
body.theme-biz .sidebar--biz {
  width: 268px;
  background: #fff;
  border-right: 1px solid #e4e8ef;
  padding: 12px 0 24px;
  box-shadow: 2px 0 16px rgba(15, 34, 58, 0.04);
}
body.theme-biz .nav-biz {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
}
body.theme-biz .nav-biz__section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #78909c;
  padding: 14px 16px 4px;
  margin-top: 2px;
}
body.theme-biz .nav-biz__link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #37474f;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-left: 4px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
body.theme-biz .nav-biz__link:hover {
  background: #f5f9ff;
  color: #1565c0;
  text-decoration: none;
}
body.theme-biz .nav-biz__link--active {
  background: #e3f2fd;
  border-left-color: #1976d2;
  color: #0d47a1;
  font-weight: 600;
}
body.theme-biz .nav-biz__note {
  font-size: 11px;
  color: #90a4ae;
  font-weight: 400;
}
body.theme-biz .main--biz {
  flex: 1;
  min-width: 0;
  background: #f0f2f7;
  padding: 20px 26px 32px;
}
body.theme-biz .page-title {
  margin-top: 0;
}

.shell { display: flex; min-height: calc(100vh - 52px); }

.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 12px 0;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--text);
  font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--teal-light); }
.sidebar nav a.active {
  background: var(--teal-light);
  border-left-color: var(--teal);
  color: var(--teal-dark);
}

/* ERP: тёмный сайдбар (компактный «премиум» вид, как в референсе) */
.sidebar.sidebar--erp {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #2a2f37 0%, #252a31 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  padding: 20px 12px 28px;
  position: relative;
  z-index: 30;
}
.nav-erp--main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar.sidebar--erp .nav-erp__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  border-left: none;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar.sidebar--erp .nav-erp__link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.sidebar.sidebar--erp .nav-erp__link.active {
  background: linear-gradient(135deg, #0f6b5c 0%, #0d5a4f 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(15, 107, 92, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.sidebar.sidebar--erp .nav-erp__link.active .nav-erp__ico {
  opacity: 1;
}
.sidebar.sidebar--erp .nav-erp__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.88;
}
.sidebar.sidebar--erp .nav-ico {
  display: block;
}
.sidebar.sidebar--erp .nav-erp__sub {
  display: none;
  margin: 4px 0 12px 6px;
  padding: 6px 0 8px 38px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}
.sidebar.sidebar--erp .nav-erp__sub--open {
  display: block;
}
.sidebar.sidebar--erp .nav-erp__sublink {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  border-radius: 8px;
}
.sidebar.sidebar--erp .nav-erp__sublink:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Mega-menu flyout (Клиенты / Команда / Склад / Аудит) */
.nav-erp {
  position: relative;
}
.nav-erp__mega {
  position: relative;
}
.nav-erp__mega .nav-erp__flyout {
  display: none;
  position: absolute;
  left: calc(100% - 4px);
  top: 0;
  width: max(520px, 42vw);
  max-width: 640px;
  background: #3a3f48;
  border: 1px solid #252a32;
  border-radius: 0 10px 10px 0;
  box-shadow: 8px 8px 32px rgba(0, 0, 0, 0.35);
  padding: 14px 18px 18px;
  z-index: 40;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.nav-erp__mega:hover .nav-erp__flyout,
.nav-erp__mega:focus-within .nav-erp__flyout {
  display: block;
}
.nav-erp__flyout::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0;
  bottom: 0;
  width: 14px;
}
.nav-erp__flyout-cols {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.nav-erp__flyout-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-erp__flyout-col:last-child {
  border-right: none;
}
/* Flyout: global `a` rangidan mustaqil, matn aniq o‘qiladi */
.sidebar.sidebar--erp .nav-erp__flyout a.nav-erp__fly-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #f1f3f7;
  text-decoration: none;
  background: transparent;
}
.sidebar.sidebar--erp .nav-erp__flyout a.nav-erp__fly-item:hover {
  background: #4a515c;
  color: #ffffff;
  text-decoration: none;
}
.sidebar.sidebar--erp .nav-erp__flyout a.nav-erp__fly-item:focus {
  outline: none;
}
.sidebar.sidebar--erp .nav-erp__flyout a.nav-erp__fly-item:focus-visible {
  background: #0a5c56;
  color: #ffffff;
  box-shadow: 0 0 0 2px #2dd4bf;
  text-decoration: none;
}
.nav-erp__fly-item--soon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #c4cad6;
  cursor: default;
}
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  background: #c62828;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.2;
}
@media (max-width: 1100px) {
  .nav-erp__mega .nav-erp__flyout {
    width: 420px;
    max-width: calc(100vw - 100px);
  }
  .nav-erp__flyout-cols {
    flex-direction: column;
    gap: 8px;
  }
  .nav-erp__flyout-col {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
  }
  .nav-erp__flyout-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

.main { flex: 1; padding: 20px 24px 40px; max-width: 1280px; min-width: 0; }

.page-footer {
  margin-top: 28px;
  font-size: 13px;
  color: #666;
}
.page-footer code { background: #e8f0ee; padding: 2px 6px; border-radius: 4px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toolbar label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.toolbar input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.toolbar button {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-draft { background: #fff3e0; color: #e65100; }
.badge-submitted { background: #e8f5e9; color: #2e7d32; }

.form-stock .form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 900px) {
  .form-stock .form-row { grid-template-columns: 1fr; }
}
.form-stock label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.form-stock input[type="text"],
.form-stock input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-actions button[type="submit"] {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
button.link-btn {
  background: none !important;
  color: #007167 !important;
  text-decoration: underline;
  padding: 0 !important;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.receipt-head-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}
@media (max-width: 560px) {
  .receipt-head-grid {
    grid-template-columns: 1fr;
  }
}
.receipt-field {
  position: relative;
}
.receipt-field label {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-50%);
  background: var(--card);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  z-index: 1;
  margin: 0;
  pointer-events: none;
}
.receipt-field input,
.receipt-field select {
  padding: 14px 12px 10px;
}
.receipt-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.receipt-form input[type="text"],
.receipt-form input[type="number"],
.receipt-form input[type="datetime-local"],
.receipt-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.receipt-form .receipt-field input:focus,
.receipt-form .receipt-field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(19, 141, 117, 0.2);
}
.receipt-items-table input,
.receipt-items-table select {
  min-width: 110px;
}

.page-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--teal-dark); }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
.tabs button,
.tabs a {
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
}
.tabs button.active,
.tabs a.active {
  background: #fff;
  color: var(--teal-dark);
  font-weight: 600;
  border: 1px solid var(--border);
  border-bottom-color: #fff;
  margin-bottom: -1px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
table.data th {
  background: #f7faf9;
  font-weight: 600;
  color: var(--muted);
}
table.data tr:hover td { background: #fafcfb; }
.text-right { text-align: right; }

/* Login */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 20%, rgba(30, 167, 255, 0.32), transparent 42%),
    radial-gradient(circle at 88% 80%, rgba(139, 211, 255, 0.2), transparent 44%),
    linear-gradient(145deg, #0b1320 0%, #1a2f4e 48%, #355f8b 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  padding: 28px;
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  text-align: center;
  letter-spacing: 1px;
}
.login-card p {
  margin: 0 0 20px;
  font-size: 13px;
  opacity: .85;
  text-align: center;
}
.login-card p.login-brand {
  margin: 0 0 16px;
  text-align: center;
  opacity: 1;
}
.login-card p.login-brand img {
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.login-card label { display: block; font-size: 12px; margin-bottom: 6px; opacity: .9; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  margin-bottom: 14px;
}
.login-card input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.login-card button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #1ea7ff 0%, #29b6f6 100%);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}
.login-card .err {
  background: rgba(198, 40, 40, 0.25);
  border: 1px solid rgba(255, 171, 171, 0.65);
  color: #ffe3e3;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0 0 16px;
  font-size: 14px;
}
.flash--ok {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}
.flash--err {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
}

button.button-danger {
  background: #c62828;
  color: #fff;
  border: 1px solid #b71c1c;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
button.button-danger:hover {
  background: #b71c1c;
}

.kassa-actions-cell {
  vertical-align: top;
  min-width: 220px;
}
.kassa-actions-cell .kassa-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.kassa-actions-cell .kassa-inline-form:last-child {
  margin-bottom: 0;
}
.kassa-actions-cell .kassa-form-label {
  flex: 0 0 100%;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.kassa-debt-form {
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e0e0e0);
}

.kassa-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 12px 0 8px;
}
.kassa-summary-card {
  background: var(--teal-light, #e8f4f2);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 12px 14px;
}
.kassa-summary-card--credit {
  background: #fff8e1;
  border-color: #ffe082;
}
.kassa-summary-card--today {
  background: #e3f2fd;
  border-color: #90caf9;
}
.kassa-summary-card__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #455a64;
  margin-bottom: 6px;
}
.kassa-summary-card__val {
  font-size: 18px;
  display: block;
}
.kassa-summary-card__sub {
  display: block;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.35;
}
.kassa-summary-foot {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
}
.kassa-hint {
  display: inline-block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
}
.kassa-hint--credit {
  color: #e65100;
}
.kassa-hint--cash {
  color: #1565c0;
}
.kassa-select-channel {
  min-width: 130px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}

.audit-log-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.audit-log-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.audit-log-table .audit-pre {
  max-height: 140px;
  overflow: auto;
  margin: 0;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}
.audit-log__t { white-space: nowrap; }

.agent-row--editable {
  cursor: pointer;
}
.agent-row--editable:focus-within,
.agent-row--editable:hover td {
  background: #eef7f5 !important;
}

.shutter[hidden] {
  display: none !important;
}
.shutter {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.shutter__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.shutter__panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: shutter-in 0.2s ease-out;
}
@keyframes shutter-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.shutter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.shutter__head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.shutter__x {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}
.shutter__x:hover {
  background: #f0f0f0;
  color: var(--text);
}
.shutter__form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: auto;
}
.shutter__form label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.shutter__form label:first-of-type {
  margin-top: 0;
}
.shutter__form .muted {
  font-weight: 400;
  color: #888;
}
.shutter__hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.shutter__form input[type="text"],
.shutter__form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.shutter__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn--primary {
  background: var(--teal);
  color: #fff;
}
.btn--ghost {
  background: #f5f5f5;
  color: var(--text);
  border: 1px solid var(--border);
}

.agents-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.receipt-panel.panel {
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  padding: 18px;
  border-top: 1px solid var(--border);
}
.receipt-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.receipt-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--teal-dark);
  font-weight: 700;
  background: #f7faf9;
}
.receipt-back:hover {
  background: #eef7f5;
}
.receipt-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.receipt-page-head__spacer {
  flex: 1;
}
.receipt-layout {
  display: block;
}
.receipt-layout__main {
  min-width: 0;
}
.receipt-hero {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 20px 28px;
  align-items: start;
  margin-bottom: 6px;
}
@media (max-width: 960px) {
  .receipt-hero {
    grid-template-columns: 1fr;
  }
}
.receipt-hero__fields {
  min-width: 0;
}
.receipt-summary {
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.receipt-summary--hero {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 12px 14px;
}
.receipt-summary--hero .receipt-summary-table {
  font-size: 13px;
}
.receipt-summary--hero thead th {
  font-size: 12px;
  padding: 8px 10px;
  background: #f0f7f5;
  color: var(--muted);
}
.receipt-summary--hero tbody td,
.receipt-summary--hero tbody th,
.receipt-summary--hero tfoot th {
  padding: 8px 10px;
}
.receipt-summary h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-dark);
}
.receipt-summary-table {
  font-size: 13px;
}
.receipt-group-hint {
  margin: 10px 0 0;
  font-size: 13px;
}
.receipt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 18px 0 14px;
}
.receipt-toolbar__add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(19, 141, 117, 0.28);
}
.receipt-toolbar__add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}
.receipt-toolbar__search-wrap {
  position: relative;
  flex: 1 1 200px;
  max-width: 520px;
  min-width: 160px;
}
.receipt-toolbar__search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.45;
  pointer-events: none;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6f6d' stroke-width='2'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M16 16l5 5'/%3E%3C/svg%3E");
}
.receipt-toolbar__search {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.receipt-settings {
  position: relative;
  margin-left: auto;
}
.receipt-settings summary.receipt-settings__btn {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.receipt-settings summary.receipt-settings__btn::-webkit-details-marker {
  display: none;
}
.receipt-settings__gear {
  font-size: 16px;
  line-height: 1;
  color: var(--teal-dark);
}
.receipt-settings__caret {
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}
.receipt-settings summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-dark);
  list-style: none;
}
.receipt-settings summary::-webkit-details-marker {
  display: none;
}
.receipt-settings__body {
  position: absolute;
  right: 0;
  z-index: 20;
  margin-top: 8px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  min-width: 220px;
}
.receipt-settings__body label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.receipt-settings__link {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.receipt-settings__link a {
  font-weight: 600;
}
.receipt-settings__export {
  display: inline;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.receipt-footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.receipt-footer-bar .receipt-comment {
  flex: 1;
  min-width: 260px;
  margin: 0;
}
.receipt-footer-bar .receipt-actions {
  margin: 0;
  flex-shrink: 0;
}
.receipt-items-table tfoot tr {
  background: #3d4d4a;
  color: #fff;
}
.receipt-items-table tfoot th,
.receipt-items-table tfoot td {
  border-bottom: none;
  color: #fff;
  font-weight: 600;
}
.receipt-items-table tfoot th[data-col="prod"] {
  color: rgba(255, 255, 255, 0.95);
}
.receipt-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.receipt-presets-catalog {
  grid-column: 1 / -1;
}
.receipt-presets-catalog__hint {
  margin: 4px 0 10px;
  max-width: 920px;
}
.receipt-presets-catalog textarea {
  min-height: 220px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
}
.receipt-presets-form textarea {
  width: 100%;
  min-height: 160px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.receipt-presets-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.supplier-ret-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.supplier-ret-filters__grow {
  grid-column: span 2;
  min-width: 200px;
}
@media (max-width: 720px) {
  .supplier-ret-filters__grow {
    grid-column: span 1;
  }
}
.supplier-ret-filters label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.supplier-ret-filters input[type="search"],
.supplier-ret-filters input[type="date"],
.supplier-ret-filters select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.wide-input {
  width: 100%;
  max-width: 520px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.table-scroll {
  overflow-x: auto;
  margin-bottom: 8px;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.stepper input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.stepper__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  color: var(--teal-dark);
}
.stepper__btn:hover {
  background: #eef7f5;
}
.receipt-comment textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  margin-top: 4px;
}
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
body.receipt-hide-cat .receipt-items-table thead th[data-col="cat"],
body.receipt-hide-cat .receipt-items-table tbody td[data-col="cat"],
body.receipt-hide-cat .receipt-items-table tfoot th[data-col="cat"] {
  display: none;
}
body.receipt-hide-sale .receipt-items-table thead th[data-col="sale"],
body.receipt-hide-sale .receipt-items-table tbody td[data-col="sale"],
body.receipt-hide-sale .receipt-items-table tfoot th[data-col="sale"] {
  display: none;
}
.receipt-items-table td[data-col="prod"] .in-product {
  max-width: 100%;
}
.receipt-items-table td[data-col="prod"] .in-fav-product {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 8px 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fafcfb;
  cursor: pointer;
}
.receipt-items-table td[data-col="prod"] .in-fav-product:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(19, 141, 117, 0.2);
  background: #fff;
}
.receipt-items-table td[data-col="cat"] {
  min-width: 120px;
  vertical-align: middle;
}
.receipt-cat-display {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receipt-prod-cell {
  min-width: 220px;
  vertical-align: middle;
}
.receipt-prod-new-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-dark);
  text-decoration: none;
}
.receipt-prod-new-link:hover {
  text-decoration: underline;
}
.receipt-items-table tr.receipt-row--ok td[data-col="prod"] .in-product {
  border-color: #a8d5cc;
}
.receipt-items-table tr:not(.receipt-row--ok) td[data-col="prod"] .in-product:invalid,
.receipt-items-table tr:not(.receipt-row--ok) td[data-col="prod"] .in-product {
  border-color: #e0b4b4;
}
.receipt-view-head .receipt-head-grid {
  margin: 0;
}
.stock-balances-block {
  margin-top: 18px;
}

/* Дашборд — ERP (sa_order) */
.dash-tabs {
  margin-bottom: 0;
}
.dash-tabs--triple {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.dash-overview-month-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.dash-overview-month-form__label {
  font-size: 14px;
  font-weight: 600;
}
.dash-overview-month-input {
  margin-left: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dash-overview-month-hint {
  font-size: 13px;
}
.dash-overview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .dash-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .dash-overview-cards {
    grid-template-columns: 1fr;
  }
}
.dash-overview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dash-overview-card--teal {
  border-top: 3px solid #00897b;
}
.dash-overview-card--blue {
  border-top: 3px solid #1565c0;
}
.dash-overview-card--due {
  border-top: 3px solid #c62828;
}
.dash-overview-card__label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.dash-overview-card__value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}
.dash-overview-card__sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.dash-overview-bars__title {
  margin: 0 0 14px;
  font-size: 1rem;
}
.dash-overview-bars__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-status-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 4px;
}
.dash-status-row__label {
  font-weight: 600;
}
.dash-status-row__meta {
  color: var(--muted);
  white-space: nowrap;
}
.dash-status-row__track {
  height: 8px;
  background: #eceff1;
  border-radius: 4px;
  overflow: hidden;
}
.dash-status-row__fill {
  height: 100%;
  background: linear-gradient(90deg, #00897b, #4db6ac);
  border-radius: 4px;
  min-width: 2px;
}
.dash-overview-foot {
  margin-top: 16px;
  font-size: 13px;
}

/* Обзор KPI: сетка карточек */
.dash-obzor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) {
  .dash-obzor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .dash-obzor-grid {
    grid-template-columns: 1fr;
  }
}
.dash-obzor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(15, 34, 58, 0.07);
}
.dash-obzor-card--accent {
  border-top: 4px solid #00897b;
}
.dash-obzor-card--wide {
  grid-column: span 2;
}
@media (max-width: 1100px) {
  .dash-obzor-card--wide {
    grid-column: span 2;
  }
}
@media (max-width: 640px) {
  .dash-obzor-card--wide {
    grid-column: span 1;
  }
}
.dash-obzor-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}
.dash-obzor-card__hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.dash-obzor-compare__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.dash-obzor-compare__lbl {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
}
.dash-obzor-compare__track {
  height: 12px;
  background: #eceff1;
  border-radius: 6px;
  overflow: hidden;
}
.dash-obzor-compare__fill {
  height: 100%;
  border-radius: 6px;
  min-width: 2px;
  transition: width 0.25s ease;
}
.dash-obzor-compare__fill--today {
  background: linear-gradient(90deg, #5c6bc0, #7986cb);
}
.dash-obzor-compare__fill--prev {
  background: linear-gradient(90deg, #00897b, #4db6ac);
}
.dash-obzor-compare__sum {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.dash-obzor-compare__meta {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px 12px;
}
.dash-obzor-delta {
  margin: 14px 0 0;
  font-size: 14px;
}
.dash-obzor-delta--up {
  color: #2e7d32;
}
.dash-obzor-delta--down {
  color: #c62828;
}
.dash-obzor-bars-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-obzor-vrow__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.dash-obzor-vrow__track {
  height: 10px;
  background: #eceff1;
  border-radius: 5px;
  overflow: hidden;
}
.dash-obzor-vrow__fill {
  height: 100%;
  border-radius: 5px;
  min-width: 2px;
}
.dash-obzor-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 8px auto 14px;
  box-shadow: inset 0 0 0 16px #fff;
}
.dash-obzor-legend {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
}
.dash-obzor-legend li {
  list-style: none;
  position: relative;
  margin-bottom: 4px;
}
.dash-obzor-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.dash-obzor-dot--0 {
  background: #5c6bc0;
}
.dash-obzor-dot--1 {
  background: #7e57c2;
}
.dash-obzor-dot--2 {
  background: #ff9800;
}
.dash-obzor-health {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.55;
}
.dash-obzor-health li {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eceff1;
}
.dash-obzor-health li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.dash-obzor-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e3f2fd;
  color: #1565c0;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 8px;
}
.dash-obzor-actions {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 14px;
  line-height: 1.8;
}

.report-prev-date {
  font-size: 11px;
  opacity: 0.85;
}
.dash-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.dash-filters__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.dash-filters__field {
  min-width: 160px;
}
.dash-filters__field--grow {
  flex: 1 1 220px;
  min-width: 200px;
}
.dash-filters__field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dash-filters__field select,
.dash-filters__multi {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.dash-filters__multi {
  min-height: 72px;
}
.dash-filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.dash-filters__date label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.dash-filters__date-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.dash-erp-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .dash-erp-grid {
    grid-template-columns: 1fr;
  }
}
.dash-card-total {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dash-card-total__head {
  background: linear-gradient(90deg, #2c3e50, #34495e);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
}
.dash-card-total__body {
  background: linear-gradient(180deg, #e8f4fc 0%, #f8fcff 100%);
  padding: 18px 16px 20px;
}
.dash-card-total__sum {
  font-size: 28px;
  font-weight: 800;
  color: #1a5276;
  letter-spacing: -0.02em;
}
.dash-card-total__sub {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.dash-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.dash-chart-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-dark);
}
.dash-chart-wrap {
  position: relative;
  height: 280px;
  max-width: 100%;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.dash-kpi {
  border-radius: 10px;
  padding: 14px 14px 12px;
  color: #fff;
  min-height: 120px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.dash-kpi__pct {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.dash-kpi__title {
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0 6px;
  opacity: 0.95;
}
.dash-kpi__sub {
  font-size: 11px;
  opacity: 0.88;
  line-height: 1.35;
}
.dash-kpi--coral {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
}
.dash-kpi--gold {
  background: linear-gradient(145deg, #f39c12, #d68910);
}
.dash-kpi--rose {
  background: linear-gradient(145deg, #fd79a8, #e84393);
}
.dash-kpi--amber {
  background: linear-gradient(145deg, #f1c40f, #d4ac0d);
  color: #2c2c2c;
}
.dash-kpi--amber .dash-kpi__sub {
  color: #333;
}
.dash-table-card {
  padding: 0;
  overflow: hidden;
}
.dash-table-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.dash-table-card__tools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dash-cat-table {
  font-size: 13px;
}
.dash-table-search-hint {
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid #eee;
}
.dash-table-search {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
  margin-left: 6px;
}

/* Заявки — ERP-стиль */
.orders-erp {
  max-width: 100%;
}
.orders-erp__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.orders-erp__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
}
.orders-erp__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.orders-erp__mini-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}
.orders-erp__date {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.orders-erp__date-sep {
  color: var(--muted);
}
.orders-erp__load {
  margin-left: 4px;
}

.orders-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  position: relative;
}
.orders-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 14px;
}
.orders-filters__grid label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.orders-filters__grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.orders-filters__grid select:disabled {
  background: #f5f5f5;
  color: #999;
}
.orders-filters__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}
.orders-filters__reset {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.orders-filters__gear {
  font-size: 20px;
  line-height: 1;
  cursor: default;
  opacity: 0.6;
}

.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.orders-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.orders-toolbar__fake-dd {
  opacity: 0.92;
  cursor: default;
  font-size: 13px;
  padding: 8px 14px;
}
.orders-toolbar-dd {
  position: relative;
  display: inline-block;
}
.orders-toolbar-dd__summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.orders-toolbar-dd__summary::-webkit-details-marker {
  display: none;
}
.orders-toolbar-dd__panel {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 50;
  margin-top: 6px;
  min-width: 300px;
  max-width: 420px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.orders-toolbar-dd__hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
}
.orders-toolbar-dd__link {
  display: block;
  padding: 8px 4px;
  font-weight: 600;
  color: var(--primary, #1976d2);
  text-decoration: none;
}
.orders-toolbar-dd__link:hover {
  text-decoration: underline;
}
.orders-bulk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.orders-bulk-select {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.orders-bulk-form {
  display: none;
}
.orders-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.orders-toolbar__search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.orders-toolbar__search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  font-size: 14px;
}
.orders-toolbar__per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.orders-toolbar__per-page select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.orders-stats {
  margin-bottom: 14px;
}

.orders-table-wrap.panel {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0;
  /* visible: ichki status-dropdown absolute menyusi kesilmasin */
  overflow: visible;
}
.orders-table-sizebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.orders-table-sizebar__hint {
  color: var(--muted);
  flex: 1 1 200px;
}
.orders-table-sizebar__ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.orders-table-sizebar__ctrl input[type="range"] {
  width: 120px;
  vertical-align: middle;
}
.orders-table-scroll {
  height: 560px;
  min-height: 320px;
  max-height: 92vh;
  min-width: 100%;
  max-width: 100%;
  overflow: auto;
  resize: both;
}
body.orders-col-resizing {
  cursor: col-resize !important;
  user-select: none;
}
body.orders-col-resizing * {
  cursor: col-resize !important;
}
.orders-table-wrap {
  position: relative;
}
.orders-table-scroll::after {
  content: "↘";
  position: sticky;
  float: right;
  bottom: 4px;
  right: 8px;
  margin-top: -20px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.55;
}
.orders-erp-table {
  font-size: 13px;
  min-width: 100%;
  table-layout: fixed;
  width: 100%;
}
.orders-erp-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f5f4;
  box-shadow: 0 1px 0 var(--border);
  overflow: visible;
  text-overflow: ellipsis;
  padding-right: 14px;
}
.orders-erp-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
.orders-erp-table .orders-link-doc,
.orders-erp-table .orders-link-client {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.orders-erp-table th[data-col]:not(.orders-col-check):not(.orders-col-actions) {
  position: sticky;
}
.orders-col-resizer {
  position: absolute;
  right: -3px;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  user-select: none;
  z-index: 5;
  touch-action: none;
}
.orders-col-resizer:hover,
body.orders-col-resizing .orders-col-resizer {
  background: rgba(19, 141, 117, 0.35);
}
.orders-erp-table th.orders-col-check,
.orders-erp-table th.orders-col-actions {
  position: sticky;
}
.orders-col-check {
  width: 36px;
  text-align: center;
}
.orders-col-actions {
  width: 56px;
  text-align: center;
}
.orders-link-doc {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}
.orders-link-doc:hover {
  text-decoration: underline;
}

/* Детали заявки — модальное окно (iframe) */
.orders-detail-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: min(96vw, 1120px);
  width: 100%;
  max-height: 92vh;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}
.orders-detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.orders-detail-dialog__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f0f5f4;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.orders-detail-dialog__title {
  font-weight: 700;
  font-size: 15px;
}
.orders-detail-dialog__close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #546e7a;
  padding: 4px 8px;
  border-radius: 6px;
}
.orders-detail-dialog__close:hover {
  background: rgba(0, 0, 0, 0.06);
}
.orders-detail-dialog__frame {
  width: 100%;
  height: min(78vh, 820px);
  border: none;
  display: block;
  border-radius: 0 0 12px 12px;
  background: #fff;
}

.order-detail-embed-body {
  margin: 0;
  background: var(--bg, #fafafa);
}
.order-detail-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.order-detail-panel__title {
  margin: 0;
  font-size: 1.15rem;
}
.order-detail-panel__meta,
.order-detail-panel__foot {
  font-size: 13px;
  margin-bottom: 12px;
}
.order-detail-table .kassa-inline-form {
  flex-wrap: wrap;
}
.orders-link-client {
  color: #1565c0;
  text-decoration: none;
  font-weight: 500;
}
.orders-link-client:hover {
  text-decoration: underline;
}
.orders-balance--neg {
  color: #c62828;
  font-weight: 600;
}
.badge-order {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-order--draft {
  background: #fff3e0;
  color: #e65100;
}
.badge-order--sent {
  background: #e3f2fd;
  color: #1565c0;
}
.badge-order--shipped {
  background: #efebe9;
  color: #5d4037;
}
.badge-order--cancel {
  background: #ffebee;
  color: #c62828;
}
.badge-order--new {
  background: #e3f2fd;
  color: #1565c0;
}
.badge-order--delivered {
  background: #e0f2f1;
  color: #00695c;
}
.badge-order--returned {
  background: #ffebee;
  color: #b71c1c;
}
.badge-order--partial {
  background: #fff8e1;
  color: #e65100;
}
.orders-status-cell {
  vertical-align: top;
  min-width: 140px;
  position: relative;
  overflow: visible !important;
  max-width: none !important;
}
.orders-status-dd {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}
.orders-status-dd[open] {
  z-index: 10050;
}
.orders-erp-table tr.orders-status-row-open {
  position: relative;
  z-index: 10040;
}
.orders-erp-table tr.orders-status-row-open td {
  overflow: visible;
}
/* Ba'zi brauzerlarda <details> ichki blok yopilganda ham joy egallaydi */
.orders-status-dd:not([open]) > .orders-status-dd__menu {
  display: none;
}
.orders-status-dd[open] > .orders-status-dd__menu {
  display: block;
}
.orders-status-dd--floating > .orders-status-dd__menu {
  position: fixed;
  margin-top: 0;
}
.orders-status-dd__summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.orders-status-dd__summary::-webkit-details-marker,
.orders-status-dd__summary::marker {
  display: none;
  content: '';
}
.orders-status-dd__summary::after {
  content: "\25bc";
  font-size: 8px;
  opacity: 0.65;
  line-height: 1;
}
.orders-status-dd__menu {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 100;
  margin-top: 4px;
  min-width: 260px;
  max-width: min(320px, 92vw);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
}
.orders-status-dd__form {
  margin: 0;
  padding: 0;
  border: 0;
}
.orders-status-dd__opt {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.orders-status-dd__opt:hover {
  background: #f5f5f5;
}
.orders-status-dd__opt--doc {
  font-weight: 600;
  color: #1565c0;
}
.orders-status-dd__sep {
  height: 1px;
  margin: 6px 0;
  background: var(--border);
}
.orders-status-dd__soon {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: #999;
  cursor: default;
}
.orders-comment-fake {
  color: #1565c0;
  cursor: default;
  font-size: 13px;
}
.orders-inline-form {
  display: inline;
}

/* Новая заявка — wizard */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.btn--lg {
  padding: 12px 22px;
  font-size: 15px;
}
.orders-add-page {
  max-width: 1320px;
  margin: 0 auto;
}
.orders-add-hero {
  margin-bottom: 20px;
}
.orders-add-back {
  display: inline-block;
  font-size: 13px;
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 8px;
}
.orders-add-back:hover {
  text-decoration: underline;
}
.orders-add-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  color: #1b2e2a;
  letter-spacing: -0.02em;
}
.orders-add-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.orders-add-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f8fcfb 0%, #eef6f4 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(19, 141, 117, 0.08);
}
.orders-add-stepper__item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.orders-add-stepper__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: #e0e0e0;
  color: #555;
}
.orders-add-stepper__item--current .orders-add-stepper__num {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(19, 141, 117, 0.35);
}
.orders-add-stepper__item--done .orders-add-stepper__num {
  background: var(--teal-dark);
  color: #fff;
}
.orders-add-stepper__check {
  font-size: 15px;
  line-height: 1;
}
.orders-add-stepper__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.orders-add-stepper__label {
  font-weight: 700;
  font-size: 13px;
  color: #263238;
}
.orders-add-stepper__sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}
.orders-add-stepper__dash {
  width: 24px;
  height: 2px;
  background: var(--border);
  margin-top: 15px;
  flex-shrink: 0;
  border-radius: 1px;
}
@media (max-width: 720px) {
  .orders-add-stepper {
    flex-direction: column;
    align-items: stretch;
  }
  .orders-add-stepper__dash {
    width: 2px;
    height: 16px;
    margin: 0 auto;
  }
}
.orders-add-wizard.panel {
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--border);
  padding: 22px 24px 28px;
}
.orders-add-form--card {
  max-width: 420px;
}
.orders-add-step-heading {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1b2e2a;
}
.orders-add-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.orders-add-field {
  display: block;
  margin-bottom: 18px;
}
.orders-add-field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.orders-add-select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.orders-add-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-light);
}
.orders-add-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.orders-add-actions--footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.orders-add-btn-next {
  min-width: 120px;
}
.orders-add-warn {
  padding: 10px 12px;
  background: #fff8e1;
  border-radius: 8px;
  color: #e65100;
  font-size: 14px;
  margin-bottom: 12px;
}
.clients-map-canvas {
  height: min(72vh, 640px);
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #eceff1;
  z-index: 1;
}
.orders-add-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .orders-add-kpi {
    grid-template-columns: 1fr;
  }
}
.orders-add-kpi-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.orders-add-kpi-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  border-radius: 0 0 10px 10px;
}
.orders-add-kpi-card__icon {
  color: var(--teal-dark);
  margin-bottom: 10px;
  opacity: 0.9;
}
.orders-add-kpi-card__val {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.orders-add-kpi-card__unit {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.orders-add-kpi-card__label {
  font-size: 13px;
  font-weight: 600;
  color: #455a64;
  margin-top: 8px;
}

.orders-add-search-wrap {
  margin-bottom: 14px;
}
.orders-add-search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafcfc;
}
.orders-add-search-input:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
}
.orders-add-products {
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.orders-add-table {
  margin: 0;
}
.orders-add-table thead th {
  background: linear-gradient(180deg, #f4faf8, #e8f3f0);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #546e7a;
  padding: 12px 14px;
}
.orders-add-table tbody tr {
  transition: background 0.12s ease;
}
.orders-add-table--grid tbody tr:nth-child(even) {
  background: #fafbfc;
}
.orders-add-table tbody tr:hover {
  background: #f0faf8;
}
.orders-add-th-num,
.orders-add-td-num {
  width: 40px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.orders-add-product-name {
  font-weight: 500;
  min-width: 160px;
}
.orders-add-ro {
  background: #f0f3f5 !important;
  color: #455a64;
  font-variant-numeric: tabular-nums;
}
.orders-add-price {
  color: #37474f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.orders-add-col-block {
  width: 96px;
}
.orders-add-col-piece {
  width: 120px;
}
.block-qty-pieces-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.block-qty-pieces-total {
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: #263238;
  min-height: 1.25em;
  line-height: 1.2;
}
.block-qty-loose {
  max-width: 88px;
  font-size: 12px;
  opacity: 0.92;
}
.block-qty-loose::placeholder {
  color: #90a4ae;
  font-size: 11px;
}
.orders-add-inp-num {
  width: 100%;
  max-width: 100px;
  margin-left: auto;
  display: block;
  padding: 8px 8px;
  text-align: right;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.orders-add-inp-num:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 2px var(--teal-light);
}
.orders-add-line-sum,
.orders-add-vol {
  font-variant-numeric: tabular-nums;
  color: #263238;
  font-size: 14px;
  white-space: nowrap;
}
.orders-add-tfoot {
  background: linear-gradient(180deg, #e8f5f2, #dfece8);
  font-weight: 600;
}
.orders-add-tfoot td {
  padding: 14px 12px;
  border-top: 2px solid var(--teal);
}
.orders-add-tfoot-label {
  text-align: right;
  color: #1b2e2a;
}
.orders-add-muted {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.orders-pick-client {
  margin-top: 4px;
}
.orders-pick-client__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 8px;
}
.orders-pick-client__back {
  margin-right: 4px;
}
.orders-pick-client__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1b2e2a;
}
.orders-pick-client__lead {
  margin-top: 0;
  margin-bottom: 16px;
}
.orders-pick-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
  align-items: end;
}
.orders-pick-filters label span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.orders-pick-filters select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fff;
}
.orders-pick-filter--agent .orders-pick-agent-ro {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafcfc;
  font-size: 14px;
  color: #263238;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.orders-pick-agent-change {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.orders-pick-toolbar {
  margin-bottom: 12px;
}
.orders-pick-table-wrap {
  margin-bottom: 12px;
}
.orders-pick-th-sort {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.orders-pick-th-sort:hover {
  color: var(--teal);
  text-decoration: underline;
}
.orders-pick-name {
  font-weight: 500;
}
.orders-pick-name__ico {
  margin-right: 6px;
  opacity: 0.85;
}
.orders-pick-actions {
  white-space: nowrap;
  width: 1%;
}
.orders-pick-table tbody td {
  font-size: 14px;
  vertical-align: middle;
}

.orders-add-options {
  padding: 18px;
  background: #f5faf9;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.orders-add-options__title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #37474f;
}
.orders-add-check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.orders-add-check-card:hover {
  border-color: #b2dfdb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.orders-add-check-card--accent {
  border-color: #80cbc4;
  background: #e0f2f1;
}
.orders-add-check-card__input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--teal-dark);
}
.orders-add-check-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.orders-add-check-card__title {
  font-weight: 700;
  font-size: 14px;
  color: #263238;
}
.orders-add-check-card__sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.orders-add-credit {
  margin-top: 4px;
}

.orders-totals-block {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}
.orders-totals-block__header {
  padding: 12px 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.orders-totals-block__hint {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.9;
}
.orders-totals-block__body {
  padding: 12px 16px 16px;
}
.orders-totals-toolbar {
  margin-bottom: 10px;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}
.orders-totals-table {
  font-size: 13px;
}
.orders-totals-foot {
  background: #eceff1;
}
.orders-totals-foot--grand {
  background: #cfd8dc;
  font-weight: 700;
}

/* Клиенты — ERP-таблица */
.clients-erp {
  max-width: 100%;
}
.clients-erp--dense .clients-erp__title {
  font-size: 1.15rem;
  margin: 0;
}
.clients-erp__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.clients-erp__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.clients-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #1976d2;
  border: 1px solid #1565c0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.clients-head-btn:hover {
  filter: brightness(1.06);
  color: #fff;
}
.clients-head-btn--soft {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}
.clients-head-btn--soft:hover {
  background: #bbdefb;
  color: #0d47a1;
}
.clients-head-btn--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.clients-head-dd {
  position: relative;
}
.clients-head-dd > summary.clients-head-btn {
  list-style: none;
}
.clients-head-dd > summary.clients-head-btn::-webkit-details-marker {
  display: none;
}
.clients-head-dd__menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  z-index: 40;
}
.clients-head-dd__menu a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
}
.clients-head-dd__menu a:hover {
  background: #f5f5f5;
}
.clients-filter-banner {
  font-size: 13px;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 6px;
  border: 1px solid #ffe082;
}
.clients-erp__title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
}
.clients-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.clients-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.clients-toolbar__per {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.clients-toolbar__per select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.clients-toolbar__fake {
  font-size: 13px;
  padding: 8px 12px;
  cursor: default;
  opacity: 0.95;
}
.clients-toolbar--dense {
  margin-bottom: 8px;
  gap: 8px;
}
.btn--toolbar {
  padding: 5px 11px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  background: #eceff1 !important;
  color: #37474f !important;
  border: 1px solid #cfd8dc !important;
}
.btn--toolbar.btn--primary {
  background: var(--teal, #00897b) !important;
  color: #fff !important;
  border-color: var(--teal-dark, #00695c) !important;
}
.btn--toolbar.btn--excel {
  background: #558b2f !important;
  color: #fff !important;
  border-color: #33691e !important;
}
.btn--toolbar.btn--import {
  background: #5d4037 !important;
  color: #fff !important;
  border-color: #3e2723 !important;
}
.clients-toolbar--dense .clients-toolbar__fake {
  padding: 5px 10px;
  font-size: 12px;
}
.clients-toolbar__search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.clients-quick-search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 220px;
  font-size: 14px;
}
.btn--excel {
  background: #43a047;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border: none;
  display: inline-block;
}
.btn--excel:hover {
  filter: brightness(1.05);
}
.clients-table-wrap.panel {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}
.clients-table-scroll {
  max-height: min(calc(100vh - 220px), 900px);
  overflow: auto;
}
.clients-erp--dense .clients-table-scroll {
  max-height: min(calc(100vh - 200px), 960px);
}
.clients-erp-table {
  font-size: 12px;
  min-width: 1680px;
  border-collapse: collapse;
}
.clients-erp--dense .clients-erp-table {
  font-size: 11px;
  min-width: 1750px;
}
.clients-erp-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eceff1;
  font-size: 11px;
  color: #546e7a;
  box-shadow: 0 1px 0 var(--border);
  padding: 5px 6px;
  font-weight: 600;
}
.clients-erp--dense .clients-erp-table th {
  font-size: 10px;
  padding: 4px 5px;
}
.clients-erp-table td {
  padding: 4px 6px;
  vertical-align: top;
  line-height: 1.35;
  border-bottom: 1px solid #eceff1;
}
.clients-erp--dense .clients-erp-table td {
  padding: 3px 5px;
  font-size: 11px;
}
.clients-erp-table tbody tr:nth-child(even) {
  background: #f7f9fa;
}
.clients-erp-table tbody tr:hover {
  background: #e8f4f8;
}
.clients-th-sort {
  display: inline-block;
  margin-left: 2px;
  font-size: 9px;
  opacity: 0.55;
  font-weight: 400;
  vertical-align: middle;
}
.clients-col-id {
  min-width: 72px;
}
.clients-col-cb {
  width: 28px;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
.clients-row-cb {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.clients-equip-muted {
  color: #78909c;
  font-size: 11px;
}
.clients-col-loc {
  text-align: center;
  width: 48px;
}
.clients-link-id {
  color: #00838f;
  font-weight: 600;
  text-decoration: none;
}
.clients-link-id:hover {
  text-decoration: underline;
  color: #006064;
}
.clients-link-name {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}
.clients-link-name:hover {
  text-decoration: underline;
}
.clients-equip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: default;
}
.clients-cat {
  font-size: 12px;
  color: #455a64;
}
.clients-active {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 12px;
}
.clients-balance--neg {
  color: #c62828;
  font-weight: 600;
}
.clients-pin {
  font-size: 15px;
  line-height: 1;
  color: #006064;
  text-decoration: none;
  opacity: 0.95;
}
.clients-pin--muted {
  opacity: 0.28;
  filter: grayscale(0.4);
}
.clients-actions-cell {
  vertical-align: middle;
}
.clients-dd {
  position: relative;
}
.clients-dd__btn {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f39c12;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  border: none;
  display: inline-block;
}
.clients-dd__btn::-webkit-details-marker {
  display: none;
}
.clients-dd[open] .clients-dd__btn {
  background: #e67e22;
}
.clients-dd__menu {
  position: absolute;
  right: 0;
  z-index: 30;
  margin-top: 4px;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
}
.clients-dd__menu a,
.clients-dd__menu span {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
}
.clients-dd__menu a:hover {
  background: #f5f5f5;
}
.clients-dd__doc-form {
  margin: 0;
  padding: 0;
  border: 0;
}
.clients-dd__menu button.clients-dd__action {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.clients-dd__menu button.clients-dd__action:hover {
  background: #f5f5f5;
}
.clients-dd__soon {
  color: #999;
  cursor: default;
}
.clients-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  font-size: 14px;
}
.clients-pagination__info {
  color: var(--muted);
}
.clients-pagination__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.clients-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--teal-dark);
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
}
.clients-pagination__page:hover {
  background: #f5f5f5;
}
.clients-pagination__page--current {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.clients-pagination__disabled {
  opacity: 0.45;
  pointer-events: none;
}
.clients-footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.btn--import {
  background: #5cb85c;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: default;
}
.clients-footer-bar__btn--wide {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

/* Клиенты — SalesDoc */
.clients-erp--salesdoc {
  margin: -4px 0 0;
}
.clients-erp--salesdoc .clients-erp__head--compact {
  margin-bottom: 6px;
  align-items: center;
}
.clients-erp--salesdoc .clients-erp__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #37474f;
  margin: 0;
}
.clients-head-dd--more > summary.clients-toolbar-btn {
  list-style: none;
  cursor: pointer;
}
.clients-head-dd--more > summary::-webkit-details-marker {
  display: none;
}
.clients-toolbar--salesdoc {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 0;
  gap: 6px;
}
.clients-toolbar-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #455a64;
  background: #eceff1;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.3;
}
.clients-toolbar-btn:hover {
  background: #dfe6e9;
  color: #263238;
}
.clients-toolbar-btn--excel {
  background: #fff;
  border-color: #b0bec5;
}
.clients-toolbar-btn--apply {
  background: var(--teal, #00897b);
  color: #fff;
  border-color: #00695c;
}
.clients-toolbar-btn--apply:hover {
  filter: brightness(1.05);
  color: #fff;
}
.clients-per-label {
  position: relative;
  display: inline-block;
  margin: 0;
}
.clients-per-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.clients-toolbar--salesdoc .clients-quick-search {
  min-width: 260px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #cfd8dc;
  background: #fff;
}
.clients-filters-panel {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-top: none;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 0 0 4px 4px;
}
.clients-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  font-size: 12px;
}
.clients-filters-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #546e7a;
}
.clients-filters-form input,
.clients-filters-form select {
  padding: 5px 8px;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  font-size: 12px;
  min-width: 120px;
}
.clients-erp--salesdoc .clients-table-wrap {
  border-radius: 0 0 4px 4px;
  border: 1px solid #e0e0e0;
  border-top: none;
}
.clients-erp--salesdoc .clients-table-scroll {
  max-height: calc(100vh - 168px);
}
.clients-erp--salesdoc .clients-erp-table {
  font-size: 11px;
  min-width: 1820px;
}
.clients-erp--salesdoc .clients-erp-table th {
  background: #eceff1;
  color: #455a64;
  font-size: 10px;
  padding: 6px 5px;
  border-bottom: 1px solid #cfd8dc;
}
.clients-erp--salesdoc .clients-erp-table td {
  border-bottom: 1px solid #eeeeee;
  padding: 4px 5px;
}
.clients-erp--salesdoc .clients-erp-table tbody tr:nth-child(even) {
  background: #fafafa;
}
.clients-erp--salesdoc .clients-link-name {
  color: #00838f;
  font-weight: 600;
}
.clients-agent-days {
  color: #78909c;
  font-size: 10px;
  margin-left: 2px;
}
.clients-cat-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 3px;
  vertical-align: middle;
  color: #fff;
  background: #78909c;
}
.clients-cat-badge--rt {
  background: #5c6bc0;
}
.clients-cat-badge--sm {
  background: #43a047;
}
.clients-cat-label {
  font-size: 11px;
  color: #455a64;
}
.clients-erp--salesdoc .clients-dd__btn {
  padding: 4px 14px;
  font-size: 11px;
  border-radius: 4px;
  background: #ff9800;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.clients-erp--salesdoc .clients-dd__btn:hover {
  background: #fb8c00;
}
.clients-pin-icon {
  display: inline-block;
  width: 14px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300838f'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.clients-pin--muted .clients-pin-icon {
  filter: grayscale(1);
  opacity: 0.35;
}
.clients-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}
.clients-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}
.clients-modal__inner {
  padding: 16px 18px;
}
.clients-modal__title {
  margin: 0 0 8px;
  font-size: 16px;
}
.clients-modal__hint {
  margin: 0 0 12px;
  font-size: 12px;
}
.clients-modal__checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 14px;
}
.clients-modal__check {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.clients-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.clients-order-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-height: 360px;
  overflow: auto;
}
.clients-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid #eceff1;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}
.clients-order-btns button {
  margin-left: 4px;
  padding: 2px 8px;
  cursor: pointer;
  border: 1px solid #cfd8dc;
  background: #fff;
  border-radius: 3px;
}
.clients-erp--salesdoc .clients-pagination {
  margin-top: 8px;
  font-size: 12px;
}

/* KPI агентов */
.agents-kpi-page {
  max-width: 100%;
}
.agents-kpi-head {
  margin-bottom: 12px;
}
.agents-kpi-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-dark, #00695c);
}
.agents-kpi-lead {
  margin: 0;
  font-size: 13px;
  max-width: 720px;
}
.agents-kpi-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agents-kpi-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
}
.agents-kpi-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.agents-kpi-bulk {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.agents-kpi-bulk__lbl {
  color: var(--muted);
}
.agents-kpi-inp {
  width: 88px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.agents-kpi-inp--cell {
  width: 72px;
  text-align: right;
}
.agents-kpi-table-wrap {
  overflow: auto;
}
.agents-kpi-table .js-kpi-pct {
  font-weight: 600;
  color: var(--teal-dark);
}
.agents-kpi-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.agents-kpi-period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.agents-kpi-period-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.agents-kpi-table--list td {
  vertical-align: middle;
}
.agents-kpi-pct {
  font-weight: 700;
  font-size: 14px;
}
.agents-kpi-pct--ok { color: #2e7d32; }
.agents-kpi-pct--mid { color: #ef6c00; }
.agents-kpi-pct--low { color: #c62828; }
.agents-kpi-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  white-space: nowrap;
}
.agents-kpi-preview {
  margin-bottom: 16px;
  padding: 12px 16px;
}
.agents-kpi-preview__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.agents-kpi-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.agents-kpi-edit-general h3,
.agents-kpi-edit-products h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.agents-kpi-prod-select {
  width: 100%;
  max-width: 420px;
  padding: 6px 8px;
  font-size: 13px;
}
.agents-kpi-edit-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Оборудование у клиентов */
.ce-page__title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-dark, #00695c);
}
.ce-page__lead {
  margin: 0 0 16px;
  font-size: 13px;
  max-width: 720px;
}
.ce-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .ce-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
.ce-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ce-kpi:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.ce-kpi--active { border-color: var(--teal, #00897b); box-shadow: 0 0 0 1px var(--teal); }
.ce-kpi__lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ce-kpi__val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.ce-kpi--avail .ce-kpi__val { color: #ef6c00; }
.ce-kpi--use .ce-kpi__val { color: #00838f; }
.ce-kpi--repair .ce-kpi__val { color: #c62828; }
.ce-kpi--off .ce-kpi__val { color: #78909c; }
.ce-toolbar {
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.ce-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ce-toolbar__filters select {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 140px;
}
.ce-toolbar__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}
.ce-quick {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}
.ce-quick.is-on { background: #e0f2f1; color: var(--teal-dark); font-weight: 600; }
.ce-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.ce-search {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 160px;
}
.ce-table-wrap { overflow: auto; }
.ce-table { font-size: 12px; min-width: 1100px; }
.ce-table td { vertical-align: middle; }
.ce-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ce-status--in_use { background: #e0f7fa; color: #006064; }
.ce-status--available { background: #fff3e0; color: #e65100; }
.ce-status--repair { background: #ffebee; color: #b71c1c; }
.ce-status--written_off { background: #eceff1; color: #546e7a; }
.ce-pin { text-decoration: none; font-size: 14px; }
.ce-see-also {
  margin-top: 16px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ce-field {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}
.ce-field input,
.ce-field select,
.ce-field textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.ce-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

/* Агенты — панель */
.agents-page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.agents-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.agents-tabs__link {
  padding: 10px 16px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.agents-tabs__link:hover {
  color: var(--teal-dark);
}
.agents-tabs__link.is-active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}
.agents-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.agents-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.agents-bulk__action {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
}
.agents-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.agents-toolbar__filters select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.agents-toolbar__search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
}
.agents-table-wrap {
  overflow-x: auto;
}
.agents-table {
  font-size: 13px;
  min-width: 1100px;
}
.agents-table__sync {
  max-width: 220px;
  font-size: 12px;
  white-space: pre-line;
  vertical-align: top;
}
.agents-sync {
  display: block;
  line-height: 1.35;
}
.agents-table__act {
  white-space: nowrap;
}
.agents-table__chk {
  width: 36px;
}
.agents-empty {
  padding: 16px 20px;
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.shutter__panel--wide {
  max-width: min(960px, 96vw);
  width: 100%;
}
.agents-config__layout {
  display: flex;
  gap: 0;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.agents-config__nav {
  width: 200px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}
.agents-config__tab {
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.agents-config__tab:hover {
  background: var(--teal-light);
}
.agents-config__tab.is-active {
  background: var(--teal-light);
  font-weight: 600;
  color: var(--teal-dark);
}
.agents-config__body {
  flex: 1;
  padding: 14px 16px;
  min-width: 0;
  max-height: 420px;
  overflow-y: auto;
}
.agents-config__row2 {
  display: grid;
  grid-template-columns: 120px 1fr 100px 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
}
.agents-config__row2 input,
.agents-config__row2 select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.agents-config__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agents-config__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.agents-config__check input {
  margin-top: 3px;
}
.agents-config__check--locked {
  opacity: 0.85;
  cursor: default;
}
.agents-config__check--locked input {
  cursor: not-allowed;
}
.agents-config__form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.agents-config__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.flex-spacer {
  flex: 1;
}

/* Client create/edit (веб = те же поля, что API / Android) */
.client-edit-panel .client-edit-form {
  margin-top: 12px;
}
#client-config,
#client-phone,
#client-coords {
  scroll-margin-top: 72px;
}
.client-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .client-edit-grid {
    grid-template-columns: 1fr;
  }
}
.client-edit-grid label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}
.client-edit-grid input[type="text"],
.client-edit-grid input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}
.client-edit-span2 {
  grid-column: span 2;
}
@media (max-width: 720px) {
  .client-edit-span2 {
    grid-column: span 1;
  }
}
.client-edit-days {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.client-edit-days label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0;
  cursor: pointer;
}
.client-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.clients-pin--muted {
  opacity: 0.35;
  cursor: default;
}
.clients-col-loc .clients-pin {
  font-size: 18px;
  text-decoration: none;
}

/* Остатки / склад (как в ERP) */
.stock-ostatki {
  margin-bottom: 20px;
}
.stock-ostatki__title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  color: var(--teal-dark);
}

.stock-reorder__title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: var(--teal-dark);
}
.stock-reorder__lead {
  margin: 0 0 8px;
  max-width: 960px;
}
.stock-reorder__month {
  margin: 0 0 16px;
}
.stock-reorder__filters {
  margin-bottom: 16px;
}
.stock-reorder__filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}
.stock-reorder__filter-grid label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.stock-reorder__checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
  padding-bottom: 4px;
}
.stock-reorder__check {
  font-size: 13px;
  color: #37474f;
}
.stock-reorder__filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.stock-reorder__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.stock-reorder__scroll {
  max-height: min(70vh, 720px);
}
.stock-reorder__table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.stock-reorder__table td {
  font-size: 14px;
  vertical-align: middle;
}
.stock-reorder__row--urgent {
  background: #fff8f5;
}
.stock-reorder__dc--low {
  color: #c62828;
  font-weight: 700;
}
.stock-reorder__dc--ok {
  color: #2e7d32;
  font-weight: 600;
}
.stock-reorder__qty {
  width: 88px;
  padding: 6px 8px;
  text-align: right;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stock-ostatki__wh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.stock-ostatki__wh {
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-bottom: none;
}
.stock-ostatki__wh:hover {
  color: var(--teal-dark);
  background: var(--teal-light);
}
.stock-ostatki__wh.is-active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}
.stock-ostatki__filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}
.stock-ostatki__filter-grid label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.stock-ostatki__select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.stock-ostatki__filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.stock-ostatki__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.stock-ostatki__btn-green {
  background: #1e8f5a !important;
  color: #fff !important;
  border-color: #1e8f5a !important;
}
.stock-ostatki__btn-fake {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}
.stock-ostatki__search-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}
.stock-ostatki__search {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stock-ostatki__reset {
  margin-left: auto;
}
.stock-ostatki__view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.stock-ostatki__view-tabs a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  background: #f0f0f0;
}
.stock-ostatki__view-tabs a.is-active {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 600;
}
.stock-ostatki__table-head {
  margin-bottom: 6px;
  font-size: 12px;
}
.stock-ostatki__scroll {
  max-height: 70vh;
}
.stock-ostatki__table .stock-ostatki__cat-h {
  cursor: pointer;
  user-select: none;
  background: #f8faf9;
}
.stock-ostatki__cat--0 { border-left: 4px solid #0a6a62; }
.stock-ostatki__cat--1 { border-left: 4px solid #c62828; }
.stock-ostatki__cat--2 { border-left: 4px solid #1565c0; }
.stock-ostatki__cat--3 { border-left: 4px solid #f57c00; }
.stock-ostatki__toggle {
  width: 36px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.stock-ostatki__grand th {
  background: var(--teal-light);
  font-weight: 700;
}
.stock-ostatki__hint {
  margin-top: 12px;
  font-size: 13px;
}

/* Material report */
.stock-mat {
  margin-bottom: 24px;
}
.stock-mat__title {
  margin: 4px 0 8px;
  font-size: 1.35rem;
}
.stock-mat__filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.stock-mat__filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.stock-mat__filter-grid input,
.stock-mat__filter-grid select {
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.stock-mat__filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stock-mat__filters {
  margin-bottom: 16px;
  padding: 16px;
}
.stock-mat__scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stock-mat__table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13px;
}
.stock-mat__table th,
.stock-mat__table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.stock-mat__table thead th {
  background: #f4f7f8;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.stock-mat__group--in {
  background: #e8f5e9;
}
.stock-mat__group--out {
  background: #ffebee;
}
.stock-mat__col-idx {
  width: 36px;
  text-align: center;
  color: var(--muted);
}
.stock-mat__col-name {
  min-width: 160px;
  text-align: left;
}
.stock-mat__col-name strong {
  display: block;
}
.stock-mat__cat {
  display: block;
  font-size: 11px;
}
.stock-mat__col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stock-mat__col-num--closing {
  font-weight: 700;
  background: #f0faf9;
}
.stock-mat__grand th {
  background: var(--teal-light);
  font-weight: 700;
}
.stock-mat__period {
  margin: 0 0 12px;
}
.stock-mat__empty,
.stock-mat__hint {
  margin: 16px 0;
  font-size: 14px;
}
.is-hidden {
  display: none !important;
}
.stock-batch__filter-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.stock-batch__no {
  font-size: 12px;
  background: #f0f4f5;
  padding: 2px 6px;
  border-radius: 4px;
}
.stock-batch__table {
  min-width: 960px;
}

/* Audit reports */
.audit-reports-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
}
.audit-reports-nav__link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
}
.audit-reports-nav__link:hover {
  border-color: var(--teal);
}
.audit-reports-nav__link.is-active {
  background: var(--teal-light);
  border-color: var(--teal);
  font-weight: 600;
}
.audit-visits__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.audit-visits__filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.audit-visits__filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.audit-visits__filter-grid input,
.audit-visits__filter-grid select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.audit-visits__days {
  border: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.audit-visits__days legend {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px 0 0;
}
.audit-visits__day-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}
.audit-visits__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.audit-visits__scroll {
  overflow: auto;
}
.audit-visits__table {
  min-width: 640px;
}
.audit-visits__grand th {
  background: var(--teal-light);
  font-weight: 700;
}
.audit-visits__meta {
  margin: 0 0 10px;
  font-size: 13px;
}
.audit-visits__hint,
.audit-visits__empty {
  margin: 14px 0;
  font-size: 14px;
}

/* Sklad — 2 ustunli menyu (ERP) */
.stock-menu {
  margin: -8px 0 20px;
  padding: 16px 18px;
  background: #1e2a32;
  border-radius: 10px;
  color: #e8ecef;
}
.stock-menu__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}
@media (max-width: 720px) {
  .stock-menu__cols {
    grid-template-columns: 1fr;
  }
}
.stock-menu__col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa8b0;
  margin-bottom: 10px;
}
.stock-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stock-menu__link {
  display: block;
  padding: 5px 0;
  color: #e8ecef;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}
.stock-menu__link:hover {
  color: #7fd4c8;
  text-decoration: none;
}
.stock-menu__link.is-active {
  color: #fff;
  font-weight: 600;
}
.stock-menu__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  color: #fff;
  background: #c62828;
  border-radius: 3px;
  vertical-align: middle;
}
.stock-menu-page__hint {
  margin: 0 0 16px;
}

/* Kassa — menyu (3 ustun) */
.kassa-menu {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.kassa-menu__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
}
@media (max-width: 1100px) {
  .kassa-menu__cols {
    grid-template-columns: 1fr;
  }
}
.kassa-menu__col-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #546e7a;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}
.kassa-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kassa-menu__link {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: #1565c0;
  text-decoration: none;
}
.kassa-menu__link:hover {
  text-decoration: underline;
}
.kassa-menu__link.is-active {
  font-weight: 600;
  color: #0d47a1;
}
.kassa-menu__badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  color: #fff;
  background: #c62828;
  border-radius: 3px;
  vertical-align: middle;
}
.kassa-menu-page__hint {
  margin: 0 0 16px;
}
.kassa-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -4px 0 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.kassa-bar__root {
  font-weight: 600;
  color: var(--primary, #00838f);
  text-decoration: none;
}
.kassa-bar__sep {
  color: #999;
}
.kassa-bar__current {
  font-weight: 500;
}
.kassa-bar__all {
  margin-left: auto;
  font-size: 13px;
}
.kassa-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.kassa-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.kassa-module-table {
  font-size: 13px;
}

/* Sklad — ixcham qator (ichki sahifalar) */
.stock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -4px 0 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.stock-bar__root {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}
.stock-bar__root:hover {
  text-decoration: underline;
}
.stock-bar__sep {
  color: var(--muted);
  user-select: none;
}
.stock-bar__current {
  font-weight: 600;
  color: var(--text);
}
.stock-bar__all {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--teal-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  background: var(--teal-light);
}
.stock-bar__all:hover {
  text-decoration: none;
  border-color: var(--teal);
  background: #fff;
}
.stock-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.stock-planned__title {
  margin: 0 0 8px;
}
.stock-planned__lead {
  margin: 0 0 12px;
  max-width: 52em;
}
.stock-warehouses__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Корректировка склада */
.stock-adj-panel .receipt-title {
  font-size: 20px;
}
.stock-adj-hero {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 20px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.stock-adj-hero__row--wide {
  grid-column: 1 / -1;
}
.stock-adj-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.stock-adj-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.stock-adj-input--dt {
  max-width: 220px;
}
.stock-adj-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .stock-adj-layout {
    grid-template-columns: 1fr;
  }
}
.stock-adj-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}
.stock-adj-cat {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.stock-adj-cat:hover {
  background: var(--teal-light);
}
.stock-adj-cat.is-active {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}
.stock-adj-scroll {
  max-height: 58vh;
}
.stock-adj-table input.stock-adj-qty {
  width: 88px;
  padding: 4px 8px;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.stock-adj-row--neg {
  background: #fff3f3;
}
.stock-adj-total th {
  background: #f0f7f5;
  font-weight: 700;
}
.stock-adj-hint-i {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  background: #ccc;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  cursor: help;
}
.stock-adj-note {
  margin: 12px 0;
  font-size: 13px;
}
.stock-adj-line-comment {
  width: 100%;
  min-width: 140px;
  max-width: 280px;
  font-size: 13px;
}
.stock-adj-table--meta .stock-adj-input {
  width: 100%;
  min-width: 0;
}
.stock-adj-row--changed {
  background: rgba(255, 193, 7, 0.08);
}
.stock-adj-row--delete {
  background: rgba(198, 40, 40, 0.1);
}
.stock-adj-row--delete .js-meta-name,
.stock-adj-row--delete .js-meta-cat,
.stock-adj-row--delete .js-meta-block {
  text-decoration: line-through;
  opacity: 0.65;
}
.stock-adj-input--num {
  max-width: 72px;
  text-align: right;
}
.stock-adj-delete-lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}
.stock-adj-delete-lbl input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.stock-adj-delete-lbl span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  color: #78909c;
}
.stock-adj-delete-lbl input:checked + span {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
}
.stock-journal-table .stock-journal-comment {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.stock-journal-row--adj td:first-child {
  color: var(--accent, #2563eb);
}
.stock-journal-qty--neg {
  color: #c62828;
}

/* Поднавигация «Склад» (legacy) */
.stock-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 16px;
}
.stock-subnav__link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.2;
}
.stock-subnav__link:hover {
  text-decoration: none;
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-light);
}
.stock-subnav__link.is-active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.stock-subnav__link.is-active:hover {
  text-decoration: none;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

/* Расчёт зарплаты агентов */
.salary-period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.salary-agent-card {
  margin-bottom: 20px;
  padding: 16px 18px;
}
.salary-agent-card__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.salary-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}
.salary-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.salary-stat-value {
  font-weight: 600;
  font-size: 1.05rem;
}
.salary-stat-value--warn {
  color: #b71c1c;
}
.salary-pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.salary-pay-grid label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.salary-pay-grid input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.salary-result {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--teal-light, #e8f5f0);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.salary-net {
  font-size: 1.2rem;
  margin-top: 10px;
}

/* Каталог товаров + приход (фото в строке) */
.stock-products-form__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.stock-products-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.stock-products-form__grid .receipt-field--wide {
  grid-column: 1 / -1;
}
.stock-products-form__grid .receipt-field--actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stock-products-table__inactive {
  opacity: 0.55;
}
.stock-products-table__act {
  white-space: nowrap;
}
.receipt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.receipt-items-table td[data-col="photo"] {
  width: 52px;
  padding: 6px 4px;
}
.receipt-items-table .receipt-code-readonly {
  width: 100%;
  max-width: 88px;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8f9fa;
}
.receipt-items-table .in-block {
  width: 56px;
  text-align: right;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8f9fa;
}
.receipt-items-table .row-vol {
  font-size: 13px;
  white-space: nowrap;
}

@media print {
  .no-print,
  .topbar,
  .sidebar,
  .shell > aside,
  .page-title {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .main {
    max-width: none;
    padding: 0;
  }
  .salary-agent-card {
    page-break-after: always;
    border: none;
    box-shadow: none;
  }
  .salary-agent-card:last-of-type {
    page-break-after: auto;
  }
  .salary-result {
    background: #fff;
    border: 1px solid #ccc;
  }
}

/* Приход: выбор товара из каталога (модальное окно) */
.receipt-catalog-hint {
  margin: 6px 0 0;
  font-size: 13px;
  max-width: 900px;
}
.receipt-catalog-hint a {
  font-weight: 600;
}
.receipt-prod-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.receipt-prod-top .in-product {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.receipt-prod-catalog-btn {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.receipt-product-picker {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.receipt-product-picker[hidden] {
  display: none !important;
}
.receipt-product-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 32, 0.45);
}
.receipt-product-picker__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.receipt-product-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.receipt-product-picker__head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--teal-dark, #0d5c4e);
}
.receipt-product-picker__close {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.receipt-product-picker__close:hover {
  color: var(--text);
}
.receipt-product-picker__sub {
  margin: 0;
  padding: 10px 16px 0;
  font-size: 13px;
}
.receipt-product-picker__search {
  margin: 12px 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: calc(100% - 32px);
  box-sizing: border-box;
}
.receipt-product-picker__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}
.receipt-product-picker__table {
  width: 100%;
  font-size: 13px;
}
.receipt-product-picker__row {
  cursor: pointer;
}
.receipt-product-picker__row:hover {
  background: rgba(19, 141, 117, 0.08);
}

/* Склад — обзор (hub) */
.stock-hub__lead {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--muted);
}
.stock-hub__kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stock-hub__kpi-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafcfb;
}
.stock-hub__kpi-card--warn {
  border-color: #e8a87c;
  background: #fff8f3;
}
.stock-hub__kpi-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
}
.stock-hub__kpi-lbl {
  font-size: 12px;
  color: var(--muted);
}
.stock-hub__h {
  margin: 20px 0 12px;
  font-size: 16px;
}
.stock-hub__steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.stock-hub__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stock-hub__step--done .stock-hub__step-n {
  background: var(--teal);
  color: #fff;
}
.stock-hub__step-n {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  background: #e8eeec;
  font-weight: 700;
  font-size: 13px;
}
.stock-hub__step-body {
  flex: 1;
  min-width: 0;
}
.stock-hub__step-body p {
  margin: 4px 0 0;
}
.stock-hub__badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 600;
}
.stock-hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.stock-hub__card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.stock-hub__card:hover {
  border-color: var(--teal);
  background: var(--teal-light);
  text-decoration: none;
}
.stock-hub__card-title {
  display: block;
  font-weight: 600;
  color: var(--teal-dark);
}
.stock-hub__card-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.stock-hub__admin {
  margin-top: 20px;
  font-size: 13px;
}
.stock-setup__form {
  max-width: 420px;
  margin-top: 16px;
}
.stock-setup__input {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.stock-setup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn--danger {
  background: #c62828;
  color: #fff;
  border: 1px solid #b71c1c;
}
.btn--danger:hover {
  background: #b71c1c;
}

/* Приход — выбор действия */
.receipt-start__lead {
  margin: 0 0 18px;
  max-width: 52rem;
}
.receipt-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.receipt-start-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  border: 2px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.receipt-start-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 24px rgba(19, 141, 117, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}
.receipt-start-card--create {
  border-color: #c5e8e2;
  background: linear-gradient(165deg, #f7fcfb 0%, #fff 55%);
}
.receipt-start-card__icon {
  font-size: 28px;
  line-height: 1;
}
.receipt-start-card__title {
  font-size: 17px;
  color: var(--teal-dark);
}
.receipt-start-card__desc {
  font-size: 13px;
  line-height: 1.45;
}
.receipt-start-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 18px;
  font-size: 14px;
}
.receipt-start-links a {
  color: var(--teal-dark);
  font-weight: 500;
}
.product-create-panel {
  max-width: 920px;
}
.product-create-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.product-create-tabs__item {
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 8px;
}
.product-create-tabs__item.is-active {
  color: var(--teal-dark);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--teal);
}
.product-create-tabs__item.is-disabled {
  opacity: 0.45;
  cursor: default;
}
.product-create-field--full {
  display: block;
  margin-bottom: 16px;
}
.product-create-field--full span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.product-create-field--full input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.product-create-grid label span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
}
.product-create-hint {
  margin: 8px 0 16px;
  font-size: 13px;
}
.req {
  color: #c62828;
}
.field-float {
  position: relative;
  display: block;
}
.field-float--select select {
  width: 100%;
  font: inherit;
  padding: 14px 36px 10px 12px;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}
.field-float--select select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(19, 141, 117, 0.15);
}
.field-float__label {
  position: absolute;
  left: 10px;
  top: -8px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  background: #fff;
  pointer-events: none;
}
.product-create-grid .field-float--select {
  align-self: end;
}

/* Настройки (SalesDoc /settings/diler) */
.settings-menu {
  margin: -8px 0 20px;
  padding: 16px 18px;
  background: #243447;
  border-radius: 10px;
  color: #e8ecef;
}
.settings-menu__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px 32px;
}
.settings-menu__col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa8b0;
  margin-bottom: 10px;
}
.settings-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.settings-menu__link {
  display: block;
  padding: 5px 0;
  color: #e8ecef;
  text-decoration: none;
  font-size: 14px;
}
.settings-menu__link:hover {
  color: #7fd4c8;
}
.settings-menu__link.is-active {
  color: #fff;
  font-weight: 600;
}
.settings-menu-page__hint {
  margin: 0 0 16px;
}
.settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -4px 0 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.settings-bar__root {
  font-weight: 600;
  color: var(--teal-dark);
  text-decoration: none;
}
.settings-bar__sep {
  color: var(--muted);
}
.settings-bar__all {
  margin-left: auto;
  font-size: 13px;
  color: var(--teal-dark);
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 20px 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}
.settings-side {
  padding: 12px 0;
  border-right: 1px solid var(--border);
}
@media (max-width: 860px) {
  .settings-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 8px;
  }
}
.settings-side__hub {
  display: block;
  margin: 0 0 10px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--teal-dark);
  text-decoration: none;
}
.settings-side__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.settings-side__link {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.settings-side__link:hover {
  background: #f7faf9;
}
.settings-side__link.is-active {
  font-weight: 600;
  color: var(--teal-dark);
  background: #f0f8f6;
  border-left-color: var(--teal);
}
.settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.settings-hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-hub-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(19, 141, 117, 0.12);
}
.settings-hub-card__desc {
  font-size: 13px;
  line-height: 1.4;
}
.settings-form__title {
  margin: 0 0 8px;
  font-size: 16px;
}
.settings-form__lead {
  margin: 0 0 16px;
  font-size: 13px;
}
.settings-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-bottom: 20px;
}
.settings-form__grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}
.settings-form__grid .form-grid__full {
  grid-column: 1 / -1;
}
.settings-form__grid input,
.settings-form__grid select,
.settings-form__grid textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.settings-form__checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.settings-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* GPS маршрут агента (SalesDoc-style) */
.agent-gps-route {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 0;
  min-height: min(78vh, 720px);
  margin: -8px -4px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.agent-gps-route__side {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  background: #fafbfc;
  overflow-y: auto;
}
.agent-gps-route__head {
  margin-bottom: 12px;
}
.agent-gps-route__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.agent-gps-route__sub {
  margin: 0;
  font-size: 13px;
}
.agent-gps-route__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.agent-gps-route__tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted, #666);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.agent-gps-route__tab--active {
  color: var(--primary, #00838f);
  border-bottom-color: var(--primary, #00838f);
  font-weight: 600;
}
.agent-gps-route__field {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}
.agent-gps-route__field > span {
  display: block;
  margin-bottom: 4px;
  color: #555;
}
.agent-gps-route__field input[type="date"],
.agent-gps-route__field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.agent-gps-route__field--time input[type="range"] {
  width: 100%;
}
.agent-gps-route__field--time output {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 15px;
}
.agent-gps-route__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.agent-gps-route__filter--active {
  background: var(--primary, #00838f);
  color: #fff;
  border-color: var(--primary, #00838f);
}
.agent-gps-route__hint {
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.4;
}
.agent-gps-route__panel--hidden {
  display: none;
}
.agent-gps-route__stats {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.agent-gps-route__mapwrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.agent-gps-route__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.agent-gps-route__speed select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.agent-gps-route__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.agent-gps-route__map {
  flex: 1;
  min-height: 420px;
  background: #e8eaed;
}
.agent-gps-route__progress {
  height: 4px;
  background: #eee;
}
.agent-gps-route__progress-bar {
  height: 100%;
  width: 0;
  background: #d32f2f;
  transition: width 0.15s ease;
}
@media (max-width: 960px) {
  .agent-gps-route {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .agent-gps-route__side {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }
  .agent-gps-route__map {
    min-height: 50vh;
  }
}
