.transport-map-page {
  --tfvm-ink: #213a35;
  --tfvm-muted: #7c8882;
  --tfvm-green: #247352;
  --tfvm-blue: #467ca4;
  --tfvm-amber: #b28b46;
  --tfvm-paper: #f7f8f4;
  --tfvm-line: #e6e9e2;
  color: var(--tfvm-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.transport-map-page *,
.transport-map-page *::before,
.transport-map-page *::after {
  box-sizing: border-box;
}

.transport-map-shell {
  background: var(--tfvm-paper);
  border: 1px solid #dde5d8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(32, 58, 35, 0.04);
}

.transport-map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.transport-map-heading small,
.transport-map-eyebrow {
  color: #688271;
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.transport-map-heading h2 {
  color: #172b25;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 5px 0 4px;
}

.transport-map-heading p {
  color: var(--tfvm-muted);
  font-size: 12px;
  margin: 0;
}

.transport-map-button {
  align-items: center;
  background: #fff;
  border: 1px solid #dce2d7;
  border-radius: 7px;
  color: #33443d;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  white-space: nowrap;
}

.transport-map-button.primary {
  background: #254e39;
  border-color: #254e39;
  color: #fff;
}

.transport-map-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.transport-map-button svg,
.transport-map-icon-button svg,
.transport-map-page svg.lucide {
  height: 17px;
  stroke-width: 1.75;
  width: 17px;
}

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

.transport-map-stat {
  background: #fff;
  border: 1px solid var(--tfvm-line);
  border-radius: 9px;
  color: var(--tfvm-ink);
  min-height: 84px;
  padding: 14px 16px;
  text-align: left;
}

.transport-map-stat.is-active {
  border-color: #aec39b;
  box-shadow: 0 2px 8px rgba(38, 73, 50, 0.07);
}

.transport-map-stat span {
  align-items: center;
  color: #667b68;
  display: flex;
  font-size: 11px;
  gap: 7px;
}

.transport-map-stat strong {
  color: #172b25;
  display: block;
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
  margin-top: 10px;
}

.transport-map-operations {
  background: #fff;
  border: 1px solid #dfe5d9;
  border-radius: 10px;
  overflow: hidden;
}

.transport-map-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--tfvm-line);
  display: flex;
  justify-content: space-between;
  min-height: 60px;
  padding: 15px 20px;
}

.transport-map-toolbar-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.transport-map-toolbar-title h3 {
  color: #20362f;
  font-size: 13px;
  font-weight: 750;
  margin: 0;
}

.transport-map-toolbar-title span {
  background: #f1f4eb;
  border-radius: 4px;
  color: #778b65;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 6px;
  text-transform: uppercase;
}

.transport-map-body {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: clamp(580px, 68vh, 820px);
  min-height: 580px;
}

.transport-map-panel {
  background: #fff;
  border-right: 1px solid var(--tfvm-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 500;
}

.transport-map-controls {
  padding: 16px 16px 0;
}

.transport-map-search {
  align-items: center;
  border: 1px solid #dfe5d9;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
}

.transport-map-search input,
.transport-map-control select {
  background: #fff;
  border: 0;
  color: #213a35;
  font: inherit;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.transport-map-search input {
  font-size: 11px;
}

.transport-map-control-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.transport-map-control {
  min-width: 0;
}

.transport-map-control span {
  color: #7c8b7c;
  display: block;
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 4px;
}

.transport-map-control select {
  border: 1px solid #e3e7df;
  border-radius: 5px;
  color: #5e6c5b;
  font-size: 10px;
  height: 34px;
  padding: 7px;
}

.transport-map-tabs {
  background: #f4f6f1;
  border-radius: 6px;
  display: flex;
  gap: 3px;
  margin-top: 12px;
  padding: 3px;
}

.transport-map-tabs button {
  border: 0;
  border-radius: 4px;
  color: #89937e;
  flex: 1;
  font-size: 10px;
  padding: 8px 7px;
  white-space: nowrap;
}

.transport-map-tabs button.selected {
  background: #fff;
  box-shadow: 0 1px 5px rgba(45, 62, 23, 0.13);
  color: #2d5134;
  font-weight: 700;
}

.transport-map-tabs button:disabled {
  cursor: wait;
  opacity: .62;
}

.transport-map-time-tabs {
  margin-top: 8px;
}

.transport-map-time-tabs button {
  font-size: 9px;
}

.transport-map-list-meta {
  align-items: center;
  color: #8b9587;
  display: flex;
  font-size: 9px;
  justify-content: space-between;
  padding: 15px 0 11px;
}

.transport-map-list-meta button {
  background: transparent;
  border: 0;
  color: #688e5e;
  font: inherit;
  font-weight: 700;
}

.transport-map-vehicle-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #dfe5d8 transparent;
  scrollbar-width: thin;
}

.transport-map-vehicle-row {
  background: #fff;
  border: 0;
  border-top: 1px solid #eff1ec;
  color: inherit;
  display: block;
  padding: 15px 16px 13px;
  position: relative;
  text-align: left;
  transition: background .15s;
  width: 100%;
}

.transport-map-vehicle-row:hover {
  background: #fafbf7;
}

.transport-map-vehicle-row.is-selected {
  background: #f2f6e9;
}

.transport-map-vehicle-row.is-selected::before {
  background: #7c9f51;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 3px;
}

.transport-map-row-heading,
.transport-map-row-line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.transport-map-row-heading {
  margin-bottom: 10px;
}

.transport-map-tile {
  align-items: center;
  background: #fafbf7;
  border: 1px solid #e7eae0;
  border-radius: 7px;
  color: #839573;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.transport-map-row-identity {
  flex: 1;
  min-width: 0;
}

.transport-map-plate {
  color: #172b25;
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
}

.transport-map-model,
.transport-map-row-line {
  color: #879385;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport-map-row-line + .transport-map-row-line {
  margin-top: 7px;
}

.transport-map-status {
  align-items: center;
  background: #eff6ee;
  border-radius: 4px;
  color: #477454;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 8px;
  gap: 5px;
  padding: 4px 6px;
  white-space: nowrap;
}

.transport-map-status.busy {
  background: #edf2f7;
  color: #5c7d9c;
}

.transport-map-status.missing,
.transport-map-status.unavailable {
  background: #f8f4e9;
  color: #997f49;
}

.transport-map-dot {
  border-radius: 999px;
  display: inline-block;
  height: 6px;
  width: 6px;
}

.transport-map-dot.available { background: var(--tfvm-green); }
.transport-map-dot.busy { background: var(--tfvm-blue); }
.transport-map-dot.missing,
.transport-map-dot.unavailable,
.transport-map-dot.unknown { background: var(--tfvm-amber); }

.transport-map-list-footer {
  align-items: center;
  border-top: 1px solid var(--tfvm-line);
  color: #91a084;
  display: flex;
  font-size: 9px;
  gap: 7px;
  padding: 13px 16px;
}

.transport-map-stage {
  background: #e8eee2;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.transport-map-leaflet {
  height: 100%;
  width: 100%;
}

.transport-map-page .leaflet-container {
  background: #e8eee2;
  font: inherit;
}

.transport-map-source {
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #dbe3d0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(41, 61, 35, .10);
  display: flex;
  gap: 9px;
  left: 18px;
  padding: 10px 12px;
  position: absolute;
  top: 18px;
  z-index: 600;
}

.transport-map-source strong {
  display: block;
  font-size: 10px;
  font-weight: 750;
}

.transport-map-source span {
  color: #96a087;
  display: block;
  font-size: 8px;
  margin-top: 2px;
}

.transport-map-source-icon {
  align-items: center;
  background: #eef3e6;
  border-radius: 6px;
  color: #799d4f;
  display: flex;
  height: 29px;
  justify-content: center;
  width: 29px;
}

.transport-map-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 600;
}

.transport-map-icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid #dce4d3;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(40, 58, 39, .10);
  color: #617459;
  display: inline-flex;
  height: 33px;
  justify-content: center;
  width: 33px;
}

