: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%);
}

* {
  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;
}

.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;
}

.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;
}

.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;
}

.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);
}

.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;
}

.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;
}

.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));
}

.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: 1500px;
}

.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(138px, .52fr) minmax(240px, 1.2fr) repeat(3, minmax(168px, .82fr));
  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(4, 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;
  padding: 10px;
}

.logistics-route-tab-panel .logistics-map-main {
  grid-template-rows: 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: minmax(420px, 1fr) auto;
}

.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-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);
}

.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(150px, 1fr)) minmax(220px, 1.4fr);
  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(4, 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-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 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 (max-width: 760px) {
  .app-header {
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
  }

  .app-header,
  .header-left,
  .page-title,
  .work-panel,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-menu-panel {
    left: 0;
    right: auto;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .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(150px, 190px) minmax(210px, 280px);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.logistics-work-filters label {
  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 {
  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;
}

.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;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 900;
}

.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;
  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 {
  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 {
  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-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 {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.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-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(980px, 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-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-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(180px, .85fr) minmax(260px, 1.2fr) 34px;
  min-height: 52px;
  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 {
  color: var(--text);
  font-size: 18px;
  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-row small {
  display: flex;
  gap: 7px;
  align-items: center;
}

.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-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;
}

.order-preview-anchor .order-preview-tooltip {
  display: none !important;
}

.dispatch-page {
  display: grid;
  gap: 10px;
  min-height: calc(100vh - 150px);
}

.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(5, 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 {
  color: var(--muted);
  font-weight: 900;
}

.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-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: 13px;
}

.dispatch-run-card header span,
.dispatch-run-timeline span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.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-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.dispatch-run-facts span {
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  padding: 6px;
  text-align: center;
}

.dispatch-run-timeline {
  display: grid;
  gap: 3px;
}

.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 .danger {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

@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;
}

@media (max-width: 900px) {
  .scope-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
