:root {
  color-scheme: dark;
  --canvas: #191a1f;
  --panel: #25272e;
  --panel-light: #2b2e36;
  --line: #3a3c44;
  --blue: #4b72ee;
  --gold: #d9bd7d;
  --muted: #a6a8b0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -25%, rgba(77, 85, 111, 0.14), transparent 54%),
    var(--canvas);
}

.topbar {
  min-height: 76px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #30323a;
  background: linear-gradient(110deg, #24262d 0%, #202229 100%);
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: max-content;
  gap: 12px;
  color: #f5f5f7;
  text-decoration: none;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.topbar-actions {
  gap: 17px;
}

.search-box {
  width: min(250px, 22vw);
  min-width: 160px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid #383b45;
  border-radius: 8px;
  background: rgba(25, 27, 33, 0.42);
}

.search-box svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  stroke: #a6a8b5;
  stroke-width: 1.5;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #eeeef1;
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #858791;
}

.icon-button {
  position: relative;
  width: 27px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.gear-button {
  width: 34px;
  height: 34px;
  border: 1px solid #41434d;
  border-radius: 50%;
  background: linear-gradient(145deg, #343741, #25272e);
  text-decoration: none;
}

.gear-button:hover {
  border-color: #606675;
  background: linear-gradient(145deg, #414652, #2d3038);
}

.gear-button svg {
  width: 18px;
  height: 18px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #41434d;
  border-radius: 50%;
  background: linear-gradient(145deg, #3c404b, #292b34);
  color: #f4f4f6;
  font-size: 14px;
}

.language-switcher {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #393b44;
  border-radius: 9px;
  background: rgba(17, 18, 22, 0.36);
}

.language-button {
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  color: #aeb0b9;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.language-button:hover,
.language-button.is-active {
  color: #fff;
  background: #3b3e49;
}

.dashboard-shell {
  width: min(100% - 48px, 1200px);
  margin: 0 auto;
  padding: 25px 0 40px;
}

.page-title {
  margin: 0 0 23px;
  text-align: center;
  color: #f4f4f6;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-card,
.metric-card {
  overflow: hidden;
  border: 1px solid #3b3d45;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 36%, rgba(75, 80, 95, 0.19), transparent 52%),
    linear-gradient(145deg, #2b2d35 0%, #23252c 76%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 10px 24px rgba(0, 0, 0, 0.1);
}

.feature-card {
  min-height: 346px;
  position: relative;
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #c8cbd4;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.015em;
}

.eyebrow-gold {
  color: var(--gold);
}

.artwork {
  position: relative;
  height: 174px;
  flex: 0 0 174px;
  overflow: hidden;
}

.paperwork-art {
  width: 245px;
  max-width: 75%;
  margin: -1px auto 0;
  filter: drop-shadow(0 10px 22px rgba(81, 137, 255, 0.18));
}

.paper-sheet {
  position: absolute;
  left: 50%;
  bottom: 23px;
  width: 104px;
  height: 106px;
  padding: 29px 17px 0;
  transform: translateX(-58%) perspective(220px) rotateX(7deg) rotateZ(9deg);
  border: 1px solid rgba(187, 217, 255, 0.68);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(167, 202, 255, 0.28), rgba(92, 136, 226, 0.1));
  box-shadow: 0 12px 0 -3px rgba(157, 191, 255, 0.14), 0 18px 25px rgba(0, 0, 0, 0.35);
}

.paper-sheet span {
  height: 2px;
  display: block;
  margin-bottom: 8px;
  background: rgba(221, 236, 255, 0.8);
}

.paper-sheet span:nth-child(2) {
  width: 75%;
}

.paper-sheet span:nth-child(4) {
  width: 58%;
}

.cloud-lock {
  position: absolute;
  z-index: 2;
  top: 25px;
  left: 52%;
  width: 86px;
  height: 56px;
  border: 1px solid rgba(198, 222, 255, 0.75);
  border-radius: 34px 34px 22px 22px;
  background: linear-gradient(150deg, rgba(174, 211, 255, 0.5), rgba(79, 120, 214, 0.48));
  box-shadow: 0 0 24px rgba(111, 164, 255, 0.36), inset 0 0 16px rgba(225, 238, 255, 0.23);
}

.cloud-lock::before,
.cloud-lock::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(198, 222, 255, 0.72);
  border-bottom: 0;
  background: #687fac;
}

.cloud-lock::before {
  left: 10px;
  bottom: 25px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.cloud-lock::after {
  right: 11px;
  bottom: 24px;
  width: 43px;
  height: 43px;
  border-radius: 50%;
}

.lock {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 35px;
  width: 17px;
  height: 15px;
  border: 2px solid #e6f2ff;
  border-radius: 3px;
  background: #5276bf;
}

.lock::before {
  position: absolute;
  left: 3px;
  bottom: 9px;
  width: 7px;
  height: 8px;
  content: "";
  border: 2px solid #e6f2ff;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.paper-glow {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 170px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(67, 117, 244, 0.18);
  filter: blur(18px);
}

.route-art {
  width: min(100%, 430px);
  margin: 0 auto;
}

.world-grid {
  position: absolute;
  inset: 20px 10px 4px;
  opacity: 0.65;
  background:
    radial-gradient(ellipse at 30% 43%, rgba(114, 136, 172, 0.72) 0 12%, transparent 12.5%),
    radial-gradient(ellipse at 42% 51%, rgba(114, 136, 172, 0.65) 0 8%, transparent 8.5%),
    radial-gradient(ellipse at 62% 40%, rgba(114, 136, 172, 0.68) 0 13%, transparent 13.5%),
    radial-gradient(ellipse at 73% 65%, rgba(114, 136, 172, 0.6) 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 51% 65%, rgba(114, 136, 172, 0.58) 0 6%, transparent 6.5%);
  filter: drop-shadow(0 0 8px rgba(99, 147, 226, 0.55));
  mask-image: radial-gradient(ellipse, #000 30%, transparent 73%);
}

.route-line {
  position: absolute;
  height: 1px;
  transform-origin: left center;
  border-top: 1px solid rgba(91, 158, 255, 0.95);
  box-shadow: 0 0 7px rgba(79, 146, 255, 0.8);
}

.route-one {
  top: 75px;
  left: 16%;
  width: 67%;
  transform: rotate(7deg);
}

.route-two {
  top: 126px;
  left: 24%;
  width: 52%;
  transform: rotate(-17deg);
  border-color: rgba(226, 191, 117, 0.92);
}

.route-three {
  top: 57px;
  left: 47%;
  width: 35%;
  transform: rotate(24deg);
  border-color: rgba(226, 191, 117, 0.85);
}

.route-node {
  position: absolute;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 2px solid #f1d189;
  border-radius: 50%;
  background: #252a35;
  box-shadow: 0 0 9px rgba(240, 197, 104, 0.9);
}

.node-one { top: 68px; left: 22%; }
.node-two { top: 104px; left: 45%; }
.node-three { top: 53px; left: 69%; }
.node-four { top: 132px; left: 77%; }

.ship {
  position: absolute;
  width: 25px;
  height: 6px;
  border: 1px solid #e7bd72;
  border-top: 2px solid #608ddd;
  transform: skewX(-24deg);
  background: linear-gradient(90deg, #6d8bc4 50%, #b88749 50%);
  box-shadow: 0 0 10px rgba(110, 150, 231, 0.35);
}

.ship-one { top: 92px; left: 34%; }
.ship-two { top: 40px; left: 57%; transform: scale(0.75) skewX(-24deg); }

.feature-copy {
  position: relative;
  z-index: 2;
  margin-top: auto;
  text-align: center;
}

.feature-copy h2 {
  margin: 0;
  color: #f4f4f6;
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.feature-copy p {
  margin: 5px 0 13px;
  color: #b0b1b8;
  font-size: 13px;
}

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: filter 120ms ease, transform 120ms ease;
}

.button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.button-primary {
  border-color: #7898ff;
  background: linear-gradient(180deg, #557bf0, #345bd0);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(81, 117, 239, 0.16), inset 0 1px rgba(255, 255, 255, 0.22);
}

.button-outline {
  border-color: #c4a765;
  background: rgba(26, 27, 32, 0.28);
  color: var(--gold);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 17px;
}

.metric-card {
  position: relative;
  min-height: 97px;
  padding: 16px 18px 13px;
}

.metric-card p {
  margin: 0 0 7px;
  color: #c7c8ce;
  font-size: 14px;
}

.metric-card strong {
  color: #f5f5f7;
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.sparkline {
  position: absolute;
  right: 15px;
  bottom: 14px;
  width: 88px;
  height: 34px;
  opacity: 0.75;
}

.sparkline path {
  stroke-width: 1.5;
}

.sparkline-blue path { stroke: #9da2b3; }
.sparkline-gold path { stroke: #e2d5b3; }

@media (max-width: 760px) {
  .topbar {
    min-height: 68px;
    padding: 0 18px;
  }

  .search-box,
  .icon-button,
  .avatar {
    display: none;
  }

  .topbar-actions {
    gap: 0;
  }

  .dashboard-shell {
    width: min(100% - 32px, 540px);
    padding-top: 22px;
  }

  .feature-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 330px;
  }

  .metric-card {
    min-height: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Shared form + layout primitives ---- */
[x-cloak] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 16px; }

.admin-shell {
  width: min(100% - 48px, 1100px);
  margin: 0 auto;
  padding: 38px 0 48px;
}

.admin-header {
  margin-bottom: 24px;
}

.admin-header .field-hint {
  margin: 7px 0 0;
  max-width: 720px;
}

.admin-grid {
  display: grid;
  gap: 20px;
}

.admin-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.admin-choice-card {
  min-height: 190px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
}

.admin-choice-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-company-search {
  max-width: 320px;
}

.company-table {
  min-width: 1180px;
}

.company-role-column {
  min-width: 92px;
  text-align: center;
}

.company-address {
  display: block;
  margin-top: 4px;
}

.company-row-actions {
  min-width: 82px;
  text-align: right;
}

.company-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.company-dialog-actions {
  position: sticky;
  bottom: -16px;
  padding-top: 10px;
  background: #25272e;
}

.wizard-spacer {
  flex: 1;
}

.admin-card {
  padding: 24px;
}

.admin-permission-list {
  display: grid;
  gap: 16px;
}

.admin-permission-row {
  margin: 0;
  padding: 16px 18px;
  border-color: var(--line);
  border-radius: 10px;
}

.admin-action-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
}

.admin-action-option {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #3b3e48;
  border-radius: 8px;
  background: rgba(18, 19, 23, 0.26);
}

.gear-button {
  display: grid;
}

@media (max-width: 860px) {
  .admin-action-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-choice-grid {
    grid-template-columns: 1fr;
  }
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-company-search {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    width: min(100% - 28px, 1100px);
    padding-top: 28px;
  }

  .admin-card {
    padding: 18px;
  }

  .admin-action-options {
    grid-template-columns: 1fr;
  }
}
.narrow-shell { max-width: 460px; }
.feature-grid-single { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }

.logout-button {
  padding: 6px 10px;
  border: 1px solid #393b44;
  border-radius: 8px;
  color: #c3c4ca;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.logout-button:hover { color: #fff; background: #3b3e49; }

.panel {
  padding: 20px 22px;
  border: 1px solid #3b3d45;
  border-radius: 14px;
  background: linear-gradient(145deg, #2b2d35 0%, #23252c 76%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 10px 24px rgba(0, 0, 0, 0.1);
}

.section-title { margin: 0; color: #f4f4f6; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 12px; font-weight: 500; }
.field-hint { margin: 0; color: var(--muted); font-size: 12px; }
.field-error { margin: 0; color: #f08a8a; font-size: 12px; }

.control {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #6a5d3c;
  border-radius: 8px;
  color: #f1f1f4;
  background: rgba(25, 27, 33, 0.55);
  font: inherit;
  font-size: 14px;
}
.control:focus { outline: 2px solid rgba(75, 114, 238, 0.55); outline-offset: 1px; }
.control:disabled { opacity: 0.5; }
.control.is-invalid { border-color: #d96a6a; }
.control option { color: #f1f1f4; background: #25272e; }

.select-row { display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }

.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; white-space: nowrap; }
.button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }
.link-button { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge-parsed { color: #9fd8ae; background: rgba(76, 175, 106, 0.14); border: 1px solid rgba(76, 175, 106, 0.4); }
.badge-manual { color: var(--gold); background: rgba(217, 189, 125, 0.12); border: 1px solid rgba(217, 189, 125, 0.4); }

.banner { margin: 0; padding: 10px 14px; border: 1px solid #3b3d45; border-radius: 10px; color: #d7d8de; background: rgba(25, 27, 33, 0.5); font-size: 13px; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner-ok { border-color: rgba(76, 175, 106, 0.45); }
.banner-warn { border-color: rgba(217, 189, 125, 0.5); }
.banner-error { border-color: rgba(217, 106, 106, 0.6); color: #f3b3b3; }

.jurisdiction-badge { display: inline-block; padding: 3px 10px; border: 1px solid #7898ff; border-radius: 6px; color: #cdd8ff; background: rgba(75, 114, 238, 0.18); font-size: 13px; font-weight: 600; }
.readonly-value { min-height: 40px; display: flex; align-items: center; gap: 8px; }

/* ---- Create wizard ---- */
.wizard-shell { width: min(100% - 48px, 860px); margin: 0 auto; padding: 25px 0 48px; display: flex; flex-direction: column; gap: 18px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; color: #8d909b; font-size: 13px; }
.stepper-item.is-active { color: #5b82f5; font-weight: 600; }
.stepper-item.is-done { color: #c3c4ca; }
.stepper-line { width: 78px; height: 2px; border-radius: 2px; background: #3a3c44; }
.stepper-line.is-done { background: var(--blue); }

.wizard-card .paperwork-art { margin: 0 auto; }
.dropzone {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 1.5px dashed #4b72ee;
  border-radius: 10px;
  color: #f1f1f4;
  background: linear-gradient(145deg, rgba(75, 114, 238, 0.12), rgba(75, 114, 238, 0.04));
  text-align: center;
  cursor: pointer;
}
.dropzone strong { font-size: 17px; font-weight: 600; }
.dropzone span { color: #b0b1b8; font-size: 12px; }
.dropzone.is-dragging { background: rgba(75, 114, 238, 0.24); }
.file-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid #3b3d45; border-radius: 8px; background: rgba(25, 27, 33, 0.6); color: #eeeef1 !important; font-size: 13px !important; }
.progress { width: 64px; height: 4px; border-radius: 4px; background: #3a3c44; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--blue); transition: width 160ms ease; }

.wizard-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 14px; }
.total-line { margin: 0 auto 0 0; color: #c7c8ce; font-size: 14px; }
.line-card { padding: 16px; border: 1px solid #3b3d45; border-radius: 12px; background: rgba(25, 27, 33, 0.35); }
.line-source { display: flex; align-items: center; gap: 8px; margin: 0; color: #c7c8ce; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; background: rgba(8, 9, 12, 0.72); }
.modal { width: min(100%, 640px); background: #25272e; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.similar { padding: 10px 12px; border: 1px solid #3b3d45; border-radius: 10px; }
.similar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; color: #d7d8de; font-size: 13px; }

/* ---- Batch list ---- */
.list-shell { width: min(100% - 48px, 1100px); }
.list-header, .detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.list-title, .detail-title { margin: 0; color: #f4f4f6; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; }
.filter-control { width: auto; min-width: 200px; }

.batch-card { position: relative; margin-bottom: 14px; padding: 16px 20px 14px 24px; overflow: hidden; border: 1px solid #3b3d45; border-radius: 12px; background: linear-gradient(145deg, #2b2d35 0%, #23252c 76%); }
.batch-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--blue); }
.batch-card.status-eu_export_ready::before { background: var(--gold); }
.batch-card.status-closed::before { background: #666872; }
.batch-card.status-cancelled::before { background: #b85c5c; }
.batch-card-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.batch-label { margin: 0; color: #a6a8b0; font-size: 13px; }
.batch-number { color: #f5f5f7; font-size: 22px; font-weight: 500; text-decoration: none; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid #6a5d3c; border-radius: 999px; color: var(--gold); background: rgba(217, 189, 125, 0.08); font-size: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f1d189; box-shadow: 0 0 8px rgba(240, 197, 104, 0.8); }
.batch-meta { display: flex; align-items: flex-end; gap: 38px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #353740; }
.batch-meta dt { color: var(--gold); font-size: 13px; }
.batch-meta dd { margin: 2px 0 0; color: #f1f1f4; font-size: 15px; font-weight: 500; }
.batch-meta-action { margin-left: auto; }
.view-details { color: var(--gold); font-size: 14px; text-decoration: none; }

.progress-steps { display: flex; gap: 0; margin: 16px 0 0; padding: 0; list-style: none; }
.progress-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #8d909b; font-size: 12px; }
.progress-step + .progress-step::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 3px; background: #3a3c44; }
.progress-step.is-completed + .progress-step::before, .progress-step.is-active + .progress-step::before { background: var(--blue); }
.progress-node { position: relative; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #4a4d57; border-radius: 50%; background: #2b2d35; font-size: 12px; }
.progress-step.is-completed .progress-node, .progress-step.is-active .progress-node { border-color: #7898ff; background: var(--blue); color: #fff; }
.progress-step.is-partial_ready .progress-node { border-color: var(--gold); background: #8a7342; color: #fff; }
.progress-step.is-completed, .progress-step.is-active { color: #f1f1f4; }

/* ---- Batch detail ---- */
.detail-shell { width: min(100% - 48px, 1200px); margin: 0 auto; padding: 25px 0 48px; }
.detail-grid { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr); gap: 36px; align-items: start; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.doc-card { padding: 14px; border: 1px solid #3b3d45; border-radius: 12px; background: rgba(25, 27, 33, 0.35); }
.doc-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: #e6e7ec; font-size: 13px; word-break: break-all; }
.doc-icon { width: 12px; height: 15px; border: 1.5px solid #a6a8b5; border-radius: 2px; flex: none; }
.timeline { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.timeline-step { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #8d909b; }
.timeline-step.is-active { background: rgba(75, 114, 238, 0.14); color: #f1f1f4; }
.timeline-step.is-completed { color: #e6e7ec; }
.timeline-node { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #3a3c44; color: #fff; font-size: 13px; flex: none; }
.timeline-step.is-active .timeline-node, .timeline-step.is-completed .timeline-node { background: var(--blue); }
.timeline-step.is-partial_ready .timeline-node { background: #8a7342; }
.timeline-body { display: flex; flex-direction: column; flex: 1; }
.timeline-name { font-size: 17px; font-weight: 500; line-height: 1.35; }
.timeline-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
.timeline-check { margin-left: auto; color: #f1f1f4; }

.detail-rows { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 16px; border: 1px solid #6a5d3c; border-radius: 8px; }
.detail-label { color: var(--gold); font-size: 15px; }
.detail-value { display: inline-flex; align-items: center; gap: 8px; color: #f1f1f4; font-size: 15px; text-align: right; }
.detail-control { width: 220px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 8px 10px; border-bottom: 1px solid #3b3d45; color: var(--gold); font-weight: 500; text-align: left; white-space: nowrap; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid #30323a; color: #e6e7ec; vertical-align: top; }
.totals { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; }
.totals dt { color: var(--muted); font-size: 12px; }
.totals dd { margin: 2px 0 0; color: #f1f1f4; font-size: 15px; font-weight: 500; }
.financial-summary { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr; gap: 18px; padding: 16px; border: 1px solid #40434d; border-radius: 12px; background: linear-gradient(145deg, rgba(75,114,238,.1), rgba(217,189,125,.05)); }
.financial-summary h4 { margin: 0 0 4px; color: var(--gold); font-size: 15px; }
.financial-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.financial-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.financial-grid div { padding: 10px; border: 1px solid #3a3d46; border-radius: 9px; background: rgba(21,23,29,.5); }
.financial-grid dt { color: var(--muted); font-size: 11px; }
.financial-grid dd { margin: 5px 0 0; color: #f4f4f6; font-size: 13px; line-height: 1.6; }
.financial-grid .financial-margin { border-color: rgba(91,194,139,.5); }
.financial-grid .financial-margin.is-negative { border-color: rgba(230,100,100,.6); }
.map { height: 260px; border-radius: 10px; overflow: hidden; border: 1px solid #3b3d45; }

@media (max-width: 860px) {
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .financial-summary { grid-template-columns: 1fr; }
  .financial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-meta { flex-wrap: wrap; gap: 16px; }
  .batch-meta-action { margin-left: 0; }
  .detail-row { flex-direction: column; align-items: flex-start; }
  .detail-control { width: 100%; }
  .stepper-line { width: 28px; }
}

/* ---- Route Plan builder ---- */
.detail-grid-wide { grid-template-columns: minmax(380px, 6fr) minmax(0, 6fr); }
.detail-grid > * { min-width: 0; }
.route-plan { margin-top: 4px; }
.route-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-progress { height: 4px; overflow: hidden; border-radius: 999px; background: #2c2f37; }
.route-progress-bar { display: block; height: 100%; background: var(--blue); transition: width 180ms ease; }
.route-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.route-item { position: relative; border: 1px solid #353740; border-radius: 10px; background: rgba(25, 27, 33, 0.35); }
.route-item.is-location { margin-right: 42px; }
.route-item.is-transport { margin-left: 42px; }
.route-item.is-terminal { margin-right: 42px; border-style: dashed; background: rgba(217, 189, 125, 0.05); }
.terminal-node { width: 18px; height: 18px; border: 2px solid var(--gold); border-radius: 50%; }
.route-item.is-active { border-color: rgba(75, 114, 238, 0.6); background: rgba(75, 114, 238, 0.1); }
.route-item.is-partial_ready { border-color: rgba(217, 189, 125, 0.6); }
.route-item.is-completed .timeline-node { background: var(--blue); }
.route-item.is-active .timeline-node { background: var(--blue); }
.route-item.is-partial_ready .timeline-node { background: #8a7342; }
.route-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.route-summary { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 0; padding: 6px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.route-item.is-pending .route-summary { color: #8d909b; }
.route-drawer { padding: 4px 14px 14px; border-top: 1px solid #353740; }
.route-docs-summary { padding: 2px 14px 10px 44px; }
.route-docs-summary h4 { font-size: 11px; color: var(--muted); }
.route-docs-summary .doc-checklist { gap: 2px; }
.route-docs-summary .doc-checklist li { min-height: 24px; }
.route-add-area { margin: 10px 0 0; }
.route-add-trigger { margin-left: 0; }
.destination-content { padding-top: 10px; }
.destination-details { display: grid; gap: 10px; margin: 0; }
.destination-details div { display: grid; gap: 4px; }
.destination-details dd { margin: 0; }
.route-actions-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-action-config-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px; border: 1px solid #353740; border-radius: 8px; }
.checkbox-row { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.route-step-actions { padding-top: 8px; }
.route-action-card { padding: 12px; border-color: rgba(75, 114, 238, 0.3); background: rgba(75, 114, 238, 0.05); }
.route-action-card.is-completed { border-color: rgba(109, 185, 132, 0.35); background: rgba(109, 185, 132, 0.05); }
.route-docs h4 { margin: 0; }
.doc-checklist { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.doc-checklist li { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; }
.doc-checklist .is-ok { color: #9fd8ae; }
.doc-checklist .is-missing { color: #f3b3b3; }
.document-icon-button { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 5px; border: 1px solid #4a4d57; border-radius: 6px; color: #d9dce7; background: #2a2d35; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.document-icon-button:hover { border-color: var(--blue); color: #fff; }
.document-pdf-button { color: #f0b1b1; }
.route-upload-input { display: none; }
.doc-actions { display: inline-flex; align-items: center; gap: 12px; }
.link-button.danger, .button.danger { color: #f08a8a; }
.button.danger { border-color: rgba(217, 106, 106, 0.6); }
.preview-modal { width: min(100%, 980px); }
.preview-frame { width: 100%; height: 72vh; border: 1px solid #3b3d45; border-radius: 8px; background: #fff; }
.header-actions { display: inline-flex; align-items: center; gap: 12px; }
.nav-link { text-decoration: none; }

/* ---- Control Tower map ---- */
.map-shell { width: min(100% - 48px, 1400px); margin: 0 auto; padding: 25px 0 32px; }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid #4a4d57; border-radius: 999px; color: #8d909b; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: #7898ff; color: #f1f1f4; background: rgba(75, 114, 238, 0.16); }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.chip.status-draft .chip-dot { background: #a6a8b0; }
.chip.status-eu_export_ready .chip-dot { background: var(--gold); }
.chip.status-closed .chip-dot { background: #4caf6a; }
.chip-count { color: var(--muted); font-size: 12px; }
.map-stats { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; }
.map-stats strong { color: #f1f1f4; }
.map-full { height: calc(100vh - 260px); min-height: 420px; }
.map .dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6); }
.map-popup { display: flex; flex-direction: column; gap: 4px; min-width: 210px; color: #1d1f25; font-size: 13px; }
.map-popup-title { font-size: 15px; font-weight: 600; }
.map-popup-row { display: flex; justify-content: space-between; gap: 12px; }
.map-popup-row span { color: #666a75; }
.map-popup-link { margin-top: 4px; color: #2f56d6; font-weight: 500; }
.map-legend { display: flex; gap: 20px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.map-legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend-line { display: inline-block; width: 28px; border-top: 3px solid var(--blue); }
.legend-planned { border-top-style: dashed; }

@media (max-width: 860px) {
  .detail-grid-wide { grid-template-columns: minmax(0, 1fr); }
  .map-stats { margin-left: 0; }
  .route-item.is-location, .route-item.is-terminal { margin-right: 16px; }
  .route-item.is-transport { margin-left: 16px; }
}
