/* ==========================================================================
   Orbis Global Transport - Tracking System Theme (Official Yellow Theme)
   Official Brand Color: #F7C600 (Globefarer Signature Gold / Yellow)
   ========================================================================== */

:root {
  --tp-yellow: #F7C600;
  --tp-yellow-hover: #e5b700;
  --tp-yellow-glow: rgba(247, 198, 0, 0.35);
  --tp-primary: #1B1B1B;
  --tp-primary-dark: #111827;
  --tp-bg: #ffffff;
  --tp-bg-alt: #f8fafc;
  --tp-card-bg: #ffffff;
  --tp-text: #1d2129;
  --tp-text-muted: #64748b;
  --tp-border: #e2e8f0;
  --tp-border-dark: #cbd5e1;
  --tp-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --tp-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --tp-radius: 4px;
  --tp-radius-sm: 2px;
  --tp-font: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --accent: #F7C600;
  --accent-glow: rgba(247, 198, 0, 0.35);
  --border: #e2e8f0;
  --text: #1d2129;
  --text-muted: #64748b;
  --bg: #ffffff;
}

/* Reset inside tracker app */
#wp-tracker-public-app,
.tp-v3,
.tp-dashboard,
.tp-landing {
  font-family: var(--tp-font) !important;
  color: var(--tp-text);
  box-sizing: border-box;
}

#wp-tracker-public-app *,
#wp-tracker-public-app *::before,
#wp-tracker-public-app *::after {
  box-sizing: border-box;
  font-family: inherit;
}

/* Hide any stray sample badges if ever injected */
.tp-quick-samples,
[class*="quick-samples"] {
  display: none !important;
}

/* ==========================================================================
   1. Search / Landing View - Modern High-End Logistics Portal
   ========================================================================== */

.tp-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 50px 20px 80px 20px;
  background: #ffffff;
}

.tp-landing-bg {
  display: none;
}

.tp-landing-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 780px;
  text-align: center;
  margin: 0 auto;
}

.tp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(247, 198, 0, 0.12);
  transition: all 0.25s ease;
}

.tp-badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F7C600;
  box-shadow: 0 0 0 0 rgba(247, 198, 0, 0.7);
  animation: tpPulseGold 1.8s infinite;
}

@keyframes tpPulseGold {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(247, 198, 0, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(247, 198, 0, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(247, 198, 0, 0);
  }
}

.tp-search-title,
.tp-landing h1 {
  font-size: clamp(2.2rem, 4vw, 2.9rem) !important;
  font-weight: 800 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.03em !important;
  color: #0f172a !important;
  margin: 0 0 14px 0 !important;
  font-family: var(--tp-font) !important;
}

.tp-search-subtitle,
.tp-landing p {
  color: #64748b !important;
  font-size: 1.08rem !important;
  line-height: 1.6 !important;
  margin: 0 auto 36px auto !important;
  max-width: 620px !important;
  font-weight: 400 !important;
}

/* Master Search Bar Form Container */
.tp-main-search {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.tp-search-box {
  display: flex !important;
  align-items: center !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 6px 6px 6px 18px !important;
  box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  gap: 10px !important;
}

.tp-search-box:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 14px 36px -8px rgba(15, 23, 42, 0.11), 0 6px 16px rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-2px) !important;
}

.tp-search-box:focus-within {
  border-color: #F7C600 !important;
  box-shadow: 0 0 0 4px rgba(247, 198, 0, 0.22), 0 18px 40px -8px rgba(15, 23, 42, 0.12) !important;
  transform: translateY(-2px) !important;
  background: #ffffff !important;
}

.tp-search-icon-wrap,
.search-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #94a3b8 !important;
  flex-shrink: 0 !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  transition: all 0.25s ease !important;
}

.tp-search-box:focus-within .tp-search-icon-wrap,
.tp-search-box:focus-within .search-icon {
  color: #d97706 !important;
  transform: scale(1.08) !important;
}

