/**
 * Panel v2 — финальная полировка поверх panel_v2.css
 * Выравнивание с прототипом admin-panel-after.html
 */

/* ---- Full-viewport app shell (без browser-window демо) ---- */
html.panel-app,
html.panel-app body {
  height: 100%;
  overflow: hidden;
}
html.panel-app {
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
}
html.panel-app body {
  background: var(--surface);
}
html.panel-app .app-viewport {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
html.panel-app .app-layout,
html.panel-app .main {
  min-height: 0;
}
@media (min-width: 768px) {
  html.panel-app .app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  html.panel-app .app-viewport[data-sidebar="collapsed"] .app-layout {
    grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
  }
  html.panel-app .sidebar {
    position: relative;
    inset: auto;
    width: var(--sidebar-w);
    min-width: 0;
    max-width: var(--sidebar-w);
    transform: none;
  }
  html.panel-app .app-viewport[data-sidebar="collapsed"] .sidebar {
    width: var(--sidebar-w-collapsed);
    max-width: var(--sidebar-w-collapsed);
  }
}
html.panel-app .us-form {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

/* ---- Topbar: бренд и пользователь как в прототипе ---- */
.topbar-left .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  border-radius: 8px;
  transition: background var(--motion-fast) var(--ease);
}
.topbar-left .brand:hover {
  background: rgba(28, 25, 23, 0.04);
}
.topbar-left .brand:hover .brand-title {
  color: var(--accent-strong);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
}
.brand-logo {
  height: 24px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: invert(1);
}
.app-viewport[data-sidebar="collapsed"] .brand-logo {
  height: 22px;
}
.brand-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.2;
}

.topbar-user .av,
.topbar-user .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #44403C 0%, #1C1917 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.topbar-user .name {
  font-size: 13px;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-user .chev {
  color: var(--subtle);
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  flex-shrink: 0;
}
.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-switch__btn:hover {
  background: var(--bg);
  color: var(--ink);
}
.lang-switch__btn.is-active,
.lang-switch__btn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.lang-switch--login {
  height: 30px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.icon-btn.has-badge,
.icon-btn:has(.dot-indicator) {
  position: relative;
}
.dot-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
  pointer-events: none;
}

/* ---- Sidebar active state ---- */
.nav-item.is-active,
.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-hairline);
}
.nav-item.is-active .nav-icon,
.nav-item[aria-current="page"] .nav-icon {
  color: var(--accent);
}

/* Admin-only nav (скрывается JS по data-user-role) */
body[data-user-role="manager"] .nav-item[data-admin-only],
body[data-user-role="viewer"] .nav-item[data-admin-only] {
  display: none;
}

/* ---- Flash messages (Django) ---- */
.flash-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.flash {
  pointer-events: auto;
  padding: 11px 14px 11px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 6px 20px -8px rgba(28, 25, 23, 0.18), 0 1px 2px rgba(28, 25, 23, 0.04);
  border: 1px solid var(--border);
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: flash-in var(--motion-base) var(--ease);
}
.flash::before {
  content: '';
  flex-shrink: 0;
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  margin: 1px 0;
}
.flash-success::before { background: #4ADE80; }
.flash-error::before, .flash-danger::before { background: #F87171; }
.flash-warning::before { background: #FBBF24; }
.flash-info::before { background: #60A5FA; }
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Tables: курсор, фокус строки ---- */
.t tbody tr {
  cursor: pointer;
}
.t tbody tr:focus-within {
  outline: none;
  background: var(--bg);
}
.page[data-page="trucks"] .t tbody tr,
.page[data-page="clients"] .t tbody tr,
.page[data-page="warehouses"] .t tbody tr {
  cursor: default;
}
.page[data-page="products"] .t tbody tr .row-act-btn {
  cursor: pointer;
}

/* Mono links in tables */
.t code.mono,
.t a code.mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.t a:hover code.mono {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.muted { color: var(--subtle); }

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip.is-active .chip-count,
.chip[aria-pressed="true"] .chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

.action-queue li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.action-queue li:last-child { border-bottom: 0; }
.action-queue-empty { color: var(--subtle); font-style: italic; }

.activity-list li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list .act-time {
  flex-shrink: 0;
  width: 48px;
  font-size: 11px;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

/* ---- Badges consistency ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.badge.info, .badge.is-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.success, .badge.is-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge.warning, .badge.is-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge.danger, .badge.is-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

/* ---- KPI: убрать «фейковые» дельты на проде ---- */
.kpi-delta.is-placeholder {
  visibility: hidden;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/* ---- Dashboard greeting ---- */
.greeting {
  margin: 0 28px 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-lg);
  font-size: 15px;
  color: var(--muted);
}
.greeting strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Bot widget CTA ---- */
.bot-widget-cta .btn {
  white-space: nowrap;
}

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.empty-state p {
  margin: 0 0 16px;
  font-size: 13px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state a {
  color: var(--accent);
  font-weight: 500;
}
.empty-state a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* =================================================================
   LOGIN (panel_v2/login.html) — single-column centered
   Те же токены панели: --bg / --surface / --ink / --accent / --border
   Art direction: editorial masthead, big tight headline, фоновый grid
   ================================================================= */

html.panel-app:has(.login-body),
html.panel-app:has(.login-body) body {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
}

.login-body {
  margin: 0;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.login-body--solo {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(37, 99, 235, 0.04), transparent 70%),
    var(--bg);
  position: relative;
}
.login-body--solo::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 25, 23, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 25, 23, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Page frame: top + bottom corner anchors ---- */
.login-page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* ---- Masthead (top: status + version) ---- */
.login-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.login-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.login-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: login-status-pulse 2.4s ease-out infinite;
}
@keyframes login-status-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0);    }
}
.login-status-label {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.login-version {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--subtle, #A8A29E);
}

/* ---- Center stage: brand + headline + form + hint ---- */
.login-stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 40px 0;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Brand mark (centered) ---- */
.login-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 36px;
}
.login-mark-glyph {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08);
}
.login-mark-logo {
  height: 38px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: invert(1);
}
.login-mark-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}
.login-mark-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.login-mark-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.005em;
}

/* ---- Editorial headline (art direction anchor) ---- */
.login-headline {
  margin: 0 0 32px;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.18;
  color: var(--ink);
  text-wrap: balance;
}
.login-headline-accent {
  color: var(--accent);
  font-weight: 700;
}

/* ---- Form card ---- */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-card);
}

/* ---- Error ---- */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  color: #B91C1C;
  font-size: 13px;
  font-weight: 500;
}

/* ---- Form ---- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.login-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease);
}
.login-field input::placeholder {
  color: var(--border-strong);
}
.login-field input:hover {
  border-color: var(--border-strong);
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.login-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
}

/* ---- Password wrap ---- */
.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-wrap input { padding-right: 40px; }
.login-input-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.login-input-toggle:hover {
  color: var(--ink);
  background: var(--bg);
}
.login-input-toggle.is-active { color: var(--accent); }
.login-input-toggle .eye-hide { display: none; }
.login-input-toggle.is-active .eye-show { display: none; }
.login-input-toggle.is-active .eye-hide { display: block; }

/* ---- Submit ---- */
.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease);
}
.login-submit:hover { background: #0F0D0B; }
.login-submit:active { transform: translateY(0.5px); }
.login-submit.is-loading { pointer-events: none; opacity: 0.75; }
.login-submit svg { transition: transform var(--motion-base) var(--ease); }
.login-submit:hover svg { transform: translateX(2px); }

/* ---- Card foot ---- */
.login-card-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.login-card-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
}
.login-card-foot a:hover { color: var(--accent-strong); text-decoration: underline; }

/* ---- Keyboard hint (under the card) ---- */
.login-hint {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--subtle, #A8A29E);
}
.login-hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.login-hint-sep { color: var(--border-strong); margin: 0 2px; }

/* ---- Bottom corner ---- */
.login-foot {
  font-size: 12px;
  color: var(--subtle, #A8A29E);
  text-align: center;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .login-page { padding: 18px 18px; }
  .login-stage { padding: 24px 0; }
  .login-card { padding: 20px 18px 18px; }
  .login-mark { margin-bottom: 24px; }
  .login-headline { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-status-dot { animation: none; }
  .login-submit:hover svg { transform: none; }
}

/* ---- Toolbar search: единый вид ---- */
.toolbar-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.toolbar-search input[type="search"]::placeholder {
  color: var(--subtle);
}

/* ---- Cards on secondary pages ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}

/* ---- Scrollbar (тонкий) ---- */
.main,
.table-scroll,
.side-panel .panel-body,
.help-drawer-body {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.main::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.main::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

/* ---- Operational summary cards (manager-facing, light) ---- */
.ops-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 28px 16px;
}
.ops-summary__card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 104px;
  flex-direction: column;
  gap: 7px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ops-summary__card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--border-strong);
}
.ops-summary__card[data-tone="success"]::before { background: var(--success); }
.ops-summary__card[data-tone="info"]::before { background: var(--info); }
.ops-summary__card[data-tone="warn"]::before,
.ops-summary__card.is-attention::before { background: var(--warning); }
.ops-summary__card[data-tone="alert"]::before,
.ops-summary__card.is-alert::before { background: var(--danger); }
.ops-summary__card.is-attention {
  border-color: rgba(180, 83, 9, 0.28);
  background: #FFFBEB;
}
.ops-summary__card.is-alert {
  border-color: rgba(185, 28, 28, 0.28);
  background: #FEF2F2;
}
.ops-summary__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}
.ops-summary__value {
  color: var(--ink);
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ops-summary__hint {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.ops-summary__card.is-alert .ops-summary__label,
.ops-summary__card.is-alert .ops-summary__hint {
  color: #991B1B;
}
.ops-summary__card.is-attention .ops-summary__label,
.ops-summary__card.is-attention .ops-summary__hint {
  color: #92400E;
}
.ops-summary__of,
.ops-summary__unit {
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 600;
}
.ops-summary-wrap {
  margin: 0 28px 16px;
}
.ops-summary-wrap .ops-summary {
  margin: 0;
}

@media (max-width: 1180px) {
  .ops-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .ops-summary,
  .ops-summary-wrap {
    margin-right: 16px;
    margin-left: 16px;
  }
  .ops-summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .ops-summary__card {
    min-height: 96px;
    padding: 14px 14px;
  }
  .ops-summary__value {
    font-size: 26px;
  }
}
@media (max-width: 440px) {
  .ops-summary {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   TRUCKS PAGE — Clean flat TMS work-log
   ============================================================ */

/* Table actions: always visible, compact */
.page[data-page="trucks"] .row-actions {
  opacity: 1;
  gap: 6px;
}
.page[data-page="trucks"] .row-act-btn--primary {
  display: none;
}

/* "Открыть" button — visible row action */
.btn-sm {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn-sm:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-sm:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

/* Three-dot menu button */
.row-act-menu {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.row-act-menu:hover {
  background: var(--bg);
  color: var(--ink);
}

/* Route hint (secondary text under route) */
.truck-route-hint {
  display: block;
  font-size: 11.5px;
  color: var(--subtle);
  margin-top: 0;
  line-height: 1.2;
}

/* Fleet composition list in right rail */
.fleet-comp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fleet-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 8px 0;
}
.fleet-comp-row + .fleet-comp-row {
  border-top: 1px solid var(--border);
}
.fleet-comp-label {
  color: var(--muted);
}
.fleet-comp-value {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---- Mobile card-list (hidden on desktop) ---- */
.truck-card-list {
  display: none;
}

@media (max-width: 767px) {
  .table-scroll {
    display: none;
  }
  .truck-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
  }
  .truck-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .truck-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .truck-card-code {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
  }
  .truck-card-code:hover {
    color: var(--accent);
  }
  .truck-card-route {
    font-size: 13px;
    color: var(--muted);
  }
  .truck-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--subtle);
  }
  .truck-card-actions {
    margin-top: 4px;
  }
}

/* ---- Toast: только success/info получают data-tags, ошибки остаются тёмными ---- */
.toast[data-tags*="success"] {
  background: var(--success);
}
.toast[data-tags*="info"] {
  background: var(--accent);
}

/* ============================================================
   WAREHOUSES PAGE — Operations Console (single-column facility log)
   ============================================================ */

:root {
  --wh-empty: #D6D3D1;
  --wh-low:   #06B6D4;
  --wh-mid:   #F59E0B;
  --wh-high:  #F97316;
  --wh-full:  #EF4444;
  --wh-hub:   #2563EB;
  --wh-trans: #B45309;
  --wh-ink2:  #0C0A09;
  --wh-grid:  rgba(28, 25, 23, 0.06);
}

/* ---- Console: stat strip ---- */

.wh-console {
  background: var(--wh-ink2);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.wh-console::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px);
  pointer-events: none;
}
.wh-console-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.wh-console-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.wh-console-eyebrow { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.wh-console-ts {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}
.wh-console-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.wh-console-stat {
  padding: 14px 18px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.wh-console-stat:first-child { border-left: 0; }
.wh-console-stat-lbl {
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.wh-console-stat-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.wh-console-stat-num {
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}
.wh-console-stat-num .wh-console-stat-pct {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  margin-left: 1px;
}
.wh-console-stat-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}
.wh-console-stat[data-tone="info"]   .wh-console-stat-num { color: #93C5FD; }
.wh-console-stat[data-tone="warn"]   .wh-console-stat-num { color: #FCD34D; }
.wh-console-stat[data-tone="danger"] .wh-console-stat-num { color: #FCA5A5; }
.wh-console-stat[data-tone="idle"]   .wh-console-stat-num { color: rgba(255, 255, 255, 0.55); }

@media (max-width: 900px) {
  .wh-console-grid { grid-template-columns: repeat(2, 1fr); }
  .wh-console-stat { padding: 14px 16px 14px; }
  .wh-console-stat:nth-child(3) { border-left: 0; }
  .wh-console-stat:nth-child(odd) { border-left: 0; }
}
@media (max-width: 540px) {
  .wh-console-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .wh-console-stat-num { font-size: 28px; }
  .wh-console-bar { padding: 9px 14px; font-size: 9.5px; }
}

/* ---- Facility list: single-column records ---- */

.wh-facility-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.wh-facility {
  display: grid;
  grid-template-columns: 78px 1fr 320px 220px;
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-height: 96px;
  flex-shrink: 0;
}
.wh-facility::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--wh-empty);
  transition: width 0.18s;
}
.wh-facility[data-status="low"]::before  { background: var(--wh-low); }
.wh-facility[data-status="mid"]::before  { background: var(--wh-mid); }
.wh-facility[data-status="high"]::before { background: var(--wh-high); }
.wh-facility[data-status="full"]::before { background: var(--wh-full); }
.wh-facility:hover {
  border-color: rgba(28, 25, 23, 0.16);
  box-shadow: 0 4px 16px -8px rgba(28, 25, 23, 0.10);
}
.wh-facility:hover::before { width: 4px; }
.wh-facility.is-hidden { display: none; }

/* ID block: black slab on the left */
.wh-facility-id {
  background: var(--wh-ink2);
  color: #fff;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.16em;
  position: relative;
  text-align: center;
}
.wh-facility-id::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.wh-facility-id-lbl {
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-weight: 500;
  margin-bottom: 4px;
}
.wh-facility-id-num {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Main block: type pill, status LED, name, location */
.wh-facility-main {
  padding: 14px 20px 14px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.wh-facility-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wh-facility-type {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(87, 83, 78, 0.08);
  color: #57534E;
}
.wh-facility-type[data-type="hub"] {
  background: rgba(37, 99, 235, 0.10);
  color: var(--wh-hub);
}
.wh-facility-type[data-type="transit"] {
  background: rgba(180, 83, 9, 0.10);
  color: var(--wh-trans);
}
.wh-facility-updated {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted, #57534E);
  font-variant-numeric: tabular-nums;
}
.wh-facility-updated svg { opacity: 0.55; }
.wh-facility-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted, #57534E);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 10px;
}
.wh-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wh-empty);
  box-shadow: 0 0 0 2px transparent;
  position: relative;
  flex-shrink: 0;
}
.wh-led::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: led-pulse 2.4s ease-in-out infinite;
}
.wh-facility[data-status="low"]  .wh-led { background: var(--wh-low); }
.wh-facility[data-status="mid"]  .wh-led { background: var(--wh-mid); }
.wh-facility[data-status="high"] .wh-led { background: var(--wh-high); }
.wh-facility[data-status="full"] .wh-led { background: var(--wh-full); }
@keyframes led-pulse {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 0.45; transform: scale(1); }
}
.wh-facility[data-status="empty"] .wh-led { background: var(--wh-empty); }
.wh-facility[data-status="empty"] .wh-led::after { animation: none; }

.wh-facility-name {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 2px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wh-facility-name a {
  color: inherit;
  text-decoration: none;
}
.wh-facility-name a:hover { color: var(--accent); }
.wh-facility-loc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted, #57534E);
  font-variant-numeric: tabular-nums;
}
.wh-facility-loc svg { opacity: 0.55; flex-shrink: 0; }

/* Gauge block: tick-marked horizontal bar */
.wh-facility-gauge {
  padding: 14px 22px 14px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-left: 1px solid var(--border);
  background: rgba(28, 25, 23, 0.012);
}
.wh-gauge-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.wh-gauge-num {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.wh-gauge-num .wh-gauge-pct {
  font-size: 14px;
  color: var(--muted, #57534E);
  font-weight: 500;
  margin-left: 1px;
}
.wh-gauge-lbl {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #57534E);
  font-weight: 500;
}
.wh-gauge-rail {
  position: relative;
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    var(--wh-grid) 0,
    var(--wh-grid) 1px,
    transparent 1px,
    transparent 6px
  ),
  rgba(28, 25, 23, 0.04);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.wh-gauge-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.wh-gauge-tick-label {
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9px;
  color: var(--muted, #57534E);
  font-weight: 500;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.wh-gauge-fill {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  background: var(--wh-empty);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.wh-gauge-fill[data-status="low"]  { background: var(--wh-low); }
.wh-gauge-fill[data-status="mid"]  { background: var(--wh-mid); }
.wh-gauge-fill[data-status="high"] { background: var(--wh-high); }
.wh-gauge-fill[data-status="full"] { background: var(--wh-full); }

/* Metrics block */
.wh-facility-metrics {
  padding: 14px 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.wh-facility-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  border-left: 1px solid var(--border);
}
.wh-facility-metric:first-child { border-left: 0; padding-left: 0; }
.wh-facility-metric-lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #57534E);
  font-weight: 500;
}
.wh-facility-metric-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.wh-facility-metric-val--mono {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 500;
  font-size: 13px;
}

/* Actions block */
.wh-facility-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--wh-ink2);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.wh-facility-actions .cb-wrap {
  margin-right: 4px;
}
.wh-facility-actions .cb {
  width: 16px;
  height: 16px;
  accent-color: #fff;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}
.wh-facility-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 5px;
  text-decoration: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: inherit;
  white-space: nowrap;
}
.wh-facility-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.wh-facility-btn--primary {
  background: #fff;
  color: var(--wh-ink2);
  border-color: #fff;
  font-weight: 600;
}
.wh-facility-btn--primary:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--wh-ink2);
  border-color: #fff;
}

/* ---- Responsive: collapse to 1 column under 1100px ---- */

@media (max-width: 1100px) {
  .wh-facility { grid-template-columns: 64px 1fr 240px; }
  .wh-facility-actions { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 10px 18px; justify-content: flex-end; }
  .wh-facility-metrics { display: none; }
}
@media (max-width: 820px) {
  .wh-facility { grid-template-columns: 56px 1fr; min-height: 0; }
  .wh-facility-id-num { font-size: 14px; }
  .wh-facility-main { padding: 12px 16px 12px 14px; }
  .wh-facility-name { font-size: 18px; white-space: normal; }
  .wh-facility-gauge {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 10px 16px 12px;
  }
  .wh-gauge-num { font-size: 20px; }
  .wh-facility-actions { padding: 10px 14px; gap: 6px; }
  .wh-facility-btn { flex: 1; }
}
@media (max-width: 540px) {
  .wh-facility-head { gap: 6px; }
  .wh-facility-status { font-size: 9px; }
  .wh-facility-type { font-size: 9px; padding: 2px 5px; }
  .wh-facility-updated { display: none; }
  .wh-gauge-tick-label { font-size: 8px; }
  .wh-console { border-radius: 8px; }
  .wh-console-stat { padding: 12px 12px 12px; }
  .wh-console-stat-num { font-size: 24px; }
}

/* ---- Adaptive by viewport HEIGHT: keep the WH list visible ---- */
@media (max-height: 760px) {
  .wh-facility { min-height: 80px; }
  .wh-facility-id { padding: 12px 10px; }
  .wh-facility-id-num { font-size: 15px; }
  .wh-facility-main { padding: 10px 16px 10px 18px; }
  .wh-facility-name { font-size: 17px; }
  .wh-facility-gauge { padding: 8px 16px 10px; }
  .wh-facility-actions { padding: 8px 14px; }
  .wh-facility-btn { padding: 5px 10px; font-size: 12px; }
}
@media (max-height: 600px) {
  .wh-facility { min-height: 68px; }
  .wh-facility-id { padding: 8px 8px; }
  .wh-facility-id-lbl { font-size: 8px; margin-bottom: 2px; }
  .wh-facility-id-num { font-size: 13px; }
  .wh-facility-name { font-size: 15px; }
  .wh-facility-main { padding: 8px 14px 8px 16px; }
  .wh-facility-head { gap: 4px; margin-bottom: 4px; }
}

/* ---- No-results ---- */

.wh-no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted, #57534E);
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.wh-no-results strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; }

/* ---- Empty state ---- */
.wh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px 56px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin-top: 14px;
  position: relative;
  overflow: hidden;
}
.wh-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(28, 25, 23, 0.02) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(28, 25, 23, 0.02) 19px 20px);
  pointer-events: none;
}
.wh-empty-illu {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.06);
  color: var(--accent);
  margin-bottom: 20px;
}
.wh-empty-title {
  position: relative;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.wh-empty-desc {
  position: relative;
  font-size: 14px;
  color: var(--muted, #57534E);
  margin: 0 0 24px;
  max-width: 420px;
  line-height: 1.55;
}

/* ---- Bulk bar (warehouses) ---- */
.wh-bulk-bar {
  position: sticky;
  top: 64px;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  margin-top: 12px;
  background: var(--wh-ink2);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 8px 24px -8px rgba(28, 25, 23, 0.30);
  font-variant-numeric: tabular-nums;
}
.wh-bulk-bar.is-active,
.app-viewport[data-bulk="active"] .wh-bulk-bar,
.app-viewport[data-bulk="active"] .wh-bulk-bar.is-inline {
  display: flex;
}
.wh-bulk-bar .bulk-count strong { font-weight: 600; }
.wh-bulk-bar .bulk-actions { display: flex; gap: 6px; }
.wh-bulk-bar .bulk-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.wh-bulk-bar .bulk-btn:hover { background: rgba(255, 255, 255, 0.16); }
.wh-bulk-bar .bulk-clear-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.15s;
  font-family: inherit;
}
.wh-bulk-bar .bulk-clear-btn:hover { color: #fff; }

/* ---- Modal (form to add warehouse) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; animation: modal-fade 0.16s ease-out; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.55);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.40);
  animation: modal-rise 0.20s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.modal-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted, #57534E);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--border); color: var(--ink); }
.modal-form {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  overflow-y: auto;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.modal-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #57534E);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-field input,
.modal-field textarea,
.modal-field select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.modal-field input:focus,
.modal-field textarea:focus,
.modal-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.modal-field textarea { height: auto; min-height: 80px; padding: 8px 12px; }
.modal-field-help { font-size: 11.5px; color: var(--subtle, #78716C); }
.modal-field-error { font-size: 12px; color: var(--danger); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  background: rgba(28, 25, 23, 0.015);
}
.modal-foot .btn { height: 36px; }

@media (prefers-reduced-motion: reduce) {
  .modal.is-open,
  .modal-card { animation: none; }
  .wh-console-pulse,
  .wh-led::after { animation: none; }
  .wh-gauge-fill { transition: none; }
}

/* ============================================================
   WAREHOUSES — reference match pass
   ============================================================ */
.page[data-page="warehouses"] {
  background: #fbfbfa;
}

.page[data-page="warehouses"] .page-head {
  padding: 28px 28px 20px;
}

.page[data-page="warehouses"] .page-head h1 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page[data-page="warehouses"] .page-head .crumbs {
  margin-bottom: 12px;
  font-size: 13px;
}

.page[data-page="warehouses"] .page-head .sub {
  color: #34312d;
  font-size: 14px;
}

.page[data-page="warehouses"] .page-head-actions {
  gap: 12px;
  padding-top: 2px;
}

.page[data-page="warehouses"] .page-head-actions .btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 650;
}

.page[data-page="warehouses"] .page-head-actions .btn-primary {
  min-width: 150px;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
}

.page[data-page="warehouses"] .ops-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 28px 32px;
  gap: 22px;
}

