.trip-plan-workspace {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.import-status.connected-text {
  color: var(--ok);
}

.import-status.error-text {
  color: var(--issue);
}

#planRows tr {
  cursor: pointer;
}

#planRows tr.selected-row {
  background: #eef5ff;
}

#planRows td strong,
#planRows td small {
  display: block;
}

#planRows td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.button.compact {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.row-actions,
.detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-actions {
  justify-content: flex-end;
}

.edit-button,
.view-plan-link {
  color: var(--accent);
  white-space: nowrap;
}

.view-plan-link {
  border-color: rgba(20, 104, 216, 0.28);
  background: #e8f1ff;
}

.cell-lines {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cell-line {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.countdown-lines {
  min-width: 150px;
}

.countdown-line {
  display: grid;
  gap: 2px;
}

.countdown-line small {
  display: block;
  max-width: 220px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.trip-plan-workspace .table-wrap table {
  min-width: 1120px;
}

.trip-plan-workspace .detail-panel {
  max-height: calc(100vh - 94px);
  overflow: auto;
}

.status-select {
  width: auto;
  min-width: 118px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.status-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 104, 216, 0.12);
}

.status-planned {
  background: rgba(20, 104, 216, 0.1);
  color: var(--accent);
}

.status-scheduled,
.status-pending,
.status-loading {
  background: rgba(181, 71, 8, 0.12);
  color: var(--warning);
}

.status-in-transit {
  background: rgba(6, 118, 71, 0.1);
  color: var(--ok);
}

.status-delivered,
.status-locked {
  background: #eef2f7;
  color: #344054;
}

.status-cancelled {
  background: #f4f4f5;
  color: var(--muted);
}

.status-at-risk {
  background: #fff0ee;
  color: var(--issue);
}

.status-select.status-cancelled {
  border-color: rgba(105, 115, 130, 0.16);
}

.countdown-ok,
.countdown-warning,
.countdown-overdue,
.countdown-neutral {
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.countdown-ok {
  color: var(--ok);
}

.countdown-warning {
  color: var(--warning);
}

.countdown-overdue {
  color: var(--issue);
}

.countdown-neutral {
  color: var(--muted);
}

.buffer-ok,
.buffer-warning,
.buffer-issue,
.buffer-neutral {
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.buffer-ok {
  color: var(--ok);
}

.buffer-warning {
  color: var(--warning);
}

.buffer-issue {
  color: var(--issue);
}

.buffer-neutral {
  color: var(--muted);
}

.trip-stops,
.trip-notes,
.trip-log {
  display: grid;
  gap: 10px;
}

.trip-stop {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.trip-stop header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.trip-stop dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.trip-stop dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.trip-stop dt,
.trip-stop dd {
  margin: 0;
  font-size: 12px;
}

.trip-stop dt {
  color: var(--muted);
  font-weight: 750;
}

.trip-stop dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

.trip-notes p,
.muted-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.trip-log-list {
  display: grid;
  gap: 8px;
}

.trip-log-entry {
  border-left: 3px solid var(--accent);
  background: var(--panel-soft);
  padding: 8px 10px;
}

.trip-log-entry strong,
.trip-log-entry span,
.trip-log-entry p {
  display: block;
}

.trip-log-entry strong {
  color: var(--text);
  font-size: 12px;
}

.trip-log-entry span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.trip-log-entry p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .trip-plan-workspace {
    grid-template-columns: 1fr;
  }

  .trip-plan-workspace .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .row-actions,
  .detail-actions {
    width: 100%;
  }

  .row-actions .button,
  .detail-actions .button {
    width: 100%;
  }

  .trip-stop header {
    align-items: flex-start;
    flex-direction: column;
  }

  .trip-stop dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