/* Hard Theme-Reset for Input to prevent theme underline and misalignment */
#wp-tracker-public-app .tp-search-box input.tp-search-input,
#wp-tracker-public-app .tp-search-box input,
.tp-search-box input {
  flex: 1 1 auto !important;
  background: transparent !important;
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 12px 10px !important;
  margin: 0 !important;
  height: 48px !important;
  color: #0f172a !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  font-family: var(--tp-font) !important;
  line-height: normal !important;
}

#wp-tracker-public-app .tp-search-box input::placeholder,
.tp-search-box input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

#wp-tracker-public-app .tp-search-box input:focus,
.tp-search-box input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Search Submit Button */
.tp-search-btn,
.tp-search-box button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #F7C600 !important;
  color: #0f172a !important;
  border: none !important;
  padding: 0 26px !important;
  height: 48px !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(247, 198, 0, 0.32) !important;
  font-family: var(--tp-font) !important;
}

.tp-search-btn:hover,
.tp-search-box button:hover {
  background: #0f172a !important;
  color: #F7C600 !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22) !important;
  transform: translateY(-1px) !important;
}

.tp-search-btn:hover .tp-btn-icon {
  transform: translateX(3px) !important;
}

.tp-btn-icon {
  display: flex !important;
  align-items: center !important;
  transition: transform 0.25s ease !important;
}

.tp-search-btn:active,
.tp-search-box button:active {
  transform: scale(0.98) !important;
}

.tp-search-btn:disabled,
.tp-search-box button:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Error banner */
.tp-search-error {
  margin-top: 20px;
  padding: 12px 20px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  color: #dc2626;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.06);
  animation: tpSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tpSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Quick Search Hint Chips */
.tp-search-hints {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: 20px !important;
  flex-wrap: wrap !important;
  font-size: 0.85rem !important;
}

.tp-hint-label {
  color: #94a3b8 !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
}

#wp-tracker-public-app button.tp-hint-pill,
#wp-tracker-public-app .tp-hint-pill,
button.tp-hint-pill,
.tp-hint-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f8fafc !important;
  color: #475569 !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-family: 'JetBrains Mono', 'Consolas', monospace !important;
  font-size: 0.8rem !important;
  cursor: pointer !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
  height: auto !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  transition: all 0.2s ease !important;
}

#wp-tracker-public-app button.tp-hint-pill:hover,
#wp-tracker-public-app .tp-hint-pill:hover,
button.tp-hint-pill:hover,
.tp-hint-pill:hover {
  background: #fef08a !important;
  color: #854d0e !important;
  border-color: #fde047 !important;
  transform: translateY(-1px) !important;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .tp-landing {
    padding: 35px 15px 60px 15px;
  }

  .tp-search-box {
    flex-direction: column !important;
    padding: 12px !important;
    border-radius: 14px !important;
    gap: 10px !important;
  }
  
  #wp-tracker-public-app .tp-search-box input.tp-search-input,
  #wp-tracker-public-app .tp-search-box input,
  .tp-search-box input {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 4px !important;
    font-size: 1rem !important;
  }
  
  .tp-search-icon-wrap,
  .search-icon {
    display: none !important;
  }

  .tp-search-btn,
  .tp-search-box button {
    width: 100% !important;
    height: 48px !important;
    border-radius: 10px !important;
  }
}

.tp-search-error {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #dc2626;
  font-size: 0.95rem;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 16px;
  border-radius: var(--tp-radius);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  border-top-color: #1B1B1B;
  animation: tp-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   2. Tracking Results Dashboard
   ========================================================================== */

.tp-dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 0 60px 0;
  background: transparent;
  min-height: auto;
}

