:root {
  --brand: #b0457a;
  --brand-dark: #8a3360;
  --brand-soft: #f8e8f0;
  --ink: #2b2230;
  --muted: #7a6f7f;
  --line: #e7dfe9;
  --bg: #fdfafc;
  --card: #ffffff;
  --ok: #2e8b57;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1 { font-family: "Playfair Display", serif; font-size: 1.7rem; margin: 0; font-weight: 600; }
h2.sub { font-size: 1rem; font-weight: 500; margin: 24px 0 10px; }

/* Top bar */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-family: "Playfair Display", serif; font-weight: 600; font-size: 1.2rem; }
.nav { display: flex; gap: 6px; }
.nav-link { background: transparent; border: 0; color: #fbe3ef; font: inherit; font-size: .92rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.nav-link.active, .nav-link:hover { background: rgba(255,255,255,.18); color: #fff; }

/* Layout */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding-top: 28px; padding-bottom: 48px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; gap: 24px; } }

/* Steps */
.steps { list-style: none; display: flex; padding: 0; margin: 0 0 26px; font-size: .85rem; color: var(--muted); counter-reset: none; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
/* línea que une los círculos */
.steps li:not(:first-child)::before { content: ""; position: absolute; top: 15px; right: calc(50% + 20px); left: calc(-50% + 20px); height: 2px; background: var(--line); }
.steps li.complete:not(:first-child)::before, .steps li.current:not(:first-child)::before { background: var(--brand); }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; font-size: .9rem; position: relative; z-index: 1; }
.steps li.current .step-num { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.steps li.current .step-label { color: var(--ink); font-weight: 600; }
.steps li.complete .step-num { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-size: 0; }
.steps li.complete .step-num::after { content: "✓"; font-size: .95rem; }
.steps li.complete .step-label { color: var(--brand); }
.steps li.clickable { cursor: pointer; }
.steps li.clickable:hover .step-num { background: var(--brand); color: #fff; }
.steps li.final.current .step-num { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px #dff1e7; font-size: 0; }
.steps li.final.current .step-num::after { content: "✓"; font-size: .95rem; }
.panel-head { margin-bottom: 20px; }

/* Staff */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px; }
.staff-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; transition: transform .12s, box-shadow .12s; }
.staff-card:hover, .staff-card:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(80,30,60,.12); outline: none; }
.staff-initial { height: 110px; display: grid; place-items: center; color: #fff; font-size: 3.6rem; font-weight: 500; }
.staff-name { padding: 12px 14px 14px; font-size: 1.05rem; }

/* Calendar */
.field-inline { display: inline-flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
select, input, textarea { font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.date-time { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; }
.time-col .sub { margin-top: 4px; }
.time-col .small { font-size: .85rem; margin: -4px 0 10px; }
.time-col .slots { grid-template-columns: 1fr 1fr; max-height: 420px; overflow-y: auto; padding-right: 4px; }
@media (max-width: 680px), (min-width: 861px) and (max-width: 1000px) { .date-time { grid-template-columns: 1fr; } .time-col .slots { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: none; } }
.calendar { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-width: 520px; }
.cal-day.closed { background: var(--brand-soft); color: #c9a3b8; border-radius: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 1.1rem; margin-bottom: 10px; }
.icon-btn { border: 0; background: var(--brand-soft); color: var(--brand); width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-dow { font-size: .78rem; color: var(--muted); padding-bottom: 4px; }
.cal-day { width: 100%; max-width: 44px; height: 40px; justify-self: center; border-radius: 999px; border: 1px solid transparent; background: transparent; font: inherit; font-size: .9rem; color: #c3b8c6; }
.cal-day.available { border-color: var(--line); color: var(--brand); cursor: pointer; }
.cal-day.available:hover { background: var(--brand-soft); }
.cal-day.today { text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
.cal-day.selected { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-width: 520px; }
.slot { border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 999px; padding: 9px; font: inherit; font-weight: 500; cursor: pointer; }
.slot:hover { background: var(--brand-soft); border-color: var(--brand); }
.slots .muted { grid-column: 1 / -1; margin: 0; }

/* Form */
.form { display: grid; gap: 16px; max-width: 520px; }
.form label { display: grid; gap: 6px; font-size: .9rem; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 6px 14px; font-size: .85rem; }
.error { color: #b3261e; font-size: .88rem; margin: 0; }

/* Done */
.done { text-align: center; padding: 30px 0; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 16px; }
.done p { margin: 14px auto 24px; max-width: 440px; line-height: 1.6; }

/* Side */
.side { align-self: start; }
.side-title { font-family: "Playfair Display", serif; font-size: 1.3rem; margin: 0 0 16px; font-weight: 600; }
.side-block { border-top: 1px solid var(--line); padding: 12px 0; }
.side-block p { margin: 2px 0; font-size: .92rem; }
.side-label { text-transform: uppercase; font-size: .72rem !important; letter-spacing: .06em; color: var(--muted); }
.side-strong { font-weight: 600; }
.side-person { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.mini-avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 600; flex: none; }

/* Agenda */
.agenda-filters { display: flex; gap: 16px; flex-wrap: wrap; }
.agenda-day { margin: 18px 0 8px; font-weight: 600; }
.agenda-day::first-letter { text-transform: uppercase; }
.agenda-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.agenda-time { font-weight: 600; min-width: 150px; }
.agenda-info { flex: 1; min-width: 0; font-size: .92rem; }
.agenda-info small { color: var(--muted); display: block; overflow-wrap: anywhere; }
@media (max-width: 520px) { .agenda-item { flex-wrap: wrap; } .agenda-time { min-width: 0; } }

.footer { border-top: 1px solid var(--line); padding: 18px 0; font-size: .85rem; color: var(--muted); }

/* Agenda mensual */
.layout.full { grid-template-columns: 1fr; }
.month-cal { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 4px 0 8px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-grid .cal-dow { text-align: center; }
.mc-cell { min-height: 104px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.mc-cell:hover { border-color: var(--brand); }
.mc-cell.empty { border: 0; background: transparent; cursor: default; }
.mc-cell.closed { background: var(--brand-soft); }
.mc-cell.selected { outline: 2px solid var(--brand); outline-offset: -1px; }
.mc-num { font-size: .8rem; color: var(--muted); }
.mc-cell.today .mc-num { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.mc-ev { display: block; font-size: .72rem; line-height: 1.25; background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c); border-radius: 4px; padding: 3px 5px; overflow: hidden; white-space: nowrap; }
.mc-ev b { font-weight: 600; display: block; }
.mc-name { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.mc-ev em { display: block; font-style: normal; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.mc-more { font-size: .7rem; color: var(--brand); }
@media (max-width: 640px) {
  .mc-cell { min-height: 56px; padding: 4px; }
  .mc-ev { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--c); }
  .mc-ev b, .mc-ev em, .mc-name { display: none; }
}

/* Servicios en el formulario */
.svc-field { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.svc-field legend { font-size: .9rem; margin-bottom: 8px; padding: 0; }
.svc-options { display: grid; gap: 8px; }
.svc-option { display: grid !important; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0 !important; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.svc-option:hover { border-color: var(--brand); }
.svc-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.svc-option input { grid-row: 1 / 3; accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.svc-name { font-weight: 500; font-size: .98rem; }
.svc-meta { font-size: .82rem; color: var(--muted); }
.svc-option.disabled { opacity: .5; cursor: not-allowed; }

/* Lista de servicios en el lateral */
.svc-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: .92rem; }
.svc-list li { display: flex; justify-content: space-between; gap: 8px; }
.staff-name small { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.staff-card { display: flex; flex-direction: column; justify-content: flex-start; }
.staff-initial { flex: none; }
.staff-card.reception { cursor: default; }
.staff-card.reception:hover { transform: none; box-shadow: none; }

/* ===== Agenda: barra y vista Día ===== */
.agenda-toolbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.agenda-toolbar .field-inline { margin-bottom: 0; }
.seg { display: inline-flex; background: var(--brand-soft); border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: transparent; font: inherit; font-size: .92rem; padding: 7px 18px; border-radius: 999px; color: var(--brand); cursor: pointer; }
.seg-btn.active { background: var(--brand); color: #fff; }
.day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 12px; }
#day-title { font-size: 1.1rem; font-weight: 600; min-width: 0; }
#day-title::first-letter { text-transform: uppercase; }
#day-today:disabled { opacity: .4; cursor: default; }
#day-print { margin-left: auto; }
.next-up { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; line-height: 1.7; }
.nu-label { color: var(--muted); }
.nu-staff { color: var(--c); font-weight: 600; }

.board-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.board { display: grid; min-width: min-content; }
.board-msg { padding: 24px; margin: 0; }
.b-corner, .b-head { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); z-index: 2; }
.b-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px; font-weight: 500; border-left: 1px solid var(--line); }
.b-head small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.b-times { position: relative; }
.b-times span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.b-times span:first-child { transform: none; }
.b-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.b-ev { position: absolute; left: 4px; right: 4px; overflow: hidden; border-radius: 6px; padding: 4px 6px; font-size: .74rem; line-height: 1.3;
  background: color-mix(in srgb, var(--c) 16%, #fff); border-left: 4px solid var(--c); }
.b-ev b { display: block; font-weight: 600; }
.b-ev .b-name { display: block; font-weight: 600; font-size: .82rem; }
.b-ev .b-svc, .b-ev .b-tel { display: block; color: var(--muted); }
.b-ev.past { opacity: .5; }
.b-now { position: absolute; left: 0; right: 0; height: 2px; background: #d33; z-index: 1; }
.b-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d33; }

/* ===== Impresión: solo la agenda del día ===== */
@media print {
  .topbar, .footer, .agenda-toolbar, .day-head button, .next-up, #view-reservar, .side, .panel-head { display: none !important; }
  body { background: #fff; }
  .layout { display: block; padding: 0; }
  .day-head { margin: 0 0 8px; }
  .board-wrap { overflow: visible; border: 0; }
  .b-ev { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .b-now { display: none; }
}
.main-col { min-width: 0; }
.b-ev > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-col + .b-col .b-now::before { display: none; }
