/* Agenda: una interfaz callada, de aplicación. Blanco, texto casi negro y la jerarquía hecha con grises (no con
   tamaños ni negritas), Inter a 13 px, píldoras de 28 px (la elegida, en negro) y tarjetas redondeadas.
   Los colores van en variables: el modo oscuro solo las cambia. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --ink-2: rgba(0, 0, 0, 0.49);
  --ink-3: rgba(0, 0, 0, 0.27);
  --fill: rgba(0, 0, 0, 0.063);
  --fill-hover: rgba(0, 0, 0, 0.1);
  --soft: rgba(0, 0, 0, 0.025);
  --line: rgba(0, 0, 0, 0.08);
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 64px rgba(0, 0, 0, 0.14);
  --ok-bg: hsl(145 55% 92%);
  --ok-ink: hsl(145 55% 26%);
  --live: hsl(2 80% 56%);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 0.12s;
  --radius: 12px;
  --side: 240px;
  --live-w: 320px;
  color-scheme: light;
}

.dark {
  --bg: #121212;
  --ink: #f2f2f2;
  --ink-2: rgba(255, 255, 255, 0.52);
  --ink-3: rgba(255, 255, 255, 0.3);
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.13);
  --soft: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.1);
  --card: #191919;
  --glass: rgba(25, 25, 25, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.6);
  --ok-bg: hsl(145 30% 18%);
  --ok-ink: hsl(145 55% 72%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.muted {
  color: var(--ink-2);
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.noscript {
  padding: 24px;
}

/* ---------- piezas comunes ---------- */

.pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* En una fila que no cabe, se desliza de lado y se desvanece por la derecha */
.pills-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  padding-right: 28px;
}

.pills-scroll::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    opacity var(--fast) var(--ease);
}

.pill:hover {
  background: var(--fill-hover);
  color: var(--ink);
}

.pill[aria-pressed='true'],
.pill-ink {
  background: var(--ink);
  color: var(--bg);
}

.pill-ink:hover {
  background: var(--ink);
  color: var(--bg);
  opacity: 0.84;
}

