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

:root {
  --navy: #070e1a;
  --deep: #0c1829;
  --surface: #111f36;
  --teal: #00d4aa;
  --teal-dim: rgba(0, 212, 170, 0.15);
  --teal-glow: rgba(0, 212, 170, 0.08);
  --white: #f0f4f8;
  --gray: #8899ab;
  --mid: #c2cedb;
  --red: #ff4d6a;
  --yellow: #f5c542;
  --green: #00d4aa;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; line-height: 1.15; }

.page { display: none; min-height: 100vh; }
.page.active { display: block; }

.teal { color: var(--teal); }

/* ─── NAV ─── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--white);
}
.logo span { color: var(--teal); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-tag {
  font-size: 0.75rem;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── BUTTONS ─── */
.btn-primary {
  background: var(--teal);
  color: var(--navy);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-primary.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-ghost {
  background: transparent;
  color: var(--mid);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-danger {
  background: rgba(255,77,106,0.15);
  color: var(--red);
  border: 1px solid rgba(255,77,106,0.3);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-danger:hover { background: rgba(255,77,106,0.25); }
.btn-download {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-download:hover { background: rgba(0,212,170,0.25); }

/* ─── HERO ─── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 48px 100px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--teal-glow), transparent 70%);
  pointer-events: none;
}
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 8px 18px;
  border-radius: 24px;
  margin-bottom: 28px;
  font-weight: 500;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 28px 36px;
  background: var(--deep);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  display: block;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.08);
}

/* ─── FEATURES ─── */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px 100px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--deep);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s;
}
.feature-card:hover {
  border-color: rgba(0,212,170,0.3);
  transform: translateY(-2px);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ─── FOOTER ─── */
.landing-footer {
  text-align: center;
  padding: 40px;
  color: var(--gray);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── DASHBOARD ─── */
.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 48px 60px;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.dash-stat-card {
  background: var(--deep);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px 24px;
}
.dash-stat-label {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.dash-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Table Section */
.table-section {
  background: var(--deep);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
}
.table-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.table-header h2 {
  font-size: 1.1rem;
}

.empty-state {
  text-align: center;
  padding: 80px 40px;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--gray); margin-bottom: 24px; font-size: 0.95rem; }

.shipments-table {
  width: 100%;
  border-collapse: collapse;
}
.shipments-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shipments-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.shipments-table tr:hover td {
  background: rgba(0,212,170,0.03);
}
.route-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.route-arrow { color: var(--teal); font-size: 0.8rem; }
.doc-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: 'DM Sans', sans-serif;
}
.status-badge:hover { opacity: 0.85; }
.status-pending { background: rgba(245,197,66,0.15); color: var(--yellow); }
.status-in_transit { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-at_port { background: rgba(168,85,247,0.15); color: #a855f7; }
.status-customs { background: rgba(249,115,22,0.15); color: #f97316; }
.status-delivered { background: rgba(0,212,170,0.15); color: var(--teal); }
.status-cancelled { background: rgba(255,77,106,0.15); color: var(--red); }

/* Status Dropdown */
.status-dropdown {
  position: relative;
  display: inline-block;
}
.status-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 4px;
  z-index: 100;
  min-width: 150px;
  margin-top: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.status-options.show { display: block; }
.status-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
}
.status-option:hover { background: rgba(255,255,255,0.06); }

/* ─── MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show {
  display: flex;
}
.modal {
  background: var(--deep);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 32px;
  max-width: 580px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: var(--white); }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.82rem;
  color: var(--gray);
  font-weight: 500;
}
.form-group input, .form-group select {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--teal);
}
.form-group input::placeholder {
  color: rgba(136,153,171,0.5);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Detail View */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.detail-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}
.detail-item span {
  font-size: 1rem;
}
.detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.detail-section h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--teal);
}
.detail-doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 8px;
}
.detail-doc-info {
  display: flex;
  flex-direction: column;
}
.detail-doc-type {
  font-weight: 600;
  font-size: 0.9rem;
}
.detail-doc-date {
  font-size: 0.78rem;
  color: var(--gray);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--teal);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 2000;
  animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.toast.error { border-color: var(--red); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } }
@keyframes slideOut { to { transform: translateY(20px); opacity: 0; } }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  nav { padding: 20px 24px; }
  .hero { padding: 40px 24px 60px; }
  .hero h1 { font-size: 2.2rem; }
  .hero-cta { flex-direction: column; }
  .stats-bar { flex-direction: column; gap: 20px; text-align: center; }
  .stat-divider { width: 40px; height: 1px; }
  .feature-grid { grid-template-columns: 1fr; }
  .dashboard-main { padding: 20px 16px 60px; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .shipments-table { font-size: 0.82rem; }
  .shipments-table th, .shipments-table td { padding: 12px 12px; }
  .modal { padding: 24px; width: 95%; }
}
