:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-border: #d9e0e7;
  --text: #18202a;
  --muted: #647282;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --line: #e7edf2;
  --warn-bg: #fef3c7;
  --panel-raised-border: #d5dee8;
  --panel-raised-shadow: 0 14px 34px rgb(15 23 42 / 7%), inset 0 1px 0 rgb(255 255 255 / 78%);
  --panel-header-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Supplier price mailbox, matching and delivery schedules */
.supplier-stock-page {
  max-width: 1540px;
}

.warehouse-demand-page {
  display: grid;
  gap: 10px;
  max-width: 1540px;
  padding-top: 10px;
}

.warehouse-demand-page .breadcrumbs-row {
  margin-bottom: 4px;
}

.warehouse-demand-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.warehouse-demand-heading-copy {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.warehouse-demand-heading h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

.warehouse-demand-heading-copy > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.warehouse-demand-cart-switcher {
  display: flex;
  gap: 7px;
}

.warehouse-demand-cart-switcher button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  padding: 7px 9px;
}

.warehouse-demand-cart-switcher span {
  background: #eef2f6;
  border-radius: 999px;
  min-width: 21px;
  padding: 2px 6px;
  text-align: center;
}

.warehouse-demand-controls {
  align-items: center;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: auto minmax(340px, 1fr);
}

.warehouse-demand-scope {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.warehouse-demand-tabs {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.warehouse-demand-tabs a {
  min-height: 32px;
  padding: 5px 10px;
}

.warehouse-demand-summary {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 5px 12px;
  white-space: nowrap;
}

.warehouse-demand-summary strong {
  color: var(--text);
}

.warehouse-demand-cart > header span {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-demand-toolbar {
  justify-self: stretch;
  margin: 0;
  min-width: 0;
}

.warehouse-demand-toolbar input {
  min-width: 180px;
  padding-block: 8px;
}

.warehouse-demand-toolbar select {
  min-width: 72px;
  padding-inline: 8px;
}

.warehouse-demand-toolbar .warehouse-demand-category-select {
  flex: 0 1 250px;
  max-width: 250px;
  min-width: 170px;
  text-overflow: ellipsis;
}

.warehouse-demand-toolbar button {
  padding-block: 8px;
}

.warehouse-demand-table {
  overflow-x: hidden;
  width: 100%;
}

.warehouse-demand-table table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.warehouse-demand-table th,
.warehouse-demand-table td {
  overflow-wrap: anywhere;
}

.warehouse-demand-table th {
  white-space: normal;
}

.warehouse-demand-table th:nth-child(1) {
  width: 6%;
}

.warehouse-demand-table th:nth-child(2) {
  width: 20%;
}

.warehouse-demand-table th:nth-child(3) {
  width: 11%;
}

.warehouse-demand-table th:nth-child(4) {
  width: 9%;
}

.warehouse-demand-table th:nth-child(5) {
  width: 8%;
}

.warehouse-demand-table th:nth-child(6) {
  width: 14%;
}

.warehouse-demand-table th:nth-child(7) {
  width: 17%;
}

.warehouse-demand-table th:nth-child(8) {
  width: 15%;
}

.warehouse-demand-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.warehouse-demand-table td > small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.warehouse-demand-ratings {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: 2px;
}

.warehouse-demand-rating {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #fff;
  cursor: help;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.warehouse-demand-rating-abc-A,
.warehouse-demand-rating-xyz-X {
  background: #047857;
}

.warehouse-demand-rating-abc-B,
.warehouse-demand-rating-xyz-Y {
  background: #d97706;
}

.warehouse-demand-rating-abc-C,
.warehouse-demand-rating-xyz-Z {
  background: #64748b;
}

.warehouse-demand-rating-abc-—,
.warehouse-demand-rating-xyz-— {
  background: #cbd5e1;
  color: #475569;
}

.warehouse-demand-actions {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.warehouse-demand-actions button {
  font-size: 12px;
  line-height: 1.15;
  padding: 8px 6px;
  white-space: normal;
  width: 100%;
}

@media (max-width: 760px) {
  .warehouse-demand-table {
    overflow-x: auto;
  }

  .warehouse-demand-table table {
    min-width: 1000px;
  }
}

.warehouse-demand-actions .is-added {
  background: #e7f8f1;
  border-color: #1d8a66;
  color: #14664e;
}

.warehouse-demand-recommendation > strong {
  display: block;
}

.warehouse-demand-multiple-state,
.warehouse-demand-multiple-form {
  align-items: flex-end;
  display: grid;
  gap: 4px;
  justify-items: end;
  margin-top: 5px;
}

.warehouse-demand-multiple-form[hidden] {
  display: none;
}

.warehouse-demand-multiple-state small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.warehouse-demand-multiple-state > div {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  justify-content: flex-end;
}

.warehouse-demand-multiple-state .table-link,
.warehouse-demand-multiple-form .table-link {
  font-size: 11px;
  min-height: 0;
  padding: 0;
}

.warehouse-demand-multiple-form input {
  font-size: 12px;
  min-width: 0;
  padding: 6px;
  text-align: right;
  width: 100%;
}

.warehouse-demand-multiple-form button[type="submit"] {
  font-size: 11px;
  padding: 6px 8px;
  width: 100%;
}

.warehouse-demand-multiple-message {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.warehouse-demand-multiple-message.is-error {
  color: #b42318;
}

.warehouse-demand-muted {
  color: var(--muted);
}

.warehouse-demand-cart-backdrop {
  background: rgb(20 31 45 / 44%);
  display: flex;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: 1200;
}

.warehouse-demand-cart-backdrop[hidden] {
  display: none;
}

.warehouse-demand-cart {
  background: var(--panel);
  box-shadow: -16px 0 42px rgb(20 31 45 / 18%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  width: min(620px, 100%);
}

.warehouse-demand-cart > header,
.warehouse-demand-cart > footer {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 24px;
}

.warehouse-demand-cart > footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
}

.warehouse-demand-cart h2 {
  margin: 4px 0 0;
}

.warehouse-demand-cart-body {
  overflow-y: auto;
  padding: 20px 24px;
}

.warehouse-demand-cart-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 18px;
  overflow: hidden;
}

.warehouse-demand-cart-group > header,
.warehouse-demand-cart-group article {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.warehouse-demand-cart-group > header {
  background: #f8fafc;
}

.warehouse-demand-cart-group article {
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) 100px auto;
}

.warehouse-demand-cart-group article div,
.warehouse-demand-cart-group article label {
  display: grid;
  gap: 4px;
}

.warehouse-demand-cart-group small,
.warehouse-demand-cart-group label {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-demand-cart-group input {
  padding: 7px 8px;
  width: 100%;
}

@media (max-width: 760px) {
  .warehouse-demand-page {
    padding-top: 8px;
  }

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

  .warehouse-demand-heading h1 {
    font-size: 24px;
  }

  .warehouse-demand-cart-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .warehouse-demand-controls {
    grid-template-columns: 1fr;
  }

  .warehouse-demand-scope {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .warehouse-demand-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px auto;
  }

  .warehouse-demand-toolbar input {
    min-width: 0;
  }

  .warehouse-demand-cart > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-demand-cart-group article {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .warehouse-demand-cart-group article > button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.supplier-stock-title {
  align-items: flex-end;
  margin-bottom: 16px;
}

.supplier-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.supplier-import-card {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-left: 4px solid #94a3b8;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 5%);
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px 14px;
}

.supplier-import-card.is-ready {
  border-left-color: #16a34a;
}

.supplier-import-card > div {
  display: grid;
  gap: 2px;
}

.supplier-import-card span,
.supplier-import-card small,
.supplier-import-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.supplier-import-card strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.supplier-import-card .supplier-import-error {
  color: #b91c1c;
  font-weight: 800;
}

.supplier-stock-notice,
.supplier-matching-intro {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  color: #78350f;
  line-height: 1.45;
  margin-bottom: 14px;
  padding: 11px 14px;
}

.supplier-matching-intro {
  align-items: center;
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #134e4a;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.supplier-stock-toolbar {
  grid-template-columns: minmax(240px, 1.3fr) minmax(180px, .8fr) minmax(220px, 1fr) minmax(160px, .7fr) auto;
}

.supplier-matching-toolbar {
  grid-template-columns: minmax(220px, .65fr) minmax(280px, 1.3fr) auto auto;
}

.supplier-schedule-toolbar {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  max-width: 780px;
}

.supplier-stock-table table,
.supplier-schedule-table table {
  min-width: 1080px;
}

.supplier-stock-table td,
.supplier-stock-table th,
.supplier-schedule-table td,
.supplier-schedule-table th {
  vertical-align: middle;
}

.supplier-stock-table td > small,
.supplier-schedule-table td > small,
.supplier-stock-table td strong + small,
.supplier-schedule-table td strong + small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.supplier-product-link {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 210px;
}

.supplier-product-link img,
.supplier-history-item img,
.supplier-selected-product img {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  flex: 0 0 auto;
  height: 46px;
  object-fit: contain;
  width: 46px;
}

.supplier-product-link span {
  min-width: 0;
}

.supplier-product-link strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.supplier-product-link small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.supplier-unmapped {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.supplier-matching-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(310px, .75fr) minmax(520px, 1.6fr);
}

.supplier-history-panel,
.supplier-offer-panel {
  background: #fff;
  border: 1px solid var(--panel-raised-border);
  border-radius: 10px;
  box-shadow: var(--panel-raised-shadow);
  min-width: 0;
}

.supplier-history-panel > header,
.supplier-candidate-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
}

.supplier-history-panel h2,
.supplier-candidate-heading h2 {
  margin: 0;
}

.supplier-history-panel header span,
.supplier-candidate-heading span {
  background: #f1f5f9;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.supplier-history-list {
  max-height: 720px;
  overflow: auto;
  padding: 7px;
}

.supplier-history-item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 9px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  margin-bottom: 4px;
  padding: 8px;
  text-decoration: none;
}

.supplier-history-item:hover,
.supplier-history-item.is-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.supplier-history-item img,
.supplier-history-item .supplier-product-placeholder {
  height: 42px;
  width: 42px;
}

.supplier-history-item span:not(.supplier-product-placeholder) {
  min-width: 0;
}

.supplier-history-item strong,
.supplier-history-item small {
  display: block;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.supplier-history-item strong {
  font-size: 12px;
}

.supplier-history-item small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.supplier-history-item em {
  color: #047857;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.supplier-product-placeholder {
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #64748b;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.supplier-offer-panel {
  overflow: hidden;
  padding-bottom: 10px;
}

.supplier-selected-product {
  align-items: center;
  background: linear-gradient(180deg, #f8fafc, #fff);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 15px;
}

.supplier-selected-product img,
.supplier-selected-product .supplier-product-placeholder {
  height: 64px;
  width: 64px;
}

.supplier-selected-product > div {
  min-width: 0;
}

.supplier-selected-product span,
.supplier-selected-product small {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.supplier-selected-product h2 {
  font-size: 17px;
  margin: 3px 0 5px;
  overflow-wrap: anywhere;
}

.supplier-current-mappings {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  display: grid;
  gap: 7px;
  padding: 12px 15px;
}

.supplier-current-mappings > strong {
  color: #166534;
  font-size: 12px;
}

.supplier-current-mappings > div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.supplier-current-mappings span {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.supplier-current-mappings form {
  margin: 0;
}

.supplier-current-mappings button.table-link {
  color: #b91c1c;
  font-size: 11px;
  padding: 0;
}

.supplier-offer-search {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  margin: 12px 14px;
}

.supplier-candidate-list {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
}

.supplier-candidate {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 10px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  padding: 10px;
}

.supplier-candidate.is-linked {
  background: #fffbeb;
  border-color: #fde68a;
}

.supplier-match-score {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.supplier-candidate-body {
  min-width: 0;
}

.supplier-candidate-body strong,
.supplier-candidate-body span,
.supplier-candidate-body small,
.supplier-candidate-body em {
  display: block;
  overflow-wrap: anywhere;
}

.supplier-candidate-body strong {
  font-size: 13px;
}

.supplier-candidate-body span,
.supplier-candidate-body small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.supplier-candidate-body em {
  color: #92400e;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  margin-top: 4px;
}

.supplier-candidate form {
  margin: 0;
}

.supplier-candidate button,
.supplier-schedule-editor button {
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 10px;
}

.supplier-schedule-editor {
  min-width: 160px;
  position: relative;
}

.supplier-schedule-editor > summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.supplier-schedule-editor[open] > form {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  box-shadow: 0 16px 36px rgb(15 23 42 / 16%);
  display: grid;
  gap: 9px;
  margin-top: 8px;
  min-width: 430px;
  padding: 12px;
  position: absolute;
  right: 0;
  z-index: 12;
}

.supplier-schedule-editor fieldset {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 8px;
}

.supplier-schedule-editor legend {
  font-size: 11px;
  font-weight: 900;
  padding: 0 4px;
}

.supplier-schedule-editor label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
}

.supplier-schedule-editor .supplier-route-toggle {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 11px;
}

.supplier-schedule-editor input[type="number"],
.supplier-schedule-editor textarea {
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-sizing: border-box;
  font: inherit;
  padding: 7px 8px;
  width: 100%;
}

.supplier-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.supplier-weekdays label {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 3px;
  padding: 4px 5px;
}

@media (max-width: 980px) {
  .supplier-matching-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .supplier-history-list {
    max-height: 420px;
  }
}

@media (max-width: 760px) {
  .supplier-import-grid,
  .supplier-matching-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .supplier-matching-intro {
    align-items: flex-start;
    display: grid;
  }

  .supplier-candidate {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .supplier-candidate form {
    grid-column: 1 / -1;
  }

  .supplier-candidate button {
    width: 100%;
  }

  .supplier-schedule-editor[open] > form {
    min-width: min(430px, calc(100vw - 42px));
    position: fixed;
    right: 14px;
    top: 96px;
  }
}

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

.page-title-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.customer-contact-page-shell {
  padding-bottom: 96px;
}

.customer-contact-title {
  align-items: end;
}

.customer-contact-title p:not(.eyebrow) {
  color: var(--muted);
  margin: 7px 0 0;
  max-width: 760px;
}

.customer-contact-title-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.customer-contact-title-stats span {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  min-width: 132px;
  padding: 9px 12px;
}

.customer-contact-title-stats strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.customer-contact-alert {
  align-items: flex-start;
  border: 1px solid;
  border-radius: 10px;
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 11px 14px;
}

.customer-contact-alert.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.customer-contact-alert.is-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.customer-contact-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.65fr) minmax(180px, 0.55fr) auto;
  margin-bottom: 14px;
}

.customer-contact-toolbar label,
.customer-contact-toolbar input,
.customer-contact-toolbar select {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.customer-contact-list {
  display: grid;
  gap: 8px;
}

.customer-contact-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 28px minmax(200px, 0.95fr) minmax(260px, 1.35fr) minmax(180px, 0.72fr) minmax(220px, 0.9fr);
  padding: 13px 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.customer-contact-card:focus-within {
  border-color: #8ac9c3;
  box-shadow: 0 0 0 3px rgb(15 118 110 / 9%);
}

.customer-contact-card.is-blocked {
  background: #f8fafc;
}

.customer-contact-card.is-saved {
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgb(34 197 94 / 8%);
}

.customer-contact-card.is-address-not-required {
  border-color: #93c5fd;
}

.customer-contact-select-cell {
  align-self: stretch;
  display: flex;
  justify-content: center;
  padding-top: 25px;
}

.customer-contact-select-cell input {
  height: 18px;
  width: 18px;
}

.customer-contact-client {
  align-content: center;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.customer-contact-client > a {
  color: var(--text);
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
}

.customer-contact-client > a:hover {
  color: var(--accent-strong);
}

.customer-contact-client > span,
.customer-contact-counterparty-picker > span {
  color: var(--muted);
  font-size: 12px;
}

.customer-contact-counterparty-picker {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.customer-contact-counterparty-picker select {
  font-size: 13px;
  max-width: 100%;
}

.customer-contact-row-note:empty {
  display: none;
}

.customer-contact-row-note:not(:empty) {
  color: #b45309;
  line-height: 1.25;
}

.customer-contact-address-requirement {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 4px;
  padding: 7px 8px;
}

.customer-contact-address-requirement input {
  height: 17px;
  margin: 0;
  width: 17px;
}

.customer-contact-address-requirement > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.customer-contact-address-requirement strong {
  color: #1e3a8a;
  font-size: 12px;
}

.customer-contact-address-requirement small {
  color: #475569;
  font-size: 10px;
  line-height: 1.25;
}

.customer-contact-address-requirement i {
  color: #047857;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.customer-contact-card.is-address-not-required .customer-contact-address > span::after,
.customer-contact-card.is-address-not-required .customer-contact-geopoint .customer-contact-field > label::after {
  color: #2563eb;
  content: " · не требуется";
  font-weight: 600;
}

.customer-contact-legal-name {
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 0 7px 7px 0;
  display: grid;
  gap: 2px;
  margin-top: 3px;
  min-width: 0;
  padding: 5px 7px;
}

.customer-contact-legal-name[hidden],
.customer-contact-legal-name small[hidden] {
  display: none;
}

.customer-contact-legal-name > small:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.customer-contact-legal-name > span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.customer-contact-legal-name > small:last-child {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.customer-contact-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-contact-field > span,
.customer-contact-field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-contact-field input,
.customer-contact-field textarea,
.customer-contact-counterparty-picker select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}

.customer-contact-field textarea {
  min-height: 58px;
  resize: vertical;
}

.customer-contact-field input:focus,
.customer-contact-field textarea:focus,
.customer-contact-counterparty-picker select:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(15 118 110 / 12%);
}

.customer-contact-field input:disabled,
.customer-contact-field textarea:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.customer-contact-geopoint {
  align-items: end;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.customer-contact-geopoint-control {
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.customer-contact-geopoint-control button {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 7px 11px;
  white-space: nowrap;
}

.customer-contact-geopoint-control button:hover:not(:disabled) {
  background: #d1fae5;
}

.customer-contact-geopoint-control button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.customer-contact-map-dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 26px 70px rgb(15 23 42 / 30%);
  max-width: min(920px, calc(100vw - 28px));
  padding: 20px;
  position: relative;
  width: 920px;
}

.customer-contact-map-dialog::backdrop {
  backdrop-filter: blur(2px);
  background: rgb(15 23 42 / 48%);
}

.customer-contact-map-heading h2 {
  margin: 3px 42px 4px 0;
}

.customer-contact-map-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 0 42px 14px 0;
}

.customer-contact-map-canvas {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  height: min(62vh, 560px);
  min-height: 360px;
  overflow: hidden;
  width: 100%;
}

.customer-contact-map-canvas.is-error {
  align-items: center;
  color: #991b1b;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.customer-contact-map-attribution {
  color: var(--muted);
  font-size: 11px;
  margin: 5px 2px 0;
}

.customer-contact-map-attribution a {
  color: inherit;
}

.customer-contact-map-actions {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 8px;
}

.customer-contact-map-actions > span {
  color: var(--muted);
  font-size: 13px;
}

.customer-contact-map-action-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.customer-contact-map-action-buttons button:not(.secondary-link) {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 9px 18px;
}

.customer-contact-map-action-buttons button:not(.secondary-link):hover:not(:disabled) {
  background: var(--accent-strong);
}

.customer-contact-map-action-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.customer-contact-empty {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 34px;
}

.customer-contact-pagination {
  align-items: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 4px;
  margin-top: 16px;
  padding: 8px 10px;
}

.customer-contact-pagination-top {
  margin-bottom: 12px;
  margin-top: -2px;
}

.customer-contact-pagination div {
  display: flex;
  gap: 8px;
}

.customer-contact-pagination .is-disabled {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 9px 12px;
}

.customer-contact-savebar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgb(255 255 255 / 94%);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  bottom: 16px;
  box-shadow: 0 16px 42px rgb(15 23 42 / 18%);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  left: max(18px, calc((100vw - 1500px) / 2));
  padding: 11px 13px 11px 16px;
  position: fixed;
  right: max(18px, calc((100vw - 1500px) / 2));
  z-index: 40;
}

.customer-contact-savebar > div {
  display: grid;
  gap: 2px;
}

.customer-contact-savebar span {
  color: var(--muted);
  font-size: 12px;
}

.customer-contact-savebar span.is-error {
  color: #b91c1c;
}

.customer-contact-savebar span.is-success {
  color: #047857;
}

.customer-contact-savebar button,
.customer-contact-confirm-actions button:not(.secondary-link) {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 9px 18px;
}

.customer-contact-savebar button:hover:not(:disabled),
.customer-contact-confirm-actions button:not(.secondary-link):hover:not(:disabled) {
  background: var(--accent-strong);
}

.customer-contact-savebar button:disabled,
.customer-contact-confirm-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.customer-contact-confirm {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 26px 70px rgb(15 23 42 / 30%);
  max-width: min(480px, calc(100vw - 32px));
  padding: 24px;
  position: relative;
}

.customer-contact-confirm::backdrop {
  background: rgb(15 23 42 / 48%);
  backdrop-filter: blur(2px);
}

.customer-contact-confirm h2 {
  margin: 4px 0 8px;
}

.customer-contact-confirm p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.customer-contact-confirm-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  position: absolute;
  right: 14px;
  top: 12px;
}

.customer-contact-confirm-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 1250px) {
  .customer-contact-card {
    grid-template-columns: 28px minmax(190px, 0.8fr) minmax(250px, 1.3fr) minmax(170px, 0.75fr);
  }

  .customer-contact-geopoint {
    grid-column: 3 / 5;
  }
}

@media (max-width: 860px) {
  .customer-contact-title {
    align-items: flex-start;
  }

  .customer-contact-title-stats {
    justify-content: flex-start;
  }

  .customer-contact-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-contact-card {
    align-items: start;
    grid-template-columns: 24px 1fr;
    padding: 13px;
  }

  .customer-contact-select-cell {
    grid-row: 1 / 5;
    padding-top: 3px;
  }

  .customer-contact-client,
  .customer-contact-address,
  .customer-contact-phone,
  .customer-contact-geopoint {
    grid-column: 2;
  }

  .customer-contact-savebar {
    align-items: stretch;
    bottom: 8px;
    flex-direction: column;
    gap: 8px;
    left: 8px;
    right: 8px;
  }
}

@media (max-width: 520px) {
  .customer-contact-title-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .customer-contact-geopoint-control {
    grid-template-columns: 1fr;
  }

  .customer-contact-map-dialog {
    padding: 14px;
  }

  .customer-contact-map-canvas {
    height: 54vh;
    min-height: 300px;
  }

  .customer-contact-map-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-contact-map-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .customer-contact-confirm-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

.logistics-shadow-toolbar {
  display: grid;
  grid-template-columns: auto minmax(170px, 220px) minmax(220px, 320px) auto;
  align-items: end;
}

.logistics-shadow-toolbar .secondary-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 42px;
}

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

.logistics-shadow-runs table {
  min-width: 920px;
}

.logistics-shadow-runs.has-profit-columns table {
  min-width: 1320px;
}

.logistics-shadow-runs.has-profit-columns {
  overflow-x: auto;
}

.logistics-shadow-profit-note {
  margin: -2px 0 14px;
}

.logistics-shadow-profit-cell {
  min-width: 150px;
}

.logistics-shadow-profit-cell strong,
.logistics-shadow-profit-cell small {
  display: block;
}

.logistics-shadow-profit-cell small {
  margin-top: 4px;
  color: var(--muted);
  white-space: normal;
}

.logistics-shadow-documents details summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
}

.logistics-shadow-document-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-width: 620px;
}

.logistics-shadow-document-list a {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  text-decoration: none;
}

.logistics-shadow-document-list a:hover {
  border-color: var(--accent);
}

.logistics-shadow-document-list small {
  color: var(--muted);
}

.logistics-shadow-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.logistics-shadow-status.is-high {
  background: #dcfce7;
  color: #166534;
}

.logistics-shadow-status.is-medium {
  background: #e0f2fe;
  color: #075985;
}

.logistics-shadow-status.is-review {
  background: #fef3c7;
  color: #92400e;
}

.logistics-shadow-status.is-ignored {
  background: #f1f5f9;
  color: #64748b;
}

.logistics-shadow-status.is-unknown {
  background: #f1f5f9;
  color: #475569;
}

.logistics-shadow-baseline-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 18px;
}

.logistics-shadow-baseline-grid span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.logistics-shadow-baseline-grid b {
  font-size: 20px;
}

.logistics-shadow-tabs {
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  gap: 6px;
  margin: -4px 0 18px;
  overflow-x: auto;
}

.logistics-shadow-tabs a {
  align-items: center;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  padding: 12px 16px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.logistics-shadow-tabs a:hover,
.logistics-shadow-tabs a.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.logistics-shadow-tabs a span {
  align-items: center;
  background: #fef3c7;
  border-radius: 999px;
  color: #92400e;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  min-width: 24px;
  padding: 3px 7px;
}

.logistics-shadow-analytics-toolbar {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(160px, 210px) minmax(160px, 210px) minmax(220px, 320px) auto;
}

.logistics-shadow-analytics-toolbar .secondary-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 42px;
}

.logistics-shadow-period-note {
  color: var(--muted);
  font-size: 13px;
  margin: -7px 0 16px;
}

.metric-grid.logistics-shadow-analytics-metrics,
.metric-grid.logistics-shadow-return-metrics {
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid.logistics-shadow-analytics-metrics > .metric-card,
.metric-grid.logistics-shadow-return-metrics > .metric-card {
  align-content: start;
  align-items: start;
  border-bottom: 1px solid var(--panel-raised-border);
  box-sizing: border-box;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  justify-content: stretch;
  min-height: 132px;
  min-width: 0;
  padding: 16px 18px;
}

.metric-grid.logistics-shadow-analytics-metrics > .metric-card > .metric-label,
.metric-grid.logistics-shadow-return-metrics > .metric-card > .metric-label {
  line-height: 1.3;
  margin: 0 0 9px;
}

.metric-grid.logistics-shadow-analytics-metrics > .metric-card > strong,
.metric-grid.logistics-shadow-return-metrics > .metric-card > strong {
  display: block;
  font-size: clamp(22px, 2vw, 32px);
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  margin: 0 0 8px;
  max-width: 100%;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.metric-grid.logistics-shadow-analytics-metrics > .metric-card > p,
.metric-grid.logistics-shadow-return-metrics > .metric-card > p {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  min-width: 0;
}

.logistics-shadow-review-card {
  background: linear-gradient(145deg, #fffdf5 0%, #fef3c7 100%);
  border-color: #f3d68a;
}

.logistics-shadow-return-section {
  margin-top: 26px;
}

.logistics-shadow-return-metrics .metric-card {
  background: linear-gradient(145deg, #ffffff 0%, #ecfdf5 100%);
  border-color: #a7f3d0;
}

.logistics-shadow-return-method {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  padding: 13px;
}

.logistics-shadow-return-method span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.logistics-shadow-return-method b {
  color: var(--text);
}

.logistics-shadow-return-distributions {
  margin-top: 14px;
}

.logistics-shadow-section-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 26px 0 14px;
}

.logistics-shadow-section-heading h2,
.logistics-shadow-distribution-card h3 {
  margin: 0;
}

.logistics-shadow-section-heading > p {
  color: var(--muted);
  margin: 0;
  max-width: 560px;
  text-align: right;
}

.logistics-shadow-distribution-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logistics-shadow-distribution-card {
  background: var(--panel);
  border: 1px solid var(--panel-raised-border);
  border-radius: 12px;
  box-shadow: var(--panel-raised-shadow);
  min-width: 0;
  padding: 16px;
}

.logistics-shadow-distribution-card h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.logistics-shadow-time-summary {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  margin: -7px 0 12px;
}

.logistics-shadow-bar-row {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.logistics-shadow-bar-row > div:first-child {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
}

.logistics-shadow-bar-row small {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.logistics-shadow-bar-track {
  background: #e7edf2;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.logistics-shadow-bar-track i {
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 3px;
}

.logistics-shadow-time-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 12px;
  padding: 11px 14px;
}

.logistics-shadow-analytics-table {
  margin-top: 18px;
}

.logistics-shadow-table-scroll {
  overflow: auto;
}

.logistics-shadow-analytics-table table {
  min-width: 760px;
}

.logistics-shadow-analytics-table th,
.logistics-shadow-analytics-table td {
  vertical-align: top;
}

.logistics-shadow-vehicle-days table {
  min-width: 1320px;
}

.logistics-shadow-vehicle-day-scroll {
  max-height: 760px;
}

.logistics-shadow-vehicle-day-scroll thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.logistics-shadow-day-runs-cell {
  min-width: 280px;
}

.logistics-shadow-return-details summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.logistics-shadow-return-run-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  width: min(650px, 68vw);
}

.logistics-shadow-return-run-list article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 8px;
  padding: 11px;
}

.logistics-shadow-return-run-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.logistics-shadow-return-run-title strong {
  font-size: 12px;
}

.logistics-shadow-return-run-list article > p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.logistics-shadow-return-run-facts {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.logistics-shadow-return-run-facts span {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 2px;
  padding: 7px;
}

.logistics-shadow-return-run-facts small,
.logistics-shadow-return-run-facts em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.logistics-shadow-return-run-facts b {
  font-size: 11px;
}

.logistics-shadow-return-warning {
  background: #fffbeb;
  border-radius: 6px;
  color: #92400e !important;
  padding: 6px 8px;
}

.logistics-shadow-two-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logistics-shadow-tall-table {
  max-height: 560px;
}

.logistics-shadow-tall-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.logistics-shadow-explanation {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 16px;
}

.logistics-shadow-capacity-warning {
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.logistics-shadow-review-list {
  border-color: #f3d68a;
}

.logistics-shadow-day-link {
  display: inline-flex;
  padding: 6px 9px;
  white-space: nowrap;
}

.logistics-shadow-quality-section {
  margin-top: 26px;
}

.logistics-shadow-quality-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.logistics-shadow-quality-grid article {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 15px;
}

.logistics-shadow-quality-grid strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.logistics-shadow-quality-grid span {
  font-size: 13px;
  font-weight: 800;
}

.logistics-shadow-quality-grid p,
.logistics-shadow-method-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.logistics-shadow-method-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  margin-top: 14px;
  padding: 14px 16px;
}

@media (max-width: 900px) {
  .logistics-shadow-toolbar,
  .logistics-shadow-analytics-toolbar,
  .logistics-shadow-metrics,
  .metric-grid.logistics-shadow-analytics-metrics,
  .metric-grid.logistics-shadow-return-metrics,
  .logistics-shadow-return-method,
  .logistics-shadow-quality-grid,
  .logistics-shadow-baseline-grid {
    grid-template-columns: 1fr 1fr;
  }

  .logistics-shadow-distribution-grid,
  .logistics-shadow-two-columns {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .logistics-shadow-toolbar,
  .logistics-shadow-analytics-toolbar,
  .logistics-shadow-metrics,
  .metric-grid.logistics-shadow-analytics-metrics,
  .metric-grid.logistics-shadow-return-metrics,
  .logistics-shadow-return-method,
  .logistics-shadow-distribution-grid,
  .logistics-shadow-two-columns,
  .logistics-shadow-quality-grid,
  .logistics-shadow-baseline-grid {
    grid-template-columns: 1fr;
  }

  .logistics-shadow-section-heading {
    align-items: start;
    display: grid;
  }

  .logistics-shadow-section-heading > p {
    text-align: left;
  }
}

/* Rostov supplier order assistant */
.rostov-order-page-shell {
  max-width: none;
}

.rostov-order-assistant {
  --rostov-order-blue: #173f5f;
  --rostov-order-teal: #1f7a6b;
  --rostov-order-orange: #d97706;
  --rostov-order-soft-blue: #eef6fb;
  --rostov-order-soft-green: #eefaf5;
}

.rostov-order-title {
  align-items: flex-end;
  gap: 24px;
}

.rostov-order-source {
  min-width: 290px;
  padding: 13px 16px;
  border: 1px solid #cbdce8;
  border-radius: 12px;
  background: #f7fbfe;
}

.rostov-order-source span,
.rostov-order-source small {
  display: block;
}

.rostov-order-source span {
  color: var(--rostov-order-blue);
  font-size: 13px;
  font-weight: 800;
}

.rostov-order-source small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.rostov-order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.rostov-order-summary article {
  padding: 15px 17px;
  border: 1px solid #dbe5ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(23, 63, 95, .06);
}

.rostov-order-summary article.is-existing {
  border-color: #a9ddc9;
  background: var(--rostov-order-soft-green);
}

.rostov-order-summary article.is-new {
  border-color: #f3cf9b;
  background: #fff8eb;
}

.rostov-order-summary span,
.rostov-order-summary small,
.rostov-order-summary strong {
  display: block;
}

.rostov-order-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.rostov-order-summary strong {
  margin: 5px 0 3px;
  color: var(--rostov-order-blue);
  font-size: 28px;
  line-height: 1;
}

.rostov-order-summary small {
  color: #6b7c89;
  font-size: 10px;
  line-height: 1.35;
}

.rostov-order-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(6, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #d9e3ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 63, 95, .05);
}

.rostov-order-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rostov-order-filters label > span,
.rostov-order-page-size span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rostov-order-filters input,
.rostov-order-filters select,
.rostov-order-page-size select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cad7df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.rostov-order-reset {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #cad7df;
  border-radius: 8px;
  background: #f7fafc;
  color: #526575;
  font-weight: 750;
}

.rostov-order-workspace {
  display: block;
}

.rostov-order-results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.rostov-order-results-head > div:first-child strong,
.rostov-order-results-head > div:first-child span {
  display: block;
}

.rostov-order-results-head > div:first-child strong {
  color: var(--rostov-order-blue);
  font-size: 17px;
}

.rostov-order-results-head > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.rostov-order-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rostov-order-page-size select {
  min-height: 34px;
  width: 74px;
}

.rostov-order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  transition: opacity .18s ease;
}

.rostov-order-category-group {
  min-width: 0;
  padding: 16px;
  border: 1px solid #ccdbe5;
  border-radius: 16px;
  background: #f7fafc;
}

.rostov-order-category-group > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #b9cedb;
}

.rostov-order-category-group > header span,
.rostov-order-category-group > header h2 {
  display: block;
  margin: 0;
}

.rostov-order-category-group > header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rostov-order-category-group > header h2 {
  margin-top: 3px;
  color: var(--rostov-order-blue);
  font-size: 20px;
}

.rostov-order-category-group > header strong {
  color: #617686;
  font-size: 11px;
}

.rostov-order-category-products {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.rostov-order-card-meta .rostov-order-brand-pill {
  border: 1px solid #b7c9d5;
  background: #dce8ef;
  color: #31566d;
  box-shadow: 0 2px 5px rgba(23, 63, 95, .12);
}

.rostov-order-card-meta .rostov-order-brand-pill.is-rage {
  border-color: #e88a00;
  background: #f59e0b;
  color: #3b2500;
}

.rostov-order-card-meta .rostov-order-brand-pill.is-vira {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
}

.rostov-order-grid.is-loading {
  opacity: .55;
}

.rostov-order-loading,
.rostov-order-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 30px;
  border: 1px dashed #b9cbd7;
  border-radius: 12px;
  background: #f8fbfd;
  color: var(--muted);
  text-align: center;
}

.rostov-order-empty strong,
.rostov-order-empty span {
  display: block;
}

.rostov-order-empty strong {
  color: var(--rostov-order-blue);
  font-size: 18px;
}

.rostov-order-empty span {
  margin-top: 5px;
}

.rostov-order-empty.is-error {
  border-color: #efb5b5;
  background: #fff6f6;
}

.rostov-order-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid #dce6ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 63, 95, .075);
}

.rostov-order-card.is-existing {
  border-color: #a9d9c7;
}

.rostov-order-card-photo {
  position: relative;
  display: grid;
  place-items: center;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(145deg, #f7fafc, #edf3f7);
}

.rostov-order-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform .22s ease;
}

.rostov-order-card-photo:hover img {
  transform: scale(1.045);
}

.rostov-order-photo-preview-large {
  position: fixed;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 14px;
  pointer-events: none;
  border: 1px solid #cbd9e2;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 70px rgba(15, 35, 48, .3);
  animation: rostov-order-photo-preview-in .18s ease-out both;
}

.rostov-order-photo-preview-large img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes rostov-order-photo-preview-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rostov-order-photo-placeholder {
  display: grid;
  gap: 3px;
  place-items: center;
  color: #78909f;
}

.rostov-order-photo-placeholder span {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .08em;
}

.rostov-order-photo-placeholder small {
  font-size: 10px;
}

.rostov-order-match {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.rostov-order-match.is-existing {
  background: var(--rostov-order-teal);
}

.rostov-order-match.is-new {
  background: var(--rostov-order-orange);
}

.rostov-order-card-body {
  display: grid;
  grid-template-rows: 50px minmax(64px, auto) 30px 146px 82px 86px 28px;
  gap: 8px;
  padding: 12px;
}

.rostov-order-card-body > .rostov-order-card-meta {
  align-content: flex-start;
  overflow: hidden;
}

.rostov-order-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.rostov-order-card-meta span,
.rostov-order-card-meta strong {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf3f7;
  color: #526575;
  font-size: 9px;
  font-weight: 800;
}

.rostov-order-card-meta strong {
  background: var(--rostov-order-blue);
  color: #fff;
  letter-spacing: .04em;
}

.rostov-order-card-meta .rostov-order-abc {
  min-width: 25px;
  text-align: center;
  letter-spacing: .06em;
}

.rostov-order-card-meta .rostov-order-abc.is-a {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(22, 163, 74, .3);
}

.rostov-order-card-meta .rostov-order-abc.is-b {
  background: #fbbf24;
  color: #422006;
  box-shadow: 0 2px 6px rgba(245, 158, 11, .34);
}

.rostov-order-card-meta .rostov-order-abc.is-c {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .3);
}

.rostov-order-card-meta .is-existing {
  background: #dff5eb;
  color: #12614e;
}

.rostov-order-card-meta .is-new {
  background: #fff0d8;
  color: #9a5800;
}

.rostov-order-card h2 {
  min-height: 64px;
  margin: 0;
  color: #203544;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rostov-order-category {
  height: 30px;
  min-height: 30px;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.rostov-order-live-metrics,
.rostov-order-prices,
.rostov-order-dialog-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.rostov-order-live-metrics > div,
.rostov-order-prices > div,
.rostov-order-dialog-metrics > div {
  min-width: 0;
  padding: 7px;
  border-radius: 8px;
  background: #f4f8fa;
}

.rostov-order-live-metrics span,
.rostov-order-live-metrics strong,
.rostov-order-prices span,
.rostov-order-prices strong,
.rostov-order-dialog-metrics span,
.rostov-order-dialog-metrics strong {
  display: block;
}

.rostov-order-live-metrics span,
.rostov-order-prices span,
.rostov-order-dialog-metrics span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.rostov-order-prices span {
  overflow-wrap: anywhere;
}

.rostov-order-live-metrics strong,
.rostov-order-prices strong,
.rostov-order-dialog-metrics strong {
  margin-top: 3px;
  color: #203544;
  font-size: 12px;
}

.rostov-order-spark {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-height: 68px;
  padding: 5px 7px 4px;
  border-radius: 7px;
  background: #f7fafc;
}

.rostov-order-spark-column {
  display: grid;
  grid-template-rows: 12px 37px 10px;
  gap: 1px;
  min-width: 0;
  text-align: center;
}

.rostov-order-spark-column b {
  overflow: hidden;
  color: #256b5b;
  font-size: 8px;
  font-weight: 800;
  line-height: 12px;
  text-overflow: ellipsis;
}

.rostov-order-spark-column > span {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid #b8d9d0;
}

.rostov-order-spark-column i {
  display: block;
  width: 100%;
  height: var(--bar-height, 2%);
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(to top, #4f9f8a, #8dd7bf);
  box-shadow: 0 1px 3px rgba(38, 121, 101, .2);
  transform-origin: center bottom;
  animation: rostov-order-bar-rise .55s ease-out both;
}

.rostov-order-spark-column small {
  color: #718391;
  font-size: 8px;
  font-weight: 700;
  line-height: 10px;
}

.rostov-order-new-note {
  min-height: 63px;
  padding: 11px;
  border: 1px dashed #efc27f;
  border-radius: 8px;
  background: #fff9ef;
}

.rostov-order-performance {
  display: grid;
  height: 146px;
  min-height: 146px;
  overflow: hidden;
}

.rostov-order-performance.is-existing {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.rostov-order-performance.is-new .rostov-order-new-note {
  height: 100%;
}

.rostov-order-prices > div {
  height: 82px;
}

.rostov-order-new-note strong,
.rostov-order-new-note span {
  display: block;
}

.rostov-order-new-note strong {
  color: #9a5800;
  font-size: 12px;
}

.rostov-order-new-note span {
  margin-top: 3px;
  color: #8a6a3a;
  font-size: 10px;
}

.rostov-order-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px 38px;
  gap: 8px;
}

.rostov-order-quantity-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #b9cad5;
  border-radius: 8px;
}

.rostov-order-quantity-control button,
.rostov-order-quantity-control input {
  min-width: 0;
  min-height: 38px;
  border: 0;
  background: #fff;
  text-align: center;
}

.rostov-order-quantity-control button {
  display: grid;
  place-items: center;
  color: var(--rostov-order-blue);
  font-size: 19px;
  font-weight: 800;
}

.rostov-order-quantity-control button:first-child {
  border-right: 1px solid #dce5eb;
}

.rostov-order-quantity-control button:last-child {
  border-left: 1px solid #dce5eb;
  background: #eaf3f8;
}

.rostov-order-quantity-control input {
  appearance: textfield;
  color: #203544;
  font-weight: 800;
}

.rostov-order-quantity-control input::-webkit-inner-spin-button,
.rostov-order-quantity-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.rostov-order-details {
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #b9cad5;
  border-radius: 8px;
  background: #f7fafc;
  color: #3c5668;
  font-size: 11px;
  font-weight: 750;
}

.rostov-order-source-link {
  display: block;
  min-height: 28px;
  overflow: hidden;
  color: #3c718f;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.rostov-order-source-link.is-empty {
  visibility: hidden;
}

.rostov-order-source-link:hover {
  text-decoration: underline;
}

.rostov-order-basket {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  width: min(390px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #cbd9e2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(23, 63, 95, .24);
  transition: width .18s ease, box-shadow .18s ease;
}

.rostov-order-basket.is-collapsed {
  width: min(245px, calc(100vw - 32px));
  border-color: #173f5f;
  background: var(--rostov-order-blue);
}

.rostov-order-basket-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 11px 14px;
  border: 0;
  background: var(--rostov-order-blue);
  color: #fff;
  text-align: left;
}

.rostov-order-basket-toggle span {
  color: #bed4e1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rostov-order-basket-toggle strong {
  overflow: hidden;
  font-size: 20px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rostov-order-basket-toggle i {
  font-size: 17px;
  font-style: normal;
  text-align: center;
  transition: transform .18s ease;
}

.rostov-order-basket:not(.is-collapsed) .rostov-order-basket-toggle i {
  transform: rotate(180deg);
}

.rostov-order-basket.is-collapsed .rostov-order-basket-panel {
  display: none;
}

.rostov-order-basket-panel {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.rostov-order-basket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--rostov-order-blue);
  color: #fff;
}

.rostov-order-basket-head span,
.rostov-order-basket-head strong {
  display: block;
}

.rostov-order-basket-head span {
  color: #bdd4e2;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.rostov-order-basket-head strong {
  margin-top: 2px;
  font-size: 18px;
}

.rostov-order-basket-head button {
  border: 0;
  background: transparent;
  color: #d9e8f0;
  font-size: 10px;
  font-weight: 750;
}

.rostov-order-basket-empty {
  padding: 26px 18px;
  color: var(--muted);
  text-align: center;
}

.rostov-order-basket-empty strong,
.rostov-order-basket-empty span {
  display: block;
}

.rostov-order-basket-empty strong {
  color: #385266;
}

.rostov-order-basket-empty span {
  margin-top: 4px;
  font-size: 11px;
}

.rostov-order-basket-list {
  max-height: min(46vh, 440px);
  overflow-y: auto;
}

.rostov-order-basket-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5ecf1;
}

.rostov-order-basket-line > div:first-child,
.rostov-order-basket-line-value {
  min-width: 0;
}

.rostov-order-basket-line strong,
.rostov-order-basket-line span {
  display: block;
}

.rostov-order-basket-line > div:first-child strong {
  color: var(--rostov-order-blue);
  font-size: 11px;
}

.rostov-order-basket-line > div:first-child span {
  overflow: hidden;
  margin-top: 2px;
  color: #536675;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rostov-order-basket-line-value {
  text-align: right;
}

.rostov-order-basket-line-value strong {
  color: #203544;
  font-size: 10px;
}

.rostov-order-basket-line-value span {
  color: var(--muted);
  font-size: 9px;
}

.rostov-order-basket-line button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f3f6f8;
  color: #8b98a2;
}

.rostov-order-basket-totals {
  display: grid;
  gap: 8px;
  padding: 14px 16px 10px;
  border-top: 1px solid #dce5eb;
}

.rostov-order-basket-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rostov-order-basket-totals span {
  color: var(--muted);
  font-size: 11px;
}

.rostov-order-basket-totals strong {
  color: var(--rostov-order-blue);
  font-size: 14px;
}

.rostov-order-history {
  margin: 0 16px 10px;
  border: 1px solid #d6e1e8;
  border-radius: 9px;
  background: #f7fafc;
}

.rostov-order-history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #31566d;
  font-size: 11px;
  font-weight: 800;
}

.rostov-order-history-toggle i {
  font-size: 16px;
  font-style: normal;
  transition: transform .18s ease;
}

.rostov-order-history-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.rostov-order-history-panel {
  padding: 0 8px 8px;
  border-top: 1px solid #dce5eb;
}

.rostov-order-history-panel > small {
  display: block;
  padding: 8px 4px 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.rostov-order-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #29475b;
  text-align: left;
}

.rostov-order-history-item + .rostov-order-history-item {
  margin-top: 5px;
}

.rostov-order-history-item:hover {
  background: #eaf3f8;
}

.rostov-order-history-item > span:last-child {
  text-align: right;
}

.rostov-order-history-item strong,
.rostov-order-history-item small {
  display: block;
}

.rostov-order-history-item strong {
  font-size: 10px;
}

.rostov-order-history-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.rostov-order-export {
  width: calc(100% - 32px);
  margin: 4px 16px 8px;
  padding: 12px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--rostov-order-teal);
  color: #fff;
  font-weight: 800;
}

.rostov-order-export:disabled {
  background: #aab8c2;
  cursor: not-allowed;
}

.rostov-order-basket-panel > small {
  display: block;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.rostov-order-basket-panel > small.rostov-order-draft-status.is-saved {
  padding-bottom: 5px;
  color: #17705e;
  font-weight: 750;
}

.rostov-order-basket-panel > small.rostov-order-draft-status.is-saved::before {
  content: "✓ ";
}

.rostov-order-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.rostov-order-pagination button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #bdccd6;
  border-radius: 8px;
  background: #fff;
  color: #385266;
  font-weight: 750;
}

.rostov-order-pagination span {
  color: var(--muted);
  font-size: 11px;
}

.rostov-order-dialog {
  width: min(920px, calc(100vw - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 35, 48, .28);
}

.rostov-order-dialog::backdrop {
  background: rgba(19, 40, 54, .55);
  backdrop-filter: blur(3px);
}

.rostov-order-dialog-close {
  position: sticky;
  z-index: 2;
  top: 10px;
  float: right;
  width: 34px;
  height: 34px;
  margin: 10px 10px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf3f6;
  color: #365166;
  font-size: 22px;
}

.rostov-order-dialog > div {
  padding: 24px;
}

.rostov-order-dialog-head {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-right: 38px;
}

.rostov-order-dialog-head img {
  width: 190px;
  height: 160px;
  object-fit: contain;
}

.rostov-order-dialog-head h2 {
  margin: 10px 0 6px;
  color: var(--rostov-order-blue);
  font-size: 23px;
  line-height: 1.3;
}

.rostov-order-dialog-head p {
  margin: 0;
  color: var(--muted);
}

.rostov-order-dialog-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #dfe7ec;
}

.rostov-order-dialog-section h3 {
  margin: 0 0 12px;
  color: #29475b;
  font-size: 15px;
}

.rostov-order-dialog-section p {
  margin: 7px 0;
  color: #415766;
  font-size: 12px;
  line-height: 1.55;
}

.rostov-order-dialog-section p small {
  display: block;
  color: var(--muted);
}

.rostov-order-description {
  max-height: 300px;
  overflow-y: auto;
  padding: 13px;
  border-radius: 9px;
  background: #f7fafc;
}

.rostov-order-month-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 170px;
  overflow-x: auto;
  padding: 12px 8px 8px;
  border-radius: 10px;
  background: #f7fafc;
}

.rostov-order-month-chart > div {
  display: grid;
  gap: 4px;
  min-width: 34px;
  text-align: center;
}

.rostov-order-month-chart > div > span {
  display: flex;
  align-items: flex-end;
  height: 105px;
}

.rostov-order-month-chart i {
  display: block;
  width: 100%;
  height: var(--bar-height, 2%);
  min-height: 2px;
  border-radius: 5px 5px 1px 1px;
  background: linear-gradient(to top, #267965, #8dd7bf);
  transform-origin: center bottom;
  animation: rostov-order-bar-rise .65s ease-out both;
}

@keyframes rostov-order-bar-rise {
  from {
    opacity: .25;
    transform: scaleY(0);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.rostov-order-month-chart strong {
  color: #29475b;
  font-size: 9px;
}

.rostov-order-month-chart small {
  color: var(--muted);
  font-size: 8px;
}

.rostov-order-dialog-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
}

@media (max-width: 1500px) {
  .rostov-order-filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .rostov-order-search {
    grid-column: span 2;
  }

  .rostov-order-reset {
    width: 100%;
  }

}

@media (min-width: 1061px) and (max-width: 1180px) {
  .rostov-order-category-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .rostov-order-basket {
    right: 16px;
    bottom: 16px;
  }

  .rostov-order-basket-list {
    max-height: 260px;
  }
}

@media (max-width: 820px) {
  .rostov-order-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .rostov-order-source {
    min-width: 0;
    width: 100%;
  }

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

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

  .rostov-order-category-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rostov-order-search {
    grid-column: 1 / -1;
  }

  .rostov-order-dialog-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .rostov-order-summary,
  .rostov-order-filters,
  .rostov-order-category-products {
    grid-template-columns: 1fr;
  }

  .rostov-order-search {
    grid-column: auto;
  }

  .rostov-order-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rostov-order-card-photo {
    height: 210px;
  }

  .rostov-order-card-body {
    grid-template-rows: auto;
  }

  .rostov-order-card h2,
  .rostov-order-category,
  .rostov-order-performance {
    height: auto;
  }

  .rostov-order-card h2,
  .rostov-order-category {
    min-height: 0;
  }

  .rostov-order-basket {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .rostov-order-basket.is-collapsed {
    width: min(220px, calc(100vw - 20px));
  }

  .rostov-order-dialog > div {
    padding: 18px;
  }

  .rostov-order-dialog-head {
    grid-template-columns: 1fr;
    padding-right: 0;
  }

  .rostov-order-dialog-head img {
    width: 100%;
    height: 190px;
  }
}

* {
  box-sizing: border-box;
}

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

body.auth-body {
  min-height: 100vh;
  background: #050817;
}

.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--panel-border);
}

.auth-body .app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  background: linear-gradient(180deg, rgb(3 7 18 / 72%), rgb(3 7 18 / 36%));
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  backdrop-filter: blur(18px) saturate(1.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.auth-body .brand {
  color: #f8fafc;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

@media (min-width: 761px) {
  body:not(.auth-body) .app-header > .header-left {
    flex: 1 1 auto;
    width: 0;
  }

  body:not(.auth-body) .app-header .brand {
    flex: 0 0 auto;
  }

  body:not(.auth-body) .app-header .top-nav {
    flex: 1 1 auto;
    width: 0;
  }

  body:not(.auth-body) .app-header > .header-right {
    flex: 0 0 auto;
    margin-left: 12px;
  }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.auth-body .brand-mark {
  background: linear-gradient(135deg, #0f766e, #0891b2);
  box-shadow: 0 12px 30px rgb(15 118 110 / 28%);
}

.brand-name {
  font-size: 17px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.top-nav a,
.top-nav button,
.user-menu > button,
.user-menu-panel a,
.user-menu-panel button {
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}


.nav-button-avito {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.nav-icon-avito {
  display: inline-block;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.top-nav a.active,
.top-nav a:hover,
.top-nav button.active,
.top-nav button:hover,
.user-menu > button.active,
.user-menu > button:hover {
  background: #ecfdf5;
  color: var(--accent-strong);
}

.nav-group {
  position: relative;
}

.nav-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 14px 35px rgb(15 23 42 / 12%);
  z-index: 20;
}

.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  display: block;
}

.nav-menu a {
  display: block;
}

.nav-menu-more {
  min-width: 230px;
}

.nav-menu-section-title {
  padding: 8px 10px 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav-menu-section-title:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.nav-menu a.nav-menu-link-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu a.nav-menu-subitem {
  padding-left: 20px;
}

.user-menu {
  position: relative;
}

.user-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.user-menu > button {
  border: 1px solid var(--panel-border);
}

.user-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 14px 35px rgb(15 23 42 / 12%);
  z-index: 20;
}

.user-menu:hover .user-menu-panel,
.user-menu:focus-within .user-menu-panel {
  display: block;
}

.nav-group.is-open .nav-menu,
.user-menu.is-open .user-menu-panel {
  display: block;
}

.mobile-header-menu-panel[hidden] {
  display: none !important;
}

.mobile-header-menu-panel {
  position: fixed;
  top: var(--mobile-header-menu-top, 96px);
  left: 10px;
  right: 10px;
  z-index: 200;
  max-height: calc(100vh - var(--mobile-header-menu-top, 96px) - 10px);
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgb(15 23 42 / 18%);
}

.mobile-header-menu-panel a,
.mobile-header-menu-panel form,
.mobile-header-menu-panel button {
  width: 100%;
}

.mobile-header-menu-panel form {
  margin: 0;
}

.mobile-header-menu-panel a,
.mobile-header-menu-panel button {
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.mobile-header-menu-panel a.active,
.mobile-header-menu-panel a:hover,
.mobile-header-menu-panel button:hover {
  background: #ecfdf5;
  color: var(--accent-strong);
}

.mobile-header-menu-panel select {
  width: 100%;
  min-height: 36px;
  margin: 0 0 6px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.user-menu-panel a,
.user-menu-panel form,
.user-menu-panel button {
  width: 100%;
}

.user-menu-panel form {
  margin: 0;
}

.user-menu-panel a,
.user-menu-panel button {
  display: block;
  text-align: left;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: #ecfdf5;
  color: var(--accent-strong);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.data-freshness-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.data-freshness-light {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgb(148 163 184 / 16%);
}

.data-freshness-indicator.is-fresh {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.data-freshness-indicator.is-fresh .data-freshness-light {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgb(22 163 74 / 16%);
}

.data-freshness-indicator.is-stale {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.data-freshness-indicator.is-stale .data-freshness-light {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgb(220 38 38 / 16%);
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 28px;
}

.auth-page-shell {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.blank-page {
  min-height: calc(100vh - 120px);
}

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

.breadcrumbs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breadcrumbs-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  white-space: nowrap;
}

.breadcrumbs a,
.breadcrumbs span {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent-strong);
}

.breadcrumbs span:last-child {
  color: var(--text);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

h2 {
  font-size: 18px;
}

.status-pill {
  border: 1px solid #b7e4d6;
  background: #ecfdf5;
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

.metric-card,
.work-panel,
.table-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  box-shadow: var(--panel-raised-shadow);
}

.metric-card {
  padding: 18px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.metric-card p,
.work-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-page {
  display: grid;
  gap: 18px;
}

.dashboard-title {
  align-items: center;
  margin-bottom: 0;
}

.dashboard-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-status span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.dashboard-status.is-fresh {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.dashboard-status.is-fresh span {
  background: #16a34a;
}

.dashboard-status.is-stale {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.dashboard-status.is-stale span {
  background: #dc2626;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-metric-card {
  display: grid;
  min-height: 190px;
  min-width: 0;
  align-content: space-between;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-metric-card--sales {
  border-top: 4px solid #2563eb;
}

.dashboard-metric-card--shipping {
  border-top: 4px solid #16a34a;
}

.dashboard-metric-card--purchase {
  border-top: 4px solid #d97706;
}

.dashboard-metric-card--receipt {
  border-top: 4px solid #0891b2;
}

.dashboard-logistics-panel {
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr);
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-logistics-head,
.dashboard-logistics-stat {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.dashboard-logistics-head {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border-top: 4px solid #7c3aed;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
}

.dashboard-logistics-head strong {
  color: var(--text);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.08;
}

.dashboard-logistics-head small,
.dashboard-logistics-stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-logistics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.dashboard-logistics-stat {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
}

.dashboard-logistics-stat + .dashboard-logistics-stat {
  border-left: 1px solid var(--line);
}

.dashboard-logistics-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-logistics-stat strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(25px, 2.8vw, 34px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.dashboard-logistics-stat--amount strong {
  color: #6d28d9;
  font-size: clamp(20px, 2.3vw, 29px);
}

.dashboard-logistics-head:hover strong,
.dashboard-logistics-stat:hover strong {
  color: var(--accent-strong);
}

@media (max-width: 760px) {
  .dashboard-logistics-panel {
    grid-template-columns: 1fr;
    border-radius: 10px;
  }

  .dashboard-logistics-head {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }

  .dashboard-logistics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-logistics-stat {
    padding: 14px;
  }

  .dashboard-logistics-stat + .dashboard-logistics-stat {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.dashboard-metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-metric-primary {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.dashboard-metric-card strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.dashboard-metric-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-metric-primary:hover strong,
.dashboard-metric-total:hover b {
  color: var(--accent-strong);
}

.dashboard-metric-total {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

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

.dashboard-metric-total b {
  min-width: 0;
  color: var(--text);
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: 1.15;
  overflow-wrap: normal;
}

.money-value {
  white-space: nowrap;
}

.dashboard-money-panel {
  display: grid;
  grid-template-columns: minmax(260px, .48fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-money-head {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-top: 4px solid #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-money-head strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.08;
}

.dashboard-money-head small,
.dashboard-money-item small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.dashboard-money-item {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  border-top: 4px solid #cbd5e1;
}

.dashboard-money-item + .dashboard-money-item {
  border-left: 1px solid var(--line);
}

.dashboard-money-item--cash {
  border-top-color: #16a34a;
}

.dashboard-money-item--noncash {
  border-top-color: #0891b2;
}

.dashboard-money-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-money-item b {
  min-width: 0;
  color: var(--text);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.1;
}

.dashboard-money-item:hover b {
  color: var(--accent-strong);
}

.dashboard-reserve-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .28fr);
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-reserve-link {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border-top: 4px solid #dc2626;
  color: inherit;
  text-decoration: none;
}

.dashboard-reserve-link span,
.dashboard-reserve-aside span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-reserve-link strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.08;
}

.dashboard-reserve-link small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-reserve-link:hover strong {
  color: var(--accent-strong);
}

.dashboard-reserve-aside {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
  border-top: 4px solid #d97706;
  background: #fbfdff;
}

.dashboard-reserve-aside b {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.dashboard-profit-panel {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) repeat(3, minmax(170px, .34fr));
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-profit-main,
.dashboard-profit-cell {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border-top: 4px solid #16a34a;
}

.dashboard-profit-cell {
  border-left: 1px solid var(--line);
  border-top-color: #2563eb;
  background: #fbfdff;
}

.dashboard-profit-cell + .dashboard-profit-cell {
  border-top-color: #0891b2;
}

.dashboard-profit-expenses {
  border-top-color: #dc2626;
}

.dashboard-profit-main span,
.dashboard-profit-cell span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-profit-main strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.08;
}

.dashboard-profit-main--split {
  align-content: stretch;
}

.dashboard-profit-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.dashboard-profit-breakdown > div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  background: #ffffff;
  padding: 10px;
}

.dashboard-profit-breakdown > div > span {
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-profit-breakdown > div > strong {
  font-size: clamp(17px, 1.8vw, 24px);
  overflow-wrap: anywhere;
}

.dashboard-profit-main--split > small {
  line-height: 1.35;
}

.dashboard-profit-cell b {
  min-width: 0;
  color: var(--text);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.1;
}

.dashboard-profit-main small,
.dashboard-profit-cell small,
.dashboard-profit-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-profit-link {
  width: fit-content;
  text-decoration: none;
}

.dashboard-profit-link:hover,
.dashboard-profit-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.dashboard-report-panel {
  display: grid;
  grid-template-columns: minmax(260px, .36fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-report-main {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border-top: 4px solid #4f46e5;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-report-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-report-main strong {
  color: var(--text);
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.08;
}

.dashboard-report-download,
.dashboard-report-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-report-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-top: 4px solid #0f766e;
}

.dashboard-report-recipients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  min-width: 0;
}

.dashboard-report-recipient {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.dashboard-report-recipient input {
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.dashboard-report-recipient span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-report-recipient small,
.dashboard-report-empty,
.dashboard-report-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.dashboard-report-actions button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.dashboard-report-actions span {
  min-width: 0;
  text-align: right;
}

.dashboard-report-actions span.is-progress {
  color: var(--muted);
}

.dashboard-report-actions span.is-success {
  color: #166534;
}

.dashboard-report-actions span.is-error {
  color: #991b1b;
}


.dashboard-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 0;
  border-radius: 6px;
  color: var(--muted);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-tab:hover,
.dashboard-tab:focus-visible {
  color: var(--accent-strong);
  background: #eef6ff;
}

.dashboard-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.dashboard-operational-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.dashboard-operational-toolbar > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-operational-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-operational-toolbar strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}

.dashboard-operational-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.dashboard-operational-period a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-operational-period a:hover,
.dashboard-operational-period a:focus-visible {
  color: var(--accent-strong);
  background: #eef6ff;
}

.dashboard-operational-period a.is-active {
  background: var(--accent);
  color: #ffffff;
}

.trade-reps-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.trade-reps-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.trade-reps-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.trade-reps-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.trade-reps-heading span,
.trade-rep-header span,
.trade-rep-kpi span,
.trade-rep-stat span,
.trade-rep-gap-list span,
.trade-rep-group-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-reps-period-panel {
  display: grid;
  justify-items: end;
  gap: 9px;
  min-width: 0;
}

.trade-reps-period-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.trade-reps-period-switch a,
.trade-reps-period-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
  color: var(--muted);
  padding: 8px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.trade-reps-period-switch a.is-active,
.trade-reps-period-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.trade-reps-period-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.trade-reps-period-form label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-reps-period-form input {
  min-height: 36px;
  max-width: 145px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.trade-reps-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.trade-rep-block {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.trade-rep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 18px 18px 0;
}

.trade-rep-header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trade-rep-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.trade-rep-header b {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 45%;
  overflow: hidden;
  border-radius: 6px;
  background: color-mix(in srgb, var(--rep-accent) 12%, white);
  color: var(--rep-accent);
  padding: 7px 10px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-rep-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  border-top: 4px solid var(--rep-accent);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.trade-rep-kpi,
.trade-rep-stat {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  background: #ffffff;
  padding: 14px;
}

.dashboard-body .trade-rep-kpi.is-split {
  padding: 0;
}

.trade-metric-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  min-height: 100%;
  background: var(--line);
}

.trade-metric-split-part {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  background: #ffffff;
  color: inherit;
  padding: 12px 10px;
  text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.trade-metric-split-part + .trade-metric-split-part {
  border-left: 1px solid var(--line);
}

.trade-metric-split-part span {
  line-height: 1.2;
}

.trade-rep-kpi .trade-metric-split-part strong {
  font-size: clamp(14px, 1.15vw, 18px);
  letter-spacing: -.02em;
}

.trade-metric-split-part small {
  font-size: 11px;
}

.trade-metric-split-part.is-clickable:hover,
.trade-metric-split-part.is-clickable:focus-visible {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--rep-accent) 6%, white);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rep-accent) 35%, transparent);
  outline: none;
}

.trade-rep-kpi strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.trade-rep-kpi small,
.trade-rep-stat small,
.trade-rep-group-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.trade-rep-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  background: var(--line);
}

.trade-rep-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  background: #fbfdff;
  padding: 16px 18px 18px;
}

.trade-rep-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.15;
}

.trade-rep-panel--assortment,
.trade-rep-panel--focus {
  grid-column: 1 / -1;
}

.trade-rep-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trade-rep-stat-grid--clients,
.trade-rep-stat-grid--debt {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trade-rep-stat-grid--assortment {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trade-rep-stat-grid--focus {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trade-rep-focus-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.trade-rep-focus-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.trade-rep-focus-row h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.trade-rep-stat strong {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.trade-rep-stat--revenue,
.trade-rep-kpi--revenue {
  border-top: 3px solid #2563eb;
}

.trade-rep-stat--profit,
.trade-rep-kpi--profit {
  border-top: 3px solid #16a34a;
}

.trade-rep-stat--margin,
.trade-rep-kpi--margin,
.trade-rep-stat--customer,
.trade-rep-kpi--customer {
  border-top: 3px solid #0f766e;
}

.trade-rep-stat--plan,
.trade-rep-kpi--plan,
.trade-rep-stat--assortment,
.trade-rep-kpi--assortment {
  border-top: 3px solid #d97706;
}

.trade-rep-stat--risk,
.trade-rep-kpi--risk {
  border-top: 3px solid #be123c;
}

.trade-rep-stat--debt,
.trade-rep-kpi--debt {
  border-top: 3px solid #4f46e5;
}

.trade-rep-bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.trade-rep-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rep-accent);
}

.trade-rep-gap-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.trade-rep-gap-list > div,
.trade-rep-gap-list > a {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trade-rep-gap-list strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.1;
}

.trade-rep-group-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trade-rep-group-list li {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trade-rep-group-list div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.trade-rep-group-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-rep-group-list b {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.trade-rep-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .trade-rep-kpis,
  .trade-rep-stat-grid,
  .trade-rep-stat-grid--clients,
  .trade-rep-stat-grid--debt,
  .trade-rep-stat-grid--assortment,
  .trade-rep-stat-grid--focus,
  .trade-rep-group-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-rep-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .manager-salary-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-tabs,
  .dashboard-operational-toolbar,
  .trade-reps-toolbar,
  .trade-rep-header,
  .trade-reps-period-panel,
  .trade-reps-period-switch,
  .trade-reps-period-form {
    width: 100%;
  }

  .dashboard-tabs,
  .dashboard-operational-toolbar,
  .trade-reps-toolbar,
  .trade-rep-header {
    align-items: stretch;
  }

  .dashboard-tabs,
  .dashboard-operational-toolbar,
  .trade-reps-toolbar,
  .trade-rep-header {
    flex-direction: column;
  }

  .dashboard-tab,
  .dashboard-operational-period a,
  .trade-reps-period-switch a,
  .trade-reps-period-form button {
    width: 100%;
  }

  .trade-reps-period-panel,
  .trade-reps-period-switch,
  .trade-reps-period-form {
    justify-items: stretch;
    justify-content: stretch;
  }

  .trade-reps-period-form label,
  .trade-reps-period-form input {
    width: 100%;
    max-width: none;
  }

  .trade-rep-header b {
    max-width: none;
  }

  .trade-rep-kpis,
  .trade-rep-stat-grid,
  .trade-rep-stat-grid--clients,
  .trade-rep-stat-grid--debt,
  .trade-rep-stat-grid--assortment,
  .trade-rep-stat-grid--focus,
  .trade-rep-gap-list,
  .trade-rep-group-list {
    grid-template-columns: 1fr;
  }

  .trade-metric-split {
    grid-template-columns: 1fr;
  }

  .trade-metric-split-part + .trade-metric-split-part {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Forward planning: keep future and next-trip baskets editable while release remains guarded. */
.logistics-filter-date {
  grid-template-rows: auto auto auto;
}

.logistics-date-shortcuts {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 5px;
  margin-top: 2px;
  color: inherit !important;
  text-transform: none !important;
}

.logistics-date-shortcuts button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 24px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-date-shortcuts button.active {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #0f766e;
}

.logistics-planning-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.logistics-planning-pill.state-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.logistics-planning-pill.state-waiting_return,
.logistics-planning-pill.state-waiting_trip,
.logistics-planning-pill.state-future {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.logistics-planning-pill.state-past,
.logistics-planning-pill.state-unavailable {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.logistics-route-card.is-waiting-release,
.workspace-route-row.is-waiting-release {
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 18%);
}

.logistics-route-planning-note {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  padding: 6px 8px;
}

.logistics-route-planning-note.state-past,
.logistics-route-planning-note.state-unavailable {
  background: #f1f5f9;
  color: #64748b;
}

.logistics-cross-date-assignments {
  margin: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.logistics-cross-date-assignments > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  padding: 8px 10px;
}

.logistics-cross-date-assignments > div {
  display: grid;
  gap: 7px;
  border-top: 1px solid #dbeafe;
  padding: 8px;
}

.logistics-cross-date-assignments article {
  display: grid;
  gap: 5px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
}

.logistics-cross-date-assignments article > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.logistics-cross-date-assignments article > span strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-cross-date-assignments article > small {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.logistics-cross-date-assignments form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.logistics-cross-date-assignments select,
.logistics-cross-date-assignments button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #ffffff;
  color: #1e3a8a;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  padding: 5px 7px;
}

.logistics-cross-date-assignments button {
  cursor: pointer;
}

.logistics-cross-date-assignments article > a {
  width: fit-content;
  color: #2563eb;
  font-size: 10px;
  font-weight: 850;
}

.logistics-cross-date-assignments.is-workspace {
  margin-top: auto;
}

@media (max-width: 760px) {
  .logistics-date-shortcuts button {
    min-height: 32px;
  }

  .logistics-cross-date-assignments form {
    grid-template-columns: 1fr;
  }
}


.logistics-vehicle-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.logistics-vehicle-directory-table {
  min-width: 1240px;
}

.logistics-vehicle-directory-table tr.is-inactive > td {
  background: #f8fafc;
  color: #64748b;
}

.logistics-vehicle-name-cell {
  display: flex;
  min-width: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logistics-vehicle-name-cell > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-vehicle-name-cell strong,
.logistics-vehicle-name-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-vehicle-name-cell small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.logistics-vehicle-edit-button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #f0fdfa;
  color: #0f766e;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  padding: 5px 8px;
}

.logistics-vehicle-edit-button:hover,
.logistics-vehicle-edit-button:focus-visible {
  border-color: #14b8a6;
  background: #ccfbf1;
  outline: none;
}

.logistics-vehicle-edit-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 24px 80px rgb(15 23 42 / 28%);
  padding: 0;
}

.logistics-vehicle-edit-dialog::backdrop {
  background: rgb(15 23 42 / 52%);
  backdrop-filter: blur(2px);
}

.logistics-vehicle-edit-form > header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  background: rgb(255 255 255 / 96%);
  padding: 14px 18px;
}

.logistics-vehicle-edit-form > header small {
  color: #0f766e;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-vehicle-edit-form > header h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.logistics-vehicle-edit-form > header button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
}

.logistics-vehicle-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.logistics-vehicle-edit-grid label {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.logistics-vehicle-edit-grid label > span:first-child {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-vehicle-edit-grid input,
.logistics-vehicle-edit-grid select,
.logistics-vehicle-edit-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  padding: 9px 10px;
}

.logistics-vehicle-edit-grid input,
.logistics-vehicle-edit-grid select {
  min-height: 40px;
}

.logistics-vehicle-edit-grid textarea {
  resize: vertical;
}

.logistics-vehicle-edit-grid input:focus,
.logistics-vehicle-edit-grid select:focus,
.logistics-vehicle-edit-grid textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgb(20 184 166 / 12%);
  outline: none;
}

.logistics-vehicle-edit-grid .is-wide {
  grid-column: span 2;
}

.logistics-vehicle-active-toggle > span:last-child {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.logistics-vehicle-active-toggle input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: #16a34a;
}

.logistics-vehicle-edit-help {
  margin: 0 18px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  padding: 9px 11px;
}

.logistics-vehicle-edit-form > footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid #e2e8f0;
  background: rgb(255 255 255 / 96%);
  padding: 12px 18px;
}

.logistics-vehicle-edit-form > footer button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 9px 14px;
}

.logistics-vehicle-edit-form > footer .ghost-button {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
}

@media (max-width: 900px) {
  .logistics-vehicle-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .logistics-vehicle-edit-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .logistics-vehicle-edit-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .logistics-vehicle-edit-grid .is-wide {
    grid-column: auto;
  }

  .logistics-vehicle-edit-help {
    margin: 0 14px;
  }
}




.trade-reps-settings-link {
  width: fit-content;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.trade-reps-settings-link:hover,
.trade-reps-settings-link:focus-visible {
  text-decoration: underline;
}

.trade-settings-month {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 14px;
}

.trade-settings-month a,
.trade-settings-month button,
.trade-settings-plan-form button,
.trade-settings-focus-form button,
.trade-settings-focus-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.trade-settings-month a {
  width: 38px;
  padding: 0;
  font-size: 20px;
}

.trade-settings-month label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-settings-month input,
.trade-settings-plan-row input,
.trade-settings-focus-form select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
}

.trade-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 14px;
  min-width: 0;
}

.trade-settings-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.trade-settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.trade-settings-panel-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trade-settings-panel-head span,
.trade-settings-plan-row span,
.trade-settings-plan-row small,
.trade-settings-focus-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-settings-panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.trade-settings-panel-head strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.trade-settings-plan-form,
.trade-settings-focus-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.trade-settings-plan-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trade-settings-plan-row {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(180px, 1fr) minmax(120px, .45fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: #fbfdff;
  padding: 12px;
}

.trade-settings-plan-row span,
.trade-settings-plan-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-settings-plan-row input {
  text-align: right;
}

.trade-settings-focus-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.trade-settings-focus-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.trade-settings-focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.trade-settings-focus-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trade-settings-focus-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-settings-focus-row button {
  min-height: 34px;
  background: #f1f5f9;
  color: var(--muted);
}

@media (max-width: 920px) {
  .trade-settings-layout,
  .trade-settings-plan-row,
  .trade-settings-focus-form,
  .trade-settings-focus-row {
    grid-template-columns: 1fr;
  }

  .trade-settings-plan-row input {
    text-align: left;
  }
}


.work-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.primary-link,
.toolbar button {
  border: 0;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 11px 12px;
  font-size: 15px;
}

.toolbar select {
  min-width: 150px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0 10px;
}

.document-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, .25fr) minmax(150px, .25fr) auto auto;
  align-items: end;
}

.document-toolbar .document-search {
  width: 100%;
}

.toolbar-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.toolbar-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toolbar-field input {
  width: 100%;
}

.secondary-link {
  align-items: center;
  align-self: stretch;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--accent-strong);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  background: #ecfdf5;
}

.products-toolbar {
  align-items: center;
}

.recommendations-toolbar {
  align-items: stretch;
  flex-wrap: wrap;
}

.recommendations-toolbar > input[name="q"] {
  flex: 1 1 260px;
}

.recommendations-toolbar label {
  display: grid;
  min-width: 86px;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.recommendations-toolbar label input {
  min-width: 76px;
  width: 86px;
  padding: 8px 9px;
  font-size: 14px;
}

.recommendations-toolbar .checkbox-field {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  min-height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  text-transform: none;
}

.recommendations-toolbar .checkbox-field input {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
}

.mode-toggle,
.mode-switch {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-toggle {
  gap: 8px;
  padding: 0 12px;
}

.mode-toggle input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.mode-switch {
  overflow: hidden;
}

.mode-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
}

.mode-switch a.active {
  background: #ecfdf5;
  color: var(--accent-strong);
}

.table-panel {
  overflow: visible;
}

.analytics-section {
  margin-top: 18px;
}

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

.payments-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(148px, .25fr) minmax(140px, .22fr) repeat(2, minmax(138px, .2fr)) auto auto;
  align-items: end;
}

.payments-toolbar .payments-search {
  width: 100%;
}

.payments-toolbar .secondary-link {
  min-height: 42px;
}

.finance-table-wrap table {
  min-width: 1680px;
}

.finance-table th:nth-child(1),
.finance-table td:nth-child(1) {
  width: 132px;
}

.finance-table th:nth-child(2),
.finance-table td:nth-child(2) {
  min-width: 230px;
  white-space: normal;
}

.finance-table th:nth-child(5),
.finance-table td:nth-child(5),
.finance-table th:nth-child(9),
.finance-table td:nth-child(9) {
  min-width: 260px;
  white-space: normal;
}

.finance-lines-wrap table {
  min-width: 1240px;
}

.finance-lines-table th:nth-child(3),
.finance-lines-table td:nth-child(3),
.finance-lines-table th:nth-child(4),
.finance-lines-table td:nth-child(4),
.finance-lines-table th:nth-child(8),
.finance-lines-table td:nth-child(8) {
  min-width: 260px;
  white-space: normal;
}

.receivables-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.receivables-source-panel {
  margin-bottom: 4px;
}

.receivables-toolbar {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) 160px 190px 88px 118px 118px;
  align-items: stretch;
  gap: 8px;
  margin: 10px 0 12px;
  max-width: 1012px;
}

.receivables-toolbar .logistics-filter-field {
  min-width: 0;
  padding: 6px 10px 7px;
}

.receivables-toolbar .receivables-search-field {
  min-width: 280px;
}

.receivables-toolbar .receivables-days-field {
  min-width: 88px;
}

.receivables-toolbar .logistics-filter-field > span {
  font-size: 9px;
  letter-spacing: 0;
}

.receivables-toolbar .logistics-filter-field select,
.receivables-toolbar .logistics-filter-field input {
  font-size: 14px;
  line-height: 1.15;
}

.receivables-toolbar button {
  min-height: 44px;
  width: 118px;
  padding: 9px 14px;
}

.receivables-check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: 118px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
  overflow: hidden;
  white-space: nowrap;
}

.receivables-check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.receivables-toolbar .receivables-search-field::before {
  background: #14b8a6;
}

.receivables-toolbar .receivables-search-field input {
  font-weight: 900;
}

.receivables-client .table-summary span:first-child {
  display: grid;
  gap: 4px;
}

.receivables-client .table-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receivables-table-note {
  border-top: 1px solid var(--line);
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}

.receivables-client-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.receivables-client-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  background: #fbfdff;
}

.receivables-client-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receivables-client-summary strong {
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.receivables-table {
  min-width: 1180px;
}

.receivables-summary-table {
  table-layout: fixed;
  min-width: 1160px;
}

.receivables-summary-table .receivables-col-client {
  width: 185px;
}

.receivables-summary-table .receivables-col-money {
  width: 132px;
}

.receivables-summary-table .receivables-col-money-wide {
  width: 150px;
}

.receivables-summary-table .receivables-col-days {
  width: 104px;
}

.receivables-summary-table .receivables-col-next {
  width: 180px;
}

.receivables-summary-table .receivables-col-count {
  width: 82px;
}

.receivables-summary-table .receivables-col-dynamic {
  width: 40px;
}

.receivables-summary-table th,
.receivables-summary-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.receivables-summary-table .numeric-col {
  width: auto;
  max-width: none;
  overflow-wrap: normal;
}

.receivables-summary-table th.numeric-col {
  white-space: normal;
}

.receivables-summary-table td.numeric-col {
  white-space: nowrap;
}

.receivables-summary-table th:last-child {
  font-size: 11px;
  line-height: 1.05;
}

.receivables-inflow {
  color: #047857;
  font-weight: 900;
}

.receivables-outflow {
  color: #b91c1c;
  font-weight: 900;
}

.receivables-dynamic-head,
.receivables-dynamic-cell {
  width: 40px;
  max-width: 40px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
}

.receivables-dynamic {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.receivables-dynamic.is-down {
  background: #dcfce7;
  color: #047857;
}

.receivables-dynamic.is-up {
  background: #fee2e2;
  color: #b91c1c;
}

.receivables-dynamic.is-flat {
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
}

.receivables-table-wrap table:not(.receivables-summary-table) .numeric-col {
  width: 112px;
  max-width: 118px;
}

.receivables-table-wrap table:not(.receivables-summary-table) th:nth-child(3),
.receivables-table-wrap table:not(.receivables-summary-table) td:nth-child(3) {
  width: 180px;
  max-width: 180px;
}

.receivables-overdue-row td {
  background: #fff7ed;
}

.detail-table-panel {
  overflow: visible;
}

.analytics-section table {
  table-layout: fixed;
}

.analytics-section th,
.analytics-section td {
  overflow-wrap: anywhere;
}

.analytics-section .numeric-col {
  width: 120px;
  white-space: nowrap;
}

.analytics-section .table-actions {
  width: 190px;
}

.analytics-section > table th:first-child,
.analytics-section > table td:first-child {
  width: 24%;
}

.manager-contract-group table th:nth-child(1),
.manager-contract-group table td:nth-child(1) {
  width: 34%;
}

.manager-contract-group table th:nth-child(2),
.manager-contract-group table td:nth-child(2) {
  width: 22%;
}

.manager-contract-group table th:nth-child(5),
.manager-contract-group table td:nth-child(5),
.manager-contract-group table th:nth-child(6),
.manager-contract-group table td:nth-child(6) {
  width: 112px;
  white-space: nowrap;
}

.wide-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.wide-table-wrap table {
  min-width: 1760px;
}

.wide-table-wrap th,
.wide-table-wrap td {
  white-space: nowrap;
}

.wide-table-wrap td:nth-child(2),
.wide-table-wrap th:nth-child(2) {
  min-width: 340px;
  white-space: normal;
}

.analytics-table-wrap table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

.analytics-table-wrap {
  overflow: visible;
}

.analytics-table-wrap th,
.analytics-table-wrap td {
  box-sizing: border-box;
  max-width: 220px;
  overflow-wrap: anywhere;
  white-space: normal;
  vertical-align: top;
  padding: 10px 12px;
}

.analytics-table-wrap th {
  overflow-wrap: normal;
  white-space: normal;
}

.analytics-table-wrap .numeric-col {
  width: 88px;
  max-width: 96px;
  white-space: nowrap;
}

.analytics-table-wrap th.numeric-col {
  white-space: normal;
}

.analytics-table-wrap .col-date {
  width: 118px;
  max-width: 118px;
  white-space: normal;
}

.analytics-table-wrap .col-code {
  width: 88px;
  max-width: 88px;
  white-space: normal;
}

.analytics-table-wrap .col-doc {
  width: 100px;
  max-width: 100px;
  white-space: nowrap;
}

.analytics-table-wrap .col-group {
  width: 72px;
  max-width: 72px;
  white-space: nowrap;
}

.analytics-table-wrap .col-product {
  width: 330px;
  max-width: 330px;
}

.analytics-table-wrap td strong {
  line-height: 1.25;
}

.analytics-table-missing {
  min-width: 1080px;
}

.analytics-table-profit-check {
  min-width: 1120px;
}

.grouped-profit-table {
  min-width: 1680px;
}

.grouped-profit-table .col-product {
  width: 350px;
  max-width: 350px;
}

.grouped-profit-table .col-status {
  width: 190px;
}

.grouped-profit-table .numeric-col {
  width: 96px;
  max-width: 104px;
}

.analytics-table-price-jump {
  min-width: 1420px;
}

.analytics-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.abc-metrics {
  margin-top: 4px;
}

.abc-method-tabs {
  flex-wrap: wrap;
}

.abc-note-panel {
  margin-bottom: 14px;
}

.analytics-transfer-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 8px;
}

.transfer-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.transfer-table-wrap {
  max-height: clamp(420px, calc(100vh - 250px), 720px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.transfer-table-wrap table {
  table-layout: fixed;
}

.transfer-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.transfer-driver-table {
  min-width: 1680px;
}

.transfer-doc-table,
.transfer-product-table {
  min-width: 1320px;
}

.transfer-driver-table th,
.transfer-driver-table td,
.transfer-doc-table th,
.transfer-doc-table td,
.transfer-product-table th,
.transfer-product-table td {
  max-width: none;
  white-space: nowrap;
}

.transfer-driver-table th:nth-child(1),
.transfer-driver-table td:nth-child(1) {
  width: 160px;
  white-space: normal;
}

.transfer-driver-table th:nth-child(2),
.transfer-driver-table td:nth-child(2),
.transfer-driver-table th:nth-child(3),
.transfer-driver-table td:nth-child(3) {
  width: 78px;
}

.transfer-driver-table th:nth-child(4),
.transfer-driver-table td:nth-child(4),
.transfer-driver-table th:nth-child(5),
.transfer-driver-table td:nth-child(5),
.transfer-driver-table th:nth-child(6),
.transfer-driver-table td:nth-child(6),
.transfer-driver-table th:nth-child(7),
.transfer-driver-table td:nth-child(7),
.transfer-driver-table th:nth-child(8),
.transfer-driver-table td:nth-child(8),
.transfer-driver-table th:nth-child(9),
.transfer-driver-table td:nth-child(9) {
  width: 118px;
}

.transfer-driver-table th:nth-child(10),
.transfer-driver-table td:nth-child(10) {
  width: 170px;
}

.transfer-driver-table th:nth-child(11),
.transfer-driver-table td:nth-child(11),
.transfer-doc-table th:last-child,
.transfer-doc-table td:last-child {
  width: 330px;
  white-space: normal;
}

.transfer-doc-table th:nth-child(1),
.transfer-doc-table td:nth-child(1) {
  width: 110px;
}

.transfer-doc-table th:nth-child(2),
.transfer-doc-table td:nth-child(2),
.transfer-doc-table th:nth-child(3),
.transfer-doc-table td:nth-child(3) {
  width: 140px;
}

.transfer-product-table {
  min-width: 1520px;
}

.transfer-product-table th:nth-child(1),
.transfer-product-table td:nth-child(1) {
  width: 86px;
}

.transfer-product-table th:nth-child(2),
.transfer-product-table td:nth-child(2) {
  width: 86px;
}

.transfer-product-table th:nth-child(3),
.transfer-product-table td:nth-child(3) {
  width: 420px;
  white-space: normal;
}

.transfer-product-table th:nth-child(4),
.transfer-product-table td:nth-child(4),
.transfer-product-table th:nth-child(8),
.transfer-product-table td:nth-child(8),
.transfer-product-table th:nth-child(9),
.transfer-product-table td:nth-child(9) {
  width: 90px;
}

.transfer-product-table th:nth-child(5),
.transfer-product-table td:nth-child(5),
.transfer-product-table th:nth-child(6),
.transfer-product-table td:nth-child(6),
.transfer-product-table th:nth-child(7),
.transfer-product-table td:nth-child(7),
.transfer-product-table th:nth-child(10),
.transfer-product-table td:nth-child(10),
.transfer-product-table th:nth-child(11),
.transfer-product-table td:nth-child(11) {
  width: 118px;
}

.transfer-recommendation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
}

.transfer-recommendation-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.transfer-recommendation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.transfer-recommendation-head strong,
.transfer-recommendation-head small {
  display: block;
}

.transfer-recommendation-head small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.transfer-recommendation-wrap {
  max-height: none;
  overflow-x: visible;
  overflow-y: visible;
}

.transfer-recommendation-wrap table {
  table-layout: fixed;
  min-width: 0;
}

.transfer-recommendation-wrap th,
.transfer-recommendation-wrap td {
  max-width: none;
}

.transfer-recommendation-table {
  min-width: 0;
  width: 100%;
}

.transfer-recommendation-table th,
.transfer-recommendation-table td {
  max-width: none;
  white-space: nowrap;
}

.transfer-recommendation-table th:nth-child(1),
.transfer-recommendation-table td:nth-child(1) {
  width: 72px;
}

.transfer-recommendation-table th:nth-child(2),
.transfer-recommendation-table td:nth-child(2) {
  width: auto;
  white-space: normal;
}

.transfer-recommendation-table th:nth-child(3),
.transfer-recommendation-table td:nth-child(3),
.transfer-recommendation-table th:nth-child(4),
.transfer-recommendation-table td:nth-child(4),
.transfer-recommendation-table th:nth-child(5),
.transfer-recommendation-table td:nth-child(5),
.transfer-recommendation-table th:nth-child(6),
.transfer-recommendation-table td:nth-child(6),
.transfer-recommendation-table th:nth-child(7),
.transfer-recommendation-table td:nth-child(7) {
  width: 108px;
}

.calc-help {
  cursor: help;
  border-bottom: 1px dotted #64748b;
  outline: none;
}

.calc-help:focus-visible {
  border-radius: 4px;
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

.abc-summary-panel table {
  table-layout: fixed;
}

.abc-table-wrap {
  max-height: clamp(520px, calc(100vh - 235px), 760px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.abc-table-wrap .abc-table {
  min-width: 1220px;
}

.abc-table-wrap th,
.abc-table-wrap td {
  padding: 10px 10px;
}

.abc-table-wrap th {
  top: 0;
  z-index: 12;
}

.abc-table-wrap thead th:first-child {
  z-index: 13;
}

.abc-table-wrap .numeric-col {
  max-width: none;
}

.abc-table-wrap th:nth-child(1),
.abc-table-wrap td:nth-child(1) {
  width: 58px;
}

.abc-table-wrap th:nth-child(2),
.abc-table-wrap td:nth-child(2) {
  width: 62px;
}

.abc-table-wrap th:nth-child(3),
.abc-table-wrap td:nth-child(3) {
  width: 74px;
}

.abc-table-wrap .col-product {
  width: 300px;
  max-width: 300px;
}

.abc-table-wrap th:nth-child(5),
.abc-table-wrap td:nth-child(5) {
  width: 210px;
  max-width: 210px;
}

.abc-table-wrap th:nth-child(6),
.abc-table-wrap td:nth-child(6) {
  width: 136px;
}

.abc-table-wrap th:nth-child(7),
.abc-table-wrap td:nth-child(7) {
  width: 62px;
}

.abc-table-wrap th:nth-child(8),
.abc-table-wrap td:nth-child(8) {
  width: 86px;
}

.abc-table-wrap th:nth-child(9),
.abc-table-wrap td:nth-child(9) {
  width: 72px;
}

.abc-table-wrap th:nth-child(10),
.abc-table-wrap td:nth-child(10) {
  width: 64px;
}

.abc-table-wrap th:nth-child(11),
.abc-table-wrap td:nth-child(11) {
  width: 96px;
}

.abc-table-wrap .abc-matrix-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

.abc-table-wrap .abc-matrix-table th,
.abc-table-wrap .abc-matrix-table td {
  padding: 9px 9px;
}

.abc-table-wrap .abc-matrix-table th:nth-child(1),
.abc-table-wrap .abc-matrix-table td:nth-child(1) {
  width: 52px;
}

.abc-table-wrap .abc-matrix-table th:nth-child(2),
.abc-table-wrap .abc-matrix-table td:nth-child(2) {
  width: 74px;
}

.abc-matrix-table th:nth-child(3),
.abc-matrix-table td:nth-child(3) {
  width: auto;
  max-width: none;
}

.abc-table-wrap .abc-matrix-table th:nth-child(4),
.abc-table-wrap .abc-matrix-table td:nth-child(4),
.abc-table-wrap .abc-matrix-table th:nth-child(5),
.abc-table-wrap .abc-matrix-table td:nth-child(5),
.abc-table-wrap .abc-matrix-table th:nth-child(6),
.abc-table-wrap .abc-matrix-table td:nth-child(6),
.abc-table-wrap .abc-matrix-table th:nth-child(7),
.abc-table-wrap .abc-matrix-table td:nth-child(7),
.abc-table-wrap .abc-matrix-table th:nth-child(8),
.abc-table-wrap .abc-matrix-table td:nth-child(8) {
  width: 58px;
  text-align: center;
}

.abc-table-wrap .abc-matrix-table th:nth-child(9),
.abc-table-wrap .abc-matrix-table td:nth-child(9) {
  width: 68px;
}

.abc-matrix-table th:nth-child(10),
.abc-matrix-table td:nth-child(10) {
  width: 260px;
  max-width: 260px;
}

.abc-matrix-table td:nth-child(3) strong,
.abc-matrix-table td:nth-child(10) strong {
  overflow-wrap: anywhere;
}

.abc-matrix-table td:nth-child(10) {
  white-space: normal;
}

.abc-matrix-table .abc-class {
  min-width: 30px;
  min-height: 26px;
}

.abc-table-wrap th {
  font-size: 11px;
}

.abc-class {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 26px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.matrix-stat-help {
  cursor: help;
  outline: none;
}

.abc-class-A {
  background: #047857;
}

.abc-class-B {
  background: #2563eb;
}

.abc-class-C {
  background: #64748b;
}

.abc-class-— {
  background: #cbd5e1;
  color: #475569;
}

.abc-progress {
  display: block;
  width: 100%;
  height: 5px;
  margin-bottom: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #0f766e var(--abc-progress), #e2e8f0 var(--abc-progress));
}

.column-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  outline: none;
}

.column-help::after {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.floating-column-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 16px 38px rgb(15 23 42 / 22%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}

.floating-column-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.stock-matrix-wrap table {
  min-width: 1900px;
}

.stock-matrix-wrap th.numeric-col,
.stock-matrix-wrap td.numeric-col {
  min-width: 132px;
  vertical-align: middle;
}

.stock-cell {
  display: inline-grid;
  justify-items: end;
  gap: 2px;
}

.stock-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.table-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-header-bg);
  padding: 12px 14px;
  border-bottom: 1px solid #dfe7ef;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-summary > span:first-child,
.logistics-queue-title span:first-child {
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  color: var(--muted);
  background: #f9fbfc;
  font-size: 12px;
  line-height: 1.18;
  text-transform: uppercase;
  vertical-align: bottom;
  box-shadow: inset 0 -1px 0 var(--line);
}

.wide-table-wrap th {
  top: 0;
}

.table-panel thead th:first-child {
  z-index: 5;
}


td a {
  color: inherit;
  text-decoration: none;
}

td a:hover,
.page-title a:hover,
.product-name-link:hover strong {
  color: var(--accent-strong);
}

.photo-col {
  width: 68px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #fbfefd;
}

.product-thumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgb(15 118 110 / 10%), rgb(8 145 178 / 8%)),
    #f8fafc;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  overflow: visible;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  background: #fff;
}

.product-thumb:hover {
  z-index: 50;
}

.product-thumb:hover img {
  position: absolute;
  left: 0;
  top: 50%;
  width: min(354px, calc(100vw - 56px));
  height: 288px;
  max-height: calc(100vh - 120px);
  transform: translateY(-50%);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgb(15 23 42 / 22%);
  background: #fff;
}

.product-name-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-tree {
  padding: 8px 12px 14px;
}

.product-tree-node {
  border-bottom: 1px solid var(--line);
}

.product-tree-node summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.product-tree-node summary::-webkit-details-marker {
  display: none;
}

.product-tree-node summary::before {
  content: "›";
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  transition: transform .15s ease;
}

.product-tree-node[open] > summary::before {
  transform: rotate(90deg);
}

.product-tree-node summary a {
  color: inherit;
  text-decoration: none;
}

.product-tree-node summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tree-folder-mark {
  width: 22px;
  height: 16px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #facc15, #f59e0b);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 42%);
}

.product-tree-children {
  margin-left: 28px;
  padding-left: 14px;
  border-left: 1px dashed #d9e0e7;
}

.product-tree-item {
  display: grid;
  grid-template-columns: 42px minmax(260px, 1fr) 100px minmax(120px, .35fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.product-tree-item strong {
  color: var(--text);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.pagination a {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--accent-strong);
  text-decoration: none;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 700;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tabs-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tabs-nav a.active,
.tabs-nav a:hover {
  border-color: #b7e4d6;
  background: #ecfdf5;
  color: var(--accent-strong);
}

.tabs-nav span {
  color: inherit;
  opacity: .7;
}

.check-tabs a {
  align-items: stretch;
  min-height: 46px;
  border-radius: 8px;
  padding: 8px 10px;
}

.check-tab-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 9px;
  align-items: baseline;
}

.check-tab-count {
  grid-row: span 2;
  align-self: center;
  min-width: 32px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.check-tab-title {
  color: var(--text);
  font-weight: 900;
  line-height: 1.15;
}

.check-tab-note {
  max-width: 230px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.profit-document-row td {
  padding: 0;
  background: #eef6f5;
  border-bottom-color: #d4e6e3;
  overflow: hidden;
}

.profit-document-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(120px, .6fr) minmax(180px, 1fr) minmax(180px, .9fr) minmax(160px, .75fr) minmax(180px, .7fr);
  gap: 12px;
  align-items: center;
  max-width: 100%;
  padding: 10px 14px;
  overflow: hidden;
}

.profit-document-card > div {
  min-width: 0;
}

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

.profit-document-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profit-document-card .numeric-col {
  justify-self: end;
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.profit-document-lines td {
  background: #fff;
}

.profit-line-muted td {
  background: #fbfefd;
  color: #566574;
}

.profit-line-muted td strong {
  color: #26313b;
}

.profit-rule-panel {
  margin-bottom: 14px;
}

.numeric-col {
  text-align: right;
  white-space: nowrap;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.product-photo-panel,
.detail-section {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.product-photo-panel {
  padding: 16px;
}

.product-photo-large {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(15 118 110 / 10%), rgb(245 158 11 / 8%)),
    #f8fafc;
  color: var(--accent-strong);
  font-size: 64px;
  font-weight: 900;
  overflow: hidden;
}

.product-photo-large img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.product-photo-panel small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.detail-sections {
  display: grid;
  gap: 14px;
}

.detail-section {
  padding: 18px;
}

.detail-section h2 {
  margin-bottom: 14px;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-form button {
  justify-self: start;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  padding: 10px 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-field {
  display: grid;
  gap: 5px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.detail-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-field strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.auth-scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 12% 10%, rgb(88 28 135 / 78%), transparent 40%),
    radial-gradient(ellipse at 86% 18%, rgb(8 145 178 / 60%), transparent 38%),
    radial-gradient(ellipse at 48% 100%, rgb(15 118 110 / 50%), transparent 45%),
    linear-gradient(135deg, #040716 0%, #071121 46%, #050b16 100%);
}

.premium-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.premium-backdrop::before,
.premium-backdrop::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
}

.premium-backdrop::before {
  background:
    linear-gradient(115deg, rgb(124 58 237 / 34%), transparent 32%),
    linear-gradient(245deg, rgb(6 182 212 / 30%), transparent 36%),
    linear-gradient(30deg, transparent 44%, rgb(245 158 11 / 18%) 72%, transparent 100%);
  filter: blur(10px);
}

.premium-backdrop::after {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 255 255 / 3%) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 78%, transparent 100%);
  opacity: .35;
}

.mock-control-panel {
  position: absolute;
  left: 50%;
  top: 53%;
  width: min(1320px, 86vw);
  min-height: 620px;
  padding: 30px;
  transform: translate(-50%, -50%) rotate(-3deg);
  border-radius: 30px;
  color: #e5edf7;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 20%), rgb(255 255 255 / 7%)),
    linear-gradient(135deg, rgb(49 46 129 / 64%), rgb(8 47 73 / 66%) 58%, rgb(6 78 59 / 48%));
  border: 1px solid rgb(255 255 255 / 18%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 22%),
    0 42px 130px rgb(0 0 0 / 58%);
  backdrop-filter: blur(26px) saturate(1.45);
  filter: blur(2.2px);
  opacity: .92;
}

.mock-browser-bar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 18px;
  background: rgb(2 6 23 / 48%);
  border: 1px solid rgb(255 255 255 / 8%);
}

.mock-browser-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
}

.mock-browser-bar span:nth-child(2) { background: #f59e0b; }
.mock-browser-bar span:nth-child(3) { background: #10b981; }

.mock-browser-bar b {
  margin-left: 10px;
  color: rgb(226 232 240 / 80%);
  font-size: 15px;
}

.mock-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0;
}

.mock-stats-row div {
  min-height: 110px;
  padding: 22px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 18%), rgb(255 255 255 / 6%)),
    rgb(15 23 42 / 34%);
  border: 1px solid rgb(255 255 255 / 9%);
}

.mock-stats-row b,
.mock-stats-row span {
  display: block;
}

.mock-stats-row b {
  font-size: 36px;
  color: #f8fafc;
  line-height: 1;
}

.mock-stats-row span {
  margin-top: 8px;
  color: rgb(203 213 225 / 78%);
  font-size: 13px;
}

.mock-products-table {
  color: rgb(226 232 240 / 82%);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.mock-products-table th,
.mock-products-table td {
  border: 0;
  padding: 18px 18px;
  background: rgb(15 23 42 / 42%);
}

.mock-products-table th {
  color: rgb(148 163 184 / 72%);
  background: transparent;
}

.mock-products-table td:first-child {
  width: 56px;
  border-radius: 14px 0 0 14px;
}

.mock-products-table td:last-child {
  border-radius: 0 14px 14px 0;
}

.mock-products-table i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  box-shadow: 0 0 24px rgb(6 182 212 / 35%);
}

.mock-products-table tr:nth-child(2n) i {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 24px rgb(245 158 11 / 30%);
}

.mock-products-table .ok {
  color: #34d399;
  font-weight: 800;
}

.mock-products-table .warn {
  color: #fbbf24;
  font-weight: 800;
}

.auth-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 18px 34px;
}

.auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  border-radius: 26px;
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.glass-card {
  background:
    linear-gradient(145deg, rgb(255 255 255 / 88%), rgb(255 255 255 / 46%)),
    linear-gradient(315deg, rgb(14 116 144 / 28%), rgb(245 158 11 / 18%));
  border: 1px solid rgb(255 255 255 / 84%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 88%),
    inset 0 -1px 0 rgb(15 118 110 / 10%),
    0 42px 120px rgb(0 0 0 / 36%),
    0 0 0 1px rgb(255 255 255 / 30%);
  backdrop-filter: blur(36px) saturate(1.55);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgb(255 255 255 / 70%) 0%, transparent 28%),
    linear-gradient(280deg, rgb(14 165 233 / 18%), transparent 36%);
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 25px;
  border: 1px solid rgb(255 255 255 / 44%);
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card h1 {
  font-size: 30px;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-card label em {
  color: #ef4444;
  font-style: normal;
}

.optional-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 -2px;
  color: rgb(71 85 105 / 82%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.optional-divider::before,
.optional-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(71 85 105 / 26%), transparent);
}

.auth-card input {
  width: 100%;
  border: 1px solid rgb(148 163 184 / 32%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 82%), rgb(255 255 255 / 56%));
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.auth-card input:focus {
  border-color: rgb(15 118 110 / 62%);
  box-shadow: 0 0 0 3px rgb(15 118 110 / 12%);
}

.auth-card button {
  border: 0;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 18%), transparent),
    linear-gradient(135deg, #0f766e, #0891b2 55%, #f59e0b);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 18px 42px rgb(8 145 178 / 30%);
}

.auth-card a {
  color: var(--accent-strong);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.form-error {
  margin: 0;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.form-note {
  margin: 0;
  border: 1px solid #bae6fd;
  background: #eff6ff;
  color: #075985;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.user-badge.approved {
  background: #dcfce7;
  color: #166534;
}

.user-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.table-actions {
  text-align: right;
}

.table-actions form {
  margin: 0;
}

.table-actions button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  padding: 9px 12px;
}

.contract-bind-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.contract-bind-form select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0 8px;
}

.manager-contract-group {
  border-top: 1px solid var(--line);
}

.manager-contract-group:first-of-type {
  border-top: 0;
}

.manager-contract-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f8fafc;
  padding: 12px 14px;
}

.manager-contract-heading strong {
  font-size: 15px;
}

.manager-contract-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.secondary-link {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--accent-strong);
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.logistics-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, .65fr) minmax(220px, 1.1fr) repeat(3, minmax(150px, .78fr)) minmax(170px, .72fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.logistics-filter-field {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 3px;
  min-width: 0;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 1px 0 rgb(15 23 42 / 3%);
  padding: 7px 10px 8px;
}

.logistics-filter-field::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #0f766e;
  opacity: .74;
}

.logistics-filter-field:focus-within {
  border-color: rgb(15 118 110 / 62%);
  box-shadow:
    0 0 0 3px rgb(15 118 110 / 10%),
    0 10px 26px rgb(15 23 42 / 7%);
}

.logistics-filter-field > span {
  color: #647282;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.logistics-filter-field select,
.logistics-filter-field input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
  padding: 0;
}

.logistics-run-form select,
.logistics-run-form input,
.logistics-directory-form select,
.logistics-directory-form input {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

.logistics-filter-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #647282 50%),
    linear-gradient(135deg, #647282 50%, transparent 50%);
  background-position:
    calc(100% - 10px) 50%,
    calc(100% - 5px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 20px;
}

.logistics-filter-field input[type="date"] {
  min-height: 20px;
}

.logistics-create-panel {
  margin-bottom: 14px;
}

.logistics-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.logistics-metrics .metric-card {
  min-height: 0;
  padding: 9px 12px;
}

.logistics-metrics .metric-card strong {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.logistics-run-form {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(180px, 1fr) minmax(140px, .7fr) minmax(180px, 1fr) auto;
  gap: 10px;
  padding: 12px 14px 14px;
}

.logistics-directory-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 14px;
}

.logistics-run-form button,
.logistics-directory-form button,
.logistics-assign-row button,
.logistics-inline-assign-form button,
.route-doc-row button,
.route-doc-tile button,
.route-actions button,
.route-print-link {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.route-doc-row button,
.route-doc-tile button {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--muted);
}

.route-actions button:disabled {
  background: #d1d5db;
  color: #647282;
}

.logistics-board-live {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.22fr);
  gap: 14px;
  align-items: stretch;
  height: clamp(520px, calc(100vh - 260px), 760px);
  min-height: 0;
}

.logistics-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.logistics-route-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 6px;
  padding: 6px;
}

.logistics-route-tab-panel {
  flex: 1;
  overflow: hidden;
}

.logistics-route-tab-panel.active {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.logistics-route-tab-panel .logistics-route-list,
.logistics-route-tab-panel .logistics-address-review,
.logistics-route-tab-panel .logistics-timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.logistics-route-tab-panel .logistics-map-body {
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(360px, 1fr) auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.logistics-route-tab-panel .logistics-map-main {
  grid-template-rows: auto minmax(320px, 1fr) auto;
}

.logistics-route-tab-panel .logistics-map-canvas {
  min-height: 320px;
}

.logistics-route-tab-panel .logistics-map-routes {
  max-height: 150px;
}

.logistics-timeline {
  padding: 10px;
}

.logistics-card-list,
.logistics-route-list {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.logistics-map-body {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, .34fr);
  gap: 12px;
  min-height: 0;
  padding: 10px;
}

.logistics-map-panel {
  margin-top: 14px;
}

.logistics-map-main,
.logistics-map-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.logistics-map-main {
  grid-template-rows: auto minmax(420px, 1fr) auto;
}

.logistics-map-vehicle-filter {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 9px;
}

.logistics-map-vehicle-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.logistics-map-vehicle-filter-head strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-map-vehicle-filter-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-map-vehicle-options {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.logistics-map-vehicle-options button {
  display: inline-grid;
  grid-template-columns: 9px auto auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  padding: 6px 9px;
}

.logistics-map-vehicle-options button i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--route-color, #334155);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--route-color, #334155) 18%, #ffffff);
}

.logistics-map-vehicle-options button span {
  max-width: 180px;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-map-vehicle-options button small {
  color: #64748b;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.logistics-map-vehicle-options button:hover,
.logistics-map-vehicle-options button:focus-visible {
  border-color: var(--route-color, #64748b);
  outline: none;
}

.logistics-map-vehicle-options button.active {
  border-color: var(--route-color, #334155);
  background: color-mix(in srgb, var(--route-color, #334155) 9%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--route-color, #334155) 16%, #ffffff);
  color: #172033;
}

.logistics-map-vehicle-options button:disabled {
  cursor: default;
  opacity: .55;
}

.logistics-map-canvas {
  position: relative;
  z-index: 0;
  min-height: 420px;
  border: 1px solid #c9d4df;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #e7f4ef 0%, #f8fafc 58%, #eaf2ff 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 82%);
  overflow: hidden;
}

.logistics-map-canvas .leaflet-container,
.logistics-map-canvas.leaflet-container {
  font: inherit;
}

.logistics-map-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgb(15 23 42 / 22%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.logistics-map-marker.depot {
  width: 34px;
  height: 34px;
  background: #111827;
  font-size: 14px;
}

.logistics-map-status {
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  padding: 8px 10px;
}

.logistics-map-routes {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.logistics-map-route-item {
  position: relative;
  border: 1px solid #d8e1eb;
  border-left: 5px solid var(--route-color, var(--accent));
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.logistics-map-route-item.is-route-hidden {
  opacity: 0.48;
}

.logistics-map-route-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  cursor: pointer;
}

.logistics-map-route-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.logistics-map-route-check {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 2px solid var(--route-color, var(--accent));
  border-radius: 4px;
  background: var(--route-color, var(--accent));
  box-shadow: inset 0 0 0 3px #ffffff;
}

.logistics-map-route-toggle input:focus-visible + .logistics-map-route-check {
  outline: 2px solid color-mix(in srgb, var(--route-color, var(--accent)) 38%, #ffffff);
  outline-offset: 2px;
}

.logistics-map-route-toggle input:not(:checked) + .logistics-map-route-check {
  background: #ffffff;
  box-shadow: none;
}

.logistics-map-route-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-map-route-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-map-route-text > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logistics-address-review {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 0 10px 10px;
}

.logistics-address-review-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}

.logistics-address-review-title span {
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
}

.logistics-address-review-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.logistics-address-review-item {
  display: grid;
  gap: 2px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  padding: 8px 10px;
}

.logistics-address-review-item strong,
.logistics-address-review-item span,
.logistics-address-review-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-address-review-item strong {
  color: #7c2d12;
  font-size: 12px;
}

.logistics-address-review-item span,
.logistics-address-review-item p {
  color: #9a3412;
  font-size: 11px;
  margin: 0;
}

.logistics-address-review-item small {
  color: #c2410c;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-suggest-form {
  margin-left: auto;
}

.logistics-suggest-form button {
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.logistics-queue-summary {
  align-items: center;
  flex-wrap: wrap;
}

.logistics-queue-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.logistics-queue-new-indicator {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #4ade80;
  border-radius: 999px;
  background: #dcfce7;
  box-shadow: 0 0 0 0 rgb(34 197 94 / 42%);
  cursor: pointer;
  padding: 0;
  animation: logistics-queue-new-order-pulse 780ms ease-in-out infinite;
}

.logistics-queue-new-indicator::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 10px rgb(22 163 74 / 72%);
  content: "";
}

.logistics-queue-new-indicator[hidden] {
  display: none;
}

.logistics-queue-new-indicator:hover,
.logistics-queue-new-indicator:focus-visible {
  border-color: #16a34a;
  background: #bbf7d0;
  outline: none;
}

@keyframes logistics-queue-new-order-pulse {
  0%, 100% {
    opacity: .45;
    transform: scale(.88);
    box-shadow: 0 0 0 0 rgb(34 197 94 / 46%);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 0 0 7px rgb(34 197 94 / 0%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logistics-queue-new-indicator {
    animation: none;
  }
}

.logistics-queue-search {
  flex: 1;
  min-width: min(260px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
}

.logistics-doc-card,
.logistics-route-card {
  min-width: 0;
  border: 1px solid #c9d4df;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow:
    0 8px 18px rgb(15 23 42 / 7%),
    inset 3px 0 0 rgb(15 118 110 / 16%);
  padding: 12px;
}

.logistics-doc-card {
  box-shadow:
    0 5px 14px rgb(15 23 42 / 7%),
    inset 3px 0 0 rgb(15 118 110 / 16%);
  padding: 10px;
}

.logistics-doc-card[data-logistics-draggable-card] {
  cursor: grab;
}

.logistics-doc-card.is-dragging {
  cursor: grabbing;
  opacity: .58;
  outline: 2px solid #9bd7c7;
}

body.logistics-dragging {
  cursor: grabbing;
  user-select: none;
}

.logistics-drag-ghost {
  position: fixed;
  z-index: 3000;
  display: grid;
  min-width: 220px;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
  box-shadow: 0 18px 42px rgb(15 23 42 / 22%);
  color: var(--text);
  font-weight: 900;
  gap: 2px;
  pointer-events: none;
  transform: translateY(-50%);
}

.logistics-drag-ghost small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-route-card.is-drop-target {
  border-color: var(--accent);
  background: #f0fdfa;
  box-shadow:
    0 0 0 3px rgb(15 118 110 / 10%),
    0 10px 24px rgb(15 23 42 / 10%),
    inset 3px 0 0 rgb(15 118 110 / 36%);
}

.logistics-doc-card p,
.logistics-route-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.logistics-card-top,
.route-card-header,
.route-doc-row,
.route-doc-tile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.logistics-card-top {
  align-items: center;
  gap: 8px;
}

.logistics-card-top > div,
.route-card-header > div,
.route-doc-row > div,
.route-doc-tile > div {
  min-width: 0;
}

.logistics-doc-card strong,
.logistics-doc-card p,
.empty-note,
.route-doc-row strong,
.route-doc-row span,
.route-doc-tile strong,
.route-doc-tile span,
.route-doc-tile b {
  overflow-wrap: anywhere;
}

.doc-number {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.logistics-order-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.logistics-card-customer {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.logistics-card-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-card-address {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-card-address span {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-card-address.is-uncertain {
  background: #fffbeb;
  color: #92400e;
}

.logistics-card-address.is-missing {
  background: #f1f5f9;
  color: #94a3b8;
}

.zone-badge,
.warning-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-height: 24px;
  max-width: 48%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.zone-badge {
  background: #eff6ff;
  color: #1d4ed8;
}

.warning-badge {
  margin-top: 9px;
  background: var(--warn-bg);
  color: #92400e;
}

.dimension-warning {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  width: fit-content;
  margin: 0;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  cursor: help;
}

.traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 14%);
}

.dimension-tooltip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(360px, calc(100vw - 60px));
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(15 23 42 / 18%);
  color: var(--text);
  padding: 10px 12px;
  line-height: 1.35;
}

.dimension-tooltip strong {
  display: block;
  margin-bottom: 7px;
}

.dimension-tooltip div {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  white-space: normal;
}

.dimension-tooltip div:first-of-type {
  border-top: 0;
}

.dimension-warning:hover .dimension-tooltip,
.dimension-warning:focus .dimension-tooltip,
.dimension-warning:focus-within .dimension-tooltip {
  display: block;
}

.traffic-dot:hover + .dimension-tooltip {
  display: block;
}

.logistics-card-meta,
.route-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.logistics-doc-card .logistics-card-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.logistics-card-meta span,
.route-stats span {
  border-radius: 6px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  padding: 6px;
}

.logistics-card-meta strong,
.route-stats strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.route-stats {
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0;
}

.route-stats span {
  font-size: 12px;
  line-height: normal;
  padding: 7px 8px;
}

.route-stats strong {
  font-size: 13px;
  line-height: normal;
}

.route-economy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: -2px 0 8px;
}

.logistics-assign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.logistics-assign-menu {
  margin-top: 8px;
}

.logistics-assign-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 9px;
  cursor: pointer;
  user-select: none;
}

.logistics-inline-assign-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.logistics-inline-assign-form select {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
}

.empty-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.logistics-route-card.overloaded {
  border-color: #f59e0b;
  box-shadow:
    0 8px 18px rgb(15 23 42 / 7%),
    inset 3px 0 0 rgb(245 158 11 / 42%);
}

.route-card-header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capacity-bar {
  height: 8px;
  margin: 8px 0 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.capacity-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--route-color, var(--accent));
}

.capacity-bar.is-overloaded span {
  background: #dc2626;
}

.route-doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.route-doc-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 9px 10px;
}

.route-doc-tile {
  position: relative;
  display: block;
  min-width: 0;
  border: 1px solid var(--tile-border, #dfe7ef);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 70%) 0%, var(--tile-bg, #f8fafc) 100%);
  box-shadow: 0 4px 10px rgb(15 23 42 / 5%);
  padding: 9px 34px 9px 10px;
}

.route-doc-tile-tone-0 {
  --tile-bg: #f0fdfa;
  --tile-border: #bae6df;
}

.route-doc-tile-tone-1 {
  --tile-bg: #eff6ff;
  --tile-border: #c7d8f5;
}

.route-doc-tile-tone-2 {
  --tile-bg: #fff7ed;
  --tile-border: #fed7aa;
}

.route-doc-tile-tone-3 {
  --tile-bg: #f8fafc;
  --tile-border: #cbd5e1;
}

.route-doc-tile-tone-4 {
  --tile-bg: #f0fdf4;
  --tile-border: #bbf7d0;
}

.route-doc-tile-tone-5 {
  --tile-bg: #fefce8;
  --tile-border: #fde68a;
}

.route-doc-tile-tone-6 {
  --tile-bg: #f5f3ff;
  --tile-border: #ddd6fe;
}

.route-doc-tile-tone-7 {
  --tile-bg: #fdf2f8;
  --tile-border: #fbcfe8;
}

.route-doc-tile > div {
  display: grid;
  gap: 5px;
}

.route-doc-row strong,
.route-doc-row span,
.route-doc-tile strong,
.route-doc-tile span,
.route-doc-tile b {
  display: block;
}

.route-doc-row span,
.route-doc-tile span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-doc-tile strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-doc-customer {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-height: 2.36em;
  line-height: 1.18;
}

.route-doc-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.route-doc-footer > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-doc-tile b {
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.route-doc-tile form {
  position: absolute;
  top: 7px;
  right: 7px;
}

.route-doc-tile button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.order-preview-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  cursor: help;
  outline: 0;
}

.route-order-preview {
  display: block;
  width: fit-content;
}

.order-preview-anchor:focus-visible .doc-number,
.order-preview-anchor:focus-visible strong {
  border-radius: 4px;
  outline: 2px solid rgb(15 118 110 / 24%);
  outline-offset: 2px;
}

.order-preview-anchor .order-preview-tooltip {
  display: none;
  position: fixed;
  left: 50%;
  top: 88px;
  z-index: 1000;
  width: min(760px, calc(100vw - 48px));
  max-height: min(620px, calc(100vh - 116px));
  transform: translateX(-50%);
  overflow-y: auto;
  border: 1px solid #bfd0dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 18px 44px rgb(15 23 42 / 20%),
    inset 3px 0 0 rgb(15 118 110 / 24%);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
  padding: 10px;
  pointer-events: none;
  text-align: left;
  white-space: normal;
}

.order-preview-anchor:hover .order-preview-tooltip,
.order-preview-anchor:focus .order-preview-tooltip,
.order-preview-anchor:focus-within .order-preview-tooltip {
  display: grid;
  gap: 8px;
}

.order-preview-title {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.order-preview-table {
  display: grid;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
}

.order-preview-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 74px 92px 74px;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 8px 10px;
}

.order-preview-row:first-child {
  border-top: 0;
}

.order-preview-row > span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.18;
  margin-top: 0;
}

.order-preview-row > span:not(:first-child) {
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.order-preview-head {
  background: #f8fafc;
}

.order-preview-head > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: right;
  text-transform: uppercase;
}

.order-preview-head > span:first-child {
  text-align: left;
}

.order-preview-more,
.order-preview-empty,
.order-preview-profit {
  display: block;
  margin-top: 0;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  padding: 7px 8px;
}

.order-preview-profit {
  background: #ecfdf5;
  color: var(--accent-strong);
}

@media (max-width: 640px) {
  .order-preview-anchor .order-preview-tooltip {
    top: 16px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
  }

  .order-preview-row {
    grid-template-columns: minmax(0, 1fr) 58px 72px 58px;
    gap: 8px;
  }
}

.route-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.logistics-workspace {
  display: grid;
  gap: 10px;
  min-height: calc(100vh - 126px);
}

.agent-logistics-intake {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #c4b5fd;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f3ff, #ffffff);
  box-shadow: 0 12px 30px rgb(76 29 149 / 8%);
}

.agent-logistics-intake-head,
.agent-logistics-intake-list article,
.agent-logistics-intake-list article > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-logistics-intake-head span { font-size: 18px; font-weight: 800; color: #4c1d95; }
.agent-logistics-intake-head strong { min-width: 34px; padding: 6px 10px; border-radius: 999px; text-align: center; color: #fff; background: #6d28d9; }
.agent-logistics-intake-list { display: grid; gap: 8px; margin-top: 12px; }
.agent-logistics-intake-list article { align-items: stretch; padding: 11px 12px; border-radius: 12px; background: #fff; border: 1px solid #ede9fe; }
.agent-logistics-intake-list article > span { align-items: baseline; }
.agent-logistics-intake-list article strong { margin-left: 8px; }
.agent-logistics-intake-list article small { color: #64748b; }
.agent-logistics-intake > p { margin: 10px 2px 0; color: #6b7280; font-size: 13px; }
.agent-logistics-intake.is-compact { margin: 0; }

@media (max-width: 760px) {
  .agent-logistics-intake-list article { display: grid; }
  .agent-logistics-intake-list article > span { flex-wrap: wrap; }
}

.logistics-workspace-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #ffffff;
}

.logistics-workspace-top h1,
.logistics-workspace-top p {
  margin: 0;
}

.logistics-workspace-top h1 {
  color: var(--text);
  font-size: 22px;
}

.logistics-workspace-top p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.logistics-workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ghost-button,
.logistics-workspace-actions button,
.workspace-selection-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
  text-decoration: none;
}

.workspace-selection-bar button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.workspace-selection-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.logistics-workspace-alerts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logistics-workspace-alerts span {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.logistics-workspace-alerts .is-hot {
  background: #fff7ed;
  color: #c2410c;
}

.logistics-workspace-filters {
  display: grid;
  grid-template-columns: 140px repeat(3, minmax(140px, 1fr)) minmax(200px, 1.4fr) minmax(170px, .8fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #ffffff;
}

.logistics-workspace-filters label,
.workspace-selection-bar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.logistics-workspace-filters span,
.workspace-selection-bar label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.logistics-workspace-filters input,
.logistics-workspace-filters select,
.workspace-selection-bar select {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 9px;
}

.logistics-workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(460px, 1.32fr) minmax(300px, .82fr);
  gap: 10px;
  min-height: 0;
  height: clamp(620px, calc(100vh - 260px), 860px);
}

.workspace-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.workspace-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.workspace-panel-head strong {
  color: var(--text);
  font-size: 14px;
}

.workspace-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workspace-queue-list,
.workspace-route-list,
.workspace-route-details,
.workspace-issues,
.workspace-timeline {
  min-height: 0;
  overflow: auto;
}

.workspace-order-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: start;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  padding: 9px 10px;
}

.workspace-order-row:hover,
.workspace-route-row:hover {
  background: #f8fafc;
}

.workspace-order-row.has-warning {
  box-shadow: inset 3px 0 0 #ef4444;
}

.workspace-order-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.workspace-order-main,
.workspace-order-facts {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-order-main strong,
.workspace-order-main b,
.workspace-order-main small,
.workspace-order-facts b,
.workspace-order-facts small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-order-main strong {
  color: #334155;
  font-size: 12px;
}

.workspace-order-main b {
  color: var(--text);
  font-size: 13px;
}

.workspace-order-main small,
.workspace-order-facts small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workspace-order-facts {
  justify-items: end;
  text-align: right;
}

.workspace-order-facts b {
  color: var(--text);
  font-size: 12px;
}

.workspace-order-facts .is-warning {
  color: #b45309;
}

.workspace-map {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.workspace-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.workspace-tabs button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px;
}

.workspace-tabs button.active {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #047857;
}

.workspace-tabs.logistics-route-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
}

.workspace-tabs.logistics-route-tabs button {
  min-width: 0;
  min-height: 32px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
  padding: 6px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab-panel {
  display: none;
  min-height: 0;
  padding: 10px;
}

.workspace-tab-panel.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.workspace-tab-panel.active[data-workspace-tab-panel="map"] {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.workspace-map-canvas {
  min-height: 0;
}

.workspace-timeline {
  display: grid;
  align-content: start;
  gap: 8px;
}

.workspace-timeline article {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e1eb;
  border-left: 5px solid var(--route-color, var(--accent));
  border-radius: 8px;
  padding: 10px;
}

.workspace-timeline article strong,
.workspace-timeline article span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-timeline article strong {
  color: var(--text);
}

.workspace-timeline article span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-timeline-bar,
.workspace-route-row i {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.workspace-timeline-bar i,
.workspace-route-row i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--route-color, var(--accent));
}

.workspace-issues {
  display: grid;
  align-content: start;
  gap: 8px;
}

.workspace-issues article {
  display: grid;
  gap: 3px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  padding: 10px;
}

.workspace-issues strong {
  color: #7c2d12;
}

.workspace-issues span,
.workspace-issues small {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.workspace-routes {
  grid-template-rows: auto minmax(190px, .55fr) minmax(0, 1fr);
}

.workspace-route-row {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-left: 5px solid var(--route-color, var(--accent));
  background: #ffffff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 9px 10px;
  text-align: left;
}

.workspace-route-row.active {
  background: #f0fdfa;
}

.workspace-route-row.is-overloaded i em {
  background: #dc2626;
}

.workspace-route-row span,
.workspace-route-row b,
.workspace-route-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-route-row strong {
  color: var(--text);
  font-size: 13px;
}

.workspace-route-row b {
  color: #334155;
  font-size: 12px;
}

.workspace-route-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workspace-route-details {
  border-top: 1px solid #e2e8f0;
}

.workspace-route-details section {
  display: none;
  padding: 12px;
}

.workspace-route-details section.active {
  display: grid;
  gap: 8px;
}

.workspace-route-details h2,
.workspace-route-details p {
  margin: 0;
}

.workspace-route-details h2 {
  color: var(--text);
  font-size: 16px;
}

.workspace-route-details-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.workspace-route-details-head button {
  min-height: 30px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ecfdf5;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 10px;
  white-space: nowrap;
}

.workspace-route-details p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workspace-route-details ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.workspace-route-details li {
  border-bottom: 1px solid #e2e8f0;
  color: var(--text);
  padding: 0 0 6px;
}

.workspace-route-details li strong,
.workspace-route-details li span,
.workspace-route-details li small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-route-details li span,
.workspace-route-details li small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-selection-bar {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, .7fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  box-shadow: 0 16px 34px rgb(15 23 42 / 14%);
}

.workspace-selection-bar > div:first-child {
  display: grid;
  gap: 2px;
}

.workspace-selection-bar strong {
  color: var(--text);
}

.workspace-selection-bar div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .receivables-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(160px, .65fr) minmax(190px, .75fr);
  }

  .receivables-toolbar .receivables-days-field,
  .receivables-toolbar button {
    width: 100%;
  }

  .receivables-check-field {
    width: auto;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .logistics-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .logistics-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-header {
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
  }

  .app-header,
  .header-left,
  .header-right,
  .page-title,
  .work-panel,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-menu-panel {
    left: 0;
    right: auto;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .data-freshness-indicator {
    width: 100%;
  }

  .dashboard-metric-grid {
    grid-template-columns: 1fr;
  }

  .document-toolbar {
    grid-template-columns: 1fr;
  }

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

  .page-shell {
    padding: 18px;
  }

  .auth-page-shell {
    padding: 0;
  }

  .auth-scene {
    min-height: 100vh;
    border-radius: 0;
  }

  .mock-control-panel {
    width: 900px;
    min-height: 560px;
    left: 50%;
    top: 48%;
    padding: 18px;
    transform: translate(-50%, -50%) rotate(-4deg);
    filter: blur(2.4px);
    opacity: .78;
  }

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

  .auth-shell {
    min-height: 100vh;
    padding: 96px 14px 28px;
  }

  .auth-card {
    padding: 22px;
  }

  .products-toolbar,
  .page-title,
  .product-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .receivables-toolbar {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .receivables-toolbar .receivables-search-field {
    min-width: 0;
  }

  .mode-toggle,
  .mode-switch {
    justify-content: center;
  }

  .product-tree-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .product-tree-item > span {
    display: none;
  }

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

  .logistics-toolbar,
  .logistics-run-form,
  .logistics-directory-form,
  .logistics-board-live,
  .logistics-map-body,
  .logistics-card-meta,
  .route-stats {
    grid-template-columns: 1fr;
  }

  .logistics-board-live,
  .logistics-panel {
    min-height: 0;
  }

  .logistics-board-live {
    height: auto;
  }

  .logistics-panel {
    height: min(620px, 72vh);
  }

  .logistics-map-panel {
    height: auto;
  }

  .logistics-map-main {
    grid-template-rows: minmax(320px, 54vh) auto;
  }

  .logistics-map-canvas {
    min-height: 320px;
  }

}

@media (max-width: 1199px) {
  .logistics-workspace-grid {
    grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr);
    height: auto;
  }

  .workspace-routes {
    grid-column: 1 / -1;
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .logistics-workspace-top,
  .logistics-workspace-filters,
  .logistics-workspace-grid,
  .workspace-selection-bar {
    grid-template-columns: 1fr;
  }

  .logistics-workspace-actions {
    justify-content: stretch;
  }

  .ghost-button,
  .logistics-workspace-actions form,
  .logistics-workspace-actions button {
    width: 100%;
  }

  .workspace-panel {
    min-height: 420px;
  }

  .workspace-order-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .workspace-order-row input {
    width: 22px;
    height: 22px;
  }

  .workspace-order-facts {
    grid-column: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: start;
    text-align: left;
  }

  .workspace-map-canvas {
    min-height: 460px;
  }

  .workspace-selection-bar {
    bottom: 0;
    border-radius: 8px 8px 0 0;
  }
}

body:has(.logistics-board-live) {
  overflow: hidden;
}

body:has(.logistics-board-live) .page-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: calc(100vh - 64px);
  min-height: 0;
  padding: 8px 10px 10px;
}

body:has(.logistics-board-live) .page-title {
  margin-bottom: 8px;
}

.logistics-breadcrumb-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.logistics-work-mode-actions {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 90;
}

.logistics-work-mode-button {
  min-height: 34px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #0f766e;
  box-shadow: 0 14px 30px rgb(15 23 42 / 18%);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
}

body.logistics-work-mode .app-header,
body.logistics-work-mode .page-title,
body.logistics-work-mode .logistics-toolbar,
body.logistics-work-mode .logistics-metrics {
  display: none;
}

body.logistics-work-mode .page-shell {
  height: 100vh;
}

body.logistics-work-mode .logistics-board-live {
  height: calc(100vh - 58px);
}

.logistics-toolbar {
  flex: 0 0 auto;
  margin-bottom: 6px;
}

.logistics-work-filters {
  display: none;
}

body.logistics-work-mode .logistics-work-filters {
  display: grid;
  grid-template-columns: minmax(145px, 175px) minmax(150px, 190px) minmax(210px, 280px) minmax(150px, 190px);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.logistics-work-filters label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-work-date {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-work-filters span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.logistics-work-filters input,
.logistics-work-filters select {
  min-width: 0;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.logistics-metrics {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.logistics-metrics .metric-card {
  min-height: 38px;
  padding: 8px 10px;
}

.logistics-metrics .metric-card strong {
  font-size: 13px;
}

.logistics-board-live {
  flex: 1;
  grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr);
  height: auto;
  min-height: 0;
}

.logistics-panel .table-summary {
  min-height: 38px;
  padding: 7px 10px;
}

.logistics-card-list,
.logistics-route-list {
  gap: 4px;
  padding: 6px;
}

.logistics-doc-card.logistics-doc-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 56px minmax(0, 1fr) 86px 18px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  box-shadow: none;
  cursor: grab;
  padding: 4px 7px;
}

[data-logistics-order-ref] {
  position: relative;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.logistics-new-order-badge {
  position: absolute;
  top: -7px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  padding: 2px 6px;
  pointer-events: none;
  text-transform: uppercase;
}

.logistics-new-order-badge[hidden] {
  display: none;
}

.logistics-doc-row > .logistics-new-order-badge {
  right: 24px;
}

.logistics-modal-list-row > .logistics-new-order-badge {
  right: 46px;
}

.workspace-order-row > .logistics-new-order-badge,
.workspace-route-details li > .logistics-new-order-badge {
  top: 5px;
  right: 7px;
}

.logistics-doc-card.is-logistics-new-order,
.logistics-modal-list-row.is-logistics-new-order,
.workspace-order-row.is-logistics-new-order,
.workspace-route-details li.is-logistics-new-order {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: 0 0 0 2px rgb(245 158 11 / 16%), 0 6px 16px rgb(146 64 14 / 10%) !important;
}

.logistics-doc-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.logistics-detail-link {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.logistics-doc-row .doc-number {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-detail-link:hover {
  text-decoration: underline;
}

.logistics-row-customer,
.logistics-row-weight {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-row-customer {
  color: var(--text);
  font-size: 12px;
  line-height: 1.05;
}

.logistics-row-weight {
  justify-self: end;
  color: #334155;
  font-size: 12px;
  line-height: 1;
}

.logistics-row-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  cursor: help;
  font-size: 11px;
  font-weight: 900;
  outline: none;
}

.logistics-row-warning:focus-visible {
  box-shadow: 0 0 0 3px rgb(185 28 28 / 22%);
}

.logistics-bulk-assign {
  display: grid;
  grid-template-columns: minmax(92px, .7fr) minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  padding: 7px;
  border-top: 1px solid var(--panel-border);
  background: #f8fafc;
}

.logistics-bulk-assign div:first-child {
  display: grid;
  gap: 1px;
}

.logistics-bulk-assign strong {
  font-size: 12px;
}

.logistics-bulk-assign span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.logistics-bulk-assign select {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 8px;
}

.logistics-bulk-assign button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 9px;
}

.logistics-bulk-assign button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.logistics-route-card.logistics-route-compact {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, .8fr) auto;
  grid-template-areas:
    "identity facts actions"
    "capacity capacity capacity";
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border-left: 6px solid var(--route-color, var(--accent));
  border-radius: 6px;
  box-shadow: none;
  padding: 6px 10px 6px 12px;
}

.logistics-route-compact .route-card-header {
  grid-area: identity;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logistics-route-compact h2 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.05;
  overflow: hidden;
}

.logistics-route-compact h2 .logistics-detail-link {
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-route-compact h2 small {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-compact-line {
  grid-area: facts;
  display: grid;
  grid-template-columns: 58px minmax(82px, .8fr) 72px 76px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-compact-line > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-route-compact .capacity-bar {
  grid-area: capacity;
  grid-column: 1 / -1;
  height: 5px;
  margin: 0;
}

.logistics-route-compact .warning-badge,
.logistics-route-compact .route-actions {
  margin-top: 2px;
}

.logistics-route-compact .route-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

@media (max-width: 900px) {
  .logistics-route-card.logistics-route-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity actions"
      "facts facts"
      "capacity capacity";
  }
}

.logistics-route-compact .route-print-link,
.logistics-route-compact .route-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  text-decoration: none;
}

.logistics-route-compact .route-actions .route-add-trip-button {
  width: auto;
  min-width: 68px;
  border-color: #99f6e4;
  background: #ecfdf5;
  color: var(--accent-strong);
  padding: 0 8px;
}

.logistics-route-compact .route-print-link:hover,
.logistics-route-compact .route-actions button:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: var(--accent-strong);
}

.logistics-route-compact .route-actions button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.logistics-route-compact .status-pill {
  min-height: 28px;
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 12px;
  white-space: nowrap;
}

.logistics-approve-all-form button {
  min-height: 32px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ecfdf5;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

.logistics-release-board {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(320px, 1.1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
}

.logistics-release-panel,
.logistics-release-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.logistics-release-panel {
  overflow: hidden;
}

.logistics-release-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.logistics-release-summary span {
  border: 1px solid #d8e2ec;
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.logistics-release-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.logistics-release-actions button,
.logistics-release-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  text-decoration: none;
}

.logistics-release-actions form:first-child button {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: var(--accent-strong);
}

.logistics-release-list {
  overflow: auto;
}

.logistics-release-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 62px;
  gap: 8px;
  align-items: center;
  border: 1px solid #d8e2ec;
  border-left: 5px solid var(--route-color, var(--accent));
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 10px;
}

.logistics-release-list article.is-approved {
  background: #f0fdfa;
}

.logistics-release-list strong,
.logistics-release-list span,
.logistics-release-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-release-list strong {
  color: var(--text);
  font-size: 13px;
}

.logistics-release-list span,
.logistics-release-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.logistics-release-list a {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  padding: 6px 8px;
  text-align: center;
  text-decoration: none;
}

.logistics-modal-source {
  display: none;
}

.logistics-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 42%);
}

.logistics-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgb(15 23 42 / 28%);
}

.logistics-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.logistics-modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.logistics-modal header button {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.logistics-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.logistics-modal-body > .logistics-modal-source,
.logistics-detail-grid,
.logistics-detail-address,
.logistics-detail-warning,
.logistics-modal-list,
.logistics-modal-list-row,
.order-preview-content {
  display: grid;
}

.logistics-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.logistics-run-modal-source .logistics-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.logistics-run-modal-source .logistics-run-route-metric {
  grid-column: span 2;
}

.logistics-run-modal-source.has-profit-metrics .logistics-run-unit-metric,
.logistics-run-modal-source:not(.has-profit-metrics) .logistics-run-amount-metric,
.logistics-run-modal-source:not(.has-profit-metrics) .logistics-run-delivery-cost-metric,
.logistics-run-modal-source:not(.has-profit-metrics) .logistics-run-unit-metric {
  grid-column: span 2;
}

.logistics-order-modal-source .logistics-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.logistics-detail-grid > span,
.logistics-detail-address,
.logistics-detail-warning,
.logistics-modal-list-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.logistics-run-modal-source .logistics-detail-grid > span {
  display: grid;
  align-content: center;
  min-height: 66px;
  gap: 4px;
  border-color: #d8e2ec;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.logistics-run-modal-source .logistics-run-route-metric.is-missing {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fffaf0 0%, #fff7ed 100%);
}

.logistics-run-modal-source .logistics-run-route-metric.is-missing b {
  color: #c2410c;
  font-size: 14px;
}

.logistics-run-coordinate-review {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.logistics-order-modal-source .logistics-detail-grid > span {
  display: grid;
  align-content: start;
  min-height: 62px;
  gap: 5px;
  border-color: #d8e2ec;
  background: #ffffff;
}

.logistics-detail-grid small,
.logistics-detail-address small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.logistics-detail-grid b,
.logistics-detail-address b {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.logistics-run-modal-source .logistics-detail-grid b {
  font-size: 17px;
  line-height: 1.15;
}

.logistics-order-modal-source .logistics-detail-grid b {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.logistics-detail-address,
.logistics-detail-warning,
.order-preview-content,
.logistics-modal-list {
  gap: 6px;
  margin-top: 10px;
}

.logistics-order-modal-source .logistics-detail-address {
  gap: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

.logistics-order-modal-source .logistics-detail-address b {
  font-size: 16px;
}

.logistics-order-modal-source .logistics-detail-warning {
  gap: 8px;
  border-color: #fed7aa;
  background: #fff7ed;
  padding: 12px 14px;
}

.logistics-order-modal-source .logistics-detail-warning strong {
  color: #7c2d12;
  font-size: 15px;
}

.logistics-order-modal-source .logistics-detail-warning span {
  color: #9a3412;
  font-size: 13px;
  line-height: 1.25;
}

.logistics-order-modal-source .order-preview-content {
  gap: 10px;
  margin-top: 14px;
}

.logistics-order-modal-source .order-preview-title {
  font-size: 15px;
}

.logistics-order-modal-source .order-preview-table {
  border-color: #d8e2ec;
  border-radius: 8px;
}

.logistics-order-modal-source .order-preview-row {
  grid-template-columns: minmax(320px, 1fr) 82px 108px 82px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
}

.logistics-order-modal-source .order-preview-row > span {
  color: #334155;
  font-size: 14px;
  line-height: 1.25;
}

.logistics-order-modal-source .order-preview-row > span:not(:first-child) {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.logistics-order-modal-source .order-preview-profit {
  border-radius: 8px;
  font-size: 14px;
  padding: 11px 14px;
}

.logistics-run-modal-source .logistics-modal-list {
  gap: 8px;
  margin-top: 14px;
}

.logistics-modal-list-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.logistics-detail-address.is-uncertain {
  background: #fffbeb;
}

.logistics-detail-address.is-missing,
.logistics-detail-warning {
  background: #fff7ed;
}

.logistics-detail-warning span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.logistics-modal-list-row {
  grid-template-columns: 90px minmax(0, 1fr) minmax(160px, 1.1fr) auto;
  gap: 8px;
  align-items: center;
}

.logistics-run-modal-source .logistics-modal-list-row {
  grid-template-columns: 72px minmax(0, 1fr) minmax(220px, 250px) 34px;
  grid-template-areas:
    "order customer transfer remove"
    "order meta transfer remove";
  gap: 5px 10px;
  min-height: 64px;
  padding: 9px 11px;
  border-color: #d8e2ec;
  background: #ffffff;
  box-shadow: 0 4px 12px rgb(15 23 42 / 5%);
}

.logistics-modal-list-row > * {
  min-width: 0;
}

.logistics-modal-list-row span,
.logistics-modal-list-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-modal-list-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logistics-run-modal-source .logistics-modal-order-link {
  grid-area: order;
  align-self: center;
  color: var(--text);
  font-size: 17px;
  text-align: left;
}

.logistics-run-modal-source .logistics-modal-order-link:hover {
  color: var(--accent-strong);
}

.logistics-modal-list-customer {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.logistics-run-modal-source .logistics-modal-list-customer {
  grid-area: customer;
}

.logistics-coordinate-status {
  display: inline-grid !important;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  overflow: visible !important;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.logistics-modal-list-row button.logistics-coordinate-retry {
  width: 24px;
  height: 24px;
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
  padding: 0;
}

.logistics-coordinate-status.is-missing {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.logistics-modal-list-row button.logistics-coordinate-retry:hover {
  border-color: #f97316;
  background: #ffedd5;
  color: #9a3412;
}

.logistics-modal-list-row button.logistics-coordinate-retry.is-pending {
  cursor: progress;
  animation: logistics-coordinate-retry-pulse 900ms ease-in-out infinite;
}

@keyframes logistics-coordinate-retry-pulse {
  50% {
    opacity: .45;
    transform: rotate(180deg);
  }
}

.logistics-run-modal-source .logistics-modal-list-row small {
  display: grid;
  grid-template-columns: minmax(90px, .45fr) auto minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
}

.logistics-run-modal-source .logistics-modal-list-meta {
  grid-area: meta;
}

.logistics-run-modal-source .logistics-modal-list-row small b {
  flex: 0 0 auto;
  color: #334155;
}

.logistics-run-modal-source .logistics-modal-list-row small span {
  min-width: 0;
}

.logistics-run-modal-source .logistics-modal-list-weight {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.logistics-run-transfer-form {
  grid-area: transfer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
}

.logistics-run-remove-form {
  grid-area: remove;
  align-self: center;
}

.logistics-run-transfer-form select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 0 7px;
}

.logistics-modal-list-row button {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  font-weight: 900;
}

.logistics-run-modal-source .logistics-modal-list-row button:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.logistics-run-modal-source .logistics-run-transfer-form button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 760px) {
  .logistics-modal-backdrop {
    padding: 8px;
  }

  .logistics-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .logistics-run-modal-source .logistics-detail-grid,
  .logistics-order-modal-source .logistics-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistics-run-modal-source .logistics-run-route-metric,
  .logistics-run-modal-source.has-profit-metrics .logistics-run-unit-metric,
  .logistics-run-modal-source:not(.has-profit-metrics) .logistics-run-unit-metric {
    grid-column: span 1;
  }

  .logistics-run-modal-source .logistics-modal-list-row {
    grid-template-columns: 64px minmax(0, 1fr) 34px;
    grid-template-areas:
      "order customer remove"
      "meta meta meta"
      "transfer transfer transfer";
    align-items: start;
  }

  .logistics-run-modal-source .logistics-modal-order-link,
  .logistics-run-remove-form {
    align-self: start;
  }

  .logistics-run-modal-source .logistics-modal-list-row small {
    grid-template-columns: minmax(80px, .45fr) auto minmax(120px, 1fr);
  }
}

@media (max-width: 480px) {
  .logistics-run-modal-source .logistics-modal-list-row small {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .logistics-run-modal-source .logistics-modal-list-address {
    grid-column: 1 / -1;
  }
}

.order-preview-anchor .order-preview-tooltip {
  display: none !important;
}

.sales-orders-panel {
  width: calc(100vw - 56px);
  max-width: calc(100vw - 56px);
  margin-left: calc(50% - 50vw + 28px);
  overflow-x: auto;
}

.sales-orders-panel table {
  table-layout: fixed;
  min-width: 1480px;
}

.sales-orders-panel th,
.sales-orders-panel td {
  padding: 10px 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: normal;
}

.sales-orders-panel th:nth-child(1),
.sales-orders-panel td:nth-child(1) {
  width: 92px;
}

.sales-orders-panel th:nth-child(2),
.sales-orders-panel td:nth-child(2) {
  width: 120px;
}

.sales-orders-panel th:nth-child(3),
.sales-orders-panel td:nth-child(3),
.sales-orders-panel th:nth-child(4),
.sales-orders-panel td:nth-child(4) {
  width: 17%;
}

.sales-orders-panel th:nth-child(5),
.sales-orders-panel td:nth-child(5) {
  width: 12%;
}

.sales-orders-panel th:nth-child(6),
.sales-orders-panel td:nth-child(6) {
  width: 13%;
}

.sales-orders-panel th:nth-child(7),
.sales-orders-panel td:nth-child(7) {
  width: 10%;
}

.sales-orders-panel th:nth-child(8),
.sales-orders-panel td:nth-child(8) {
  width: 130px;
}

.sales-orders-panel th:nth-child(9),
.sales-orders-panel td:nth-child(9) {
  width: 96px;
  white-space: nowrap;
}

.sales-orders-panel .money-col {
  white-space: nowrap;
}

.sales-order-link.is-loading {
  color: var(--muted);
}


.purchase-orders-panel {
  width: calc(100vw - 56px);
  max-width: calc(100vw - 56px);
  margin-left: calc(50% - 50vw + 28px);
  overflow: hidden;
}

.purchase-orders-panel table {
  table-layout: fixed;
}

.purchase-orders-panel th,
.purchase-orders-panel td {
  padding: 10px 11px;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
}

.purchase-orders-panel th:nth-child(1),
.purchase-orders-panel td:nth-child(1) {
  width: 96px;
}

.purchase-orders-panel th:nth-child(2),
.purchase-orders-panel td:nth-child(2) {
  width: 118px;
}

.purchase-orders-panel th:nth-child(3),
.purchase-orders-panel td:nth-child(3),
.purchase-orders-panel th:nth-child(4),
.purchase-orders-panel td:nth-child(4) {
  width: 15%;
}

.purchase-orders-panel th:nth-child(5),
.purchase-orders-panel td:nth-child(5) {
  width: 12%;
}

.purchase-orders-panel th:nth-child(6),
.purchase-orders-panel td:nth-child(6) {
  width: 13%;
}

.purchase-orders-panel th:nth-child(7),
.purchase-orders-panel td:nth-child(7) {
  width: 10%;
}

.purchase-orders-panel th:nth-child(8),
.purchase-orders-panel td:nth-child(8) {
  width: 112px;
}

.purchase-orders-panel th:nth-child(9),
.purchase-orders-panel td:nth-child(9) {
  width: 116px;
}

.purchase-orders-panel th:nth-child(10),
.purchase-orders-panel td:nth-child(10) {
  width: 88px;
}

.table-link {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
  text-decoration: none;
}

.table-link:hover,
.table-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.table-link:disabled {
  cursor: wait;
  opacity: .65;
}

.purchase-order-link {
  overflow-wrap: anywhere;
}

.purchase-order-modal {
  width: min(1180px, calc(100vw - 36px));
}

.purchase-order-modal-body {
  padding: 16px;
}

.purchase-order-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.purchase-order-modal-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  align-content: start;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.purchase-order-modal-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.purchase-order-modal-summary b {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.purchase-order-comment {
  margin-top: 10px;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.purchase-order-lines-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
}

.purchase-order-lines-table {
  table-layout: fixed;
  min-width: 860px;
}

.purchase-order-lines-table th,
.purchase-order-lines-table td {
  padding: 10px 12px;
}

.purchase-order-lines-table th:nth-child(1),
.purchase-order-lines-table td:nth-child(1) {
  width: 44%;
}

.purchase-order-lines-table th:nth-child(2),
.purchase-order-lines-table td:nth-child(2) {
  width: 22%;
}

.purchase-order-lines-table th:nth-child(3),
.purchase-order-lines-table td:nth-child(3),
.purchase-order-lines-table th:nth-child(4),
.purchase-order-lines-table td:nth-child(4),
.purchase-order-lines-table th:nth-child(5),
.purchase-order-lines-table td:nth-child(5) {
  width: 11%;
}


.purchase-order-totals-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid #d8e2ec;
  background: #f8fafc;
}

.purchase-order-totals-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.purchase-order-totals-row span + span {
  border-left: 1px solid #d8e2ec;
}

.purchase-order-totals-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.purchase-order-totals-row b {
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.purchase-order-line-product strong,
.purchase-order-line-product small,
.purchase-order-line-canceled {
  display: block;
  overflow-wrap: anywhere;
}

.purchase-order-line-product small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.purchase-order-line-canceled {
  margin-top: 5px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .purchase-orders-panel {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    margin-left: calc(50% - 50vw + 14px);
    overflow-x: auto;
  }

  .purchase-orders-panel table {
    min-width: 920px;
  }

  .purchase-order-modal-summary,
  .purchase-order-totals-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .purchase-order-modal-summary,
  .purchase-order-totals-row {
    grid-template-columns: 1fr;
  }

  .purchase-order-totals-row span + span {
    border-top: 1px solid #d8e2ec;
    border-left: 0;
  }
}

.dispatch-page {
  display: grid;
  gap: 10px;
  min-height: calc(100vh - 150px);
}

.logistics-dispatch-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
  padding: 10px;
}

.logistics-dispatch-tab-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #d8e2ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgb(15 23 42 / 4%);
  padding: 10px 12px;
}

.logistics-dispatch-tab-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-dispatch-tab-head strong {
  color: var(--text);
  font-size: 15px;
}

.logistics-dispatch-tab-title span {
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.logistics-dispatch-stage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 6px;
}

.logistics-dispatch-stage-summary > span {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px 8px;
}

.logistics-dispatch-stage-summary b {
  color: var(--text);
  font-size: 16px;
}

.logistics-dispatch-stage-summary small {
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.logistics-dispatch-stage-summary .is-release {
  border-color: #fde68a;
  background: #fffbeb;
}

.logistics-dispatch-stage-summary .is-road {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.logistics-dispatch-stage-summary .is-returned {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.logistics-dispatch-back-button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.dispatch-board.is-embedded {
  flex: 1;
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.dispatch-board.is-embedded .dispatch-column > div {
  overflow-y: auto;
}

.logistics-board-live.is-dispatch-view {
  grid-template-columns: minmax(0, 1fr);
}

.logistics-board-live.is-dispatch-view > .logistics-queue-panel {
  display: none;
}

.logistics-board-live.is-dispatch-view > .logistics-routes-panel > .table-summary {
  display: none;
}

.logistics-board-live.is-dispatch-view .logistics-route-tabs {
  grid-template-columns: repeat(5, minmax(130px, 180px));
  justify-content: start;
  border-bottom: 1px solid #d8e2ec;
  background: #ffffff;
  padding: 8px 10px;
}

.logistics-board-live.is-dispatch-view .logistics-route-tabs button {
  min-height: 36px;
  font-size: 12px;
}

.logistics-board-live.is-dispatch-view .logistics-dispatch-tab-panel.active {
  padding: 12px;
}

.logistics-board-live.is-dispatch-view .dispatch-board.is-embedded {
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  .logistics-dispatch-tab-head {
    grid-template-columns: 1fr auto;
  }

  .logistics-dispatch-stage-summary {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .logistics-board-live.is-dispatch-view .logistics-route-tabs {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
  }
}

.dispatch-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0;
}

.dispatch-toolbar label {
  display: grid;
  gap: 4px;
}

.dispatch-toolbar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-toolbar input,
.dispatch-toolbar select {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 7px 10px;
}

.dispatch-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ecfdf5;
  color: var(--accent-strong);
  font-weight: 900;
  padding: 7px 12px;
  text-decoration: none;
}

.dispatch-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dispatch-summary article {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.dispatch-summary strong,
.dispatch-summary span {
  display: block;
}

.dispatch-summary strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.dispatch-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 10px;
  min-height: 0;
}

.dispatch-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fafc;
}

.dispatch-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--panel-border);
  background: #ffffff;
  padding: 10px 12px;
}

.dispatch-column > header strong {
  color: var(--text);
}

.dispatch-column > header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 900;
}

.dispatch-column.is-release > header {
  box-shadow: inset 0 3px 0 #f59e0b;
}

.dispatch-column.is-road > header {
  box-shadow: inset 0 3px 0 #7c3aed;
}

.dispatch-column.is-returned > header {
  box-shadow: inset 0 3px 0 #0f766e;
}

.dispatch-column > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.dispatch-run-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e2ec;
  border-left: 5px solid var(--route-color, var(--accent));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgb(15 23 42 / 5%);
  padding: 10px;
}

.dispatch-run-card.is-problem {
  background: #fff7ed;
  border-color: #fed7aa;
}

.dispatch-run-card.is-available {
  background: #f8fafc;
}

.dispatch-run-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.dispatch-run-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dispatch-run-card strong,
.dispatch-run-card span,
.dispatch-run-card b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-run-card strong {
  display: block;
  color: var(--accent-strong);
  font-size: 14px;
}

.dispatch-run-card header span,
.dispatch-run-timeline small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.dispatch-run-name {
  display: flex !important;
  gap: 5px;
  align-items: center;
}

.dispatch-run-name > span {
  color: var(--accent-strong) !important;
  font-size: 14px !important;
}

.dispatch-run-badges {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.dispatch-run-card header .dispatch-run-plan-date {
  width: max-content;
  margin-top: 3px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 6px;
}

.dispatch-run-card header b {
  flex: 0 0 auto;
  align-self: start;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--accent-strong);
  font-size: 11px;
  padding: 4px 8px;
}

.dispatch-run-card.status-approved header > b {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.dispatch-run-card.status-printed header > b,
.dispatch-run-card.status-loading header > b {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.dispatch-run-card.status-departed header > b {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
}

.dispatch-run-card.status-returned header > b {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.dispatch-run-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.dispatch-run-facts span {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  padding: 6px;
  text-align: left;
}

.dispatch-run-facts small {
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-run-facts b {
  color: #1e293b;
  font-size: 11px;
  font-weight: 900;
}

.dispatch-run-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 5px;
}

.dispatch-run-timeline span {
  display: grid;
  gap: 1px;
  border-left: 2px solid #cbd5e1;
  padding-left: 6px;
}

.dispatch-run-timeline b {
  color: #334155;
  font-size: 11px;
}

.dispatch-run-problem-note {
  margin: 0;
  border-radius: 7px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 8px;
}

.dispatch-run-orders {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.dispatch-run-orders summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  color: #475569;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  list-style: none;
  padding: 6px 8px;
}

.dispatch-run-orders summary::-webkit-details-marker {
  display: none;
}

.dispatch-run-orders summary::before {
  content: "▸";
  color: #64748b;
}

.dispatch-run-orders[open] summary::before {
  content: "▾";
}

.dispatch-run-orders summary > span {
  flex: 1;
}

.dispatch-run-orders summary > b {
  min-width: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  padding: 3px 6px;
  text-align: center;
}

.dispatch-run-orders > div {
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid #e2e8f0;
}

.dispatch-run-order {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 3px 7px;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 7px 8px;
}

.dispatch-run-order:last-child {
  border-bottom: 0;
}

.dispatch-run-order > b {
  color: #0f766e;
  font-size: 12px;
}

.dispatch-run-order > span {
  color: #1e293b;
  font-size: 11px;
  font-weight: 900;
}

.dispatch-run-order > strong {
  color: #334155;
  font-size: 10px;
  text-align: right;
}

.dispatch-run-order > small {
  grid-column: 2 / -1;
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-run-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dispatch-run-actions form {
  display: contents;
}

.dispatch-run-actions button,
.dispatch-run-actions a {
  min-height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  text-decoration: none;
}

.dispatch-run-actions .primary {
  border-color: #99f6e4;
  background: #0f766e;
  color: #ffffff;
}

.dispatch-run-actions .dispatch-manual-add-button {
  border-color: #7dd3c7;
  background: #e8faf7;
  color: #006b64;
}

.dispatch-run-actions .danger {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.logistics-board-live.is-dispatch-view .dispatch-run-card {
  gap: 10px;
  padding: 12px;
}

.logistics-board-live.is-dispatch-view .dispatch-run-actions button,
.logistics-board-live.is-dispatch-view .dispatch-run-actions a {
  min-height: 32px;
  padding: 6px 10px;
}

.logistics-manual-add-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(820px, calc(100vw - 36px));
  max-height: min(780px, calc(100dvh - 36px));
}

.logistics-manual-add-modal header {
  align-items: flex-start;
}

.logistics-manual-add-modal header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.logistics-manual-add-modal header p {
  max-width: 680px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.dispatch-manual-add-body {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr);
  grid-auto-rows: auto;
  gap: 10px;
  overflow: hidden;
}

.dispatch-manual-add-search {
  display: grid;
  gap: 5px;
}

.dispatch-manual-add-search > span {
  color: #52636d;
  font-size: 11px;
  font-weight: 900;
}

.dispatch-manual-add-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b8c8cf;
  border-radius: 9px;
  background: #ffffff;
  color: #17242b;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 8px 11px;
}

.dispatch-manual-add-results {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #d6e1e4;
  border-radius: 10px;
  background: #f7fafb;
  padding: 7px;
}

.dispatch-manual-add-candidate {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 88px 24px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid #d6e1e4;
  border-radius: 9px;
  background: #ffffff;
  color: #1f2b33;
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
  text-align: left;
}

.dispatch-manual-add-candidate:hover,
.dispatch-manual-add-candidate.is-selected {
  border-color: #37b8aa;
  background: #effbf9;
  box-shadow: inset 0 0 0 1px #8adbd2;
}

.dispatch-manual-add-candidate > b {
  color: #00756d;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-manual-add-candidate > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dispatch-manual-add-candidate strong,
.dispatch-manual-add-candidate small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-manual-add-candidate strong {
  color: #1f2937;
  font-size: 13px;
}

.dispatch-manual-add-candidate small {
  color: #75858e;
  font-size: 11px;
  font-weight: 750;
}

.dispatch-manual-add-candidate > em {
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.dispatch-manual-add-candidate > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff1e8;
  color: #b54708;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.dispatch-manual-add-empty,
.dispatch-manual-add-more {
  color: #71808a;
  font-size: 12px;
  font-weight: 750;
  padding: 14px;
  text-align: center;
}

.dispatch-manual-add-selection {
  display: grid;
  gap: 3px;
  border: 1px solid #9bddd6;
  border-radius: 9px;
  background: #effbf9;
  padding: 9px 11px;
}

.dispatch-manual-add-selection[hidden],
.dispatch-manual-add-overload[hidden],
.dispatch-manual-add-reprint[hidden] {
  display: none;
}

.dispatch-manual-add-selection strong {
  color: #006b64;
  font-size: 13px;
}

.dispatch-manual-add-selection span,
.dispatch-manual-add-selection small {
  color: #52636d;
  font-size: 11px;
  font-weight: 800;
}

.dispatch-manual-add-selection small {
  color: #b54708;
}

.dispatch-manual-add-overload {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid #fca5a5;
  border-radius: 9px;
  background: #fff1f2;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.dispatch-manual-add-overload input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.dispatch-manual-add-reprint {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid #fbbf24;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.dispatch-manual-add-reprint input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.dispatch-manual-add-message {
  min-height: 18px;
  margin: 0;
  color: #52636d;
  font-size: 12px;
  font-weight: 850;
}

.dispatch-manual-add-message.is-error {
  color: #b42318;
}

.dispatch-manual-add-message.is-success {
  color: #067647;
}

.dispatch-manual-add-message.is-progress {
  color: #006b64;
}

.dispatch-manual-add-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding: 11px 14px;
}

.dispatch-manual-add-footer button {
  min-height: 40px;
  border: 1px solid #b8c8cf;
  border-radius: 8px;
  background: #ffffff;
  color: #41525c;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 13px;
}

.dispatch-manual-add-footer button.primary {
  border-color: #00877f;
  background: #00877f;
  color: #ffffff;
}

.dispatch-manual-add-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.logistics-modal-open {
  overflow: hidden;
}

.logistics-manual-add-backdrop.is-submitting .logistics-manual-add-modal {
  cursor: progress;
}

@media (max-width: 760px) {
  .logistics-manual-add-backdrop {
    place-items: stretch;
    padding: 8px;
  }

  .logistics-manual-add-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .logistics-manual-add-modal h2 {
    font-size: 16px;
  }

  .dispatch-manual-add-body {
    padding: 10px;
  }

  .dispatch-manual-add-candidate {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    min-height: 64px;
  }

  .dispatch-manual-add-candidate > i {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .dispatch-manual-add-footer button {
    min-height: 44px;
  }
}

@media (max-width: 1180px) {
  .dispatch-board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .dispatch-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.summary-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.access-view-form {
  width: 100%;
  padding: 8px 10px;
}

.access-view-form select {
  width: 100%;
  min-width: 180px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 7px 9px;
}

.access-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #f4c56b;
  border-radius: 8px;
  background: #fff8e6;
  color: #5f3b00;
}

.access-view-banner form {
  margin: 0;
}

.access-view-banner button,
.access-profile-actions button,
.access-group-form button {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.access-group-cell {
  min-width: 260px;
}

.access-group-form {
  display: grid;
  gap: 8px;
}

.access-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 6px 10px;
}

.access-group-options label,
.permission-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.access-group-options input,
.permission-check input {
  margin-top: 3px;
}

.access-overview {
  display: grid;
  gap: 18px;
}

.access-profile {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.access-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-header-bg);
  cursor: pointer;
  list-style: none;
}

.access-profile-header::-webkit-details-marker {
  display: none;
}

.access-profile-header::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.access-profile:not([open]) .access-profile-header {
  border-bottom: 0;
}

.access-profile:not([open]) .access-profile-header::after {
  transform: rotate(-45deg);
}

.access-profile-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.access-profile-header p {
  margin: 0;
  color: var(--muted);
}

.access-profile-header > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: auto;
}

.access-module {
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--panel-border);
}

.access-module legend {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 18px;
  margin-top: 10px;
}

.permission-check span {
  display: grid;
  gap: 2px;
}

.permission-check strong {
  font-size: 14px;
}

.permission-check small {
  color: var(--muted);
  line-height: 1.35;
}

.access-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
}

.access-profile-actions span {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .permission-grid,
  .access-group-options {
    grid-template-columns: 1fr;
  }

  .access-view-banner,
  .access-profile-header {
    align-items: stretch;
    flex-direction: column;
  }
}

.user-password-note {
  margin: 0 0 14px;
}

.user-password-cell {
  min-width: 250px;
}

.password-reset-form {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(78px, 0.85fr) auto;
  gap: 6px;
  align-items: center;
}

.password-reset-form input {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 8px 9px;
}

.password-reset-form button {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 10px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .password-reset-form {
    grid-template-columns: 1fr;
  }
}


.inline-admin-form {
  margin-top: 8px;
}

.inline-admin-form button,
.admin-user-actions button,
.access-copy-form button,
.access-scopes-form button,
.admin-panel button,
.table-panel td form button {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 10px;
  white-space: nowrap;
}

.password-reset-form {
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 0.9fr);
}

.compact-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}

.compact-check input {
  margin: 0;
}

.password-reset-form button {
  grid-column: 1 / -1;
}

.user-badge.inactive {
  background: #e9edf3;
  color: #5d6777;
}

.muted-row {
  opacity: 0.72;
}

.effective-access-cell {
  min-width: 220px;
}

.effective-access-cell summary {
  cursor: pointer;
  font-weight: 800;
}

.effective-access-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
}

.effective-access-list span {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-actions {
  display: grid;
  gap: 6px;
}

.access-scopes-form {
  border-top: 1px solid var(--panel-border);
  padding: 16px 18px 0;
}

.access-scopes-form h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.scope-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.scope-grid textarea {
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 9px 10px;
}

.access-copy-form {
  display: flex;
  justify-content: flex-start;
  padding: 0 18px 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  padding: 16px 18px;
}

.admin-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.status-list,
.metric-grid {
  display: grid;
  gap: 10px;
}

.status-list > div,
.metric-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
}

.metric-grid span {
  color: var(--muted);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.status-pill.ok {
  background: #e8f7ee;
  color: #0f6b38;
}

.status-pill.bad {
  background: #fdecec;
  color: #9b1c1c;
}

.mermaid-workspace {
  margin-bottom: 18px;
}

.mermaid-workspace-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mermaid-workspace-head h2 {
  margin: 0 0 4px;
}

.mermaid-workspace-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.mermaid-editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(320px, 1fr);
  gap: 16px;
}

.mermaid-source-box,
.mermaid-preview-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mermaid-source-box span,
.mermaid-preview-box > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mermaid-source-box textarea {
  width: 100%;
  min-height: 320px;
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 12px;
}

.mermaid-preview {
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.mermaid {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: auto;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

.mermaid-render-error,
.mermaid-preview-empty {
  color: #9b1c1c;
  font-weight: 800;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .scope-grid,
  .admin-grid,
  .mermaid-editor-grid {
    grid-template-columns: 1fr;
  }

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


.user-create-panel {
  margin: 0 0 16px;
  overflow: visible;
}

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

.user-create-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.user-create-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.user-create-field span,
.user-create-groups legend,
.user-create-flags legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-create-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
}

.user-create-access-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.45fr);
  gap: 12px;
}

.user-create-groups,
.user-create-flags {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px 12px;
}

.user-create-group-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px 14px;
}

.user-create-flags {
  align-content: start;
  display: grid;
  gap: 8px;
}

.user-create-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
}

.user-create-check input {
  flex: 0 0 auto;
  margin: 0;
}

.user-create-check span {
  min-width: 0;
}

.user-create-actions {
  display: flex;
  justify-content: flex-start;
}

.user-create-actions button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
}

@media (max-width: 1180px) {
  .user-create-fields {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .user-create-access-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .user-create-fields,
  .user-create-group-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payments-toolbar {
    grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(140px, .3fr)) auto;
  }

  .payments-toolbar .toolbar-field,
  .payments-toolbar .secondary-link {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .dashboard-metric-grid,
  .dashboard-money-panel,
  .dashboard-money-grid,
  .dashboard-reserve-panel,
  .dashboard-profit-panel,
  .dashboard-report-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-title {
    align-items: flex-start;
  }

  .dashboard-money-head,
  .dashboard-report-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-money-item + .dashboard-money-item {
    border-left: 0;
  }

  .dashboard-reserve-aside {
    border-left: 0;
  }

  .dashboard-profit-cell {
    border-left: 0;
  }
}

@media (max-width: 1180px) {
  .document-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, .35fr)) auto;
  }

  .document-toolbar .secondary-link {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .payments-toolbar {
    grid-template-columns: 1fr;
  }

  .payments-toolbar .toolbar-field,
  .payments-toolbar .secondary-link {
    grid-column: auto;
  }
}


.trade-rep-kpi.is-clickable,
.trade-rep-stat.is-clickable,
.trade-rep-gap-list a,
.trade-rep-group-link {
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.trade-rep-kpi.is-clickable:hover,
.trade-rep-kpi.is-clickable:focus-visible,
.trade-rep-stat.is-clickable:hover,
.trade-rep-stat.is-clickable:focus-visible,
.trade-rep-gap-list a:hover,
.trade-rep-gap-list a:focus-visible,
.trade-rep-group-link:hover,
.trade-rep-group-link:focus-visible {
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rep-accent) 28%, var(--line));
  outline: none;
}

.trade-rep-gap-list a,
.trade-rep-group-link {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.trade-rep-group-link {
  gap: 7px;
}

.trade-rep-group-list li {
  padding: 0;
}

.trade-rep-group-link {
  padding: 11px;
}

.trade-rep-kpi[data-tooltip],
.trade-rep-stat[data-tooltip],
.trade-rep-gap-list a[data-tooltip],
.trade-rep-group-link[data-tooltip] {
  position: relative;
}

.trade-rep-kpi[data-tooltip]:hover,
.trade-rep-stat[data-tooltip]:hover,
.trade-rep-gap-list a[data-tooltip]:hover,
.trade-rep-group-link[data-tooltip]:hover,
.trade-rep-kpi[data-tooltip]:focus-visible,
.trade-rep-stat[data-tooltip]:focus-visible,
.trade-rep-gap-list a[data-tooltip]:focus-visible,
.trade-rep-group-link[data-tooltip]:focus-visible {
  z-index: 120;
}

.trade-rep-kpi[data-tooltip]::before,
.trade-rep-stat[data-tooltip]::before,
.trade-rep-gap-list a[data-tooltip]::before,
.trade-rep-group-link[data-tooltip]::before,
.trade-rep-kpi[data-tooltip]::after,
.trade-rep-stat[data-tooltip]::after,
.trade-rep-gap-list a[data-tooltip]::after,
.trade-rep-group-link[data-tooltip]::after {
  position: absolute;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

.trade-rep-kpi[data-tooltip]::before,
.trade-rep-stat[data-tooltip]::before,
.trade-rep-gap-list a[data-tooltip]::before,
.trade-rep-group-link[data-tooltip]::before {
  content: "";
  left: 22px;
  top: calc(100% + 2px);
  border: 7px solid transparent;
  border-bottom-color: #111827;
  transform: translateY(-4px);
}

.trade-rep-kpi[data-tooltip]::after,
.trade-rep-stat[data-tooltip]::after,
.trade-rep-gap-list a[data-tooltip]::after,
.trade-rep-group-link[data-tooltip]::after {
  content: attr(data-tooltip);
  left: 10px;
  top: calc(100% + 15px);
  width: min(360px, calc(100vw - 44px));
  max-width: 360px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  box-shadow: 0 16px 38px rgb(15 23 42 / 22%);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  transform: translateY(-4px);
}

.trade-rep-kpi[data-tooltip]:hover::before,
.trade-rep-stat[data-tooltip]:hover::before,
.trade-rep-gap-list a[data-tooltip]:hover::before,
.trade-rep-group-link[data-tooltip]:hover::before,
.trade-rep-kpi[data-tooltip]:focus-visible::before,
.trade-rep-stat[data-tooltip]:focus-visible::before,
.trade-rep-gap-list a[data-tooltip]:focus-visible::before,
.trade-rep-group-link[data-tooltip]:focus-visible::before,
.trade-rep-kpi[data-tooltip]:hover::after,
.trade-rep-stat[data-tooltip]:hover::after,
.trade-rep-gap-list a[data-tooltip]:hover::after,
.trade-rep-group-link[data-tooltip]:hover::after,
.trade-rep-kpi[data-tooltip]:focus-visible::after,
.trade-rep-stat[data-tooltip]:focus-visible::after,
.trade-rep-gap-list a[data-tooltip]:focus-visible::after,
.trade-rep-group-link[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .trade-rep-kpi[data-tooltip]::after,
  .trade-rep-stat[data-tooltip]::after,
  .trade-rep-gap-list a[data-tooltip]::after,
  .trade-rep-group-link[data-tooltip]::after {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
}

.trade-detail-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.trade-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--panel-raised-border);
  border-top: 4px solid var(--rep-accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.trade-detail-head div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.trade-detail-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.12;
}

.trade-detail-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trade-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  min-width: 0;
}

.trade-detail-summary div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trade-detail-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-detail-summary strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.trade-detail-table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--panel-raised-shadow);
}

.trade-detail-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.trade-detail-table th,
.trade-detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.trade-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trade-detail-table td {
  color: var(--text);
  font-weight: 700;
}

.trade-detail-table td a {
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.trade-detail-table tr:hover td {
  background: #fbfdff;
}

@media (max-width: 760px) {
  .trade-detail-head {
    display: grid;
  }

  .trade-detail-table {
    min-width: 720px;
  }
}

/* Dashboard mobile app shell */
.dashboard-body,
.dashboard-body .page-shell,
.dashboard-body .dashboard-page {
  min-width: 0;
}

@media (max-width: 760px) {
  body.dashboard-body {
    width: 100%;
    overflow-x: hidden;
    background: #eef2f7;
  }

  .dashboard-body .app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    gap: 10px;
    padding: 10px 10px 8px;
    background: rgb(255 255 255 / 96%);
    border-bottom: 1px solid #dbe3ec;
    box-shadow: 0 10px 28px rgb(15 23 42 / 10%);
    backdrop-filter: blur(14px) saturate(1.15);
  }

  .dashboard-body .header-left,
  .dashboard-body .header-right,
  .dashboard-body .brand,
  .dashboard-body .top-nav {
    width: 100%;
  }

  .dashboard-body .header-left,
  .dashboard-body .header-right {
    gap: 8px;
  }

  .dashboard-body .brand {
    min-height: 34px;
  }

  .dashboard-body .brand-mark {
    width: 36px;
    height: 30px;
    border-radius: 8px;
  }

  .dashboard-body .brand-name {
    font-size: 16px;
  }

  .dashboard-body .top-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-body .nav-group,
  .dashboard-body .user-menu {
    min-width: 0;
  }

  .dashboard-body .top-nav button {
    width: 100%;
    min-height: 36px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-body .top-nav button.active,
  .dashboard-body .top-nav button:hover,
  .dashboard-body .top-nav button:focus-visible {
    border-color: #bbf7d0;
    background: #ecfdf5;
  }

  .dashboard-body .nav-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    border-radius: 8px;
    box-shadow: none;
  }

  .dashboard-body .nav-menu a {
    white-space: normal;
    line-height: 1.2;
  }

  .dashboard-body .header-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .dashboard-body .data-freshness-indicator {
    min-width: 0;
    min-height: 38px;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 10px;
  }

  .dashboard-body .data-freshness-indicator [data-freshness-text] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-body .user-menu > button {
    width: 100%;
    max-width: 132px;
    min-height: 38px;
    overflow: hidden;
    border-radius: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-body .user-menu-panel {
    right: 0;
    left: auto;
    width: min(270px, calc(100vw - 20px));
    min-width: 0;
  }

  .dashboard-body .page-shell {
    width: 100%;
    max-width: none;
    padding: 10px 10px 18px;
  }

  .dashboard-body .dashboard-page {
    gap: 10px;
  }

  .dashboard-body .dashboard-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgb(15 23 42 / 8%);
  }

  .dashboard-body .dashboard-tab {
    width: 100%;
    min-height: 40px;
    padding: 8px 7px;
    border: 1px solid transparent;
    text-align: center;
    line-height: 1.15;
    white-space: normal;
  }

  .dashboard-body .dashboard-tab.is-active {
    box-shadow: 0 8px 18px rgb(15 118 110 / 18%);
  }

  .dashboard-body .dashboard-metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-body .dashboard-metric-card,
  .dashboard-body .dashboard-operational-toolbar,
  .dashboard-body .dashboard-money-panel,
  .dashboard-body .dashboard-reserve-panel,
  .dashboard-body .dashboard-profit-panel,
  .dashboard-body .trade-reps-toolbar,
  .dashboard-body .trade-rep-block {
    border-radius: 10px;
    box-shadow: 0 8px 22px rgb(15 23 42 / 8%);
  }

  .dashboard-body .dashboard-metric-card {
    min-height: 126px;
    gap: 8px;
    padding: 14px;
  }

  .dashboard-body .dashboard-metric-card strong {
    font-size: 30px;
  }

  .dashboard-body .dashboard-metric-total b,
  .dashboard-body .money-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .dashboard-body .dashboard-money-head,
  .dashboard-body .dashboard-money-item,
  .dashboard-body .dashboard-reserve-link,
  .dashboard-body .dashboard-reserve-aside,
  .dashboard-body .dashboard-profit-main,
  .dashboard-body .dashboard-profit-cell {
    padding: 14px;
  }

  .dashboard-body .dashboard-money-head strong,
  .dashboard-body .dashboard-reserve-link strong,
  .dashboard-body .dashboard-profit-main strong {
    font-size: 26px;
  }

  .dashboard-body .dashboard-money-item b,
  .dashboard-body .dashboard-profit-cell b {
    font-size: 20px;
  }

  .dashboard-body .trade-reps-toolbar {
    gap: 12px;
    padding: 14px;
  }

  .dashboard-body .dashboard-operational-toolbar {
    padding: 14px;
  }

  .dashboard-body .dashboard-operational-period {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .dashboard-body .trade-reps-heading h1 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .dashboard-body .trade-reps-settings-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #ecfdf5;
    padding: 8px 10px;
    text-align: center;
  }

  .dashboard-body .trade-reps-period-switch,
  .dashboard-body .trade-reps-period-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-body .trade-rep-header {
    gap: 10px;
    padding: 14px 14px 0;
  }

  .dashboard-body .trade-rep-header h2 {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .dashboard-body .trade-rep-header b {
    line-height: 1.2;
    white-space: normal;
  }

  .dashboard-body .trade-rep-kpi,
  .dashboard-body .trade-rep-stat {
    padding: 12px;
  }

  .dashboard-body .trade-rep-kpi strong {
    font-size: 22px;
  }

  .dashboard-body .trade-rep-stat strong {
    font-size: 18px;
  }

  .dashboard-body .trade-rep-panel {
    padding: 14px;
  }

  .dashboard-body .trade-rep-group-list span {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 380px) and (max-width: 760px) {
  .dashboard-body .top-nav,
  .dashboard-body .dashboard-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-body .dashboard-metric-grid,
  .dashboard-body .trade-rep-kpis,
  .dashboard-body .trade-rep-stat-grid,
  .dashboard-body .trade-rep-stat-grid--clients,
  .dashboard-body .trade-rep-stat-grid--debt,
  .dashboard-body .trade-rep-stat-grid--assortment,
  .dashboard-body .trade-rep-gap-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .dashboard-body .header-right {
    grid-template-columns: 1fr;
  }

  .dashboard-body .user-menu > button {
    max-width: none;
  }
}

/* Mobile table card view */
.page-shell .table-panel,
.page-shell .detail-table-panel,
.page-shell .wide-table-wrap,
.page-shell .analytics-table-wrap,
.page-shell .finance-table-wrap,
.page-shell .receivables-table-wrap,
.page-shell .transfer-table-wrap,
.page-shell .abc-table-wrap {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 760px) {
  body:not(.auth-body) {
    overflow-x: hidden;
  }

  .page-shell {
    width: 100%;
    max-width: 100%;
  }

  .page-shell .metric-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .page-shell .metric-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }

  .page-shell .metric-card strong,
  .page-shell .metric-card p,
  .page-shell .metric-card span {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .page-shell .tabs-nav,
  .page-shell .sub-tabs,
  .page-shell .abc-method-tabs,
  .page-shell .check-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    width: 100%;
    min-width: 0;
  }

  .page-shell .tabs-nav a {
    flex: 1 1 min(100%, 150px);
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    justify-content: center;
  }

  .page-shell .profit-document-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 10px;
    min-width: 0;
    overflow: visible;
  }

  .page-shell .profit-document-card span,
  .page-shell .profit-document-card strong,
  .page-shell .profit-document-card .numeric-col {
    justify-self: stretch;
    max-width: 100%;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .page-shell .manager-contract-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
    padding: 10px;
  }

  .page-shell .manager-contract-heading strong,
  .page-shell .manager-contract-heading span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }


  .page-title,
  .breadcrumbs-row {
    min-width: 0;
  }

  .page-title h1,
  .breadcrumbs-title,
  .status-pill {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .toolbar,
  .document-toolbar,
  .payments-toolbar,
  .receivables-toolbar,
  .analytics-filters,
  .abc-toolbar,
  .transfer-filter-form,
  .marketing-filter-form,
  .stock-filter-form,
  .access-toolbar,
  .admin-toolbar {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr !important;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button,
  .toolbar .secondary-link,
  .document-toolbar input,
  .document-toolbar select,
  .document-toolbar button,
  .document-toolbar .secondary-link,
  .payments-toolbar input,
  .payments-toolbar select,
  .payments-toolbar button,
  .payments-toolbar .secondary-link,
  .receivables-toolbar input,
  .receivables-toolbar select,
  .receivables-toolbar button,
  .analytics-filters input,
  .analytics-filters select,
  .analytics-filters button {
    width: 100%;
    min-width: 0;
  }

  .page-shell .table-panel,
  .page-shell .detail-table-panel {
    overflow: visible;
    padding: 10px;
    border-radius: 10px;
  }

  .page-shell .wide-table-wrap,
  .page-shell .analytics-table-wrap,
  .page-shell .finance-table-wrap,
  .page-shell .receivables-table-wrap,
  .page-shell .transfer-table-wrap,
  .page-shell .abc-table-wrap {
    overflow: visible;
  }

  .table-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 0 2px 10px;
  }

  .page-shell table[data-mobile-table],
  .logistics-modal table[data-mobile-table] {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .page-shell table[data-mobile-table] thead,
  .logistics-modal table[data-mobile-table] thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .page-shell table[data-mobile-table] tbody,
  .logistics-modal table[data-mobile-table] tbody {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .page-shell table[data-mobile-table] tr,
  .logistics-modal table[data-mobile-table] tr {
    display: grid;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 7px 18px rgb(15 23 42 / 6%);
  }

  .page-shell table[data-mobile-table] td,
  .page-shell table[data-mobile-table] th,
  .logistics-modal table[data-mobile-table] td,
  .logistics-modal table[data-mobile-table] th {
    position: static;
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.28;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible;
    overflow-wrap: anywhere;
    box-shadow: none;
  }

  .page-shell table[data-mobile-table] tr > :last-child,
  .logistics-modal table[data-mobile-table] tr > :last-child {
    border-bottom: 0;
  }

  .page-shell table[data-mobile-table] td::before,
  .page-shell table[data-mobile-table] th::before,
  .logistics-modal table[data-mobile-table] td::before,
  .logistics-modal table[data-mobile-table] th::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
  }

  .page-shell table[data-mobile-table] td:not([data-label])::before,
  .page-shell table[data-mobile-table] th:not([data-label])::before,
  .logistics-modal table[data-mobile-table] td:not([data-label])::before,
  .logistics-modal table[data-mobile-table] th:not([data-label])::before {
    display: none;
  }

  .page-shell table[data-mobile-table] .mobile-table-full,
  .page-shell table[data-mobile-table] .empty-state,
  .logistics-modal table[data-mobile-table] .mobile-table-full,
  .logistics-modal table[data-mobile-table] .empty-state {
    display: block;
    grid-template-columns: none;
    text-align: center !important;
  }

  .page-shell table[data-mobile-table] .mobile-table-full::before,
  .page-shell table[data-mobile-table] .empty-state::before,
  .logistics-modal table[data-mobile-table] .mobile-table-full::before,
  .logistics-modal table[data-mobile-table] .empty-state::before {
    display: none;
  }

  .page-shell table[data-mobile-table] .numeric-col,
  .page-shell table[data-mobile-table] .money-col,
  .logistics-modal table[data-mobile-table] .numeric-col,
  .logistics-modal table[data-mobile-table] .money-col {
    text-align: left !important;
    white-space: normal !important;
  }

  .page-shell table[data-mobile-table] strong,
  .page-shell table[data-mobile-table] b,
  .page-shell table[data-mobile-table] a,
  .page-shell table[data-mobile-table] button,
  .logistics-modal table[data-mobile-table] strong,
  .logistics-modal table[data-mobile-table] b,
  .logistics-modal table[data-mobile-table] a,
  .logistics-modal table[data-mobile-table] button {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .page-shell table[data-mobile-table] .table-link,
  .logistics-modal table[data-mobile-table] .table-link {
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    min-height: 32px;
    padding: 0;
    text-align: left;
  }

  .page-shell table[data-mobile-table] .table-actions,
  .logistics-modal table[data-mobile-table] .table-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100% !important;
  }

  .page-shell table[data-mobile-table] .table-actions form,
  .page-shell table[data-mobile-table] .table-actions button,
  .page-shell table[data-mobile-table] .table-actions a,
  .logistics-modal table[data-mobile-table] .table-actions form,
  .logistics-modal table[data-mobile-table] .table-actions button,
  .logistics-modal table[data-mobile-table] .table-actions a {
    width: 100%;
  }

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

  .pagination a {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .page-shell table[data-mobile-table] td,
  .page-shell table[data-mobile-table] th,
  .logistics-modal table[data-mobile-table] td,
  .logistics-modal table[data-mobile-table] th {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}


.reserves-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
}

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

.reserve-filter-buttons {
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  min-height: 40px;
  padding: 3px;
  white-space: nowrap;
}

.reserve-filter-button {
  align-items: center;
  border-radius: 6px;
  color: #334155;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  min-height: 32px;
  padding: 0 11px;
  text-decoration: none;
}

.reserve-filter-button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.reserve-filter-button.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.reserves-metrics .metric-card strong {
  white-space: nowrap;
}

.reserves-summary-table .reserve-row-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.reserves-summary-table tr:hover td {
  background: #f8fafc;
}

.reserves-summary-table td small,
.reserve-lines-table td small {
  color: #64748b;
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

.reserve-detail-title {
  align-items: flex-start;
}

.reserve-pdf-link,
.reserve-detail-toolbar .secondary-link {
  align-items: center;
  background: #0f172a;
  border: 1px solid #0f172a;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.reserve-detail-toolbar .secondary-link {
  background: #fff;
  color: #0f172a;
}

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

.reserve-document-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.reserve-document-card summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(150px, auto) auto;
  list-style: none;
  padding: 14px 16px;
}

.reserve-document-card summary::-webkit-details-marker {
  display: none;
}

.reserve-document-main strong,
.reserve-document-main small,
.reserve-document-person strong,
.reserve-document-person small,
.reserve-document-meta span {
  display: block;
}

.reserve-document-main small,
.reserve-document-person small,
.reserve-document-meta span:last-child,
.reserve-document-facts span {
  color: #64748b;
  font-size: 13px;
}

.reserve-document-meta {
  text-align: right;
}

.reserve-people-cell {
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
  max-width: 260px;
}

.reserve-payment-pill {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  justify-self: end;
  padding: 6px 10px;
  white-space: nowrap;
}

.reserve-payment-pill.is-paid {
  background: #dcfce7;
  color: #166534;
}

.reserve-payment-pill.is-partial {
  background: #fef3c7;
  color: #92400e;
}

.reserve-payment-pill.is-unpaid {
  background: #fee2e2;
  color: #991b1b;
}

.reserve-document-body {
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px 16px;
}

.reserve-document-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 10px;
}

.reserve-lines-wrap {
  max-height: none;
}

.reserve-selected-line td {
  background: #fff7ed;
}

@media (max-width: 760px) {
  .reserves-toolbar,
  .reserve-document-card summary {
    grid-template-columns: 1fr;
  }

  .reserve-filter-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .reserve-filter-button {
    justify-content: center;
    padding: 0 8px;
  }

  .reserve-document-meta,
  .reserve-payment-pill {
    justify-self: start;
    text-align: left;
  }

  .reserve-pdf-link,
  .reserve-detail-toolbar .secondary-link {
    justify-content: center;
    width: 100%;
  }
}

/* Compact mobile header menu */
@media (max-width: 760px) {
  body:not(.auth-body) .app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand controls"
      "nav nav";
    align-items: center;
    gap: 7px 10px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 8px 10px 6px;
    background: rgb(255 255 255 / 96%);
    border-bottom: 1px solid #dbe3ec;
    box-shadow: 0 8px 22px rgb(15 23 42 / 10%);
    backdrop-filter: blur(14px) saturate(1.15);
  }

  body:not(.auth-body) .app-header .header-left {
    display: contents;
  }

  body:not(.auth-body) .app-header .brand {
    grid-area: brand;
    width: auto;
    min-width: 0;
    min-height: 32px;
    gap: 8px;
    align-items: center;
  }

  body:not(.auth-body) .app-header .brand-mark {
    width: 34px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  body:not(.auth-body) .app-header .brand-name {
    font-size: 16px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-body) .app-header .header-right {
    grid-area: controls;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
    min-width: 0;
  }

  body:not(.auth-body) .app-header .top-nav {
    grid-area: nav;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 32px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 0 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.auth-body).has-open-header-menu {
    overflow-x: hidden;
  }

  body:not(.auth-body) .app-header .top-nav::-webkit-scrollbar {
    display: none;
  }

  body:not(.auth-body) .app-header .nav-group,
  body:not(.auth-body) .app-header .user-menu {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
  }

  body:not(.auth-body) .app-header .nav-group.is-open,
  body:not(.auth-body) .app-header .user-menu.is-open {
    z-index: 80;
  }

  body:not(.auth-body) .app-header .top-nav button {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    padding: 6px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
  }

  body:not(.auth-body) .app-header .top-nav button.active,
  body:not(.auth-body) .app-header .top-nav button:hover,
  body:not(.auth-body) .app-header .top-nav button:focus-visible {
    border-color: #86efac;
    background: #ecfdf5;
    color: var(--accent-strong);
  }

  body:not(.auth-body) .app-header .nav-menu {
    display: none !important;
  }

  body:not(.auth-body) .app-header .nav-menu a {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
  }

  body:not(.auth-body) .app-header .data-freshness-indicator {
    width: auto;
    min-width: 0;
    max-width: 116px;
    min-height: 30px;
    justify-content: flex-start;
    gap: 6px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    overflow: hidden;
  }

  body:not(.auth-body) .app-header .data-freshness-light {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px rgb(22 163 74 / 14%);
  }

  body:not(.auth-body) .app-header .data-freshness-indicator [data-freshness-text] {
    min-width: 0;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-body) .app-header .user-menu > button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    min-height: 30px;
    max-width: none;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    color: var(--muted);
    background: #f8fafc;
  }

  body:not(.auth-body) .app-header .user-menu > button::before {
    content: "";
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }

  body:not(.auth-body) .app-header .user-menu-panel {
    display: none !important;
  }

  body:not(.auth-body) .app-header .user-menu-panel a,
  body:not(.auth-body) .app-header .user-menu-panel button {
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.2;
  }

  body:not(.auth-body) .app-header .access-view-form select {
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  body:not(.auth-body) .app-header .data-freshness-indicator {
    max-width: 32px;
    justify-content: center;
    padding: 0;
  }

  body:not(.auth-body) .app-header .data-freshness-indicator [data-freshness-text] {
    display: none;
  }
}


.expense-intake-table-wrap table {
  table-layout: fixed;
  min-width: 1500px;
}

.expense-intake-table th,
.expense-intake-table td {
  min-width: 0;
  vertical-align: top;
}

.expense-intake-table th:nth-child(1),
.expense-intake-table td:nth-child(1) {
  width: 180px;
}

.expense-intake-table th:nth-child(2),
.expense-intake-table td:nth-child(2) {
  width: 190px;
  min-width: 190px;
}

.expense-intake-table th:nth-child(3),
.expense-intake-table td:nth-child(3) {
  width: 160px;
}

.expense-intake-table th:nth-child(4),
.expense-intake-table td:nth-child(4) {
  width: 116px;
}

.expense-intake-table th:nth-child(5),
.expense-intake-table td:nth-child(5) {
  width: 390px;
}

.expense-intake-table th:nth-child(6),
.expense-intake-table td:nth-child(6) {
  width: 360px;
}

.expense-intake-table th:nth-child(7),
.expense-intake-table td:nth-child(7) {
  width: 230px;
}

.expense-intake-table th:nth-child(8),
.expense-intake-table td:nth-child(8) {
  width: 132px;
}

.expense-intake-table th:nth-child(9),
.expense-intake-table td:nth-child(9) {
  width: 110px;
}

.expense-message-cell,
.expense-intake-table td:nth-child(6),
.expense-intake-table td:nth-child(7) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.expense-message-cell small,
.expense-intake-table td:nth-child(6) strong,
.expense-intake-table td:nth-child(6) small {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.expense-kind-pill {
  display: inline-flex;
  width: fit-content;
}

.expense-intake-empty {
  padding: 28px;
}


.expense-type-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 12px;
}

.expense-type-chip {
  flex: 0 0 190px;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: inherit;
  text-decoration: none;
}

.expense-type-chip.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color) inset;
}

.expense-type-chip span,
.expense-type-chip small {
  color: var(--muted-color);
}

.expense-type-chip strong {
  font-size: 17px;
}

.expense-cash-table-wrap table {
  table-layout: fixed;
  min-width: 1690px;
}

.expense-cash-table th:nth-child(1),
.expense-cash-table td:nth-child(1) {
  width: 130px;
}

.expense-cash-table th:nth-child(2),
.expense-cash-table td:nth-child(2) {
  width: 132px;
}

.expense-cash-table th:nth-child(3),
.expense-cash-table td:nth-child(3) {
  width: 158px;
}

.expense-cash-table th:nth-child(4),
.expense-cash-table td:nth-child(4) {
  width: 170px;
}

.expense-cash-table th:nth-child(5),
.expense-cash-table td:nth-child(5) {
  width: 350px;
}

.expense-cash-table th:nth-child(6),
.expense-cash-table td:nth-child(6) {
  width: 390px;
}

.expense-cash-table th:nth-child(7),
.expense-cash-table td:nth-child(7) {
  width: 150px;
}

.expense-cash-table th:nth-child(8),
.expense-cash-table td:nth-child(8) {
  width: 210px;
}

.expense-cash-table td:nth-child(5),
.expense-cash-table td:nth-child(6),
.expense-cash-table td:nth-child(8) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.expense-cash-table td:nth-child(7) {
  white-space: nowrap;
}

.expense-comment-cell {
  white-space: normal;
}

.expense-company-form {
  margin: 0;
}

.expense-include-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.expense-include-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.expense-include-toggle span {
  color: var(--accent-strong);
}

.expense-include-toggle input:not(:checked) + span {
  color: #b91c1c;
}

.expense-excluded-row td {
  background: #f8fafc;
  color: var(--muted);
}

.expense-excluded-row .numeric-col strong,
.expense-excluded-row a,
.expense-excluded-row small {
  color: var(--muted);
}


.expense-rules-panel {
  margin-bottom: 18px;
}

.expense-rule-form {
  align-items: end;
  grid-template-columns: minmax(170px, 1.1fr) minmax(190px, 1.2fr) minmax(190px, 1.2fr) minmax(130px, .8fr) minmax(150px, .9fr) minmax(190px, 1.1fr) minmax(170px, 1fr) 84px auto;
}

.expense-rule-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.expense-rule-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-color);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-color);
}

.expense-rule-row.is-disabled {
  opacity: .58;
}

.expense-rule-row small,
.expense-intake-meta-panel small,
.expense-matching-rule small {
  display: block;
  color: var(--muted-text);
  overflow-wrap: anywhere;
}

.expense-intake-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .85fr);
  gap: 18px;
  align-items: start;
}

.expense-file-viewer {
  min-width: 0;
  border: 1px solid var(--line-color);
  border-radius: 8px;
  background: var(--surface-color);
  overflow: hidden;
}

.expense-file-viewer iframe {
  display: block;
  width: 100%;
  height: min(74vh, 860px);
  border: 0;
  background: #fff;
}

.expense-file-viewer img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #fff;
}

.expense-file-viewer > .secondary-link,
.expense-file-viewer > .button-link {
  margin: 12px 14px 14px;
}

.expense-intake-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.expense-intake-meta-panel,
.expense-intake-review-panel {
  margin: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted-text);
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.expense-review-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.expense-review-form label,
.expense-rule-create-details {
  display: grid;
  gap: 6px;
  font-size: .92rem;
  color: var(--muted-text);
}

.expense-review-form input,
.expense-review-form select,
.expense-review-form textarea,
.expense-rule-create-details input {
  width: 100%;
}

.expense-rule-create-details {
  border: 1px solid var(--line-color);
  border-radius: 8px;
  padding: 10px;
}

.expense-rule-create-details summary {
  cursor: pointer;
  color: var(--text-color);
  font-weight: 600;
}

.expense-matching-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line-color);
}

.expense-matching-rule:first-of-type {
  border-top: 0;
}

@media (max-width: 980px) {
  .expense-intake-detail {
    grid-template-columns: 1fr;
  }

  .expense-rule-form,
  .expense-rule-row {
    grid-template-columns: 1fr;
  }

  .expense-file-viewer iframe {
    height: 70vh;
  }
}

/* Rostov project */
:root {
  --rostov-accent: #be123c;
  --rostov-accent-strong: #9f1239;
  --rostov-accent-soft: #fff1f2;
  --rostov-accent-border: #fecdd3;
}

.top-nav .nav-group-rostov > button {
  color: var(--rostov-accent-strong);
}

.top-nav .nav-group-rostov > button.active,
.top-nav .nav-group-rostov > button:hover {
  background: var(--rostov-accent-soft);
  color: var(--rostov-accent-strong);
}

.top-nav .nav-group-rostov > button::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--rostov-accent);
  vertical-align: 1px;
}

.rostov-page-shell {
  max-width: 1360px;
}

.rostov-title .eyebrow,
.rostov-status-pill {
  color: var(--rostov-accent-strong);
}

.rostov-status-pill {
  border-color: var(--rostov-accent-border);
  background: var(--rostov-accent-soft);
}

.rostov-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rostov-metric-card strong {
  color: var(--rostov-accent-strong);
}

.rostov-layout,
.rostov-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.rostov-form-panel {
  padding: 16px;
}

.rostov-prospect-form {
  display: grid;
  gap: 13px;
}

.rostov-field {
  display: grid;
  gap: 6px;
}

.rostov-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rostov-field input,
.rostov-field textarea,
.rostov-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 12px;
}

.rostov-field textarea {
  resize: vertical;
}

.rostov-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rostov-capture-button,
.rostov-form-actions button,
.rostov-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--rostov-accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.rostov-capture-button {
  background: #ffffff;
  color: var(--rostov-accent-strong);
  border: 1px solid var(--rostov-accent-border);
}

.rostov-capture-button:hover,
.rostov-capture-button:focus-visible {
  background: var(--rostov-accent-soft);
}

.rostov-capture-button:disabled,
.rostov-form-actions button:disabled {
  cursor: progress;
  opacity: .68;
}

.rostov-photo-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.rostov-location-state {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.rostov-location-state.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.rostov-location-state.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.rostov-location-state.is-progress,
.rostov-photo-preview.is-loading {
  border-color: var(--rostov-accent-border);
  background: var(--rostov-accent-soft);
  color: var(--rostov-accent-strong);
}

.rostov-photo-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.rostov-photo-preview-item {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.rostov-photo-preview-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.rostov-photo-preview-item span {
  display: block;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rostov-form-actions {
  display: flex;
}

.rostov-form-actions button {
  width: 100%;
}

.rostov-filter-form {
  align-items: stretch;
}

.rostov-prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.rostov-prospect-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
  box-shadow: var(--panel-raised-shadow);
}

.rostov-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.rostov-card-head strong {
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.rostov-card-status {
  padding: 6px 9px;
  font-size: 12px;
}

.rostov-card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.rostov-card-body p,
.rostov-card-body small,
.rostov-card-meta span {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rostov-card-meta,
.rostov-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rostov-card-flags span {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rostov-card-flags span.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.rostov-card-link {
  min-height: 40px;
  background: var(--rostov-accent-soft);
  color: var(--rostov-accent-strong);
  border: 1px solid var(--rostov-accent-border);
}

.rostov-detail-panel {
  padding: 16px;
}

.rostov-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.rostov-detail-list div {
  display: grid;
  gap: 4px;
}

.rostov-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rostov-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.rostov-photos-section {
  margin-top: 18px;
}

.rostov-photos-summary {
  margin-bottom: 10px;
}

.rostov-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.rostov-photo-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--panel-raised-shadow);
}

.rostov-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.rostov-photo-card span {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.rostov-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 760px) {
  body:not(.auth-body) .app-header .nav-group-rostov > button,
  body:not(.auth-body) .app-header .nav-group-rostov > button.active,
  body:not(.auth-body) .app-header .nav-group-rostov > button:hover,
  body:not(.auth-body) .app-header .nav-group-rostov > button:focus-visible {
    border-color: var(--rostov-accent-border);
    background: var(--rostov-accent-soft);
    color: var(--rostov-accent-strong);
  }

  .rostov-metrics,
  .rostov-layout,
  .rostov-detail-grid {
    grid-template-columns: 1fr;
  }

  .rostov-form-panel,
  .rostov-detail-panel {
    padding: 12px;
  }

  .rostov-capture-grid,
  .rostov-photo-preview,
  .rostov-photo-grid,
  .rostov-prospect-grid {
    grid-template-columns: 1fr;
  }

  .rostov-field input,
  .rostov-field textarea,
  .rostov-field select {
    min-height: 48px;
  }

  .rostov-form-actions {
    position: sticky;
    bottom: 8px;
    z-index: 10;
    padding-top: 4px;
    background: linear-gradient(180deg, rgb(255 255 255 / 0%), #fff 42%);
  }

  .rostov-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Rostov polished UI */
body .rostov-page-shell {
  max-width: 1440px;
}

body .top-nav .nav-group-rostov > button,
body .top-nav .nav-group-rostov > button.active,
body .top-nav .nav-group-rostov > button:hover {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}

body .top-nav .nav-group-rostov > button::before {
  background: #14b8a6;
}

body .rostov-title {
  align-items: center;
  margin-bottom: 16px;
}

body .rostov-title h1 {
  font-size: 28px;
  line-height: 1.12;
}

body .rostov-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

body .rostov-summary-strip div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

body .rostov-summary-strip span {
  color: #647282;
  font-size: 13px;
  font-weight: 800;
}

body .rostov-summary-strip strong {
  color: #18202a;
  font-size: 24px;
  line-height: 1;
}

body .rostov-layout {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body .rostov-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body .rostov-intake-panel,
body .rostov-list-section,
body .rostov-photos-section {
  min-width: 0;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(15 23 42 / 6%);
}

body .rostov-list-section {
  padding: 14px;
}

body .rostov-intake-panel {
  overflow: hidden;
}

body .rostov-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7edf2;
  background: #fbfdff;
}

body .rostov-panel-heading div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body .rostov-panel-heading strong {
  color: #18202a;
  font-size: 15px;
  line-height: 1.2;
}

body .rostov-panel-heading span {
  color: #647282;
  font-size: 12px;
  font-weight: 800;
}

body .rostov-intake-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

body .rostov-field,
body .rostov-field-full {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

body .rostov-field-full {
  grid-column: 1 / -1;
}

body .rostov-field > span {
  display: block;
  color: #647282;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

body .rostov-field input,
body .rostov-field textarea,
body .rostov-field select,
body .rostov-filter-form input,
body .rostov-filter-form select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #18202a;
  font: inherit;
  font-size: 15px;
  line-height: 1.25;
  padding: 10px 12px;
  box-shadow: none;
}

body .rostov-field textarea {
  resize: vertical;
}

body .rostov-phone-stack {
  display: grid;
  gap: 8px;
}

body .rostov-phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
}

body .rostov-phone-remove-button,
body .rostov-add-phone-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #647282;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

body .rostov-phone-remove-button {
  min-width: 44px;
  min-height: 44px;
  font-size: 24px;
  line-height: 1;
}

body .rostov-phone-row:first-child .rostov-phone-remove-button {
  visibility: hidden;
  pointer-events: none;
}

body .rostov-add-phone-button {
  justify-self: start;
  gap: 8px;
  min-height: 40px;
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  padding: 0 12px;
}

body .rostov-add-phone-button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #14b8a6;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

body .rostov-add-phone-button small {
  color: inherit;
  font-size: 13px;
  font-weight: 850;
}

body .rostov-phone-list {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

body .rostov-capture-section {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body .rostov-capture-button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body .rostov-capture-button span {
  color: inherit;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
}

body .rostov-capture-button small,
body .rostov-capture-button.is-ready small,
body .rostov-capture-button.is-error small,
body .rostov-capture-button.is-progress small {
  color: #647282;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

body .rostov-capture-button.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

body .rostov-capture-button.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

body .rostov-capture-button.is-progress {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

body .rostov-manual-location {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px dashed #fecdd3;
  border-radius: 8px;
  background: #fff7f8;
}

body .rostov-manual-location .rostov-field-full {
  grid-column: 1 / -1;
}

body .rostov-manual-location .rostov-field > span {
  color: #9f1239;
}

body .rostov-photo-button input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body .rostov-photo-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body .rostov-photo-preview:empty {
  display: none;
}

body .rostov-form-actions {
  display: flex;
}

body .rostov-form-actions button,
body .rostov-filter-form button,
body .rostov-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  padding: 0 14px;
  cursor: pointer;
}

body .rostov-form-actions button {
  width: 100%;
}

body .rostov-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

body .rostov-settlement-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

body .rostov-settlement-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 100%;
  border: 1px solid #e7edf2;
  border-radius: 8px;
  background: #fbfdff;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  padding: 8px 10px;
  text-decoration: none;
}

body .rostov-settlement-tabs a.is-active {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

body .rostov-settlement-tabs span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body .rostov-settlement-tabs strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  border-radius: 8px;
  background: #e7edf2;
  color: #18202a;
  font-size: 12px;
  line-height: 1;
  padding: 0 7px;
}

body .rostov-settlement-tabs a.is-active strong {
  background: #ccfbf1;
  color: #115e59;
}

body .rostov-prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

body .rostov-empty-panel {
  display: grid;
  gap: 6px;
  min-height: 180px;
  place-content: center;
  padding: 22px;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  background: #fbfdff;
  color: #647282;
  text-align: center;
}

body .rostov-empty-panel strong {
  color: #18202a;
  font-size: 16px;
}

body .rostov-empty-panel span {
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 900px) {
  body .rostov-summary-strip,
  body .rostov-layout,
  body .rostov-detail-grid,
  body .rostov-intake-form,
  body .rostov-capture-section,
  body .rostov-manual-location,
  body .rostov-filter-form,
  body .rostov-photo-preview {
    grid-template-columns: 1fr;
  }

  body .rostov-settlement-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }

  body .rostov-settlement-tabs a {
    flex: 0 0 auto;
  }

  body .rostov-title {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  body .rostov-summary-strip div {
    min-height: 48px;
  }

  body .rostov-intake-form {
    padding: 12px;
  }

  body .rostov-field input,
  body .rostov-field textarea,
  body .rostov-field select,
  body .rostov-filter-form input,
  body .rostov-filter-form select,
  body .rostov-form-actions button,
  body .rostov-filter-form button,
  body .rostov-filter-form .secondary-link {
    width: 100%;
  }

  body .rostov-form-actions {
    position: sticky;
    bottom: 8px;
    z-index: 10;
    padding-top: 6px;
    background: linear-gradient(180deg, rgb(255 255 255 / 0%), #fff 48%);
  }
}

/* Rostov menu red accent */
body .top-nav .nav-group-rostov > button,
body .top-nav .nav-group-rostov > button.active,
body .top-nav .nav-group-rostov > button:hover,
body .top-nav .nav-group-rostov > button:focus-visible,
body:not(.auth-body) .app-header .nav-group-rostov > button,
body:not(.auth-body) .app-header .nav-group-rostov > button.active,
body:not(.auth-body) .app-header .nav-group-rostov > button:hover,
body:not(.auth-body) .app-header .nav-group-rostov > button:focus-visible {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

body .top-nav .nav-group-rostov > button::before,
body:not(.auth-body) .app-header .nav-group-rostov > button::before {
  background: #e11d48;
  box-shadow: 0 0 0 4px rgb(225 29 72 / 10%);
}

/* Rostov client map */
body .rostov-map-title {
  align-items: center;
}

body .rostov-map-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

body .rostov-map-sidebar,
body .rostov-map-panel {
  min-width: 0;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(15 23 42 / 6%);
}

body .rostov-map-sidebar {
  display: grid;
  align-content: start;
  overflow: hidden;
}

body .rostov-map-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7edf2;
  background: #fbfdff;
}

body .rostov-map-counter span {
  color: #647282;
  font-size: 12px;
  font-weight: 850;
}

body .rostov-map-counter strong {
  color: #18202a;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

body .rostov-map-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: min(680px, calc(100vh - 230px));
  overflow: auto;
}

body .rostov-map-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  border: 1px solid #e7edf2;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

body .rostov-map-list-item button {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #18202a;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

body .rostov-map-list-item strong,
body .rostov-map-list-item span,
body .rostov-map-list-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

body .rostov-map-list-item span,
body .rostov-map-list-item small {
  color: #647282;
  font-size: 12px;
  font-weight: 750;
}

body .rostov-map-list-item a {
  align-self: center;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff1f2;
  color: #9f1239;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
}

body .rostov-map-panel {
  overflow: hidden;
  padding: 0;
}

body .rostov-client-map {
  width: 100%;
  height: min(680px, calc(100vh - 220px));
  min-height: 560px;
  background: #e5edf7;
}

body .rostov-client-map.is-error {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #991b1b;
  font-weight: 850;
  text-align: center;
}

body .rostov-map-popup {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

body .rostov-map-popup strong {
  color: #18202a;
  font-size: 14px;
}

body .rostov-map-popup span,
body .rostov-map-popup small {
  color: #647282;
  font-size: 12px;
}

body .rostov-map-popup a {
  color: #9f1239;
  font-weight: 850;
  text-decoration: none;
}

body .rostov-map-empty {
  min-height: 220px;
}

@media (max-width: 900px) {
  body .rostov-map-shell {
    grid-template-columns: 1fr;
  }

  body .rostov-map-title {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  body .rostov-map-list {
    max-height: none;
  }

  body .rostov-client-map {
    height: 62vh;
    min-height: 420px;
  }
}

/* Mobile header cleanup */
@media (max-width: 760px) {
  body:not(.auth-body) .app-header {
    grid-template-areas: "brand controls";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 10px;
    padding: 8px 10px;
  }

  body:not(.auth-body) .app-header .top-nav,
  body:not(.auth-body) .app-header .data-freshness-indicator {
    display: none !important;
  }

  body:not(.auth-body) .app-header .header-right {
    gap: 0;
  }

  body:not(.auth-body) .mobile-header-menu-panel {
    padding: 6px;
  }

  body:not(.auth-body) .mobile-header-menu-section {
    display: grid;
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid #e7edf2;
  }

  body:not(.auth-body) .mobile-header-menu-section:last-child {
    border-bottom: 0;
  }

  body:not(.auth-body) .mobile-header-menu-title {
    padding: 4px 4px 2px;
    color: #647282;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
  }
}

/* Rostov delete action */
body .rostov-delete-form {
  display: grid;
  padding: 0 16px 16px;
}

body .rostov-delete-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff1f2;
  color: #9f1239;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

body .rostov-delete-form button:hover,
body .rostov-delete-form button:focus-visible {
  background: #ffe4e6;
}

/* Reports */
.reports-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, .22fr) minmax(150px, .22fr) auto;
  align-items: end;
}

.reports-toolbar .reports-search {
  width: 100%;
}

.manager-salary-toolbar {
  grid-template-columns: minmax(150px, .18fr) minmax(150px, .18fr) auto;
  max-width: 520px;
}

.manager-salary-settings-row {
  display: flex;
  justify-content: flex-start;
  margin: -4px 0 16px;
}

.manager-salary-settings-button {
  align-self: auto;
  background: #ffffff;
  border: 1px solid #99f6e4;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 850;
  min-height: 38px;
  padding: 0 14px;
}

.manager-salary-settings-button:hover,
.manager-salary-settings-button:focus-visible {
  background: #ecfdf5;
  color: var(--accent-strong);
}

.manager-salary-tabs {
  margin-bottom: 16px;
}

.manager-salary-section {
  margin-bottom: 18px;
}

.manager-salary-table-wrap table {
  min-width: 1360px;
}

.manager-salary-table-wrap th:nth-child(3),
.manager-salary-table-wrap td:nth-child(3) {
  min-width: 260px;
}

.manager-salary-table-wrap td a,
.manager-salary-detail-table-wrap td a,
.manager-salary-payments-table-wrap td a,
.manager-salary-bonus-table-wrap td a {
  color: var(--accent-strong);
  text-decoration: none;
}

.manager-salary-table-wrap td a:hover,
.manager-salary-detail-table-wrap td a:hover,
.manager-salary-payments-table-wrap td a:hover,
.manager-salary-bonus-table-wrap td a:hover {
  text-decoration: underline;
}

.manager-salary-table-wrap small,
.manager-salary-detail-table-wrap small,
.manager-salary-bonus-table-wrap small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.manager-salary-note {
  padding: 0;
}

.manager-salary-note p {
  margin: 0;
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.manager-salary-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 16px;
}

.manager-salary-document-actions a {
  align-items: center;
  display: inline-flex;
  min-height: 38px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.manager-salary-detail-table-wrap table {
  min-width: 1180px;
}

.manager-salary-payments-table-wrap table {
  min-width: 820px;
}

.manager-salary-bonus-table-wrap table {
  min-width: 1040px;
}

.manager-salary-contract-table-wrap table {
  min-width: 1180px;
}

.manager-salary-contract-table-wrap th,
.manager-salary-contract-table-wrap td {
  vertical-align: top;
}

.manager-salary-contract-table-wrap th:nth-child(1),
.manager-salary-contract-table-wrap td:nth-child(1) {
  min-width: 220px;
  white-space: normal;
}

.manager-salary-contract-table-wrap th:nth-child(2),
.manager-salary-contract-table-wrap td:nth-child(2),
.manager-salary-contract-table-wrap th:nth-child(3),
.manager-salary-contract-table-wrap td:nth-child(3) {
  min-width: 190px;
  white-space: normal;
}

.manager-salary-contract-table-wrap .contract-bind-form {
  justify-content: flex-end;
}

.manager-salary-warning-section {
  border-color: #fed7aa;
}

.reports-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manager-salary-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.manager-salary-metric-grid > .metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  justify-content: stretch;
  gap: 6px;
  min-height: 118px;
  padding: 14px 16px;
  border-bottom: 0;
}

.manager-salary-metric-grid .metric-label {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.manager-salary-metric-grid .metric-card strong {
  margin: 0;
  font-size: clamp(22px, 1.55vw, 28px);
  line-height: 1.08;
  white-space: nowrap;
}

.manager-salary-metric-grid .metric-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.manager-salary-card-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.manager-salary-settings-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, .46);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 2200;
}

.manager-salary-settings-backdrop[hidden] {
  display: none;
}

body.manager-salary-settings-open {
  overflow: hidden;
}

.manager-salary-settings-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
  max-height: min(720px, calc(100vh - 48px));
  max-width: 860px;
  overflow: auto;
  width: min(860px, 100%);
}

.manager-salary-settings-modal header {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px 14px;
}

.manager-salary-settings-modal h2 {
  color: var(--text-color);
  font-size: 22px;
  line-height: 1.15;
  margin: 4px 0 0;
}

.manager-salary-settings-modal header button,
.manager-salary-tier-row > button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  font-weight: 850;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.manager-salary-settings-modal header button:hover,
.manager-salary-tier-row > button:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.manager-salary-settings-form {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.manager-salary-settings-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manager-salary-settings-meta span {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.manager-salary-fixed-rate-field {
  display: grid;
  gap: 6px;
  max-width: 280px;
}

.manager-salary-fixed-rate-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.manager-salary-fixed-rate-field input {
  width: 100%;
}

.manager-salary-tier-head,
.manager-salary-tier-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, .55fr) 40px;
}

.manager-salary-tier-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 4px 2px 0;
  text-transform: uppercase;
}

.manager-salary-tier-list {
  display: grid;
  gap: 8px;
}

.manager-salary-tier-row {
  align-items: end;
  background: #fbfdff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
}

.manager-salary-tier-row.is-active {
  border-color: #99f6e4;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .12);
}

.manager-salary-tier-row label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.manager-salary-tier-row label span {
  color: var(--muted);
  display: none;
  font-size: 12px;
  font-weight: 800;
}

.manager-salary-tier-row input {
  min-width: 0;
  width: 100%;
}

.manager-salary-settings-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.manager-salary-settings-actions .secondary-link {
  min-height: 40px;
}

@media (max-width: 1180px) {
  .manager-salary-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .manager-salary-metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .manager-salary-metric-grid .metric-card strong {
    white-space: normal;
  }
}

.reports-warehouse-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 8px;
  padding-bottom: 0;
}

.reports-warehouse-tabs a {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.warehouse-movement-table-wrap table {
  min-width: 980px;
}

.warehouse-movement-table-wrap th:nth-child(2),
.warehouse-movement-table-wrap td:nth-child(2) {
  min-width: 340px;
}

.dead-stock-heading {
  align-items: flex-start;
}

.dead-stock-heading-actions {
  align-items: flex-end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.dead-stock-cart-button,
.dead-stock-add-button {
  align-items: center;
  background: #b45309;
  border: 1px solid #92400e;
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 11px;
}

.dead-stock-cart-button:hover,
.dead-stock-cart-button:focus-visible,
.dead-stock-add-button:hover,
.dead-stock-add-button:focus-visible {
  background: #92400e;
}

.dead-stock-cart-button span {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  min-width: 22px;
  padding: 2px 6px;
}

.dead-stock-cart-button small {
  color: #ffedd5;
  font-size: 11px;
}

.dead-stock-add-button {
  min-width: 150px;
}

.dead-stock-add-button.is-added {
  background: #166534;
  border-color: #14532d;
}

.dead-stock-add-button:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.dead-stock-method {
  background: linear-gradient(135deg, #f5f8ff, #eef6ff);
  border: 1px solid #cfdcf3;
  border-radius: 14px;
  color: #334155;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.dead-stock-method strong {
  color: #172033;
}

.dead-stock-method p {
  line-height: 1.55;
  margin: 5px 0 0;
}

.dead-stock-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(210px, auto) auto;
}

.dead-stock-tabs a span {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  font-size: 12px;
  margin-left: 5px;
  padding: 2px 7px;
}

.dead-stock-tabs a.active span {
  background: rgba(255, 255, 255, 0.22);
}

.dead-stock-metrics {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.dead-stock-metrics > .metric-card {
  align-content: start;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.dead-stock-metrics > .metric-card > .metric-label,
.dead-stock-metrics > .metric-card > strong,
.dead-stock-metrics > .metric-card > p {
  margin: 0;
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.dead-stock-metrics > .metric-card > strong {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.08;
}

.dead-stock-metrics > .metric-card > p {
  font-size: 14px;
  line-height: 1.35;
}

.dead-stock-primary-metric {
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  border-color: #fdba74;
}

.dead-stock-primary-metric strong {
  color: #9a3412;
}

.inline-alert.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  color: #854d0e;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.dead-stock-table-wrap .dead-stock-table {
  min-width: 980px;
  table-layout: fixed;
  width: 100%;
}

.dead-stock-table th:first-child,
.dead-stock-table td:first-child {
  min-width: 0;
  width: 36%;
  white-space: normal;
}

.dead-stock-table th:nth-child(2),
.dead-stock-table td:nth-child(2) {
  min-width: 0;
  width: 8%;
}

.dead-stock-table th:nth-child(3),
.dead-stock-table td:nth-child(3) {
  width: 12%;
}

.dead-stock-table th:nth-child(4),
.dead-stock-table td:nth-child(4) {
  width: 16%;
}

.dead-stock-table th:last-child,
.dead-stock-table td:last-child {
  min-width: 0;
  width: 28%;
  white-space: normal;
}

.dead-stock-table td {
  vertical-align: top;
}

.dead-stock-table td small {
  color: var(--text-muted);
  display: block;
  line-height: 1.35;
  margin-top: 4px;
}

.dead-stock-badge,
.dead-stock-review-label {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

.dead-stock-badge-never_sold,
.dead-stock-badge-stopped {
  background: #fee2e2;
  color: #991b1b;
}

.dead-stock-badge-slow {
  background: #fef3c7;
  color: #92400e;
}

.dead-stock-review-label {
  background: #e0f2fe;
  color: #075985;
  margin-top: 5px;
}

.dead-stock-reason {
  max-width: 38ch;
}

.dead-stock-row-return .dead-stock-return-cell strong {
  color: #b45309;
  font-size: 16px;
}

.dead-stock-return-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(96px, 120px) minmax(150px, 1fr);
}

.dead-stock-return-form label {
  color: var(--text-muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}

.dead-stock-return-form input {
  border: 1px solid var(--border-color);
  border-radius: 9px;
  font: inherit;
  font-size: 15px;
  min-height: 38px;
  padding: 7px 9px;
  width: 100%;
}

.dead-stock-return-form .dead-stock-add-button {
  min-width: 0;
}

.dead-stock-row-review {
  background: #f8fbff;
}

.donspec-return-cart {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  width: min(760px, 100%);
}

.donspec-return-cart .warehouse-demand-cart-body {
  min-height: 0;
  overflow-y: auto;
}

.donspec-return-cart > header small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.donspec-return-cart-save-copy {
  display: grid;
  gap: 4px;
}

.donspec-return-cart-save-status {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.donspec-return-cart-save-status[data-state="saving"] {
  color: #92400e;
}

.donspec-return-cart-save-status[data-state="error"] {
  color: #b42318;
}

.donspec-return-cart-group > header div {
  display: grid;
  gap: 3px;
}

.donspec-return-cart-group article {
  grid-template-columns: minmax(0, 1fr) 100px 110px auto;
}

.donspec-return-cart-line-total span {
  color: var(--muted);
  font-size: 12px;
}

.donspec-return-drafts {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  gap: 10px;
  max-height: 220px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
}

.donspec-return-drafts-heading,
.donspec-return-drafts-list article {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.donspec-return-drafts-heading > div,
.donspec-return-drafts-list article > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.donspec-return-drafts-heading small,
.donspec-return-drafts-list small {
  color: var(--text-muted);
}

.donspec-return-drafts-list {
  display: grid;
  gap: 8px;
}

.donspec-return-drafts-list article {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 9px 10px;
}

.donspec-return-drafts-heading .table-link,
.donspec-return-drafts-list article .table-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .dead-stock-metrics {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .reports-toolbar,
  .manager-salary-toolbar,
  .manager-salary-tier-head,
  .manager-salary-tier-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .manager-salary-tier-head {
    display: none;
  }

  .manager-salary-tier-row label span {
    display: block;
  }

  .manager-salary-settings-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .dead-stock-heading .status-pill {
    width: 100%;
  }

  .dead-stock-heading-actions {
    justify-items: stretch;
    width: 100%;
  }

  .dead-stock-cart-button {
    width: 100%;
  }

  .dead-stock-method {
    border-radius: 12px;
    font-size: 13px;
    padding: 12px;
  }

  .dead-stock-toolbar,
  .dead-stock-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-shell .dead-stock-metrics > .metric-card {
    align-content: start;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 16px;
  }

  .page-shell .dead-stock-metrics > .metric-card > .metric-label {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    margin: 0;
    overflow-wrap: normal;
    white-space: normal;
    word-break: normal;
  }

  .page-shell .dead-stock-metrics > .metric-card > strong {
    display: block;
    font-size: clamp(24px, 8vw, 30px);
    line-height: 1.08;
    margin: 0;
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: keep-all;
  }

  .page-shell .dead-stock-metrics > .metric-card > p {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: normal;
    white-space: normal;
    word-break: normal;
  }

  .dead-stock-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .dead-stock-tabs a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .dead-stock-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .dead-stock-panel .table-summary {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
  }

  .dead-stock-table-wrap {
    overflow: visible;
  }

  .dead-stock-table,
  .dead-stock-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .dead-stock-table-wrap .dead-stock-table {
    min-width: 0;
    table-layout: auto;
  }

  .dead-stock-table thead {
    display: none;
  }

  .dead-stock-table tbody {
    display: grid;
    gap: 12px;
  }

  .dead-stock-table tr {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }

  .dead-stock-table td {
    border-bottom: 1px solid #edf1f6;
    display: block;
    min-width: 0;
    padding: 11px 13px;
    text-align: left;
    width: auto;
  }

  .dead-stock-table td::before {
    color: var(--text-muted);
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
    text-transform: uppercase;
  }

  .dead-stock-table td:first-child,
  .dead-stock-table td:last-child {
    grid-column: 1 / -1;
  }

  .dead-stock-table td:first-child {
    background: #fbfcfe;
    padding: 14px 13px;
  }

  .dead-stock-table td:first-child .product-name-link strong {
    font-size: 17px;
    line-height: 1.3;
  }

  .dead-stock-table td:nth-child(2),
  .dead-stock-table td:nth-child(3) {
    min-height: 78px;
  }

  .dead-stock-table td:nth-child(2) {
    border-right: 1px solid #edf1f6;
  }

  .dead-stock-table td:nth-child(4) {
    background: #fffbeb;
    grid-column: 1 / -1;
  }

  .dead-stock-table td:nth-child(2) > strong,
  .dead-stock-table td:nth-child(3) > strong,
  .dead-stock-table td:nth-child(4) > strong {
    font-size: 20px;
    line-height: 1.15;
    margin: 0;
  }

  .dead-stock-table td:nth-child(4) > strong {
    color: #b45309;
  }

  .dead-stock-table .dead-stock-badge {
    display: inline-flex;
    max-width: 100%;
    width: auto;
  }

  .dead-stock-table .dead-stock-reason {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
    max-width: none;
  }

  .dead-stock-table td:last-child {
    border-bottom: 0;
    padding: 12px 13px 14px;
  }

  .dead-stock-table td.numeric-col {
    text-align: left;
  }

  .dead-stock-add-button {
    width: 100%;
  }

  .dead-stock-return-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .donspec-return-drafts-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .donspec-return-drafts {
    max-height: 190px;
    padding: 12px;
  }

  .donspec-return-drafts-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .donspec-return-cart-group > header {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr);
  }

  .donspec-return-cart-group article {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .donspec-return-cart-line-total {
    justify-self: start;
  }

  .donspec-return-cart-group article > button {
    grid-column: auto;
    justify-self: end;
  }
}



.avito-heading {
  align-items: center;
}

.avito-stats {
  margin-bottom: 18px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
}

.data-tag {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 5px 10px;
}

.empty-cell {
  color: var(--text-muted);
  text-align: center;
}


.avito-page {
  display: grid;
  gap: 14px;
}

.avito-tabs {
  align-items: stretch;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.avito-tab {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  color: #64748b;
  display: inline-grid;
  gap: 3px 10px;
  grid-template-columns: auto auto;
  min-height: 50px;
  min-width: 156px;
  padding: 8px 14px;
  text-decoration: none;
}

.avito-tab:hover,
.avito-tab:focus-visible {
  border-color: #94a3b8;
  color: #1f2937;
  text-decoration: none;
}

.avito-tab.is-active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #0f766e;
  box-shadow: 0 1px 0 rgb(15 118 110 / 8%);
}

.avito-tab__title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.avito-tab__count {
  align-items: center;
  background: #fff;
  border: 1px solid rgb(100 116 139 / 24%);
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 24px;
  justify-content: center;
  min-width: 34px;
  padding: 0 8px;
}

.avito-tab__sub {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  grid-column: 1 / -1;
}

.avito-board {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  overflow: visible;
}

.avito-board__header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px;
}

.avito-board__header h1 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
}

.avito-board__badges,
.avito-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avito-toolbar {
  align-items: end;
  background: #f8fafc;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  padding: 12px 18px;
}

.avito-filter-tabs {
  align-items: center;
  background: #e2e8f0;
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.avito-filter-tab {
  border-radius: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.avito-filter-tab:hover,
.avito-filter-tab:focus-visible {
  color: #172033;
  text-decoration: none;
}

.avito-filter-tab.is-active {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 1px 2px rgb(15 23 42 / 9%);
}

.avito-search-field {
  display: grid;
  gap: 5px;
}

.avito-search-field span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.avito-search-field input,
.avito-product-search input {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172033;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.avito-card-list {
  display: flex;
  flex-direction: column;
}

.avito-card {
  align-items: stretch;
  border-bottom: 1px solid #edf2f7;
  display: grid;
  gap: 16px;
  grid-template-columns: 112px minmax(360px, 1fr) minmax(230px, 300px);
  min-height: 148px;
  padding: 14px 18px;
}

.avito-card:last-child {
  border-bottom: 0;
}

.avito-card.is-linked {
  background: linear-gradient(90deg, rgb(240 253 244 / 70%), #fff 34%);
}

.avito-card__media {
  align-self: start;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: block;
  height: 112px;
  overflow: hidden;
  text-decoration: none;
  width: 112px;
}

.avito-card__media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.avito-card__media-empty {
  align-items: center;
  color: #94a3b8;
  display: flex;
  font-size: 12px;
  font-weight: 850;
  height: 100%;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.avito-card__main {
  min-width: 0;
}

.avito-card__title {
  color: #172033;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  max-width: 860px;
}

.avito-card__title a {
  color: inherit;
  text-decoration: none;
}

.avito-card__title a:hover,
.avito-card__title a:focus-visible {
  color: #0f766e;
  text-decoration: underline;
}

.avito-card__meta {
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  line-height: 1.35;
  margin-top: 7px;
}

.avito-card__meta span + span::before {
  color: #cbd5e1;
  content: '/';
  margin-right: 8px;
}

.avito-card__description {
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 10px;
  max-width: 860px;
}

.avito-match-panel {
  align-items: start;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-width: 900px;
}

.avito-match-form {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 280px) auto;
}

.avito-product-search {
  position: relative;
}

.avito-product-results {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgb(15 23 42 / 16%);
  left: 0;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
}

.avito-product-option {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #172033;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.avito-product-option:hover,
.avito-product-option:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.avito-product-option strong {
  font-size: 13px;
  line-height: 1.3;
}

.avito-product-option span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
}

.avito-selected-product {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  min-height: 38px;
  min-width: 0;
  padding: 8px 10px;
}

.avito-selected-product.is-ready {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.avito-linked-product {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.avito-linked-product__label {
  color: #047857;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.avito-linked-product strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.3;
}

.avito-linked-product span:last-child {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.avito-description-lines {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 10px;
}

.avito-description-lines__header {
  align-items: center;
  color: #172033;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.avito-description-lines__header strong {
  font-size: 13px;
  font-weight: 900;
}

.avito-description-lines__header span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.avito-description-line-list {
  display: grid;
  gap: 6px;
}

.avito-description-line {
  align-items: center;
  background: #fff;
  border: 1px solid #e5edf5;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(86px, 120px) minmax(220px, 1fr) auto;
  padding: 8px;
}

.avito-description-line__label,
.avito-description-line__product {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.avito-description-line__label strong,
.avito-description-line__product span {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avito-description-line__product small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avito-description-line-form {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(72px, 100px) minmax(220px, 1fr) minmax(160px, 240px) minmax(120px, 150px) auto auto;
}

.avito-line-label-input,
.avito-line-unit-input {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172033;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.avito-inline-check {
  align-items: center;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  min-height: 38px;
  white-space: nowrap;
}

.avito-card__side {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-start;
  min-width: 0;
}

.avito-card__side-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.avito-card__price-box {
  display: grid;
  gap: 4px;
}

.avito-card__price-box--onec {
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 9px 10px;
  width: 100%;
}

.avito-card__price-box--missing {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 9px 10px;
  width: 100%;
}

.avito-card__price {
  color: #111827;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.avito-card__price--onec {
  color: #0f766e;
  font-size: 20px;
}

.avito-card__price-missing {
  color: #c2410c;
  font-size: 14px;
  font-weight: 900;
}

.avito-price-delta {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-self: start;
  line-height: 1;
  padding: 5px 8px;
}

.avito-price-delta.is-match {
  background: #ecfdf5;
  color: #047857;
}

.avito-price-delta.is-higher {
  background: #fff7ed;
  color: #c2410c;
}

.avito-price-delta.is-lower {
  background: #eff6ff;
  color: #1d4ed8;
}

.avito-card__date {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 750;
  margin-top: auto;
}

.avito-page .compact {
  min-height: 36px;
  padding: 7px 12px;
}

@media (max-width: 1100px) {
  .avito-toolbar {
    grid-template-columns: 1fr;
  }

  .avito-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .avito-card__media {
    height: 96px;
    width: 96px;
  }

  .avito-card__side {
    grid-column: 2;
  }

  .avito-match-form,
  .avito-description-line-form,
  .avito-description-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .avito-tab {
    flex: 0 0 auto;
  }

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

  .avito-filter-tabs {
    overflow-x: auto;
    width: 100%;
  }

  .avito-card {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .avito-card__media {
    height: 78px;
    width: 78px;
  }

  .avito-card__title {
    font-size: 15px;
  }

  .avito-card__price {
    font-size: 18px;
  }
}


.avito-extra-toggle {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
  justify-self: start;
  min-height: 36px;
  padding: 7px 10px;
}

.avito-extra-toggle input {
  accent-color: #0f766e;
}

.avito-extra-toggle strong {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.avito-description-lines[hidden] {
  display: none;
}

.avito-description-line-form {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.avito-description-line-drafts {
  display: grid;
  gap: 8px;
}

.avito-description-line-draft {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(72px, 100px) minmax(220px, 1fr) minmax(160px, 240px) minmax(120px, 150px) auto auto;
}

.avito-description-line-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .avito-description-line-draft {
    grid-template-columns: 1fr;
  }
}

/* Avito listing card polish: 20260710 */
.avito-card {
  grid-template-columns: 112px minmax(0, 1fr) minmax(190px, 220px);
  gap: 18px;
}

.avito-card__main {
  display: grid;
  align-content: start;
  min-width: 0;
}

.avito-card__title,
.avito-card__description,
.avito-match-panel,
.avito-description-lines {
  max-width: 760px;
}

.avito-match-panel,
.avito-description-lines {
  width: min(100%, 760px);
}

.avito-linked-product {
  gap: 2px;
  padding: 9px 11px 9px 13px;
  box-shadow: inset 3px 0 0 #10b981;
}

.avito-linked-product__label,
.avito-card__side-label {
  letter-spacing: 0;
}

.avito-linked-product__label {
  font-size: 10px;
}

.avito-linked-product strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.avito-card__side {
  align-items: stretch;
  gap: 8px;
  max-width: 220px;
  width: 100%;
}

.avito-card__side-label {
  font-size: 10px;
  margin-bottom: 2px;
}

.avito-card__price-box--onec,
.avito-card__price-box--missing {
  padding: 8px 9px;
}

.avito-card__price-box--onec {
  background: #f8fffb;
  border-color: #bbf7d0;
}

.avito-card__price {
  font-size: 21px;
}

.avito-card__price--onec {
  font-size: 18px;
}

.avito-price-delta {
  font-size: 11px;
  padding: 4px 7px;
}

.avito-card__chips {
  gap: 6px;
}

.avito-card__date {
  font-size: 11px;
}

.avito-extra-toggle {
  background: #ffffff;
  min-height: 34px;
  padding: 6px 10px;
}

.avito-description-lines {
  padding: 8px;
}

.avito-description-line {
  grid-template-columns: minmax(64px, 90px) minmax(0, 1fr) auto;
  padding: 7px 8px;
}

@media (max-width: 1100px) {
  .avito-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .avito-card__side {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    grid-column: 2;
    max-width: 100%;
  }

  .avito-card__price-box {
    min-width: 132px;
  }

  .avito-card__price-box--onec,
  .avito-card__price-box--missing {
    width: auto;
  }
}

@media (max-width: 620px) {
  .avito-card {
    gap: 12px;
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 12px;
  }

  .avito-card__side {
    grid-column: 1 / -1;
  }

  .avito-card__price {
    font-size: 18px;
  }

  .avito-card__price--onec {
    font-size: 17px;
  }

  .avito-match-panel,
  .avito-description-lines {
    max-width: 100%;
    width: 100%;
  }
}

/* Avito description primary chip polish: 20260710 */
.avito-description-line {
  grid-template-columns: minmax(150px, 170px) minmax(0, 1fr) auto;
}

.avito-description-line__label {
  align-content: start;
}

.avito-description-line__label .status-pill {
  justify-self: start;
  max-width: 100%;
  white-space: nowrap;
}

.avito-description-line__product {
  min-width: 0;
}

.avito-description-line__product small {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .avito-description-line {
    grid-template-columns: 1fr auto;
  }

  .avito-description-line__label {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / -1;
  }

  .avito-description-line__product {
    grid-column: 1 / -1;
  }
}

/* Avito title copy button: 20260710 */
.avito-card__title-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  max-width: 760px;
  min-width: 0;
}

.avito-card__title-row .avito-card__title {
  min-width: 0;
}

.avito-copy-title-button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  min-height: 26px;
  padding: 6px 8px;
  white-space: nowrap;
}

.avito-copy-title-button:hover,
.avito-copy-title-button:focus-visible {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  outline: none;
}

.avito-copy-title-button.is-copied {
  background: #ecfdf5;
  border-color: #86efac;
  color: #047857;
}

.avito-copy-title-button.is-error {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.avito-copy-title-button:disabled {
  cursor: default;
  opacity: 1;
}

@media (max-width: 620px) {
  .avito-card__title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}



/* Knowledge base */
.knowledge-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.knowledge-summary-strip > div {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px;
}

.knowledge-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.knowledge-summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.1;
}

.knowledge-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) minmax(190px, 260px) auto auto auto;
}

.knowledge-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.knowledge-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  min-height: 158px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
}

.knowledge-thumb,
.knowledge-photo-large {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.knowledge-thumb {
  width: 82px;
  height: 82px;
  border-radius: 8px;
}

.knowledge-thumb img,
.knowledge-photo-large img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.knowledge-card-topline,
.training-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.knowledge-brand,
.knowledge-stock {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.knowledge-brand {
  background: #eef2f7;
  color: #263241;
}

.brand-VIRA {
  background: #fee2e2;
  color: #991b1b;
}

.brand-RAGE,
.brand-RAGE-by-VIRA {
  background: #111827;
  color: #f9fafb;
}

.brand-RAGE-Furious {
  background: #fef3c7;
  color: #92400e;
}

.knowledge-stock.in-stock {
  background: #dcfce7;
  color: #166534;
}

.knowledge-stock.out-stock {
  background: #f1f5f9;
  color: #64748b;
}

.knowledge-card h2,
.training-card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.knowledge-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.knowledge-card h2 a:hover {
  color: var(--accent-strong);
}

.knowledge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.knowledge-meta span {
  padding: 3px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #526173;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-card p,
.training-card p,
.knowledge-description,
.knowledge-source-comment {
  color: var(--muted);
  line-height: 1.45;
}

.knowledge-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 13px;
}

.knowledge-detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-detail-aside {
  display: grid;
  gap: 12px;
}

.knowledge-photo-large {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 42px;
}

.knowledge-side-facts {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
}

.knowledge-side-facts a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.knowledge-note-grid,
.knowledge-attributes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.knowledge-attribute {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.knowledge-attribute span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.knowledge-attribute strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.knowledge-source-comment {
  white-space: pre-line;
}

.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.training-card {
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
}

.training-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.training-options button {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.training-options button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #ecfdf5;
}

.training-options button.is-correct {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.training-options button.is-wrong {
  border-color: #dc2626;
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 760px) {
  .knowledge-summary-strip,
  .knowledge-detail-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar {
    grid-template-columns: 1fr;
  }

  .knowledge-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .knowledge-thumb {
    width: 72px;
    height: 72px;
  }
}

.portal-page-title .summary-link {
  align-self: center;
}
.portal-admin-note {
  margin-bottom: 14px;
}
.portal-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.portal-stat {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--panel-raised-shadow);
}
.portal-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.portal-stat strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text);
  font-size: 24px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-admin-panel + .portal-admin-panel {
  margin-top: 18px;
}
.portal-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.portal-table-wrap table {
  min-width: 1320px;
}
.portal-client-table td,
.portal-order-table td {
  vertical-align: top;
}
.portal-client-table input,
.portal-client-table select,
.portal-order-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 9px;
}
.portal-client-table small,
.portal-order-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.portal-client-table th:nth-child(1),
.portal-client-table td:nth-child(1) { min-width: 190px; }
.portal-client-table th:nth-child(2),
.portal-client-table td:nth-child(2) { min-width: 180px; }
.portal-client-table th:nth-child(6),
.portal-client-table td:nth-child(6) { min-width: 220px; }
.portal-order-table th:nth-child(7),
.portal-order-table td:nth-child(7) { min-width: 360px; white-space: normal; }
.portal-order-lines summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
}
.portal-order-lines-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.portal-order-lines-list div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}
.portal-order-lines-list span,
.portal-order-lines-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.portal-order-lines-list strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sales report and customer analytics */
.sales-report-title,
.customer-sales-title {
  align-items: center;
}

.sales-report-title p:not(.eyebrow),
.customer-sales-title p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.sales-report-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, .9fr) repeat(2, minmax(180px, .75fr)) minmax(250px, 1.15fr);
  grid-template-areas:
    "period date-from date-to actions"
    "department manager customer customer";
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--panel-raised-shadow);
}

.sales-report-toolbar .logistics-filter-field {
  min-width: 0;
  min-height: 64px;
  box-sizing: border-box;
}

.sales-report-period-filter { grid-area: period; }
.sales-report-date-from-filter { grid-area: date-from; }
.sales-report-date-to-filter { grid-area: date-to; }
.sales-report-department-filter { grid-area: department; }
.sales-report-manager-filter { grid-area: manager; }
.sales-report-customer-filter { grid-area: customer; }

.sales-report-toolbar .logistics-filter-field input,
.sales-report-toolbar .logistics-filter-field select {
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  font-size: 15px;
  line-height: 1.15;
}

.sales-report-filter-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  grid-area: actions;
  gap: 8px;
  min-height: 64px;
}

.sales-report-filter-actions button,
.sales-report-filter-actions .button-link {
  box-sizing: border-box;
  min-height: 42px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.button-link.secondary {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--text);
}

.sales-report-primary-card {
  border-color: #99d5ca;
  background: linear-gradient(145deg, #ffffff 0%, #edfdf8 100%);
}

.sales-report-metrics .metric-card strong {
  font-size: clamp(22px, 2.1vw, 30px);
  letter-spacing: -.02em;
}

.sales-delta {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #506070;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sales-delta--positive {
  background: #dcfce7;
  color: #166534;
}

.sales-delta--negative {
  background: #fee2e2;
  color: #991b1b;
}

.sales-report-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: -4px 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 64%);
  color: var(--muted);
  font-size: 13px;
}

.sales-report-facts strong {
  color: var(--text);
  font-size: 15px;
}

.sales-report-warning {
  margin-bottom: 18px;
}

.sales-report-warning h2,
.sales-panel-heading h2 {
  margin-bottom: 4px;
}

.sales-report-warning .status-pill {
  text-decoration: none;
}

.sales-chart-panel {
  margin-bottom: 18px;
  padding: 18px 18px 10px;
  overflow: hidden;
}

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

.sales-chart-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sales-chart-summary::-webkit-details-marker {
  display: none;
}

.sales-chart-panel:not([open]) .sales-chart-summary {
  margin-bottom: 0;
}

.sales-chart-summary-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.sales-chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sales-chart-toggle-text::before {
  content: "Свернуть";
}

.sales-chart-panel:not([open]) .sales-chart-toggle-text::before {
  content: "Развернуть";
}

.sales-chart-toggle-icon::before {
  content: "▴";
  font-style: normal;
}

.sales-chart-panel:not([open]) .sales-chart-toggle-icon::before {
  content: "▾";
}

.sales-chart-content {
  min-width: 0;
}

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

.sales-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sales-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sales-legend-bar,
.sales-legend-line {
  display: inline-block;
  width: 20px;
  height: 8px;
  border-radius: 3px;
  background: #83d6c9;
}

.sales-legend-line {
  height: 3px;
  border-radius: 999px;
  background: #f59e0b;
}

.sales-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.sales-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.sales-chart-grid,
.sales-chart-axis {
  stroke: #e4eaf0;
  stroke-width: 1;
}

.sales-chart-axis {
  stroke: #aeb9c5;
}

.sales-chart-bar {
  fill: #83d6c9;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: sales-chart-bar-rise .62s cubic-bezier(.22, .8, .32, 1) both;
  transition: fill .15s ease;
}

.sales-chart-bar:hover {
  fill: var(--accent);
}

.sales-chart-profit-line {
  fill: none;
  stroke: #f59e0b;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  animation: sales-chart-line-draw .82s cubic-bezier(.3, .7, .2, 1) .28s both;
}

.sales-chart-profit-point {
  fill: #fff;
  stroke: #d97706;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: sales-chart-point-pop .3s cubic-bezier(.2, .9, .35, 1.35) both;
}

.sales-chart-label,
.sales-chart-value {
  fill: #778493;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.sales-report-toolbar,
.sales-report-metrics .metric-card,
.sales-report-facts,
.sales-chart-panel,
.sales-customers-panel {
  animation: sales-report-enter .42s cubic-bezier(.22, .8, .32, 1) both;
}

.sales-report-metrics .metric-card:nth-child(1) { animation-delay: 60ms; }
.sales-report-metrics .metric-card:nth-child(2) { animation-delay: 110ms; }
.sales-report-metrics .metric-card:nth-child(3) { animation-delay: 160ms; }
.sales-report-facts { animation-delay: 190ms; }
.sales-chart-panel { animation-delay: 220ms; }
.sales-customers-panel { animation-delay: 260ms; }

@keyframes sales-report-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sales-chart-bar-rise {
  from { opacity: .25; transform: scaleY(0); }
  to { opacity: 1; transform: scaleY(1); }
}

@keyframes sales-chart-line-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes sales-chart-point-pop {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sales-report-toolbar,
  .sales-report-metrics .metric-card,
  .sales-report-facts,
  .sales-chart-panel,
  .sales-customers-panel,
  .sales-chart-bar,
  .sales-chart-profit-line,
  .sales-chart-profit-point {
    animation: none !important;
    transition: none !important;
  }
}

.sales-customers-panel {
  overflow: hidden;
}

.sales-manager-groups {
  background: #fff;
}

.sales-manager-group {
  margin: 0;
}

.sales-manager-group + .sales-manager-group {
  border-top: 1px solid var(--line);
}

.sales-manager-group-summary {
  display: grid;
  grid-template-columns: 18px minmax(190px, 1fr) minmax(0, auto) 82px;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  transition: background-color .16s ease;
}

.sales-manager-group-summary::-webkit-details-marker {
  display: none;
}

.sales-manager-group-summary::marker {
  content: "";
}

.sales-manager-group-summary:hover {
  background: #f7fbfa;
}

.sales-manager-group-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.sales-manager-group[open] > .sales-manager-group-summary {
  background: #f0fdfa;
  box-shadow: inset 0 -1px 0 #cfe9e3;
}

.sales-manager-group-chevron {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.sales-manager-group-chevron::before {
  content: "▸";
}

.sales-manager-group[open] .sales-manager-group-chevron::before {
  content: "▾";
}

.sales-manager-group-identity {
  min-width: 0;
}

.sales-manager-group-identity small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sales-manager-group-identity strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-manager-group-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px 18px;
  min-width: 0;
}

.sales-manager-group-stats > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.sales-manager-group-stats strong {
  margin-left: 4px;
  color: var(--text);
  font-size: 13px;
}

.sales-manager-group-toggle {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.sales-manager-group-toggle::before {
  content: "Свернуть";
}

.sales-manager-group:not([open]) .sales-manager-group-toggle::before {
  content: "Развернуть";
}

.sales-manager-group-table-wrap {
  background: #fff;
}

.sales-manager-groups-empty {
  margin: 0;
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 761px) {
  .sales-customers-panel .analytics-table-wrap {
    overflow-x: auto;
    scrollbar-gutter: stable;
  }

  .analytics-table-wrap .sales-customers-table {
    min-width: 1248px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(1) {
    width: 215px;
    max-width: 215px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(2) {
    width: 148px;
    max-width: 148px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(3) {
    width: 150px;
    max-width: 150px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(4) {
    width: 190px;
    max-width: 190px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(5) {
    width: 112px;
    max-width: 112px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(6) {
    width: 138px;
    max-width: 138px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(7) {
    width: 80px;
    max-width: 80px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(8) {
    width: 70px;
    max-width: 70px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(9) {
    width: 65px;
    max-width: 65px;
  }

  .analytics-table-wrap .sales-customers-table :is(th, td):nth-child(10) {
    width: 120px;
    max-width: 120px;
  }
}

.sales-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.sales-sort-link:hover,
.sales-sort-link:focus-visible {
  color: var(--accent-strong);
}

.sales-customers-table th.numeric-col .sales-sort-link {
  justify-content: flex-end;
}

.sales-customers-table .sales-customer-delta-col .sales-sort-link {
  justify-content: center;
}

.sales-sort-indicator {
  flex: 0 0 auto;
  color: #8a98a8;
  font-size: 12px;
  line-height: 1;
  opacity: .45;
}

.sales-sort-link:hover .sales-sort-indicator,
.sales-sort-link:focus-visible .sales-sort-indicator,
.sales-sort-indicator.is-active {
  color: var(--accent-strong);
  opacity: 1;
}

.sales-customers-table th[aria-sort="ascending"],
.sales-customers-table th[aria-sort="descending"] {
  background: #f0fdfa;
  color: var(--accent-strong);
}

.sales-customer-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.sales-customer-link:hover,
.sales-back-link:hover {
  text-decoration: underline;
}

.sales-report-documents-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 34px;
  color: var(--accent-strong);
  text-align: right;
}

.sales-report-documents-link-icon {
  font-size: 10px;
  line-height: 1;
  transition: transform .15s ease;
}

.sales-report-documents-link:hover .sales-report-documents-link-icon,
.sales-report-documents-link:focus-visible .sales-report-documents-link-icon {
  transform: translate(1px, -1px);
}

.sales-report-documents-link.is-loading {
  cursor: wait;
  opacity: .6;
  pointer-events: none;
}

.sales-report-documents-modal {
  width: min(1240px, calc(100vw - 36px));
}

.sales-report-documents-modal-body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
}

.sales-report-documents-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e2ec;
  border-radius: 9px;
  background: #fff;
  padding: 11px 13px;
}

.sales-report-documents-intro > span:first-child {
  display: grid;
  gap: 3px;
}

.sales-report-documents-intro small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.sales-report-documents-intro strong {
  color: var(--text);
  font-size: 14px;
}

.sales-report-documents-list {
  display: grid;
  gap: 10px;
}

.sales-report-document-card {
  overflow: hidden;
  border: 1px solid #d8e2ec;
  border-radius: 9px;
  background: #fff;
}

.sales-report-document-summary {
  display: grid;
  grid-template-columns: 18px minmax(185px, .8fr) minmax(260px, 1.4fr) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  transition: background-color .15s ease;
}

.sales-report-document-summary::-webkit-details-marker {
  display: none;
}

.sales-report-document-summary::marker {
  content: "";
}

.sales-report-document-summary:hover {
  background: #f7fbfa;
}

.sales-report-document-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.sales-report-document-card[open] > .sales-report-document-summary {
  background: #f0fdfa;
}

.sales-report-document-chevron {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.sales-report-document-chevron::before {
  content: "▸";
}

.sales-report-document-card[open] .sales-report-document-chevron::before {
  content: "▾";
}

.sales-report-document-identity,
.sales-report-document-amount {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sales-report-document-identity small,
.sales-report-document-amount small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.sales-report-document-identity strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-report-document-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-report-document-amount {
  justify-items: end;
  text-align: right;
  white-space: nowrap;
}

.sales-report-document-amount strong {
  color: var(--text);
  font-size: 14px;
}

.sales-report-document-body {
  padding: 12px;
  border-top: 1px solid #d8e2ec;
  background: #fff;
}

.sales-report-document-warning {
  margin-top: 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.sales-report-document-lines-wrap {
  margin-top: 10px;
}

.sales-report-documents-empty {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  padding: 28px 16px;
  text-align: center;
}

@media (max-width: 900px) {
  .sales-report-document-summary {
    grid-template-columns: 18px minmax(0, 1fr) minmax(120px, auto);
  }

  .sales-report-document-meta {
    grid-column: 2 / -1;
    grid-row: 2;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .sales-report-documents-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-report-document-summary {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 7px 9px;
    padding: 11px;
  }

  .sales-report-document-meta,
  .sales-report-document-amount {
    grid-column: 2;
  }

  .sales-report-document-meta {
    grid-row: 2;
  }

  .sales-report-document-amount {
    grid-row: 3;
    justify-items: start;
    text-align: left;
  }

  .sales-report-document-body {
    padding: 9px;
  }
}

.sales-customers-table td small,
.customer-sku-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-table-wrap .sales-customers-table .sales-customer-sales-col {
  width: 148px;
  max-width: 148px;
  padding-right: 18px;
}

.analytics-table-wrap .sales-customers-table .sales-customer-average-check-col {
  width: 150px;
  max-width: 150px;
  padding-right: 18px;
}

.analytics-table-wrap .sales-customers-table .sales-customer-delta-col {
  width: 112px;
  max-width: 112px;
  padding-right: 14px;
  padding-left: 12px;
  text-align: center;
}

.sales-customer-debt {
  min-width: 138px;
}

.sales-customer-debt strong {
  white-space: nowrap;
}

.sales-customer-debt strong.has-debt {
  color: #9a6700;
}

.sales-customer-debt strong.is-overdue,
.sales-customer-debt strong.is-overdue + small {
  color: #b42318;
}

.sales-back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.customer-sales-tabs {
  margin-bottom: 18px;
}

.metric-card-link {
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.metric-card-link:hover,
.metric-card-link:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgb(15 118 110 / 14%);
  outline: none;
  transform: translateY(-2px);
}

.customer-sales-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr);
  gap: 16px;
  align-items: start;
}

.customer-history-panel {
  margin-bottom: 0;
}

.customer-sales-summary,
.customer-category-panel {
  margin: 0;
}

.sales-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.sales-matrix-card {
  padding: 16px;
  border: 1px solid var(--panel-raised-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--panel-raised-shadow);
}

.sales-matrix-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sales-matrix-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 27px;
}

.sales-matrix-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.sales-matrix-card--positive {
  border-color: #9bd8bb;
  background: linear-gradient(145deg, #fff 0%, #effdf5 100%);
}

.sales-matrix-card--negative {
  border-color: #f1b7b7;
  background: linear-gradient(145deg, #fff 0%, #fff4f4 100%);
}

.customer-sales-sku-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(250px, .75fr);
  gap: 16px;
  align-items: start;
}

.customer-focus-products {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.customer-focus-products > .sales-panel-heading {
  margin-bottom: 2px;
}

.sku-depth-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sku-depth-picker > span {
  padding: 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sku-depth-picker a {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.sku-depth-picker a:hover,
.sku-depth-picker a:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.sku-depth-picker a.active {
  background: var(--accent);
  color: #fff;
}

.customer-focus-groups {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.customer-focus-section {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.customer-focus-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.customer-focus-section > summary::-webkit-details-marker {
  display: none;
}

.customer-focus-section > summary::before {
  content: "▸";
  color: var(--accent-strong);
}

.customer-focus-section[open] > summary::before {
  content: "▾";
}

.customer-focus-section > summary span {
  flex: 1;
  font-weight: 800;
}

.customer-focus-section > summary strong {
  color: var(--accent-strong);
  white-space: nowrap;
}

.customer-focus-table-wrap {
  max-height: 520px;
  border-top: 1px solid var(--line);
  overflow: auto;
}

.customer-focus-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.sku-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #506070;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sku-status--new {
  background: #dcfce7;
  color: #166534;
}

.sku-status--lost {
  background: #fee2e2;
  color: #991b1b;
}

.customer-category-list {
  display: grid;
  gap: 0;
}

.customer-category-list > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.customer-category-list > div:last-child {
  border-bottom: 0;
}

.customer-category-list span {
  font-size: 13px;
  font-weight: 750;
}

.customer-category-list strong {
  font-size: 13px;
}

.customer-category-list small {
  color: var(--muted);
  font-size: 11px;
}

.customer-sales-profile .detail-section {
  max-width: none;
}

@media (max-width: 1180px) {
  .sales-report-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: none;
  }

  .sales-report-period-filter,
  .sales-report-date-from-filter,
  .sales-report-date-to-filter,
  .sales-report-department-filter,
  .sales-report-manager-filter,
  .sales-report-customer-filter,
  .sales-report-filter-actions {
    grid-area: auto;
  }

  .sales-report-filter-actions {
    align-self: end;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .customer-sales-overview-grid,
  .customer-sales-sku-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .sales-report-title,
  .customer-sales-title,
  .sales-panel-heading,
  .sales-report-warning {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-report-toolbar {
    grid-template-columns: 1fr;
  }

  .sales-report-filter-actions,
  .sales-report-filter-actions button,
  .sales-report-filter-actions .button-link {
    width: 100%;
  }

  .sales-report-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sales-manager-group-summary {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 9px 11px;
    padding: 14px 12px;
  }

  .sales-manager-group-identity strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sales-manager-group-stats {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 5px 13px;
  }

  .sales-manager-group-stats > span {
    font-size: 11px;
  }

  .sales-manager-group-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  .sales-chart-legend {
    flex-wrap: wrap;
  }

  .sales-chart-summary-side {
    width: 100%;
    justify-content: space-between;
  }

  .sales-matrix-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified user settings: 20260715 */
.user-directory-title {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.user-directory-title h1,
.user-profile-heading h1 {
  margin-bottom: 4px;
}

.user-directory-title p:not(.eyebrow),
.user-profile-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
}

.user-directory-title-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-directory-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, .65fr)) repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.user-directory-metrics > a,
.user-directory-integration-metric {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  text-decoration: none;
}

.user-directory-metrics > a:hover,
.user-directory-metrics > a.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.user-directory-metrics > a.user-directory-agent-pending.has-pending {
  border-color: #f2c66d;
  background: #fffaf0;
  color: #8a4b08;
}

.user-directory-metrics > a.user-directory-agent-pending.has-pending:hover,
.user-directory-metrics > a.user-directory-agent-pending.has-pending:focus-visible {
  border-color: #d97706;
  box-shadow: inset 0 0 0 1px #d97706;
}

.user-directory-metrics span,
.user-directory-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.user-directory-metrics strong {
  font-size: 22px;
  line-height: 1;
}

.agent-registration-panel {
  scroll-margin-top: 16px;
  border: 1px solid #f0d9a5;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf8, #fffaf0);
  display: grid;
  gap: 13px;
  margin-bottom: 14px;
  padding: 16px;
}

.agent-registration-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.agent-registration-heading h2 {
  font-size: 20px;
  margin: 1px 0 3px;
}

.agent-registration-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
}

.agent-registration-count {
  align-items: center;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  min-width: 36px;
  padding: 0 11px;
}

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

.agent-registration-card {
  align-items: end;
  border: 1px solid #eadfca;
  border-radius: 13px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(430px, 1.65fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.agent-registration-person {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.agent-registration-person > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-registration-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-registration-person small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.agent-registration-approve {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(150px, .65fr) auto;
  gap: 8px;
  min-width: 0;
}

.agent-registration-approve label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agent-registration-approve label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.agent-registration-approve select {
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  min-width: 0;
  padding: 9px 10px;
  width: 100%;
}

.agent-registration-approve button,
.agent-registration-reject button {
  min-height: 40px;
  white-space: nowrap;
}

.agent-registration-reject button {
  border: 1px solid #efb4ae;
  background: #fff;
  color: #b42318;
}

.user-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, .28fr) auto;
  margin-bottom: 12px;
}

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

.user-directory-row {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.user-directory-row:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--panel-border));
  box-shadow: 0 8px 24px rgba(30, 41, 59, .07);
  transform: translateY(-1px);
}

.user-directory-row.is-inactive {
  background: #f8fafc;
  opacity: .8;
}

.user-directory-row-main {
  align-items: center;
  color: inherit;
  display: grid;
  grid-template-columns: 42px minmax(170px, 1.25fr) minmax(130px, .8fr) minmax(210px, 1fr) minmax(160px, .65fr) minmax(135px, .65fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 11px 13px;
  text-decoration: none;
}

.user-directory-avatar,
.user-profile-avatar {
  align-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #edf4ff, #e8f7ee);
  color: var(--accent);
  display: flex;
  font-size: 18px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.user-directory-identity,
.user-directory-name,
.user-directory-groups,
.user-directory-scope,
.user-directory-services,
.user-directory-login {
  min-width: 0;
}

.user-directory-identity {
  display: grid;
  gap: 4px;
}

.user-directory-name {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.user-directory-name > strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-directory-identity > small {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  overflow-wrap: anywhere;
}

.user-directory-groups,
.user-directory-services {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.user-directory-groups > span,
.user-directory-services > span {
  border-radius: 999px;
  background: #eef2f7;
  color: #526174;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 7px;
}

.user-directory-groups > span.is-empty {
  color: #8b96a6;
}

.user-directory-services > span.is-linked {
  background: #e8f7ee;
  color: #0f6b38;
}

.user-directory-scope {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.user-directory-scope > span {
  display: grid;
  gap: 1px;
}

.user-directory-scope strong {
  font-size: 14px;
}

.user-directory-scope small,
.user-directory-login small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.15;
}

.user-directory-login {
  display: grid;
  gap: 2px;
}

.user-directory-login strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.user-directory-open {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.user-create-panel > summary {
  cursor: pointer;
}

.user-create-panel > summary small,
.user-manager-directory .table-summary small {
  color: var(--muted);
  font-weight: 650;
}

.user-create-panel .user-create-form {
  padding: 16px 18px 18px;
}

.user-manager-metrics {
  grid-template-columns: repeat(3, minmax(140px, 220px));
}

.user-manager-directory input[type="text"],
.user-manager-directory input[type="number"],
.user-manager-directory select {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-width: 110px;
  padding: 8px 9px;
  width: 100%;
}

.user-manager-directory td:first-child {
  min-width: 230px;
}

.user-profile-hero {
  align-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: linear-gradient(115deg, #ffffff 0%, #f8fbff 65%, #f1fbf6 100%);
  display: grid;
  grid-template-columns: 64px minmax(220px, 1fr) auto auto;
  gap: 16px;
  margin: 2px 0 12px;
  padding: 18px;
}

.user-profile-hero.is-inactive {
  background: #f8fafc;
}

.user-profile-avatar {
  border-radius: 16px;
  font-size: 27px;
  height: 64px;
  width: 64px;
}

.user-profile-heading h1 {
  font-size: 27px;
  margin-top: 1px;
}

.user-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.user-profile-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 7px;
}

.user-profile-facts > span {
  border-left: 1px solid var(--panel-border);
  display: grid;
  gap: 3px;
  padding-left: 11px;
}

.user-profile-facts small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.user-profile-facts strong {
  font-size: 20px;
}

.user-profile-notice {
  margin: 0 0 10px;
}

.user-profile-nav {
  align-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .96);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 5px;
  position: sticky;
  top: 8px;
  z-index: 20;
}

.user-profile-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  text-decoration: none;
}

.user-profile-nav a:hover {
  background: #eef5ff;
  color: var(--accent);
}

.user-settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-settings-panel {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #fff;
  min-width: 0;
  padding: 17px;
  scroll-margin-top: 72px;
}

.user-settings-panel-wide {
  grid-column: 1 / -1;
}

.user-settings-panel-head,
.user-settings-subhead {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.user-settings-panel-head h2,
.user-settings-subhead h3,
.user-integration-card h3,
.user-security-card h3 {
  margin: 0;
}

.user-settings-panel-head h2 {
  font-size: 19px;
}

.user-settings-panel-head .eyebrow {
  margin-bottom: 3px;
}

.user-settings-source {
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.user-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.user-profile-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.user-profile-field > span,
.user-manager-settings-card > label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.user-profile-field input,
.user-manager-settings-card input[type="text"],
.user-manager-settings-card input[type="number"],
.user-manager-settings-card select {
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  min-width: 0;
  padding: 9px 10px;
  width: 100%;
}

.user-profile-field.is-readonly input {
  background: #f5f7fa;
  color: #5b6778;
}

.user-profile-field small {
  color: var(--muted);
  font-size: 10px;
}

.user-profile-form-actions {
  align-items: flex-end;
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.user-settings-panel button,
.user-manager-settings-card button {
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 12px;
}

.user-access-profile-form {
  display: grid;
  gap: 12px;
}

.user-access-profile-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.user-access-profile-option,
.user-toggle-option {
  align-items: flex-start;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
}

.user-access-profile-option:has(input:checked),
.user-toggle-option:has(input:checked) {
  border-color: #94d6b6;
  background: #f4fbf7;
}

.user-access-profile-option input,
.user-toggle-option input {
  flex: 0 0 auto;
  margin: 3px 0 0;
}

.user-access-profile-option > span,
.user-toggle-option > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-access-profile-option strong,
.user-toggle-option strong {
  font-size: 12px;
}

.user-access-profile-option small,
.user-toggle-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.user-permissions-details {
  border-top: 1px solid var(--panel-border);
  margin-top: 14px;
  padding-top: 11px;
}

.user-permissions-details summary {
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.user-permission-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.user-permission-modules > div {
  border-radius: 9px;
  background: #f7f9fc;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.user-permission-modules strong {
  font-size: 11px;
  margin-bottom: 2px;
}

.user-permission-modules span {
  color: var(--muted);
  font-size: 10px;
}

.user-work-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.user-assignment-form {
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.user-assignment-form-head {
  display: grid;
  gap: 2px;
}

.user-assignment-form-head strong {
  font-size: 14px;
}

.user-assignment-form-head span {
  color: var(--muted);
  font-size: 10px;
}

.user-assignment-options {
  align-content: start;
  display: grid;
  gap: 5px;
  max-height: 250px;
  min-height: 120px;
  overflow: auto;
  padding-right: 4px;
}

.user-assignment-options label {
  align-items: flex-start;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  gap: 8px;
  padding: 7px 8px;
}

.user-assignment-options label:has(input:checked) {
  background: #edf8f2;
}

.user-assignment-options input {
  margin-top: 2px;
}

.user-assignment-options label > span {
  display: grid;
  gap: 1px;
}

.user-assignment-options strong {
  font-size: 11px;
}

.user-assignment-options small {
  color: var(--muted);
  font-size: 9px;
}

.user-manager-settings-list {
  border-top: 1px solid var(--panel-border);
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
}

.user-settings-subhead {
  margin-bottom: 3px;
}

.user-settings-subhead h3 {
  font-size: 15px;
}

.user-settings-subhead p {
  color: var(--muted);
  font-size: 10px;
  margin: 3px 0 0;
}

.user-manager-settings-card {
  align-items: end;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .8fr) minmax(145px, .65fr) 90px minmax(145px, .65fr) minmax(170px, .8fr) auto;
  gap: 9px;
  min-width: 0;
  padding: 11px;
}

.user-manager-settings-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-manager-settings-name > strong {
  font-size: 13px;
}

.user-manager-settings-name > small {
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.user-manager-settings-name > span {
  color: #8a3d12;
  font-size: 9px;
  font-weight: 800;
}

.user-manager-settings-name > span.is-ready {
  color: #0f6b38;
}

.user-manager-settings-card > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-manager-settings-flags {
  display: grid;
  gap: 4px;
}

.user-manager-settings-flags label {
  align-items: center;
  display: flex;
  font-size: 9px;
  font-weight: 750;
  gap: 5px;
}

.user-manager-month-facts {
  display: grid;
  gap: 4px;
}

.user-manager-month-facts > span {
  display: grid;
  gap: 1px;
}

.user-manager-month-facts small {
  color: var(--muted);
  font-size: 8px;
}

.user-manager-month-facts strong {
  font-size: 10px;
}

.user-communications-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.user-integration-card,
.user-security-card {
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.user-integration-card-head {
  align-items: center;
  display: flex;
  gap: 9px;
}

.user-integration-icon {
  align-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: #1769aa;
  display: flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.user-integration-icon.is-agent {
  background: #ede9ff;
  color: #5b43d6;
}

.user-integration-icon.is-bot {
  background: #e8f7ee;
  color: #0f6b38;
}

.user-integration-card h3 {
  font-size: 14px;
}

.user-integration-card-head p,
.user-integration-card > small {
  color: var(--muted);
  font-size: 9px;
  margin: 2px 0 0;
}

.user-integration-state {
  border-radius: 9px;
  background: #f5f7fa;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 9px 10px;
}

.user-integration-state.is-linked {
  background: #eaf8f0;
}

.user-integration-state.is-suggested {
  background: #fff7e8;
}

.user-integration-state.is-error {
  background: #fff0f0;
}

.user-integration-state strong {
  font-size: 11px;
}

.user-integration-state span {
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.user-integration-facts,
.user-security-facts {
  display: grid;
  gap: 5px;
  margin: 0;
}

.user-integration-facts > div,
.user-security-facts > div {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.user-integration-facts dt,
.user-security-facts dt {
  color: var(--muted);
  font-size: 9px;
}

.user-integration-facts dd,
.user-security-facts dd {
  font-size: 9px;
  font-weight: 750;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.user-integration-binding {
  color: #0f6b38 !important;
  font-weight: 750;
}

.user-integration-suggestions {
  display: grid;
  gap: 5px;
}

.user-integration-suggestions > span {
  border-bottom: 1px solid var(--panel-border);
  display: grid;
  gap: 1px;
  padding-bottom: 5px;
}

.user-integration-suggestions strong {
  font-size: 10px;
}

.user-integration-suggestions small {
  color: var(--muted);
  font-size: 9px;
}

.user-integration-card > a,
.user-integration-card > form,
.user-integration-card > small:last-child {
  margin-top: auto;
}

.user-integration-card.is-agent-managed {
  grid-column: span 2;
}

.user-agent-account-form {
  border-top: 1px solid var(--panel-border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 2px !important;
  padding-top: 11px;
}

.user-agent-account-form > label:not(.user-toggle-option) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-agent-account-form > label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.user-agent-account-form input[type="text"],
.user-agent-account-form select,
.user-agent-account-form textarea {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  min-width: 0;
  padding: 8px 9px;
  resize: vertical;
  width: 100%;
}

.user-agent-account-form .user-agent-active,
.user-agent-account-form .is-wide,
.user-agent-account-actions {
  grid-column: 1 / -1;
}

.user-agent-price-types {
  border: 0;
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.user-agent-price-types legend {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 4px;
  padding: 0;
}

.user-agent-price-types > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.user-agent-account-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-agent-account-actions small {
  color: var(--muted);
  font-size: 9px;
}

.user-agent-devices {
  border-top: 1px solid var(--panel-border);
  display: grid;
  gap: 8px;
  padding-top: 11px;
}

.user-agent-devices-head,
.user-agent-device-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.user-agent-devices-head > div,
.user-agent-device-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-agent-devices-head strong,
.user-agent-device-row strong {
  font-size: 11px;
}

.user-agent-devices-head small,
.user-agent-device-row small,
.user-agent-devices-empty {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.user-agent-device-list {
  display: grid;
  gap: 5px;
}

.user-agent-device-row {
  border-radius: 8px;
  background: #f7f9fc;
  padding: 8px 9px;
}

.user-settings-panel button.is-compact {
  flex: 0 0 auto;
  font-size: 9px;
  padding: 6px 8px;
  white-space: nowrap;
}

.user-notification-settings {
  border-top: 1px solid var(--panel-border);
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(130px, .45fr) minmax(200px, 1.2fr) minmax(200px, 1.2fr) minmax(130px, .45fr) minmax(130px, .45fr);
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
}

.user-notification-settings .user-settings-subhead {
  grid-column: 1 / -1;
}

.user-security-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.user-security-card h3 {
  font-size: 14px;
}

.user-security-card.password-reset-form {
  align-items: stretch;
  display: flex;
  grid-template-columns: none;
}

.user-security-card.password-reset-form input[type="password"] {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font: inherit;
  padding: 8px 9px;
  width: 100%;
}

.user-security-card.is-actions form,
.user-security-card.is-actions button {
  width: 100%;
}

.user-settings-panel button.is-danger {
  border-color: #b42318;
  background: #fff;
  color: #b42318;
}

@media (max-width: 1280px) {
  .user-directory-metrics {
    grid-template-columns: repeat(4, minmax(105px, 1fr));
  }

  .user-directory-integration-metric {
    grid-column: span 2;
  }

  .user-directory-agent-pending {
    grid-column: span 2;
  }

  .agent-registration-card {
    align-items: stretch;
    grid-template-columns: minmax(210px, .8fr) minmax(0, 1.7fr);
  }

  .agent-registration-reject {
    grid-column: 2;
    justify-self: end;
  }

  .user-directory-row-main {
    grid-template-columns: 42px minmax(180px, 1.15fr) minmax(130px, .75fr) minmax(190px, 1fr) minmax(140px, .65fr) auto;
  }

  .user-directory-login {
    display: none;
  }

  .user-manager-settings-card {
    grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(130px, .7fr));
  }

  .user-manager-settings-flags,
  .user-manager-month-facts,
  .user-manager-settings-card > form {
    align-self: stretch;
  }

  .user-notification-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .user-directory-row-main {
    grid-template-columns: 42px minmax(190px, 1fr) minmax(150px, .8fr) minmax(170px, .8fr) auto;
  }

  .user-directory-scope,
  .user-directory-login {
    display: none;
  }

  .user-profile-hero {
    grid-template-columns: 64px minmax(200px, 1fr) auto;
  }

  .user-profile-hero > .secondary-link {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .user-settings-layout,
  .user-communications-grid {
    grid-template-columns: 1fr;
  }

  .user-integration-card.is-agent-managed {
    grid-column: auto;
  }

  .user-settings-panel-wide {
    grid-column: auto;
  }

  .user-manager-settings-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-manager-settings-name,
  .user-manager-settings-card > form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .user-directory-title,
  .user-settings-panel-head,
  .user-settings-subhead {
    align-items: stretch;
    flex-direction: column;
  }

  .user-directory-title-actions,
  .user-directory-title-actions .secondary-link {
    width: 100%;
  }

  .user-directory-metrics,
  .user-manager-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-directory-integration-metric {
    grid-column: auto;
  }

  .user-directory-agent-pending {
    grid-column: auto;
  }

  .agent-registration-panel {
    padding: 13px;
  }

  .agent-registration-heading {
    align-items: flex-start;
  }

  .agent-registration-card,
  .agent-registration-approve {
    grid-template-columns: 1fr;
  }

  .agent-registration-reject {
    grid-column: auto;
    justify-self: stretch;
  }

  .agent-registration-approve button,
  .agent-registration-reject button {
    width: 100%;
  }

  .user-directory-toolbar {
    grid-template-columns: 1fr;
  }

  .user-directory-row-main {
    align-items: start;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .user-directory-avatar {
    border-radius: 10px;
    height: 38px;
    width: 38px;
  }

  .user-directory-groups,
  .user-directory-services {
    grid-column: 2 / -1;
  }

  .user-directory-open {
    grid-column: 3;
    grid-row: 1;
    font-size: 0;
  }

  .user-directory-open::after {
    content: "→";
    font-size: 17px;
  }

  .user-profile-hero {
    align-items: start;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .user-profile-avatar {
    border-radius: 13px;
    font-size: 22px;
    height: 52px;
    width: 52px;
  }

  .user-profile-heading h1 {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .user-profile-facts,
  .user-profile-hero > .secondary-link {
    grid-column: 1 / -1;
  }

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

  .user-profile-facts > span {
    padding-left: 7px;
  }

  .user-profile-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .user-profile-nav a {
    white-space: nowrap;
  }

  .user-settings-panel {
    padding: 13px;
  }

  .user-profile-form,
  .user-access-profile-groups,
  .user-permission-modules,
  .user-work-assignment-grid,
  .user-manager-settings-card,
  .user-agent-account-form,
  .user-notification-settings,
  .user-security-grid {
    grid-template-columns: 1fr;
  }

  .user-manager-settings-name,
  .user-manager-settings-card > form,
  .user-agent-account-form .user-agent-active,
  .user-agent-account-form .is-wide,
  .user-agent-account-actions,
  .user-notification-settings .user-settings-subhead {
    grid-column: auto;
  }

  .user-agent-devices-head,
  .user-agent-device-row {
    align-items: stretch;
    flex-direction: column;
  }

  .user-agent-devices-head form,
  .user-agent-devices-head button,
  .user-agent-device-row form,
  .user-agent-device-row button {
    width: 100%;
  }

  .user-assignment-options {
    max-height: 220px;
  }
}

/* Dashboard profit split: compact cards that keep money values readable. */
.dashboard-body .trade-rep-kpi.is-split {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 9px;
  padding: 12px;
}

.dashboard-body .trade-metric-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dashboard-body .trade-metric-split-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.dashboard-body .trade-metric-split-head > small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard-body .trade-metric-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-height: 0;
  background: transparent;
}

.dashboard-body .trade-metric-split-part {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  background: #f0fdf4;
  color: inherit;
  padding: 9px 10px;
  text-decoration: none !important;
  box-shadow: none;
}

.dashboard-body .trade-metric-split-part + .trade-metric-split-part {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.dashboard-body .trade-metric-split-part > span {
  color: #166534;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1.15;
  text-decoration: none !important;
  text-transform: uppercase;
}

.dashboard-body .trade-metric-split-part + .trade-metric-split-part > span {
  color: #1d4ed8;
}

.dashboard-body .trade-rep-kpi .trade-metric-split-part > strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(14px, 1.15vw, 18px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1.05;
  overflow-wrap: normal !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.dashboard-body .trade-metric-split-part > small {
  width: fit-content;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
}

.dashboard-body .trade-metric-split-part.is-clickable:hover,
.dashboard-body .trade-metric-split-part.is-clickable:focus-visible {
  z-index: auto;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #22c55e;
  outline: none;
  text-decoration: none !important;
}

.dashboard-body .trade-metric-split-part.is-clickable + .trade-metric-split-part.is-clickable:hover,
.dashboard-body .trade-metric-split-part.is-clickable + .trade-metric-split-part.is-clickable:focus-visible {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #3b82f6;
}

.dashboard-body .dashboard-profit-main--split {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px 18px;
}

.dashboard-body .dashboard-profit-main--split > .dashboard-profit-split-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.dashboard-body .dashboard-profit-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-body .dashboard-profit-breakdown-card {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  padding: 11px 12px;
}

.dashboard-body .dashboard-profit-breakdown-card--bank {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.dashboard-body .dashboard-profit-breakdown-card > span {
  color: #166534;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1.15;
  text-transform: uppercase;
}

.dashboard-body .dashboard-profit-breakdown-card--bank > span {
  color: #1d4ed8;
}

.dashboard-body .dashboard-profit-main .dashboard-profit-breakdown-card > strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(17px, 1.6vw, 22px) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1.05;
  overflow-wrap: normal !important;
  white-space: nowrap !important;
}

.dashboard-body .dashboard-profit-net {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  padding: 9px 11px;
}

.dashboard-body .dashboard-profit-net > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-body .dashboard-profit-main .dashboard-profit-net > strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(15px, 1.35vw, 18px) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.05;
  overflow-wrap: normal !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .dashboard-body .trade-metric-split {
    grid-template-columns: 1fr;
  }

  .dashboard-body .trade-metric-split-part {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label value"
      "detail detail";
    align-items: center;
    gap: 5px 10px;
  }

  .dashboard-body .trade-metric-split-part > span {
    grid-area: label;
  }

  .dashboard-body .trade-rep-kpi .trade-metric-split-part > strong {
    grid-area: value;
    justify-self: end;
    font-size: clamp(15px, 3vw, 18px);
  }

  .dashboard-body .trade-metric-split-part > small {
    grid-area: detail;
    justify-self: end;
  }

  .dashboard-body .dashboard-profit-main--split {
    padding: 14px;
  }

  .dashboard-body .dashboard-profit-breakdown-card {
    padding: 10px;
  }

  .dashboard-body .dashboard-profit-main .dashboard-profit-breakdown-card > strong {
    font-size: clamp(15px, 4.4vw, 19px) !important;
  }
}

@media (max-width: 520px) {
  .dashboard-body .trade-rep-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 350px) {
  .dashboard-body .dashboard-profit-breakdown {
    grid-template-columns: 1fr;
  }

  .dashboard-body .dashboard-profit-net {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.logistics-loader-icon {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  overflow: visible !important;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 2px 5px rgb(180 83 9 / 12%);
  color: #b45309;
  cursor: help;
  line-height: 1;
  padding: 2px;
  vertical-align: middle;
  white-space: normal !important;
}

.logistics-loader-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.logistics-loader-icon.is-vehicle {
  border-color: #fb923c;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  color: #c2410c;
}

.logistics-loader-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(245 158 11 / 24%);
}

.logistics-row-customer,
.logistics-modal-list-customer,
.logistics-title-with-loader,
.workspace-order-title,
.workspace-route-title,
.workspace-route-heading,
.workspace-route-order-title,
.dispatch-run-name {
  display: flex !important;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.logistics-row-customer > strong,
.logistics-modal-list-customer > span:first-child,
.logistics-title-with-loader > span:first-child,
.workspace-order-title > strong,
.workspace-route-title > strong,
.workspace-route-heading > h2,
.workspace-route-order-title > span:first-child,
.dispatch-run-name > span:first-child {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-route-compact h2 > .logistics-loader-icon,
.workspace-route-title > .logistics-loader-icon,
.dispatch-run-name > .logistics-loader-icon {
  align-self: center;
}

.logistics-availability-pill {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 22px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-availability-pill.is-available {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.logistics-availability-pill.is-day-off,
.logistics-availability-pill.is-inactive {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.logistics-availability-pill.is-vacation {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.logistics-availability-pill.is-sick,
.logistics-availability-pill.is-unavailable,
.logistics-availability-pill.is-no-driver {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.logistics-availability-pill.is-other-assignment {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
}

.logistics-availability-pill.is-repair {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #b45309;
}

.logistics-availability-filter,
.logistics-workspace-availability-filter {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fee7 0%, #f0fdf4 100%);
  color: #166534;
  cursor: pointer;
  padding: 7px 10px;
}

.logistics-availability-filter input,
.logistics-workspace-availability-filter input,
.logistics-work-availability-filter input {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #16a34a;
}

.logistics-availability-filter > span,
.logistics-workspace-availability-filter > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-availability-filter strong,
.logistics-workspace-availability-filter strong {
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.logistics-availability-filter small,
.logistics-workspace-availability-filter small {
  color: #4d7c0f;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.logistics-availability-filter a,
.logistics-workspace-availability-filter a {
  color: inherit;
}

.logistics-work-availability-filter {
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  cursor: pointer;
  padding: 4px 7px;
}

.logistics-work-availability-filter span {
  color: inherit;
  font-size: 10px;
}

.logistics-availability-warning {
  margin: -2px 0 8px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 10px;
}

.logistics-route-statuses {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.logistics-route-card.is-unavailable,
.workspace-route-row.is-unavailable,
.dispatch-run-card.is-unavailable {
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px rgb(245 158 11 / 18%);
}

.logistics-route-card.is-unavailable[data-logistics-accepts-orders="false"] {
  cursor: not-allowed;
}

.workspace-route-row > .logistics-availability-pill {
  margin-top: -2px;
}

.logistics-schedule-panel {
  margin-bottom: 14px;
}

.logistics-schedule-summary nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logistics-schedule-summary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 9px;
  text-decoration: none;
}

.logistics-driver-schedule-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(145px, .72fr)) minmax(230px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px 14px 8px;
}

.logistics-driver-schedule-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.logistics-driver-schedule-form label > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logistics-driver-schedule-form input,
.logistics-driver-schedule-form select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
}

.logistics-driver-schedule-form button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
  white-space: nowrap;
}

.logistics-schedule-help {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 0 14px 10px;
}

.logistics-schedule-table-wrap {
  overflow: auto;
  border-top: 1px solid #e2e8f0;
}

.logistics-schedule-table {
  min-width: 1220px;
  table-layout: fixed;
}

.logistics-schedule-table th,
.logistics-schedule-table td {
  padding: 6px;
  vertical-align: top;
}

.logistics-schedule-table thead th {
  background: #f8fafc;
  text-align: center;
}

.logistics-schedule-table thead th:first-child,
.logistics-schedule-table tbody th {
  width: 250px;
  text-align: left;
}

.logistics-schedule-table thead th:not(:first-child) {
  width: 138px;
}

.logistics-schedule-table thead span,
.logistics-schedule-table thead b,
.logistics-schedule-table tbody th strong,
.logistics-schedule-table tbody th small {
  display: block;
}

.logistics-schedule-table thead span,
.logistics-schedule-table tbody th small,
.logistics-schedule-cell small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.logistics-schedule-table .is-today {
  background: #f0fdfa;
}

.logistics-schedule-table tr.is-inactive {
  opacity: .62;
}

.logistics-schedule-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 4px;
  text-align: left;
}

.logistics-schedule-cell:hover,
.logistics-schedule-cell:focus-visible {
  border-color: #5eead4;
  background: #f0fdfa;
  outline: none;
}

.logistics-schedule-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-schedule-notice {
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 9px 12px;
}

.logistics-schedule-notice.is-success {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
}

.logistics-schedule-notice.is-error {
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.dispatch-unavailable-panel {
  display: grid;
  gap: 8px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px;
}

.dispatch-unavailable-panel > header {
  display: flex;
  justify-content: space-between;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
}

.dispatch-unavailable-panel > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

@media (max-width: 1400px) {
  .logistics-driver-schedule-form {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .logistics-driver-schedule-form {
    grid-template-columns: 1fr;
  }

  .logistics-availability-filter,
  .logistics-workspace-availability-filter {
    min-height: 44px;
  }
}

/* Logistics planner visual system · Figma concept 2026-07-21 */
body:has(.logistics-planner-shell) {
  background: #eef2f4;
}

body:has(.logistics-planner-shell) .logistics-page-shell {
  gap: 0;
  background: #eef2f4;
  padding: 12px 24px 20px;
}

.logistics-page-shell .breadcrumbs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  margin-bottom: 21px;
}

.logistics-page-shell .breadcrumbs {
  display: none;
}

.logistics-page-shell .logistics-breadcrumb-aside {
  display: grid;
  grid-template-columns: 255px auto minmax(190px, 1fr);
  justify-content: stretch;
  gap: 16px;
  width: 100%;
}

.logistics-page-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logistics-page-heading > span {
  overflow: hidden;
  color: #71818d;
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell .logistics-page-heading .breadcrumbs-title {
  color: #17252b;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.logistics-primary-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(116px, auto);
  gap: 4px;
  border-radius: 10px;
  background: #e4ebed;
  padding: 4px;
}

.logistics-primary-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5f717a;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 16px;
  white-space: nowrap;
}

.logistics-primary-tabs button.active {
  background: #0f8178;
  box-shadow: 0 2px 5px rgb(15 71 66 / 18%);
  color: #ffffff;
}

.logistics-primary-tabs-mobile,
.logistics-mobile-filter-toggle {
  display: none;
}

.logistics-filter-stack {
  display: contents;
}

.logistics-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
}

.logistics-schedule-link,
.logistics-page-shell .logistics-work-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #d4dfe3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  color: #38505b;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
  text-decoration: none;
}

.logistics-page-shell .logistics-work-mode-button {
  border-color: #97ddd6;
  background: #e8faf7;
  color: #006b64;
}

.logistics-page-shell .logistics-toolbar {
  grid-template-columns: minmax(180px, .7fr) minmax(230px, 1.6fr) repeat(3, minmax(112px, .55fr)) minmax(180px, .85fr);
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  border: 1px solid #d5e0e4;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgb(35 58 66 / 4%);
  padding: 8px;
}

.logistics-page-shell .logistics-filter-field {
  min-height: 54px;
  border-color: #d4e0e4;
  background: #fbfcfd;
  box-shadow: none;
  padding: 7px 10px;
}

.logistics-page-shell .logistics-filter-date {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "label label"
    "value shortcut";
  column-gap: 8px;
}

.logistics-page-shell .logistics-filter-date > span:first-child {
  grid-area: label;
}

.logistics-page-shell .logistics-filter-date > input {
  grid-area: value;
  z-index: 2;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.logistics-page-shell .logistics-date-display {
  grid-area: value;
  align-self: center;
  overflow: hidden;
  color: #17252b;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.logistics-page-shell .logistics-filter-date .logistics-date-shortcuts {
  grid-area: shortcut;
  width: auto;
  margin: 0;
}

.logistics-page-shell .logistics-filter-date .logistics-date-shortcuts button {
  display: none;
  min-width: 58px;
  min-height: 26px;
}

.logistics-page-shell .logistics-filter-date .logistics-date-shortcuts button.active {
  display: block;
}

.logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) {
  align-content: center;
  border-color: transparent;
  background: transparent;
  padding: 7px 2px;
}

.logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) > span:first-child {
  display: none;
}

.logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) select {
  min-height: 38px;
  border: 1px solid #d4e0e4;
  border-radius: 999px;
  background-color: #ffffff;
  padding-left: 12px;
}

.logistics-page-shell .logistics-filter-field::before {
  display: none;
}

.logistics-page-shell .logistics-filter-field > span:first-child {
  color: #71818d;
  font-size: 9px;
  letter-spacing: .025em;
}

.logistics-page-shell .logistics-filter-field select,
.logistics-page-shell .logistics-filter-field input {
  font-size: 12px;
  font-weight: 900;
}

.logistics-page-shell .logistics-availability-filter {
  min-height: 54px;
  border-color: #d6f3de;
  border-radius: 9px;
  background: #f0fcf3;
}

.logistics-page-shell .logistics-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.logistics-page-shell .logistics-metric-card {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  border: 1px solid #d5e0e4;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgb(35 58 66 / 3%);
  color: #6b7d86;
  font: inherit;
  padding: 9px 11px;
  text-align: left;
}

.logistics-page-shell .logistics-metric-card strong {
  flex: 0 0 auto;
  color: #1d2d34;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.logistics-page-shell .logistics-metric-card span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell button.logistics-metric-action,
.logistics-page-shell button.logistics-metric-attention {
  cursor: pointer;
}

.logistics-page-shell .logistics-metric-attention {
  border-color: #f1b472;
  background: #fff6ec;
  color: #9a4718;
}

.logistics-page-shell .logistics-metric-attention strong {
  color: #b34811;
}

.logistics-page-shell .logistics-availability-warning {
  margin: 0 0 6px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.25;
  padding: 6px 9px;
}

.logistics-page-shell .logistics-planner-shell {
  grid-template-columns: minmax(340px, .62fr) minmax(600px, 1.38fr);
  gap: 9px;
}

.logistics-page-shell .logistics-panel {
  border: 1px solid #d4dfe3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgb(35 58 66 / 4%);
}

.logistics-page-shell .logistics-panel .table-summary {
  min-height: 48px;
  border-bottom-color: #dce5e8;
  background: #ffffff;
  padding: 9px 11px;
}

.logistics-page-shell .logistics-queue-summary {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 10px;
}

.logistics-page-shell .logistics-queue-title span {
  font-size: 14px;
  font-weight: 950;
}

.logistics-page-shell .logistics-queue-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logistics-page-shell .logistics-queue-title b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  background: #dff4f0;
  color: #006b64;
  font-size: 10px;
}

.logistics-page-shell .logistics-queue-search {
  min-width: 0;
  height: 34px;
  border-radius: 7px;
  background: #f8fafb;
  font-size: 11px;
  padding: 7px 10px;
}

.logistics-page-shell .logistics-card-list {
  gap: 0;
  padding: 5px 8px 8px;
}

.logistics-page-shell .logistics-doc-card.logistics-doc-row {
  grid-template-columns: 22px 62px minmax(0, 1fr) 74px;
  grid-template-areas:
    "check number customer weight"
    ". . secondary manager";
  gap: 2px 12px;
  min-height: 51px;
  border: 0;
  border-bottom: 1px solid #e6edef;
  border-radius: 0;
  background: #ffffff;
  padding: 6px 4px;
}

.logistics-page-shell .logistics-doc-card.logistics-doc-row.is-customer-agreed {
  border-left: 3px solid #16a36a;
  background: #f1fbf6;
  padding-left: 5px;
}

.logistics-customer-agreed-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 17px;
  border: 1px solid #86d7b2;
  border-radius: 999px;
  background: #dff7eb;
  color: #087647;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 6px;
  text-transform: uppercase;
}

.logistics-page-shell .logistics-doc-row > input[type="checkbox"] {
  grid-area: check;
}

.logistics-page-shell .logistics-doc-row > .doc-number {
  grid-area: number;
}

.logistics-page-shell .logistics-doc-row > .logistics-row-customer {
  grid-area: customer;
}

.logistics-page-shell .logistics-doc-row > .logistics-row-secondary {
  grid-area: secondary;
}

.logistics-page-shell .logistics-doc-row > .logistics-row-weight {
  grid-area: weight;
  align-self: end;
  text-align: right;
}

.logistics-page-shell .logistics-doc-row > .logistics-row-manager {
  grid-area: manager;
  align-self: start;
  overflow: hidden;
  color: #778892;
  font-size: 9px;
  font-weight: 750;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell .logistics-doc-row > .logistics-row-warning-list {
  grid-area: warnings;
}

.logistics-page-shell .logistics-doc-row .doc-number {
  color: #006b64;
  font-size: 14px;
}

.logistics-page-shell .logistics-row-customer {
  font-size: 12px;
  line-height: 1.15;
}

.logistics-row-secondary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: #778892;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.logistics-row-secondary > span {
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
}

.logistics-row-secondary > .logistics-row-warning-list {
  flex: 0 0 auto;
  overflow: visible;
}

.logistics-row-secondary > .logistics-customer-agreed-badge {
  flex: 0 0 auto;
  overflow: visible;
}

.logistics-row-secondary small {
  overflow: hidden;
  flex: 0 1 90px;
  font-size: inherit;
  text-overflow: ellipsis;
}

.logistics-row-warning-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 16px;
}

.logistics-page-shell .logistics-row-warning {
  width: 16px;
  height: 16px;
  background: #f7eee5;
  color: #c65317;
  font-size: 9px;
}

.logistics-page-shell .logistics-bulk-assign {
  grid-template-columns: minmax(96px, .55fr) minmax(130px, 1fr) auto;
  gap: 5px;
  border-top-color: #cce9e5;
  background: #edfbf8;
  padding: 8px 9px;
}

.logistics-page-shell .logistics-bulk-assign strong {
  font-size: 10px;
  white-space: nowrap;
}

.logistics-page-shell .logistics-bulk-assign select {
  min-height: 36px;
  border-color: #bed8d5;
  background: #ffffff;
}

.logistics-page-shell .logistics-bulk-assign button {
  min-height: 36px;
  border-radius: 8px;
  background: #0f8178;
}

.logistics-page-shell .logistics-bulk-assign > [data-logistics-alt-selected-fields] {
  display: none;
}

.logistics-routes-summary {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.logistics-routes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e2e35;
}

.logistics-routes-title strong {
  font-size: 14px;
}

.logistics-routes-title b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  background: #dff4f0;
  color: #006b64;
  font-size: 10px;
}

.logistics-release-explanation {
  display: none;
}

.logistics-routes-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.logistics-page-shell .logistics-suggest-form {
  margin: 0;
}

.logistics-page-shell .logistics-suggest-form button,
.logistics-page-shell .logistics-approve-all-form button {
  min-height: 36px;
  border: 1px solid #9bddd6;
  border-radius: 8px;
  background: #e8faf7;
  color: #006b64;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 7px 11px;
  white-space: nowrap;
}

.logistics-page-shell .logistics-approve-all-form button {
  border-color: #0f8178;
  background: #0f8178;
  color: #ffffff;
}

.logistics-page-shell .logistics-approve-all-form button:disabled,
.logistics-page-shell .logistics-suggest-form button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.logistics-page-shell .workspace-tabs.logistics-route-tabs {
  position: relative;
  grid-template-columns: repeat(3, minmax(92px, 120px));
  justify-content: start;
  gap: 4px;
  border-bottom: 1px solid #dce5e8;
  background: #fbfcfd;
  padding: 7px 9px;
}

.logistics-page-shell .workspace-tabs.logistics-route-tabs > button,
.logistics-route-more-tabs > summary {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #637680;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 8px 12px;
  text-align: center;
}

.logistics-page-shell .workspace-tabs.logistics-route-tabs > button.active {
  background: #e7f7f4;
  color: #006b64;
}

.logistics-route-more-tabs {
  display: none;
}

.logistics-route-more-tabs > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
}

.logistics-route-more-tabs > summary::-webkit-details-marker {
  display: none;
}

.logistics-route-more-tabs > div {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 3px;
  min-width: 190px;
  border: 1px solid #d4dfe3;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgb(35 58 66 / 18%);
  padding: 6px;
}

.logistics-route-more-tabs > div button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #38505b;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  padding: 9px 10px;
  text-align: left;
}

.logistics-page-shell .logistics-route-list {
  gap: 5px;
  padding: 7px;
}

.logistics-page-shell .logistics-route-card.logistics-route-compact {
  grid-template-columns: minmax(315px, 1fr) minmax(285px, 32%) auto;
  grid-template-areas: "identity facts actions";
  gap: 8px 12px;
  min-height: 58px;
  border: 1px solid #dce5e8;
  border-left: 5px solid var(--route-color, #0f8178);
  border-radius: 9px;
  background: #ffffff;
  padding: 7px 8px 7px 10px;
}

.logistics-page-shell .logistics-route-compact .route-card-header {
  grid-area: identity;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.logistics-page-shell .logistics-route-compact h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logistics-page-shell .logistics-route-compact h2 .logistics-detail-link {
  flex: 0 1 auto;
  color: #1c2d34;
  font-size: 14px;
}

.logistics-page-shell .logistics-route-compact h2 .logistics-availability-pill {
  flex: 0 0 auto;
  min-height: 20px;
  box-shadow: none;
  font-size: 9px;
  padding: 3px 7px;
}

.logistics-page-shell .logistics-route-subtitle {
  overflow: hidden;
  color: #7a8a93;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell .logistics-route-subtitle span {
  color: #9a5a21;
  font-weight: 850;
}

.logistics-planning-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #f1f5f7;
  color: #61747e;
  font-size: 9px;
  font-weight: 900;
  padding: 5px 7px;
  white-space: nowrap;
}

.logistics-planning-state.state-waiting_return,
.logistics-planning-state.state-waiting_trip,
.logistics-planning-state.state-future {
  background: #fff4e6;
  color: #a04a17;
}

.logistics-page-shell .route-compact-line {
  grid-area: facts;
  min-width: 0;
  grid-template-columns: minmax(80px, 1fr) 34px minmax(145px, 1.2fr);
  grid-template-areas:
    "documents percent weight"
    "capacity capacity weight";
  grid-template-rows: auto 4px;
  gap: 3px 7px;
  color: #61747e;
  font-size: 10px;
}

.logistics-page-shell .logistics-route-document-count {
  grid-area: documents;
}

.logistics-page-shell .logistics-route-load-percent {
  grid-area: percent;
  text-align: right;
}

.logistics-page-shell .route-compact-line strong,
.logistics-page-shell .logistics-route-weight {
  color: #24353c;
}

.logistics-page-shell .route-compact-line .capacity-bar {
  grid-area: capacity;
  align-self: end;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: #edf1f3;
}

.logistics-page-shell .logistics-route-weight {
  display: grid;
  grid-area: weight;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.logistics-page-shell .logistics-route-weight > strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell .logistics-route-weight > small,
.logistics-page-shell .logistics-route-weight > button {
  overflow: hidden;
  margin: 0;
  border: 0;
  background: transparent;
  color: #7a8a93;
  cursor: default;
  font-family: inherit;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.15;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-page-shell .logistics-route-weight > button.logistics-route-coordinate-warning {
  color: #b45309;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgb(180 83 9 / 35%);
  text-underline-offset: 2px;
}

.logistics-page-shell .logistics-route-weight > button.logistics-route-coordinate-warning:hover {
  color: #8f3f07;
}

.logistics-page-shell .logistics-route-weight > small.is-overloaded {
  color: #b42335;
}

.logistics-route-metric-summary {
  display: flex;
  align-items: center;
  min-width: 0;
}

.logistics-route-metric-summary > span:empty {
  display: none;
}

.logistics-route-metric-summary > [data-route-duration-run-id]:not(:empty)::before {
  content: "·";
  margin: 0 3px;
}

.logistics-route-metric-summary:has([data-route-distance-run-id]:not(:empty)) .logistics-route-not-calculated,
.logistics-route-metric-summary:has([data-route-duration-run-id]:not(:empty)) .logistics-route-not-calculated {
  display: none;
}

.logistics-page-shell .logistics-route-card.overloaded {
  border-color: #fecaca;
  border-left-color: #c5233e;
  background: #fffafa;
  box-shadow: none;
}

.logistics-page-shell .logistics-route-compact .warning-badge,
.logistics-page-shell .logistics-route-planning-note {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.2;
  padding: 5px 7px;
}

.logistics-page-shell .logistics-route-compact .warning-badge {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b42335;
}

.logistics-page-shell .logistics-route-compact .route-actions {
  grid-area: actions;
  position: relative;
  align-items: center;
  margin: 0;
}

.logistics-page-shell .logistics-route-compact .route-open-button {
  width: auto;
  min-width: 76px;
  height: 34px;
  min-height: 34px;
  border: 1px solid #a5ddd8;
  border-radius: 8px;
  background: #eaf9f6;
  color: #006b64;
  font-size: 11px;
  padding: 7px 11px;
  text-align: center;
  text-decoration: none;
}

.logistics-route-action-menu {
  position: relative;
}

.logistics-route-action-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border: 1px solid #d4dfe3;
  border-radius: 8px;
  background: #ffffff;
  color: #38505b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 1px;
  list-style: none;
}

.logistics-route-action-menu > summary::-webkit-details-marker {
  display: none;
}

.logistics-route-action-menu > div {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 90;
  display: grid;
  gap: 4px;
  width: 270px;
  border: 1px solid #d4dfe3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgb(35 58 66 / 22%);
  padding: 7px;
}

.logistics-route-action-menu form {
  display: grid;
  gap: 3px;
  margin: 0;
}

.logistics-page-shell .logistics-route-action-menu .route-print-link,
.logistics-page-shell .logistics-route-action-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  height: auto;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #2d444e;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
  white-space: normal;
}

.logistics-page-shell .logistics-route-action-menu a:hover,
.logistics-page-shell .logistics-route-action-menu button:hover:not(:disabled) {
  background: #eef9f7;
  color: #006b64;
}

.logistics-page-shell .logistics-route-action-menu button:disabled {
  background: #f4f6f7;
  color: #94a1a8;
}

.logistics-route-action-menu form small {
  color: #8a6c5a;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  padding: 0 9px 5px;
}

.logistics-page-shell .logistics-route-action-menu .logistics-destructive-action {
  border-top: 1px solid #e8edef;
  padding-top: 4px;
}

.logistics-page-shell .logistics-route-action-menu .logistics-destructive-action button {
  color: #b42335;
}

.logistics-page-shell .logistics-planner-shell.is-primary-dispatch {
  grid-template-columns: minmax(0, 1fr);
}

.logistics-page-shell .logistics-planner-shell.is-primary-dispatch > .logistics-queue-panel,
.logistics-page-shell .logistics-planner-shell.is-primary-dispatch .logistics-routes-summary,
.logistics-page-shell .logistics-planner-shell.is-primary-dispatch .logistics-route-tabs {
  display: none;
}

body.logistics-work-mode .logistics-page-shell .breadcrumbs {
  display: none;
}

body.logistics-work-mode .logistics-page-shell .breadcrumbs-row {
  grid-template-columns: minmax(0, 1fr);
}

body.logistics-work-mode .logistics-page-shell .logistics-breadcrumb-aside {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

@media (min-width: 761px) and (max-width: 1300px) {
  .logistics-page-shell .logistics-bulk-assign {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "count button"
      "select select";
  }

  .logistics-page-shell .logistics-bulk-assign > div:first-child {
    grid-area: count;
  }

  .logistics-page-shell .logistics-bulk-assign > select {
    grid-area: select;
    width: 100%;
  }

  .logistics-page-shell .logistics-bulk-assign > button {
    grid-area: button;
  }
}

@media (max-width: 1080px) {
  .logistics-page-shell .logistics-breadcrumb-aside {
    grid-template-columns: minmax(190px, 1fr) auto auto;
  }

  .logistics-page-shell .logistics-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .logistics-routes-summary {
    grid-template-columns: minmax(150px, 1fr) auto;
  }

  .logistics-release-explanation {
    display: none;
  }

  .logistics-page-shell .logistics-route-card.logistics-route-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity actions"
      "facts facts";
  }
}

@media (max-width: 900px) {
  .logistics-page-shell .breadcrumbs-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .logistics-page-shell .breadcrumbs {
    display: none;
  }

  .logistics-page-shell .logistics-planner-shell {
    grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.22fr);
  }

  .logistics-page-shell .logistics-route-compact .route-card-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .logistics-page-shell .logistics-route-statuses {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body:has(.logistics-planner-shell) {
    overflow: auto;
  }

  body:has(.logistics-planner-shell) .logistics-page-shell {
    display: flex;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 64px);
    padding: 10px;
  }

  .logistics-page-shell .breadcrumbs-row {
    display: block;
    margin-bottom: 9px;
  }

  .logistics-page-shell .logistics-breadcrumb-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .logistics-page-shell .logistics-page-heading {
    grid-column: 1;
  }

  .logistics-page-shell .logistics-page-heading > span {
    font-size: 10px;
  }

  .logistics-page-shell .logistics-page-heading .breadcrumbs-title {
    font-size: 21px;
    white-space: normal;
  }

  .logistics-filter-stack {
    position: relative;
    display: block;
  }

  .logistics-primary-tabs-desktop,
  .logistics-schedule-link,
  .logistics-work-filters {
    display: none !important;
  }

  .logistics-heading-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .logistics-page-shell .logistics-work-mode-button {
    min-height: 38px;
    font-size: 11px;
    padding: 7px 10px;
  }

  .logistics-mobile-filter-toggle {
    display: flex;
    position: absolute;
    top: 12px;
    right: 18px;
    z-index: 6;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    min-height: 24px;
    margin: 0;
    border: 1px solid #d4dfe3;
    border-radius: 9px;
    background: #ffffff;
    color: #38505b;
    font: inherit;
    font-size: 9px;
    font-weight: 900;
    padding: 4px 8px;
  }

  .logistics-mobile-filter-toggle b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    min-height: 16px;
    margin-left: auto;
    border-radius: 999px;
    background: #dff4f0;
    color: #006b64;
    font-size: 8px;
  }

  .logistics-mobile-filter-toggle i {
    display: none;
  }

  .logistics-mobile-filter-toggle.active i {
    transform: rotate(180deg);
  }

  .logistics-page-shell .logistics-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    margin-bottom: 7px;
    padding: 7px;
  }

  .logistics-page-shell .logistics-toolbar > :not(.logistics-filter-date) {
    display: none !important;
  }

  .logistics-page-shell .logistics-toolbar.is-mobile-open > * {
    display: grid !important;
  }

  .logistics-page-shell .logistics-toolbar.is-mobile-open > .logistics-availability-filter {
    display: flex !important;
  }

  .logistics-page-shell .logistics-filter-field {
    min-height: 54px;
  }

  .logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) {
    border-color: #d4e0e4;
    background: #fbfcfd;
    padding: 7px 10px;
  }

  .logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) > span:first-child {
    display: block;
  }

  .logistics-page-shell .logistics-filter-field:not(.logistics-filter-date):not(.logistics-filter-warehouse) select {
    min-height: 24px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    padding-left: 0;
  }

  .logistics-page-shell .logistics-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .logistics-page-shell .logistics-metric-card {
    min-height: 54px;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .logistics-page-shell .logistics-metric-loaded {
    display: none;
  }

  .logistics-page-shell .logistics-metric-attention {
    grid-column: 1 / -1;
  }

  .logistics-page-shell .logistics-availability-warning {
    font-size: 9px;
  }

  .logistics-page-shell .logistics-planner-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 7px;
    flex: 0 0 auto;
    width: 100%;
    height: min(760px, max(560px, calc(100dvh - 315px)));
    min-height: 560px;
  }

  .logistics-primary-tabs-mobile {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    width: 100%;
    padding: 4px;
  }

  .logistics-primary-tabs-mobile button {
    min-width: 0;
    min-height: 40px;
    overflow: hidden;
    padding: 8px 5px;
    text-overflow: ellipsis;
  }

  .logistics-primary-tabs-mobile button.active {
    background: #ffffff;
    box-shadow: 0 2px 6px rgb(35 58 66 / 12%);
    color: #006b64;
  }

  .logistics-page-shell .logistics-planner-shell > .logistics-panel {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-queue > .logistics-routes-panel,
  .logistics-page-shell .logistics-planner-shell.is-primary-planning > .logistics-queue-panel,
  .logistics-page-shell .logistics-planner-shell.is-primary-dispatch > .logistics-queue-panel {
    display: none;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-queue > .logistics-queue-panel,
  .logistics-page-shell .logistics-planner-shell.is-primary-planning > .logistics-routes-panel,
  .logistics-page-shell .logistics-planner-shell.is-primary-dispatch > .logistics-routes-panel {
    display: flex;
  }

  .logistics-page-shell .logistics-queue-summary {
    grid-template-columns: auto minmax(120px, 1fr);
  }

  .logistics-page-shell .logistics-queue-search {
    height: 38px;
    font-size: 12px;
  }

  .logistics-page-shell .logistics-card-list {
    padding: 4px 8px calc(10px + env(safe-area-inset-bottom));
  }

  .logistics-page-shell .logistics-doc-card.logistics-doc-row {
    grid-template-columns: 24px 52px minmax(0, 1fr) 72px;
    grid-template-areas:
      "check number customer weight"
      ". . secondary manager";
    min-height: 58px;
    gap: 3px 7px;
    padding: 7px 3px;
  }

  .logistics-page-shell .logistics-doc-row > input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .logistics-page-shell .logistics-doc-row .doc-number {
    font-size: 14px;
  }

  .logistics-page-shell .logistics-row-manager {
    text-align: right;
  }

  .logistics-page-shell .logistics-row-warning-list {
    justify-content: flex-start;
  }

  .logistics-page-shell .logistics-bulk-assign {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "count button"
      "select select";
    gap: 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .logistics-page-shell .logistics-bulk-assign > div:first-child {
    grid-area: count;
  }

  .logistics-page-shell .logistics-bulk-assign > select {
    display: block !important;
    grid-area: select;
    width: 100%;
    min-height: 44px;
  }

  .logistics-page-shell .logistics-bulk-assign > button {
    grid-area: button;
    min-height: 44px;
    padding: 9px 15px;
  }

  .logistics-page-shell .logistics-bulk-assign > [data-logistics-alt-selected-fields] {
    display: none;
  }

  .logistics-routes-summary {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .logistics-routes-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistics-page-shell .logistics-suggest-form button,
  .logistics-page-shell .logistics-approve-all-form button {
    width: 100%;
    min-height: 44px;
    font-size: 10px;
    white-space: normal;
  }

  .logistics-page-shell .workspace-tabs.logistics-route-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .logistics-page-shell .workspace-tabs.logistics-route-tabs > button,
  .logistics-route-more-tabs > summary {
    min-height: 42px;
    padding: 8px 5px;
  }

  .logistics-page-shell .logistics-route-list {
    padding: 6px;
  }

  .logistics-page-shell .logistics-route-card.logistics-route-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity actions"
      "facts facts";
    min-height: 88px;
  }

  .logistics-page-shell .route-compact-line {
    grid-template-columns: minmax(90px, 1fr) 36px minmax(115px, 1fr);
  }

  .logistics-page-shell .logistics-route-compact .route-open-button {
    display: none;
  }

  .logistics-route-action-menu > summary {
    width: 44px;
    height: 44px;
  }

  .logistics-route-action-menu > div {
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    top: auto;
    width: calc(100vw - 24px);
    max-width: 360px;
  }

  .logistics-page-shell .logistics-route-action-menu .route-print-link,
  .logistics-page-shell .logistics-route-action-menu button {
    min-height: 44px;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-dispatch .logistics-dispatch-tab-panel.active {
    padding: 7px;
  }

  .logistics-page-shell .logistics-dispatch-tab-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .logistics-page-shell .logistics-dispatch-stage-summary {
    grid-column: 1 / -1;
  }

  .logistics-page-shell .dispatch-board.is-embedded {
    grid-template-columns: minmax(280px, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-queue .logistics-bulk-assign {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 70;
    border: 1px solid #a9dcd6;
    border-radius: 11px;
    box-shadow: 0 12px 30px rgb(35 58 66 / 20%);
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-queue .logistics-card-list {
    padding-bottom: calc(126px + env(safe-area-inset-bottom));
  }
}

.logistics-page-shell .logistics-availability-filter strong,
.logistics-page-shell .logistics-availability-filter small {
  overflow: hidden;
  white-space: normal;
}


/* Keep the bulk vehicle picker out of the idle queue footer. It returns only after an order is selected. */
.logistics-page-shell .logistics-bulk-assign.is-empty {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "count button";
}

.logistics-page-shell .logistics-bulk-assign.is-empty > div:first-child {
  grid-area: count;
}

.logistics-page-shell .logistics-bulk-assign.is-empty > select {
  display: none !important;
}

.logistics-page-shell .logistics-bulk-assign.is-empty > button {
  grid-area: button;
}

@media (max-width: 760px) {
  .logistics-page-shell .logistics-planner-shell.is-primary-queue
    .logistics-queue-panel:not(.has-selected-orders) .logistics-card-list {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
}


/* Automatic distribution is temporarily removed from the planner UI. */
.logistics-page-shell .logistics-suggest-form[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .logistics-page-shell .logistics-routes-summary-actions.is-release-only {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Embedded active-runs workspace: compact operations and an obvious return to planning. */
.logistics-page-shell .logistics-heading-dispatch-title {
  display: none;
}

body:has(.logistics-page-shell .logistics-planner-shell.is-primary-dispatch)
  .logistics-page-shell .logistics-heading-planning-title,
body:has(.logistics-page-shell .logistics-planner-shell.is-primary-dispatch)
  .logistics-page-shell .logistics-filter-stack,
body:has(.logistics-page-shell .logistics-planner-shell.is-primary-dispatch)
  .logistics-page-shell .agent-logistics-intake,
body:has(.logistics-page-shell .logistics-planner-shell.is-primary-dispatch)
  .logistics-page-shell .logistics-metrics {
  display: none;
}

body:has(.logistics-page-shell .logistics-planner-shell.is-primary-dispatch)
  .logistics-page-shell .logistics-heading-dispatch-title {
  display: inline;
}

.logistics-page-shell .logistics-planner-shell.is-primary-dispatch
  .logistics-dispatch-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f4f7f8;
  padding: 8px;
}

.logistics-page-shell .logistics-dispatch-tab-head {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-color: #d6e1e4;
  box-shadow: none;
  padding: 8px;
}

.logistics-page-shell .logistics-dispatch-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-color: #0f8178;
  background: #0f8178;
  box-shadow: 0 3px 8px rgb(15 129 120 / 18%);
  color: #ffffff;
  font-size: 11px;
  padding: 8px 14px;
}

.logistics-page-shell .logistics-dispatch-back-button:hover {
  background: #0b6f68;
}

.logistics-page-shell .logistics-dispatch-tab-title {
  gap: 1px;
}

.logistics-page-shell .logistics-dispatch-tab-title > strong {
  color: #1e2e35;
  font-size: 14px;
}

.logistics-page-shell .logistics-dispatch-tab-title > span {
  color: #6f8089;
  font-size: 9px;
  font-weight: 750;
}

.logistics-page-shell .logistics-dispatch-stage-summary {
  grid-template-columns: repeat(3, minmax(72px, auto));
  gap: 5px;
}

.logistics-page-shell .logistics-dispatch-stage-summary > span {
  min-height: 34px;
  padding: 4px 7px;
}

.logistics-page-shell .logistics-planner-shell.is-primary-dispatch
  .dispatch-board.is-embedded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 3px;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-column {
  grid-template-rows: auto auto;
  align-self: start;
  width: 100%;
  border-color: #d6e1e4;
  border-radius: 10px;
  background: #f8fafb;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-column > header {
  min-height: 42px;
  padding: 8px 10px;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-column > div {
  max-height: calc(100dvh - 310px);
  overflow-y: auto;
  padding: 8px;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-run-card {
  gap: 7px;
  border-color: #d7e2e5;
  box-shadow: none;
  padding: 10px;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-run-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-run-driver {
  overflow: visible;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.logistics-page-shell .dispatch-board.is-embedded .dispatch-run-name > span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.logistics-page-shell .dispatch-board-empty {
  display: grid;
  justify-items: start;
  gap: 5px;
  width: min(520px, 100%);
  border: 1px dashed #bfd0d5;
  border-radius: 11px;
  background: #ffffff;
  color: #6b7d86;
  padding: 18px;
}

.logistics-page-shell .dispatch-board-empty strong {
  color: #1e2e35;
  font-size: 14px;
}

.logistics-page-shell .dispatch-board-empty span {
  font-size: 10px;
  font-weight: 750;
}

.logistics-page-shell .dispatch-board-empty button {
  min-height: 36px;
  margin-top: 5px;
  border: 1px solid #9bddd6;
  border-radius: 8px;
  background: #e8faf7;
  color: #006b64;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  padding: 7px 10px;
}

@media (min-width: 761px) and (max-width: 1180px) {
  .logistics-page-shell .logistics-dispatch-tab-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .logistics-page-shell .logistics-dispatch-stage-summary {
    grid-column: 1 / -1;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-dispatch
    .dispatch-board.is-embedded {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }
}

@media (max-width: 760px) {
  .logistics-page-shell .logistics-dispatch-tab-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .logistics-page-shell .logistics-dispatch-back-button {
    width: 100%;
    min-height: 44px;
  }

  .logistics-page-shell .logistics-dispatch-tab-title > span {
    display: none;
  }

  .logistics-page-shell .logistics-dispatch-stage-summary {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .logistics-page-shell .logistics-planner-shell.is-primary-dispatch
    .dispatch-board.is-embedded {
    grid-template-columns: minmax(0, 1fr);
  }

  .logistics-page-shell .dispatch-board.is-embedded .dispatch-column > div {
    max-height: none;
  }

  .logistics-page-shell .dispatch-board.is-embedded .dispatch-run-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