.pill-line {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pill-line:hover {
  background: var(--soft);
}

.pill-lg {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.pill-wide {
  width: 100%;
}

.pill:disabled {
  opacity: 0.35;
}

.pill:disabled:hover {
  background: var(--fill);
  color: var(--ink-2);
}

.pill-ink:disabled:hover {
  background: var(--ink);
  color: var(--bg);
}

.round {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  transition: background-color var(--fast) var(--ease);
}

.round:hover {
  background: var(--fill);
}

.avatar {
  --hue: 0;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: hsl(var(--hue) 75% 92%);
  color: hsl(var(--hue) 45% 30%);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dark .avatar {
  background: hsl(var(--hue) 28% 22%);
  color: hsl(var(--hue) 70% 82%);
}

.avatar.is-plain,
.avatar.is-any {
  background: var(--fill);
  color: var(--ink-2);
}

.person[aria-pressed='true'] .avatar.is-any {
  background: rgba(127, 127, 127, 0.3);
  color: inherit;
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.status.is-confirmed {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.status.is-cancelled {
  color: var(--ink-3);
  text-decoration: line-through;
}

.empty,
.empty-card {
  color: var(--ink-2);
}

.empty-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- estructura: barra lateral, contenido y columna en directo ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--live-w);
  grid-template-areas: 'side main live';
  min-height: 100dvh;
}

body:not([data-route='cita']) .shell {
  grid-template-columns: var(--side) minmax(0, 1fr);
  grid-template-areas: 'side main';
}

body:not([data-route='cita']) .live {
  display: none;
}

.side {
  grid-area: side;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: none;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.brand-star {
  align-self: center;
  width: 18px;
  height: 18px;
  transition: transform 0.6s var(--ease);
}

.brand:hover .brand-star {
  transform: rotate(90deg);
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-by {
  color: var(--ink-2);
  font-size: 12px;
}

.menu-close {
  display: none;
}

.side-nav {
  display: grid;
  justify-items: start;
  margin-top: 40px;
}

.side-label {
  margin: 20px 0 4px;
  color: var(--ink-3);
}

.side-label:first-child {
  margin-top: 0;
}

.side-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 14px 2px 0;
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

.side-nav a:hover {
  color: var(--ink);
}

/* La sección en la que se está: en negro y con un punto detrás */
.side-nav a[aria-current] {
  color: var(--ink);
}

.side-nav a[aria-current]::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  animation: pop 0.4s var(--ease);
}

.nav-count[hidden] {
  display: none;
}

@keyframes pop {
  from {
    transform: scale(0.4);
  }
}

.side-foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 32px;
}

.side-pitch {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.side-pitch p:first-child {
  font-size: 13px;
  line-height: 1.45;
}

.side-small {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}

.side-rule {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ink-3);
}

.side-links a {
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

.side-links a:hover {
  color: var(--ink);
}

.scrim,
.topbar {
  display: none;
}

.main {
  grid-area: main;
  min-width: 0;
  padding: 16px 24px 40px;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
}

.head-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.head-name {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.head-desc {
  margin-left: 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

/* Botón del tema: el sol en claro, la luna en oscuro */
#theme .i-moon,
.dark #theme .i-sun {
  display: none;
}

.dark #theme .i-moon {
  display: block;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 20px;
}

.filters-label {
  flex: none;
  color: var(--ink-3);
}

.filters .pills {
  min-width: 0;
}

#reset {
  margin-left: auto;
}

.view.is-in > * {
  animation: view-in 0.32s var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Título que se transforma: las letras viejas se van desenfocándose y las nuevas llegan una a una */
.morph-out {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  animation: morph-out 0.28s var(--ease) forwards;
}

.morph-in span {
  display: inline-block;
  animation: morph-in 0.42s var(--ease) both;
}

@keyframes morph-out {
  to {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(-5px);
  }
}

@keyframes morph-in {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(5px);
  }
}

/* ---------- pedir cita ---------- */

/* Pedir cita: una columna en pantallas estrechas; en las anchas, dos (ver «@container client» más abajo) */
.client {
  container: client / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.client-grid,
.client-what,
.client-when {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 28px;
}

.shop-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px;
  border-radius: 16px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.shop-text {
  flex: 1;
  min-width: 180px;
}

.shop-facts {
  display: grid;
  justify-items: end;
  gap: 2px;
  padding-right: 4px;
  text-align: right;
}

.shop-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.shop-status i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ink-3);
}

.shop-status.is-open i {
  background: hsl(145 60% 42%);
  box-shadow: 0 0 0 3px hsl(145 60% 42% / 0.18);
}

.shop-fact {
  color: var(--ink-2);
}

.shop-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 17px;
  font-weight: 600;
}

.shop-name {
  font-size: 15px;
  font-weight: 500;
}

.shop-meta {
  color: var(--ink-2);
}

.step-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.step-n {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.step-head h2 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.svc {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition:
    box-shadow var(--fast) var(--ease),
    background-color var(--fast) var(--ease),
    transform 0.2s var(--ease);
}

.svc:hover {
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.svc:active {
  transform: scale(0.985);
}

.svc[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}

.svc-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.svc-price {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.svc-desc {
  color: var(--ink-2);
  line-height: 1.4;
}

.svc-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12px;
}

.svc[aria-pressed='true'] .svc-desc,
.svc[aria-pressed='true'] .svc-meta {
  color: inherit;
  opacity: 0.62;
}

.svc-tag {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fill);
}

.svc[aria-pressed='true'] .svc-tag {
  background: rgba(127, 127, 127, 0.28);
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 4px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 13px;
  transition: background-color var(--fast) var(--ease);
}

.person:hover {
  background: var(--fill-hover);
}

.person[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

/* Calendario de dos semanas, de lunes a domingo */
.cal-month {
  margin-bottom: 8px;
  color: var(--ink-2);
  text-transform: capitalize;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-week {
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
}

.day {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  height: 54px;
  border-radius: var(--radius);
  background: var(--fill);
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.day:hover {
  background: var(--fill-hover);
}

.day:disabled {
  background: transparent;
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--ink-3);
}

.day.is-today:not([aria-pressed='true']) {
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
}

.day[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

.day-num {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.day-dots {
  display: flex;
  gap: 3px;
  height: 4px;
  align-items: center;
}

.day-dots i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.18;
}

.day-dots i.on {
  opacity: 0.75;
}

.day:disabled .day-dots {
  visibility: hidden;
}

.times {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.times-day {
  color: var(--ink-2);
}

.times-group {
  display: grid;
  gap: 8px;
}

.times-label {
  color: var(--ink-3);
}

.times-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}

.pill-time {
  min-width: 0;
  height: 32px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pill-time:disabled {
  opacity: 1;
  background: transparent;
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--ink-3);
}

.pill-time:disabled:hover {
  background: transparent;
  color: var(--ink-3);
}

/* Lo elegido y el botón de reservar: una barra que acompaña al bajar */
.summary {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--line);
}

.summary-text {
  display: grid;
  min-width: 0;
}

.summary-main {
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-price {
  color: var(--ink-2);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.summary-sub {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Con sitio, dos columnas: qué y con quién a la izquierda; cuándo y reservar a la derecha, fijo al bajar */
@container client (min-width: 820px) {
  .client-grid {
    grid-template-columns: minmax(0, 1fr) clamp(330px, 38%, 520px);
    align-items: start;
    gap: 32px;
  }

  .client-when {
    position: sticky;
    top: 16px;
    gap: 22px;
    padding: 18px;
    border-radius: 18px;
    background: var(--card);
    box-shadow:
      var(--shadow),
      inset 0 0 0 1px var(--line);
  }

  .client-when .summary {
    position: static;
    padding: 12px 10px 12px 14px;
    border-radius: 14px;
    background: var(--soft);
    box-shadow: inset 0 0 0 1px var(--line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- hoja: confirmar, cita confirmada y detalle de una cita ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
}

.sheet.is-on {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.26);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.sheet.is-on .sheet-backdrop {
  opacity: 1;
}

.sheet-panel {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition:
    opacity 0.24s var(--ease),
    transform 0.32s var(--ease);
}

.sheet.is-on .sheet-panel {
  opacity: 1;
  transform: none;
}

.sheet-panel:focus {
  outline: none;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.sheet-title {
  padding-right: 40px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.sheet-title:focus {
  outline: none;
}

.recap {
  display: grid;
  margin: 16px 0 20px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.recap > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
}

.recap > div + div {
  border-top: 1px solid var(--line);
}

.recap dt {
  flex: none;
  color: var(--ink-2);
}

.recap dd {
  text-align: right;
}

.confirm {
  display: grid;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field-label {
  color: var(--ink-2);
}

.field-opt {
  color: var(--ink-3);
}

.field-input,
.search-input {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  font-size: 15px;
  transition: box-shadow var(--fast) var(--ease);
}

.field-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.field-input::placeholder,
.search-input::placeholder {
  color: var(--ink-3);
}

.deposit {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.form-note {
  margin-bottom: 16px;
  font-size: 12px;
}

.form-error {
  margin: -4px 0 12px;
  color: hsl(2 70% 50%);
}

.dark .form-error {
  color: hsl(2 85% 70%);
}

.done {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-top: 8px;
  text-align: center;
}

.done .sheet-title {
  padding: 0;
  margin-top: 8px;
}

.done-check {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  animation: check-in 0.5s var(--ease) both;
}

.done-check svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 0.4s 0.18s var(--ease) forwards;
}

@keyframes check-in {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.done-when {
  font-size: 15px;
}

.done-actions {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

.done-note {
  margin-top: 8px;
  font-size: 12px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- agenda del día ---------- */

.agenda {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.stat b {
  margin-right: 4px;
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.board {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  scrollbar-width: thin;
}

.board-grid {
  position: relative;
  display: grid;
  grid-template-columns: 52px repeat(var(--cols), minmax(150px, 1fr));
  min-width: min-content;
  padding-bottom: 12px;
}

.board-gutter {
  position: relative;
  margin-top: 52px;
}

.board-hour {
  position: absolute;
  right: 10px;
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}

.board-col {
  border-left: 1px solid var(--line);
}

.board-person {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 12px;
  font-size: 13px;
}

.board-person .muted {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Las líneas de cada hora (y, más suaves, las medias horas): 90 px por hora */
.board-lane {
  position: relative;
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(to bottom, transparent 0 45px, var(--soft) 45px 46px, transparent 46px 90px);
}

.board-closedband {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(-45deg, var(--fill) 0 1px, transparent 1px 7px);
}

.block {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px 5px 10px;
  overflow: hidden;
  border-radius: 8px;
  background: hsl(var(--hue) 75% 95%);
  color: hsl(var(--hue) 45% 22%);
  box-shadow: inset 3px 0 0 hsl(var(--hue) 65% 58%);
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  transition:
    transform var(--fast) var(--ease),
    filter var(--fast) var(--ease);
}

.dark .block {
  background: hsl(var(--hue) 30% 19%);
  color: hsl(var(--hue) 70% 86%);
  box-shadow: inset 3px 0 0 hsl(var(--hue) 60% 58%);
}

.block:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.dark .block:hover {
  filter: brightness(1.12);
}

.block.is-short {
  justify-content: center;
  padding-block: 0;
}

.block-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.block.is-mine .block-line {
  padding-right: 34px;
}

.block-time {
  flex: none;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.block-client {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-service {
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block.is-done {
  opacity: 0.45;
}

.block.is-mine {
  outline: 1.5px solid hsl(var(--hue) 65% 52%);
  outline-offset: -1.5px;
}

.block-tag {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: hsl(var(--hue) 65% 50%);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}

.block.is-short .block-tag {
  top: 50%;
  transform: translateY(-50%);
}

/* Una cita que acaba de llegar: aparece y suelta una onda */
.block.is-new {
  animation:
    arrive 0.6s var(--ease) both,
    ripple 1.6s 0.2s ease-out 2;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

@keyframes ripple {
  from {
    outline: 2px solid hsl(var(--hue) 70% 50% / 0.9);
    outline-offset: 0;
  }
  to {
    outline: 2px solid hsl(var(--hue) 70% 50% / 0);
    outline-offset: 10px;
  }
}

.board-nowwrap {
  position: absolute;
  top: 52px;
  left: 52px;
  right: 0;
  pointer-events: none;
}

.board-now {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px solid var(--live);
}

.board-now span {
  position: absolute;
  left: -50px;
  top: -9px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
}

.board-closed {
  display: grid;
  gap: 4px;
  padding: 48px 24px;
  text-align: center;
  font-size: 15px;
}

/* ---------- listas: reservas, clientes y la columna en directo ---------- */

.reservas,
.clientes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

/* Reservas: cada día es una tarjeta, y las tarjetas van en mosaico, tantas columnas como quepan */
.reservas .rows {
  display: block;
  columns: 340px;
  column-gap: 16px;
}

.reservas .rows-day {
  break-inside: avoid;
  margin: 0 0 16px;
  padding: 12px 14px 6px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.reservas .rows-day + .rows-day {
  margin-top: 0;
}

/* Clientes: una tarjeta por cliente, en rejilla */
.clientes .rows {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

.clientes .row {
  width: auto;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.rows {
  display: grid;
}

.rows-day + .rows-day {
  margin-top: 18px;
}

.rows-label {
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 400;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% + 20px);
  margin: 0 -10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  text-align: left;
  transition: background-color var(--fast) var(--ease);
}

button.row:hover {
  background: var(--soft);
}

.row .avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 11.5px;
}

.row-main {
  display: grid;
  flex: 1;
  min-width: 0;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
}

.row-sub {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.row-time {
  color: var(--ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  height: 36px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  transition: box-shadow var(--fast) var(--ease);
}

.search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
}

.search-input:focus {
  outline: none;
}

.live {
  grid-area: live;
  padding: 92px 16px 24px 0;
}

.live-card {
  position: sticky;
  top: 16px;
  display: grid;
  padding: 14px 14px 0;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-head h2 {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--live);
  animation: beat 1.6s ease-in-out infinite;
}

@keyframes beat {
  50% {
    opacity: 0.35;
  }
}

.live-intro {
  margin: 8px 0 6px;
  color: var(--ink-2);
  font-size: 12px;
}

.live-list {
  display: grid;
}

.live-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.live-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 11px;
}

.live-item .row-title {
  font-size: 13px;
}

.live-when {
  display: grid;
  justify-items: end;
  flex: none;
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.live-when span:last-child {
  color: var(--ink);
}

.live-item.is-new {
  animation: live-in 0.6s var(--ease) both;
}

.live-item.is-new a {
  margin: 0 -8px;
  padding: 8px;
  border-radius: 10px;
  animation: flash 2.4s var(--ease) both;
}

@keyframes live-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes flash {
  0%,
  40% {
    background: var(--fill-hover);
  }
  100% {
    background: transparent;
  }
}

.live-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px -14px 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

.live-more:hover {
  color: var(--ink);
}

/* ---------- servicios y precios ---------- */

.servicios {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
}

.svc-edit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.svc-edit {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: opacity 0.2s var(--ease);
}

.svc-edit.is-off {
  opacity: 0.5;
}

.svc-edit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.svc-edit-head .muted {
  font-size: 12px;
  font-weight: 400;
}

.svc-edit-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.mini-field {
  display: grid;
  gap: 4px;
}

.mini-label {
  color: var(--ink-2);
  font-size: 12px;
}

.mini-switch {
  margin-left: auto;
  justify-items: end;
}

.num {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--fill);
}

.num:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.num-input {
  width: 38px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}

.num-input:focus {
  outline: none;
}

.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-unit {
  color: var(--ink-2);
}

.select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 0;
  border-radius: 8px;
  background-color: var(--fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.dark .select option {
  background: var(--card);
}

/* Interruptor: el círculo es un degradado del fondo, que se desplaza (sin pseudo-elementos, que Firefox no pinta en
   las casillas) */
.switch {
  width: 36px;
  height: 20px;
  margin: 6px 0;
  border-radius: 999px;
  background: radial-gradient(circle at 10px 10px, #fff 7px, transparent 7.5px) no-repeat var(--fill-hover);
  background-position: 0 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-position 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.switch:checked {
  background-color: var(--ink);
  background-position: 16px 0;
}

.dark .switch {
  background-image: radial-gradient(circle at 10px 10px, #121212 7px, transparent 7.5px);
}

.dark .switch:not(:checked) {
  background-image: radial-gradient(circle at 10px 10px, #8a8a8a 7px, transparent 7.5px);
}

.hours-card {
  max-width: 420px;
  margin-top: 10px;
}

.hours {
  display: grid;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  font-variant-numeric: tabular-nums;
}

.hours-row + .hours-row {
  border-top: 1px solid var(--line);
}

/* ---------- aviso ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.24s var(--ease),
    transform 0.32s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast:empty {
  display: none;
}

.toast-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--live);
}

.toast-text {
  min-width: 0;
  padding: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-action {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.dark .toast-action {
  background: rgba(0, 0, 0, 0.08);
}

@media (min-width: 1680px) {
  :root {
    --live-w: 360px;
  }
}

/* ---------- pantallas medianas: la columna en directo baja debajo del contenido ---------- */

@media (max-width: 1279px) {
  .shell,
  body:not([data-route='cita']) .shell {
    grid-template-columns: var(--side) minmax(0, 1fr);
    grid-template-areas:
      'side main'
      'side live';
    grid-template-rows: auto 1fr;
  }

  .live {
    max-width: 780px;
    padding: 0 24px 40px;
  }

  .live-card {
    position: static;
  }
}

/* ---------- móvil y tableta: la barra lateral es un menú ---------- */

@media (max-width: 1023px) {
  .shell,
  body:not([data-route='cita']) .shell {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 1px 0 var(--line);
  }

  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(300px, 86vw);
    height: 100dvh;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(-104%);
    transition: transform 0.34s var(--ease);
  }

  .menu-is-open .side {
    transform: none;
  }

  .menu-close {
    display: inline-grid;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s var(--ease);
  }

  .menu-is-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    padding: 16px 16px 32px;
  }

  .live {
    padding: 0 16px 32px;
  }

  .filters {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .filters-label {
    width: 100%;
  }

  .filters .pills {
    flex: 1;
  }

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

  .note {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .head-title {
    display: grid;
  }

  .head-desc {
    margin: 2px 0 0;
  }

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

  .sheet {
    place-items: end stretch;
    padding: 0;
  }

  .sheet-panel {
    width: 100%;
    max-height: 92dvh;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    transform: translateY(32px);
  }

  .summary {
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: 14px;
  }

  .row-side .status {
    display: none;
  }

  /* Tres columnas caben en un móvil de 360 px */
  .board-grid {
    grid-template-columns: 44px repeat(var(--cols), minmax(96px, 1fr));
  }

  .block {
    padding-inline: 8px 6px;
  }

  /* Restablecer, solo con el icono: así caben los tres negocios */
  #reset {
    width: 28px;
    padding: 0;
  }

  .reset-text {
    display: none;
  }

  .board-nowwrap {
    left: 44px;
  }

  .board-now span {
    left: -42px;
  }

  .board-person {
    padding: 0 8px;
  }
}

/* ---------- sin movimiento ---------- */

.motion-none *,
.motion-none *::before,
.motion-none *::after {
  animation: none !important;
  transition: none !important;
}

@media print {
  .side,
  .topbar,
  .live,
  .filters,
  .summary,
  .toast {
    display: none !important;
  }
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 12px;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px;
}

.lost svg {
  width: 22px;
  height: 22px;
}

.lost h1 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.lost p {
  color: var(--ink-2);
  font-size: 15px;
}
