:root {
  --ink: #1f2b24;
  --muted: #617066;
  --forest: #126b27;
  --forest-deep: #0d4d1d;
  --paper: rgba(255, 251, 245, 0.86);
  --paper-soft: #eef5e8;
  --line: rgba(18, 42, 23, 0.14);
  --shadow: 0 24px 60px rgba(18, 42, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(67, 151, 82, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(25, 106, 44, 0.14), transparent 28%),
    linear-gradient(135deg, #f8fcf5 0%, #edf8ec 48%, #e5f1e4 100%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

button,
input,
select {
  font: inherit;
}

.hidden,
.hidden-input {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--forest);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-row.compact {
  gap: 14px;
}

.brand-logo {
  width: 94px;
  border-radius: 20px;
  background: white;
}

.brand-logo.compact {
  width: 64px;
}

.login-shell,
.app-shell {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.hero-card,
.controls-card,
.map-card,
.detail-card {
  background: var(--paper);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(560px, 100%);
  border-radius: 32px;
  padding: 32px;
}

.login-copy,
.hero-copy,
.helper-copy,
.detail-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-emphasis {
  margin: 28px 0 0;
  color: var(--forest-deep);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label,
.controls-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-form span,
.controls-grid span {
  color: var(--forest-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 14px 16px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 18px;
  min-height: 56px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  border: 0;
  background: linear-gradient(135deg, var(--forest-deep), var(--forest));
  color: white;
}

.secondary-btn,
.ghost-btn,
.status-pill,
.metric-pill,
.map-badge {
  border: 1px solid rgba(18, 107, 39, 0.16);
  background: var(--paper-soft);
  color: var(--forest);
}

.secondary-btn,
.ghost-btn {
  color: var(--forest-deep);
}

.login-btn {
  margin-top: 8px;
}

.login-feedback {
  min-height: 1.4rem;
  margin: 0;
  color: #b32727;
  font-weight: 700;
}

.app-shell {
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-actions,
.hero-metrics,
.map-badges {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.status-pill,
.metric-pill,
.map-badge {
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.hero-card,
.controls-card,
.map-card,
.detail-card {
  border-radius: 30px;
  padding: 24px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.map-hero {
  padding-bottom: 34px;
}

.hero-copy-block {
  min-width: 0;
}

.metric-pill {
  min-width: 124px;
  display: grid;
  gap: 4px;
}

.metric-pill span {
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-pill strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 520px;
}

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

.map-controls-card {
  display: grid;
  gap: 18px;
}

.starting-point-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: end;
}

.starting-point-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.map-go-btn {
  width: 100%;
}

.controls-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.import-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.import-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.helper-copy {
  margin: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 18px;
}

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

.geocode-btn {
  min-height: 48px;
}

.map-stage {
  position: relative;
  overflow: hidden;
  min-height: 540px;
  margin-top: 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #dfe8de;
}

.map-frame,
.map-empty {
  position: absolute;
  inset: 0;
}

.map-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #dfe8de;
}

.map-empty,
.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.04rem;
  text-align: center;
  padding: 32px;
}

.detail-panel {
  margin-top: 18px;
}

.route-actions {
  display: grid;
  gap: 14px;
}

.route-btn {
  width: 100%;
}

.route-summary-card {
  margin-top: 18px;
  border-radius: 24px;
  background: var(--paper-soft);
  padding: 22px 20px;
  border: 1px solid rgba(18, 107, 39, 0.1);
}

.route-summary-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
  color: var(--forest-deep);
}

.route-summary-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.detail-intro-card {
  margin-bottom: 12px;
}

.stop-card {
  margin-top: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
}

.selected-stop {
  box-shadow: inset 0 0 0 2px rgba(18, 107, 39, 0.18);
}

.stop-card-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.stop-label {
  color: var(--forest);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stop-card p {
  margin: 6px 0;
}

.drive-leg-btn {
  width: 100%;
  margin-top: 12px;
}

.nearby-copy {
  margin-top: 14px;
}

.nearby-copy strong {
  display: block;
  margin-bottom: 6px;
  color: var(--forest-deep);
}

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

.detail-item,
.note-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.detail-item {
  padding: 14px 16px;
}

.detail-item span,
.note-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.note-card {
  margin-top: 12px;
  padding: 16px;
}

.note-card strong,
.detail-item strong {
  font-size: 1rem;
}

.note-card p {
  margin: 0;
}

.lead-board-card {
  display: grid;
  gap: 18px;
}

.lead-board-header {
  display: grid;
  gap: 16px;
}

.lead-board-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
}

.lead-table th,
.lead-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(18, 42, 23, 0.08);
}

.lead-table thead th {
  color: var(--forest-deep);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-row {
  cursor: pointer;
}

.lead-row.active,
.lead-row:hover {
  background: rgba(232, 245, 231, 0.9);
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .starting-point-row,
  .lead-board-filters,
  .controls-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .hero-metrics {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .login-shell {
    padding: 16px;
  }

  .topbar,
  .controls-footer,
  .panel-header {
    flex-direction: column;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    max-width: none;
  }

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

  .map-stage {
    min-height: 420px;
  }
}
