:root {
  --ink: #102126;
  --deep: #07262e;
  --sea: #0e4c57;
  --foam: #e7f6f2;
  --paper: #f3f7f5;
  --card: #fffcf8;
  --line: rgba(16, 33, 38, 0.12);
  --cyan: #1577a8;
  --aqua: #0e8f7e;
  --sun: #b67912;
  --coral: #b42318;
  --muted: #5d6f74;
  --shadow: 0 24px 60px rgba(7, 38, 46, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}
img, svg { display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px 12px 10px 14px;
  background: rgba(255, 252, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--deep);
  display: grid;
  place-items: center;
}
.mark svg { width: 30px; height: 22px; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
nav { display: flex; gap: 8px; }
nav a {
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--sea);
  white-space: nowrap;
}
nav a[aria-current="page"] {
  background: var(--deep);
  color: #e9fbf6;
}

.demo {
  width: min(1120px, calc(100% - 32px));
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0 18px;
}
.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 42px 40px;
  border-radius: 28px;
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(46, 163, 242, 0.35), transparent 70%),
    radial-gradient(380px 240px at 0% 100%, rgba(14, 143, 126, 0.35), transparent 70%),
    var(--deep);
  color: #e7f7f2;
}
.hero-copy h1 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(46px, 6vw, 74px);
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: #9ee7d8;
}
.lede { margin: 0; max-width: 38ch; font-size: 18px; color: #d5ebe6; }
.points {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.points li { margin: 0; }
.points b { font-weight: 650; color: white; }
.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: 54px;
  opacity: 0.45;
}

.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
form.card { padding: 26px; }
.card h2, .panel h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 32px;
  letter-spacing: -0.03em;
}
.hint { margin: 0 0 18px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field span { font-size: 13px; color: var(--sea); }
input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(16, 33, 38, 0.16);
  background: #fff;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(21, 119, 168, 0.12); }

.actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
button.primary, a.primary {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--deep);
  color: #f3fffb;
  text-decoration: none;
}
button.primary:hover, a.primary:hover { background: #0c3d49; }
button.ghost, a.ghost {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
}
button.waze {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: #102a22;
  color: #d9fff4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.waze:hover { background: #184438; }
button:disabled { opacity: 0.55; cursor: wait; }
.error { min-height: 1.2em; margin: 8px 0 0; color: var(--coral); font-size: 14px; }
.ok-title {
  margin: 8px 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 8px 0 42px;
}
.steps article {
  padding: 18px 18px 16px;
  border-top: 1px solid var(--line);
}
.steps strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 560;
}
.steps p { margin: 6px 0 0; color: var(--muted); }

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
.site-foot a { color: var(--cyan); }

.toolbar {
  position: sticky;
  top: 78px;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 22px 0 16px;
  padding: 14px;
  background: rgba(243, 247, 245, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}
.toolbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 36px;
  letter-spacing: -0.04em;
}
.dayline { margin: 4px 0 0; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.controls label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.controls input, .controls select { background: white; padding: 10px 12px; }

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding-bottom: 48px;
}
.visit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
}
.visit header, .visit footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.when { font-variant-numeric: tabular-nums; font-weight: 650; }
.visit h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.visit p { margin: 0; }
.muted { color: var(--muted); }
.visit .notes {
  color: var(--sea);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status.solicitada { background: #fff4d8; color: var(--sun); }
.status.confirmada { background: #ddf7f1; color: var(--aqua); }
.status.hecha { background: #e5eef1; color: var(--sea); }
.status.cancelada { background: #f3e8e6; color: #8a625c; }
.visit.cancelada { opacity: 0.62; }
.visit footer { margin-top: auto; padding-top: 8px; }
.visit select { width: auto; padding: 8px 10px; border-radius: 999px; }
.empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

dialog {
  width: min(920px, calc(100% - 24px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: transparent;
}
dialog::backdrop { background: rgba(7, 24, 30, 0.62); }
.sheet {
  padding: 22px;
  background: var(--card);
  border-radius: 24px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.sheet header { display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; }
.route-actions { margin-top: 0; flex-wrap: wrap; }
.sheet h2 { margin: 0; font-family: var(--serif); font-weight: 560; font-size: 34px; letter-spacing: -0.03em; }
#editor { width: min(640px, calc(100% - 24px)); }
.map {
  height: 280px;
  margin: 14px 0;
  border-radius: 18px;
  overflow: hidden;
  background: #d7e6e4;
}
.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.route-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
}
.route-list li.current { border-color: var(--aqua); background: #f3fffb; }
.reason { display: block; margin-top: 4px; color: var(--aqua); font-size: 14px; }
.reason.late { color: var(--coral); }
.ord {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--deep);
  color: white;
  font-size: 14px;
}
.ord-sm { width: 24px; height: 24px; font-size: 12px; }
.leaflet-div-icon.pin { background: transparent; border: 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: var(--deep);
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .hero, .steps, .grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .hero-copy { padding: 28px 22px 36px; }
  .toolbar { position: static; flex-direction: column; align-items: stretch; }
  .site-foot { flex-direction: column; }
  .top {
    margin-top: 8px;
    flex-wrap: wrap;
  }
  nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  nav a { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { transition: none; }
}