/* Dashboard Header Card */
.tp-dash-header {
  background: #ffffff;
  border: 1px solid var(--tp-border);
  border-top: 4px solid var(--tp-yellow);
  border-radius: var(--tp-radius);
  padding: 32px;
  margin-bottom: 30px;
  box-shadow: var(--tp-shadow);
  transition: all 0.3s ease;
}

.tp-dash-header:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.tp-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--tp-border);
  flex-wrap: wrap;
  gap: 20px;
}

.tp-brand-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tp-logo {
  height: 40px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
}

.tp-site-name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--tp-primary);
}

.tp-header-stats {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.tp-header-stat .label {
  display: block;
  font-size: 0.72rem;
  color: var(--tp-text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.tp-header-stat .value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--tp-primary);
  display: block;
}

.tp-header-stat .highlight {
  color: #92400e;
}

/* Status Badge */
.status-badge-animated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  padding: 6px 16px;
  border-radius: var(--tp-radius-sm);
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid #fde68a;
  transition: all 0.25s ease;
}

.status-badge-animated:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

.status-badge-animated .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--tp-yellow);
  border-radius: 50%;
  animation: mini-pulse 1.8s infinite;
}

@keyframes mini-pulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

/* Tracking ID & Progress Bar */
.tp-tracking-info {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 10px;
}

.id-label {
  display: block;
  font-size: 0.72rem;
  color: var(--tp-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.tracking-id {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--tp-primary);
  font-family: var(--tp-font);
}

/* Progress Track */
.tp-progress-track {
  flex: 1;
  display: flex;
  justify-content: space-between;
  position: relative;
  padding-top: 12px;
}

.tp-progress-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  position: relative;
  cursor: pointer;
}

.node-icon {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 2px solid var(--tp-border-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tp-text-muted);
  margin-bottom: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-progress-node:hover .node-icon {
  transform: scale(1.14);
  box-shadow: 0 4px 14px rgba(247, 198, 0, 0.4);
}

.tp-progress-node.completed .node-icon {
  background: var(--tp-primary);
  color: var(--tp-yellow);
  border-color: var(--tp-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tp-progress-node.active .node-icon {
  background: var(--tp-yellow);
  color: #1B1B1B;
  border-color: var(--tp-yellow);
  box-shadow: 0 0 0 4px var(--tp-yellow-glow);
}

.node-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tp-text-muted);
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.tp-progress-node:hover .node-label {
  color: var(--tp-primary);
}

.tp-progress-node.completed .node-label,
.tp-progress-node.active .node-label {
  color: var(--tp-primary);
  font-weight: 700;
}

.progress-bg {
  position: absolute;
  top: 30px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: var(--tp-border);
  z-index: 1;
}

.progress-fill {
  height: 100%;
  background: var(--tp-yellow);
  transition: width 0.8s ease;
}

/* ==========================================================================
   3. Body Layout: Map & Data Cards
   ========================================================================== */

.tp-dash-body {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Advanced Interactive Logistics Map & Marker System */

.tp-map-container {
  position: relative;
  background: #0f172a;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  overflow: hidden;
  height: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin-top: 24px;
}

.tp-map-interface {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 440px;
}

/* Floating Map HUD */
.tp-map-hud-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

.tp-map-hud-left, .tp-map-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.tp-map-badge {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.tp-map-badge .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: live-blink 1.5s infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Custom Marker - Origin */
.tp-marker-origin-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tp-marker-origin-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.6);
  position: relative;
  z-index: 2;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tp-marker-origin-pin:hover {
  transform: scale(1.18);
}

.tp-marker-origin-halo {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.35);
  top: -8px;
  left: -8px;
  z-index: 1;
  animation: origin-pulse 2.2s infinite ease-out;
}

@keyframes origin-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Custom Marker - Live In-Transit Vehicle */
.tp-marker-live-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tp-marker-live-pin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111827;
  border: 3px solid #F7C600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F7C600;
  box-shadow: 0 0 20px rgba(247, 198, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 5;
  transition: transform 0.3s ease;
}

.tp-vehicle-icon-svg {
  width: 22px;
  height: 22px;
  fill: #F7C600;
}

.tp-radar-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  margin-left: -22px;
  background: rgba(247, 198, 0, 0.35);
  border: 1.5px solid rgba(247, 198, 0, 0.8);
  border-radius: 50%;
  pointer-events: none;
  animation: radar-sonar 2.4s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

.tp-radar-wave:nth-child(2) {
  animation-delay: 0.8s;
}

.tp-radar-wave:nth-child(3) {
  animation-delay: 1.6s;
}

@keyframes radar-sonar {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.tp-marker-cp-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  transition: transform 0.2s ease;
}

.tp-marker-cp-pin:hover {
  transform: scale(1.25);
}

/* Custom Marker - Destination */
.tp-marker-dest-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tp-marker-dest-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ef4444;
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.6);
  position: relative;
  z-index: 2;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tp-marker-dest-pin:hover {
  transform: scale(1.18);
}

.tp-marker-dest-halo {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.35);
  top: -8px;
  left: -8px;
  z-index: 1;
  animation: dest-pulse 2.2s infinite ease-out;
}

