/* Reference-style Orders screen. Loaded last on purpose; functionality stays in JS. */
:root {
  --orders-ref-bg: #f6f9fd;
  --orders-ref-bg-start: #eef6ff;
  --orders-ref-bg-mid: #f9fbfe;
  --orders-ref-bg-end: #ffffff;
  --orders-ref-card: #ffffff;
  --orders-ref-card-soft: rgba(255, 255, 255, 0.72);
  --orders-ref-ink: #061126;
  --orders-ref-muted: #40516d;
  --orders-ref-faint: #74849c;
  --orders-ref-line: #dce5f0;
  --orders-ref-line-strong: #cbd7e5;
  --orders-ref-grid: #d8e1ec;
  --orders-ref-grid-strong: rgba(15, 23, 42, 0.22);
  --orders-ref-grid-soft: rgba(15, 23, 42, 0.16);
  --orders-ref-blue: #1769e9;
  --orders-ref-blue-soft: #eef6ff;
  --orders-ref-focus: rgba(23, 105, 233, 0.2);
  --orders-ref-payment-info-bg: #edf6ff;
  --orders-ref-payment-info-border: #cfe2f9;
  --orders-ref-payment-info-text: #1359ad;
  --orders-ref-payment-warning-bg: #f6edff;
  --orders-ref-payment-warning-border: #decff5;
  --orders-ref-payment-warning-text: #6f3fb7;
  --orders-ref-payment-success-bg: #ecfbf4;
  --orders-ref-payment-success-border: #b8ecd3;
  --orders-ref-payment-success-text: #0f6b46;
  --orders-ref-expense-border: rgba(15, 23, 42, 0.22);
  --orders-ref-expense-border-hover: rgba(15, 23, 42, 0.34);
  --orders-ref-shadow: 0 18px 44px -38px rgba(18, 48, 88, 0.38);
  --orders-ref-font: "Manrope", "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  --orders-ref-bg: #0f1724;
  --orders-ref-bg-start: #101c2d;
  --orders-ref-bg-mid: #0f1724;
  --orders-ref-bg-end: #0b1220;
  --orders-ref-card: #111b2b;
  --orders-ref-card-soft: rgba(17, 27, 43, 0.78);
  --orders-ref-ink: #edf4ff;
  --orders-ref-muted: #b8c6da;
  --orders-ref-faint: #8ea0b9;
  --orders-ref-line: rgba(148, 163, 184, 0.24);
  --orders-ref-line-strong: rgba(180, 194, 214, 0.32);
  --orders-ref-grid: rgba(170, 184, 205, 0.24);
  --orders-ref-grid-strong: rgba(213, 226, 244, 0.34);
  --orders-ref-grid-soft: rgba(213, 226, 244, 0.22);
  --orders-ref-blue: #68a7ff;
  --orders-ref-blue-soft: rgba(104, 167, 255, 0.16);
  --orders-ref-focus: rgba(104, 167, 255, 0.28);
  --orders-ref-payment-info-bg: rgba(47, 116, 197, 0.2);
  --orders-ref-payment-info-border: rgba(104, 167, 255, 0.34);
  --orders-ref-payment-info-text: #9dccff;
  --orders-ref-payment-warning-bg: rgba(137, 89, 190, 0.22);
  --orders-ref-payment-warning-border: rgba(188, 153, 231, 0.34);
  --orders-ref-payment-warning-text: #d8c4ff;
  --orders-ref-payment-success-bg: rgba(18, 122, 79, 0.22);
  --orders-ref-payment-success-border: rgba(82, 196, 141, 0.36);
  --orders-ref-payment-success-text: #8de0b4;
  --orders-ref-expense-border: rgba(213, 226, 244, 0.28);
  --orders-ref-expense-border-hover: rgba(213, 226, 244, 0.46);
  --orders-ref-shadow: 0 20px 48px -38px rgba(0, 0, 0, 0.72);
}

body[data-active-view="templates"] {
  background: linear-gradient(180deg, var(--orders-ref-bg-start) 0%, var(--orders-ref-bg-mid) 34%, var(--orders-ref-bg-end) 100%) !important;
  color: var(--orders-ref-ink) !important;
  font-family: var(--orders-ref-font) !important;
  font-kerning: normal !important;
  text-rendering: geometricPrecision !important;
}

body[data-active-view="templates"] .app-shell,
body[data-active-view="templates"] .app-main {
  background: transparent !important;
}

body[data-active-view="templates"] .sidebar,
body[data-active-view="templates"] .sidebar-backdrop {
  display: none !important;
}

body[data-active-view="templates"] .app-shell.is-sidebar-open .app-main,
body[data-active-view="templates"] .app-main {
  margin-left: 0 !important;
}

body[data-active-view="templates"] .topbar {
  height: 58px !important;
  min-height: 58px !important;
  padding: 0 24px !important;
  border-bottom: 1px solid var(--orders-ref-line) !important;
  background: var(--orders-ref-card) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body[data-active-view="templates"] .topbar__brandblock {
  display: none !important;
}

body[data-active-view="templates"] .topbar__module-nav {
  min-height: 38px !important;
  padding: 3px !important;
  border: 1px solid var(--orders-ref-line) !important;
  border-radius: 12px !important;
  background: var(--orders-ref-card) !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] .topbar-nav-button {
  min-height: 30px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--orders-ref-faint) !important;
  font-family: var(--orders-ref-font) !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

body[data-active-view="templates"] .topbar-nav-button.is-active {
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-blue) !important;
  box-shadow: inset 0 0 0 1px rgba(28, 105, 233, 0.24) !important;
}

body[data-active-view="templates"] .topbar__theme,
body[data-active-view="templates"] .pill-button--avatar-only {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border: 1px solid var(--orders-ref-line) !important;
  border-radius: 10px !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-muted) !important;
  box-shadow: none !important;
}

#view-templates.orders-view {
  height: calc(100vh - 58px) !important;
  min-height: 0 !important;
  padding: 24px 22px 24px !important;
  overflow: hidden !important;
  background: transparent !important;
  font-family: var(--orders-ref-font) !important;
}

#view-templates .orders-crm,
#view-templates .orders-board {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
}

#view-templates .orders-board {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#view-templates .orders-board__toolbar {
  display: grid !important;
  grid-template-columns: minmax(238px, 0.72fr) minmax(380px, 560px) auto !important;
  align-items: center !important;
  gap: 18px !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#view-templates .orders-board__titlewrap,
#view-templates .orders-board__titleline {
  min-width: 0 !important;
}

#view-templates .orders-board__titleline {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
}

#view-templates .orders-board__title {
  margin: 0 !important;
  color: var(--orders-ref-ink) !important;
  font-size: 34px !important;
  line-height: 1 !important;
  font-weight: 860 !important;
  letter-spacing: -0.035em !important;
}

#view-templates .orders-board__year-select {
  width: 94px !important;
  height: 44px !important;
  padding: 0 34px 0 18px !important;
  border: 1px solid var(--orders-ref-line) !important;
  border-radius: 9px !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
  font-size: 14px !important;
  font-weight: 820 !important;
  box-shadow: none !important;
}