.transport-map-legend {
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #dfe6d6;
  border-radius: 6px;
  bottom: 24px;
  color: #79876d;
  display: flex;
  font-size: 8px;
  gap: 14px;
  left: 18px;
  padding: 10px 12px;
  position: absolute;
  z-index: 600;
}

.transport-map-legend span {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.transport-map-counter {
  background: rgba(245, 248, 238, .85);
  border-radius: 4px;
  bottom: 27px;
  color: #708461;
  font-size: 9px;
  padding: 7px 9px;
  position: absolute;
  right: 16px;
  z-index: 600;
}

.transport-map-detail {
  background: rgba(255, 255, 255, .97);
  border: 1px solid #d9e2cd;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(52, 81, 43, .12);
  max-height: calc(100% - 92px);
  overflow: auto;
  position: absolute;
  right: 62px;
  top: 18px;
  width: 286px;
  z-index: 650;
}

.transport-map-freight-detail {
  background: rgba(255, 255, 255, .98);
  border: 1px solid #d9e2cd;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(52, 81, 43, .14);
  left: 18px;
  max-height: calc(100% - 120px);
  overflow: auto;
  padding: 14px;
  position: absolute;
  top: 82px;
  width: min(360px, calc(100% - 36px));
  z-index: 650;
}

.transport-map-freight-detail-title {
  align-items: center;
  border-bottom: 1px solid var(--tfvm-line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.transport-map-freight-detail-title strong {
  color: #172b25;
  font-size: 14px;
  font-weight: 750;
}

.transport-map-freight-detail-title span {
  background: #f4f6f1;
  border-radius: 999px;
  color: #688271;
  font-size: 9px;
  font-weight: 750;
  padding: 4px 8px;
}

.transport-map-freight-detail-list {
  display: grid;
  gap: 8px;
}

.transport-map-freight-detail-row {
  background: #f8faf2;
  border: 1px solid #e0e7d7;
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.transport-map-freight-detail-row strong,
.transport-map-freight-detail-row b {
  color: #1f312b;
  display: block;
  font-size: 11px;
  font-weight: 750;
}

.transport-map-freight-detail-row span,
.transport-map-freight-detail-row small,
.transport-map-freight-detail-list p {
  color: #8a977d;
  display: block;
  font-size: 9px;
  line-height: 1.45;
  margin-top: 4px;
}

.transport-map-detail[hidden] {
  display: none;
}

.transport-map-detail-top {
  border-bottom: 1px solid var(--tfvm-line);
  padding: 15px 16px 12px;
}

.transport-map-detail-kicker {
  align-items: center;
  color: #8e9e80;
  display: flex;
  font-size: 8px;
  justify-content: space-between;
  letter-spacing: 1.15px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.transport-map-detail-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.transport-map-detail-title h3 {
  color: #172b25;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .6px;
  margin: 0;
}

.transport-map-detail-title p {
  color: #86927d;
  font-size: 10px;
  margin: 4px 0 0;
}

.transport-map-detail-main {
  padding: 14px 16px;
}

.transport-map-detail-grid {
  display: grid;
  gap: 12px 9px;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 14px;
}

.transport-map-detail-grid div:first-child {
  grid-column: span 2;
}

.transport-map-detail-grid dt {
  color: #91a082;
  font-size: 8px;
  margin-bottom: 4px;
}

.transport-map-detail-grid dd {
  color: #1f312b;
  font-size: 10px;
  font-weight: 700;
  margin: 0;
}

.transport-map-location-card,
.transport-map-no-freight {
  background: #f8faf2;
  border: 1px solid #e0e7d7;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.55;
  padding: 11px;
}

.transport-map-location-card.missing {
  background: #faf7ed;
  border-color: #ede3c8;
}

.transport-map-location-title {
  align-items: center;
  display: flex;
  font-weight: 750;
  gap: 7px;
}

.transport-map-location-card p,
.transport-map-no-freight p {
  color: #8a977d;
  font-size: 9px;
  margin: 5px 0 0 20px;
}

.transport-map-section-title {
  align-items: center;
  display: flex;
  font-size: 9px;
  font-weight: 750;
  justify-content: space-between;
  margin: 15px 0 10px;
}

.transport-map-route-item {
  align-items: center;
  display: flex;
  font-size: 10px;
  gap: 9px;
  min-height: 28px;
}

.transport-map-route-dot {
  border: 1.5px solid #8ca07d;
  border-radius: 50%;
  height: 7px;
  position: relative;
  width: 7px;
}

.transport-map-route-item:first-child .transport-map-route-dot::after {
  border-left: 1px dashed #adbba0;
  content: "";
  height: 20px;
  left: 2px;
  position: absolute;
  top: 6px;
}

.transport-map-route-item:last-child .transport-map-route-dot {
  background: #8ca07d;
  border-radius: 1px;
}

.transport-map-freight-summary {
  background: #f6f8f1;
  border-radius: 4px;
  color: #7c8f6b;
  display: flex;
  font-size: 9px;
  justify-content: space-between;
  margin-top: 8px;
  padding: 8px 9px;
}

.transport-map-empty-overlay,
.transport-map-empty-list {
  text-align: center;
}

.transport-map-empty-overlay {
  background: rgba(255, 255, 255, .94);
  border: 1px solid #dbe3cf;
  border-radius: 9px;
  left: 50%;
  padding: 24px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 270px;
  z-index: 550;
}

.transport-map-empty-overlay strong,
.transport-map-empty-list strong {
  display: block;
  font-size: 13px;
}

.transport-map-empty-overlay p,
.transport-map-empty-list p {
  color: #88987a;
  font-size: 11px;
  line-height: 1.6;
}

.transport-map-empty-list {
  padding: 38px 18px;
}

.transport-map-pin {
  align-items: center;
  background: #317651;
  border: 3px solid #fff;
  border-radius: 11px;
  box-shadow: 0 3px 9px rgba(36, 70, 39, .22);
  color: #fff;
  display: flex;
  height: 36px;
  justify-content: center;
  position: relative;
  width: 36px;
}

.transport-map-pin.busy {
  background: #507e9c;
}

.transport-map-pin.missing,
.transport-map-pin.unavailable,
.transport-map-pin.unknown {
  background: #b28b46;
}

.transport-map-pin.selected {
  box-shadow: 0 0 0 2px #6a9147, 0 3px 8px rgba(53, 68, 32, .25);
  outline: 7px solid rgba(117, 155, 73, .18);
}

.transport-map-pin.stale {
  border-color: #d7a34d;
}

.transport-map-pin::after {
  background: inherit;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  bottom: -5px;
  content: "";
  height: 7px;
  left: 12px;
  position: absolute;
  transform: rotate(45deg);
  width: 7px;
}

.transport-map-marker {
  background: none;
  border: 0;
}

.transport-map-cluster {
  align-items: center;
  background: #324f3e;
  border: 4px solid #f4f8e6;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(132, 154, 104, .14);
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 750;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.transport-map-freight-line {
  stroke: #5a7f90;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.transport-map-freight-origin,
.transport-map-freight-destination {
  align-items: center;
  background: #f59e0b;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(90, 67, 25, .2);
  color: #fff;
  display: flex;
  font-size: 10px;
  font-weight: 750;
  height: 24px;
  justify-content: center;
  line-height: 1;
  min-width: 24px;
  padding: 0 5px;
  width: 24px;
}

.transport-map-freight-origin.selected {
  box-shadow: 0 0 0 7px rgba(245, 158, 11, .18), 0 2px 8px rgba(90, 67, 25, .25);
  outline: 2px solid #b45309;
}

.transport-map-freight-destination {
  background: #6f8794;
  border-radius: 3px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  width: 14px;
}

.transport-map-city-label {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #879578;
  font-size: 10px;
  font-weight: 500;
  text-shadow: 0 1px 2px #fff;
  white-space: nowrap;
}

.transport-map-state-label {
  background: none;
  border: 0;
  box-shadow: none;
  color: #9aa78e;
  font-size: 11px;
  letter-spacing: 2px;
  text-shadow: 0 1px 1px #fff;
  white-space: nowrap;
}

.transport-map-page .vehicle-tooltip,
.transport-map-page .freight-tooltip {
  border: 1px solid #d7e1cc !important;
  border-radius: 9px !important;
  box-shadow: 0 5px 20px rgba(45, 66, 32, .14) !important;
  color: var(--tfvm-ink) !important;
  min-width: 220px;
  padding: 13px !important;
}

.transport-map-tip-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.transport-map-tip-row,
.transport-map-tip-note {
  font-size: 10px;
  line-height: 1.55;
  margin-top: 7px;
}

.transport-map-tip-note {
  border-top: 1px solid #e5e9df;
  color: #94a083;
  padding-top: 7px;
}

.transport-map-dialog {
  border: 1px solid #dce3d2;
  border-radius: 13px;
  color: var(--tfvm-ink);
  max-width: calc(100vw - 32px);
  padding: 24px;
  width: 430px;
}

.transport-map-dialog::backdrop {
  backdrop-filter: blur(3px);
  background: rgba(17, 43, 37, .40);
}

.transport-map-dialog h3 {
  font-size: 19px;
  font-weight: 750;
  margin: 0 0 10px;
}

.transport-map-dialog p {
  color: #819075;
  font-size: 12px;
  line-height: 1.6;
}

.transport-map-dialog label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin: 16px 0;
}

.transport-map-dialog select,
.transport-map-dialog textarea {
  border: 1px solid #dfe5d9;
  border-radius: 7px;
  color: #213a35;
  display: block;
  font: inherit;
  margin-top: 7px;
  padding: 11px;
  width: 100%;
}

.transport-map-dialog textarea {
  min-height: 78px;
  resize: vertical;
}

.transport-map-warning {
  background: #fff7df;
  border-radius: 6px;
  color: #947739;
  font-size: 11px;
  line-height: 1.6;
  padding: 10px;
}

.transport-map-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.transport-map-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 9px;
  color: #7f1d1d;
  padding: 18px;
}

@media (max-width: 1150px) {
  .transport-map-body {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .transport-map-detail {
    right: 54px;
    top: 78px;
    width: 256px;
  }
}

@media (max-width: 760px) {
  .transport-map-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .transport-map-heading h2 {
    font-size: 23px;
  }

  .transport-map-stats {
    grid-template-columns: 1fr 1fr;
  }

  .transport-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .transport-map-body {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .transport-map-stage {
    height: 470px;
    order: 1;
  }

  .transport-map-panel {
    border-right: 0;
    border-top: 1px solid var(--tfvm-line);
    max-height: 470px;
    min-height: 390px;
    order: 2;
  }

  .transport-map-source {
    left: 10px;
    max-width: calc(100% - 58px);
    padding: 8px;
    top: 10px;
  }

  .transport-map-source-icon {
    display: none;
  }

  .transport-map-actions {
    right: 10px;
    top: 10px;
  }

  .transport-map-detail {
    left: 10px;
    max-height: calc(100% - 116px);
    right: 10px;
    top: 74px;
    width: auto;
  }

  .transport-map-freight-detail {
    bottom: 20px;
    left: 10px;
    max-height: calc(100% - 116px);
    right: 10px;
    top: auto;
    width: auto;
  }

  .transport-map-counter {
    display: none;
  }

  .transport-map-legend {
    bottom: 20px;
    font-size: 7px;
    gap: 8px;
    left: 10px;
    padding: 8px;
  }
}