.page[data-page="warehouses"] .ops-summary__card {
  min-height: 118px;
  padding: 18px 20px;
  border-color: #ddd9d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.page[data-page="warehouses"] .ops-summary__card::before {
  width: 0;
}

.page[data-page="warehouses"] .ops-summary__card.is-alert,
.page[data-page="warehouses"] .ops-summary__card.is-attention {
  background: #fff;
}

.page[data-page="warehouses"] .ops-summary__card:last-child::before {
  width: 3px;
  background: #3f73f4;
}

.page[data-page="warehouses"] .ops-summary__label {
  color: #4b4640;
  font-size: 13px;
  font-weight: 650;
}

.page[data-page="warehouses"] .ops-summary__value {
  color: #111;
  font-size: 31px;
  font-weight: 800;
}

.page[data-page="warehouses"] .ops-summary__of {
  color: #111;
  font-size: 0.72em;
  font-weight: 700;
}

.page[data-page="warehouses"] .ops-summary__hint {
  color: #5f5a54;
  font-size: 13px;
}

.page[data-page="warehouses"] .filter-bar {
  margin: 0 28px 18px;
  align-items: center;
  gap: 18px;
}

.page[data-page="warehouses"] .filter-bar .chips {
  flex: initial;
  gap: 0;
  padding: 3px;
  border: 1px solid #dedbd6;
  border-radius: 8px;
  background: #fff;
}

.page[data-page="warehouses"] .chip {
  height: 28px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #292522;
  font-size: 13px;
  font-weight: 650;
}

.page[data-page="warehouses"] .chip:hover {
  background: #fafafa;
}

.page[data-page="warehouses"] .chip.is-active,
.page[data-page="warehouses"] .chip[aria-pressed="true"] {
  background: #1f1f1f;
  color: #fff;
  box-shadow: 0 7px 16px -11px rgba(0, 0, 0, 0.72);
}

.page[data-page="warehouses"] .chip.is-active .chip-count,
.page[data-page="warehouses"] .chip[aria-pressed="true"] .chip-count {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.page[data-page="warehouses"] .chip-count {
  height: 18px;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5ff;
  color: currentColor;
  font-size: 11px;
}

.page[data-page="warehouses"] .filter-bar .toolbar {
  margin-left: auto;
}

.page[data-page="warehouses"] .filter-bar .toolbar-search {
  width: clamp(290px, 26vw, 320px);
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff;
  border-color: #dedbd6;
}

.wh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  padding: 0 28px 28px;
}

.wh-main {
  min-width: 0;
}

.page[data-page="warehouses"] .wh-table-card,
.page[data-page="warehouses"] .wh-side .cr-rail-card {
  border-color: #ddd9d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.page[data-page="warehouses"] .wh-table-card {
  overflow: hidden;
}

.page[data-page="warehouses"] .table-scroll {
  border-top: 0;
}

@media (min-width: 981px) {
  .page[data-page="warehouses"] .table-scroll {
    overflow-x: hidden;
  }
}

.page[data-page="warehouses"] .wh-table {
  min-width: 0;
  font-size: 13.5px;
}

.page[data-page="warehouses"] .wh-table col.col-wh-cb { width: 36px; }
.page[data-page="warehouses"] .wh-table col.col-wh-id { width: 250px; }
.page[data-page="warehouses"] .wh-table col.col-wh-loc { width: 115px; }
.page[data-page="warehouses"] .wh-table col.col-wh-fill { width: 140px; }
.page[data-page="warehouses"] .wh-table col.col-wh-products { width: 90px; }
.page[data-page="warehouses"] .wh-table col.col-wh-status { width: 80px; }
.page[data-page="warehouses"] .wh-table col.col-wh-action { width: 126px; }

.page[data-page="warehouses"] .wh-table thead th {
  height: 48px;
  padding: 0 14px;
  background: #fbfbfa;
  color: #625d56;
  font-size: 12px;
  font-weight: 650;
  border-bottom-color: #e4e0da;
}

.page[data-page="warehouses"] .wh-th-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.page[data-page="warehouses"] .wh-th-stack small {
  color: #8b857e;
  font-size: 10px;
  font-weight: 600;
}

.page[data-page="warehouses"] .wh-table tbody td {
  height: 88px;
  padding: 0 14px;
  border-bottom-color: #e8e4de;
}

.page[data-page="warehouses"] .wh-table tbody td:nth-child(3) {
  overflow: hidden;
  min-width: 0;
}

.page[data-page="warehouses"] .wh-table tbody tr {
  cursor: pointer;
}

.page[data-page="warehouses"] .wh-table tbody tr:hover {
  background: #fafafa;
}

.page[data-page="warehouses"] .wh-table .cb-col {
  padding-left: 18px;
}

.wh-row.is-hidden {
  display: none;
}

.wh-code-cell {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.wh-code-cell .track-code {
  justify-self: start;
  padding: 4px 8px;
  border-color: #dedbd6;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 12.5px;
  font-weight: 800;
}

.wh-name-cell {
  min-width: 0;
}

.wh-name-cell a {
  display: block;
  overflow: hidden;
  color: #111;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wh-name-cell span {
  display: block;
  margin-top: 7px;
  color: #68625b;
  font-size: 13px;
}

.wh-location-cell {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.wh-pin {
  margin-top: 1px;
  color: #817b74;
}

.wh-location-cell strong {
  display: block;
  overflow: hidden;
  color: #111;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wh-location-cell span {
  display: block;
  margin-top: 7px;
  color: #68625b;
  font-size: 13px;
}

.wh-fill-cell {
  max-width: 132px;
}

.wh-fill-cell strong {
  display: block;
  margin-bottom: 7px;
  color: #111;
  font-size: 14px;
  font-weight: 800;
}

.wh-mini-gauge {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(28, 25, 23, 0.045) 0, rgba(28, 25, 23, 0.045) 1px, transparent 1px, transparent 5px),
    #f1efec;
}

.wh-mini-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d7d4d0;
}

.wh-mini-fill[data-status="low"] { background: #42bf66; }
.wh-mini-fill[data-status="mid"] { background: #f3b33d; }
.wh-mini-fill[data-status="high"],
.wh-mini-fill[data-status="full"] { background: #f05d62; }

.wh-mini-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #6e6962;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8px;
  font-weight: 700;
}

.wh-products-cell strong {
  display: block;
  color: #111;
  font-size: 13.5px;
  font-weight: 800;
}

.wh-products-cell span {
  display: block;
  margin-top: 7px;
  color: #68625b;
  font-size: 13px;
}

.wh-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #292522;
  font-size: 13.5px;
  font-weight: 650;
}

.wh-status-pill span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d7d4d0;
}

.wh-status-pill[data-status="low"] span { background: #42bf66; }
.wh-status-pill[data-status="mid"] span { background: #f3b33d; }
.wh-status-pill[data-status="high"] span,
.wh-status-pill[data-status="full"] span { background: #f05d62; }

.page[data-page="warehouses"] .row-actions {
  gap: 8px;
  opacity: 1;
}

.page[data-page="warehouses"] .row-open-btn {
  display: inline-flex;
  height: 34px;
  min-width: 78px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid #dedbd6;
  border-radius: 7px;
  background: #fff;
  color: #292522;
  font-size: 13px;
  font-weight: 750;
}

.page[data-page="warehouses"] .row-act-btn {
  width: 32px;
  height: 34px;
  border: 1px solid #dedbd6;
  border-radius: 7px;
  background: #fff;
  color: #292522;
}

.page[data-page="warehouses"] .table-foot {
  min-height: 56px;
  padding: 0 18px;
  color: #49443f;
  font-size: 13.5px;
}

.page[data-page="warehouses"] .table-foot > div:first-child .pager-current {
  display: inline;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.page[data-page="warehouses"] .pager-current {
  display: inline-grid;
  width: auto;
  min-width: 32px;
  height: 32px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #b7cffd;
  border-radius: 7px;
  background: #fff;
  color: #1d4ed8;
}

.page[data-page="warehouses"] .pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.page[data-page="warehouses"] .wh-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page[data-page="warehouses"] .wh-side .cr-rail-card {
  padding: 22px 22px 20px;
}

.page[data-page="warehouses"] .cr-rail-head {
  margin-bottom: 26px;
}

.page[data-page="warehouses"] .cr-rail-eyebrow {
  gap: 12px;
  color: #3c3834;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.page[data-page="warehouses"] .cr-rail-eyebrow-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #202020;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.page[data-page="warehouses"] .cr-rail-bars {
  gap: 20px;
}

.page[data-page="warehouses"] .cr-rail-row {
  margin-bottom: 12px;
  color: #2f2b27;
  font-size: 13.5px;
}

.page[data-page="warehouses"] .cr-rail-v {
  color: #111;
  font-weight: 800;
}

.page[data-page="warehouses"] .cr-rail-bar {
  height: 7px;
  background: #f0eeeb;
}

.page[data-page="warehouses"] .cr-rail-bar-fill[data-tone="success"] { background: #42bf66; }
.page[data-page="warehouses"] .cr-rail-bar-fill[data-tone="info"] { background: #3f73f4; }
.page[data-page="warehouses"] .cr-rail-bar-fill[data-tone="danger"] { background: #f05d62; }

.page[data-page="warehouses"] .cr-rail-rules {
  gap: 16px;
  color: #37322e;
  font-size: 13px;
  line-height: 1.45;
}

.page[data-page="warehouses"] .cr-rail-rules li {
  gap: 12px;
}

.page[data-page="warehouses"] .cr-rail-rules-mark {
  width: 20px;
  height: 20px;
  background: #fff;
  color: #4a4641;
  font-size: 10px;
}

.page[data-page="warehouses"] .wh-bulk-bar {
  position: static;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #0c0a09;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  font-size: 13px;
}

.page[data-page="warehouses"] .wh-bulk-bar.is-active,
.app-viewport[data-bulk="active"] .page[data-page="warehouses"] .wh-bulk-bar {
  display: flex;
}

.page[data-page="warehouses"] .wh-bulk-bar .bulk-actions {
  display: flex;
  gap: 6px;
}

.page[data-page="warehouses"] .wh-bulk-bar .bulk-btn,
.page[data-page="warehouses"] .wh-bulk-bar .bulk-clear-btn {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
}

.page[data-page="warehouses"] .wh-bulk-bar .bulk-clear-btn {
  margin-left: auto;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1280px) {
  .wh-layout {
    grid-template-columns: minmax(0, 1fr) 276px;
    gap: 18px;
  }
  .page[data-page="warehouses"] .wh-table col.col-wh-fill { width: 132px; }
  .page[data-page="warehouses"] .wh-table col.col-wh-id { width: 230px; }
}

@media (max-width: 980px) {
  .wh-layout {
    grid-template-columns: 1fr;
    padding: 0 20px 20px;
  }
  .page[data-page="warehouses"] .ops-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 20px 24px;
  }
  .page[data-page="warehouses"] .filter-bar {
    margin: 0 20px 18px;
  }
}

@media (max-width: 767px) {
  .page[data-page="warehouses"] .page-head {
    padding: 20px 16px 16px;
  }
  .page[data-page="warehouses"] .ops-summary {
    grid-template-columns: 1fr 1fr;
    margin: 0 16px 18px;
    gap: 10px;
  }
  .page[data-page="warehouses"] .filter-bar {
    margin: 0 16px 16px;
  }
  .page[data-page="warehouses"] .filter-bar .chips {
    max-width: 100%;
    overflow-x: auto;
  }
  .page[data-page="warehouses"] .filter-bar .toolbar,
  .page[data-page="warehouses"] .filter-bar .toolbar-search {
    width: 100%;
  }
  .wh-layout {
    padding: 0 16px 16px;
  }
}

/* ============================================================
   IMPORT — Inbound Cargo Bay
   ============================================================ */
.page[data-page="import"] .page-head h1 { letter-spacing: -0.02em; }

.import-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.import-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 0 transparent;
  transition: background var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.import-status[data-status="ready"] .import-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.import-status[data-status="ready"] { color: var(--accent-strong); border-color: var(--accent); }
.import-status[data-status="loading"] .import-status-dot {
  background: var(--ink);
  animation: imp-blink 0.9s ease-in-out infinite;
}
.import-status[data-status="loading"] { color: var(--ink); border-color: var(--ink); }
@keyframes imp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.imp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 0 20px 20px;
  flex-shrink: 0;
}
.imp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.imp-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 360px;
  padding: 56px 32px 32px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 18px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  overflow: hidden;
}
.imp-drop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  pointer-events: none;
  opacity: 0.6;
}
.imp-drop > * { position: relative; }
.imp-drop:hover {
  border-color: var(--ink);
  background: #FAFAF9;
}
.imp-drop.is-hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.005);
}
.imp-drop.is-loaded {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.imp-drop-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
}
.imp-drop-corner--tl { top: 14px; left: 14px; border-top-width: 2px; border-left-width: 2px; }
.imp-drop-corner--tr { top: 14px; right: 14px; border-top-width: 2px; border-right-width: 2px; }
.imp-drop-corner--bl { bottom: 14px; left: 14px; border-bottom-width: 2px; border-left-width: 2px; }
.imp-drop-corner--br { bottom: 14px; right: 14px; border-bottom-width: 2px; border-right-width: 2px; }

.imp-drop-eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.imp-drop-step {
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.imp-drop-step-sep { color: var(--border-strong); }
.imp-drop-step-label { color: var(--muted); }

.imp-drop-icon {
  color: var(--ink);
  margin-top: 4px;
}
.imp-drop.is-hover .imp-drop-icon { color: var(--accent-strong); }
.imp-drop.is-loaded .imp-drop-icon { color: var(--accent-strong); }

.imp-drop-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 4px;
}
.imp-drop-or {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.imp-drop-cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: transform var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.imp-drop:hover .imp-drop-cta { background: var(--accent-strong); }
.imp-drop.is-loaded .imp-drop-cta { background: var(--accent-strong); }

.imp-drop-foot {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.imp-drop.is-loaded .imp-drop-foot { color: var(--accent-strong); font-weight: 600; }
.imp-drop-input { display: none; }

.imp-target {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.imp-target-row { display: flex; gap: 12px; align-items: stretch; }
.imp-target-pick {
  position: relative;
  flex: 1;
}
.imp-target-pick select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 40px 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--motion-base) var(--ease);
}
.imp-target-pick select:hover,
.imp-target-pick select:focus { border-color: var(--ink); outline: none; }
.imp-target-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.imp-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  align-self: flex-start;
  min-width: 220px;
}
.imp-submit:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}
.imp-submit:disabled {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.imp-submit.is-loading .imp-submit-label::after {
  content: " · · ·";
  letter-spacing: 0.2em;
  animation: imp-dots 1.1s steps(4, end) infinite;
}
@keyframes imp-dots {
  0% { content: " ·"; }
  25% { content: " · ·"; }
  50% { content: " · · ·"; }
  75% { content: " · ·"; }
  100% { content: " ·"; }
}

.imp-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.imp-rail-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.imp-rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.imp-rail-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
}
.imp-rail-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.imp-rail-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.imp-rail-stats li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.imp-rail-stats li:last-child { border-bottom: 0; padding-bottom: 0; }
.imp-rail-stat-k {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.imp-rail-stat-v {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.imp-rail-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: rail-step;
}
.imp-rail-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
}
.imp-rail-step-dot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  text-transform: lowercase;
  letter-spacing: 0;
}

.imp-schema {
  margin: 8px 20px 32px;
  padding: 28px 28px 24px;
  background: #0C0A09;
  color: #FAFAF9;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.imp-schema::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 100%;
  pointer-events: none;
}
.imp-schema > * { position: relative; }
.imp-schema-head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
}
.imp-schema-eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.imp-schema-eyebrow .imp-drop-step { color: #FAFAF9; }
.imp-schema-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: #FAFAF9;
}
.imp-schema-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0;
  max-width: 60ch;
}

.imp-schema-sheet {
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.imp-schema-row {
  display: grid;
  grid-template-columns: 48px 1.4fr 0.7fr 1.6fr 0.6fr;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.imp-schema-row:last-child { border-bottom: 0; }
.imp-schema-row--head {
  padding: 8px 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.imp-schema-num { color: rgba(255,255,255,0.35); font-size: 11px; }
.imp-schema-key { color: #FAFAF9; font-weight: 600; }
.imp-schema-syn { color: rgba(255,255,255,0.55); }
.imp-schema-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.imp-schema-pill--str { background: rgba(56,189,248,0.15); color: #7DD3FC; }
.imp-schema-pill--int { background: rgba(34,197,94,0.15); color: #86EFAC; }
.imp-schema-pill--flt { background: rgba(168,85,247,0.15); color: #D8B4FE; }
.imp-schema-req {
  font-size: 14px;
  line-height: 1;
}
.imp-schema-req--yes { color: #F59E0B; }
.imp-schema-req--no { color: rgba(255,255,255,0.3); }

@media (max-width: 980px) {
  .imp-grid { grid-template-columns: 1fr; }
  .imp-schema-row {
    grid-template-columns: 32px 1.4fr 0.6fr 0.5fr;
  }
  .imp-schema-row [role="columnheader"]:nth-child(4),
  .imp-schema-row [role="cell"]:nth-child(4) { display: none; }
}
@media (max-width: 640px) {
  .imp-drop { min-height: 280px; padding: 40px 20px 20px; }
  .imp-drop-title { font-size: 24px; }
  .imp-schema-row {
    grid-template-columns: 24px 1fr 0.6fr;
  }
  .imp-schema-row [role="columnheader"]:nth-child(3),
  .imp-schema-row [role="cell"]:nth-child(3) { display: none; }
}

/* ============================================================
   SETTINGS — The Control Room
   ============================================================ */
.page[data-page="settings"] .page-head h1 { letter-spacing: -0.02em; }

.cr-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.cr-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: cr-pulse 1.6s ease-in-out infinite;
}
@keyframes cr-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.cr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 0 20px 32px;
}
.cr-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.cr-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 20px;
}
.cr-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.cr-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.cr-section-meta { flex: 1; min-width: 0; }
.cr-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
  color: var(--ink);
}
.cr-section-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}
.cr-section-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.cr-section-state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.cr-section-state[data-state="ok"] { background: rgba(34,197,94,0.12); color: #15803D; }
.cr-section-state[data-state="ok"] .cr-section-state-dot { background: #22C55E; }

.cr-env {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #FAFAF9;
}
.cr-env-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.cr-env-row:last-child { border-bottom: 0; }
.cr-env-row--full { display: block; }
.cr-env-key {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cr-env-var {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
.cr-env-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cr-env-val {
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  word-break: break-all;
  text-align: right;
}
.cr-env-row--full .cr-env-key { margin-bottom: 10px; }
.cr-env-template {
  margin: 0;
  padding: 12px 14px;
  background: var(--ink);
  color: #FAFAF9;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.cr-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.cr-foot code { font-size: 11px; }

.cr-sys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #FAFAF9;
}
.cr-sys-cell {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cr-sys-cell:nth-child(3n) { border-right: 0; }
.cr-sys-cell:nth-last-child(-n+3) { border-bottom: 0; }
.cr-sys-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cr-sys-v {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}

.cr-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cr-rail-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.cr-rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cr-rail-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
}
.cr-rail-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.cr-roles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cr-role {
  position: relative;
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color var(--motion-base) var(--ease);
}
.cr-role:hover { border-color: var(--ink); }
.cr-role-bar {
  width: 4px;
  flex-shrink: 0;
  background: var(--ink);
}
.cr-role[data-role="admin"] .cr-role-bar { background: #DC2626; }
.cr-role[data-role="manager"] .cr-role-bar { background: #2563EB; }
.cr-role[data-role="viewer"] .cr-role-bar { background: #6B7280; }
.cr-role-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}
.cr-role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.cr-role-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
.cr-role-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cr-role-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.5;
}
.cr-role-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cr-perm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cr-perm::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.cr-perm[data-on="1"] {
  background: rgba(34,197,94,0.1);
  color: #15803D;
}
.cr-perm[data-on="1"]::before { background: #22C55E; }
.cr-perm[data-on="0"] {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.cr-perm[data-on="0"]::before {
  background: transparent;
  border: 1px solid var(--border-strong);
}

.cr-rail-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cr-rail-stats li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.cr-rail-stats li:last-child { border-bottom: 0; padding-bottom: 0; }
.cr-rail-stat-k {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cr-rail-stat-v {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 980px) {
  .cr-grid { grid-template-columns: 1fr; }
  .cr-sys { grid-template-columns: repeat(2, 1fr); }
  .cr-sys-cell:nth-child(3n) { border-right: 1px solid var(--border); }
  .cr-sys-cell:nth-child(2n) { border-right: 0; }
  .cr-sys-cell:nth-last-child(-n+3) { border-bottom: 1px solid var(--border); }
  .cr-sys-cell:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 640px) {
  .cr-env-row { grid-template-columns: 1fr; }
  .cr-env-val { text-align: left; }
  .cr-sys { grid-template-columns: 1fr; }
  .cr-sys-cell { border-right: 0; }
  .cr-sys-cell { border-bottom: 1px solid var(--border); }
  .cr-sys-cell:last-child { border-bottom: 0; }
}

/* ============================================================
   DASHBOARD — Control Tower
   art-directed redesign: hero panel + 3 sides, action queue,
   fleet status board, weekly pulse, refined activity feed,
   command-style quick actions
   ============================================================ */

/* Tokens (use existing palette; expose dashboard-only vars) */
.dash {
  --dash-gap: 16px;
  --dash-pad: 20px;
  --dash-card-bg: var(--bg-card);
  --dash-card-bd: var(--border);
  --dash-card-bd-strong: var(--border-strong);
  --dash-ink: var(--ink);
  --dash-muted: var(--muted);
  --dash-subtle: var(--subtle);
  --dash-accent: var(--accent);
  --dash-accent-strong: var(--accent-strong);
  --dash-accent-soft: var(--accent-soft);
  --dash-ok: #22C55E;
  --dash-warn: #D97706;
  --dash-danger: #DC2626;
}

/* ---------- Header ---------- */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px var(--dash-pad) 10px;
  border-bottom: 1px solid var(--dash-card-bd);
  margin-bottom: var(--dash-gap);
}
.dash-head-text { min-width: 0; }
.dash-head-text .crumbs {
  font-size: 11px;
  font-weight: 600;
  color: var(--dash-subtle);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-head-text .crumbs a {
  color: var(--dash-muted);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease);
}
.dash-head-text .crumbs a:hover { color: var(--dash-ink); }
.dash-head-text .crumbs .sep { color: var(--dash-card-bd-strong); }
.dash-head-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--dash-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.dash-head-pre {
  font-weight: 400;
  color: var(--dash-muted);
}
.dash-greet { color: var(--dash-accent-strong); }
.dash-head-sub {
  margin: 0;
  font-size: 13px;
  color: var(--dash-muted);
  line-height: 1.5;
  max-width: 56ch;
}
.dash-head-sub-sep { color: var(--dash-subtle); margin: 0 4px; }

.dash-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dash-head-clock-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 8px;
}
.dash-head-clock-inline .dash-head-clock-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
}
.dash-head-clock-inline .dash-head-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--dash-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Hero (4-cell control board) ---------- */
.dash-hero {
  margin: 0 var(--dash-pad) var(--dash-gap);
}
.dash-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--dash-card-bd);
  border-radius: 16px;
  overflow: hidden;
  background: var(--dash-card-bg);
  position: relative;
  box-shadow: var(--shadow-card);
}
.dash-hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(28,25,23,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28,25,23,0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  border-radius: 16px;
  z-index: 0;
}
.dash-hero-grid > * { position: relative; z-index: 1; }

.dash-hero-main,
.dash-hero-side {
  text-decoration: none;
  color: inherit;
  position: relative;
  display: block;
  border-right: 1px solid var(--dash-card-bd);
  transition: background var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
  overflow: hidden;
}
.dash-hero-side:last-child,
.dash-hero-main { border-right: 0; }
.dash-hero-main:hover {
  background: #0A0A09;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.dash-hero-side { transition: background var(--motion-base) var(--ease); }
.dash-hero-side:hover { background: var(--bg); }

/* HERO MAIN — big cargo number */
.dash-hero-main {
  background: var(--dash-ink);
  color: #FAFAF9;
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.dash-hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dash-ok);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  animation: dash-blink 1.6s ease-in-out infinite;
}
.dash-hero-eyebrow-sep { color: rgba(255,255,255,0.25); }

.dash-hero-figure {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 2px;
}
.dash-hero-num {
  font-size: clamp(56px, 7vw, 84px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #FAFAF9;
  font-variant-numeric: tabular-nums;
}
.dash-hero-suffix {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  line-height: 1.25;
  letter-spacing: 0.01em;
  padding-bottom: 6px;
}

/* cargo breakdown bar */
.dash-hero-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  gap: 2px;
}
.dash-hero-bar-seg {
  height: 100%;
  display: block;
  min-width: 0;
  transition: filter var(--motion-base) var(--ease);
}
.dash-hero-bar-seg--wh { background: var(--dash-ok); }
.dash-hero-bar-seg--tr { background: #3B82F6; }
.dash-hero-bar-seg--np { background: var(--dash-danger); }
.dash-hero-bar-seg:first-child { border-radius: 4px 0 0 4px; }
.dash-hero-bar-seg:last-child { border-radius: 0 4px 4px 0; }

.dash-hero-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  font-size: 11.5px;
}
.dash-hero-legend li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255,255,255,0.7);
}
.dash-hero-legend--np { color: rgba(255,255,255,0.85); }
.dash-hero-legend-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  align-self: center;
}
.dash-hero-legend-swatch--wh { background: var(--dash-ok); }
.dash-hero-legend-swatch--tr { background: #3B82F6; }
.dash-hero-legend-swatch--np { background: var(--dash-danger); }
.dash-hero-legend-k {
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.dash-hero-legend-v {
  color: #FAFAF9;
  font-weight: 700;
  font-size: 12.5px;
}
.dash-hero-legend-p {
  color: rgba(255,255,255,0.4);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dash-hero-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
}
.dash-hero-foot-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dash-hero-foot-k {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.dash-hero-foot-v {
  font-size: 14px;
  font-weight: 700;
  color: #FAFAF9;
  font-variant-numeric: tabular-nums;
}
.dash-hero-foot-u {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-left: 2px;
}

/* SIDE PANELS — fleet / storage / clients */
.dash-hero-side {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dash-hero-side-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dash-subtle);
}
.dash-hero-side-figure {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: -2px;
}
.dash-hero-side-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
}
.dash-hero-side-of {
  font-size: 14px;
  color: var(--dash-subtle);
  font-weight: 600;
}
.dash-hero-side-of .mono { color: var(--dash-muted); }
.dash-hero-side-k {
  font-size: 11.5px;
  color: var(--dash-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: -2px;
}

.dash-hero-side-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--dash-card-bd);
  overflow: hidden;
  margin-top: 2px;
}
.dash-hero-side-bar-fill {
  display: block;
  height: 100%;
  background: var(--dash-accent);
  transition: width var(--motion-slow) var(--ease);
}

.dash-hero-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.dash-hero-side-list--two { gap: 6px; }
.dash-hero-side-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--dash-muted);
  padding: 4px 0;
  border-bottom: 1px dashed var(--dash-card-bd);
}
.dash-hero-side-list li:last-child { border-bottom: 0; }
.dash-hero-side-list-k {
  font-weight: 500;
  letter-spacing: 0.01em;
}
.dash-hero-side-list-v {
  color: var(--dash-ink);
  font-weight: 700;
  font-size: 12.5px;
}

/* warehouse stack (top warehouses by product count) */
.dash-hero-side-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}
.dash-hero-side-stack-row {
  display: grid;
  grid-template-columns: 1fr 50px auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  min-width: 0;
}
.dash-hero-side-stack-row--empty { color: var(--dash-subtle); }
.dash-hero-side-stack-name {
  color: var(--dash-ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-hero-side-stack-bar {
  display: block;
  height: 4px;
  background: var(--dash-card-bd);
  border-radius: 2px;
  overflow: hidden;
}
.dash-hero-side-stack-fill {
  display: block;
  height: 100%;
  background: var(--dash-accent);
}
.dash-hero-side-stack-v {
  font-size: 11px;
  font-weight: 700;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  text-align: right;
}

/* clients trend (mini sparkline) */
.dash-hero-side-trend {
  margin-top: 4px;
  height: 28px;
  color: var(--dash-accent);
}
.dash-hero-side-trend-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* hover affordance arrow */
.dash-hero-go {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 18px;
  color: rgba(255,255,255,0.45);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  line-height: 1;
  z-index: 2;
}
.dash-hero-side .dash-hero-go { color: var(--dash-subtle); }
.dash-hero-main:hover .dash-hero-go,
.dash-hero-side:hover .dash-hero-go {
  opacity: 1;
  transform: translateX(0);
}
.dash-hero-main:hover .dash-hero-go { color: #FAFAF9; }
.dash-hero-side:hover .dash-hero-go { color: var(--dash-accent-strong); }

/* ---------- Section heads (shared) ---------- */
.dash-now,
.dash-fleet,
.dash-tg,
.dash-pulse,
.dash-feed,
.dash-quick {
  margin: 0 var(--dash-pad) var(--dash-gap);
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 12px;
  padding: 14px 16px 16px;
  position: relative;
  min-width: 0;
}

.dash-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--dash-card-bd);
}
.dash-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--dash-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dash-section-title-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dash-accent);
  box-shadow: 0 0 0 3px var(--dash-accent-soft);
  animation: dash-blink 1.6s ease-in-out infinite;
}
.dash-section-sub {
  font-size: 11.5px;
  color: var(--dash-muted);
  margin: 4px 0 0;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.4;
}
.dash-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  background: var(--dash-ink);
  color: var(--bg);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.dash-section-link {
  font-size: 12px;
  color: var(--dash-accent-strong);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  transition: color var(--motion-fast) var(--ease);
  border-radius: 4px;
  padding: 2px 4px;
  margin-right: -4px;
}
.dash-section-link:hover { color: var(--dash-ink); background: var(--bg); }

