:root {
  --color-primary: #16947f;
  --color-primary-light: #06ba8f;
  --color-secondary: #4388c8;
  --color-error: #eb5757;
  --color-warning: #f2994a;
  --color-info: #939da4;
  --color-text-primary: #000;
  --color-text-secondary: #828282;
  --color-divider: #e0e0e0;
  --color-bg: #f5f5f5;
  --color-bg-paper: #fff;
  --font: 'Open Sans', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.header {
  background: var(--color-bg-paper);
  border-bottom: 1px solid var(--color-divider);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.header svg {
  height: 26px;
  width: auto;
}

.header .divider {
  width: 1px;
  height: 18px;
  background: var(--color-divider);
}

.header .subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* ── Loading cover ── */
.loading-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ── Main two-column layout ── */
.workspace {
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* ── Left panel ── */
.left-panel {
  width: 55%;
  overflow-y: auto;
  padding: 28px 32px;
  border-right: 1px solid var(--color-divider);
  background: var(--color-bg);
}

.order-id {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.order-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.order-meta strong {
  color: var(--color-text-primary);
}

/* Progress */
.progress-section {
  margin-bottom: 28px;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.progress-label .count {
  font-weight: 400;
  color: var(--color-text-secondary);
}

.progress-track {
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Summary cards */
.summary-row {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--color-bg-paper);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 14px 20px;
  flex: 1;
}

.summary-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.summary-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.summary-card .sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Stops table */
.stops-section {
  margin-bottom: 32px;
}

.stops-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-paper);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.stops-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: left;
  padding: 13px 16px;
  height: 45px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--color-bg-paper);
}

.stops-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.stops-table tbody tr:hover {
  background: rgba(67, 136, 200, 0.05);
}

.stops-table tbody tr.active {
  background: rgba(0, 0, 0, 0.04);
}

.stops-table tbody td {
  font-size: 0.875rem;
  padding: 6px 16px;
  height: 51px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  vertical-align: middle;
  line-height: 1.375em;
}

.stops-table tbody tr:last-child td {
  border-bottom: none;
}

.stop-location {
  font-weight: 600;
  font-size: 0.875rem;
}

/* ── Right panel ── */
.right-panel {
  width: 45%;
  overflow-y: auto;
  background: var(--color-bg-paper);
  display: flex;
  flex-direction: column;
}

.right-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  gap: 12px;
  padding: 40px;
  text-align: center;
}

.right-placeholder .icon {
  font-size: 40px;
  opacity: 0.4;
}

.right-placeholder p {
  font-size: 14px;
}

/* Stop detail panel */
.stop-detail {
  flex: 1;
}

.stop-detail-top {
  padding: 14px 24px;
  border-bottom: 1px solid var(--color-divider);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-detail-hero {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-divider);
}

.stop-detail-hero .stop-name {
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.stop-detail-hero .stop-address {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Detail sections */
.detail-section {
  border-bottom: 1px solid var(--color-divider);
  padding: 18px 24px;
}

.detail-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 0.875rem;
}

.detail-row .label {
  color: var(--color-text-secondary);
}

.detail-row .value {
  font-weight: 600;
  text-align: right;
}

/* Specimen cards */
.specimen-card {
  background: var(--color-bg);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.specimen-card:last-child {
  margin-bottom: 0;
}

.specimen-card .spec-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.specimen-card .spec-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.specimen-card .spec-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge--completed {
  background: rgba(22, 148, 127, 0.12);
  color: var(--color-primary);
}

.badge--new {
  background: rgba(147, 157, 164, 0.12);
  color: var(--color-info);
}

.badge--inprogress,
.badge--dispatched {
  background: rgba(67, 136, 200, 0.12);
  color: var(--color-secondary);
}

.badge--scheduled {
  background: rgba(242, 153, 74, 0.12);
  color: var(--color-warning);
}

.badge--delayed {
  background: rgba(198, 40, 40, 0.1);
  color: #c62828;
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.error-state .icon {
  font-size: 48px;
  color: var(--color-text-secondary);
}

.error-state p {
  font-size: 16px;
  color: var(--color-text-secondary);
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.footer {
  padding: 12px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-divider);
  flex-shrink: 0;
  background: var(--color-bg-paper);
}

/* Responsive */
@media (max-width: 700px) {
  body {
    overflow: auto;
  }

  .workspace {
    flex-direction: column;
    overflow: auto;
  }

  .left-panel,
  .right-panel {
    width: 100%;
    overflow: visible;
  }

  .right-panel {
    border-top: 1px solid var(--color-divider);
  }
}
