* {
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 45%, #000000 100%);
  color: #e5e7eb;
  font-size: 16px;
}

header {
  padding: 12px 24px 0;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  backdrop-filter: blur(10px);
  background: linear-gradient(to right, rgba(15,23,42,0.95), rgba(15,23,42,0.85));
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  text-align: center;
}

header h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

header p {
  margin: 0;
  color: #9ca3af;
  font-size: 14px;
}

.header-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}

.header-cta {
  margin-top: 4px;
  padding: 6px 14px;
  font-size: 15px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37,99,235,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37,99,235,0.6);
  filter: brightness(1.05);
}

.nav-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 10px;
  border-top: 1px solid rgba(15,23,42,0.7);
  border-bottom: 1px solid rgba(15,23,42,0.7);
  margin-top: 4px;
}

.nav-tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #e5e7eb;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
}

.nav-tab:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.nav-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37,99,235,0.5);
}

main {
  padding: 16px 24px 32px;
  max-width: 1360px;
  margin: 0 auto;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeInUp 0.3s ease forwards;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

label {
  font-size: 14px;
}

select, button {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
}

input, textarea {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #0b1224;
  color: #e5e7eb;
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 64px;
}

button {
  cursor: pointer;
  background: #2563eb;
  border-color: #2563eb;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover {
  background: #1d4ed8;
  box-shadow: 0 8px 18px rgba(37,99,235,0.45);
  transform: translateY(-1px);
}

.output h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

#table-container {
  width: 100%;
  overflow-x: auto;
  background: #020617;
  border-radius: 6px;
  border: 1px solid #1f2937;
  padding: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th, td {
  border: 1px solid #1f2937;
  padding: 6px 8px;
}

th {
  background: #111827;
  text-align: left;
}

tr:nth-child(even) td {
  background: #030712;
}

footer {
  padding: 18px 28px 26px;
  font-size: 14px;
  line-height: 1.55;
  color: #cbd5e1;
  text-align: left;
  border-top: 1px solid #1f2937;
  margin-top: 28px;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-card {
  max-width: 1280px;
  margin: 0 auto;
  background: radial-gradient(circle at 18% 18%, rgba(59,130,246,0.12), rgba(15,23,42,0.65)), #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  padding: 18px 20px 20px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.92);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.footer-block {
  padding-right: 6px;
}

.footer-title {
  margin: 0 0 8px;
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 15px;
}

.footer-line {
  margin: 0 0 6px;
  color: #cbd5e1;
}

.footer-label {
  font-weight: 700;
  color: #e5e7eb;
}

.footer-dot {
  color: #60a5fa;
  margin-right: 4px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }
  .card {
    background: #020617;
    border-radius: 10px;
    border: 1px solid #1f2937;
    padding: 14px 16px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.8);
    transform: translateY(0);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #9ca3af;
  }
  .metric {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
  }
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(15,23,42,0.95);
    border-color: #2563eb;
  }

  .card {
    background: #020617;
    border-radius: 8px;
    border: 1px solid #1f2937;
    padding: 10px 12px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.8);
    transform: translateY(0);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #9ca3af;
  }

  .metric {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
  }

  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(15,23,42,0.95);
    border-color: #2563eb;
  }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: #020617;
  border-radius: 8px;
  border: 1px solid #1f2937;
  padding: 10px 12px 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.9);
  animation: fadeIn 0.35s ease;
  overflow-x: auto; /* allow wide tables (e.g., recent pickups) to scroll instead of being cut off */
}

.panel h2, .panel h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 16px;
}

.section-header {
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0 0 4px;
}

.section-header p {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.routes-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.filters-row label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.form-grid button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
}

.form-status {
  grid-column: 1 / -1;
  font-size: 13px;
  color: #9ca3af;
}

.secondary {
  background: #111827;
  border-color: #4b5563;
}

.secondary:hover {
  background: #1f2937;
}

.list {
  font-size: 14px;
}

.list-item {
  padding: 6px 6px;
  border-bottom: 1px solid #1f2937;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease;
}

.list-item:hover {
  background: #020617;
  transform: translateX(2px);
}

.list-item.active {
  background: #1d4ed8;
}

.list-item small {
  display: block;
  color: #9ca3af;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}

.pill-status-open { background: #b91c1c; border-color: #fecaca; color: #fee2e2; }
.pill-status-in_progress { background: #92400e; border-color: #fed7aa; color: #ffedd5; }
.pill-status-resolved { background: #14532d; border-color: #bbf7d0; color: #dcfce7; }

.muted {
  color: #9ca3af;
  font-size: 13px;
}

.two-col-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 700px) {
  .two-col-detail {
    grid-template-columns: 1fr;
  }
}

.detail-block h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.detail-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.detail-block li {
  padding: 3px 0;
}

.small-table {
  font-size: 13px;
  min-width: 620px; /* ensure dashboard tables don't squash too narrow */
}

.small-table th, .small-table td {
  padding: 4px 6px;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
