/* Colors set dynamically via PHP-injected :root block */
:root {
  --primary: #2c3e6b;
  --primary-dark: #1e2f55;
  --primary-rgb: 44, 62, 107;
  --accent: #10b981;
  --accent-rgb: 16, 185, 129;
  --accent-light: rgba(16, 185, 129, 0.12);
  --primary-light: rgba(44, 62, 107, 0.08);
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: var(--primary);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.topbar-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.signout-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}
.signout-btn:hover {
  background: rgba(255,255,255,0.25);
}

.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.arrival-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.arrival-banner h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  font-weight: 400;
}

.consignment-tag {
  background: rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Hero row - shipment summary */
.hero-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.hero-icon {
  width: 52px;
  height: 52px;
  background: #eef2ff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.hero-icon svg {
  width: 28px;
  height: 28px;
}
.hero-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}
.hero-info > p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-chip.in-transit { background: #dbeafe; color: #1d4ed8; }
.status-chip.in-transit .dot { background: #3b82f6; }
.status-chip.delivered { background: var(--accent-light); color: var(--accent); }
.status-chip.delivered .dot { background: var(--accent); }
.status-chip.on-hold { background: #fef3c7; color: #92400e; }
.status-chip.on-hold .dot { background: #f59e0b; }

.hero-dates {
  margin-top: 12px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-date-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.hero-date-label { font-weight: 500; }
.hero-date-val { font-weight: 700; color: var(--text); }

/* Progress stepper */
.progress-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 10px 0 20px;
}
.stepper-line-bg {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
}
.stepper-line-fill {
  position: absolute;
  top: 24px;
  left: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}
.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.3s;
}
.step.done .step-circle { background: var(--accent); }
.step.active .step-circle { background: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.2); }
.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
.step.done .step-label { color: var(--accent); }
.step.active .step-label { color: var(--primary); }

/* Stepper fill bar uses accent */
.stepper-line-fill { background: var(--accent) !important; }

.percent-badge {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}
.percent-badge small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Actions row */
.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card-bg);
  transition: all 0.2s;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.action-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.action-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.action-btn.primary:hover { background: var(--primary-dark); }

/* Details grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.detail-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
}
.detail-group h4 svg {
  width: 18px;
  height: 18px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.detail-label { color: var(--text-muted); font-weight: 500; }
.detail-value { font-weight: 600; text-align: right; max-width: 60%; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.timeline-meta .day {
  font-weight: 700;
  color: var(--primary);
}
.timeline-detail {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.timeline-comment {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* Notice banner */
.notice-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.5;
}

/* Welcome message */
.welcome-msg {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Not found page */
.not-found-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: #fef2f2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}
.not-found-icon svg {
  width: 40px;
  height: 40px;
}
.bad-code {
  background: #fef2f2;
  color: #dc2626;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: monospace;
  margin: 8px 0;
}

/* Google translate overrides */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

@media (max-width: 600px) {
  .container { padding: 12px 12px 30px; }
  .arrival-banner { padding: 18px; flex-direction: column; align-items: flex-start; }
  .hero-row { flex-direction: column; }
  .details-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-dates { flex-direction: column; gap: 8px; }
  .actions-row { flex-direction: column; }
  .action-btn { text-align: center; }
}