/* ---------- Action queue ("Сейчас в работе") ---------- */
.dash-now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-now-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--dash-card-bd);
  border-left: 3px solid var(--dash-card-bd-strong);
  border-radius: 10px;
  background: var(--bg);
  transition:
    border-color var(--motion-base) var(--ease),
    background var(--motion-base) var(--ease),
    transform var(--motion-base) var(--ease);
}
.dash-now-item:hover {
  border-color: var(--dash-ink);
  background: var(--dash-card-bg);
  transform: translateX(2px);
}
.dash-now-item[data-priority="high"] {
  border-left-color: var(--dash-danger);
  background: linear-gradient(90deg, rgba(220,38,38,0.04) 0%, var(--bg) 60%);
}
.dash-now-item[data-priority="mid"] {
  border-left-color: var(--dash-warn);
  background: linear-gradient(90deg, rgba(217,119,6,0.04) 0%, var(--bg) 60%);
}
.dash-now-item[data-priority="low"] {
  border-left-color: var(--dash-ok);
  background: linear-gradient(90deg, rgba(34,197,94,0.04) 0%, var(--bg) 60%);
}

.dash-now-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dash-now-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  color: var(--dash-ink);
  flex-shrink: 0;
}
.dash-now-item[data-priority="high"] .dash-now-icon {
  background: var(--dash-danger);
  border-color: var(--dash-danger);
  color: #FFF;
}
.dash-now-item[data-priority="mid"] .dash-now-icon {
  background: var(--dash-warn);
  border-color: var(--dash-warn);
  color: #FFF;
}
.dash-now-item[data-priority="low"] .dash-now-icon {
  background: var(--dash-ok);
  border-color: var(--dash-ok);
  color: #FFF;
}
.dash-now-priority {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dash-muted);
  white-space: nowrap;
}
.dash-now-item[data-priority="high"] .dash-now-priority { color: var(--dash-danger); }
.dash-now-item[data-priority="mid"] .dash-now-priority { color: var(--dash-warn); }
.dash-now-item[data-priority="low"] .dash-now-priority { color: var(--dash-ok); }

.dash-now-body { min-width: 0; }
.dash-now-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dash-ink);
  letter-spacing: -0.005em;
  margin-bottom: 3px;
  text-transform: lowercase;
}
.dash-now-title::first-letter { text-transform: uppercase; }
.dash-now-text {
  font-size: 12px;
  color: var(--dash-muted);
  line-height: 1.45;
}

.dash-now-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--dash-ink);
  color: var(--bg);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.dash-now-cta:hover {
  background: var(--dash-accent-strong);
  transform: translateX(2px);
}
.dash-now-item[data-priority="low"] .dash-now-cta {
  background: var(--dash-ok);
}
.dash-now-item[data-priority="low"] .dash-now-cta:hover { background: var(--dash-ink); }

/* ---------- Fleet status board ---------- */
.dash-fleet-board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-fleet-row {
  display: grid;
  grid-template-columns: 160px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.dash-fleet-row:hover {
  border-color: var(--dash-ink);
  background: var(--dash-card-bg);
}
.dash-fleet-row--empty { color: var(--dash-subtle); text-align: center; }

.dash-fleet-row-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dash-ink);
}
.dash-fleet-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dash-subtle);
}
.dash-fleet-row-dot.is-transit { background: var(--dash-accent); box-shadow: 0 0 0 3px var(--dash-accent-soft); animation: dash-blink 1.8s ease-in-out infinite; }
.dash-fleet-row-dot.is-unload { background: var(--dash-warn); box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }
.dash-fleet-row-dot.is-loaded { background: #8B5CF6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.dash-fleet-row-dot.is-warehouse { background: var(--dash-ok); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.dash-fleet-row-dot.is-other { background: var(--dash-subtle); }

.dash-fleet-row-bar {
  display: block;
  height: 6px;
  background: var(--dash-card-bd);
  border-radius: 3px;
  overflow: hidden;
  min-width: 0;
}
.dash-fleet-row-bar-fill {
  display: block;
  height: 100%;
  background: var(--dash-accent);
  border-radius: 3px;
  transition: width var(--motion-slow) var(--ease);
}
.dash-fleet-row-bar-fill.is-transit { background: var(--dash-accent); }
.dash-fleet-row-bar-fill.is-unload { background: var(--dash-warn); }
.dash-fleet-row-bar-fill.is-loaded { background: #8B5CF6; }
.dash-fleet-row-bar-fill.is-warehouse { background: var(--dash-ok); }
.dash-fleet-row-bar-fill.is-other { background: var(--dash-subtle); }

.dash-fleet-row-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- Telegram widget ---------- */
.dash-tg-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-tg-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(34,197,94,0.1);
  color: #15803D;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  align-self: flex-start;
}
.dash-tg-bar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dash-ok);
  animation: dash-blink 1.4s ease-in-out infinite;
}
.dash-tg-bar-sep { color: rgba(21,128,61,0.4); }
.dash-tg-bar-meta {
  font-size: 10.5px;
  color: #15803D;
  letter-spacing: 0.06em;
  opacity: 0.8;
}
.dash-tg-stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--dash-card-bd);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.dash-tg-stats > div {
  padding: 14px 14px 12px;
  border-right: 1px solid var(--dash-card-bd);
}
.dash-tg-stats > div:last-child { border-right: 0; }
.dash-tg-stats dt {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dash-muted);
  margin-bottom: 6px;
}
.dash-tg-stats dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.dash-tg-foot {
  margin: 0;
  font-size: 11.5px;
  color: var(--dash-muted);
  line-height: 1.5;
}
.dash-tg-foot code {
  font-size: 10.5px;
  padding: 2px 5px;
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 4px;
  color: var(--dash-ink);
}

/* ---------- Pulse chart ---------- */
.dash-pulse-total {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dash-muted);
  margin-top: 2px;
}
.dash-pulse-total-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--dash-ink);
  letter-spacing: -0.01em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.dash-pulse-total-k {
  font-weight: 600;
  font-size: 10px;
  color: var(--dash-subtle);
}

.dash-pulse-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 140px;
  padding-top: 12px;
}
.dash-pulse-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  position: relative;
}
.dash-pulse-col-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dash-pulse-col.is-empty .dash-pulse-col-value { color: var(--dash-subtle); }
.dash-pulse-col-bar {
  flex: 1;
  width: 100%;
  background: var(--bg);
  border: 1px dashed var(--dash-card-bd);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  min-height: 12px;
}
.dash-pulse-col-bar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dash-card-bd-strong);
  border-radius: 4px 4px 0 0;
  transition: height var(--motion-slow) var(--ease), background var(--motion-base) var(--ease);
  min-height: 4px;
}
.dash-pulse-col.is-today .dash-pulse-col-bar {
  background: var(--dash-accent-soft);
  border-color: var(--dash-accent);
  border-style: solid;
}
.dash-pulse-col.is-today .dash-pulse-col-bar-fill {
  background: var(--dash-accent);
}
.dash-pulse-col.is-empty .dash-pulse-col-bar-fill {
  background: var(--dash-card-bd-strong);
  min-height: 0;
}
.dash-pulse-col-day {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dash-muted);
}
.dash-pulse-col.is-today .dash-pulse-col-day { color: var(--dash-accent-strong); }
.dash-pulse-col:hover .dash-pulse-col-bar-fill { background: var(--dash-ink); }
.dash-pulse-col.is-today:hover .dash-pulse-col-bar-fill { background: var(--dash-accent-strong); }

/* ---------- Activity feed ---------- */
.dash-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-feed-item {
  display: grid;
  grid-template-columns: 72px 4px 1fr;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 4px 12px 0;
  border-bottom: 1px dashed var(--dash-card-bd);
}
.dash-feed-item:last-child { border-bottom: 0; }
.dash-feed-item--empty { color: var(--dash-muted); }
.dash-feed-time {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.dash-feed-time-h {
  font-size: 13px;
  font-weight: 700;
  color: var(--dash-ink);
  letter-spacing: -0.01em;
}
.dash-feed-time-d {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dash-subtle);
}
.dash-feed-rail {
  width: 3px;
  align-self: stretch;
  background: var(--dash-card-bd-strong);
  border-radius: 2px;
  margin: 4px 0;
}
.dash-feed-item:first-child .dash-feed-rail {
  background: var(--dash-accent);
}
.dash-feed-body { min-width: 0; }
.dash-feed-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--dash-ink);
  line-height: 1.45;
}
.dash-feed-link {
  color: var(--dash-ink);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid var(--dash-card-bd-strong);
  padding-bottom: 1px;
  transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
  font-size: 12.5px;
}
.dash-feed-link:hover {
  color: var(--dash-accent-strong);
  border-bottom-color: var(--dash-accent-strong);
}
.dash-feed-arrow {
  color: var(--dash-subtle);
  font-size: 11px;
}
.dash-feed-status {
  font-weight: 600;
  color: var(--dash-muted);
  font-size: 12.5px;
}
.dash-feed-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--dash-muted);
  margin-top: 4px;
  font-weight: 500;
}
.dash-feed-loc svg { color: var(--dash-subtle); flex-shrink: 0; }
.dash-feed-loc a { color: var(--dash-accent-strong); text-decoration: none; font-weight: 700; }
.dash-feed-loc a:hover { text-decoration: underline; }

/* ---------- Quick actions (command-style) ---------- */
.dash-quick-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.dash-quick-cell {
  background: var(--bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 10px;
  transition:
    background var(--motion-base) var(--ease),
    border-color var(--motion-base) var(--ease),
    transform var(--motion-base) var(--ease);
  overflow: hidden;
}
.dash-quick-cell:hover {
  border-color: var(--dash-ink);
  background: var(--dash-card-bg);
  transform: translateY(-1px);
}
.dash-quick-cell--primary {
  background: var(--dash-ink);
  border-color: var(--dash-ink);
}
.dash-quick-cell--primary:hover {
  background: var(--dash-accent-strong);
  border-color: var(--dash-accent-strong);
}
.dash-quick-link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--dash-ink);
  font-weight: 600;
  font-size: 12.5px;
  height: 100%;
  min-height: 60px;
}
.dash-quick-cell--primary .dash-quick-link { color: #FAFAF9; }
.dash-quick-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--dash-ink);
  border: 1px solid var(--dash-card-bd);
  flex-shrink: 0;
}
.dash-quick-cell--primary .dash-quick-icon {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
  color: #FAFAF9;
}
.dash-quick-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-quick-label {
  line-height: 1.2;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-quick-shortcut {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--dash-subtle);
  text-transform: uppercase;
}
.dash-quick-cell--primary .dash-quick-shortcut { color: rgba(255,255,255,0.5); }
.dash-quick-arrow {
  font-size: 16px;
  color: var(--dash-subtle);
  transition: transform var(--motion-base) var(--ease), color var(--motion-base) var(--ease);
}
.dash-quick-cell:hover .dash-quick-arrow {
  color: var(--dash-accent-strong);
  transform: translateX(2px);
}
.dash-quick-cell--primary .dash-quick-arrow { color: rgba(255,255,255,0.55); }
.dash-quick-cell--primary:hover .dash-quick-arrow { color: #FAFAF9; }

/* ---------- Blink keyframe (shared) ---------- */
@keyframes dash-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Responsive: tablet ---------- */
@media (max-width: 1180px) {
  .dash-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-hero-main {
    grid-column: 1 / -1;
  }
  .dash-hero-side {
    border-right: 0;
    border-bottom: 1px solid var(--dash-card-bd);
  }
  .dash-hero-side:nth-child(odd):not(:last-child) { border-right: 1px solid var(--dash-card-bd); }
  .dash-hero-side:last-child { border-bottom: 0; }
  .dash-quick-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Responsive: small tablet ---------- */
@media (max-width: 880px) {
  .dash-hero-grid { grid-template-columns: 1fr; }
  .dash-hero-main,
  .dash-hero-side {
    border-right: 0;
    border-bottom: 1px solid var(--dash-card-bd);
  }
  .dash-hero-side:last-child { border-bottom: 0; }
  .dash-fleet-row { grid-template-columns: 140px 1fr 44px; gap: 10px; }
  .dash-now-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dash-now-cta { justify-self: flex-start; }
  .dash-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Responsive: mobile ---------- */
@media (max-width: 640px) {
  .dash-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .dash-head-meta { align-self: stretch; justify-content: flex-end; }
  .dash-pulse-chart { gap: 6px; }
  .dash-pulse-col-day { font-size: 9px; }
  .dash-pulse-col-value { font-size: 10px; }
  .dash-hero-figure { gap: 10px; }
  .dash-hero-suffix { font-size: 11px; }
  .dash-now,
  .dash-fleet,
  .dash-tg,
  .dash-pulse,
  .dash-feed,
  .dash-quick,
  .dash-hero { margin-left: 12px; margin-right: 12px; }
  .dash-now,
  .dash-fleet,
  .dash-tg,
  .dash-pulse,
  .dash-feed,
  .dash-quick { padding: 16px; }
  .dash-hero-main, .dash-hero-side { padding: 16px; }
  .dash-quick-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-hero-eyebrow-dot,
  .dash-section-title-pulse,
  .dash-fleet-row-dot.is-transit,
  .dash-tg-bar-dot,
  .dash-pulse-col:hover .dash-pulse-col-bar-fill,
  .dash-pulse-col.is-today .dash-pulse-col-bar-fill { animation: none !important; }
  .dash-now-item, .dash-quick-cell, .dash-hero-main, .dash-hero-side { transition: none !important; }
}

/* ---------- Dashboard IA revision: compact operations screen ---------- */
.dash-summary {
  margin: 0 var(--dash-pad) var(--dash-gap);
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 6px;
}
.dash-summary-card {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 10px 12px;
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-card-bd);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.dash-summary-card:hover {
  border-color: var(--dash-ink);
  background: var(--bg);
  transform: translateY(-1px);
}
.dash-summary-card--primary {
  background: var(--dash-card-bg);
  border-color: rgba(28, 25, 23, 0.18);
  color: var(--dash-ink);
}
.dash-summary-card--primary:hover {
  background: var(--bg);
  border-color: var(--dash-ink);
}
.dash-summary-card.is-alert {
  border-color: rgba(220, 38, 38, 0.52);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.10), var(--dash-card-bg) 64%);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.06);
}
.dash-summary-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--dash-muted);
}
.dash-summary-card--primary .dash-summary-k { color: var(--dash-muted); }
.dash-summary-v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--dash-ink);
  font-variant-numeric: tabular-nums;
}
.dash-summary-card--primary .dash-summary-v { color: var(--dash-ink); }
.dash-summary-card.is-alert .dash-summary-v { color: var(--dash-danger); }
.dash-summary-of {
  font-size: 13px;
  font-weight: 700;
  color: var(--dash-subtle);
  letter-spacing: -0.01em;
}
.dash-summary-card--primary .dash-summary-of { color: var(--dash-subtle); }
.dash-summary-v--status {
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.dash-summary-bot-label {
  font-size: 13px;
  font-weight: 700;
  color: #15803D;
}
.dash-summary-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--dash-ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
  flex-shrink: 0;
}
.dash-summary-meta {
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--dash-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-summary-card--primary .dash-summary-meta { color: var(--dash-muted); }

.dash-ops-grid {
  margin: 0 var(--dash-pad) var(--dash-gap);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: var(--dash-gap);
  align-items: start;
}
.dash-ops-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}
.dash-ops-grid .dash-fleet,
.dash-ops-grid .dash-tg,
.dash-ops-grid .dash-feed,
.dash-ops-grid .dash-quick,
.dash-ops-grid .dash-pulse {
  margin: 0;
}
.dash-now {
  box-shadow: 0 8px 20px -18px rgba(28, 25, 23, 0.4);
}
.dash-now .dash-section-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.dash-now-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.dash-now-item {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "marker body"
    "marker cta";
  align-items: start;
  gap: 6px 10px;
  padding: 9px 10px;
}
.dash-now-marker {
  grid-area: marker;
  width: auto;
  min-width: 72px;
}
.dash-now-body { grid-area: body; }
.dash-now-title {
  font-size: 12.5px;
}
.dash-now-text {
  font-size: 11.5px;
  line-height: 1.3;
}
.dash-now-cta {
  grid-area: cta;
  justify-self: flex-start;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}
.dash-ops-grid .dash-section-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.dash-ops-grid .dash-section-sub {
  max-width: 42ch;
}
.dash-ops-grid .dash-quick-grid {
  grid-template-columns: 1fr 1fr;
}
.dash-ops-grid .dash-quick-link {
  min-height: 46px;
  padding: 8px 12px;
}
.dash-ops-grid .dash-feed-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.dash-ops-grid .dash-tg-stats dd {
  font-size: 18px;
}
.dash-tg--compact {
  padding: 14px 16px 14px;
}
.dash-tg--compact .dash-section-head {
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.dash-tg--compact .dash-tg-bar {
  padding: 6px 10px;
  font-size: 11.5px;
  margin-bottom: 8px;
}
.dash-tg-stats--compact {
  grid-template-columns: 1fr 1fr;
}
.dash-tg-stats--compact > div {
  padding: 10px 12px 8px;
}
.dash-tg-stats--compact dd {
  font-size: 16px;
}
.dash-feed--compact {
  padding: 14px 16px 14px;
}
.dash-feed--compact .dash-section-head {
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.dash-feed--compact .dash-feed-item {
  padding: 8px 4px 8px 0;
}
.dash-quick--compact {
  padding: 14px 16px 14px;
}
.dash-quick--compact .dash-section-head {
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.dash-pulse {
  padding-bottom: 16px;
}
.dash-pulse .dash-section-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.dash-pulse-chart {
  height: 56px;
  gap: 6px;
  padding-top: 2px;
}
.dash-pulse-col {
  gap: 4px;
}
.dash-pulse-col-bar {
  min-height: 8px;
}
.dash-pulse--compact {
  padding: 14px 16px 12px;
}
.dash-pulse--compact .dash-section-title {
  font-size: 15px;
}
.dash-pulse--compact .dash-section-sub {
  font-size: 11px;
}
.dash-pulse--compact .dash-pulse-total {
  gap: 5px;
}
.dash-pulse--compact .dash-pulse-total-num {
  font-size: 17px;
}
.dash-pulse--compact .dash-pulse-total-k {
  font-size: 10px;
}
.dash-pulse--compact .dash-pulse-col-value,
.dash-pulse--compact .dash-pulse-col-day {
  font-size: 9.5px;
}
.dash-pulse-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px dashed var(--dash-card-bd);
  border-radius: 8px;
  color: var(--dash-muted);
  font-size: 11px;
  line-height: 1.4;
}
.dash-pulse-empty-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-card-bd);
  color: var(--dash-ink);
  font-weight: 700;
  flex-shrink: 0;
}
#app-viewport-shell[data-route="dashboard"] .help-fab {
  display: none;
}

