@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: #e2e8f0;
  background-color: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.25rem 2rem;
  background-color: #0f172a;
}

header {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

header h1 {
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: #f8fafc;
}

header p {
  color: #94a3b8;
  margin: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: #1e293b;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px -28px rgba(15, 23, 42, 1);
  border: 1px solid #334155;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  background: #1b2538;
  border: none;
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  color: #cbd5f5;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab.active {
  background: #2563eb;
  color: #f8fafc;
}

.form {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
}

.form.active {
  display: flex;
}

.form-inline {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  gap: 0.25rem;
  color: #cbd5f5;
}

input,
button {
  font-size: 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #334155;
}

input {
  background: #0f172a;
  color: #e2e8f0;
}

input::placeholder {
  color: #64748b;
}

button {
  background: #2563eb;
  color: #f8fafc;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
  font-weight: 500;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  background: #475569;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #111827;
  color: #f8fafc;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  font-weight: 500;
}

.toast.visible {
  opacity: 0.95;
  transform: translateY(0);
}

.toast-success {
  background: #16a34a;
}

.toast-error {
  background: #dc2626;
}

.toast-warning {
  background: #d97706;
}

.toast-info {
  background: #1d4ed8;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  background: rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  font-size: 0.88rem;
  color: #cbd5f5;
}

.chip .remove {
  background: transparent;
  color: #93c5fd;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.1rem;
  align-items: stretch;
}

#map-container {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  min-height: 420px;
  height: 100%;
  padding: 0;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 420px;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.list-card h3 {
  margin-top: 0;
  color: #cbd5f5;
}

.route-card {
  border: 1px solid #2a3a55;
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.75rem;
  background: #16213a;
}

.route-card h4 {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: #f8fafc;
}

.route-card p {
  margin: 0;
  color: #cbd5f5;
  font-size: 0.9rem;
}

.route-card a {
  display: inline-block;
  margin-top: 0.4rem;
  color: #60a5fa;
  font-size: 0.88rem;
  text-decoration: none;
}

.route-card a:hover {
  text-decoration: underline;
}

.route-card ul {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.route-card li {
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  color: #e2e8f0;
}

#summary p {
  margin: 0.25rem 0;
  color: #f1f5f9;
}

#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

#history-list li {
  border: 1px solid #2a3a55;
  border-radius: 10px;
  padding: 0.65rem;
  background: #16213a;
  color: #e2e8f0;
}

#history-list a {
  color: #60a5fa;
  text-decoration: none;
}

#history-list a:visited {
  color: #93c5fd;
}

#history-list a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 1rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  border: 2px solid #1e293b;
}

@media (max-width: 960px) {
  body {
    padding: 0 1rem 2rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  #map {
    height: 360px;
  }
}


.assigned-section,
.route-section {
  margin-top: 0.6rem;
}

.assigned-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

.assigned-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.section-title {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #94a3b8;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.65);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 600;
}

.history-assigned {
  list-style: none;
  margin: 0.35rem 0 0.5rem;
  padding-left: 1rem;
  color: #cbd5f5;
}

.history-no-stops {
  margin: 0.25rem 0 0.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
}