#view-templates .orders-board__subtitle,
#view-templates .orders-board__titleline .panel-help {
  display: none !important;
}

#view-templates .orders-board__searchslot {
  min-width: 0 !important;
  justify-self: stretch !important;
}

#view-templates .orders-filter--search {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 44px !important;
  margin: 0 !important;
}

#view-templates .orders-filter--search::before {
  content: "" !important;
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  z-index: 1 !important;
  width: 15px !important;
  height: 15px !important;
  border: 2px solid #506a96 !important;
  border-radius: 50% !important;
  transform: translateY(-50%) !important;
  opacity: 0.82 !important;
}

#view-templates .orders-filter--search::after {
  content: "" !important;
  position: absolute !important;
  left: 30px !important;
  top: 28px !important;
  z-index: 1 !important;
  width: 7px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: #506a96 !important;
  transform: rotate(45deg) !important;
  opacity: 0.82 !important;
}

#view-templates .orders-filter__label {
  display: none !important;
}

#view-templates .orders-filter__input {
  width: 100% !important;
  height: 44px !important;
  padding: 0 48px !important;
  border: 1px solid var(--orders-ref-line-strong) !important;
  border-radius: 9px !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}

#view-templates .orders-filter__input::placeholder {
  color: var(--orders-ref-muted) !important;
}

#view-templates .orders-board__actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 9px !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

#view-templates .orders-board__actions .ghost-button,
#view-templates .orders-board__actions .primary {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border: 1px solid var(--orders-ref-line-strong) !important;
  border-radius: 9px !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
  font-size: 12px !important;
  font-weight: 820 !important;
  letter-spacing: -0.012em !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

#view-templates .orders-board__actions .ghost-button:hover {
  border-color: #cad8ef !important;
  background: #fafdff !important;
}

#view-templates .orders-board__actions .primary {
  min-width: 142px !important;
  border-color: #1668e8 !important;
  background: linear-gradient(180deg, #1975ff 0%, #0f5fe6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 18px 34px -22px rgba(18, 94, 229, 0.76) !important;
}

#view-templates #ordersColumnsBtn::before,
#view-templates #ordersRouteBtn::before,
#view-templates #ordersImportBtn::before,
#view-templates #ordersAddBtn::before {
  display: inline-block !important;
  margin-right: 8px !important;
  color: currentColor !important;
  font-weight: 900 !important;
  vertical-align: -2px !important;
}

#view-templates #ordersColumnsBtn::before {
  content: "" !important;
  width: 14px !important;
  height: 14px !important;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 9px 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 0 9px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 9px 9px / 5px 5px no-repeat !important;
  border-radius: 2px !important;
}

#view-templates #ordersRouteBtn::before {
  content: "" !important;
  width: 15px !important;
  height: 15px !important;
  border: 2px solid currentColor !important;
  border-top-width: 4px !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
}

#view-templates #ordersImportBtn::before {
  content: "" !important;
  width: 14px !important;
  height: 14px !important;
  border: 2px solid currentColor !important;
  border-radius: 3px !important;
  box-sizing: border-box !important;
  background:
    linear-gradient(currentColor 0 0) 50% 3px / 2px 8px no-repeat,
    linear-gradient(currentColor 0 0) 3px 50% / 8px 2px no-repeat !important;
}

#view-templates #ordersAddBtn::before {
  content: "+" !important;
  margin-right: 9px !important;
  font-size: 18px !important;
  line-height: 0 !important;
}

#view-templates .orders-table-settings-btn {
  width: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
}

#view-templates .orders-machine-tabs {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

#view-templates .orders-machine-tabs__scroller {
  display: flex !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 0 0 2px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

#view-templates .orders-machine-tabs__scroller::-webkit-scrollbar {
  display: none !important;
}

#view-templates .orders-machine-card,
#view-templates .orders-machine-tab-action {
  flex: 0 0 128px !important;
  min-width: 128px !important;
  height: 72px !important;
  padding: 15px 15px 13px !important;
  border: 1px solid var(--orders-ref-line-strong) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: var(--orders-ref-ink) !important;
  box-shadow: none !important;
}

#view-templates .orders-machine-card--all {
  flex-basis: 132px !important;
}

#view-templates .orders-machine-card.is-active,
#view-templates .orders-machine-card[aria-pressed="true"] {
  border-color: #7daeff !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 233, 0.12) !important;
}

#view-templates .orders-machine-card__top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

#view-templates .orders-machine-card__plate {
  min-width: 0 !important;
  color: var(--orders-ref-ink) !important;
  font-size: 13px !important;
  font-weight: 860 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#view-templates .orders-machine-card.is-active .orders-machine-card__plate {
  color: var(--orders-ref-blue) !important;
}

#view-templates .orders-machine-card__flag {
  margin-right: 6px !important;
  color: #506a96 !important;
  font-size: 10px !important;
  font-weight: 880 !important;
}

#view-templates .orders-machine-card__count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: #f2f6fb !important;
  color: #0d1b35 !important;
  font-size: 12px !important;
  font-weight: 840 !important;
}

#view-templates .orders-machine-card.is-active .orders-machine-card__count {
  background: var(--orders-ref-blue-soft) !important;
  color: var(--orders-ref-blue) !important;
}

#view-templates .orders-machine-card__status {
  margin-top: 16px !important;
  color: #465b78 !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

#view-templates .orders-machine-card__status--route,
#view-templates .orders-machine-card__status--loading {
  color: var(--orders-ref-blue) !important;
}

#view-templates .orders-machine-card--create,
#view-templates .orders-machine-tab-action--danger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--orders-ref-blue) !important;
  font-size: 12px !important;
  font-weight: 780 !important;
}

#view-templates .orders-machine-tab-action--danger {
  color: #e03145 !important;
}

#view-templates .orders-notice {
  margin: 0 !important;
}

#view-templates .orders-table-wrap {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--orders-ref-grid) !important;
  border-radius: 13px !important;
  background: #ffffff !important;
  box-shadow: var(--orders-ref-shadow) !important;
  overflow: auto !important;
  scrollbar-gutter: stable !important;
}

#view-templates .orders-table {
  width: max(100%, var(--orders-table-content-width, 100%)) !important;
  min-width: max(100%, var(--orders-table-content-width, 100%)) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  background: #ffffff !important;
  color: var(--orders-ref-ink) !important;
  font-family: var(--orders-ref-font) !important;
  font-size: 13px !important;
  font-variant-numeric: tabular-nums !important;
}

#view-templates .orders-table__label-row {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
}

#view-templates .orders-table__head {
  height: 42px !important;
  padding: 0 18px !important;
  border-right: 1px solid var(--orders-ref-grid) !important;
  border-bottom: 1px solid var(--orders-ref-grid) !important;
  background: #fbfdff !important;
  color: #334866 !important;
  font-size: 11px !important;
  font-weight: 760 !important;
  letter-spacing: 0.01em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

#view-templates .orders-table__head-label {
  justify-content: center !important;
  gap: 7px !important;
}

