:root {
  --bg: #f3f4f7;
  --card: #ffffff;
  --ink: #1c2030;
  --muted: #6b7185;
  --line: #e3e6ee;
  --accent: #0f7a55;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4ec;
  --ok: #17803d;
  --ok-soft: #e5f5ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 8px 24px rgba(20, 24, 40, .06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 32px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 16px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: #c9cedb; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=time], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--accent-soft); color: #0b5c40; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badge::first-letter { text-transform: uppercase; }
.badge.pendiente { background: var(--warn-soft); color: var(--warn); }
.badge.confirmada { background: var(--ok-soft); color: var(--ok); }
.badge.rechazada, .badge.cancelada { background: var(--bad-soft); color: var(--bad); }

/* ─── Página de agendar ─── */
.booking { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.booking .intro { padding: 28px; border-right: 1px solid var(--line); }
.booking .intro .owner { color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.booking .intro h1 { font-size: 24px; margin-bottom: 14px; }
.meta { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; color: var(--muted); font-weight: 600; }
.meta li { display: flex; gap: 10px; align-items: center; }
.meta svg { width: 18px; height: 18px; flex: none; }
.choice { margin-top: 22px; padding: 14px; border-radius: 10px; background: var(--accent-soft); color: #0b5c40; font-weight: 600; }
.choice .small { font-weight: 400; }
.booking .main { padding: 28px; min-height: 480px; }
.step-title { font-size: 19px; margin-bottom: 18px; }

.picker { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head strong { font-size: 16px; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-grid .dow { font-size: 12px; color: var(--muted); font-weight: 700; padding-bottom: 4px; text-transform: uppercase; }
.day {
  aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 0; background: transparent; color: #aab0c0; cursor: default;
  font-weight: 600; display: grid; place-items: center; position: relative;
}
.day.available { background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.day.available:hover { background: #cdeadb; }
.day.selected { background: var(--accent); color: #fff; }
.day.today::after { content: ""; position: absolute; bottom: 12%; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tz { margin-top: 14px; }

.slots h3 { font-size: 15px; margin-bottom: 12px; }
.slot-list { display: grid; gap: 8px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.slot {
  border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 10px;
  padding: 11px; font-weight: 700; cursor: pointer;
}
.slot:hover { background: var(--accent-soft); }
.empty { color: var(--muted); padding: 12px 0; }

.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.type-opt { position: relative; }
.type-opt input { position: absolute; opacity: 0; }
.type-opt span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-weight: 600; cursor: pointer; }
.type-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.type-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hp { position: absolute; left: -9999px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.done { text-align: center; max-width: 460px; margin: 30px auto; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.done h2 { margin-bottom: 10px; }
.summary { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 18px 0; }
.summary div { display: flex; gap: 10px; padding: 3px 0; }
.summary dt, .summary .k { color: var(--muted); min-width: 92px; }

.narrow { max-width: 560px; margin: 0 auto; padding: 28px; }
footer.foot { text-align: center; margin-top: 18px; }

@media (max-width: 860px) {
  .booking { grid-template-columns: 1fr; }
  .booking .intro { border-right: 0; border-bottom: 1px solid var(--line); }
  .picker { grid-template-columns: 1fr; }
  .slot-list { max-height: none; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (max-width: 520px) {
  .wrap { padding: 16px 12px 32px; }
  .booking .intro, .booking .main, .narrow { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .day { font-size: 14px; }
}

/* ─── Proponer otros horarios ─── */
.badge.reagendar { background: #eef0ff; color: #3b3fb6; }
.proposal { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.proposal-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.daynav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.daynav input { max-width: 190px; }
.agenda-box { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.agenda-box ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.chip-slot { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; padding: 8px 4px; font-weight: 700; cursor: pointer; }
.chip-slot:hover { background: var(--accent-soft); }
.chip-slot.on { background: var(--accent); color: #fff; }
.options { display: grid; gap: 8px; margin: 14px 0; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.option.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.option.gone { opacity: .55; }
.quote { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: var(--accent-soft); color: #0b5c40; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 15px; }
.step-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* ─── Traslados y resumen ─── */
.travel-box { list-style: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); display: grid; gap: 6px; font-size: 14px; }
.tr-ok b { color: var(--ok); }
.tr-bad { color: var(--bad); }
.tr-unknown { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px 16px; text-align: left; cursor: pointer; border: 1px solid var(--line); }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.overview { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.day.has { color: var(--ink); cursor: pointer; }
.day .dots { position: absolute; bottom: 10%; display: flex; gap: 2px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.day .dots i.p { background: #d08a00; }
.day.pick { cursor: pointer; }
.day.pick:hover { background: var(--bg); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.tl .when { font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 10px; }
.tl .what { border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; }
.tl.cita .what { border-left: 4px solid var(--ok); }
.tl.cita.pendiente .what { border-left-color: #d08a00; }
.tl.traslado .what { background: var(--bg); border-style: dashed; font-size: 14px; }
.tl.traslado.late .what { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.next-card { padding: 14px 16px; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .overview { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