@media (max-width: 1180px) {
  .dash-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dash-summary-card--bot {
    grid-column: 1 / -1;
    min-height: 60px;
  }
  .dash-ops-grid {
    grid-template-columns: 1fr;
  }
  .dash-ops-grid .dash-quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-ops-grid .dash-feed-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .dash-summary {
    grid-template-columns: 1fr;
    margin-left: 12px;
    margin-right: 12px;
  }
  .dash-summary-card,
  .dash-summary-card--bot {
    grid-column: auto;
    min-height: 72px;
  }
  .dash-ops-grid {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    margin-right: 12px;
  }
  .dash-ops-col {
    display: contents;
  }
  .dash-ops-grid .dash-quick { order: 1; }
  .dash-ops-grid .dash-fleet { order: 2; }
  .dash-ops-grid .dash-tg { order: 3; }
  .dash-ops-grid .dash-feed { order: 4; }
  .dash-ops-grid .dash-quick-grid {
    grid-template-columns: 1fr;
  }
  .dash-now-list,
  .dash-ops-grid .dash-feed-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .dash-now-list {
    grid-template-columns: 1fr;
  }
  .dash-now-item {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }
  .dash-now-marker,
  .dash-now-body,
  .dash-now-cta {
    grid-area: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-summary-card {
    transition: none !important;
  }
}

/* ============================================================
   PRODUCTS — Cargo Atlas
   ============================================================ */
.atlas-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.atlas-cell {
  position: relative;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--motion-base) var(--ease);
  overflow: hidden;
}
.atlas-cell:last-child { border-right: 0; }
.atlas-cell::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
  transition: background var(--motion-base) var(--ease);
}
.atlas-cell:hover { background: var(--bg); }
.atlas-cell:hover::after { background: var(--accent-strong); }
.atlas-cell--all::after { background: var(--ink); }
.atlas-cell--alert::after { background: #DC2626; }
.atlas-cell--alert:hover::after { background: #DC2626; }
.atlas-cell-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.atlas-cell-v {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.atlas-cell--alert .atlas-cell-v { color: #DC2626; }
.atlas-cell-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.t--atlas { font-size: 13px; }
.t--atlas thead th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}
.row-atlas { transition: background var(--motion-base) var(--ease); }
.row-atlas:hover { background: rgba(28,25,23,0.025); }
.row-atlas.is-selected { background: rgba(34,197,94,0.06); }
.row-track {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--motion-base) var(--ease), color var(--motion-base) var(--ease);
}
.row-track:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.row-track code { font-size: 12px; }

.row-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  white-space: nowrap;
}
.row-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.row-status--truck { background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.25); color: #1E40AF; }
.row-status--truck .row-status-dot { background: #2563EB; box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }
.row-status--cargo { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.25); color: #15803D; }
.row-status--cargo .row-status-dot { background: #16A34A; box-shadow: 0 0 0 2px rgba(22,163,74,0.18); }
.row-placement { margin-top: 6px; }
.row-placement-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  padding: 2px 6px;
  border-radius: 3px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.row-placement-pill--warehouse { color: #15803D; border-color: rgba(22,163,74,0.3); background: rgba(22,163,74,0.04); }
.row-placement-pill--truck { color: #1E40AF; border-color: rgba(37,99,235,0.3); background: rgba(37,99,235,0.04); }
.row-placement-pill--unplaced { color: #DC2626; border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.04); }

.cell-desc-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
}
.cell-desc-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.cell-desc-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.cell-desc-tag.mono { font-family: var(--font-mono, monospace); }
.cell-customer { text-decoration: none; color: inherit; display: block; }
.cell-customer:hover .cust-name { color: var(--accent-strong); }
.cust-name { font-size: 12.5px; font-weight: 600; color: var(--ink); transition: color var(--motion-base); }
.cust-org { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cell-dims { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.cell-dims strong { color: var(--ink); font-weight: 700; font-size: 13px; }
.cell-dims span { color: var(--ink); }
.cell-assignee {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink);
  text-decoration: none;
}
.cell-assignee--unassigned { color: var(--muted); font-weight: 600; }
.cell-assignee--unassigned:hover { color: var(--accent-strong); }
.mini-av {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.mini-av--empty { background: var(--bg); color: var(--muted); border: 1px dashed var(--border-strong); }

.atlas-empty {
  text-align: center;
  padding: 60px 20px !important;
}
.atlas-empty-mark {
  font-size: 64px;
  font-weight: 700;
  color: var(--border-strong);
  line-height: 1;
  margin-bottom: 16px;
  font-family: var(--font-display, system-ui);
}
.atlas-empty-title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 8px;
}
.atlas-empty-cta {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease);
}
.atlas-empty-cta:hover { background: var(--accent-strong); color: #FAFAF9; }

/* Table card to wrap products table */
.page[data-page="products"] .table-card {
  margin: 0 20px 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
}
.page[data-page="products"] .table-scroll { border: 0; }
.page[data-page="products"] .table-foot {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 18px;
}

@media (max-width: 980px) {
  .atlas-strip { grid-template-columns: repeat(2, 1fr); }
  .atlas-cell:nth-child(2) { border-right: 0; }
  .atlas-cell:nth-child(3), .atlas-cell:nth-child(4) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .dash-radar-v { font-size: 28px; }
  .dash-radar-v--xl { font-size: 40px; }
  .dash-radar-grid { grid-template-columns: 1fr; }
  .dash-radar-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .dash-radar-cell:last-child { border-bottom: 0; }
  .dash-feed-item { grid-template-columns: 56px 3px 1fr; gap: 10px; }
  .dash-quick-grid { grid-template-columns: 1fr; }
  .dash-bridge-stats { grid-template-columns: 1fr 1fr; }
  .dash-bridge-stats > div { border-right: 1px solid var(--border); border-bottom: 0; }
  .dash-bridge-stats > div:nth-child(2n) { border-right: 0; }
  .dash-bridge-stats > div:nth-child(3) { border-top: 1px solid var(--border); grid-column: 1 / -1; border-right: 0; }
  .atlas-strip { grid-template-columns: 1fr; }
  .atlas-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .atlas-cell:last-child { border-bottom: 0; }
}

/* ============================================================
   PRODUCTS — Cargo Register Console
   Reuses the wh-console rhythm (dark ops console + grid stats)
   so this page feels native to the rest of the admin panel.
   ============================================================ */

.cr-console {
  background: #0C0A09;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 0;
  margin: 0 28px 18px;
  position: relative;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.cr-console::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.025) 23px 24px);
  pointer-events: none;
}
.cr-console-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FAFAF9;
}
.cr-console-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: cr-pulse 2s ease-in-out infinite;
}
@keyframes cr-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.cr-console-eyebrow { color: #fff; font-weight: 700; }
.cr-console-ts {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-weight: 500;
}
.cr-console-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.cr-console-stat {
  padding: 18px 22px 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.cr-console-stat:first-child { border-left: 0; }
.cr-console-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  opacity: 0.92;
}
.cr-console-stat-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cr-console-stat-num {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}
.cr-console-stat-sub {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
  opacity: 0.75;
}
.cr-console-stat[data-tone="primary"] .cr-console-stat-num { color: #fff; }
.cr-console-stat[data-tone="success"]  .cr-console-stat-num { color: #BBF7D0; }
.cr-console-stat[data-tone="info"]    .cr-console-stat-num { color: #BFDBFE; }
.cr-console-stat[data-tone="warn"]    .cr-console-stat-num { color: #FDE68A; }
.cr-console-stat[data-tone="danger"]  .cr-console-stat-num { color: #FECACA; }
.cr-console-stat[data-tone="idle"]    .cr-console-stat-num { color: rgba(255, 255, 255, 0.7); }

/* ---- Layout: 2-col main + side rail ---- */
.cr-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  padding: 0 28px 28px;
  align-items: start;
}
.cr-main { min-width: 0; }
.cr-main .table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cr-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
}

.cr-rail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cr-rail-card--ghost {
  background: transparent;
  border-style: dashed;
}
.cr-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cr-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cr-rail-eyebrow-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--ink);
  color: #FAFAF9;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
}
.cr-rail-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cr-rail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.cr-rail-k { color: var(--muted); }
.cr-rail-v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cr-rail-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}
.cr-rail-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 240ms ease;
  background: var(--ink);
}
.cr-rail-bar-fill[data-tone="success"] { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.cr-rail-bar-fill[data-tone="info"]    { background: linear-gradient(90deg, #2563EB, #60A5FA); }
.cr-rail-bar-fill[data-tone="warn"]    { background: linear-gradient(90deg, #B45309, #FBBF24); }
.cr-rail-bar-fill[data-tone="danger"]  { background: linear-gradient(90deg, #B91C1C, #F87171); }
.cr-rail-bar-fill[data-tone="idle"]    { background: var(--border-strong); }

.cr-rail-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.cr-rail-rules li { display: flex; gap: 8px; }
.cr-rail-rules-mark {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border);
  margin-top: 1px;
}

/* ---- Empty state (table cell) ---- */
.cr-empty {
  text-align: center;
  padding: 60px 20px !important;
}
.cr-empty-illu {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--bg);
  color: var(--subtle);
  border: 1px solid var(--border);
}
.cr-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.cr-empty-desc {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 36ch;
  margin: 0 auto 16px;
  line-height: 1.5;
}

/* ---- Inline bulk-bar inside products table-card ---- */
.cr-bulk-bar {
  position: static;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  margin-top: 0;
  background: #0C0A09;
  color: #fff;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.cr-bulk-bar.is-active { display: flex; }
.app-viewport[data-bulk="active"] .cr-bulk-bar { display: flex; }
.cr-bulk-bar .bulk-count strong { font-weight: 600; }
.cr-bulk-bar .bulk-actions { display: flex; gap: 6px; }
.cr-bulk-bar .bulk-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.cr-bulk-bar .bulk-btn:hover { background: rgba(255, 255, 255, 0.16); }
.cr-bulk-bar .bulk-clear-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.15s;
  font-family: inherit;
}
.cr-bulk-bar .bulk-clear-btn:hover { color: #fff; }

/* ---- Filter bar refinements (parity with trucks/warehouses) ---- */
.page[data-page="products"] .filter-bar {
  margin: 0 28px 14px;
  padding: 0;
  gap: 12px;
  flex-wrap: wrap;
}
.page[data-page="products"] .filter-bar .chips {
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.page[data-page="products"] .filter-bar .toolbar {
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
}
.page[data-page="products"] .filter-bar .toolbar-search {
  width: clamp(180px, 28vw, 280px);
  min-width: 0;
}
@media (max-width: 900px) {
  .page[data-page="products"] .filter-bar { margin: 0 20px 12px; }
  .page[data-page="products"] .filter-bar .toolbar { margin-left: 0; width: 100%; }
  .page[data-page="products"] .filter-bar .toolbar-search { width: 100%; }
}
@media (max-width: 640px) {
  .page[data-page="products"] .filter-bar { margin: 0 16px 12px; }
}

/* ---- Subtle refinements for table cells used in this page ---- */
.page[data-page="products"] .t .cell-dims {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  align-items: flex-end;
}
.page[data-page="products"] .t .cell-dims strong {
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}
.page[data-page="products"] .t .cell-dims .muted { color: var(--subtle); }

/* ---- Column width tuning for products table ---- */
.page[data-page="products"] .t col.col-cb     { width: 36px; }
.page[data-page="products"] .t col.col-id     { width: 110px; }
.page[data-page="products"] .t col.col-prio   { width: 28px; }
.page[data-page="products"] .t col.col-desc   { width: auto; min-width: 240px; }
.page[data-page="products"] .t col.col-client { width: 200px; }
.page[data-page="products"] .t col.col-dims   { width: 110px; }
.page[data-page="products"] .t col.col-mgr    { width: 168px; }
.page[data-page="products"] .t col.col-act    { width: 72px; }

@media (max-width: 1180px) {
  .page[data-page="products"] .t col.col-client { width: 170px; }
  .page[data-page="products"] .t col.col-mgr    { width: 140px; }
  .page[data-page="products"] .t col.col-dims   { width: 96px; }
  .page[data-page="products"] .t col.col-desc   { min-width: 220px; }
}

@media (max-width: 1180px) {
  .cr-layout { grid-template-columns: 1fr 280px; }
  .cr-side > * { min-width: 0; }
}
@media (max-width: 980px) {
  .cr-layout { grid-template-columns: 1fr; padding: 0 20px 20px; }
  .cr-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .cr-side > * { flex: 1 1 260px; min-width: 0; }
  .cr-console { margin: 0 20px 14px; }
}
@media (max-width: 767px) {
  .cr-layout { padding: 0 16px 16px; }
  .cr-console { margin: 0 16px 14px; }
  .cr-side { flex-direction: column; }
  .cr-side > * { flex: 1 1 auto; }
  .page[data-page="products"] .page-head { padding: 18px 20px 14px; flex-wrap: wrap; }
  .page[data-page="products"] .page-head h1 { font-size: 20px; }
  .page[data-page="products"] .page-head-actions { width: 100%; }
  .page[data-page="products"] .page-head-actions .btn { flex: 1; justify-content: center; min-width: 0; }
}
@media (max-width: 640px) {
  .cr-console-grid { grid-template-columns: 1fr 1fr; }
  .cr-console-stat { padding: 14px 16px 14px; }
  .cr-console-stat-num { font-size: 28px; }
  .cr-console-bar { padding: 9px 14px; font-size: 9.5px; }
  .cr-console { border-radius: 10px; }
}

/* ---- Products: mobile responsive for table & bulk bar ---- */
@media (max-width: 767px) {
  .page[data-page="products"] .cr-bulk-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-btn svg {
    display: none;
  }
  .page[data-page="products"] .table-foot {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }
}
@media (max-width: 480px) {
  .page[data-page="products"] .cr-bulk-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 12px;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-actions {
    justify-content: stretch;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
  .page[data-page="products"] .cr-bulk-bar .bulk-clear-btn {
    margin-left: 0;
    justify-content: center;
  }
  .page[data-page="products"] .table-foot {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .page[data-page="products"] .t { min-width: 540px; }
  .page[data-page="products"] .t thead th,
  .page[data-page="products"] .t tbody td { padding: 8px 6px; }
}

/* ============================================================
   PRODUCTS — reference match pass
   ============================================================ */
.page[data-page="products"] {
  background: #fbfbfa;
}

.page[data-page="products"] .page-head {
  padding: 28px 28px 20px;
}

.page[data-page="products"] .page-head h1 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page[data-page="products"] .page-head .crumbs {
  margin-bottom: 12px;
  font-size: 13px;
}

.page[data-page="products"] .page-head .sub {
  color: #34312d;
  font-size: 14px;
}

.page[data-page="products"] .page-head-actions {
  gap: 12px;
  padding-top: 2px;
}

.page[data-page="products"] .page-head-actions .btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 650;
}

.page[data-page="products"] .page-head-actions .btn-primary {
  min-width: 162px;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
}

.page[data-page="products"] .filter-bar {
  margin: 0 20px 26px;
  align-items: center;
  gap: 18px;
}

.page[data-page="products"] .filter-bar .chips {
  flex: initial;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.page[data-page="products"] .chip {
  height: 42px;
  padding: 0 18px;
  border: 1px solid #dedbd6;
  border-radius: 8px;
  background: #fff;
  color: #292522;
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.page[data-page="products"] .chip:hover {
  border-color: #cfcac3;
  background: #fff;
}

.page[data-page="products"] .chip.is-active,
.page[data-page="products"] .chip[aria-pressed="true"] {
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.7);
}

.page[data-page="products"] .chip[data-prod-filter="unplaced"]:not(.is-active):not([aria-pressed="true"]) {
  color: #dc2626;
}

.page[data-page="products"] .chip[data-prod-filter="warehouse"]:not(.is-active):not([aria-pressed="true"]) {
  color: #16a34a;
}

.page[data-page="products"] .chip[data-prod-filter="truck"]:not(.is-active):not([aria-pressed="true"]) {
  color: #2563eb;
}

.page[data-page="products"] .chip-count {
  height: 20px;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef3ff;
  color: currentColor;
  font-size: 11px;
}

.page[data-page="products"] .chip[aria-pressed="true"] .chip-count,
.page[data-page="products"] .chip.is-active .chip-count {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.page[data-page="products"] .filter-bar .toolbar {
  margin-left: auto;
}

.page[data-page="products"] .filter-bar .toolbar-search {
  width: clamp(340px, 32vw, 430px);
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff;
  border-color: #dedbd6;
}

.page[data-page="products"] .filter-bar .toolbar-search input {
  font-size: 13.5px;
}

.page[data-page="products"] .cr-layout {
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 16px;
  padding: 0 20px 28px;
}

.page[data-page="products"] .table-card,
.page[data-page="products"] .cr-rail-card {
  border-color: #ddd9d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.page[data-page="products"] .table-card {
  overflow: hidden;
}

.page[data-page="products"] .table-scroll {
  border-top: 0;
}

@media (min-width: 981px) {
  .page[data-page="products"] .table-scroll {
    overflow-x: hidden;
  }
}

.page[data-page="products"] .t {
  min-width: 900px;
  font-size: 13.5px;
}

.page[data-page="products"] .t col.col-cb     { width: 36px; }
.page[data-page="products"] .t col.col-id     { width: 86px; }
.page[data-page="products"] .t col.col-desc   { width: 206px; }
.page[data-page="products"] .t col.col-place  { width: 140px; }
.page[data-page="products"] .t col.col-client { width: 116px; }
.page[data-page="products"] .t col.col-dims   { width: 88px; }
.page[data-page="products"] .t col.col-mgr    { width: 114px; }
.page[data-page="products"] .t col.col-act    { width: 108px; }

.page[data-page="products"] .t thead th {
  height: 52px;
  padding: 0 12px;
  background: #fbfbfa;
  color: #625d56;
  font-size: 12px;
  font-weight: 650;
  border-bottom-color: #e4e0da;
}

.page[data-page="products"] .t tbody td {
  height: 66px;
  padding: 0 12px;
  border-bottom-color: #e8e4de;
}

.page[data-page="products"] .t tbody tr:hover {
  background: #fafafa;
}

.page[data-page="products"] .t thead th.cb-col,
.page[data-page="products"] .t tbody td.cb-col {
  padding-left: 18px;
}

.page[data-page="products"] .t thead th.num-col,
.page[data-page="products"] .t tbody td.num-col {
  text-align: left;
}

.page[data-page="products"] .t thead th.actions-col,
.page[data-page="products"] .t tbody td.actions-col {
  width: auto;
  padding-right: 18px;
  text-align: left;
}

.page[data-page="products"] .track-code {
  padding: 4px 7px;
  border-color: #dedbd6;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 12.5px;
  font-weight: 700;
}

.page[data-page="products"] .cell-subject {
  gap: 7px;
}

.page[data-page="products"] .cell-subject .subject-text {
  font-size: 14px;
  font-weight: 700;
}

.page[data-page="products"] .cell-subject .subject-meta {
  gap: 8px;
  font-size: 12px;
}

.page[data-page="products"] .badge {
  height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 650;
}

.page[data-page="products"] .badge.unplaced {
  color: #ef4444;
  background: #fee2e2;
  border-color: transparent;
}

.page[data-page="products"] .cell-place {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.page[data-page="products"] .cell-place strong {
  overflow: hidden;
  color: #111;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page[data-page="products"] .cell-place span,
.page[data-page="products"] .cell-place a {
  overflow: hidden;
  color: #69645e;
  font-size: 12.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page[data-page="products"] .cell-place a {
  color: #7b766f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page[data-page="products"] .cell-customer {
  gap: 9px;
}

.page[data-page="products"] .cell-customer .av {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.page[data-page="products"] .cell-customer .cust-name {
  font-size: 13.5px;
  font-weight: 700;
}

.page[data-page="products"] .cell-customer .cust-org {
  margin-top: 5px;
  color: #9a958e;
  font-size: 12px;
}

.page[data-page="products"] .t .cell-dims {
  align-items: flex-start;
  gap: 3px;
}

.page[data-page="products"] .t .cell-dims span {
  color: #111;
  font-size: 13px;
  font-weight: 650;
}

.page[data-page="products"] .cell-assignee {
  gap: 9px;
  color: #34312d;
  font-size: 13.5px;
}

.page[data-page="products"] .cell-assignee .mini-av {
  width: 22px;
  height: 22px;
  background: #d8d6d3;
  color: #fff;
  font-size: 10px;
}

.page[data-page="products"] .row-actions {
  gap: 5px;
  opacity: 1;
}

.page[data-page="products"] .row-open-btn {
  display: inline-flex;
  height: 34px;
  min-width: 76px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #dedbd6;
  border-radius: 7px;
  background: #fff;
  color: #292522;
  font-size: 12.5px;
  font-weight: 650;
}

.page[data-page="products"] .row-open-btn:hover {
  border-color: #c9c3bb;
  background: #fafafa;
}

.page[data-page="products"] .row-open-btn--danger {
  color: #dc2626;
}

.page[data-page="products"] .row-act-btn {
  width: 28px;
  height: 34px;
  border: 1px solid #dedbd6;
  border-radius: 7px;
  background: #fff;
  color: #292522;
}

.page[data-page="products"] .row-act-btn:hover {
  border-color: #c9c3bb;
  background: #fafafa;
}

.page[data-page="products"] .table-foot {
  min-height: 56px;
  padding: 0 18px;
  color: #49443f;
  font-size: 13.5px;
}

.page[data-page="products"] .table-foot > div:first-child .pager-current {
  display: inline;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.page[data-page="products"] .pager {
  gap: 8px;
}

.page[data-page="products"] .pager-btn,
.page[data-page="products"] .pager-current {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.page[data-page="products"] .pager-current {
  display: inline-grid;
  width: auto;
  min-width: 32px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #b7cffd;
  background: #fff;
  color: #1d4ed8;
}

.page[data-page="products"] .cr-side {
  gap: 20px;
}

.page[data-page="products"] .cr-rail-card {
  padding: 22px 22px 20px;
}

.page[data-page="products"] .cr-rail-head {
  margin-bottom: 26px;
}

.page[data-page="products"] .cr-rail-eyebrow {
  gap: 12px;
  color: #3c3834;
  font-size: 12px;
  font-weight: 750;
}

.page[data-page="products"] .cr-rail-eyebrow-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #202020;
  color: #fff;
  font-size: 12px;
}

.page[data-page="products"] .cr-rail-bars {
  gap: 20px;
}

.page[data-page="products"] .cr-rail-row {
  margin-bottom: 12px;
  color: #2f2b27;
  font-size: 13.5px;
}

.page[data-page="products"] .cr-rail-v {
  color: #111;
  font-weight: 800;
}

.page[data-page="products"] .cr-rail-bar {
  height: 7px;
  background: #f0eeeb;
}

.page[data-page="products"] .cr-rail-bar-fill[data-tone="success"] { background: #42bf66; }
.page[data-page="products"] .cr-rail-bar-fill[data-tone="info"] { background: #3f73f4; }
.page[data-page="products"] .cr-rail-bar-fill[data-tone="danger"] { background: #f05d62; }

.page[data-page="products"] .cr-rail-rules {
  gap: 15px;
  color: #37322e;
  font-size: 13px;
  line-height: 1.45;
}

.page[data-page="products"] .cr-rail-rules li {
  gap: 12px;
}

.page[data-page="products"] .cr-rail-rules-mark {
  width: 20px;
  height: 20px;
  background: #fff;
  color: #4a4641;
  font-size: 10px;
}

@media (max-width: 1280px) {
  .page[data-page="products"] .cr-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 18px;
  }
  .page[data-page="products"] .filter-bar .toolbar-search {
    width: clamp(260px, 28vw, 360px);
  }
}

@media (max-width: 980px) {
  .page[data-page="products"] .cr-layout {
    grid-template-columns: 1fr;
    padding: 0 20px 20px;
  }
  .page[data-page="products"] .cr-side {
    flex-direction: row;
  }
  .page[data-page="products"] .filter-bar {
    margin: 0 20px 20px;
  }
}

@media (max-width: 767px) {
  .page[data-page="products"] .page-head {
    padding: 20px 16px 16px;
  }
  .page[data-page="products"] .filter-bar {
    margin: 0 16px 16px;
  }
  .page[data-page="products"] .filter-bar .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .page[data-page="products"] .filter-bar .toolbar-search {
    width: 100%;
  }
  .page[data-page="products"] .cr-layout {
    padding: 0 16px 16px;
  }
}

/* ============================================================
   INVITES — Access Roster
   ============================================================ */
.page[data-page="invites"] .page-head h1 { letter-spacing: -0.02em; }

.ir-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.ir-generate:hover { background: var(--accent-strong); transform: translateY(-1px); }
.ir-generate-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.ir-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #FAFAF9;
}
.ir-summary-cell {
  position: relative;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.ir-summary-cell:last-child { border-right: 0; }
.ir-summary-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ir-summary-v {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ir-summary-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.ir-summary-cell--active .ir-summary-bar { background: var(--accent); }
.ir-summary-cell--used .ir-summary-bar { background: var(--border-strong); }
.ir-summary-cell--total .ir-summary-bar { background: var(--ink); }

.ir-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 32px;
}

.ir-card {
  display: grid;
  grid-template-columns: 130px 1fr 1.2fr 220px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.ir-card:hover { border-color: var(--ink); }
.ir-card[data-state="used"] { background: #FAFAF9; }
.ir-card[data-state="used"] .ir-code { color: var(--muted); }

.ir-card-id {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ir-card-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.ir-card-led {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 2px;
}
.ir-card-led--active { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ir-card-led--used { background: var(--border-strong); }

.ir-card-code { min-width: 0; }
.ir-code {
  display: inline-block;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.ir-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ir-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}
.ir-role::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.ir-role--admin { background: rgba(220,38,38,0.1); color: #B91C1C; }
.ir-role--admin::before { background: #DC2626; }
.ir-role--manager { background: rgba(37,99,235,0.1); color: #1D4ED8; }
.ir-role--manager::before { background: #2563EB; }
.ir-role--viewer { background: rgba(107,114,128,0.1); color: #4B5563; }
.ir-role--viewer::before { background: #6B7280; }

.ir-card-time {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
}
.ir-card-time-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ir-card-time-v { color: var(--ink); }

.ir-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ir-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ir-status--active { background: rgba(34,197,94,0.12); color: #15803D; }
.ir-status--used { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.ir-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.ir-copy:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ir-copy.is-copied { background: var(--accent-strong); border-color: var(--accent-strong); color: white; }

.ir-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.ir-empty-mark {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.ir-empty h3 { margin: 0 0 6px; font-size: 16px; }
.ir-empty p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .ir-summary { grid-template-columns: 1fr; }
  .ir-summary-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .ir-summary-cell:last-child { border-bottom: 0; }
  .ir-card { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .ir-card-action { justify-content: flex-start; }
}

/* ============================================================
   TEMPLATES — Status Lexicon
   ============================================================ */
.page[data-page="templates"] .page-head h1 { letter-spacing: -0.02em; }

.sl-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.sl-create:hover { background: var(--accent-strong); transform: translateY(-1px); color: white; }
.sl-create-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.sl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #FAFAF9;
}
.sl-stats-cell {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.sl-stats-cell:last-child { border-right: 0; }
.sl-stats-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-stats-v {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sl-lex {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 32px;
}

.sl-specimen {
  display: grid;
  grid-template-columns: 160px 1fr 220px 140px;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease);
}
.sl-specimen:hover { border-color: var(--ink); }

.sl-specimen-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sl-specimen-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.sl-specimen-name {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
  word-break: break-all;
}

.sl-specimen-bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}
.sl-specimen-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #FAFAF9;
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 0;
}
.sl-specimen-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 1px 5px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.sl-specimen-tag--uz { background: #2563EB; }
.sl-specimen-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  word-break: break-word;
}

.sl-specimen-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.sl-loc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sl-loc-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-loc-bars {
  display: flex;
  gap: 3px;
}
.sl-loc-bar {
  width: 18px;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.sl-loc-bar.is-on { background: var(--accent); border-color: var(--accent); }
.sl-loc-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.sl-type {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}
.sl-type--truck { background: rgba(37,99,235,0.1); color: #1D4ED8; }
.sl-type--product { background: rgba(34,197,94,0.1); color: #15803D; }

.sl-specimen-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.sl-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: background var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.sl-edit:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.sl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.sl-empty-mark {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.sl-empty h3 { margin: 0 0 6px; font-size: 16px; }
.sl-empty p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  .sl-specimen { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .sl-specimen-action { justify-content: flex-start; }
  .sl-stats { grid-template-columns: 1fr; }
  .sl-stats-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .sl-stats-cell:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
  .sl-specimen-bilingual { grid-template-columns: 1fr; }
}

/* ============================================================
   TELEGRAM — Telegram Bridge
   ============================================================ */
.page[data-page="telegram"] .page-head h1 { letter-spacing: -0.02em; }

.tb-bot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #229ED9;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--motion-base) var(--ease);
}
.tb-bot-link:hover { background: #1A8AC2; }

.tb-bridge {
  margin: 0 20px 16px;
  padding: 20px 24px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.tb-bridge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.tb-bridge-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.tb-bridge-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tb-bridge-state[data-state="ok"] {
  background: rgba(34,197,94,0.12);
  color: #15803D;
}
.tb-bridge-state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  animation: tb-blink 1.4s ease-in-out infinite;
}
@keyframes tb-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.tb-bridge-meter {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.tb-bridge-meter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tb-bridge-meter-k {
  font-size: 12px;
  color: var(--muted);
}
.tb-bridge-meter-v {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tb-bridge-bar {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.tb-bridge-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: 25% 100%;
  pointer-events: none;
  opacity: 0.4;
}
.tb-bridge-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 600ms var(--ease);
}
.tb-bridge-meter-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.tb-bridge-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tb-lang {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  gap: 6px 12px;
  padding: 12px 14px;
  background: #FAFAF9;
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items: center;
}
.tb-lang-tag {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.tb-lang-tag--uz { background: #2563EB; }
.tb-lang-v {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  align-self: end;
}
.tb-lang-bar {
  display: block;
  height: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  align-self: start;
}
.tb-lang-bar-fill {
  display: block;
  height: 100%;
  background: var(--ink);
}
.tb-lang-bar-fill--uz { background: #2563EB; }

.tb-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #FAFAF9;
}
.tb-strip-cell {
  position: relative;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.tb-strip-cell:last-child { border-right: 0; }
.tb-strip-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tb-strip-v {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tb-strip-pulse {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: tb-blink 1.4s ease-in-out infinite;
}

.tb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 20px 16px;
}
.tb-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--motion-base) var(--ease);
}
.tb-chip:hover { border-color: var(--ink); color: var(--ink); }
.tb-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.tb-chip-n {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.tb-search {
  flex: 0 0 280px;
  max-width: 280px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.tb-search:focus { outline: none; border-color: var(--ink); }

.tb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px 32px;
}

.tb-user {
  display: grid;
  grid-template-columns: 130px 1.4fr 1fr 60px 100px 100px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease);
}
.tb-user:hover { border-color: var(--ink); }

.tb-user-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-user-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tb-user-led--recent {
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
  animation: tb-blink 1.4s ease-in-out infinite;
}
.tb-user-led--week { background: #F59E0B; }
.tb-user-led--inactive { background: var(--border-strong); }
.tb-user-status-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tb-user-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-user-name-v {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-user-phone {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
}

.tb-user-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tb-user-id-k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 4px;
  background: #229ED9;
  color: white;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.tb-user-id-v {
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-user-lang {
  display: flex;
  justify-content: flex-start;
}
.tb-user-lang-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tb-user-lang-pill--ru { background: rgba(37,99,235,0.1); color: #1D4ED8; }
.tb-user-lang-pill--uz { background: rgba(34,197,94,0.1); color: #15803D; }

.tb-user-cargos,
.tb-user-since {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}
.tb-user-cargos-k,
.tb-user-since-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tb-user-cargos-v,
.tb-user-since-v {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.tb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.tb-empty-mark {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.tb-empty h3 { margin: 0 0 6px; font-size: 16px; }
.tb-empty p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  .tb-user { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tb-user-lang, .tb-user-id { grid-column: span 1; }
  .tb-user-cargos, .tb-user-since { text-align: left; }
  .tb-strip { grid-template-columns: 1fr 1fr; }
  .tb-strip-cell:nth-child(2n) { border-right: 0; }
  .tb-strip-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .tb-toolbar { flex-direction: column; align-items: stretch; }
  .tb-search { max-width: 100%; flex: 1; }
}
@media (max-width: 640px) {
  .tb-bridge-split { grid-template-columns: 1fr; }
  .tb-user { grid-template-columns: 1fr; }
  .tb-strip { grid-template-columns: 1fr; }
  .tb-strip-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .tb-strip-cell:last-child { border-bottom: 0; }
}

/* ============================================================
   INVENTORY — Storage Atlas
   ============================================================ */
.page[data-page="inventory"] .page-head h1 { letter-spacing: -0.02em; }

.inv-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: background var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.inv-export:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.inv-radar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0;
  margin: 0 20px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #FAFAF9;
}
.inv-radar-cell {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.inv-radar-cell:last-child { border-right: 0; }
.inv-radar-cell--primary {
  background: var(--ink);
  color: #FAFAF9;
}
.inv-radar-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.inv-radar-cell--primary .inv-radar-k { color: rgba(255,255,255,0.55); }
.inv-radar-v {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.inv-radar-cell--primary .inv-radar-v { color: #FAFAF9; }
.inv-radar-of { font-size: 0.5em; color: var(--muted); margin-left: 2px; }
.inv-radar-cell--primary .inv-radar-of { color: rgba(255,255,255,0.5); }
.inv-radar-meta { font-size: 11px; color: var(--muted); }
.inv-radar-cell--primary .inv-radar-meta { color: rgba(255,255,255,0.55); }
.inv-radar-meta b { color: var(--ink); }
.inv-radar-cell--primary .inv-radar-meta b { color: #FAFAF9; }

.inv-section {
  margin: 0 20px 24px;
}
.inv-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.inv-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.inv-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.inv-unit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.inv-unit:hover { border-color: var(--ink); transform: translateY(-1px); }

.inv-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inv-unit-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.inv-unit-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.inv-unit-led--empty { background: #D6D3D1; }
.inv-unit-led--low { background: #06B6D4; box-shadow: 0 0 0 2px rgba(6,182,212,0.15); }
.inv-unit-led--mid { background: #F59E0B; }
.inv-unit-led--high { background: #EF4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }
.inv-unit-led--active { background: #22C55E; animation: inv-blink 1.4s ease-in-out infinite; }
@keyframes inv-blink {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0.05); }
}

.inv-unit-name {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
  word-break: break-word;
}

.inv-unit-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.inv-unit-gauge-bar {
  position: relative;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.inv-unit-gauge-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: 25% 100%;
  pointer-events: none;
  opacity: 0.4;
}
.inv-unit-gauge-fill {
  display: block;
  height: 100%;
  transition: width 600ms var(--ease);
}
.inv-unit-gauge-fill[data-status="empty"] { background: #D6D3D1; }
.inv-unit-gauge-fill[data-status="low"] { background: #06B6D4; }
.inv-unit-gauge-fill[data-status="mid"] { background: #F59E0B; }
.inv-unit-gauge-fill[data-status="high"] { background: #EF4444; }
.inv-unit-gauge-ticks { position: relative; height: 0; }
.inv-unit-gauge-ticks span {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 3px;
  background: var(--muted);
  opacity: 0.4;
}
.inv-unit-gauge-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
}
.inv-unit-products { color: var(--muted); font-weight: 600; }

.inv-unit-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
}
.inv-unit-status {
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.inv-unit-time {
  color: var(--muted);
}

.inv-empty {
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
}
.inv-empty-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--bg);
  color: var(--subtle);
  border: 1px solid var(--border);
}
.inv-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.inv-empty-desc {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 36ch;
  margin: 0 auto 16px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .inv-radar { grid-template-columns: 1fr 1fr; }
  .inv-radar-cell--primary { grid-column: 1 / -1; }
  .inv-radar-cell { border-right: 1px solid var(--border); }
  .inv-radar-cell:nth-child(2n) { border-right: 0; }
}
@media (max-width: 640px) {
  .inv-radar { grid-template-columns: 1fr; }
  .inv-radar-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .inv-radar-cell:last-child { border-bottom: 0; }
  .inv-radar-v { font-size: 24px; }
}

/* ============================================================
   CALCULATOR — Tariff Engine
   ============================================================ */
.page[data-page="calculator"] .page-head h1 { letter-spacing: -0.02em; }
.tc-link { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.tc-link:hover { text-decoration: underline; }

.tc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  padding: 0 20px 32px;
  align-items: flex-start;
}

.tc-input { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.tc-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 20px;
}
.tc-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tc-block-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.tc-block-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--ink);
  text-transform: uppercase;
}

.tc-services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tc-service {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.tc-service input { position: absolute; opacity: 0; pointer-events: none; }
.tc-service:hover { border-color: var(--ink); }
.tc-service:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: #FAFAF9;
}
.tc-service-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  color: var(--ink);
  flex-shrink: 0;
}
.tc-service:has(input:checked) .tc-service-mark {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #FAFAF9;
}
.tc-service-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tc-service-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.tc-service:has(input:checked) .tc-service-name { color: #FAFAF9; }
.tc-service-desc {
  font-size: 11px;
  color: var(--muted);
}
.tc-service:has(input:checked) .tc-service-desc { color: rgba(255,255,255,0.55); }

.tc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tc-field-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tc-field-i {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color var(--motion-base) var(--ease);
}
.tc-field-i:focus { outline: none; border-color: var(--ink); }
.tc-field-i--select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.tc-run {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  text-transform: uppercase;
}
.tc-run:hover { background: var(--accent-strong); transform: translateY(-1px); }
.tc-run-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid white;
  border-radius: 50%;
  flex-shrink: 0;
}
.tc-run-pulse {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}
.tc-run-label { flex: 1; text-align: left; }
.tc-run-arrow { color: white; }

.tc-output { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.tc-total-card {
  position: relative;
  background: var(--ink);
  color: #FAFAF9;
  border-radius: 16px;
  padding: 24px 28px 28px;
  overflow: hidden;
}
.tc-total-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 100%;
  pointer-events: none;
}
.tc-total-card > * { position: relative; }
.tc-total-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(255,255,255,0.15);
}
.tc-total-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
}
.tc-total-state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #22C55E;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tc-total-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  animation: tc-blink 1.4s ease-in-out infinite;
}
@keyframes tc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.tc-total-v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}
.tc-total-currency {
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
}
.tc-total-number {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #FAFAF9;
  font-variant-numeric: tabular-nums;
}
.tc-total-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.tc-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 20px;
}
.tc-breakdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tc-breakdown-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: uppercase;
  color: var(--ink);
}
.tc-breakdown-count {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tc-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tc-breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.tc-breakdown-item:last-child { border-bottom: 0; }
.tc-breakdown-k { color: var(--ink); }
.tc-breakdown-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border);
  height: 1px;
  align-self: end;
  margin-bottom: 4px;
}
.tc-breakdown-v { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.tc-actions { display: flex; gap: 8px; }
.tc-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  transition: background var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.tc-action--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tc-action--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.tc-action--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.tc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 28px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.tc-empty-mark {
  font-size: 56px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.tc-empty h3 { margin: 0 0 6px; font-size: 16px; }
.tc-empty p { margin: 0 0 20px; color: var(--muted); font-size: 13px; max-width: 36ch; }
.tc-empty-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  max-width: 240px;
}
.tc-empty-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-empty-list .mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .tc-grid { grid-template-columns: 1fr; }
  .tc-total-number { font-size: 48px; }
}
@media (max-width: 640px) {
  .tc-services { grid-template-columns: 1fr; }
  .tc-fields { grid-template-columns: 1fr; }
  .tc-total-number { font-size: 40px; }
  .tc-actions { flex-direction: column; }
}

/* ============================================================
   LOAD TRUCK — Loading Manifest
   ============================================================ */
.page[data-page="load-truck"] .page-head h1 { letter-spacing: -0.02em; }

.lt-steps {
  list-style: none;
  margin: 0 20px 20px;
  padding: 16px 20px;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.lt-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  flex: 1;
  min-width: 0;
}
.lt-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.lt-step-k {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.lt-step-v {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-left: auto;
}
.lt-step--current .lt-step-num {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.lt-step--current .lt-step-k { color: var(--ink); }
.lt-step--current .lt-step-v { color: var(--accent-strong); font-weight: 700; }
.lt-step-sep {
  width: 24px;
  height: 1px;
  background: var(--border);
  align-self: center;
  flex-shrink: 0;
  position: relative;
}
.lt-step-sep::before {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  width: 4px;
  height: 4px;
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

.lt-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 32px;
}

.lt-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 20px;
}
.lt-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.lt-block-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.lt-block-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--ink);
  text-transform: uppercase;
}
.lt-block-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.lt-block-counter {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

.lt-trucks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.lt-truck {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.lt-truck input { position: absolute; opacity: 0; pointer-events: none; }
.lt-truck:hover { border-color: var(--ink); }
.lt-truck:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: #FAFAF9;
}
.lt-truck-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  flex-shrink: 0;
}
.lt-truck:has(input:checked) .lt-truck-mark {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #FAFAF9;
}
.lt-truck-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lt-truck-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
.lt-truck:has(input:checked) .lt-truck-num { color: #FAFAF9; }
.lt-truck-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.lt-truck:has(input:checked) .lt-truck-meta { color: rgba(255,255,255,0.6); }

.lt-route {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: end;
  gap: 12px;
}
.lt-route-stop {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lt-route-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 6px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.lt-route-tag--to { background: var(--accent-strong); }
.lt-route-stop select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.lt-route-stop select:focus { outline: none; border-color: var(--ink); }
.lt-route-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  align-self: end;
  margin-bottom: 8px;
}

.lt-products {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #FAFAF9;
  max-height: 420px;
  overflow-y: auto;
}
.lt-products-row {
  display: grid;
  grid-template-columns: 32px 1fr 1.6fr 1fr 100px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease);
}
.lt-products-row:last-child { border-bottom: 0; }
.lt-products-row--head {
  background: var(--bg-card);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
  position: sticky;
  top: 0;
  z-index: 1;
}
.lt-products-row:not(.lt-products-row--head):hover { background: var(--bg); }
.lt-products-row.is-picked { background: var(--accent-soft); }
.lt-products-row.is-picked .lt-pick { border-color: var(--accent-strong); }
.lt-pick { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.lt-products-track { font-size: 12px; color: var(--ink); font-weight: 600; }
.lt-products-desc { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-products-wh { color: var(--muted); font-size: 11px; }
.lt-products-num { text-align: right; font-size: 12px; }
.lt-products-avail { color: var(--ink); font-weight: 600; }
.lt-qty {
  width: 100%;
  padding: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  text-align: right;
}
.lt-qty:focus { outline: none; border-color: var(--ink); }
.lt-qty:disabled { opacity: 0.4; background: var(--bg-card); }

.lt-empty {
  padding: 30px 20px;
  text-align: center;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.lt-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--ink);
  border-radius: 14px;
  color: #FAFAF9;
}
.lt-submit-hint { font-size: 12px; color: rgba(255,255,255,0.55); max-width: 60%; }
.lt-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-base) var(--ease);
}
.lt-submit:hover { background: var(--accent-strong); }
.lt-submit-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: white;
  color: var(--accent);
  border-radius: 50%;
  font-size: 10px;
}

@media (max-width: 900px) {
  .lt-steps { flex-wrap: wrap; }
  .lt-step-sep { display: none; }
  .lt-route { grid-template-columns: 1fr; }
  .lt-route-arrow { transform: rotate(90deg); margin: 0 auto; }
  .lt-products-row { grid-template-columns: 24px 1fr 80px 80px; }
  .lt-products-row > *:nth-child(3), .lt-products-row > *:nth-child(4) { display: none; }
  .lt-submit-row { flex-direction: column; align-items: stretch; }
  .lt-submit-hint { max-width: 100%; }
}
@media (max-width: 640px) {
  .lt-products-row { grid-template-columns: 20px 1fr 70px; }
  .lt-products-row > *:nth-child(5) { display: none; }
  .lt-trucks { grid-template-columns: 1fr; }
}

/* ============================================================
   UNLOAD TRUCK — Arrival Bay
   ============================================================ */
.page[data-page="unload"] .page-head h1 { letter-spacing: -0.02em; }
.ab-counter {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ab-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px 32px;
}

.ab-truck {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color var(--motion-base) var(--ease);
}
.ab-truck:hover { border-color: var(--ink); }

.ab-truck-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #FAFAF9;
}
.ab-truck-id { display: flex; align-items: center; gap: 8px; }
.ab-truck-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.ab-truck-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ab-truck-led--active { background: #22C55E; animation: ab-blink 1.4s ease-in-out infinite; }
.ab-truck-led--arrived { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.ab-truck-led--loaded { background: #06B6D4; }
@keyframes ab-blink {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0.05); }
}

.ab-truck-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.ab-truck-arrow { color: var(--muted); font-weight: 400; }
.ab-truck-dest { font-size: 14px; color: var(--muted); font-weight: 500; }

.ab-state {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ab-state--active { background: rgba(34,197,94,0.12); color: #15803D; }
.ab-state--arrived { background: rgba(245,158,11,0.15); color: #B45309; }

.ab-truck-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ab-truck-stat {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px dashed var(--border);
}
.ab-truck-stat:last-child { border-right: 0; }
.ab-truck-stat-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ab-truck-stat-v {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.ab-cargo {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.ab-cargo-head { margin-bottom: 8px; }
.ab-cargo-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.ab-cargo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ab-cargo-item {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--border);
}
.ab-cargo-item:last-child { border-bottom: 0; }
.ab-cargo-item--more { color: var(--muted); font-size: 12px; }
.ab-cargo-track { color: var(--ink); font-weight: 600; font-size: 11.5px; }
.ab-cargo-desc { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-cargo-qty { text-align: right; color: var(--ink); font-weight: 600; font-size: 12px; }

.ab-truck-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #FAFAF9;
  flex-wrap: wrap;
}
.ab-accept {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
.ab-accept-wh {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ab-accept-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ab-accept-wh select {
  padding: 6px 26px 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.ab-accept-wh select:focus { outline: none; border-color: var(--ink); }

.ab-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  transition: background var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.ab-action--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ab-action--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.ab-action--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.ab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  margin: 0 20px 32px;
}
.ab-empty-mark {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.ab-empty h3 { margin: 0 0 6px; font-size: 16px; }
.ab-empty p { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .ab-truck-head { flex-wrap: wrap; }
  .ab-truck-name { flex-basis: 100%; order: 2; }
  .ab-truck-id { order: 1; }
  .ab-truck-state { order: 3; margin-left: auto; }
  .ab-truck-body { grid-template-columns: 1fr; }
  .ab-truck-stat { border-right: 0; border-bottom: 1px dashed var(--border); }
  .ab-truck-stat:last-child { border-bottom: 0; }
  .ab-cargo-item { grid-template-columns: 100px 1fr 80px; }
  .ab-truck-foot { flex-direction: column; align-items: stretch; }
  .ab-accept { margin-left: 0; }
}

/* =====================================================================
   CLIENTS PAGE — Client Registry
   ===================================================================== */

.cl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cl-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.cl-eyebrow-sep { color: var(--border-strong); }
.cl-eyebrow-meta { color: var(--subtle); font-weight: 500; letter-spacing: 0.04em; }

/* ---- Stat strip ---- */
.cl-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
}
.cl-strip-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  border-right: 1px dashed var(--border);
}
.cl-strip-cell:last-child { border-right: 0; }
.cl-strip-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cl-strip-v {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cl-strip-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--ink);
}
.cl-strip-cell--total .cl-strip-bar { width: 100%; background: var(--ink); }
.cl-strip-cell--active .cl-strip-bar { width: 100%; background: var(--accent-strong); }
.cl-strip-cell--phone .cl-strip-bar { width: 100%; background: #3B82F6; }
.cl-strip-cell--tg .cl-strip-bar { width: 100%; background: #06B6D4; }

/* ---- 2-col layout ---- */
.cl-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.cl-main { min-width: 0; }
.cl-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Toolbar / search ---- */
.cl-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 16px;
}
.cl-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.cl-search:focus-within {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.cl-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: 0;
  min-width: 0;
}
.cl-search input::placeholder { color: var(--subtle); }
.cl-search-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.cl-search-clear:hover { background: var(--ink); color: #fff; }
.cl-toolbar-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cl-toolbar-meta-k {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}
.cl-toolbar-meta-v { color: var(--ink); font-weight: 500; }

/* ---- Cards grid ---- */
.cl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.cl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease), transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.cl-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background var(--motion-base) var(--ease);
}
.cl-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -10px rgba(28, 25, 23, 0.15);
}
.cl-card:hover::before { background: var(--ink); }

.cl-card-id {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.cl-card-num {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--subtle);
  text-transform: uppercase;
}
.cl-card-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  padding: 3px 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.cl-card-led {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.cl-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cl-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #44403C 0%, #1C1917 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}
.cl-card-info { min-width: 0; flex: 1; }
.cl-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-card-org {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.cl-card-contacts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
}
.cl-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--motion-fast) var(--ease);
}
.cl-phone:hover { color: var(--ink); }
.cl-phone--empty {
  color: var(--subtle);
  font-style: italic;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  cursor: default;
}
.cl-tg {
  font-size: 11px;
  font-weight: 600;
  color: #0891B2;
  padding: 3px 8px;
  background: #ECFEFF;
  border: 1px solid #A5F3FC;
  border-radius: 5px;
}

.cl-card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.cl-card-products {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.cl-card-products-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--subtle);
  text-transform: uppercase;
}
.cl-card-products-v {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cl-card-bar {
  flex: 1;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.cl-card-bar-fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--ink);
  border-radius: 2px;
  transition: width 600ms var(--ease);
}

/* ---- Empty state ---- */
.cl-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.cl-empty-mark {
  font-size: 48px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 300;
}
.cl-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.cl-empty p { margin: 0 0 18px; color: var(--muted); font-size: 13px; max-width: 360px; }
.cl-empty-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cl-empty-cta:hover { background: var(--accent-strong); }

/* ---- Pager ---- */
.cl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 12px 0;
  border-top: 1px dashed var(--border);
}
.cl-pager-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.cl-pager-actions { display: inline-flex; gap: 6px; }
.cl-pager-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.cl-pager-btn:hover:not(:disabled) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cl-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cl-pager-btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cl-pager-btn--primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }

/* ---- Right rail ---- */
.cl-rail-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cl-rail-card--ghost {
  background: var(--bg);
  border-style: dashed;
}
.cl-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cl-rail-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cl-rail-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cl-rail-sub {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.cl-rail-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cl-rail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-rail-field-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cl-rail-field input {
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.cl-rail-field input:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
}
.cl-rail-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  margin-top: 4px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.cl-rail-submit:hover { background: var(--accent-strong); }
.cl-rail-submit-plus {
  font-size: 16px;
  font-weight: 400;
  line-height: 0.5;
  margin-top: 1px;
}
.cl-rail-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cl-rail-rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.cl-rail-rules-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--ink);
  font-style: italic;
  margin-top: 1px;
}

@media (max-width: 980px) {
  .cl-layout { grid-template-columns: 1fr; }
  .cl-rail { position: static; }
  .cl-strip { grid-template-columns: repeat(2, 1fr); }
  .cl-strip-cell { border-right: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
  .cl-strip-cell:nth-child(2n) { border-right: 0; }
  .cl-strip-cell:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 640px) {
  .cl-grid { grid-template-columns: 1fr; }
  .cl-toolbar { flex-wrap: wrap; }
  .cl-toolbar-meta { width: 100%; }
  .cl-strip { grid-template-columns: 1fr; }
  .cl-strip-cell { border-right: 0; border-bottom: 1px dashed var(--border); }
  .cl-strip-cell:last-child { border-bottom: 0; }
}

/* =====================================================================
   PRODUCT FORM — Cargo Intake
   ===================================================================== */

.pf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.pf-eyebrow-sep { color: var(--border-strong); }
.pf-eyebrow-meta { color: var(--subtle); font-weight: 500; letter-spacing: 0.04em; }

.pf-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.pf-cancel:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Stepper ---- */
.pf-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 24px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pf-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  color: var(--muted);
  transition: color var(--motion-base) var(--ease);
  flex: 1 1 0;
  min-width: 0;
}
.pf-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.pf-step-k {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-step-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--motion-base) var(--ease);
}
.pf-step--active .pf-step-num { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pf-step--active { color: var(--ink); }
.pf-step--active .pf-step-dot { background: var(--accent-strong); }
.pf-step.is-filled .pf-step-num { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.pf-step.is-filled .pf-step-dot { background: var(--accent-strong); }
.pf-step-sep {
  flex: 0 0 28px;
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ---- Banner ---- */
.pf-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.pf-banner--err {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.pf-banner-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #DC2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---- Layout ---- */
.pf-form { display: block; }
.pf-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.pf-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pf-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Block ---- */
.pf-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 24px;
}
.pf-block-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.pf-block-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-block-eyebrow-n {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.pf-block-title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}
.pf-block-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Grid + fields ---- */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}
.pf-grid--4 { grid-template-columns: repeat(3, 1fr); }
.pf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pf-field--wide { grid-column: 1 / -1; }
.pf-field-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pf-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pf-field-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--subtle);
  pointer-events: none;
}
.pf-field input,
.pf-field select,
.pf-field textarea {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.pf-field input.has-ring:focus,
.pf-field select.has-ring:focus,
.pf-field textarea.has-ring:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
.pf-field-wrap input { padding-left: 50px; font-family: var(--font-mono); letter-spacing: 0.02em; }
.pf-field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.pf-field-help {
  font-size: 11px;
  line-height: 1.4;
  color: var(--subtle);
}
.pf-field-err {
  font-size: 12px;
  color: #DC2626;
  font-weight: 500;
}
.pf-field--required .pf-field-k::after {
  content: "●";
  color: #DC2626;
  font-size: 8px;
  margin-left: 2px;
  position: relative;
  top: -1px;
}

/* ---- Route toggle (warehouse / truck) ---- */
.pf-route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pf-route-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 16px 18px;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.pf-route-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pf-route-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pf-route-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pf-route-card-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.pf-route-card-k {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pf-route-card-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.pf-route-card-pick select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease);
}
.pf-route-card-pick select:focus {
  outline: 0;
  border-color: var(--ink);
}
.pf-route-card:hover { border-color: var(--ink); }
.pf-route-card.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.pf-route-card.is-active .pf-route-card-mark {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.pf-route-card.is-active .pf-route-card-k,
.pf-route-card.is-active .pf-route-card-sub { color: #fff; }
.pf-route-card.is-active .pf-route-card-pick select {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.pf-route-card.is-active .pf-route-card-pick select option {
  color: var(--ink);
  background: var(--bg-card);
}

/* ---- Footer ---- */
.pf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
}
.pf-foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}
.pf-foot-mark { color: #DC2626; font-size: 8px; position: relative; top: -1px; }
.pf-foot-actions { display: inline-flex; align-items: center; gap: 14px; }
.pf-foot-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--motion-fast) var(--ease);
}
.pf-foot-link:hover { color: #fff; }
.pf-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent-strong);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.pf-submit:hover { background: #047857; transform: translateX(1px); }
.pf-submit-mark { font-size: 14px; line-height: 1; }

/* ---- Right rail ---- */
.pf-rail-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pf-rail-card--rules {
  background: var(--bg);
  border-style: dashed;
}
.pf-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-rail-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.pf-rail-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pf-rail-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: pf-rail;
}
.pf-rail-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
}
.pf-rail-steps-n {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-style: italic;
  margin-top: 1px;
}
.pf-rail-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pf-rail-rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.pf-rail-rules-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 8px;
  color: var(--subtle);
  margin-top: 1px;
}
.pf-rail-rules-mark--req { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }

@media (max-width: 980px) {
  .pf-layout { grid-template-columns: 1fr; }
  .pf-rail { position: static; }
  .pf-stepper { flex-wrap: wrap; gap: 8px; }
  .pf-step-sep { display: none; }
  .pf-step { flex: 1 1 45%; }
  .pf-route { grid-template-columns: 1fr; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .pf-foot { flex-direction: column; align-items: stretch; }
  .pf-foot-actions { justify-content: space-between; }
}
@media (max-width: 640px) {
  .pf-grid--4 { grid-template-columns: 1fr; }
  .pf-step-k { font-size: 11px; }
  .pf-step-num { width: 22px; height: 22px; font-size: 10px; }
  .pf-step { flex: 1 1 100%; }
}

/* =====================================================================
   PRODUCT EDIT — Cargo Console
   Отдельный язык для страницы редактирования. Hero — это «манифест»
   текущего состояния груза, правая колонка — хронология и контекст.
   Использует существующие токены (--ink, --border, --accent, --font-mono).
   ===================================================================== */

.pe { display: block; }

.pe-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.pe-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pe-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.pe-bar-link:hover { background: var(--bg); border-color: var(--border-strong); }

/* ---- HERO: dark manifest block ---- */
.pe-hero {
  position: relative;
  background: #0C0A09;
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 0 0 18px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}
.pe-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, 0.025) 27px 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(255, 255, 255, 0.025) 27px 28px);
  pointer-events: none;
}
.pe-hero-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FAFAF9;
}
.pe-hero-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: cr-pulse 2s ease-in-out infinite;
}
.pe-hero-eyebrow { color: #fff; font-weight: 700; }
.pe-hero-sep { color: rgba(255, 255, 255, 0.35); }
.pe-hero-eyebrow-meta { color: rgba(255, 255, 255, 0.75); font-size: 10px; letter-spacing: 0.12em; }
.pe-hero-bar-spacer { flex: 1 1 auto; }

.pe-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 1fr 0.9fr;
  gap: 0;
}

/* main (track + meta) */
.pe-hero-main {
  padding: 22px 26px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.pe-hero-track {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 18px;
  line-height: 1;
}
.pe-hero-track-prefix {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
}
.pe-hero-track-value {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.pe-hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}
.pe-hero-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pe-hero-meta-row:nth-child(3) { grid-column: 1 / -1; }
.pe-hero-meta-k {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.pe-hero-meta-v {
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.pe-hero-meta-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
.pe-hero-client {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pe-hero-client .av-sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}
.pe-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.pe-hero-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}
.pe-hero-status[data-tone="info"] { background: rgba(37, 99, 235, 0.18); border-color: rgba(147, 197, 253, 0.35); }
.pe-hero-status[data-tone="info"] .pe-hero-status-dot { background: #93C5FD; box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25); }
.pe-hero-status[data-tone="primary"] { background: rgba(255, 255, 255, 0.10); }

/* stats column */
.pe-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.pe-hero-stat {
  padding: 18px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pe-hero-stat:nth-child(odd) { border-left: 0; }
.pe-hero-stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.pe-hero-stat-k {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.pe-hero-stat-v {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.05;
}
.pe-hero-stat-u {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.pe-hero-stat-sep { color: rgba(255, 255, 255, 0.35); margin: 0 2px; }

/* side (HS / manager / creator / parts) */
.pe-hero-side {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%);
}
.pe-hero-side-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pe-hero-side-k {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.pe-hero-side-v {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  word-break: break-word;
}
.pe-hero-side-v .muted { color: rgba(255, 255, 255, 0.45); }

/* ---- stepper (как у add-формы, но с собственным классом для отличия) ---- */
.pe-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pe-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  color: var(--muted);
  transition: color var(--motion-base) var(--ease);
  flex: 1 1 0;
  min-width: 0;
}
.pe-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.pe-step-k {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pe-step-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--motion-base) var(--ease);
}
.pe-step--active .pe-step-num { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pe-step--active { color: var(--ink); }
.pe-step.is-filled .pe-step-num { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.pe-step.is-filled .pe-step-dot { background: var(--accent-strong); }
.pe-step-sep {
  flex: 0 0 24px;
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ---- layout: 2-col ---- */
.pe-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}
.pe-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* ---- diff-highlight для полей ---- */
.pe-field-current {
  display: inline-block;
  margin-bottom: -3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-field-current--wide {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pf-field[data-pe-field].is-changed {
  position: relative;
}
.pf-field[data-pe-field].is-changed::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.pf-field[data-pe-field].is-changed .pe-field-current {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.25);
  border-style: solid;
  color: var(--accent-strong);
}
.pf-field[data-pe-field].is-changed input,
.pf-field[data-pe-field].is-changed select,
.pf-field[data-pe-field].is-changed textarea {
  border-color: var(--accent);
  background: var(--surface);
}

/* ---- footer dirty indicator ---- */
.pf-foot-sep { color: rgba(255, 255, 255, 0.4); }
.pe-foot-dirty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FCD34D;
  font-weight: 600;
}
.pe-foot-dirty::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  animation: cr-pulse 1.6s ease-in-out infinite;
}

/* ---- RIGHT RAIL ---- */
.pe-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pe-rail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px;
}
.pe-rail-card--rules { background: var(--bg); border-style: dashed; }
.pe-rail-head { margin-bottom: 12px; }
.pe-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pe-rail-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.pe-rail-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pe-rail-sub {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- timeline ---- */
.pe-timeline-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pe-timeline-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}
.pe-tl-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 0 0 12px;
  position: relative;
}
.pe-tl-item:last-child { padding-bottom: 0; }
.pe-tl-rail {
  position: relative;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.pe-tl-rail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  transform: translate(-50%, -50%);
}
.pe-tl-item.is-first .pe-tl-rail::before {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
.pe-tl-item[data-tone="info"].is-first .pe-tl-rail::before {
  background: var(--info);
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}
.pe-tl-body { min-width: 0; }
.pe-tl-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.pe-tl-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.pe-tl-item.is-first .pe-tl-name {
  color: var(--ink);
}
.pe-tl-ts {
  font-size: 10.5px;
  color: var(--subtle);
  letter-spacing: 0.02em;
  margin-left: auto;
  flex-shrink: 0;
}
.pe-tl-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.pe-tl-loc-sep { color: var(--subtle); }
.pe-tl-comment {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* empty timeline */
.pe-timeline-empty {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin: 8px 0 4px;
}
.pe-timeline-empty-line {
  height: 1px;
  background: var(--border);
}
.pe-timeline-empty-mark {
  font-size: 14px;
  color: var(--subtle);
  font-weight: 500;
  padding: 0 4px;
}

/* ---- neighbours ---- */
.pe-neigh-list,
.pe-parts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pe-neigh-item { margin: 0; }
.pe-neigh-link,
.pe-part-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.pe-neigh-link:hover,
.pe-part-link:hover { border-color: var(--ink); background: var(--surface); }
.pe-neigh-code,
.pe-part-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.01em;
}
.pe-neigh-desc {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pe-neigh-dims {
  font-size: 10.5px;
  color: var(--subtle);
  white-space: nowrap;
}
.pe-neigh-empty {
  padding: 12px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--subtle);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ---- parts ---- */
.pe-part-item { margin: 0; }
.pe-part-link { grid-template-columns: auto 1fr; }
.pe-part-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.pe-part-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---- tips ---- */
.pe-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pe-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.pe-tips-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 8px;
  color: var(--subtle);
  margin-top: 1px;
}
.pe-tips-mark--req { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .pe-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pe-hero-side {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px 32px;
  }
  .pe-hero-side-row { min-width: 160px; }
  .pe-hero-main { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .pe-hero-stats { border-right: 0; }
}
@media (max-width: 980px) {
  .pe-layout { grid-template-columns: 1fr; }
  .pe-rail { position: static; }
  .pe-stepper { flex-wrap: wrap; gap: 8px; }
  .pe-step-sep { display: none; }
  .pe-step { flex: 1 1 45%; }
}
@media (max-width: 720px) {
  .pe-hero-grid { grid-template-columns: 1fr; }
  .pe-hero-side { flex-direction: column; gap: 10px; }
  .pe-hero-stats { grid-template-columns: 1fr 1fr; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .pe-hero-track-value { font-size: 42px; }
  .pe-hero-meta { grid-template-columns: 1fr; }
  .pe-step { flex: 1 1 100%; }
}
@media (max-width: 540px) {
  .pe-hero-stat { padding: 14px 16px; }
  .pe-hero-main { padding: 18px 18px 18px; }
  .pe-hero-side { padding: 14px 18px; }
  .pe-hero-track-value { font-size: 36px; }
  .pe-hero-stat-v { font-size: 18px; }
  .pf-foot { flex-direction: column; align-items: stretch; }
  .pf-foot-actions { justify-content: space-between; }
}

/* =====================================================================
   CALCULATOR — Tariff Workshop (settings + manager calc)
   ===================================================================== */

.cs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.cs-eyebrow-sep { color: var(--border-strong); }
.cs-eyebrow-meta { color: var(--subtle); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }

/* ---- Layout ---- */
.cs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.cs-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cs-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Block ---- */
.cs-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 24px;
}
.cs-block-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.cs-block-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-block-eyebrow-n {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.cs-block-title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}
.cs-block-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.cs-block-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Form grid + fields ---- */
.cs-form { display: block; }
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}
.cs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cs-field-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-field input,
.cs-field select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.cs-field input:focus,
.cs-field select:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
.cs-field-help {
  font-size: 11px;
  line-height: 1.4;
  color: var(--subtle);
}
.cs-field-err {
  font-size: 12px;
  color: #DC2626;
  font-weight: 500;
}

/* ---- Block foot ---- */
.cs-block-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.cs-block-foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.cs-block-foot-mark {
  color: #DC2626;
  font-size: 8px;
  position: relative;
  top: -1px;
}
.cs-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.cs-submit:hover { background: var(--accent-strong); }
.cs-submit--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.cs-submit--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.cs-submit-mark { font-size: 14px; line-height: 1; }

/* ---- Tariff table ---- */
.cs-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cs-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cs-table tbody td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cs-table tbody tr:last-child td { border-bottom: 0; }
.cs-table tbody tr:hover td { background: rgba(28, 25, 23, 0.02); }
.cs-col-num {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 48px;
  padding-right: 14px !important;
}
.cs-col-u {
  font-size: 9px;
  font-weight: 500;
  color: var(--subtle);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin-left: 2px;
}
.cs-tcell {
  display: block;
  width: 100%;
}
.cs-tcell input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color var(--motion-fast) var(--ease);
}
.cs-tcell input:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
}

/* ---- Preview table (read-only) ---- */
.cs-base {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
}
.cs-base-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}
.cs-base-v {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-right: auto;
}
.cs-base-help {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  max-width: 220px;
  line-height: 1.4;
}
.cs-table--preview tbody td {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.cs-table--preview tbody td:first-child {
  text-align: left;
}
.cs-table--preview tbody td strong {
  color: var(--ink);
  font-weight: 600;
}
.cs-row-n {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  margin-right: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  vertical-align: 1px;
}
.cs-row-density { color: var(--ink); font-weight: 600; }
.cs-row-u { color: var(--subtle); font-size: 10px; font-weight: 500; }
.cs-table-overflow td { background: var(--bg); color: var(--muted); }
.cs-table-overflow td .cs-row-density { color: var(--muted); }
.cs-table-overflow td strong { color: var(--ink); font-weight: 600; }

/* ---- Right rail ---- */
.cs-rail-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cs-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-rail-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cs-rail-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs-rail-sub {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.cs-rail-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-rail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cs-rail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cs-rail-field-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-rail-field-u {
  font-size: 9px;
  font-weight: 500;
  color: var(--subtle);
  margin-left: 2px;
  text-transform: lowercase;
}
.cs-rail-input {
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.cs-rail-input:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
}
.cs-rail-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent-strong);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.cs-rail-submit:hover { background: #047857; }
.cs-rail-submit-mark { font-size: 14px; line-height: 1; }

/* ---- Result block ---- */
.cs-rail-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.cs-rail-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.cs-rail-result-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
}
.cs-rail-result-state {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.cs-rail-result-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.cs-rail-result-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.cs-rail-result-k {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 70px;
}
.cs-rail-result-v { color: var(--ink); }
.cs-rail-result-cat { color: var(--subtle); margin-left: 4px; font-size: 11px; }
.cs-rail-result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.cs-badge-k {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.cs-badge-v {
  font-variant-numeric: tabular-nums;
}
.cs-badge--primary {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}
.cs-badge--neutral {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border);
}
.cs-badge--success {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}

.cs-rail-empty {
  margin-top: 18px;
  padding: 22px 16px;
  text-align: center;
  border-top: 1px dashed var(--border);
}
.cs-rail-empty-mark {
  font-size: 32px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 300;
  line-height: 1;
}
.cs-rail-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 980px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-rail { position: static; }
  .cs-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-block-foot { flex-direction: column; align-items: stretch; }
  .cs-block-foot-meta { justify-content: flex-end; }
  .cs-base { flex-wrap: wrap; }
  .cs-base-v { font-size: 18px; }
  .cs-base-help { text-align: left; max-width: none; }
}
@media (max-width: 640px) {
  .cs-grid { grid-template-columns: 1fr; }
  .cs-table { font-size: 11px; }
  .cs-table thead th, .cs-table tbody td { padding: 6px 8px; }
  .cs-rail-grid { grid-template-columns: 1fr; }
}

/* ====================================================================
   TRUCK DETAIL — единый язык с trucks.html (fleet-hero) + product_edit
   ==================================================================== */

/* page-head: добавляем значок грузовика рядом с номером */
.td-page-head { margin-bottom: 0; }
.td-page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.td-h1-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 16px;
  margin-right: 10px;
  vertical-align: -4px;
}

/* fleet-hero для детальной страницы — 3 колонки внутри */
.td-hero {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}
.td-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: stretch;
  position: relative;
  z-index: 1;
}

/* левая колонка: статус / маршрут / загрузка */
.td-hero-main {
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-right: 1px solid var(--border);
}
.td-hero-line {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 24px;
}
.td-hero-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.td-hero-v {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
}
.td-hero-v--wide { width: 100%; }
.td-hero-meta { color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; }

/* route */
.td-route {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.td-route-mark {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.td-route-place { color: var(--ink); font-weight: 500; }
.td-route-place--dest { color: var(--ink); }
.td-route-loc { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.td-route-arrow { color: var(--subtle); font-size: 13px; }

/* occupancy */
.td-occupancy {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.td-occupancy-track {
  flex: 1;
  height: 6px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.td-occupancy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #4ADE80);
  border-radius: 999px;
  transition: width 240ms ease;
}
.td-occupancy-fill.is-low  { background: linear-gradient(90deg, var(--success), #4ADE80); }
.td-occupancy-fill.is-high { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.td-occupancy-fill.is-full { background: linear-gradient(90deg, var(--danger), #F87171); }
.td-occupancy-fill.is-empty{ background: var(--border-strong); }
.td-occupancy-pct {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

/* центральная колонка: 4 метрики 2×2 */
.td-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-right: 1px solid var(--border);
}
.td-hero-stat {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.td-hero-stat:nth-child(odd) { border-right: 1px solid var(--border); }
.td-hero-stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.td-hero-stat-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.td-hero-stat-v {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.td-hero-stat-u { color: var(--muted); font-size: 11px; font-weight: 500; }

/* правая колонка: ID-сводка */
.td-hero-side {
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.td-hero-side-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  padding: 2px 0;
  border-bottom: 1px dashed transparent;
}
.td-hero-side-k { color: var(--muted); }
.td-hero-side-v { color: var(--ink); font-weight: 500; }
.td-side-meta { color: var(--subtle); font-size: 11px; letter-spacing: 0.02em; font-weight: 400; }

/* bar (legacy class) */
.td-bar { margin-top: 14px; }
.td-bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* layout */
.td-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 18px;
  align-items: start;
}
.td-main { min-width: 0; }
.td-rail { position: sticky; top: 16px; }

/* actions block — flow + main button */
.td-actions-block .pf-block-title { margin-bottom: 4px; }

.td-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  margin: 6px 0 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.td-flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  position: relative;
  color: var(--muted);
  border-right: 1px solid var(--border);
  transition: background 160ms ease, color 160ms ease;
}
.td-flow-step:last-child { border-right: 0; }
.td-flow-step.is-done {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
}
.td-flow-step.is-current {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.0));
}
.td-flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.td-flow-step.is-done .td-flow-num { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.td-flow-step.is-current .td-flow-num {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}
.td-flow-body { min-width: 0; }
.td-flow-k { font-size: 13px; font-weight: 600; line-height: 1.3; }
.td-flow-v { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.td-flow-step.is-done .td-flow-v,
.td-flow-step.is-current .td-flow-v { color: var(--ink); opacity: 0.7; }
.td-flow-sep { display: none; }

.td-action-form { display: flex; }
.td-action-form form { display: block; width: 100%; }
.td-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.td-action:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.td-action:active { transform: translateY(1px); }
.td-action-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  flex-shrink: 0;
}
.td-action-body { display: flex; flex-direction: column; min-width: 0; }
.td-action-k { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.td-action-sub { font-size: 11.5px; opacity: 0.75; margin-top: 3px; line-height: 1.4; }
.td-action-sub a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.td-action--hint {
  background: var(--bg);
  color: var(--ink);
  border-style: dashed;
  border-color: var(--border-strong);
  cursor: default;
}
.td-action--hint:hover { background: var(--bg); border-color: var(--border-strong); }
.td-action--hint .td-action-mark { background: var(--border); color: var(--ink); }
.td-action--hint .td-action-sub a { color: var(--ink); }

.td-action--done {
  background: var(--bg);
  color: var(--success);
  border-color: var(--success);
  cursor: default;
}
.td-action--done:hover { background: var(--bg); border-color: var(--success); }
.td-action--done .td-action-mark { background: var(--success-bg); color: var(--success); }

/* cargo table */
.td-cargo {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.td-cargo-head,
.td-cargo-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) repeat(4, minmax(0, 0.6fr)) minmax(0, 0.9fr) 28px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 12.5px;
}
.td-cargo-head {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.td-cargo-row {
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  transition: background 120ms ease;
}
.td-cargo-row:last-child { border-bottom: 0; }
.td-cargo-row:hover { background: var(--bg); }
.td-cargo-num { text-align: right; }
.td-cargo-u  { color: var(--muted); font-size: 10.5px; }
.td-cargo-code .mono { font-weight: 600; font-size: 12.5px; }
.td-cargo-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-cargo-client-name { font-weight: 500; font-size: 12.5px; }
.td-cargo-client-org { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.td-cargo-status { display: flex; align-items: center; gap: 6px; min-width: 0; }
.td-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.td-status-dot[data-tone="info"]    { background: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }
.td-status-dot[data-tone="primary"] { background: var(--ink); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); }
.td-status-dot[data-tone="warn"]    { background: #B45309; box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.16); }
.td-status-dot[data-tone="success"] { background: #16A34A; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.td-status-dot[data-tone="danger"]  { background: #B91C1C; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16); }
.td-status-dot[data-tone="idle"]    { background: var(--border-strong); }
.td-status-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-status-name.muted { color: var(--muted); font-weight: 400; }

.td-cargo-act { text-align: right; }
.td-cargo-go { color: var(--muted); font-size: 14px; transition: transform 140ms ease, color 140ms ease; }
.td-cargo-row:hover .td-cargo-go { color: var(--ink); transform: translateX(2px); }

.td-cargo-empty {
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 24px 20px 22px;
  text-align: center;
  background: var(--bg);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.td-cargo-empty-line {
  display: block;
  width: 56px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin: 4px auto;
}
.td-cargo-empty-line:nth-child(2) { width: 38px; }
.td-cargo-empty-line:nth-child(3) { width: 24px; }
.td-cargo-empty-mark {
  font-size: 28px;
  color: var(--muted);
  margin: 8px 0 4px;
  font-weight: 300;
}
.td-cargo-empty p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* params */
.td-param { background: var(--bg); }
.td-param-v {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* context card */
.td-context-dest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}
.td-context-dest-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.td-context-dest-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.td-context-dest-loc  { color: var(--muted); font-size: 11px; margin-top: 2px; }
.td-context-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.td-context-link:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.td-context-empty { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.td-context-empty p { margin: 0 0 8px; }
.td-context-empty a { color: var(--accent-strong); font-weight: 500; text-decoration: none; }
.td-context-empty a:hover { text-decoration: underline; }

/* timeline meta for truck */
.td-tl-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
}
.td-tl-sep { color: var(--border-strong); margin: 0 4px; }
.td-tl-client { color: var(--muted); font-size: 11px; }

@media (max-width: 1180px) {
  .td-layout { grid-template-columns: 1fr; }
  .td-rail { position: static; }
  .td-hero-grid { grid-template-columns: 1fr 1fr; }
  .td-hero-side { border-top: 1px solid var(--border); grid-column: 1 / -1; }
  .td-hero-stats { border-right: 0; border-bottom: 1px solid var(--border); }
  .td-hero-main { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 880px) {
  .td-flow { grid-template-columns: 1fr; }
  .td-flow-step { border-right: 0; border-bottom: 1px solid var(--border); }
  .td-flow-step:last-child { border-bottom: 0; }
  .td-cargo-head { display: none; }
  .td-cargo-row {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    row-gap: 6px;
    padding: 12px 14px;
  }
  .td-cargo-code { grid-column: 1 / -1; }
  .td-cargo-status { grid-column: 1 / -1; }
  .td-cargo-act { display: none; }
  .td-hero-grid { grid-template-columns: 1fr; }
  .td-hero-stats { grid-template-columns: 1fr 1fr; }
}

/* ====================================================================
   TRUCKS PAGE — Fleet Operations Console
   Reuses the dark-ops rhythm from cr-console / wh-console.
   The console anchors the page; the truck distribution strip is the
   unique visual signature — every truck is a small tile grouped by
   status. Right rail is editorialised: active routes, fleet
   composition, lifecycle flow, tips.
   ==================================================================== */

.page[data-page="trucks"] .filter-bar {
  padding-left: 0;
  padding-right: 0;
}

/* ---- Fleet Ops Console (dark hero) ---- */
.fo-console {
  background: #0C0A09;
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 0 28px 14px;
  position: relative;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 20px 40px -20px rgba(12, 10, 9, 0.45);
}
.fo-console::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.022) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.022) 23px 24px);
  pointer-events: none;
}
.fo-console::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(ellipse 40% 60% at 0% 100%, rgba(22, 163, 74, 0.10), transparent 60%);
  pointer-events: none;
}
.fo-console-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FAFAF9;
}
.fo-console-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: fo-pulse 2s ease-in-out infinite;
}
@keyframes fo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
.fo-console-eyebrow { color: #fff; font-weight: 700; }
.fo-console-eyebrow-sep { color: rgba(255, 255, 255, 0.30); }
.fo-console-eyebrow-tone {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}
.fo-console-ts {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: lowercase;
  font-weight: 500;
}

.fo-console-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
  align-items: stretch;
}
.fo-console-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.fo-console-stat {
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
}
.fo-console-stat:nth-child(odd) { border-left: 0; }
.fo-console-stat:nth-last-child(-n+2) { border-bottom: 0; }
.fo-console-stat-lbl {
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 6px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fo-console-stat-lbl::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.30);
}
.fo-console-stat[data-tone="primary"] .fo-console-stat-lbl::before { background: #fff; }
.fo-console-stat[data-tone="info"] .fo-console-stat-lbl::before    { background: #60A5FA; box-shadow: 0 0 8px rgba(96, 165, 250, 0.6); }
.fo-console-stat[data-tone="warn"] .fo-console-stat-lbl::before    { background: #FBBF24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.fo-console-stat[data-tone="success"] .fo-console-stat-lbl::before { background: #4ADE80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }

.fo-console-stat-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.fo-console-stat-num {
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  color: #fff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.fo-console-stat-sub {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  opacity: 0.65;
}
.fo-console-stat[data-tone="info"]    .fo-console-stat-num { color: #BFDBFE; }
.fo-console-stat[data-tone="warn"]    .fo-console-stat-num { color: #FDE68A; }
.fo-console-stat[data-tone="success"] .fo-console-stat-num { color: #BBF7D0; }

/* ---- Fleet distribution strip ---- */
.fo-strip-wrap {
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.fo-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.fo-strip-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.fo-strip-meta {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.40);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.fo-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 48px;
  align-items: stretch;
  padding: 5px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.fo-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: -1px -1px;
  pointer-events: none;
  mask-image: linear-gradient(135deg, transparent 50%, black 100%);
  -webkit-mask-image: linear-gradient(135deg, transparent 50%, black 100%);
  opacity: 0.4;
}
.fo-strip-tile {
  position: relative;
  flex: 1 1 50px;
  min-width: 50px;
  min-height: 36px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}
.fo-strip-tile:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.4);
  z-index: 2;
}
.fo-strip-tile-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  position: relative;
  z-index: 1;
}
.fo-strip-tile-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  align-self: flex-end;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}
.fo-strip-tile[data-status="В пути"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.30), rgba(37, 99, 235, 0.10));
  border-color: rgba(96, 165, 250, 0.40);
}
.fo-strip-tile[data-status="В пути"] .fo-strip-tile-dot { background: #60A5FA; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.30), 0 0 8px rgba(96, 165, 250, 0.6); }
.fo-strip-tile[data-status="Прибыл на разгрузку"] {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.30), rgba(180, 83, 9, 0.10));
  border-color: rgba(251, 191, 36, 0.40);
}
.fo-strip-tile[data-status="Прибыл на разгрузку"] .fo-strip-tile-dot { background: #FBBF24; box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.30), 0 0 8px rgba(251, 191, 36, 0.6); }
.fo-strip-tile[data-status="Загружен"] {
  background: linear-gradient(135deg, rgba(28, 25, 23, 0.65), rgba(28, 25, 23, 0.40));
  border-color: rgba(255, 255, 255, 0.18);
}
.fo-strip-tile[data-status="Загружен"] .fo-strip-tile-dot { background: #fff; }
.fo-strip-tile[data-status="Свободен"],
.fo-strip-tile[data-status="На складе"],
.fo-strip-tile[data-status="Готов к отправке"],
.fo-strip-tile[data-status="Разгружен"] {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.22), rgba(22, 163, 74, 0.06));
  border-color: rgba(74, 222, 128, 0.30);
}
.fo-strip-tile[data-status="Свободен"] .fo-strip-tile-dot,
.fo-strip-tile[data-status="На складе"] .fo-strip-tile-dot,
.fo-strip-tile[data-status="Готов к отправке"] .fo-strip-tile-dot,
.fo-strip-tile[data-status="Разгружен"] .fo-strip-tile-dot { background: #4ADE80; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.30); }

.fo-strip-empty {
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: rgba(255, 255, 255, 0.40);
  letter-spacing: 0.04em;
  padding: 14px 0;
  text-transform: lowercase;
}

.fo-strip-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
}
.fo-strip-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fo-strip-legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.20);
  flex-shrink: 0;
}
.fo-strip-legend-item[data-tone="info"] .fo-strip-legend-swatch    { background: #60A5FA; box-shadow: 0 0 6px rgba(96, 165, 250, 0.5); }
.fo-strip-legend-item[data-tone="warn"] .fo-strip-legend-swatch    { background: #FBBF24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.5); }
.fo-strip-legend-item[data-tone="success"] .fo-strip-legend-swatch { background: #4ADE80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.fo-strip-legend-item[data-tone="primary"] .fo-strip-legend-swatch { background: #fff; }
.fo-strip-legend-k { color: rgba(255, 255, 255, 0.65); }
.fo-strip-legend-v {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.fo-strip-legend-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.10);
}
.fo-strip-legend-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
}
.fo-strip-legend-meta strong {
  color: #fff;
  font-weight: 700;
  margin-left: 4px;
}

/* ---- Layout: 2-col main + side rail ---- */
.page[data-page="trucks"] .fleet-dispatch-brief {
  margin-bottom: 12px;
}
.page[data-page="trucks"] .fleet-dispatch-brief .ops-summary {
  gap: 8px;
}
.page[data-page="trucks"] .fleet-dispatch-brief .ops-summary__card {
  min-height: 76px;
  gap: 5px;
  padding: 12px 14px 12px 16px;
  box-shadow: none;
}
.page[data-page="trucks"] .fleet-dispatch-brief .ops-summary__value {
  font-size: 24px;
}
.page[data-page="trucks"] .fleet-dispatch-brief .ops-summary__hint {
  font-size: 11.5px;
}
.trucks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 0 28px 28px;
  align-items: start;
}
.trucks-main { min-width: 0; }
.trucks-main .table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 18px 34px -32px rgba(28, 25, 23, 0.26);
  overflow: hidden;
}
.truck-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.truck-list-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}
.truck-list-kicker {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
}
.truck-list-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.trucks-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: sticky;
  top: var(--topbar-h, 64px);
  align-self: start;
}
.trucks-side > * {
  min-width: 0;
}
.trucks-side > .trucks-side-head {
  flex-basis: auto;
}

/* ---- Trucks table: column widths + code tile ---- */
.page[data-page="trucks"] .table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}
.page[data-page="trucks"] .trucks-table {
  width: 100%;
  min-width: 840px !important;
  table-layout: fixed;
}
.page[data-page="trucks"] .trucks-table col.col-cb-tr    { width: 32px; }
.page[data-page="trucks"] .trucks-table col.col-id-tr    { width: 120px; }
.page[data-page="trucks"] .trucks-table col.col-st-tr    { width: 156px; }
.page[data-page="trucks"] .trucks-table col.col-route-tr { width: 168px; }
.page[data-page="trucks"] .trucks-table col.col-cnt-tr   { width: 106px; }
.page[data-page="trucks"] .trucks-table col.col-load-tr  { width: 136px; }
.page[data-page="trucks"] .trucks-table col.col-act-tr   { width: 158px; }

.page[data-page="trucks"] .trucks-table th,
.page[data-page="trucks"] .trucks-table td {
  vertical-align: middle;
}
.page[data-page="trucks"] .trucks-table td {
  min-width: 0;
}
.page[data-page="trucks"] .trucks-table th.actions-col,
.page[data-page="trucks"] .trucks-table td.actions-col {
  width: 158px;
  padding-right: 18px;
}
.page[data-page="trucks"] .trucks-table tbody tr {
  cursor: pointer;
}
.page[data-page="trucks"] .trucks-table tbody tr[data-status="Прибыл на разгрузку"] td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}
.page[data-page="trucks"] .trucks-table tbody tr[data-status="В пути"] td:first-child {
  box-shadow: inset 3px 0 0 var(--info);
}
.page[data-page="trucks"] .trucks-table tbody tr[data-status="Свободен"] td:first-child,
.page[data-page="trucks"] .trucks-table tbody tr[data-status="Разгружен"] td:first-child,
.page[data-page="trucks"] .trucks-table tbody tr[data-status="На складе"] td:first-child,
.page[data-page="trucks"] .trucks-table tbody tr[data-status="Готов к отправке"] td:first-child {
  box-shadow: inset 3px 0 0 var(--success);
}
.page[data-page="trucks"] .row-actions {
  justify-content: flex-end;
  opacity: 1;
}
.page[data-page="trucks"] .row-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page[data-page="trucks"] .row-act-btn--primary {
  width: auto;
  min-width: 74px;
  padding: 0 8px 0 10px;
  gap: 5px;
}
.page[data-page="trucks"] .row-act-label {
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
}

.truck-code-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  max-width: 100%;
  padding: 0 12px 0 10px;
  border-radius: 8px;
  background: rgba(28, 25, 23, 0.035);
  border: 1px solid rgba(28, 25, 23, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.truck-code-tile:hover {
  background: var(--surface);
  border-color: rgba(28, 25, 23, 0.18);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.05);
}
.truck-code-tile-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--ink);
  color: #FAFAF9;
  font-size: 10.5px;
  line-height: 1;
}
.truck-code-tile-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* Route mini (table) */
.route-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
}
.route-mini-k {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.route-mini-dest {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 136px;
}

/* Update the existing .route-progress empty fill */
.route-progress-fill.is-empty { background: var(--border-strong); }

/* Compact progress bar for trucks table */
.page[data-page="trucks"] .route-progress { gap: 8px; min-width: 128px; }
.page[data-page="trucks"] .route-progress-track { height: 7px; }
.page[data-page="trucks"] .route-progress-pct {
  min-width: 34px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.truck-count-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--ink);
  line-height: 1.1;
}
.truck-count-cell strong {
  font-size: 14px;
  font-weight: 700;
}
.truck-count-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.truck-count-cell.is-empty {
  color: var(--muted);
}
.truck-status-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.page[data-page="trucks"] .truck-status-cell .badge {
  min-height: 24px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
}
.truck-status-note {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page[data-page="trucks"] .truck-route-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.28;
}

/* ---- Table: header confidence + row spacing + hover ---- */
.page[data-page="trucks"] .trucks-table thead th {
  font-weight: 600;
  height: 42px;
  padding: 10px 16px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  white-space: normal;
  line-height: 1.2;
}
.page[data-page="trucks"] .trucks-table thead th.actions-col {
  text-align: right;
  white-space: nowrap;
}
.page[data-page="trucks"] .trucks-table tbody td {
  height: 62px;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
.page[data-page="trucks"] .trucks-table tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
  border-bottom: 1px solid var(--border);
}
.page[data-page="trucks"] .trucks-table tbody tr:hover,
.page[data-page="trucks"] .trucks-table tbody tr:focus-within {
  background: rgba(28, 25, 23, 0.028);
}
.page[data-page="trucks"] .trucks-table tbody tr:hover td,
.page[data-page="trucks"] .trucks-table tbody tr:focus-within td {
  border-bottom-color: var(--border-strong);
}
.page[data-page="trucks"] .trucks-table tbody tr:hover .truck-code-tile,
.page[data-page="trucks"] .trucks-table tbody tr:focus-within .truck-code-tile {
  background: var(--surface);
  border-color: rgba(28, 25, 23, 0.18);
}

.page[data-page="trucks"] .table-foot {
  padding: 12px 18px;
  font-size: 12.5px;
}

/* ---- Toolbar: unified single row ---- */
.page[data-page="trucks"] .filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px 16px;
}
.page[data-page="trucks"] .filter-bar .chips {
  min-height: 36px;
  height: auto;
  flex-shrink: 0;
}
.page[data-page="trucks"] .chip {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}
.page[data-page="trucks"] .chip-count {
  font-size: 10.5px;
  padding: 2px 6px;
}
.page[data-page="trucks"] .filter-bar .toolbar {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.page[data-page="trucks"] .filter-bar .toolbar-search {
  height: 36px;
  width: 252px;
  padding-inline: 12px;
}
.page[data-page="trucks"] .toolbar-search input[type="search"] { font-size: 13.5px; }

/* ---- Right rail: compact fleet composition ---- */
.trucks-side-head {
  width: 100%;
}
.trucks-side-label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.trucks-side .cr-rail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.trucks-side .cr-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.trucks-side .cr-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.trucks-side .cr-rail-eyebrow-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink);
}
.fleet-comp-list {
  gap: 0;
}
.fleet-comp-row {
  padding: 6px 0;
}
.fleet-comp-row + .fleet-comp-row {
  border-top: 1px solid var(--border);
}
.fleet-comp-label {
  font-size: 12.5px;
}
.fleet-comp-value {
  font-size: 13px;
}

/* ---- Right rail: active routes section ---- */
.trucks-side .ar-item {
  padding: 10px 0;
}

/* ---- Right rail: card badge ---- */
.trucks-side .card-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}

/* ---- Right rail: compact at narrow viewports ---- */
@media (max-width: 1400px) {
  .trucks-side .cr-rail-card {
    padding: 12px 14px;
  }
}

/* ---- Table: action column always visible ---- */
.page[data-page="trucks"] .trucks-table .row-actions {
  opacity: 1;
  justify-content: flex-end;
  gap: 8px;
}
.page[data-page="trucks"] .btn-sm {
  height: 35px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  border-color: rgba(28, 25, 23, 0.14);
  background: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.page[data-page="trucks"] .btn-sm:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.page[data-page="trucks"] .btn-sm:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.page[data-page="trucks"] .row-act-menu {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-color: var(--border-strong);
  background: var(--bg);
  color: var(--muted);
}
.page[data-page="trucks"] .row-more-toggle {
  cursor: pointer;
  border: 0;
  background: transparent;
}
.page[data-page="trucks"] .row-act-menu:hover {
  background: var(--surface);
  color: var(--ink);
}
.page[data-page="trucks"] .row-more {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}
.page[data-page="trucks"] .row-more-menu {
  display: none;
  position: fixed;
  z-index: 1000;
  width: 188px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 24px -18px rgba(28, 25, 23, 0.24);
}
.page[data-page="trucks"] .row-more.is-open .row-more-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.page[data-page="trucks"] .row-more-close {
  align-self: flex-end;
  width: 24px;
  height: 24px;
  margin: 0 0 2px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: none;
}
.page[data-page="trucks"] .row-more-close:hover {
  background: rgba(28, 25, 23, 0.05);
  color: var(--ink);
  box-shadow: none;
}
.page[data-page="trucks"] .row-more-toggle.row-act-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  padding: 0;
  box-shadow: none;
}
.page[data-page="trucks"] .row-more .row-act-btn {
  width: 100%;
  min-height: 34px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 7px;
  text-align: left;
  box-shadow: none;
}
.page[data-page="trucks"] .row-more .row-act-btn:hover {
  box-shadow: none;
}
.page[data-page="trucks"] .row-more .row-more-close.row-act-btn {
  width: 24px;
  min-height: 24px;
  height: 24px;
  display: inline-grid;
  justify-content: center;
  align-self: flex-end;
  padding: 0;
  margin: 0 0 2px;
}
.page[data-page="trucks"] .row-more-item {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.page[data-page="trucks"] .row-more-item:hover {
  background: rgba(28, 25, 23, 0.05);
}
.page[data-page="trucks"] .row-more-item--danger {
  color: var(--danger);
}
.page[data-page="trucks"] .row-more-item--danger:hover {
  background: rgba(239, 68, 68, 0.08);
}
.page[data-page="trucks"] .row-more-divider {
  height: 1px;
  margin: 4px 4px;
  background: var(--border);
}
.page[data-page="trucks"] .row-more-form {
  margin: 0;
}

/* ---- Right rail: active routes (A) ---- */
.ar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  position: relative;
}
.ar-item:first-child { border-top: 0; padding-top: 4px; }
.ar-item:last-child  { padding-bottom: 4px; }

.ar-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
}
.ar-code {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--ink);
  color: #FAFAF9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.ar-track {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 30px;
  gap: 0;
  color: var(--subtle);
  position: relative;
  height: 8px;
}
.ar-track-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
  flex-shrink: 0;
}
.ar-track-line {
  flex: 1;
  height: 1.5px;
  background-image: linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 8px);
  background-size: 8px 1.5px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  margin: 0 4px;
  opacity: 0.7;
}
.ar-track-arrow {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.ar-dest {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  flex-shrink: 0;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ar-progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
  overflow: hidden;
}
.ar-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #60A5FA);
  transition: width 240ms ease;
}
.ar-progress-fill.is-low  { background: linear-gradient(90deg, var(--success), #4ADE80); }
.ar-progress-fill.is-high { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.ar-progress-fill.is-full { background: linear-gradient(90deg, var(--danger),  #F87171); }
.ar-progress-fill.is-empty{ background: var(--border-strong); }
.ar-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.ar-progress-meta strong { color: var(--ink); font-weight: 700; }
.ar-status { font-size: 11px; }
.ar-status .badge { font-size: 11px; height: 20px; }

.ar-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 4px;
  font-size: 12px;
  color: var(--subtle);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: lowercase;
}
.ar-empty-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}

/* ---- Right rail: lifecycle flow (C) ---- */
.lc-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lc-step {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background var(--motion-fast) var(--ease);
}
.lc-step:last-child { border-bottom: 0; }
.lc-step.is-on { background: var(--surface); }
.lc-step.is-on::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink);
}
.lc-step[data-tone="info"].is-on::before    { background: var(--info); }
.lc-step[data-tone="warn"].is-on::before    { background: var(--warning); }
.lc-step[data-tone="success"].is-on::before { background: var(--success); }
.lc-step[data-tone="primary"].is-on::before { background: var(--ink); }

.lc-step-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.lc-step[data-tone="info"] .lc-step-num    { color: var(--info); border-color: rgba(30, 64, 175, 0.25); }
.lc-step[data-tone="warn"] .lc-step-num    { color: var(--warning); border-color: rgba(180, 83, 9, 0.25); }
.lc-step[data-tone="success"] .lc-step-num { color: var(--success); border-color: rgba(21, 128, 61, 0.25); }
.lc-step[data-tone="primary"] .lc-step-num { color: var(--ink); border-color: var(--border-strong); }
.lc-step.is-on .lc-step-num {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.lc-step[data-tone="info"].is-on .lc-step-num    { background: var(--info); border-color: var(--info); color: #fff; }
.lc-step[data-tone="warn"].is-on .lc-step-num    { background: var(--warning); border-color: var(--warning); color: #fff; }
.lc-step[data-tone="success"].is-on .lc-step-num { background: var(--success); border-color: var(--success); color: #fff; }

.lc-step-k {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-step.is-on .lc-step-k { color: var(--ink); }
.lc-step-v {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lc-step.is-on .lc-step-v { color: var(--ink); }

/* ---- Responsive ---- */
@media (max-width: 1180px) {
  .fo-console-body { grid-template-columns: 1fr; }
  .fo-console-grid { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
}
@media (max-width: 900px) {
  .fo-console-grid { grid-template-columns: 1fr 1fr; }
  .fo-console-stat { padding: 18px 18px 16px; }
  .fo-console-stat-num { font-size: 32px; }
  .fo-strip-wrap { padding: 16px 18px; }
}
@media (max-width: 720px) {
  .fo-console { margin: 0 16px 16px; border-radius: 12px; }
  .fo-console-grid { grid-template-columns: 1fr 1fr; }
  .fo-strip-tile { flex: 1 1 50px; min-width: 50px; min-height: 44px; }
  .fo-strip-legend { gap: 10px 14px; }
  .page[data-page="trucks"] .fleet-dispatch-brief .ops-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trucks-layout {
    grid-template-columns: 1fr;
    padding: 0 16px 16px;
  }
  .page[data-page="trucks"] .filter-bar { padding: 0 0 12px; }
  .trucks-side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    position: static;
  }
  .trucks-side > * { flex: 1 1 260px; }
  .trucks-side > .trucks-side-head { flex-basis: 100%; min-width: 100%; }
}
@media (max-width: 480px) {
  .fo-console-stat-num { font-size: 26px; }
  .fo-strip-tile { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .fo-strip-legend-sep { display: none; }
}

/* ---- Trucks: mobile responsive for table & bulk bar ---- */
@media (max-width: 767px) {
  .page[data-page="trucks"] .bulk-bar.is-inline {
    flex-wrap: wrap;
    gap: 8px;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-btn svg {
    display: none;
  }
  .page[data-page="trucks"] .table-foot {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }
  .page[data-page="trucks"] .trucks-main .table-card {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .page[data-page="trucks"] .table-scroll {
    margin: 0;
    overflow: visible;
    border-top: 0;
  }
  .page[data-page="trucks"] .trucks-table,
  .page[data-page="trucks"] .trucks-table tbody,
  .page[data-page="trucks"] .trucks-table tr,
  .page[data-page="trucks"] .trucks-table td {
    display: block;
    width: 100%;
  }
  .page[data-page="trucks"] .trucks-table {
    min-width: 0;
    border-spacing: 0;
  }
  .page[data-page="trucks"] .trucks-table colgroup,
  .page[data-page="trucks"] .trucks-table thead {
    display: none;
  }
  .page[data-page="trucks"] .trucks-table tbody {
    display: grid;
    gap: 10px;
  }
  .page[data-page="trucks"] .trucks-table tr {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    cursor: default;
  }
  .page[data-page="trucks"] .trucks-table tbody tr[data-status] td:first-child {
    box-shadow: none;
  }
  .page[data-page="trucks"] .trucks-table tr[data-status="Прибыл на разгрузку"] {
    border-left: 3px solid var(--warning);
  }
  .page[data-page="trucks"] .trucks-table tr[data-status="В пути"] {
    border-left: 3px solid var(--info);
  }
  .page[data-page="trucks"] .trucks-table tr[data-status="Свободен"],
  .page[data-page="trucks"] .trucks-table tr[data-status="Разгружен"],
  .page[data-page="trucks"] .trucks-table tr[data-status="На складе"],
  .page[data-page="trucks"] .trucks-table tr[data-status="Готов к отправке"] {
    border-left: 3px solid var(--success);
  }
  .page[data-page="trucks"] .trucks-table td {
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(3) {
    grid-column: 2 / -1;
    grid-row: 2;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(4),
  .page[data-page="trucks"] .trucks-table td:nth-child(5) {
    display: flex;
    grid-column: 2 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(4) {
    grid-row: 3;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(5) {
    grid-row: 4;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(4)::before,
  .page[data-page="trucks"] .trucks-table td:nth-child(5)::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(4)::before {
    content: "Товаров";
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(5)::before {
    content: "Загрузка";
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(6) {
    grid-column: 2 / -1;
    grid-row: 5;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .page[data-page="trucks"] .trucks-table td:nth-child(6) .btn-sm {
    width: 100%;
    justify-content: center;
  }
  .page[data-page="trucks"] .truck-code-tile {
    max-width: 100%;
  }
  .page[data-page="trucks"] .route-mini {
    display: flex;
    width: 100%;
  }
  .page[data-page="trucks"] .route-mini-dest {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .page[data-page="trucks"] .route-progress {
    width: min(190px, 56vw);
  }
  .page[data-page="trucks"] .truck-status-note {
    display: none;
  }
  .page[data-page="trucks"] .row-actions {
    justify-content: flex-end;
  }
  .page[data-page="trucks"] .row-act-btn--primary {
    min-width: 92px;
  }
}
@media (max-width: 480px) {
  .page[data-page="trucks"] .bulk-bar.is-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 12px;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-actions {
    justify-content: stretch;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
  .page[data-page="trucks"] .bulk-bar .bulk-clear-btn {
    margin-left: 0;
    justify-content: center;
  }
  .page[data-page="trucks"] .table-foot {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .page[data-page="trucks"] .t:not(.trucks-table) { min-width: 540px; }
  .page[data-page="trucks"] .trucks-table { min-width: 0; }
  .page[data-page="trucks"] .t thead th,
  .page[data-page="trucks"] .t tbody td { padding: 8px 6px; }
}

/* ---- Adaptive by viewport HEIGHT: keep the dark console always in view ---- */
@media (max-height: 820px) {
  .fo-strip-wrap { display: none; }
  .fo-console-body { grid-template-columns: 1fr; }
  .fo-console-grid { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .wh-console-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-height: 680px) {
  .fo-console { margin: 0 28px 10px; }
  .fo-console-stat { padding: 10px 14px 8px; }
  .fo-console-stat-num { font-size: 26px; }
  .fo-console-stat-lbl { font-size: 9px; margin-bottom: 4px; }
  .fo-console-bar { padding: 7px 16px; font-size: 9.5px; }
  .wh-console-stat { padding: 10px 14px 8px; }
  .wh-console-stat-num { font-size: 24px; }
  .wh-console-stat-lbl { font-size: 9px; margin-bottom: 4px; }
  .wh-console-bar { padding: 7px 16px; font-size: 9.5px; }
}
@media (max-height: 560px) {
  .fo-console { display: none; }
  .wh-console { display: none; }
}
@media (max-height: 560px) {
  .fo-console { display: none; }
}

/* ============================================================
   TEMPLATES — Status Lexicon · Add / Edit Form
   Bilingual studio with live preview side-rail.
   ============================================================ */

.sl-page .page-head { padding: 22px 28px 14px; }
.sl-head-main { min-width: 0; }

.sl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}
.sl-eyebrow-sep { color: var(--border-strong); }
.sl-eyebrow-meta { color: var(--subtle); font-weight: 500; letter-spacing: 0.04em; }

.sl-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.sl-back:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.sl-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #B91C1C;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.sl-delete:hover { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }

/* ---- Stepper ---- */
.sl-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 28px 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sl-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  color: var(--muted);
  transition: color var(--motion-base) var(--ease);
  flex: 1 1 0;
  min-width: 0;
}
.sl-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.sl-step-k {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sl-step-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--motion-base) var(--ease);
}
.sl-step--active .sl-step-num { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sl-step--active { color: var(--ink); }
.sl-step--active .sl-step-dot { background: var(--accent-strong); }
.sl-step.is-filled .sl-step-num { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.sl-step.is-filled .sl-step-dot { background: var(--accent-strong); }
.sl-step-sep {
  flex: 0 0 28px;
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ---- Banner ---- */
.sl-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 28px 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.sl-banner--err {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.sl-banner-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #DC2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.sl-banner-title { font-weight: 600; margin-bottom: 2px; }
.sl-banner-list { display: flex; flex-direction: column; gap: 2px; }
.sl-banner-item b { font-weight: 600; }

/* ---- Layout ---- */
.sl-form { display: block; }
.sl-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
  margin: 0 28px 28px;
}
.sl-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sl-rail {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- Block ---- */
.sl-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 24px;
}
.sl-block-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.sl-block-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-block-eyebrow-n {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.sl-block-title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}
.sl-block-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.sl-inline-mono {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.9em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ink);
}

/* ---- Grid + fields ---- */
.sl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.sl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sl-field-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sl-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sl-field-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--subtle);
  pointer-events: none;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
}
.sl-field input,
.sl-field textarea,
.sl-lang-input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.sl-field input.has-ring:focus,
.sl-field textarea.has-ring:focus,
.sl-lang-input.has-ring:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
.sl-field-wrap input { padding-left: 46px; font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace); letter-spacing: 0.02em; }
.sl-field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.sl-field-help {
  font-size: 11px;
  line-height: 1.4;
  color: var(--subtle);
}
.sl-field-err {
  font-size: 12px;
  color: #DC2626;
  font-weight: 500;
}
.sl-field--required .sl-field-k::after {
  content: "●";
  color: #DC2626;
  font-size: 8px;
  margin-left: 2px;
  position: relative;
  top: -1px;
}

/* ---- Suggest (auto name from RU) ---- */
.sl-suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px dashed #BFDBFE;
  border-radius: 10px;
}
.sl-suggest[hidden] { display: none; }
.sl-suggest-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.sl-suggest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-suggest-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  word-break: break-all;
}
.sl-suggest-apply {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.sl-suggest-apply:hover { background: var(--accent-strong); }

/* ---- Bilingual text editors ---- */
.sl-bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sl-lang {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.sl-lang:focus-within {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.06);
}
.sl-lang--uz:focus-within { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.sl-lang-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-lang-k {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
}
.sl-lang-counter {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color var(--motion-fast) var(--ease);
}
.sl-lang-counter.is-warn { color: #B45309; }
.sl-lang-counter.is-full { color: #DC2626; }
.sl-lang-input {
  font-size: 13px;
  line-height: 1.5;
  min-height: 86px;
  resize: vertical;
  font-family: inherit;
}
.sl-lang-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sl-tokens {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sl-tokens-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}
.sl-token {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.sl-token:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Toggle cards ---- */
.sl-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sl-toggle {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 14px 16px;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.sl-toggle:nth-child(3) { grid-column: 1 / -1; }
.sl-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sl-toggle-inner { display: flex; flex-direction: column; gap: 8px; }
.sl-toggle-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sl-toggle-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 15px;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.sl-toggle-k {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
}
.sl-toggle-state {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.sl-toggle-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.sl-toggle:hover { border-color: var(--ink); }
.sl-toggle.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.sl-toggle.is-on .sl-toggle-mark {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.sl-toggle.is-on .sl-toggle-k { color: #fff; }
.sl-toggle.is-on .sl-toggle-sub { color: rgba(255, 255, 255, 0.78); }
.sl-toggle.is-on .sl-toggle-state {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}
.sl-toggle--accent.is-on {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.sl-toggle--accent.is-on .sl-toggle-mark { color: var(--accent-strong); }

/* ---- Footer ---- */
.sl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  flex-wrap: wrap;
}
.sl-foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  flex-wrap: wrap;
}
.sl-foot-dot { color: #DC2626; font-size: 8px; position: relative; top: -1px; }
.sl-foot-sep { color: rgba(255, 255, 255, 0.3); }
.sl-foot-plus { color: rgba(255, 255, 255, 0.4); }
.sl-foot-hint { color: rgba(255, 255, 255, 0.55); }
.sl-kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.sl-foot-actions { display: inline-flex; align-items: center; gap: 14px; }
.sl-foot-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--motion-fast) var(--ease);
}
.sl-foot-link:hover { color: #fff; }
.sl-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent-strong);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.sl-submit:hover { background: #1E40AF; transform: translateX(1px); }
.sl-submit-mark { font-size: 14px; line-height: 1; }

/* ---- Preview rail (the visual anchor) ---- */
.sl-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sl-preview-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-preview-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
}
.sl-preview-meta {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
}
.sl-preview-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sl-preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--motion-base) var(--ease);
}
.sl-preview-card:hover { border-color: var(--ink); }
.sl-preview-id {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-preview-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.sl-preview-name {
  display: inline-block;
  padding: 3px 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}
.sl-preview-bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sl-preview-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 7px;
  border: 1px solid var(--border);
  min-width: 0;
}
.sl-preview-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
  min-height: 36px;
}
.sl-empty-text { color: var(--subtle); font-style: italic; }
.sl-tok {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.9em;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0;
}
.sl-preview-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sl-preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.sl-preview-stat {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border);
}
.sl-preview-stat:last-child { border-right: 0; }
.sl-preview-stat-k {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-preview-stat-v {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* ---- Side rail cards ---- */
.sl-rail-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sl-rail-card--rules {
  background: var(--bg);
  border-style: dashed;
}
.sl-rail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sl-rail-eyebrow-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
}
.sl-rail-rules {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sl-rail-rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.sl-rail-rules-mark {
  flex-shrink: 0;
  color: var(--subtle);
  font-size: 10px;
  margin-top: 2px;
}
.sl-rail-rules-mark--req { color: #DC2626; }
.sl-rail-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: slstep;
}
.sl-rail-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
}
.sl-rail-steps-n {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .sl-layout { grid-template-columns: 1fr; }
  .sl-rail { position: static; }
  .sl-bilingual { grid-template-columns: 1fr; }
  .sl-toggles { grid-template-columns: 1fr; }
  .sl-toggle:nth-child(3) { grid-column: auto; }
}
@media (max-width: 768px) {
  .sl-page .page-head { flex-direction: column; align-items: stretch; padding: 18px 20px 14px; }
  .sl-stepper { margin: 0 20px 16px; padding: 10px 12px; }
  .sl-step-k { display: none; }
  .sl-step-sep { flex: 0 0 12px; }
  .sl-banner { margin: 0 20px 14px; }
  .sl-layout { margin: 0 20px 20px; gap: 16px; }
  .sl-block { padding: 18px 18px 20px; }
  .sl-preview-bilingual { grid-template-columns: 1fr; }
  .sl-foot { flex-direction: column; align-items: stretch; }
  .sl-foot-actions { justify-content: space-between; }
  .sl-preview-stats { grid-template-columns: 1fr; }
  .sl-preview-stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .sl-preview-stat:last-child { border-bottom: 0; }
}
@media (max-width: 480px) {
  .sl-block-eyebrow { font-size: 9px; }
  .sl-block-title { font-size: 15px; }
  .sl-foot-meta { font-size: 10px; }
}

/* ============================================================
   SPARSE PAGES — Compact Layout Strategy
   Constrains content width on desktop so pages with little
   data don't stretch across a football field.
   ============================================================ */

/* Templates: tighter lexicon grid */
.page[data-page="templates"] .sl-lex {
  padding: 0 0 24px;
}
.page[data-page="templates"] .sl-specimen {
  padding: 14px 16px;
}

/* Invites: tighter roster */
.page[data-page="invites"] .ir-roster {
  padding: 0 0 24px;
}
.page[data-page="invites"] .ir-card {
  padding: 14px 16px;
}

/* Telegram: tighter user list */
.page[data-page="telegram"] .tb-list {
  padding: 0 0 24px;
}
.page[data-page="telegram"] .tb-user {
  padding: 12px 14px;
}

/* Inventory: tighter grid */
.page[data-page="inventory"] .inv-grid {
  gap: 6px;
}
.page[data-page="inventory"] .inv-unit {
  padding: 12px 14px;
}

/* Compact page-head for sparse pages */
.page[data-page="templates"] .page-head,
.page[data-page="invites"] .page-head,
.page[data-page="telegram"] .page-head,
.page[data-page="inventory"] .page-head {
  padding: 18px 24px 14px;
}
.page[data-page="templates"] .page-head h1,
.page[data-page="invites"] .page-head h1,
.page[data-page="telegram"] .page-head h1,
.page[data-page="inventory"] .page-head h1 {
  font-size: 20px;
}
.page[data-page="templates"] .page-head .sub,
.page[data-page="invites"] .page-head .sub,
.page[data-page="telegram"] .page-head .sub,
.page[data-page="inventory"] .page-head .sub {
  font-size: 12.5px;
  max-width: 54ch;
}

/* Compact stats strips for sparse pages */
.page[data-page="templates"] .sl-stats {
  margin: 0 0 14px;
}
.page[data-page="templates"] .sl-stats-cell {
  padding: 12px 16px;
}
.page[data-page="invites"] .ir-summary {
  margin: 0 0 14px;
}
.page[data-page="invites"] .ir-summary-cell {
  padding: 12px 16px;
}
.page[data-page="telegram"] .tb-bridge {
  margin: 0 0 14px;
}
.page[data-page="telegram"] .tb-strip {
  margin: 0 0 14px;
}
.page[data-page="telegram"] .tb-strip-cell {
  padding: 12px 14px;
}
.page[data-page="telegram"] .tb-toolbar {
  margin: 0 0 14px;
}
.page[data-page="inventory"] .inv-radar {
  margin: 0 0 16px;
}
.page[data-page="inventory"] .inv-radar-cell {
  padding: 14px 16px;
}
.page[data-page="inventory"] .inv-section {
  margin: 0 0 20px;
}

/* ============================================================
   TRUCK EDIT (te-*) — scoped styles for edit_truck.html
   ============================================================ */

.te-page-head h1 {
  letter-spacing: -0.02em;
}
.te-h1-mark {
  margin-right: 6px;
  font-size: 0.85em;
  opacity: 0.6;
}

/* Summary strip */
.te-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.te-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.te-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
  border-left: 1px solid var(--border);
}
.te-summary-item:first-child { border-left: 0; padding-left: 0; }
.te-summary-k {
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.te-summary-v {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
@media (max-width: 820px) {
  .te-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 0; }
  .te-summary-item { padding: 6px 0; border-left: 0; }
  .te-summary-item:nth-child(odd) { border-left: 0; }
}
@media (max-width: 540px) {
  .te-summary-grid { grid-template-columns: 1fr 1fr; }
}

/* Form block */
.te-form-block {
  margin-bottom: 16px;
}

/* ============================================================
   WAREHOUSE DETAIL (wd-*) — scoped styles for warehouse_detail.html
   ============================================================ */

.wd-page-head h1 {
  letter-spacing: -0.02em;
}
.wd-h1-mark {
  margin-right: 6px;
  font-size: 0.85em;
  opacity: 0.6;
}

/* Summary strip */
.wd-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.wd-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.wd-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
  border-left: 1px solid var(--border);
}
.wd-summary-item:first-child { border-left: 0; padding-left: 0; }
.wd-summary-k {
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.wd-summary-v {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
@media (max-width: 820px) {
  .wd-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 0; }
  .wd-summary-item { padding: 6px 0; border-left: 0; }
}
@media (max-width: 540px) {
  .wd-summary-grid { grid-template-columns: 1fr 1fr; }
}

/* Products block */
.wd-products-block {
  margin-bottom: 16px;
}

/* Cargo table */
.wd-cargo {
  display: flex;
  flex-direction: column;
}
.wd-cargo-head {
  display: grid;
  grid-template-columns: 140px 1fr 100px 80px 90px 48px;
  gap: 12px;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px 10px 0 0;
}
.wd-cargo-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px 80px 90px 48px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.wd-cargo-row:last-child { border-bottom: 0; }
.wd-cargo-row:hover { background: rgba(28, 25, 23, 0.015); }
.wd-cargo-code a {
  text-decoration: none;
}
.wd-cargo-code code.mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.wd-cargo-code a:hover code.mono {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.wd-cargo-desc {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wd-cargo-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wd-cargo-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.wd-cargo-edit:hover {
  background: var(--bg);
  color: var(--ink);
}
@media (max-width: 820px) {
  .wd-cargo-head { display: none; }
  .wd-cargo-row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 12px 14px;
  }
  .wd-cargo-desc { grid-column: 1 / -1; white-space: normal; }
  .wd-cargo-num { text-align: left; }
  .wd-cargo-edit { justify-self: end; }
}

/* Empty state */
.wd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 40px;
}
.wd-empty-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--subtle);
  margin-bottom: 16px;
}
.wd-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.wd-empty-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  max-width: 380px;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE — mobile (<=767px) and tablet (<=1023px)
   ============================================================ */

@media (max-width: 1023px) {
  .dash {
    --dash-pad: 20px;
    --dash-gap: 14px;
  }

  .dash-hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-hero-main {
    grid-column: 1 / -1;
  }

  .dash-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-summary > :last-child {
    grid-column: 1 / -1;
  }

  .dash-ops-grid {
    grid-template-columns: 1fr;
  }

  .dash-ops-grid .dash-feed-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .dash-ops-grid .dash-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-now-list {
    grid-template-columns: 1fr;
  }

  .dash-now-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "marker body cta";
    align-items: center;
  }

  .dash-fleet-row {
    grid-template-columns: 140px minmax(0, 1fr) 44px;
  }

  .ir-card {
    grid-template-columns: 110px minmax(0, 1fr) minmax(180px, 1.1fr);
  }

  .ir-card-action {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .page[data-page="products"] .cr-layout,
  .wh-layout {
    grid-template-columns: 1fr;
  }

  .page[data-page="products"] .cr-side,
  .page[data-page="warehouses"] .wh-side {
    position: static;
  }

  .page[data-page="products"] .filter-bar,
  .page[data-page="warehouses"] .filter-bar,
  .filter-bar {
    flex-wrap: wrap;
  }

  .page[data-page="products"] .filter-bar .toolbar,
  .page[data-page="warehouses"] .filter-bar .toolbar,
  .filter-bar .toolbar {
    width: 100%;
    margin-left: 0;
  }

  .page[data-page="products"] .filter-bar .toolbar-search,
  .page[data-page="warehouses"] .filter-bar .toolbar-search,
  .filter-bar .toolbar-search {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .dash-hero-grid {
    grid-template-columns: 1fr;
  }

  .dash-hero-main,
  .dash-hero-side {
    border-right: 0;
    border-bottom: 1px solid var(--dash-card-bd);
  }

  .dash-hero-side:last-child {
    border-bottom: 0;
  }

  .dash-now-item {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 10px;
  }

  .dash-now-marker,
  .dash-now-body,
  .dash-now-cta {
    grid-area: auto;
  }

  .dash-now-cta {
    justify-self: flex-start;
  }

  .dash-ops-grid .dash-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ir-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .ir-card-action {
    grid-column: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-head-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }

  .filter-bar,
  .page[data-page="products"] .filter-bar,
  .page[data-page="warehouses"] .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-bar .chips,
  .page[data-page="products"] .filter-bar .chips,
  .page[data-page="warehouses"] .filter-bar .chips {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
  }

  .filter-bar .chip,
  .page[data-page="products"] .chip,
  .page[data-page="warehouses"] .chip {
    min-height: 36px;
  }

  .table-scroll,
  .page[data-page="products"] .table-scroll,
  .page[data-page="warehouses"] .table-scroll {
    display: block;
    overflow-x: auto;
    margin: 0 -16px;
    border-top: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }

  .page[data-page="trucks"] .table-scroll {
    display: none;
  }

  .page[data-page="trucks"] .truck-card-list {
    display: flex;
  }

  .dash {
    --dash-pad: 16px;
    --dash-gap: 12px;
  }

  .dash-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 4px var(--dash-pad) 10px;
  }

  .dash-head-title {
    font-size: 20px;
  }

  .dash-head-sub {
    font-size: 12px;
  }

  .dash-head-meta {
    width: 100%;
    align-self: stretch;
    justify-content: flex-start;
  }

  .dash-head-clock-inline {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
  }

  .dash-hero {
    margin-right: var(--dash-pad);
    margin-left: var(--dash-pad);
  }

  .dash-hero-grid {
    grid-template-columns: 1fr;
    border-radius: 12px;
  }

  .dash-hero-grid::before {
    display: none;
  }

  .dash-hero-main,
  .dash-hero-side {
    border-right: 0;
    border-bottom: 1px solid var(--dash-card-bd);
  }

  .dash-hero-side:last-child {
    border-bottom: 0;
  }

  .dash-hero-main,
  .dash-hero-side {
    padding: 16px;
  }

  .dash-hero-foot,
  .dash-hero-legend {
    gap: 10px 14px;
  }

  .dash-summary {
    grid-template-columns: 1fr 1fr;
    margin-right: var(--dash-pad);
    margin-left: var(--dash-pad);
    gap: 8px;
  }

  .dash-summary > :last-child {
    grid-column: 1 / -1;
  }

  .dash-summary-card,
  .dash-summary-card--bot {
    grid-column: auto;
    min-height: 84px;
  }

  .dash-ops-grid {
    display: flex;
    flex-direction: column;
    margin-right: var(--dash-pad);
    margin-left: var(--dash-pad);
  }

  .dash-ops-col {
    display: contents;
  }

  .dash-ops-grid .dash-quick { order: 1; }
  .dash-ops-grid .dash-fleet { order: 2; }
  .dash-ops-grid .dash-tg { order: 3; }
  .dash-ops-grid .dash-pulse { order: 4; }
  .dash-ops-grid .dash-feed { order: 5; }

  .dash-now,
  .dash-fleet,
  .dash-tg,
  .dash-pulse,
  .dash-feed,
  .dash-quick {
    margin-right: var(--dash-pad);
    margin-left: var(--dash-pad);
    padding: 14px;
    border-radius: 10px;
  }

  .dash-section-head {
    gap: 8px;
  }

  .dash-now-list {
    grid-template-columns: 1fr;
  }

  .dash-now-item {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 10px;
    padding: 12px;
  }

  .dash-now-marker,
  .dash-now-body,
  .dash-now-cta {
    grid-area: auto;
  }

  .dash-now-marker {
    min-width: 0;
  }

  .dash-now-cta {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    justify-self: stretch;
  }

  .dash-fleet-row {
    grid-template-columns: 120px minmax(0, 1fr) 36px;
    gap: 8px;
    padding: 10px;
  }

  .dash-fleet-row-status {
    min-width: 0;
  }

  .dash-fleet-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dash-tg-stats,
  .dash-tg-stats--compact {
    grid-template-columns: 1fr;
  }

  .dash-tg-stats > div,
  .dash-tg-stats--compact > div {
    border-right: 0;
    border-bottom: 1px solid var(--dash-card-bd);
  }

  .dash-tg-stats > div:last-child,
  .dash-tg-stats--compact > div:last-child {
    border-bottom: 0;
  }

  .dash-pulse-chart {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .dash-feed-item,
  .dash-feed--compact .dash-feed-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
  }

  .dash-feed-time,
  .dash-feed-rail {
    display: none;
  }

  .dash-feed-line {
    gap: 5px;
  }

  .dash-quick-grid,
  .dash-ops-grid .dash-quick-grid {
    grid-template-columns: 1fr;
  }

  .dash-quick-link {
    min-height: 54px;
  }

  .ir-summary {
    grid-template-columns: 1fr;
    margin: 0 16px 14px;
  }

  .ir-summary-cell {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .ir-summary-cell:last-child {
    border-bottom: 0;
  }

  .ir-roster {
    padding: 0 16px 24px;
  }

  .ir-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .ir-card-action {
    grid-column: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .ir-copy {
    min-height: 44px;
  }

  .page[data-page="products"] .cr-layout,
  .wh-layout {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }

  .page[data-page="products"] .cr-side,
  .page[data-page="warehouses"] .wh-side {
    flex-direction: column;
  }

  .page[data-page="products"] .cr-side > *,
  .page[data-page="warehouses"] .wh-side > * {
    min-width: 0;
  }

  .page[data-page="warehouses"] .wh-table {
    min-width: 760px;
  }

  .page[data-page="products"] .t {
    min-width: 760px;
  }

  .page[data-page="products"] .table-foot,
  .page[data-page="warehouses"] .table-foot {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .dash {
    --dash-pad: 12px;
  }

  .dash-head-title {
    font-size: 18px;
  }

  .dash-hero-num {
    font-size: 48px;
  }

  .dash-hero-figure {
    align-items: flex-start;
    flex-direction: column;
  }

  .dash-hero-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .dash-summary {
    grid-template-columns: 1fr;
  }

  .dash-summary > :last-child {
    grid-column: auto;
  }

  .dash-fleet-row {
    grid-template-columns: 1fr auto;
  }

  .dash-fleet-row-bar {
    grid-column: 1 / -1;
    order: 3;
  }

  .dash-tg-bar {
    width: 100%;
  }

  .dash-tg-bar-meta {
    margin-left: auto;
  }

  .dash-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-section-count,
  .dash-section-link,
  .dash-pulse-total {
    align-self: flex-start;
  }

  .dash-quick-link {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .ir-code {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .page[data-page="products"] .t {
    min-width: 680px;
  }

  .page[data-page="warehouses"] .wh-table {
    min-width: 700px;
  }
}