#view-templates .orders-table__head-label span:first-child::after {
  content: "" !important;
  display: inline-block !important;
  width: 7px !important;
  height: 10px !important;
  margin-left: 7px !important;
  background:
    linear-gradient(135deg, transparent 0 45%, #9fb0ca 45% 55%, transparent 55% 100%) top / 7px 5px no-repeat,
    linear-gradient(45deg, transparent 0 45%, #9fb0ca 45% 55%, transparent 55% 100%) bottom / 7px 5px no-repeat !important;
  vertical-align: -1px !important;
}

#view-templates .orders-table__head--control .orders-table__head-label span:first-child::after,
#view-templates .orders-table__head-label--icon span:first-child::after {
  content: "" !important;
  margin: 0 !important;
}

#view-templates .orders-table__cell {
  height: 44px !important;
  padding: 0 18px !important;
  border-right: 1px solid var(--orders-ref-grid) !important;
  border-bottom: 1px solid var(--orders-ref-grid) !important;
  background: #ffffff !important;
  color: var(--orders-ref-ink) !important;
  font-size: 13px !important;
  font-weight: 720 !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
}

#view-templates .orders-table__row {
  height: 44px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

#view-templates .orders-table__row:nth-child(even),
#view-templates .orders-table__row.has-route-group,
#view-templates .orders-table__row.has-route-group:nth-child(even) {
  background: #ffffff !important;
}

#view-templates .orders-table__row:hover,
#view-templates .orders-table__row.has-route-group:hover {
  background: #f9fbff !important;
}

#view-templates .orders-table__row:hover .orders-table__cell {
  background: #f9fbff !important;
}

#view-templates .orders-table__row.is-selected {
  background: #f5f9ff !important;
  box-shadow: inset 0 0 0 2px rgba(23, 105, 233, 0.2) !important;
}

#view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-bottom: 2px solid #145aa8 !important;
}

#view-templates .orders-table__head:last-child,
#view-templates .orders-table__cell:last-child {
  border-right: 1px solid var(--orders-ref-grid) !important;
}

#view-templates .orders-table__cell--left,
#view-templates .orders-table__head--left {
  text-align: left !important;
}

#view-templates .orders-table__cell--right,
#view-templates .orders-table__head--right {
  text-align: right !important;
}

#view-templates .orders-table__cell--center,
#view-templates .orders-table__head--center {
  text-align: center !important;
}

#view-templates .orders-table__date,
#view-templates .orders-table__money,
#view-templates .orders-table__km,
#view-templates .orders-table__number,
#view-templates .orders-table__order-num,
#view-templates .orders-table__party-name {
  color: var(--orders-ref-ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.015em !important;
}

#view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  content: "" !important;
  display: inline-block !important;
  width: 10px !important;
  height: 10px !important;
  margin-right: 16px !important;
  border-radius: 999px !important;
  background: #16b86b !important;
  vertical-align: -1px !important;
}

#view-templates .orders-table__row:nth-child(3n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #ff9f0a !important;
}

#view-templates .orders-table__row:nth-child(4n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #a8b3c5 !important;
}

#view-templates .orders-table__order-sub,
#view-templates .orders-table__party-meta,
#view-templates .orders-table__date-sub,
#view-templates .orders-table__location-meta {
  display: none !important;
}

#view-templates .orders-table__party-name,
#view-templates .orders-table__order-num,
#view-templates .orders-table__text--ellipsis {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#view-templates .orders-route-compact {
  display: inline-grid !important;
  grid-template-columns: minmax(0, auto) 20px minmax(0, auto) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  max-width: 100% !important;
}

#view-templates .orders-route-compact__code {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  height: 24px !important;
  padding: 0 10px !important;
  border: 1px solid #d6e1ef !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

#view-templates .orders-route-compact__flag {
  width: 16px !important;
  height: 12px !important;
  margin-right: 7px !important;
  border-radius: 50% !important;
  box-shadow: inset 0 0 0 1px rgba(13, 27, 53, 0.08) !important;
  flex: 0 0 auto !important;
}

#view-templates .orders-route-compact__flag[data-country="FR"] {
  background: linear-gradient(90deg, #244fb7 0 33%, #ffffff 33% 66%, #e03a49 66% 100%) !important;
}

#view-templates .orders-route-compact__flag[data-country="DE"] {
  background: linear-gradient(180deg, #111111 0 33%, #d3313d 33% 66%, #f2c94c 66% 100%) !important;
}

#view-templates .orders-route-compact__flag[data-country="PL"] {
  background: linear-gradient(180deg, #ffffff 0 50%, #dc3d4d 50% 100%) !important;
}

#view-templates .orders-route-compact__flag[data-country="NL"] {
  background: linear-gradient(180deg, #c63b46 0 33%, #ffffff 33% 66%, #315fbe 66% 100%) !important;
}

#view-templates .orders-route-compact__flag[data-country="ES"] {
  background: linear-gradient(180deg, #cf3444 0 25%, #f0c84b 25% 75%, #cf3444 75% 100%) !important;
}

#view-templates .orders-route-compact__dot {
  display: none !important;
}

#view-templates .orders-route-compact__endpoint {
  color: var(--orders-ref-ink) !important;
  font-size: 12px !important;
  font-weight: 820 !important;
  letter-spacing: -0.015em !important;
  white-space: nowrap !important;
}

#view-templates .orders-route-compact__arrow {
  color: #54709d !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

#view-templates .orders-table__payment-term {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 50px !important;
  height: 24px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: #edf6ff !important;
  color: #1769c7 !important;
  font-size: 12px !important;
  font-weight: 780 !important;
  line-height: 1 !important;
}

#view-templates .orders-week-expense-cell {
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#view-templates .orders-week-expense-cell__input {
  width: 58px !important;
  max-width: 58px !important;
  height: 26px !important;
  padding: 0 9px !important;
  border: 1px solid #c8d6e7 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: var(--orders-ref-ink) !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  text-align: right !important;
  box-shadow: none !important;
}

#view-templates .orders-table__doc-chip,
#view-templates .orders-table__count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 0 !important;
  background: transparent !important;
  color: #41669d !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  box-shadow: none !important;
}

#view-templates .orders-table__link--map {
  min-height: 26px !important;
  padding: 0 10px !important;
  border: 1px solid var(--orders-ref-line) !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  color: #344c70 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

#view-templates .orders-table__cell--control,
#view-templates .orders-table__head--control {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: normal !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-align: center !important;
}

#view-templates .orders-table__head--control .orders-table__head-label {
  justify-content: center !important;
}

#view-templates .orders-table__head--control svg {
  display: none !important;
}

#view-templates .orders-table__row-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #0b1a35 !important;
  box-shadow: none !important;
}

#view-templates .orders-table__row-action:hover {
  background: #f0f5fc !important;
  color: var(--orders-ref-blue) !important;
}

#view-templates .orders-filter__input:focus,
#view-templates .orders-board__year-select:focus-visible,
#view-templates .orders-week-expense-cell__input:focus {
  outline: 3px solid var(--orders-ref-focus) !important;
  outline-offset: 0 !important;
  border-color: var(--orders-ref-blue) !important;
}

