:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-soft: #edf2f6;
  --stroke: #c7d1dc;
  --stroke-strong: #8f9aaa;
  --text: #3a4553;
  --muted: #6f7a88;
  --blue: #98d8f3;
  --blue-deep: #5bb5d8;
  --yellow: #eaed72;
  --yellow-deep: #c9c94e;
  --orange: #ff6b1f;
  --green: #d8f0d2;
  --cream: #fff0b9;
  --rose: #f2cfd2;
  --danger: #d90429;
  --apmt-red: #d7264f;
  --apmt-red-soft: rgba(215, 38, 79, 0.11);
  --apmt-red-border: rgba(215, 38, 79, 0.28);
}

@font-face {
  font-family: "Maersk";
  src: local("Maersk Text"), local("Maersk");
  font-weight: 400 700;
  font-style: normal;
}

html,
body,
button,
input,
select,
textarea {
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
  color: var(--text);
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.dashboard-shell {
  padding: 10px 12px;
}

.dashboard {
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.page-header h1,
.validation-section h2,
.yard-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.page-tab-button {
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #445266;
  cursor: pointer;
}

.page-tab-button.active {
  border-color: rgba(215, 38, 79, 0.28);
  background: linear-gradient(180deg, #fff6f8 0%, #fde9ee 100%);
  color: #7a1d34;
  box-shadow: inset 0 0 0 1px rgba(215, 38, 79, 0.08);
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.mini-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-switch {
  position: relative;
  width: 24px;
  height: 14px;
  background: #cfd7e1;
  border-radius: 999px;
  transition: background 0.16s ease;
}

.mini-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.16s ease;
}

.mini-toggle input:checked + .mini-switch {
  background: #ff7a2a;
}

.mini-toggle input:checked + .mini-switch::after {
  left: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-button {
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #445266;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.toolbar-button:hover {
  border-color: #bec9d7;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
}

.toolbar-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ============================================================
   State breadcrumb — shows scope / highlight / mode at a glance
   ============================================================ */
.state-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 6px 0;
  border-top: 1px solid #e3e8ee;
  border-bottom: 1px solid #e3e8ee;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  line-height: 1;
  color: #4a5566;
}

.crumb.crumb-active {
  border-color: #b8c3d4;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

.crumb-label {
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 9px;
  color: #7b8696;
}

.crumb-value {
  font-weight: 600;
  font-size: 11.5px;
  color: #2c3a4d;
}

.crumb-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--apmt-red-border);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6f8 0%, #fde9ee 100%);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #7a1d34;
  cursor: pointer;
  margin-left: 4px;
}
.crumb-reset:hover {
  background: linear-gradient(180deg, #fff 0%, #fde0e7 100%);
  border-color: var(--apmt-red);
}
.crumb-mode.crumb-active { border-color: #e2a366; background: linear-gradient(180deg, #fff8ef 0%, #fceedb 100%); }
.crumb-mode.crumb-active .crumb-value { color: #7c4513; }
.crumb-highlight.crumb-active { border-color: var(--apmt-red-border); background: linear-gradient(180deg, #fff6f8 0%, #fde9ee 100%); }
.crumb-highlight.crumb-active .crumb-value { color: #7a1d34; }
.crumb-scope.crumb-active { border-color: #82a4cc; background: linear-gradient(180deg, #f5faff 0%, #e8f1fb 100%); }
.crumb-scope.crumb-active .crumb-value { color: #234876; }

.crumb-x {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #4a5566;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.crumb-x:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* ============================================================
   Solo button on vessel cards (visible on hover)
   ============================================================ */
.vessel-solo-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  width: 20px;
  height: 20px;
  border: 1px solid #c5cedd;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #4a5566;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
  padding: 0;
}
.vessel-card:hover .vessel-solo-btn,
.vessel-solo-btn:focus-visible {
  opacity: 1;
}
.vessel-solo-btn:hover {
  background: #fff;
  color: #2c3a4d;
  border-color: #8aa8c2;
}

/* ============================================================
   Clash popover — "Highlight these vessels" action button
   ============================================================ */
.clash-popover-action {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #2c3a4d;
  cursor: pointer;
}
.clash-popover-action:hover {
  border-color: #8aa8c2;
  background: linear-gradient(180deg, #ffffff 0%, #ecf3fa 100%);
}

/* ============================================================
   Better hover affordances on bucket bands + yard cells
   ============================================================ */
.bucket-band:hover {
  background: rgba(60, 90, 130, 0.06);
}
.yard-cell.point-load:hover,
.yard-cell.point-discharge:hover,
.yard-cell.point-both:hover,
.yard-cell[data-yard-clash="true"]:hover {
  outline: 2px solid rgba(60, 90, 130, 0.32);
  outline-offset: 1px;
}

.hour-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.hour-picker-label {
  font-size: 11px;
  font-weight: 700;
  color: #6f7a88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hour-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #2c3a4d;
  cursor: pointer;
  padding: 2px 18px 2px 4px;
  background-image: linear-gradient(45deg, transparent 50%, #6f7a88 50%),
                    linear-gradient(135deg, #6f7a88 50%, transparent 50%);
  background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}

.hour-select:focus {
  outline: 2px solid rgba(215, 38, 79, 0.32);
  outline-offset: 2px;
  border-radius: 4px;
}

.vessel-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.vessel-drawer.open {
  opacity: 1;
}

.vessel-drawer-backdrop {
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

.vessel-drawer-panel {
  position: relative;
  width: min(380px, 92vw);
  height: 100%;
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
  border-left: 1px solid #d7dee8;
  box-shadow: -18px 0 36px rgba(32, 46, 66, 0.12);
  padding: 26px 22px 22px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  pointer-events: auto;
}

.vessel-drawer.open .vessel-drawer-panel {
  transform: translateX(0);
}

.vessel-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 1px solid #d5dce6;
  border-radius: 999px;
  background: #fff;
  color: #4b5665;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.vessel-drawer-content {
  display: grid;
  gap: 16px;
}

.drawer-vessel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-vessel-brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.drawer-vessel-brand h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.08;
  font-weight: 650;
  color: #3a4553;
}

.drawer-vessel-brand p {
  margin: 6px 0 0;
  color: #6d7887;
  font-size: 13px;
  line-height: 1.35;
}

.drawer-vessel-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #d90429;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.drawer-vessel-card {
  border: 1px solid #d8e0ea;
  border-radius: 16px;
  background: #fff;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 24px rgba(56, 70, 91, 0.05);
  display: grid;
  gap: 10px;
}

.drawer-meta-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: baseline;
  gap: 12px;
}

.drawer-meta-row span {
  font-size: 13px;
  color: #3f4b59;
}

.drawer-meta-row strong {
  justify-self: end;
  font-size: 17px;
  font-weight: 650;
  color: #384251;
}

.drawer-divider {
  height: 1px;
  background: #d7dfe8;
}

.drawer-metric-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #3a4553;
}

.drawer-metric-strip strong {
  font-size: 15px;
  font-weight: 650;
}

.drawer-move-info {
  color: #44505f;
  font-size: 15px;
  line-height: 1.35;
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-kpi {
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.drawer-kpi span {
  color: #6f7a88;
  font-size: 12px;
}

.drawer-kpi strong {
  color: #394554;
  font-size: 20px;
  font-weight: 650;
}

.vessel-card {
  position: relative;
  border: 1px solid #b8c2cf;
  border-radius: 3px;
  background: #f9fbfd;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 152px;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.vessel-card.risk-low {
  border-left: 4px solid #b8c2cf;
}

.vessel-card.risk-medium {
  border-left: 4px solid #f08a2b;
  box-shadow: 0 6px 16px rgba(240, 138, 43, 0.08);
}

.vessel-card.risk-high {
  border-left: 4px solid #d7264f;
  box-shadow:
    0 8px 20px rgba(215, 38, 79, 0.14),
    0 0 0 3px rgba(215, 38, 79, 0.08);
}

.vessel-card:hover {
  border-color: #8aa8c2;
  box-shadow: 0 4px 14px rgba(63, 87, 113, 0.08);
}

.vessel-card.selected {
  border-color: var(--apmt-red);
  background: linear-gradient(180deg, #fff7f9 0%, #fff 100%);
  box-shadow:
    0 0 0 4px var(--apmt-red-soft),
    0 10px 18px rgba(215, 38, 79, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.vessel-card.selected-primary {
  border-color: var(--apmt-red);
  background: linear-gradient(180deg, #fff7f9 0%, #fff 100%);
  box-shadow:
    0 0 0 4px var(--apmt-red-soft),
    0 10px 18px rgba(215, 38, 79, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.vessel-card.selected-linked {
  border-color: #efb7c6;
  background: linear-gradient(180deg, #fffbfd 0%, #fff 100%);
  box-shadow:
    0 0 0 3px rgba(215, 38, 79, 0.06),
    0 8px 16px rgba(215, 38, 79, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.vessel-card.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(215, 38, 79, 0.22);
  pointer-events: none;
}

.vessel-card.selected-primary::after,
.vessel-card.selected-linked::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vessel-card.selected-primary::after {
  border: 1px solid rgba(215, 38, 79, 0.22);
}

.vessel-card.selected-linked::after {
  border: 1px solid rgba(215, 38, 79, 0.12);
}

.vessel-card-head {
  background: #dde5ee;
  padding: 8px 10px 7px;
  border-bottom: 1px solid #bdc7d4;
  min-height: 46px;
}

.vessel-card.selected .vessel-card-head {
  background: linear-gradient(180deg, #fce7ed 0%, #f8dbe4 100%);
  border-bottom-color: #e0a1b1;
}

.vessel-card.selected-primary .vessel-card-head {
  background: linear-gradient(180deg, #fce7ed 0%, #f8dbe4 100%);
  border-bottom-color: #e0a1b1;
}

.vessel-card.selected-linked .vessel-card-head {
  background: linear-gradient(180deg, #fff1f5 0%, #f7e7ec 100%);
  border-bottom-color: #ebc5cf;
}

.vessel-card.risk-medium .vessel-card-head {
  background: linear-gradient(180deg, #fff7ef 0%, #fff0de 100%);
  border-bottom-color: #ebc88f;
}

.vessel-card.risk-high .vessel-card-head {
  background: linear-gradient(180deg, #fff0f4 0%, #ffe0e8 100%);
  border-bottom-color: #e8a8b9;
}

.vessel-card.selected .vessel-card-head strong {
  color: #87233b;
}

.vessel-card.selected-primary .vessel-card-head strong {
  color: #87233b;
}

.vessel-card.selected-linked .vessel-card-head strong {
  color: #9b4a5d;
}

.vessel-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.vessel-card-head strong {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vessel-card-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #5d6774;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrier-badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.carrier-badge i {
  width: 100%;
  height: 100%;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  font-style: normal;
  font-size: 7px;
  font-weight: 700;
  color: #fff;
}

.carrier-badge.maersk {
  color: #0c7e9f;
  background: rgba(13, 141, 178, 0.08);
  border-color: rgba(13, 141, 178, 0.22);
}

.carrier-badge.maersk i {
  background: #0d8db2;
}

.carrier-badge.hapag {
  color: #b96800;
  background: rgba(219, 122, 0, 0.09);
  border-color: rgba(219, 122, 0, 0.22);
}

.carrier-badge.hapag i {
  background: #db7a00;
}

.vessel-card-body {
  padding: 7px 9px 9px;
  display: grid;
  gap: 4px;
  align-content: start;
  overflow: hidden;
}

.operations-grid.details-hidden .vessel-card {
  height: 42px;
}

.operations-grid.details-hidden .vessel-card-body {
  display: none;
}

.operations-grid.details-hidden .vessel-card-head {
  min-height: 46px;
}

.operations-column.has-selected-wq .qc-cell,
.operations-column.has-selected-wq .queue-cell {
  opacity: 0.38;
}

.qc-cell.selected,
.queue-cell.selected {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(54, 92, 122, 0.22);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 9px;
  min-width: 0;
}

.meta-row span,
.meta-row strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-row strong {
  font-size: 10px;
  text-align: right;
}

.metric-strip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #d4dbe4;
  font-size: 9px;
  min-width: 0;
}

.metric-strip strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vessel-risk-score {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #eef2f7;
  color: #536173;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vessel-card.risk-medium .vessel-risk-score {
  background: rgba(240, 138, 43, 0.16);
  color: #9b5717;
}

.vessel-card.risk-high .vessel-risk-score {
  background: rgba(215, 38, 79, 0.16);
  color: #9b203f;
}

.queue-area {
  display: block;
  margin-bottom: 22px;
}

.operations-board {
  overflow: visible;
}

.operations-grid-shell {
  position: relative;
  --schedule-top: 164px;
  width: 100%;
  min-width: 0;
  padding: 0 12px 0 34px;
}

.bucket-side-labels {
  position: absolute;
  inset: var(--schedule-top) auto 0 0;
  width: 28px;
  pointer-events: auto;
  z-index: 4;
}

.bucket-side-button {
  position: absolute;
  left: 0;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  transform-origin: center;
  font-size: 10px;
  color: var(--muted);
  border: 0;
  background: transparent;
  padding: 4px 2px;
  border-radius: 999px;
  cursor: pointer;
}

.bucket-side-button:hover {
  color: #49596b;
  background: rgba(84, 108, 133, 0.08);
}

.bucket-side-button.active {
  color: #b65719;
  background: rgba(255, 122, 42, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 42, 0.18);
}

.bucket-lines {
  position: absolute;
  inset: var(--schedule-top) 12px 0 34px;
  pointer-events: none;
  z-index: 0;
}

.bucket-lines span {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dotted rgba(95, 114, 131, 0.55);
}

.bucket-bands {
  position: absolute;
  inset: var(--schedule-top) 12px 0 34px;
  z-index: 2;
  pointer-events: none;
}

.bucket-band {
  position: absolute;
  left: 0;
  right: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.bucket-band:hover {
  background: rgba(84, 108, 133, 0.05);
}

.bucket-band.active {
  background: rgba(255, 122, 42, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 122, 42, 0.18),
    inset 0 0 0 999px rgba(255, 122, 42, 0.03);
}

.operations-grid {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 3;
  align-items: start;
  width: 100%;
}

.operations-column {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
}

.qc-lane {
  min-height: 34px;
}

.qc-schedule {
  display: grid;
  gap: 4px;
  align-items: stretch;
}

.qc-cell,
.qc-empty {
  min-height: 30px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
}

.qc-cell {
  background: var(--qc-fill);
  border: 1px solid var(--qc-border);
  color: var(--qc-text);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.45);
}

.qc-empty {
  border: 1px dashed rgba(159, 171, 183, 0.9);
  color: var(--muted);
  background: rgba(246, 248, 250, 0.9);
}

.wq-lane {
  min-height: 336px;
  padding-top: 4px;
}

.wq-schedule {
  display: grid;
  gap: 4px;
  height: 320px;
  align-items: stretch;
}

.queue-track {
  position: relative;
  min-width: 0;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(128, 164, 184, 0.06) 0%, rgba(128, 164, 184, 0.14) 100%);
  border: 1px solid rgba(163, 187, 205, 0.45);
}

.queue-cell {
  position: absolute;
  left: 0;
  right: 0;
  min-width: 0;
  border: 1px solid var(--qc-border);
  border-radius: 4px;
  padding: 6px 6px 18px;
  display: grid;
  align-content: start;
  gap: 4px;
  background: var(--qc-fill);
  color: var(--qc-text);
  overflow: hidden;
}

.queue-cell.load {
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.queue-cell.discharge {
  border-style: dashed;
}

.queue-cell.discharge::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.18) 0 6px,
      rgba(255, 255, 255, 0) 6px 12px
    );
  pointer-events: none;
}

.queue-cell.soft {
  opacity: 0.6;
}

.queue-cell.clash-focus {
  z-index: 3;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.28),
    0 0 0 2px rgba(215, 38, 79, 0.34),
    0 0 0 5px rgba(215, 38, 79, 0.12),
    0 10px 20px rgba(215, 38, 79, 0.14);
  transform: translateY(-1px);
}

.queue-cell.clash-focus::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(215, 38, 79, 0.12) 0 8px, rgba(255, 255, 255, 0) 8px),
    radial-gradient(circle at top right, rgba(215, 38, 79, 0.16) 0 14px, transparent 15px);
}

.queue-cell.risk-focus-restow {
  z-index: 2;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.22),
    0 0 0 2px rgba(122, 167, 64, 0.3),
    0 0 0 5px rgba(122, 167, 64, 0.12),
    0 8px 18px rgba(122, 167, 64, 0.16);
}

.queue-cell.risk-focus-restow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(122, 167, 64, 0.14) 0 8px, rgba(255, 255, 255, 0) 8px),
    radial-gradient(circle at top right, rgba(122, 167, 64, 0.16) 0 14px, transparent 15px);
}

.queue-cell.risk-focus-connection {
  z-index: 2;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.22),
    0 0 0 2px rgba(44, 134, 200, 0.28),
    0 0 0 5px rgba(44, 134, 200, 0.12),
    0 8px 18px rgba(44, 134, 200, 0.14);
}

.queue-cell.risk-focus-connection::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(44, 134, 200, 0.14) 0 8px, rgba(255, 255, 255, 0) 8px),
    radial-gradient(circle at top right, rgba(44, 134, 200, 0.16) 0 14px, transparent 15px);
}

.queue-cell strong {
  position: relative;
  z-index: 1;
  min-width: 0;
  font-size: 9px;
  line-height: 1.1;
  word-break: break-word;
}

.queue-cell span {
  font-size: 9px;
}

.queue-op {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(73, 81, 96, 0.14);
  background: rgba(255, 255, 255, 0.38);
  position: relative;
  z-index: 1;
}

.queue-op i {
  width: 12px;
  height: 12px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #495160;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.queue-op span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.queue-op-load {
  background: rgba(232, 248, 236, 0.78);
  border-color: rgba(62, 140, 79, 0.24);
  color: #235d31;
}

.queue-op-load i {
  background: #3c9f58;
}

.queue-op-discharge {
  background: rgba(255, 239, 230, 0.84);
  border-color: rgba(191, 104, 59, 0.28);
  color: #8a4a24;
}

.queue-op-discharge i {
  background: #d67c42;
}

.queue-moves {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: color-mix(in srgb, var(--qc-text) 86%, #ffffff 14%);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.queue-time {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 8px;
  line-height: 1.1;
  color: color-mix(in srgb, var(--qc-text) 78%, #ffffff 22%);
}

.queue-alert {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 1;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 50px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.wq-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px dashed rgba(159, 171, 183, 0.9);
  border-radius: 4px;
  background: rgba(246, 248, 250, 0.9);
  color: var(--muted);
  font-size: 11px;
}

.validation-section {
  margin-bottom: 28px;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.terminal-kpi-grid {
  grid-template-columns: repeat(10, minmax(140px, 1fr));
}

.validation-card {
  border: 1px solid #d6dde6;
  border-radius: 6px;
  background: var(--panel);
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.validation-card.interactive {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.validation-card.interactive:hover {
  border-color: #c2cedc;
  box-shadow: 0 6px 14px rgba(46, 61, 79, 0.08);
  transform: translateY(-1px);
}

.validation-card.active {
  border-color: rgba(215, 38, 79, 0.38);
  box-shadow:
    0 8px 18px rgba(215, 38, 79, 0.08),
    inset 0 0 0 1px rgba(215, 38, 79, 0.16);
}

.validation-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.validation-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.validation-icon.bad {
  background: #ffe0e5;
  color: #d33a52;
}

.validation-icon.good {
  background: #dff0dc;
  color: #58a048;
}

.validation-icon.ok {
  background: #dceffc;
  color: #2c86c8;
}

.validation-icon.icon-markup svg {
  display: block;
  width: 15px;
  height: 15px;
}

.validation-card strong {
  font-size: 11px;
}

.validation-value {
  font-size: 14px;
}

.validation-note {
  font-size: 9px;
  color: var(--muted);
  text-align: right;
}

.validation-note.alert {
  color: #e33d34;
}

.risk-drawer-panel {
  width: min(620px, 96vw);
}

.risk-drawer-content {
  display: grid;
  gap: 16px;
}

.risk-drawer-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 650;
  color: #3a4553;
}

.risk-drawer-kicker {
  color: #6a7585;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.risk-table-wrap {
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(56, 70, 91, 0.05);
}

.risk-table {
  width: 100%;
  border-collapse: collapse;
}

.risk-table th,
.risk-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e7edf4;
  font-size: 11px;
  color: #445266;
}

.risk-table th {
  background: #f7fafc;
  font-size: 10px;
  font-weight: 700;
  color: #667387;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.risk-table tbody tr:last-child td {
  border-bottom: 0;
}

.risk-table td strong {
  font-size: 11px;
  color: #384251;
}

.risk-table-vessel {
  font-size: 10px;
  font-weight: 700;
  color: #384251;
}

.risk-gap-pill {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: #5e6b7c;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

.risk-table-empty {
  font-size: 11px;
  color: var(--muted);
}

.yard-section {
  padding-bottom: 10px;
}

.analysis-section {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

.analysis-section *,
.analysis-section button,
.analysis-section input,
.analysis-section select,
.analysis-section textarea {
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

.analysis-head h2,
.analysis-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.analysis-copy,
.analysis-card-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.analysis-trend-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #e7edf4;
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f9fc 100%);
}

.analysis-summary-card {
  border: 1px solid #d6dde6;
  border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px;
  box-shadow: 0 8px 18px rgba(56, 70, 91, 0.04);
}

.analysis-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c7888;
}

.analysis-summary-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: #2f3b4c;
}

.analysis-summary-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: start;
}

.analysis-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.analysis-card-head {
  display: grid;
  gap: 2px;
  min-height: 78px;
  align-content: start;
}

.analysis-table-wrap {
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(56, 70, 91, 0.05);
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
}

.analysis-table th,
.analysis-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e7edf4;
  font-size: 11px;
  color: #445266;
}

.analysis-table th {
  background: #f7fafc;
  font-size: 10px;
  font-weight: 700;
  color: #667387;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analysis-table tbody tr:last-child td {
  border-bottom: 0;
}

.analysis-row {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.analysis-row:hover td {
  background: #f8fbff;
}

.analysis-row.selected td {
  background: #fff3f6;
  box-shadow: inset 0 1px 0 rgba(215, 38, 79, 0.1), inset 0 -1px 0 rgba(215, 38, 79, 0.1);
}

.analysis-table td strong {
  font-size: 11px;
  color: #384251;
}

.analysis-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

.analysis-tag.good {
  background: #dff0dc;
  color: #377a2c;
}

.analysis-tag.warn {
  background: #fff0c9;
  color: #946200;
}

.analysis-tag.bad {
  background: #ffe0e5;
  color: #b52845;
}

.analysis-empty {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 11px;
}

.analysis-subtle {
  color: #6f7c8d;
  font-size: 10px;
  line-height: 1.45;
}

.analysis-card-wide {
  display: grid;
  gap: 12px;
}

.analysis-sequence-preview {
  color: #334154;
  font-size: 11px;
  line-height: 1.45;
}

.analysis-metric-pair {
  color: #445266;
  font-size: 10px;
  line-height: 1.45;
}

.analysis-sequence-note {
  color: #334154;
  font-size: 10px;
  line-height: 1.45;
}

.analysis-sequence-savings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.analysis-sequence-fixes {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  color: #445266;
  font-size: 10px;
  line-height: 1.4;
}

.analysis-timeline {
  min-width: 280px;
  display: grid;
  gap: 8px;
}

.analysis-timeline-axis {
  display: flex;
  justify-content: space-between;
  color: #6c7888;
  font-size: 10px;
  font-weight: 700;
}

.analysis-timeline-lane-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
}

.analysis-timeline-lane-label {
  color: #435267;
  font-size: 10px;
  font-weight: 700;
}

.analysis-timeline-lane {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5f8fb 0%, #eef3f8 100%);
  border: 1px solid #dde5ef;
  overflow: hidden;
}

.analysis-timeline-span {
  position: absolute;
  top: 3px;
  height: 8px;
  border-radius: 999px;
  background: rgba(69, 96, 128, 0.28);
}

.analysis-timeline-overlap {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 999px;
  background: rgba(215, 38, 79, 0.12);
}

.analysis-timeline-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(26, 39, 57, 0.14);
}

.analysis-timeline-dot.load {
  background: #4b97f3;
}

.analysis-timeline-dot.discharge {
  background: #ff8c42;
}

.yard-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.yard-title-block {
  flex: 0 0 auto;
  min-width: 164px;
  padding-top: 4px;
}

.yard-title-block h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.yard-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: #5b6777;
}

.yard-legend-title {
  font-weight: 700;
  color: #6a7585;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.yard-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #d8e0ea;
}

.yard-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-block;
}

.yard-legend-swatch.move-green {
  background: linear-gradient(180deg, #dff3d7 0%, #cceac1 100%);
  border-color: #8ab37b;
}

.yard-legend-swatch.move-amber {
  background: linear-gradient(180deg, #f7e8bb 0%, #efd98c 100%);
  border-color: #c9ab4d;
}

.yard-legend-swatch.move-red {
  background: linear-gradient(180deg, #f4c8bf 0%, #e9a59a 100%);
  border-color: #c77669;
}

.yard-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 0;
  flex: 0 0 auto;
  margin-left: auto;
}

.yard-kpi-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.selection-summary {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.summary-pill {
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 8px 12px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.summary-pill:first-child {
  border-color: var(--apmt-red-border);
  background: linear-gradient(180deg, #fff6f8 0%, #fff 100%);
  color: #7a1d34;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 8px rgba(215, 38, 79, 0.08);
}

.summary-pill strong {
  font-weight: 700;
}

.summary-pill-analysis {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.summary-pill-clear {
  border: 0;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.summary-pill-clear:hover {
  background: rgba(0, 0, 0, 0.14);
}

.yard-ops {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  border: 1px solid #d6dde6;
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  white-space: nowrap;
}

.yard-ops label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.yard-ops > span {
  font-weight: 600;
  color: var(--muted);
}

.yard-kpi-card .validation-note {
  text-align: left;
}

.yard-map {
  border: 1px solid #e0e5eb;
  background: #fff;
  padding: 18px 20px 40px 34px;
  display: grid;
  grid-template-columns: repeat(11, minmax(100px, 1fr));
  gap: 18px;
}

.yard-main {
  display: block;
  position: relative;
}

.yard-column {
  display: grid;
  gap: 5px;
  align-content: start;
}

.yard-cell {
  height: 29px;
  border: 1px solid var(--stroke-strong);
  background: #ffffff;
  position: relative;
  overflow: visible;
  padding-top: 6px;
}

.yard-cell[data-yard-clash="true"],
.yard-cell.point-load,
.yard-cell.point-discharge,
.yard-cell.point-both {
  cursor: pointer;
}

.yard-cell.high {
  background: #ffffff;
}

.yard-cell.violation {
  background: #ffffff;
}

.yard-cell.focus {
  border-color: #6cc8ff;
  box-shadow: 0 0 0 1px #8ed7ff inset;
}

.yard-cell.move-none {
  background: #ffffff;
}

.yard-cell.move-green {
  background: #dff3d7;
  border-color: #8ab37b;
}

.yard-cell.move-amber {
  background: #f7e8bb;
  border-color: #c9ab4d;
}

.yard-cell.move-red {
  background: #f4c8bf;
  border-color: #c77669;
}

.yard-cell.point-load {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.yard-cell.point-discharge {
  border-style: dashed;
}

.yard-cell.point-both {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.yard-cell.point-active {
  z-index: 2;
  box-shadow: none;
}

.yard-cell.point-shared {
  outline: none;
}

.yard-cell.point-multi-vessel {
  outline: none;
  box-shadow: none;
}

.yard-cell.point-muted {
  opacity: 1;
  border-color: #dbe3ec;
  background: #ffffff;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.68);
}

.yard-cell.low-move-focus {
  box-shadow:
    inset 0 0 0 2px rgba(52, 120, 246, 0.34),
    0 0 0 1px rgba(52, 120, 246, 0.12);
}

.yard-cell.point-muted .yard-label {
  color: #6a7484;
}

.yard-cell.has-clash {
  box-shadow: none;
}

/* ─── Severity tiers ─── */
/* Critical: full red ring + flag. The default has-clash treatment above
   already gives a faint red glow; we lift it here. */
.yard-cell.clash-tier-critical {
  box-shadow: none;
  z-index: 4;
}

/* Warning: subtle amber outline, no glow, no pulse */
.yard-cell.clash-tier-warning {
  box-shadow: none;
  z-index: 3;
}

/* Info: barely visible — just a thin dashed line. Hidden by default unless
   "Show all clash signals" is toggled on (the showThisClash gate). */
.yard-cell.clash-tier-info {
  box-shadow: none;
  z-index: 2;
}

/* Warning flag — small amber chip, less attention-grabbing than the red pills */
.yard-clash-flag.warn {
  background: linear-gradient(180deg, rgba(228, 145, 40, 0.96) 0%, rgba(196, 113, 24, 0.96) 100%);
  min-width: 22px;
  width: 22px;
  font-size: 11px;
  font-weight: 800;
  height: 16px;
  letter-spacing: 0;
}

.yard-cell.clash-focus {
  z-index: 6;
  box-shadow: none;
  transform: none;
  animation: none;
}

.yard-cell.clash-rtg {
  box-shadow: none;
}

.yard-cell.clash-pow {
  box-shadow: none;
}

.yard-cell.clash-rtg.clash-pow {
  box-shadow: none;
}

.yard-cell.analysis-rtg-focus {
  z-index: 7;
}

.yard-cell.analysis-one-move-block {
  box-shadow: none;
}

.yard-cell.analysis-absorber-block {
  box-shadow: none;
}

.yard-cell.analysis-one-move-block.analysis-absorber-block {
  box-shadow: none;
}

.yard-analysis-tags {
  position: absolute;
  right: 4px;
  top: -7px;
  display: flex;
  gap: 4px;
  z-index: 8;
  pointer-events: none;
}

.yard-analysis-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 10px rgba(38, 52, 71, 0.2);
}

.yard-analysis-tag.primary {
  background: linear-gradient(180deg, #3aa0ff 0%, #1f74d8 100%);
}

.yard-analysis-tag.secondary {
  background: linear-gradient(180deg, #33b97c 0%, #208d5c 100%);
}

.yard-label {
  position: absolute;
  top: 50%;
  left: -24px;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  color: #536072;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.yard-rtg-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 34px;
  max-width: calc(100% - 8px);
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 122, 42, 0.98);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    0 2px 5px rgba(18, 28, 40, 0.2),
    0 0 0 2px rgba(255, 255, 255, 0.72);
}

.yard-rtg-badge.scoped {
  background: rgba(255, 122, 42, 1);
  min-width: 46px;
  justify-content: flex-start;
}

.yard-low-move-flag {
  position: absolute;
  top: -7px;
  right: 4px;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f7df6;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 2px 6px rgba(25, 41, 67, 0.18),
    0 0 0 2px rgba(255, 255, 255, 0.84);
  z-index: 8;
  pointer-events: none;
}

.yard-clash-flags {
  position: absolute;
  top: -10px;
  right: 4px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.yard-clash-flag {
  min-width: 46px;
  height: 18px;
  padding: 0 8px 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow:
    0 5px 12px rgba(128, 22, 43, 0.24),
    0 0 0 2px rgba(255, 255, 255, 0.74);
}

.yard-clash-flag.rtg {
  background: linear-gradient(180deg, rgba(204, 32, 69, 0.98) 0%, rgba(168, 19, 52, 0.98) 100%);
}

.yard-clash-flag.pow {
  background: linear-gradient(180deg, rgba(230, 86, 83, 0.98) 0%, rgba(196, 51, 49, 0.98) 100%);
}

@keyframes clashPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.52),
      0 0 0 3px rgba(215, 38, 79, 0.38),
      0 0 0 7px rgba(215, 38, 79, 0.11),
      0 14px 28px rgba(215, 38, 79, 0.18);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.52),
      0 0 0 4px rgba(215, 38, 79, 0.5),
      0 0 0 9px rgba(215, 38, 79, 0.18),
      0 16px 30px rgba(215, 38, 79, 0.24);
  }
}

.yard-move-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  min-width: 30px;
  min-height: 18px;
  padding: 3px 6px;
  border-radius: 10px;
  display: inline-grid;
  justify-items: end;
  gap: 1px;
  background: rgba(54, 70, 91, 0.84);
  color: #fff;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(24, 35, 49, 0.16);
}

.yard-move-count strong {
  font-size: 10px;
  font-weight: 700;
}

.yard-move-count em {
  display: inline-block;
  font-style: normal;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.85;
}

.clash-popover {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 320px;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(215, 38, 79, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 18px 42px rgba(42, 52, 67, 0.16),
    0 0 0 4px rgba(215, 38, 79, 0.06);
  padding: 14px;
  z-index: 8;
  backdrop-filter: blur(10px);
}

.clash-popover[hidden] {
  display: none;
}

.clash-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.clash-popover-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b11f44;
  margin-bottom: 4px;
}

.clash-popover h3 {
  margin: 0;
  font-size: 18px;
}

.clash-popover-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #f8dbe2;
  color: #9e1d3e;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.clash-popover-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.clash-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.clash-type-chip.rtg {
  background: linear-gradient(180deg, #cc2045 0%, #a81334 100%);
}

.clash-type-chip.pow {
  background: linear-gradient(180deg, #e65653 0%, #c43331 100%);
}

.clash-popover-copy {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #536072;
}

.clash-popover-section {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.clash-popover-section strong {
  font-size: 11px;
}

.clash-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.clash-token {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.clash-token.vessel {
  background: #fff1f4;
  color: #8f1b39;
  border: 1px solid #f2c2cf;
}

.clash-token.container {
  background: #f6f8fb;
  color: #3e4c61;
  border: 1px solid #dce4ee;
}

.clash-wq-list {
  display: grid;
  gap: 6px;
}

.clash-wq-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fbfcfe;
  border: 1px solid #e0e7f0;
  font-size: 11px;
  color: #5d687a;
}

.clash-wq-label {
  font-weight: 700;
  color: #253141;
}

.yard-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  width: min(360px, calc(100% - 16px));
  border: 1px solid rgba(179, 191, 206, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(44, 57, 76, 0.18);
  padding: 14px 14px 12px;
  z-index: 11;
  pointer-events: none;
  display: grid;
  gap: 12px;
  font-family: "Maersk", "Segoe UI", Arial, sans-serif;
}

.yard-tooltip[hidden] {
  display: none !important;
}

.yard-tooltip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.yard-tooltip-kicker {
  color: #6a7585;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.yard-tooltip-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  color: #2f3b4c;
}

.yard-tooltip-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.yard-tooltip-metric {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: #405066;
  font-size: 10px;
  font-weight: 700;
}

.yard-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.yard-tooltip-section {
  display: grid;
  gap: 5px;
}

.yard-tooltip-label {
  color: #6c7888;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.yard-tooltip-value {
  color: #334255;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.yard-tooltip-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yard-tooltip-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: #435267;
  font-size: 10px;
  font-weight: 700;
}

.yard-tooltip-chip.soft {
  background: #f6f8fb;
  color: #4f5f73;
}

.yard-tooltip-stack {
  display: grid;
  gap: 3px;
  color: #334255;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.yard-tooltip-list {
  display: grid;
  gap: 6px;
}

.yard-tooltip-list-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.yard-tooltip-list-row strong {
  color: #233145;
  font-size: 11px;
  font-weight: 700;
}

.yard-tooltip-list-row span {
  color: #516075;
  font-size: 11px;
  line-height: 1.35;
}

.yard-tooltip-empty,
.yard-tooltip-foot {
  color: #6c7888;
  font-size: 11px;
  line-height: 1.35;
}

.yard-cell.small {
  width: 38px;
  justify-self: start;
}

.yard-cell.medium {
  width: 76px;
}

.yard-cell.large {
  width: 106px;
}


@media (max-width: 1400px) {
  .yard-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .yard-topbar-main {
    flex-wrap: wrap;
  }

  .yard-map {
    grid-template-columns: repeat(6, minmax(100px, 1fr));
  }

  .yard-kpi-row {
    grid-template-columns: 1fr;
  }

  .selection-summary {
    flex-wrap: wrap;
    overflow-x: visible;
  }

}

@media (max-width: 980px) {
  .page-header,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .validation-grid,
  .terminal-kpi-grid,
  .yard-map {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .yard-topbar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .yard-title-block {
    min-width: 0;
    padding-top: 0;
  }

  .yard-controls {
    justify-content: flex-start;
  }

  .yard-ops {
    flex-wrap: wrap;
  }

}

@media (max-width: 640px) {
  .dashboard-shell {
    padding: 10px;
  }

  .validation-grid,
  .terminal-kpi-grid,
  .yard-map {
    grid-template-columns: 1fr;
  }
}