@keyframes dest-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Marker Tooltip Tags */
.tp-marker-tooltip-tag {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* Flowing Polyline Animation */
@keyframes routeFlow {
  from {
    stroke-dashoffset: 40;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.tp-flowing-route {
  stroke-dasharray: 10, 12;
  animation: routeFlow 1.2s linear infinite;
}

/* Modern Crisp White Theme Popups */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 0 !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
  overflow: hidden;
}

.leaflet-popup-tip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.leaflet-popup-close-button {
  color: #64748b !important;
  top: 8px !important;
  right: 10px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  transition: color 0.15s ease !important;
}

.leaflet-popup-close-button:hover {
  color: #0f172a !important;
}

.tp-custom-popup {
  padding: 14px 18px;
  min-width: 230px;
  font-family: inherit;
}

.tp-popup-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.tp-popup-tag.origin {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.tp-popup-tag.live {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.tp-popup-tag.checkpoint {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.tp-popup-tag.dest {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.tp-popup-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.35;
}

.tp-popup-meta {
  font-size: 11.5px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.4;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
  margin-top: 4px;
}

.tp-popup-meta strong {
  color: #1e293b;
  font-weight: 600;
}

/* Data Grid */
.tp-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tp-data-card {
  background: #ffffff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 28px;
  box-shadow: var(--tp-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-data-card:hover {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.card-lbl {
  color: var(--tp-primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tp-border);
  transition: color 0.2s ease;
}

.tp-data-card:hover .card-lbl {
  border-bottom-color: var(--tp-yellow);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-item .g-lab {
  display: block;
  font-size: 0.72rem;
  color: var(--tp-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.grid-item .g-val {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--tp-primary);
}

/* Package & Commodity Banner & Specs */
.tp-package-banner {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 22px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-package-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-package-title-group {
  flex: 1;
}

.tp-package-category {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #F7C600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tp-package-goods-desc {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.tp-package-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tp-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.tp-tag-chip.secure {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.tp-tag-chip.caution {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.tp-tag-chip.code {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-family: monospace;
}

.tp-vehicle-rotator {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.col-span-2 {
  grid-column: span 2;
}

/* Shipper & Consignee Split */
.party-split {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.party-box {
  flex: 1;
}

.p-dir {
  font-size: 0.72rem;
  color: #b45309;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.p-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tp-primary);
  margin-bottom: 6px;
}

.p-addr {
  color: var(--tp-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.p-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--tp-text-muted);
  margin-top: 6px;
}

.party-divider {
  color: var(--tp-border-dark);
  align-self: center;
}

/* ==========================================================================
   4. Activity Logs / Shipment Timeline
   ========================================================================== */

.tp-activity-logs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.tp-log-row {
  display: flex;
  gap: 20px;
  position: relative;
  padding: 8px 12px;
  border-radius: var(--tp-radius);
  transition: all 0.25s ease;
}

.tp-log-row:hover {
  background: #fffbeb;
  transform: translateX(4px);
}

.log-time {
  width: 90px;
  text-align: right;
  flex-shrink: 0;
}

.log-time .time {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tp-primary);
}

.log-time .date {
  font-size: 0.78rem;
  color: var(--tp-text-muted);
}

.log-sep {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2px;
  background: var(--tp-border);
  position: relative;
  margin: 4px 0;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.log-sep .dot {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid var(--tp-border-dark);
  border-radius: 50%;
  position: absolute;
  left: -4px;
  top: 4px;
  transition: all 0.25s ease;
}

.tp-log-row:hover .log-sep .dot {
  border-color: var(--tp-yellow);
  background: var(--tp-yellow);
  transform: scale(1.2);
}

.tp-log-row.active .log-sep {
  background: var(--tp-yellow);
}

.tp-log-row.active .log-sep .dot {
  background: var(--tp-yellow);
  border-color: #1B1B1B;
  box-shadow: 0 0 0 3px var(--tp-yellow-glow);
}

.log-content {
  flex: 1;
  padding-bottom: 6px;
}

.log-status {
  font-weight: 700;
  font-size: 1rem;
  color: var(--tp-primary);
  margin-bottom: 3px;
  transition: color 0.2s ease;
}

.tp-log-row:hover .log-status {
  color: #b45309;
}

.tp-log-row.active .log-status {
  color: #b45309;
}

.log-loc {
  color: var(--tp-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.log-note {
  font-size: 0.88rem;
  color: var(--tp-primary);
  margin-top: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-left: 3px solid var(--tp-yellow);
  border-radius: 0 var(--tp-radius) var(--tp-radius) 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   5. Action Buttons (Track Another Shipment, Print)
   ========================================================================== */

.tp-dash-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

.tp-btn-secondary {
  background: var(--tp-yellow);
  color: #1B1B1B;
  border: 1px solid var(--tp-yellow);
  padding: 13px 28px;
  border-radius: var(--tp-radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tp-btn-secondary:hover {
  background: #1B1B1B;
  color: var(--tp-yellow);
  border-color: #1B1B1B;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.tp-btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}



/* ==========================================================================
   7. Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
  .tp-tracking-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .tp-progress-track {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .tp-landing {
    padding: 30px 10px 50px 10px;
  }
  .tp-landing h1 {
    font-size: 1.85rem;
  }
  .tp-search-box {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }
  .search-icon {
    display: none;
  }
  .tp-search-box input {
    text-align: center;
    border-bottom: 1px solid var(--tp-border);
    border-radius: 0;
  }
  .tp-search-box button {
    width: 100%;
  }
  .tp-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .tp-data-grid {
    grid-template-columns: 1fr;
  }
  .party-split {
    flex-direction: column;
    gap: 20px;
  }
  .party-divider {
    transform: rotate(90deg);
    align-self: center;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2 {
    grid-column: auto;
  }
  .tp-progress-node .node-label {
    font-size: 0.65rem;
    max-width: 65px;
    white-space: normal;
  }
  .tp-map-container {
    height: 360px;
  }
  .tp-dash-actions {
    flex-direction: column;
    width: 100%;
  }
  .tp-dash-actions button,
  .tp-dash-actions .tp-btn-primary,
  .tp-dash-actions .tp-btn-secondary {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .tp-dash-card {
    padding: 1.15rem 1rem;
  }
  .tp-badge-lg {
    font-size: 0.78rem;
    padding: 4px 10px;
  }
  .tp-map-container {
    height: 300px;
  }
  .tp-map-badge {
    font-size: 0.68rem;
    padding: 4px 10px;
  }
  .tp-status-title {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   Dashboard Action Buttons & Premium Hover Effects
   ========================================================================== */

.tp-dash-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px !important;
  margin-top: 36px !important;
  margin-bottom: 20px !important;
  flex-wrap: wrap !important;
}

.tp-dash-actions button,
.tp-dash-actions .tp-btn-primary,
.tp-dash-actions .tp-btn-secondary {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 14px 28px !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  outline: none !important;
  user-select: none !important;
}

/* Secondary Button: Track Another */
.tp-dash-actions .tp-btn-secondary,
#btnTrackAnother {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1.5px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.tp-dash-actions .tp-btn-secondary:hover,
#btnTrackAnother:hover {
  background: #1e293b !important;
  color: #F7C600 !important;
  border-color: #F7C600 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.tp-dash-actions .tp-btn-secondary:active,
#btnTrackAnother:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Primary Button: Download Waybill */
.tp-dash-actions .tp-btn-primary,
#btnDownloadWaybill {
  background: #F7C600 !important;
  color: #0f172a !important;
  border: 1.5px solid #F7C600 !important;
  box-shadow: 0 4px 14px rgba(247, 198, 0, 0.35) !important;
}

.tp-dash-actions .tp-btn-primary:hover,
#btnDownloadWaybill:hover {
  background: #dfb200 !important;
  color: #000000 !important;
  border-color: #dfb200 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(247, 198, 0, 0.5) !important;
}

.tp-dash-actions .tp-btn-primary:active,
#btnDownloadWaybill:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(247, 198, 0, 0.25) !important;
}

/* Spinner during PDF download */
.tp-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge .badge-dot,
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  display: inline-block;
}

.badge.in-transit,
.badge-in-transit {
  background-color: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge.in-transit .badge-dot,
.badge-in-transit::before { background-color: #d97706; }

.badge.delivered,
.badge-delivered {
  background-color: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge.delivered .badge-dot,
.badge-delivered::before { background-color: #10b981; }

.badge.out-for-delivery,
.badge-out-for-delivery {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.badge.out-for-delivery .badge-dot,
.badge-out-for-delivery::before { background-color: #0284c7; }

.badge.order-created,
.badge-order-created {
  background-color: rgba(168, 85, 247, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge.order-created .badge-dot,
.badge-order-created::before { background-color: #9333ea; }

.badge.exception,
.badge-exception {
  background-color: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge.exception .badge-dot,
.badge-exception::before { background-color: #ef4444; }

.badge.pending,
.badge-pending {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.badge.pending .badge-dot,
.badge-pending::before { background-color: #64748b; }

/* ==========================================================================
   Waybill Sheet (Official Vector PDF & Print Layout)
   ========================================================================== */

#tpWaybillExportWrap {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 820px;
  z-index: -100;
}

.waybill-sheet {
  background: #ffffff;
  color: #111827;
  padding: 2.2rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  box-sizing: border-box;
}

.waybill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #111827;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.waybill-brand h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.waybill-brand p {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.waybill-code-block {
  text-align: right;
}

.waybill-tracking-num {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #df2423;
  letter-spacing: 1px;
}

.waybill-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.waybill-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
}

.waybill-box-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.waybill-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.waybill-table th {
  background: #f3f4f6;
  color: #374151;
  text-align: left;
  padding: 7px 10px;
  font-weight: 700;
  border: 1px solid #e5e7eb;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.waybill-table td {
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  color: #1f2937;
}

.waybill-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #d1d5db;
}

.signature-line {
  border-top: 1px solid #9ca3af;
  margin-top: 2rem;
  padding-top: 0.35rem;
  font-size: 0.72rem;
  color: #6b7280;
  text-align: center;
}

@media print {
  body * {
    visibility: hidden;
  }
  #tpWaybillExportWrap, #tpWaybillExportWrap * {
    visibility: visible;
  }
  #tpWaybillExportWrap {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 99999;
  }
  .waybill-sheet {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