#view-templates .orders-board__actions .ghost-button:focus-visible,
#view-templates .orders-board__actions .primary:focus-visible,
#view-templates .orders-machine-card:focus-visible,
#view-templates .orders-machine-tab-action:focus-visible,
#view-templates .orders-table__row-action:focus-visible,
#view-templates .orders-table__resize-handle:focus-visible,
#view-templates .orders-table__link--map:focus-visible,
#view-templates .orders-pagination__btn:focus-visible {
  outline: 3px solid var(--orders-ref-focus) !important;
  outline-offset: 2px !important;
}

#view-templates .orders-table__row-action svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto !important;
}

#view-templates .orders-cell-edit {
  width: 20px !important;
  height: 20px !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px -12px rgba(28, 55, 86, 0.52) !important;
}

#view-templates .orders-pagination {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  flex: 0 0 auto !important;
  min-height: 44px !important;
  padding: 5px 8px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #47618c !important;
  font-size: 12px !important;
}

#view-templates .orders-pagination[hidden] {
  display: none !important;
}

#view-templates .orders-pagination__meta {
  color: #47618c !important;
  font-size: 12px !important;
  font-weight: 620 !important;
}

#view-templates .orders-pagination__btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid var(--orders-ref-line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #163a70 !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

#view-templates .orders-empty {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  border: 1px dashed var(--orders-ref-line-strong) !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

/* Impeccable harden: this file is the canonical visual layer for the orders table. */
body[data-active-view="templates"] #view-templates {
  --orders-table-edge-safe: 0px;
  --orders-line-black: var(--orders-ref-grid-strong);
  --orders-line-black-soft: var(--orders-ref-grid-soft);
}

body[data-active-view="templates"] #view-templates .orders-table-wrap {
  box-sizing: border-box !important;
  padding-right: 0 !important;
  border-color: var(--orders-ref-grid-strong) !important;
  background: var(--orders-ref-card) !important;
  overflow: auto !important;
  scrollbar-gutter: stable !important;
}

body[data-active-view="templates"] #view-templates .orders-table {
  width: max(100%, var(--orders-table-content-width, 100%)) !important;
  min-width: max(100%, var(--orders-table-content-width, 100%)) !important;
  table-layout: fixed !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head {
  height: 42px !important;
  border-right: 1px solid var(--orders-line-black) !important;
  border-bottom: 1px solid var(--orders-ref-grid-strong) !important;
  background: var(--orders-ref-bg) !important;
  color: var(--orders-ref-muted) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell {
  height: 44px !important;
  border-right: 1px solid var(--orders-line-black-soft) !important;
  border-bottom: 1px solid var(--orders-ref-grid-soft) !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
  vertical-align: middle !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row + .orders-table__row > .orders-table__cell {
  border-top: 0 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="weeklyExpense"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="weeklyExpense"] {
  border-left: 1px solid var(--orders-ref-grid-strong) !important;
  border-right: 1px solid var(--orders-ref-grid-strong) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term {
  min-width: 54px !important;
  height: 24px !important;
  padding: 0 9px !important;
  border: 1px solid var(--orders-ref-payment-info-border) !important;
  border-radius: 7px !important;
  background: var(--orders-ref-payment-info-bg) !important;
  color: var(--orders-ref-payment-info-text) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 840 !important;
  line-height: 22px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term[title*="45"],
body[data-active-view="templates"] #view-templates .orders-table__payment-term:has(span[title*="45"]) {
  border-color: var(--orders-ref-payment-warning-border) !important;
  background: var(--orders-ref-payment-warning-bg) !important;
  color: var(--orders-ref-payment-warning-text) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term[title*="60"],
body[data-active-view="templates"] #view-templates .orders-table__payment-term:has(span[title*="60"]) {
  border-color: var(--orders-ref-payment-success-border) !important;
  background: var(--orders-ref-payment-success-bg) !important;
  color: var(--orders-ref-payment-success-text) !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell {
  justify-content: center !important;
  padding: 0 8px !important;
  overflow: visible !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
  display: block !important;
  box-sizing: border-box !important;
  width: 76px !important;
  max-width: 76px !important;
  border: 1px solid var(--orders-ref-expense-border) !important;
  background: var(--orders-ref-card) !important;
  color: var(--orders-ref-ink) !important;
  box-shadow: none !important;
  background-clip: padding-box !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:hover {
  border-color: var(--orders-ref-expense-border-hover) !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:focus {
  border-color: var(--orders-ref-blue) !important;
  box-shadow: 0 0 0 3px var(--orders-ref-focus) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell--control,
body[data-active-view="templates"] #view-templates .orders-table__head--control {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  padding: 0 5px !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: normal !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-align: center !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 auto !important;
  color: var(--orders-ref-muted) !important;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action svg,
body[data-active-view="templates"] #view-templates .orders-table__head--control svg {
  display: block !important;
  flex: 0 0 auto !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action:hover {
  background: var(--orders-ref-blue-soft) !important;
  color: var(--orders-ref-blue) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action:active {
  transform: translateY(1px);
}

/* Impeccable visible refresh: a clear, modern pass for the orders table surface. */
body[data-active-view="templates"] {
  background:
    radial-gradient(circle at 8% 0%, rgba(47, 128, 237, 0.12) 0, transparent 34%),
    linear-gradient(180deg, #edf6ff 0%, #f8fbff 42%, #ffffff 100%) !important;
}

body[data-active-view="templates"] #view-templates.orders-view {
  padding: 34px 40px 28px !important;
}

body[data-active-view="templates"] #view-templates .orders-board {
  gap: 20px !important;
}

body[data-active-view="templates"] #view-templates .orders-board__title {
  color: #07142d !important;
  font-size: 36px !important;
  font-weight: 880 !important;
  letter-spacing: -0.04em !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input {
  height: 50px !important;
  border-color: #d7e2ef !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button,
body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 14px !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action {
  height: 76px !important;
  border-color: #dfe8f3 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 14px 26px -24px rgba(21, 44, 78, 0.46) !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card.is-active,
body[data-active-view="templates"] #view-templates .orders-machine-card[aria-pressed="true"] {
  border-color: #8db9ff !important;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
  box-shadow: 0 18px 30px -24px rgba(23, 105, 233, 0.44), inset 0 -2px 0 rgba(23, 105, 233, 0.22) !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__status {
  color: #5a6d88 !important;
  font-weight: 720 !important;
}

body[data-active-view="templates"] #view-templates .orders-table-wrap {
  border-color: #dde8f4 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 60px -48px rgba(21, 44, 78, 0.64) !important;
}

body[data-active-view="templates"] #view-templates .orders-table {
  background: #ffffff !important;
  font-size: 13px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head {
  height: 48px !important;
  border-right-color: #e5ebf3 !important;
  border-bottom-color: #dbe4ef !important;
  background: #fbfdff !important;
  color: #516681 !important;
  font-size: 11px !important;
  font-weight: 820 !important;
  letter-spacing: 0.035em !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell {
  height: 48px !important;
  border-right-color: #e7edf5 !important;
  border-bottom-color: #e9eef5 !important;
  background: #ffffff !important;
  color: #07142d !important;
  font-size: 13px !important;
  font-weight: 780 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:hover > .orders-table__cell {
  background: #f7fbff !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-selected > .orders-table__cell {
  background: #eef6ff !important;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 233, 0.22) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-bottom: 2px solid #1769e9 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  width: 9px !important;
  height: 9px !important;
  margin-right: 18px !important;
  box-shadow: 0 0 0 3px rgba(22, 184, 107, 0.12) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact {
  gap: 8px !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__code {
  height: 26px !important;
  padding: 0 12px !important;
  border-color: #dfe8f3 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 4px 12px -10px rgba(21, 44, 78, 0.42) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__flag {
  width: 14px !important;
  height: 14px !important;
  border-radius: 999px !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__endpoint {
  color: #081a39 !important;
  font-weight: 860 !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__arrow {
  color: #6982a3 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term {
  height: 26px !important;
  border-radius: 8px !important;
  background: #edf6ff !important;
  color: #1359ad !important;
  font-weight: 820 !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
  width: 80px !important;
  max-width: 80px !important;
  height: 28px !important;
  border-color: #cfdceb !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  font-weight: 820 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #dfe8f3 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #4e6482 !important;
}

@media (max-width: 1280px) {
  #view-templates.orders-view {
    padding: 20px 14px 22px !important;
  }

  #view-templates .orders-board__toolbar {
    grid-template-columns: minmax(220px, 0.62fr) minmax(300px, 1fr) auto !important;
    gap: 14px !important;
  }

  #view-templates .orders-board__actions .ghost-button,
  #view-templates .orders-board__actions .primary {
    padding: 0 12px !important;
  }
}

@media (max-width: 980px) {
  #view-templates.orders-view {
    height: auto !important;
    min-height: calc(100vh - 58px) !important;
    overflow: auto !important;
  }

  #view-templates .orders-board__toolbar {
    grid-template-columns: 1fr !important;
  }

  #view-templates .orders-board__actions {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  #view-templates .orders-machine-card,
  #view-templates .orders-machine-tab-action {
    flex-basis: 124px !important;
    min-width: 124px !important;
  }
}

@media (pointer: coarse) {
  body[data-active-view="templates"] #view-templates .orders-table__cell {
    height: 52px !important;
    font-size: 14px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table__head {
    height: 46px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table__row-action {
    width: 44px !important;
    height: 44px !important;
    border-radius: 11px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-week-expense-cell {
    min-height: 44px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
    width: 88px !important;
    max-width: 88px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table__resize-handle {
    width: 28px !important;
    inset-inline-end: -14px !important;
  }
}

@media (max-width: 720px) {
  body[data-active-view="templates"] .topbar {
    padding: 0 12px !important;
  }

  #view-templates.orders-view {
    padding: 18px 10px 20px !important;
  }

  #view-templates .orders-board {
    gap: 12px !important;
  }

  #view-templates .orders-board__titleline {
    gap: 10px !important;
  }

  #view-templates .orders-board__title {
    font-size: 29px !important;
    letter-spacing: -0.03em !important;
  }

  #view-templates .orders-board__year-select {
    width: 86px !important;
    padding-left: 14px !important;
  }

  #view-templates .orders-board__actions {
    gap: 8px !important;
  }

  #view-templates .orders-board__actions .ghost-button,
  #view-templates .orders-board__actions .primary {
    min-height: 44px !important;
    flex: 1 1 150px !important;
    justify-content: center !important;
  }

  #view-templates .orders-machine-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  #view-templates .orders-machine-card,
  #view-templates .orders-machine-tab-action {
    scroll-snap-align: start;
  }

  body[data-active-view="templates"] #view-templates .orders-table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-templates *,
  body[data-active-view="templates"] * {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Impeccable reference lock: final visible layer for the orders screen. */
body[data-active-view="templates"] {
  background:
    radial-gradient(circle at 18% -10%, rgba(91, 150, 236, 0.18) 0, transparent 28%),
    linear-gradient(180deg, #eef6ff 0%, #f7fbff 38%, #ffffff 100%) !important;
}

body[data-active-view="templates"] #view-templates.orders-view {
  padding: 30px 40px 28px !important;
}

body[data-active-view="templates"] #view-templates .orders-board {
  gap: 18px !important;
}

body[data-active-view="templates"] #view-templates .orders-board__title {
  color: #07122b !important;
  font-size: 34px !important;
  font-weight: 880 !important;
  letter-spacing: -0.038em !important;
}

body[data-active-view="templates"] #view-templates .orders-board__toolbar {
  grid-template-columns: minmax(250px, 0.72fr) minmax(420px, 560px) auto !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input {
  height: 50px !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0b1324 !important;
  font-size: 13px !important;
  font-weight: 680 !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input::placeholder {
  color: #68788d !important;
  opacity: 1 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button,
body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  font-weight: 820 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action {
  height: 76px !important;
  min-height: 76px !important;
  border: 1px solid #dfe8f3 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 16px 30px -26px rgba(21, 44, 78, 0.42) !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card.is-active,
body[data-active-view="templates"] #view-templates .orders-machine-card[aria-pressed="true"] {
  border-color: #91bcff !important;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
  box-shadow: inset 0 -2px 0 rgba(23, 105, 233, 0.2), 0 16px 30px -26px rgba(23, 105, 233, 0.44) !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__plate {
  color: #0b1324 !important;
  font-weight: 840 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card.is-active .orders-machine-card__plate {
  color: #1769e9 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__status {
  color: #607188 !important;
  font-weight: 760 !important;
}

body[data-active-view="templates"] #view-templates .orders-table-wrap {
  width: 100% !important;
  max-width: none !important;
  align-self: stretch !important;
  border: 1px solid #d8e2ee !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 54px -44px rgba(22, 44, 78, 0.5) !important;
  overflow: auto !important;
  scrollbar-gutter: auto !important;
}

body[data-active-view="templates"] #view-templates .orders-table {
  width: max(100%, var(--orders-table-content-width, 100%)) !important;
  min-width: max(100%, var(--orders-table-content-width, 100%)) !important;
  background: #ffffff !important;
  color: #0b1324 !important;
  font-family: "Manrope", "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif !important;
  font-size: 13px !important;
  font-variant-numeric: tabular-nums !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head {
  height: 44px !important;
  padding: 0 12px !important;
  border-right: 1px solid #dfe6ee !important;
  border-bottom: 1px solid #cfd9e6 !important;
  background: #fbfdff !important;
  color: #5f6f83 !important;
  font-size: 10.5px !important;
  font-weight: 820 !important;
  letter-spacing: 0.028em !important;
  text-transform: uppercase !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label {
  min-width: 0 !important;
  gap: 5px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label span:first-child {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label span:first-child::after {
  width: auto !important;
  height: auto !important;
  margin-left: 4px !important;
  background: none !important;
  color: #9aa7b8 !important;
  font-size: 10px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="loadDate"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="unloadDate"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="freightRate"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="kilometers"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="weeklyExpense"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="documentsCount"],
body[data-active-view="templates"] #view-templates .orders-table__head[data-column-key="paymentTermDays"] {
  padding-left: 8px !important;
  padding-right: 8px !important;
  letter-spacing: 0.018em !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell {
  height: 44px !important;
  padding: 0 14px !important;
  border-right: 1px solid #dfe6ee !important;
  border-bottom: 1px solid #e8edf3 !important;
  background: #ffffff !important;
  color: #0b1324 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row {
  height: 44px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:hover > .orders-table__cell {
  background: #f7fbff !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-selected > .orders-table__cell {
  background: #eef6ff !important;
  box-shadow: inset 3px 0 0 #1769e9 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-bottom: 2px solid #165ba8 !important;
  box-shadow: none !important;
}

body[data-active-view="templates"][data-orders-direction="asc"] #view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-top: 2px solid #165ba8 !important;
  border-bottom: 1px solid #e8edf3 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="unloadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="freightRate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="kilometers"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="paymentTermDays"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="documentsCount"] {
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-weight: 800 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__date,
body[data-active-view="templates"] #view-templates .orders-table__money,
body[data-active-view="templates"] #view-templates .orders-table__km,
body[data-active-view="templates"] #view-templates .orders-table__number,
body[data-active-view="templates"] #view-templates .orders-table__order-num,
body[data-active-view="templates"] #view-templates .orders-table__party-name,
body[data-active-view="templates"] #view-templates .orders-table__text,
body[data-active-view="templates"] #view-templates .orders-table__text--ellipsis {
  color: #0b1324 !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  letter-spacing: -0.012em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-width: 100% !important;
  gap: 10px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  flex: 0 0 9px !important;
  width: 9px !important;
  height: 9px !important;
  margin-right: 0 !important;
  border-radius: 999px !important;
  background: #17b26a !important;
  box-shadow: 0 0 0 3px rgba(23, 178, 106, 0.12) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:nth-child(3n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:nth-child(4n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #9aa7b8 !important;
  box-shadow: 0 0 0 3px rgba(154, 167, 184, 0.14) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  overflow: hidden !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__code {
  flex: 0 1 auto !important;
  min-width: 92px !important;
  max-width: calc((100% - 36px) / 2) !important;
  height: 24px !important;
  padding: 0 10px !important;
  gap: 6px !important;
  border: 1px solid #dfe8f3 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__flag {
  flex: 0 0 14px !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  border: 1px solid rgba(196, 208, 224, 0.96) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  filter: saturate(1.2) contrast(1.1) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__endpoint {
  min-width: 0 !important;
  max-width: 74px !important;
  color: #07122b !important;
  font-size: 11.5px !important;
  font-weight: 880 !important;
  letter-spacing: -0.018em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__arrow {
  flex: 0 0 14px !important;
  color: #8291a5 !important;
  font-size: 13px !important;
  font-weight: 820 !important;
  text-align: center !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term {
  min-width: 54px !important;
  height: 24px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #e5f1ff !important;
  color: #1359ad !important;
  font-size: 12px !important;
  font-weight: 860 !important;
  line-height: 24px !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell {
  min-height: 44px !important;
  justify-content: center !important;
  padding: 0 8px !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
  width: 76px !important;
  max-width: 76px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 9px !important;
  border: 1px solid #cbd7e5 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0b1324 !important;
  font-size: 12px !important;
  font-weight: 780 !important;
  text-align: right !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:hover {
  border-color: #aebccd !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:focus {
  border-color: #1769e9 !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 233, 0.16) !important;
  outline: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__doc-chip,
body[data-active-view="templates"] #view-templates .orders-table__count {
  color: #26364a !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell--control,
body[data-active-view="templates"] #view-templates .orders-table__head--control {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  padding: 0 !important;
  text-align: center !important;
  overflow: hidden !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border: 1px solid #dfe8f3 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #5a6d84 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action:hover {
  border-color: #b9d4ff !important;
  background: #eef6ff !important;
  color: #1769e9 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__resize-handle::before {
  background: rgba(142, 158, 178, 0.95) !important;
}

@media (max-width: 980px) {
  body[data-active-view="templates"] #view-templates.orders-view {
    height: auto !important;
    min-height: calc(100vh - 58px) !important;
    padding: 20px 14px 22px !important;
    overflow: auto !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__toolbar {
    grid-template-columns: 1fr !important;
  }
}

@media (pointer: coarse) {
  body[data-active-view="templates"] #view-templates .orders-table__cell {
    height: 50px !important;
    font-size: 14px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table__row-action,
  body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* Logistics Dashboard facelift: dense TMS-style workspace for dispatch work. */
body[data-active-view="templates"] {
  --ld-bg: #edf3f8;
  --ld-surface: #ffffff;
  --ld-surface-alt: #f7fafc;
  --ld-ink: #071322;
  --ld-ink-soft: #26364d;
  --ld-muted: #66758a;
  --ld-line: #cfd9e5;
  --ld-line-soft: #dde5ee;
  --ld-line-strong: #9eacbc;
  --ld-navy: #102238;
  --ld-navy-2: #182c45;
  --ld-blue: #1769e9;
  --ld-blue-2: #0f5ecf;
  --ld-blue-soft: #e9f2ff;
  --ld-green: #12805c;
  --ld-green-soft: #e9f8f1;
  --ld-amber: #a15c00;
  --ld-amber-soft: #fff4df;
  --ld-red: #b42318;
  --ld-red-soft: #fff0ee;
  background: var(--ld-bg) !important;
  color: var(--ld-ink) !important;
}

body[data-active-view="templates"] .topbar {
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 18px !important;
  border-bottom: 1px solid #d2dce7 !important;
  background: #fbfdff !important;
}

body[data-active-view="templates"] .topbar__module-nav {
  min-height: 32px !important;
  padding: 2px !important;
  border-radius: 9px !important;
  border-color: #d6e0eb !important;
  background: #f5f8fb !important;
}

body[data-active-view="templates"] .topbar-nav-button {
  min-height: 28px !important;
  padding: 0 14px !important;
  border-radius: 7px !important;
  color: #506176 !important;
  font-size: 11.5px !important;
  font-weight: 780 !important;
}

body[data-active-view="templates"] .topbar-nav-button.is-active {
  background: #ffffff !important;
  color: #0f5ecf !important;
  box-shadow: inset 0 0 0 1px #b9d4ff !important;
}

body[data-active-view="templates"] .topbar__theme,
body[data-active-view="templates"] .pill-button--avatar-only {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 8px !important;
}

body[data-active-view="templates"] #view-templates.orders-view {
  height: calc(100vh - 48px) !important;
  padding: 16px 24px 20px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 180px),
    var(--ld-bg) !important;
}

body[data-active-view="templates"] #view-templates .orders-board {
  gap: 10px !important;
}

body[data-active-view="templates"] #view-templates .orders-board__toolbar {
  display: grid !important;
  grid-template-columns: minmax(252px, 0.7fr) minmax(360px, 540px) auto !important;
  gap: 14px !important;
  align-items: center !important;
  min-height: 70px !important;
  padding: 12px 16px !important;
  border: 1px solid #20344e !important;
  border-radius: 12px !important;
  background: var(--ld-navy) !important;
  box-shadow: 0 18px 40px -34px rgba(6, 19, 38, 0.7) !important;
}

body[data-active-view="templates"] #view-templates .orders-board__titleline {
  gap: 12px !important;
}

body[data-active-view="templates"] #view-templates .orders-board__title {
  color: #ffffff !important;
  font-size: 28px !important;
  font-weight: 880 !important;
  letter-spacing: -0.034em !important;
  line-height: 1 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__year-select {
  width: 88px !important;
  height: 38px !important;
  padding: 0 30px 0 13px !important;
  border: 1px solid #3a506d !important;
  border-radius: 8px !important;
  background-color: var(--ld-navy-2) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 840 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__subtitle {
  display: flex !important;
  margin-top: 7px !important;
  color: #9eb1c8 !important;
  font-size: 11px !important;
  font-weight: 760 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

body[data-active-view="templates"] #view-templates .orders-board__subtitle::before {
  background: #2f80ed !important;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.16) !important;
}

body[data-active-view="templates"] #view-templates .orders-filter {
  max-width: 540px !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input {
  height: 42px !important;
  border: 1px solid #d8e3ee !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: var(--ld-ink) !important;
  font-size: 12.5px !important;
  font-weight: 720 !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input::placeholder {
  color: #6b7b90 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions {
  gap: 8px !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button,
body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 840 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button {
  border-color: #38516e !important;
  background: #1a2d46 !important;
  color: #e9f1fb !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button:hover {
  border-color: #5d7fa8 !important;
  background: #223954 !important;
}

body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
  border: 1px solid #3985f0 !important;
  background: linear-gradient(180deg, #2f80ed 0%, #1769e9 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 28px -24px rgba(23, 105, 233, 0.75) !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-tabs {
  display: flex !important;
  gap: 6px !important;
  min-height: 58px !important;
  padding: 6px !important;
  border: 1px solid #cbd7e4 !important;
  border-radius: 12px !important;
  background: #f8fbfe !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action {
  flex: 0 0 124px !important;
  min-width: 124px !important;
  max-width: 154px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 7px 10px !important;
  border: 1px solid #d5e0eb !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: var(--ld-ink) !important;
  box-shadow: none !important;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card--all {
  flex-basis: 138px !important;
  min-width: 138px !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card:hover,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action:hover {
  border-color: #9fb5cc !important;
  background: #fbfdff !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card.is-active,
body[data-active-view="templates"] #view-templates .orders-machine-card[aria-pressed="true"] {
  border-color: #1769e9 !important;
  background: #eef6ff !important;
  color: #0f5ecf !important;
  box-shadow: inset 0 -2px 0 #1769e9 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__top {
  align-items: center !important;
  gap: 6px !important;
  min-height: 16px !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__flag {
  color: #53667d !important;
  font-size: 10px !important;
  font-weight: 880 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__plate {
  min-width: 0 !important;
  color: var(--ld-ink) !important;
  font-size: 12px !important;
  font-weight: 880 !important;
  letter-spacing: -0.012em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__count {
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  background: #e7eef6 !important;
  color: #41536a !important;
  font-size: 10px !important;
  font-weight: 860 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card.is-active .orders-machine-card__count {
  background: #d6e8ff !important;
  color: #0f5ecf !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__status {
  margin-top: 4px !important;
  color: #64758b !important;
  font-size: 10px !important;
  font-weight: 820 !important;
  letter-spacing: 0.035em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card__status--route,
body[data-active-view="templates"] #view-templates .orders-machine-card__status--loading {
  color: #0f5ecf !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card--create,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action:not(.orders-machine-card--danger) {
  justify-content: center !important;
  color: #2b4666 !important;
  font-weight: 840 !important;
}

body[data-active-view="templates"] #view-templates .orders-machine-card--danger,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action.orders-machine-card--danger {
  border-color: #f0c9c5 !important;
  background: #fff8f7 !important;
  color: #b42318 !important;
}

body[data-active-view="templates"] #view-templates .orders-table-wrap {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  border: 1px solid var(--ld-line-strong) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 36px -34px rgba(6, 19, 38, 0.45) !important;
  overflow: auto !important;
  scrollbar-gutter: stable !important;
}

body[data-active-view="templates"] #view-templates .orders-table {
  width: max(100%, var(--orders-table-content-width, 100%)) !important;
  min-width: max(100%, var(--orders-table-content-width, 100%)) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  background: #ffffff !important;
  color: var(--ld-ink) !important;
  font-size: 12.5px !important;
  font-variant-numeric: tabular-nums !important;
}

body[data-active-view="templates"] #view-templates .orders-table__label-row {
  position: sticky !important;
  top: 0 !important;
  z-index: 8 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head {
  height: 38px !important;
  padding: 0 11px !important;
  border-right: 1px solid #d5dde7 !important;
  border-bottom: 1px solid #aab6c4 !important;
  background: #f6f8fb !important;
  color: #4d5f75 !important;
  font-size: 10.5px !important;
  font-weight: 860 !important;
  letter-spacing: 0.038em !important;
  text-transform: uppercase !important;
  vertical-align: middle !important;
  box-shadow: inset 0 -1px 0 #b7c2ce !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label {
  justify-content: center !important;
  gap: 4px !important;
  min-width: 0 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label span:first-child {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-table__head-label span:first-child::after {
  margin-left: 4px !important;
  color: #8fa0b4 !important;
  font-size: 10px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell {
  height: 40px !important;
  padding: 0 11px !important;
  border-right: 1px solid var(--ld-line-soft) !important;
  border-bottom: 1px solid #e7ecf2 !important;
  background: #ffffff !important;
  color: var(--ld-ink) !important;
  font-size: 12.5px !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row {
  height: 40px !important;
  background: #ffffff !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:nth-child(even) > .orders-table__cell {
  background: #fbfcfe !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.has-route-group > .orders-table__cell {
  background: #f8fbfc !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.has-route-group:nth-child(even) > .orders-table__cell {
  background: #f5f9fb !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:hover > .orders-table__cell {
  background: #edf5ff !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-selected > .orders-table__cell {
  background: #e7f1ff !important;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 233, 0.28) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-route-selected > .orders-table__cell {
  background: #eef8f4 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-bottom: 3px solid #154c85 !important;
  box-shadow: none !important;
}

body[data-active-view="templates"][data-orders-direction="asc"] #view-templates .orders-table__row.is-week-boundary > .orders-table__cell {
  border-top: 3px solid #154c85 !important;
  border-bottom: 1px solid #e7ecf2 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="unloadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="freightRate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="kilometers"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="paymentTermDays"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="weeklyExpense"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="documentsCount"] {
  padding-left: 8px !important;
  padding-right: 8px !important;
  font-weight: 800 !important;
  text-align: right !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="unloadDate"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="paymentTermDays"] {
  text-align: center !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="routeSummary"] {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="orderNumber"],
body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="counterparty"] {
  font-weight: 800 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__date,
body[data-active-view="templates"] #view-templates .orders-table__money,
body[data-active-view="templates"] #view-templates .orders-table__km,
body[data-active-view="templates"] #view-templates .orders-table__number,
body[data-active-view="templates"] #view-templates .orders-table__order-num,
body[data-active-view="templates"] #view-templates .orders-table__party-name,
body[data-active-view="templates"] #view-templates .orders-table__text,
body[data-active-view="templates"] #view-templates .orders-table__text--ellipsis {
  color: var(--ld-ink) !important;
  font-size: 12.5px !important;
  font-weight: inherit !important;
  line-height: 1 !important;
  letter-spacing: -0.006em !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date {
  display: inline-grid !important;
  grid-template-columns: 9px minmax(0, auto) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  max-width: 100% !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  width: 8px !important;
  height: 8px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  background: #17a66a !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:nth-child(3n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #f59e0b !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row:nth-child(4n) .orders-table__cell[data-column-key="loadDate"] .orders-table__date::before {
  background: #94a3b8 !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  overflow: hidden !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__code {
  flex: 0 1 auto !important;
  min-width: 88px !important;
  max-width: calc((100% - 32px) / 2) !important;
  height: 23px !important;
  padding: 0 9px !important;
  gap: 6px !important;
  border: 1px solid #d2dde8 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.82) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__flag {
  flex: 0 0 14px !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  border: 1px solid rgba(190, 202, 216, 0.95) !important;
  border-radius: 999px !important;
  filter: saturate(1.16) contrast(1.08) !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__endpoint {
  min-width: 0 !important;
  max-width: 72px !important;
  color: #0b1628 !important;
  font-size: 11.5px !important;
  font-weight: 880 !important;
  letter-spacing: -0.014em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-active-view="templates"] #view-templates .orders-route-compact__arrow {
  flex: 0 0 13px !important;
  color: #6f8196 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-align: center !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term {
  min-width: 52px !important;
  height: 22px !important;
  padding: 0 9px !important;
  border: 1px solid #c8ddf5 !important;
  border-radius: 6px !important;
  background: #eaf4ff !important;
  color: #1359ad !important;
  font-size: 11.5px !important;
  font-weight: 880 !important;
  line-height: 20px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term[title*="45"],
body[data-active-view="templates"] #view-templates .orders-table__payment-term:has(span[title*="45"]) {
  border-color: #ead3a3 !important;
  background: var(--ld-amber-soft) !important;
  color: var(--ld-amber) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__payment-term[title*="60"],
body[data-active-view="templates"] #view-templates .orders-table__payment-term:has(span[title*="60"]) {
  border-color: #b9e4d2 !important;
  background: var(--ld-green-soft) !important;
  color: var(--ld-green) !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell {
  min-height: 40px !important;
  justify-content: center !important;
  padding: 0 6px !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
  width: 70px !important;
  max-width: 70px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  border: 1px solid #c6d2df !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: var(--ld-ink) !important;
  font-size: 12px !important;
  font-weight: 820 !important;
  text-align: right !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:hover {
  border-color: #95a6b9 !important;
}

body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input:focus {
  border-color: var(--ld-blue) !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 233, 0.16) !important;
  outline: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__link--map {
  min-height: 24px !important;
  padding: 0 9px !important;
  border: 1px solid #cfd9e5 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #2d4969 !important;
  font-size: 11.5px !important;
  font-weight: 820 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__doc-chip,
body[data-active-view="templates"] #view-templates .orders-table__count {
  color: #26364d !important;
  font-size: 12px !important;
  font-weight: 860 !important;
}

body[data-active-view="templates"] #view-templates .orders-table__cell--control,
body[data-active-view="templates"] #view-templates .orders-table__head--control {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  padding: 0 !important;
  text-align: center !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border: 1px solid #d4dee9 !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  color: #506176 !important;
  box-shadow: none !important;
}

body[data-active-view="templates"] #view-templates .orders-table__row-action:hover {
  border-color: #93bdf9 !important;
  background: #eaf3ff !important;
  color: var(--ld-blue) !important;
}

body[data-active-view="templates"] #view-templates .orders-table__resize-handle {
  width: 14px !important;
  inset-inline-end: -7px !important;
}

body[data-active-view="templates"] #view-templates .orders-table__resize-handle::before {
  top: 9px !important;
  bottom: 9px !important;
  width: 1px !important;
  background: rgba(124, 143, 164, 0.95) !important;
}

body[data-active-view="templates"] #view-templates .orders-cell-edit {
  width: 22px !important;
  height: 22px !important;
  border: 1px solid #c7d8ef !important;
  border-radius: 6px !important;
  background: #f7fbff !important;
  color: var(--ld-blue) !important;
}

body[data-active-view="templates"] #view-templates .orders-filter__input:focus,
body[data-active-view="templates"] #view-templates .orders-board__year-select:focus-visible,
body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button:focus-visible,
body[data-active-view="templates"] #view-templates .orders-board__actions .primary:focus-visible,
body[data-active-view="templates"] #view-templates .orders-machine-card:focus-visible,
body[data-active-view="templates"] #view-templates .orders-machine-tab-action:focus-visible,
body[data-active-view="templates"] #view-templates .orders-table__row-action:focus-visible,
body[data-active-view="templates"] #view-templates .orders-table__link--map:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.24) !important;
  outline-offset: 2px !important;
}

@media (max-width: 1280px) {
  body[data-active-view="templates"] #view-templates.orders-view {
    padding: 14px 16px 18px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__toolbar {
    grid-template-columns: minmax(230px, 0.72fr) minmax(300px, 1fr) auto !important;
    gap: 10px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button,
  body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
    padding: 0 11px !important;
  }
}

@media (max-width: 980px) {
  body[data-active-view="templates"] #view-templates.orders-view {
    height: auto !important;
    min-height: calc(100vh - 48px) !important;
    overflow: auto !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__toolbar {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__actions {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  body[data-active-view="templates"] #view-templates .orders-machine-card,
  body[data-active-view="templates"] #view-templates .orders-machine-tab-action {
    flex-basis: 124px !important;
  }
}

@media (max-width: 720px) {
  body[data-active-view="templates"] .topbar {
    padding: 0 10px !important;
  }

  body[data-active-view="templates"] #view-templates.orders-view {
    padding: 10px 8px 14px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__toolbar {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 10px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__title {
    font-size: 25px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-board__actions .ghost-button,
  body[data-active-view="templates"] #view-templates .orders-board__actions .primary {
    flex: 1 1 145px !important;
    justify-content: center !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table-wrap {
    border-radius: 8px !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (pointer: coarse) {
  body[data-active-view="templates"] #view-templates .orders-table__cell {
    height: 48px !important;
    font-size: 13.5px !important;
  }

  body[data-active-view="templates"] #view-templates .orders-table__row-action,
  body[data-active-view="templates"] #view-templates .orders-week-expense-cell__input {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}
