:root {
  --ink: #000000;
  --ink-soft: #1f1a1c;
  --text: #211b1d;
  --muted: #6e6266;
  --canvas: #faf6f5;
  --surface: #ffffff;
  --line: #efe5e4;
  --line-strong: #ddd0cf;
  --rose: #e3b1b9;
  --accent: #9b4a5a;
  --accent-hover: #7d3847;
  --accent-soft: #fbeef0;
  --ok: #0b6b53;
  --ok-soft: #e1f3ec;
  --warn: #7f5100;
  --warn-soft: #fdf1da;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --neutral-soft: #eeeaeb;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(36 23 34 / 0.06), 0 10px 30px rgb(36 23 34 / 0.12);
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Bodoni MT', Didot, 'Bodoni 72', Georgia, 'Times New Roman', serif;
  --nav-height: 62px;
  --page: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 15px/1.45 var(--font);
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
fieldset {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 16px;
  font-weight: 650;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.num {
  font-variant-numeric: tabular-nums;
}

.warn-text {
  color: var(--warn);
  font-weight: 600;
  font-size: 13px;
}

.dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* --- Botones -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}

.btn:hover {
  background: var(--canvas);
  border-color: var(--muted);
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: var(--rose);
}

.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.btn-danger:hover {
  background: #93201a;
  border-color: #93201a;
}

.btn-ghost-danger {
  color: var(--bad);
}

.btn-ghost-danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

.btn-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.icon-btn:hover {
  background: var(--neutral-soft);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--neutral-soft);
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented button.selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(36 23 34 / 0.12);
}

.segmented-scroll {
  max-width: 100%;
  overflow-x: auto;
}

/* --- Formularios ---------------------------------------------------------- */

input[type='text'],
input[type='search'],
input[type='tel'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='time'],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

textarea {
  resize: vertical;
}

input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--accent);
}

.form {
  display: grid;
  gap: 14px;
}

.form-narrow {
  max-width: 560px;
}

.field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.row-3 {
  grid-template-columns: 1.3fr 1fr 1fr;
}

.row-end {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 18px;
  height: 18px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}

.choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-totals {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.form-totals:empty {
  display: none;
}

.alert-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13.5px;
}

.alert-note svg {
  flex: none;
  margin-top: 2px;
}

.alert-note > span {
  flex: 1;
  min-width: 60%;
}

/* Deja el aviso completo a la vista, por encima de la barra de botones fija. */
.conflict-slot {
  scroll-margin-bottom: 76px;
}

.conflict {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--bad);
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--bad);
}

.conflict ul {
  font-size: 13.5px;
}

/* --- Selector de cliente y servicios --------------------------------------- */

.client-picker {
  display: grid;
  gap: 8px;
}

.client-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.client-results {
  display: grid;
  gap: 2px;
}

.client-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.client-result:hover {
  background: var(--neutral-soft);
}

.client-new {
  justify-content: flex-start;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
}

.client-new-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--canvas);
}

.service-picker {
  display: grid;
  gap: 10px;
  max-height: 248px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.service-picker legend {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  cursor: pointer;
}

.service-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* --- Estructura ----------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 22px 12px 14px;
  background: var(--ink);
  color: #f2eaee;
}

.side-logo {
  flex: none;
  max-width: 176px;
  margin: 0 auto 14px;
}

.nav {
  display: grid;
  gap: 3px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: #d9ccd4;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  background: var(--ink-soft);
  color: #fff;
}

.nav a.active {
  background: var(--rose);
  color: #000;
}

.side :focus-visible {
  outline-color: #fff;
}

.side-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-top: auto;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9ccd4;
  font-weight: 600;
}

.side-logout:hover {
  background: var(--ink-soft);
  color: #fff;
}

.main {
  width: 100%;
  min-width: 0;
  max-width: 2040px;
  margin-inline: auto;
  padding: 22px 26px 28px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 16px;
  text-align: center;
}

.empty-title {
  font-weight: 650;
  font-size: 16px;
}

/* --- Acceso --------------------------------------------------------------- */

.auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
  background: var(--ink);
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  padding: 18px 26px 28px;
  border: 1px solid #2c2628;
  border-radius: 14px;
  background: var(--ink);
  color: #f6e9eb;
}

.auth-logo {
  margin-top: 8px;
}

.auth-intro {
  color: #cdbfc3;
  font-size: 14px;
  text-align: center;
}

.auth-card input {
  color: var(--text);
}

.auth-card .btn-primary {
  background: var(--rose);
  border-color: var(--rose);
  color: #000;
}

.auth-error {
  color: #f6b2ac;
  font-size: 14px;
}

.auth > .auth-error {
  color: #fff;
}

.auth-error:empty {
  display: none;
}

/* --- Agenda --------------------------------------------------------------- */

.agenda-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.agenda-title::first-letter {
  text-transform: uppercase;
}

.agenda-summary {
  min-height: 21px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.agenda-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  align-items: start;
  gap: 16px;
}

.agenda-content-wide {
  grid-template-columns: minmax(0, 1fr);
}

.agenda-main {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.agenda-main > :first-child {
  width: 100%;
}

.agenda-toggle {
  font-size: 13px;
}

.tg {
  --gutter: 58px;
  max-height: calc(100dvh - 128px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.tg-head,
.tg-body {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols), minmax(var(--col-min), 1fr));
  min-width: fit-content;
}

.tg-head {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tg-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.tg-colhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 4px 6px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.tg-dayhead {
  color: var(--muted);
}

.tg-dayhead strong {
  color: var(--text);
  font-size: 16px;
}

.tg-dayhead:hover {
  background: var(--canvas);
}

.tg-today strong {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.tg-gutter {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
}

.tg-gutter span {
  position: absolute;
  right: 8px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.tg-gutter {
  position: sticky;
}

.tg-col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image:
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, #f3eeef 1px, transparent 1px);
  background-size: 100% 84px, 100% 42px;
  cursor: cell;
}

.tg-closed {
  background-color: #f7f4f4;
}

.tg-ghost {
  position: absolute;
  left: 2px;
  right: 3px;
  display: flex;
  align-items: center;
  height: 21px;
  padding-left: 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  pointer-events: none;
}

.tg-now {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}

.tg-now::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.appt {
  container-type: inline-size;
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  padding: 3px 7px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 13%, #fff);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.28;
  text-align: left;
}

.appt:hover {
  background: color-mix(in srgb, var(--c) 22%, #fff);
}

.appt > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-time {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.appt-time svg {
  flex: none;
}

.appt-client {
  font-weight: 650;
}

.appt-services {
  color: var(--muted);
}

/* En carriles angostos lo importante es la hora y el nombre. */
@container (max-width: 92px) {
  .appt-time svg,
  .appt-services {
    display: none;
  }
}

.appt-pendiente {
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 7%, #fff) 0 6px, color-mix(in srgb, var(--c) 15%, #fff) 6px 12px);
}

.appt-completada {
  background: var(--neutral-soft);
  border-left-color: color-mix(in srgb, var(--c) 45%, #b9adb3);
}

.appt-cancelada,
.appt-no_asistio {
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}

.appt-cancelada .appt-client,
.appt-no_asistio .appt-client {
  text-decoration: line-through;
}

.rail {
  display: grid;
  gap: 4px;
  max-height: calc(100dvh - 128px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.rail-empty {
  padding: 12px 0 4px;
  color: var(--ok);
  font-weight: 600;
}

.rail-list {
  display: grid;
  margin-top: 6px;
}

.rail-list li {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.rail-item {
  display: grid;
  gap: 1px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.rail-item:hover strong {
  color: var(--accent);
}

.rail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.day-strip button {
  display: grid;
  justify-items: center;
  min-height: 52px;
  padding: 6px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.day-strip strong {
  color: var(--text);
  font-size: 16px;
}

.day-strip .today strong {
  color: var(--accent);
}

.day-strip .selected {
  background: var(--ink);
  color: #e6dbe1;
}

.day-strip .selected strong {
  color: #fff;
}

.day-list {
  display: grid;
  gap: 8px;
}

.day-item {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 10px;
  background: var(--surface);
}

.day-item-inactive {
  opacity: 0.68;
}

.day-item-main {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.day-item-time {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.day-item-text {
  display: grid;
  min-width: 0;
}

/* --- Avisos de estado ------------------------------------------------------ */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge-pendiente {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-confirmada {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-completada {
  background: var(--neutral-soft);
  color: var(--text);
}

.badge-cancelada {
  background: var(--neutral-soft);
  color: var(--muted);
}

.badge-no_asistio {
  background: var(--bad-soft);
  color: var(--bad);
}

/* --- Diálogos -------------------------------------------------------------- */

.dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog-wide {
  width: min(600px, calc(100vw - 32px));
}

.dialog-confirm {
  width: min(400px, calc(100vw - 32px));
}

.dialog::backdrop {
  background: rgb(36 23 34 / 0.5);
}

.dialog-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}

.dialog-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 10px 20px;
}

.dialog-head h2 {
  font-size: 19px;
  overflow-wrap: anywhere;
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 2px 20px 20px;
  overflow-y: auto;
}

.dialog-confirm .dialog-body {
  padding-top: 20px;
  padding-bottom: 6px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-confirm .dialog-foot {
  padding: 12px 20px 18px;
}

.form .dialog-foot {
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.detail-summary {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.detail-when {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 600;
}

.detail-when::first-letter {
  text-transform: uppercase;
}

.detail-services {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-block: 1px solid var(--line);
}

.detail-services li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail-total {
  padding-top: 4px;
  font-weight: 650;
}

.detail-paid {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 600;
}

.detail-notes {
  white-space: pre-wrap;
}

.detail-actions,
.detail-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}

.toast {
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.toast-error {
  background: var(--bad);
}

/* --- Listas y clientes ----------------------------------------------------- */

.search-box {
  position: relative;
  max-width: 420px;
  margin-bottom: 14px;
}

.search-box svg {
  position: absolute;
  top: 11px;
  left: 11px;
  color: var(--muted);
}

.search-box input {
  padding-left: 36px;
}

.card-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.card-list li + li {
  border-top: 1px solid var(--line);
}

.client-row,
.setting-row {
  display: grid;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}

.client-row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 90px minmax(0, 1.1fr) 20px;
}

.setting-row {
  grid-template-columns: minmax(0, 1fr) auto 110px;
}

.setting-row > :last-child {
  text-align: right;
}

.client-row:hover,
.setting-row:hover {
  background: var(--canvas);
}

.client-row-flag {
  display: inline-flex;
  color: var(--warn);
}

.setting-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-weight: 600;
}

.setting-row-off .setting-name {
  color: var(--muted);
}

.history {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.history li + li {
  border-top: 1px solid var(--line);
}

.history-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  text-align: left;
}

.history-row:hover {
  background: var(--canvas);
}

.history-date {
  display: grid;
  font-size: 13.5px;
  font-weight: 600;
}

.history-services {
  font-size: 13.5px;
}

/* --- Reportes -------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range input {
  width: 150px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stats > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.stats dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stats dd {
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stats-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.stats-compact > div {
  padding: 8px 12px;
  border-radius: 10px;
}

.stats-compact dd {
  font-size: 18px;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.panel-narrow {
  max-width: 560px;
  margin-bottom: 12px;
  justify-items: start;
}

.panel-narrow .form {
  width: 100%;
}

.bars {
  display: grid;
  gap: 10px;
}

.bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  font-size: 14px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  grid-column: 1 / -1;
  height: 8px;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

/* --- Ajustes --------------------------------------------------------------- */

.tab-panel {
  margin-top: 14px;
}

.tab-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  position: relative;
  width: 34px;
  height: 34px;
}

.swatch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--c);
}

.swatch input:checked + span {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c);
}

.swatch input:focus-visible + span {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

/* --- Pantallas medianas y teléfonos ---------------------------------------- */

@media (max-width: 1080px) {
  .agenda-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    max-height: none;
  }

  .tg {
    max-height: 70dvh;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15.5px;
  }

  .hide-phone {
    display: none;
  }

  .shell {
    display: block;
  }

  .side {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: block;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 0 0 env(safe-area-inset-bottom);
  }

  .side-logout {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    height: var(--nav-height);
  }

  .nav a {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    font-size: 11.5px;
  }

  .nav a.active {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 3px 0 var(--rose);
  }

  .main {
    padding: 14px 16px calc(var(--nav-height) + env(safe-area-inset-bottom) + 18px);
  }

  h1 {
    font-size: 21px;
  }

  .agenda-controls {
    width: 100%;
    justify-content: space-between;
  }

  .row-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-3 > :first-child {
    grid-column: 1 / -1;
  }

  .dialog,
  .dialog-wide {
    width: 100vw;
    max-width: 100vw;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }

  .dialog-confirm {
    width: calc(100vw - 32px);
    margin: auto;
    border-radius: 14px;
  }

  .dialog-panel {
    max-height: 94dvh;
  }

  .client-row {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    gap: 2px 10px;
  }

  .client-row-visits,
  .client-row-last {
    display: none;
  }

  .setting-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .setting-row > .muted {
    display: none;
  }

  .history-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-services {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .toasts {
    bottom: calc(var(--nav-height) + 14px);
  }

  .stats:not(.stats-compact) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stats:not(.stats-compact) > div {
    padding: 10px 12px;
  }

  .stats dd {
    font-size: 21px;
  }

  .date-range {
    width: 100%;
  }

  .date-range input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .filters .segmented {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* --- Solicitudes en línea (panel del estudio) ------------------------------ */

.nav a {
  position: relative;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--rose);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.appt-solicitud {
  border: 1px dashed var(--c);
  border-left: 3px dashed var(--c);
  background: var(--surface);
}

.badge-solicitud,
.badge-req-pendiente {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-req-propuesta {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-req-aprobada {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-req-rechazada {
  background: var(--bad-soft);
  color: var(--bad);
}

.badge-req-cancelada,
.badge-req-vencida {
  background: var(--neutral-soft);
  color: var(--muted);
}

.req-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.req {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--line-strong));
  border-radius: var(--radius);
  background: var(--surface);
}

.req-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
}

.req-name {
  font-size: 16px;
  font-weight: 650;
}

.req-when {
  font-weight: 600;
}

.req-when::first-letter {
  text-transform: uppercase;
}

.req-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--canvas);
  overflow-wrap: anywhere;
}

.req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.req-history {
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.req-recent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 14px;
}

.req-recent + .req-recent {
  border-top: 1px solid var(--line);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.message-preview {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--canvas);
  overflow-wrap: anywhere;
}

.share-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.share-link code {
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* --- Inicio del panel ------------------------------------------------------ */

.first-cap::first-letter {
  text-transform: uppercase;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

a.kpi:hover {
  border-color: var(--rose);
  transform: translateY(-1px);
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.next-up {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #f6e9eb;
}

.next-up svg {
  flex: none;
  color: var(--rose);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.home-side {
  display: grid;
  gap: 12px;
}

.home-grid .panel {
  margin: 0;
}

.today {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.today-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 8px;
  background: var(--canvas);
  text-align: left;
}

.today-item:hover {
  background: var(--accent-soft);
}

.today-time {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.today-text {
  display: grid;
  min-width: 0;
}

.today-text > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remind {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remind .today-item {
  flex: 1;
  min-width: 0;
  grid-template-columns: 70px minmax(0, 1fr);
}

.notices {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.notice {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.notice svg {
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}

.notice-new svg {
  color: var(--accent);
}

/* --- Agenda: mes, bloqueos y descanso --------------------------------------- */

.mc {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  gap: 1px;
}

.mc-head {
  padding: 8px 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.mc-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  min-height: 112px;
  padding: 6px;
  border: 0;
  background: var(--surface);
  text-align: left;
}

.mc-day:hover {
  background: var(--accent-soft);
}

.mc-out {
  background: var(--canvas);
  color: var(--muted);
}

.mc-closed {
  background: #f4f0ef;
}

.mc-num {
  font-size: 13.5px;
  font-weight: 600;
}

.mc-today .mc-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--rose);
}

.mc-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--neutral-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 20px;
  text-align: center;
}

.mc-req {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 3px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.mc-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-item {
  overflow: hidden;
  padding: 0 4px;
  border-left: 3px solid var(--c);
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 11%, #fff);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-more {
  color: var(--muted);
  font-size: 12px;
}

.tg-block {
  position: absolute;
  left: 2px;
  right: 3px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  overflow: hidden;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(135deg, #ece6e6 0 6px, #f6f2f2 6px 12px);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.tg-block svg {
  flex: none;
  margin-top: 1px;
}

.tg-break {
  position: absolute;
  left: 0;
  right: 0;
  background: rgb(36 23 34 / 0.05);
  pointer-events: none;
}

.day-block {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  margin-bottom: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, #ece6e6 0 6px, #f6f2f2 6px 12px);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.hours-grid {
  display: grid;
  gap: 6px;
}

.hours-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.hours-row input[type='time']:disabled {
  opacity: 0.45;
}

.req-kind {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}

.req-search {
  max-width: 760px;
  margin-bottom: 8px;
}

/* --- Página pública: estructura --------------------------------------------- */

.pub-body {
  background: var(--canvas);
}

.pub {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.pub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(16px, calc((100% - var(--page)) / 2 + 16px));
  background: var(--ink);
}

.pub-brand .logo {
  width: 134px;
}

/* La portada ya lleva el logo grande. */
body[data-view='home'] .pub-brand {
  visibility: hidden;
}

.pub-nav {
  display: flex;
  gap: 4px;
}

.pub-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: #e6d9dc;
  font-weight: 600;
  text-decoration: none;
}

.pub-nav a:hover {
  color: #fff;
}

.pub-nav a.active {
  background: var(--rose);
  color: #000;
}

.pub-main {
  flex: 1;
}

.pub-view {
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: 20px 16px 36px;
}

.pub-view h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0;
}

.pub-fade {
  display: grid;
  gap: 14px;
  animation: pub-in 0.28s ease-out;
}

@keyframes pub-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.pub-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.pub-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}

.pub-center {
  justify-items: center;
  text-align: center;
}

.pub-error {
  color: var(--bad);
}

.pub-tabsel {
  justify-self: start;
}

.pub-foot {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 16px;
  background: var(--ink);
  color: #bdaeb2;
  font-size: 13px;
  text-align: center;
}

.pub-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: #f0e4e6;
  font-size: 14px;
}

.pub-contact > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pub-contact a {
  text-decoration: none;
}

.pub-contact a:hover {
  color: var(--rose);
}

.pub-tabs {
  display: none;
}

.btn-big {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15.5px;
}

.btn-rose {
  background: var(--rose);
  border-color: var(--rose);
  color: #000;
}

.btn-rose:hover {
  background: #eec5cb;
  border-color: #eec5cb;
}

.btn-outline {
  background: transparent;
  border-color: var(--rose);
  color: var(--rose);
}

.btn-outline:hover {
  background: rgb(227 177 185 / 0.14);
  border-color: var(--rose);
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Página pública: cuenta -------------------------------------------------- */

.acct-page {
  width: min(460px, 100%);
}

.acct-view {
  width: min(620px, 100%);
}

.acct-form {
  display: grid;
  gap: 14px;
}

.acct-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.acct-forgot {
  justify-self: center;
  font-size: 14px;
}

.acct-head {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.acct-head h1 {
  overflow-wrap: anywhere;
}

.acct-head p {
  overflow-wrap: anywhere;
}

.acct-avatar {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--rose);
  font-family: var(--font-display);
  font-size: 24px;
}

.acct-links {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.acct-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.acct-link + .acct-link {
  border-top: 1px solid var(--line);
}

.acct-link:hover {
  background: var(--accent-soft);
}

.acct-as {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--muted);
  font-size: 14px;
}

.acct-as strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

/* --- Página pública: portada ------------------------------------------------- */

.hero {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 10px 16px 34px;
  background: var(--ink);
  color: #f6e9eb;
  text-align: center;
}

.hero-logo {
  width: min(100%, 540px, 78dvh, max(300px, 32vw));
}

.hero-line {
  max-width: 30ch;
  font-size: 18px;
}

.hero-today {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rose);
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.next {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-left: 3px solid var(--rose);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.home-cols {
  display: grid;
  gap: 14px;
}

.menu {
  display: grid;
}

.menu li + li {
  border-top: 1px solid var(--line);
}

.menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  text-align: left;
}

.menu-item:hover .menu-name {
  color: var(--accent);
}

.menu-meta {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.menu-item svg {
  color: var(--muted);
}

.hours {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
}

.hours dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Página pública: reservar ------------------------------------------------ */

.steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.step-dot {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 650;
}

.step-now {
  color: var(--text) !important;
  font-weight: 650;
}

.step-now .step-dot,
.step-done .step-dot {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--rose);
}

.choose {
  display: grid;
  gap: 6px;
}

.choose legend {
  margin-bottom: 4px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.choose-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}

.choose-item:hover {
  border-color: var(--rose);
}

.choose-item input {
  position: absolute;
  opacity: 0;
}

.choose-check {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: transparent;
}

.choose-item:has(input:checked) {
  border-color: var(--ink);
  background: var(--accent-soft);
}

.choose-item:has(input:checked) .choose-check {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--rose);
}

.choose-item:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choose-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.note-warn {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
}

.pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.cal {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.cal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cal-bar .icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.cal-head {
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cal-day:not(:disabled):hover {
  background: var(--accent-soft);
}

.cal-day:disabled {
  color: #c4b9bb;
  font-weight: 400;
  cursor: default;
}

.cal-today {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.cal-dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day[aria-pressed='true'] {
  background: var(--ink) !important;
  color: var(--rose);
}

.cal-day[aria-pressed='true'] .cal-dot {
  background: var(--rose);
}

.pick-slots {
  display: grid;
  gap: 8px;
}

.pick-title {
  font-size: 15.5px;
  font-weight: 650;
}

.slots-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.slot {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.12s;
}

.slot:hover {
  border-color: var(--ink);
}

.slot[aria-pressed='true'],
.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--rose);
}

.summary {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, calc((100% - var(--page)) / 2 + 16px)) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -6px 20px rgb(0 0 0 / 0.06);
}

.bar-text {
  display: grid;
  min-width: 0;
}

.bar-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

body[data-view='flow'] .pub-foot,
body[data-view='flow'] .pub-tabs {
  display: none;
}

body[data-view='flow'] .pub-main {
  display: flex;
  flex-direction: column;
}

body[data-view='flow'] .pub-main > .pub-view {
  flex: 1;
}

/* --- Página pública: mis citas y estado -------------------------------------- */

.items {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.item-link {
  display: grid;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px 10px;
}

.item-when {
  font-size: 15.5px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-actions:not(:empty) {
  margin-top: 4px;
}

.item-actions-center {
  justify-content: center;
}

.item-note {
  flex-basis: 100%;
}

.item-change {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

.item-change svg {
  flex: none;
  margin-top: 2px;
}

.item-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}

.pill {
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-wait {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-new {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-done,
.pill-off {
  background: var(--neutral-soft);
  color: var(--muted);
}

.status {
  gap: 10px;
  justify-self: center;
  width: min(560px, 100%);
  padding: 26px 18px;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.status-wait .status-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-ok .status-icon {
  background: var(--ink);
  color: var(--rose);
}

.status-off .status-icon {
  background: var(--neutral-soft);
  color: var(--muted);
}

.status-message {
  width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

.status-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.ticket {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--canvas);
  text-align: left;
}

.ticket ul {
  margin-top: 4px;
}

.ticket-when {
  font-size: 16px;
  font-weight: 650;
}

.ticket-old {
  color: var(--muted);
  font-size: 13px;
  text-decoration: line-through;
}

@media (max-width: 1080px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .nav a {
    font-size: 10.5px;
  }

  .nav-count {
    position: absolute;
    top: 5px;
    left: calc(50% + 5px);
    min-width: 17px;
    height: 17px;
    margin: 0;
    padding: 0 4px;
    font-size: 10.5px;
    line-height: 17px;
  }

  .side-logo {
    display: none;
  }

  .kpi-value {
    font-size: 21px;
  }

  .head-actions,
  .head-actions .btn {
    width: 100%;
  }

  .mc-day {
    min-height: 58px;
    padding: 4px;
  }

  .mc-item,
  .mc-more,
  .mc-note {
    display: none;
  }

  .mc-count {
    top: auto;
    right: 4px;
    bottom: 4px;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 18px;
  }

  .mc-req {
    padding: 0 4px;
    font-size: 11px;
  }

  .hours-row {
    grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr);
  }

  .pub-top {
    justify-content: center;
    padding: 4px 16px;
  }

  body[data-view='home'] .pub-top {
    display: none;
  }

  .pub-brand .logo {
    width: 116px;
  }

  .pub-nav {
    display: none;
  }

  /* Columnas iguales para las opciones que haya (3 en internet, 4 en la
     computadora del estudio con la cuenta de muestra). */
  .pub-tabs {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink);
  }

  .pub-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    color: #cdbfc3;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }

  .pub-tabs a.active {
    color: var(--rose);
    box-shadow: inset 0 3px 0 var(--rose);
  }

  .hero {
    padding-top: 24px;
  }

  .pick {
    grid-template-columns: minmax(0, 1fr);
  }

  .step-label {
    display: none;
  }

  .step-now .step-label {
    display: inline;
  }

  .steps li {
    flex: none;
  }

  .steps .step-now {
    flex: 1;
  }

  .pub-view h1 {
    font-size: 26px;
  }
}

/* --- Logo y carga ----------------------------------------------------------- */

:where(.logo) {
  width: 100%;
}

.logo {
  position: relative;
  display: block;
  aspect-ratio: 3380 / 1570;
}

.logo-letters {
  display: block;
  width: 100%;
  height: 100%;
}

/* El punto de giro es el cuerpo de la mariposa. */
.logo-wings {
  position: absolute;
  top: 1.53%;
  left: 86.39%;
  width: 13.2%;
  height: auto;
  transform-origin: 36.6% 77.6%;
}

.logo:hover .logo-wings {
  animation: flap 0.5s ease-in-out 2;
}

.logo-live .logo-wings {
  animation: flutter 5s ease-in-out infinite;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  padding: 24px;
  background: #000;
  transition: opacity 0.4s ease, visibility 0.4s;
  /* Si el código no llegara a cargar, la pantalla no se queda atorada. */
  animation: splash-away 0.4s 10s forwards;
}

.splash-out {
  opacity: 0;
  visibility: hidden;
}

.splash .logo {
  width: min(420px, 78vw);
}

.splash .logo-letters {
  animation: wipe 0.85s cubic-bezier(0.6, 0, 0.2, 1) both;
}

.splash .logo-wings {
  animation: wings-in 0.35s 0.5s both, flap 0.46s 0.85s ease-in-out infinite;
}

.splash-bar {
  width: min(170px, 42vw);
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #2a2325;
}

.splash-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--rose);
  animation: bar-slide 1.1s ease-in-out infinite;
}

.loader {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 16px;
  text-align: center;
  animation: fade 0.2s 0.12s both;
}

.loader-badge {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #000;
}

.loader-badge img {
  transform-origin: 36.6% 77.6%;
  animation: flap 0.5s ease-in-out infinite;
}

.slot-skeleton {
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--neutral-soft) 25%, #f8f3f3 50%, var(--neutral-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

/* Un botón que está trabajando lo dice, en lugar de solo apagarse. */
.btn.is-busy {
  position: relative;
  color: transparent !important;
}

.btn.is-busy svg {
  visibility: hidden;
}

.btn.is-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid currentcolor;
  border-color: var(--rose) var(--rose) transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn:not(.btn-primary, .btn-danger, .btn-rose).is-busy::after {
  border-color: var(--ink) var(--ink) transparent;
}

/* --- Animaciones ------------------------------------------------------------ */

@keyframes flap {
  50% {
    transform: perspective(240px) rotateY(62deg);
  }
}

@keyframes flutter {
  0%, 72%, 80%, 88%, 100% {
    transform: perspective(240px) rotateY(0);
  }

  76%, 84% {
    transform: perspective(240px) rotateY(58deg);
  }
}

@keyframes wipe {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes wings-in {
  from {
    opacity: 0;
    translate: -6px 8px;
  }
}

@keyframes bar-slide {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(260%);
  }
}

@keyframes splash-away {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.82);
  }

  60% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

@keyframes bar-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 24;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.08);
  }
}

/* Al cambiar de sección. */
.main > * {
  animation: rise 0.28s ease-out both;
}

.hero > * {
  animation: rise 0.45s ease-out both;
}

.hero > :nth-child(2) {
  animation-delay: 0.08s;
}

.hero > :nth-child(3) {
  animation-delay: 0.14s;
}

.hero > :nth-child(4) {
  animation-delay: 0.2s;
}

/* Solo al aparecer la vista: el refresco automático no vuelve a animar. */
.enter :is(.kpi, .panel, .req, .today > li, .card-list > li, .day-item, .appt, .tg-block),
.pub-fade .item {
  animation: rise 0.32s ease-out both;
}

.enter .mc-day {
  animation: fade 0.3s ease-out both;
}

.enter :is(.kpi, .req, .today > li, .card-list > li, .day-item):nth-child(2),
.pub-fade .item:nth-child(2) {
  animation-delay: 45ms;
}

.enter :is(.kpi, .req, .today > li, .card-list > li, .day-item):nth-child(3),
.pub-fade .item:nth-child(3) {
  animation-delay: 90ms;
}

.enter :is(.kpi, .req, .today > li, .card-list > li, .day-item):nth-child(4),
.pub-fade .item:nth-child(4) {
  animation-delay: 135ms;
}

.enter :is(.req, .today > li, .card-list > li, .day-item):nth-child(n + 5),
.pub-fade .item:nth-child(n + 5) {
  animation-delay: 180ms;
}

.btn,
.slot,
.chip,
.cal-day,
.icon-btn,
.menu-item,
.nav a,
.pub-nav a,
.pub-tabs a {
  transition: transform 0.12s ease, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:active:not(:disabled),
.slot:active,
.chip:active,
.cal-day:not(:disabled):active,
.icon-btn:active,
.mc-day:active {
  transform: scale(0.96);
}

.slots .slot {
  animation: rise 0.24s ease-out both;
}

.slots .slot:nth-child(2) {
  animation-delay: 30ms;
}

.slots .slot:nth-child(3) {
  animation-delay: 60ms;
}

.slots .slot:nth-child(4) {
  animation-delay: 90ms;
}

.slots .slot:nth-child(n + 5) {
  animation-delay: 120ms;
}

.slot[aria-pressed='true'],
.chip[aria-pressed='true'],
.cal-day[aria-pressed='true'],
.choose-item:has(input:checked) .choose-check {
  animation: pop 0.24s ease-out;
}

.cal-grid {
  animation: fade 0.22s ease-out;
}

.dialog[open] {
  animation: dialog-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dialog[open]::backdrop {
  animation: fade 0.2s ease-out;
}

.toast {
  animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar {
  animation: bar-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.status-icon {
  animation: pop 0.38s ease-out;
}

.status-ok .status-icon path {
  stroke-dasharray: 24;
  animation: draw 0.45s 0.2s ease-out both;
}

.status-wait .status-icon svg {
  animation: breathe 2.2s ease-in-out infinite;
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  }

  .item:hover,
  .req:hover {
    border-color: var(--line-strong);
  }
}

/* --- Ajustes de la auditoría ------------------------------------------------- */

/* En pantallas grandes se aprovecha el ancho en lugar de dejar una columna angosta. */
@media (min-width: 1200px) {
  :root {
    --page: 1040px;
  }

  .home-cols {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: start;
  }

  .choose {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .pub-fade > .form {
    width: min(620px, 100%);
  }

  .pub-view > .pub-center {
    justify-self: center;
    width: min(560px, 100%);
  }
}

@media (min-width: 1400px) {
  .req-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    max-width: none;
  }

  .req-history {
    max-width: none;
  }

  .req-search {
    max-width: 460px;
  }
}

@media (max-width: 760px) {
  .btn-small {
    min-height: 36px;
  }
}

.side {
  overflow-y: auto;
}

@media (max-width: 1024px), (pointer: coarse) {
  /* Con menos de 16 px, el iPhone y el iPad acercan la pantalla al escribir. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
  }
}

@media (max-height: 560px) and (min-width: 761px) {
  .side {
    padding-top: 10px;
  }

  .side-logo {
    max-width: 110px;
    margin-bottom: 6px;
  }

  .nav a {
    min-height: 36px;
  }

  .side-logout {
    margin-top: 6px;
  }
}

@media (max-height: 560px) {
  .pub-top {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .pub-brand .logo {
    width: 100px;
  }

  .hero {
    padding-bottom: 20px;
  }
}

@media (max-width: 760px) {
  .dialog[open]:not(.dialog-confirm) {
    animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .side {
    overflow: visible;
  }

  .side .side-logo {
    display: none;
  }
}

@media (max-width: 420px) {
  .day-item-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .day-item-time {
    grid-column: 1;
    grid-row: 1;
  }

  .day-item-main .badge {
    grid-column: 2;
    grid-row: 1;
  }

  .day-item-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 360px) {
  .nav a {
    font-size: 9.5px;
  }

  .bar-actions .btn {
    padding: 0 12px;
  }
}

/* --- Flujo de 3 pasos en la portada ---------------------------------------- */

.flow-wrap {
  display: grid;
  gap: 10px;
}

.flow-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 24px 12px 22px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.flow-step {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding: 0 10px;
  text-align: center;
}

.flow-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--rose);
  box-shadow: 0 0 0 6px var(--surface);
}

.flow-num {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rose);
  color: #000;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--surface);
}

.flow-title {
  font-size: 15.5px;
}

/* La línea va del borde de un círculo al siguiente. */
.flow-line {
  position: absolute;
  top: 27px;
  left: calc(50% + 36px);
  width: calc(100% - 72px);
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.flow-line::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ink), var(--accent));
  transform-origin: left;
}

.flow-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgb(227 177 185 / 0.35);
  opacity: 0;
}

/* Entrada en secuencia: círculo, texto y línea hacia el siguiente paso. Lo
   oculto solo existe antes de verse; sin animaciones queda todo a la vista. */
.flow.reveal:not(.is-visible) :is(.flow-node, .flow-title, .flow-step p) {
  opacity: 0;
}

.flow.reveal:not(.is-visible) .flow-line::before {
  transform: scaleX(0);
}

.flow.is-visible .flow-node {
  animation: node-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
  animation-delay: calc(var(--i) * 0.45s);
}

.flow.is-visible :is(.flow-title, .flow-step p) {
  animation: rise 0.45s ease-out both;
  animation-delay: calc(var(--i) * 0.45s + 0.15s);
}

.flow.is-visible .flow-line::before {
  animation: line-grow 0.45s ease-in-out both;
  animation-delay: calc(var(--i) * 0.45s + 0.3s);
}

.flow.is-visible .flow-pulse {
  animation: travel 2.6s ease-in-out infinite;
  animation-delay: calc(1.4s + var(--i) * 1.3s);
}

/* --- Aparecer al bajar ------------------------------------------------------ */

.reveal:not(.flow) {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal:not(.flow, .is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

.reveal .bar-fill {
  transform-origin: left;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}

.reveal:not(.is-visible) .bar-fill {
  transform: scaleX(0);
}

/* --- Cargando ----------------------------------------------------------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.progress::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, rgb(227 177 185 / 0), var(--rose), var(--accent));
  animation: progress-slide 1s ease-in-out infinite;
}

.progress-on {
  opacity: 1;
}

.progress-done::before {
  width: 100%;
  animation: none;
}

.skeleton {
  display: grid;
  gap: 10px;
}

.sk {
  display: block;
  width: 70%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--neutral-soft) 25%, #f8f3f3 50%, var(--neutral-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.sk-title {
  width: 45%;
  height: 15px;
}

.sk-short {
  width: 30%;
}

.sk-big {
  width: 55%;
  height: 26px;
  margin-top: 4px;
}

.sk-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.skeleton-rows {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sk-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.sk-row + .sk-row {
  border-top: 1px solid var(--line);
}

.skeleton-dashboard .home-grid .sk-card {
  min-height: 210px;
}

.sk-next {
  width: 100%;
  height: 62px;
  border-radius: 10px;
}

.cal-loading .cal-day {
  color: transparent !important;
}

.cal-loading .cal-day::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--neutral-soft) 25%, #f8f3f3 50%, var(--neutral-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.cal-loading .cal-dot {
  display: none;
}

/* --- Más vida --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 42%;
  left: 50%;
  width: min(900px, 150vw);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(circle, rgb(227 177 185 / 0.2), rgb(227 177 185 / 0) 62%);
  animation: glow 7s ease-in-out infinite alternate;
  pointer-events: none;
}

.btn-rose {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-rose::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, rgb(255 255 255 / 0), rgb(255 255 255 / 0.65), rgb(255 255 255 / 0));
  transform: skewX(-20deg);
  animation: shine 4.5s 1.8s ease-in-out infinite;
}

.status-icon {
  position: relative;
}

.status-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.status-ok .status-icon::after {
  animation: ring 1.6s ease-out 0.35s 2;
}

.status-wait .status-icon::after {
  animation: ring-soft 2.4s ease-out infinite;
}

/* Los pasos de la reserva se unen con una línea que se llena al avanzar. */
.steps li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  margin: 0 4px 0 6px;
  border-radius: 2px;
  background: var(--line);
}

.steps .step-done::after {
  background: linear-gradient(90deg, var(--ink) 50%, var(--line) 50%);
  background-size: 200% 100%;
  animation: fill-line 0.5s ease-out both;
}

.steps li:last-child {
  flex: none;
}

.menu-item svg {
  transition: transform 0.2s ease;
}

.menu-item:hover svg {
  transform: translateX(4px);
}

@media (hover: hover) {
  .item,
  .choose-item,
  .acct-link {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s, background-color 0.15s;
  }

  .item:hover,
  .choose-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.06);
  }
}

@keyframes node-in {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

@keyframes line-grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes line-grow-y {
  from {
    transform: scaleY(0);
  }
}

@keyframes travel {
  0% {
    left: 0;
    opacity: 0;
  }

  12%,
  88% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes travel-y {
  0% {
    top: 0;
    opacity: 0;
  }

  12%,
  88% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes progress-slide {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(260%);
  }
}

@keyframes glow {
  from {
    opacity: 0.55;
    scale: 0.92;
  }

  to {
    opacity: 1;
    scale: 1.06;
  }
}

@keyframes shine {
  0% {
    left: -60%;
  }

  28%,
  100% {
    left: 130%;
  }
}

@keyframes ring {
  from {
    box-shadow: 0 0 0 0 rgb(227 177 185 / 0.75);
  }

  to {
    box-shadow: 0 0 0 22px rgb(227 177 185 / 0);
  }
}

@keyframes ring-soft {
  from {
    box-shadow: 0 0 0 0 rgb(127 81 0 / 0.25);
  }

  to {
    box-shadow: 0 0 0 16px rgb(127 81 0 / 0);
  }
}

@keyframes fill-line {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}

/* En teléfono el flujo baja en vertical, como una línea de tiempo. */
@media (max-width: 760px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding: 22px 18px;
  }

  .flow-step {
    grid-template-columns: 56px minmax(0, 1fr);
    justify-items: start;
    column-gap: 14px;
    row-gap: 2px;
    padding: 0;
    text-align: left;
  }

  .flow-node {
    grid-row: span 2;
    margin: 0;
  }

  .flow-title {
    align-self: end;
  }

  .flow-step p {
    align-self: start;
  }

  .flow-line {
    top: 62px;
    left: 27px;
    width: 2px;
    height: calc(100% - 28px);
  }

  .flow-line::before {
    transform-origin: top;
  }

  .flow.reveal:not(.is-visible) .flow-line::before {
    transform: scaleY(0);
  }

  .flow.is-visible .flow-line::before {
    animation-name: line-grow-y;
  }

  .flow-pulse {
    top: 0;
    left: 50%;
  }

  .flow.is-visible .flow-pulse {
    animation-name: travel-y;
  }

  .steps li {
    flex: 1;
  }

  .steps li:last-child {
    flex: none;
  }
}

/* --- Agenda renovada ------------------------------------------------------------ */

.agenda-head {
  align-items: flex-end;
}

.agenda-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agenda-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.today-pill {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--rose);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.agenda-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.stat-chip svg {
  color: var(--muted);
}

.stat-warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}

.stat-rose {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-warn svg,
.stat-rose svg {
  color: currentColor;
}

.agenda-fab {
  display: none;
}

.agenda-block svg,
.agenda-new svg {
  flex: none;
}

/* Filtro por profesional (semana y mes). */
.staff-filter {
  display: flex;
  gap: 6px;
  margin: -2px 0 12px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.staff-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  border-radius: 99px;
}

.staff-chip .dot {
  width: 9px;
  height: 9px;
}

.staff-filter .staff-chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 15%, #fff);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 32%, #fff);
  color: color-mix(in srgb, var(--c) 78%, #000);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Cabeceras de la cuadrícula. */
.tg {
  box-shadow: 0 1px 2px rgb(36 23 34 / 0.04);
}

.tg-head {
  box-shadow: 0 6px 12px -10px rgb(36 23 34 / 0.25);
}

.tg-staffhead {
  position: relative;
  justify-content: flex-start;
  gap: 10px;
  min-height: 60px;
  padding: 8px 12px 11px;
  font-weight: 400;
}

.tg-staff-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
}

.tg-staff-text strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-staff-text .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-load {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.tg-load span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--c);
  transform-origin: left;
  animation: load-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes load-grow {
  from {
    transform: scaleX(0);
  }
}

.tg-dayhead {
  gap: 6px;
  min-height: 48px;
}

.tg-wd {
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.tg-daycount {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--neutral-soft);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.tg-today .tg-wd {
  color: var(--accent);
}

.tg-today .tg-daycount {
  background: var(--accent-soft);
  color: var(--accent);
}

.agenda-content-wide .tg-col-today {
  background-color: #fdf8f8;
}

/* Lo que ya pasó del día queda apagado; no estorba para tocar. */
.tg-past {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgb(240 233 233 / 0.45);
  pointer-events: none;
}

.tg-now {
  box-shadow: 0 0 0 2px rgb(155 74 90 / 0.12);
}

.tg-gutter .tg-now-label {
  right: 4px;
  z-index: 1;
  margin-top: 0;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}

.tg-break {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, rgb(36 23 34 / 0.03) 0 7px, rgb(36 23 34 / 0.06) 7px 14px);
}

.tg-break span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.tg-block {
  border-left: 3px solid var(--line-strong);
  font-weight: 600;
}

/* Bloques de cita. */
.appt {
  gap: 1px;
  padding: 4px 8px 4px 7px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgb(36 23 34 / 0.05);
  transition: box-shadow 0.15s, transform 0.15s, background-color 0.15s;
}

.appt:hover {
  z-index: 3;
  box-shadow: 0 6px 16px rgb(36 23 34 / 0.16);
  transform: translateY(-1px);
}

.appt:focus-visible {
  z-index: 3;
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.appt .appt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.appt-time {
  overflow: hidden;
  gap: 0;
  font-weight: 600;
  white-space: nowrap;
}

.appt-end {
  font-weight: 500;
}

.appt-state {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.state-pendiente {
  background: var(--warn-soft);
  color: var(--warn);
}

.state-confirmada {
  background: var(--ok-soft);
  color: var(--ok);
}

.state-completada {
  background: var(--surface);
  color: var(--text);
}

.state-no_asistio {
  background: var(--bad-soft);
  color: var(--bad);
}

.state-cancelada {
  background: var(--neutral-soft);
  color: var(--muted);
}

.state-solicitud {
  background: var(--accent-soft);
  color: var(--accent);
}

.appt-confirmada {
  background: color-mix(in srgb, var(--c) 14%, #fff);
}

.appt-confirmada:hover {
  background: color-mix(in srgb, var(--c) 22%, #fff);
}

@container (max-width: 118px) {
  .appt-end {
    display: none;
  }
}

.appt-short,
.appt-initials {
  display: none;
  font-weight: 650;
}

@container (max-width: 84px) {
  .appt-client {
    display: none;
  }

  .appt-short {
    display: block;
  }
}

@container (max-width: 60px) {
  .appt {
    padding-right: 4px;
    padding-left: 5px;
  }

  .appt-short {
    display: none;
  }

  .appt-initials {
    display: block;
    letter-spacing: 0.03em;
  }
}

@container (max-width: 64px) {
  .appt-state {
    display: none;
  }
}

/* Panel lateral: calendario chico y lo que falta confirmar. */
.rail {
  gap: 14px;
  align-content: start;
}

.mini-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -6px 6px;
}

.mini-bar strong {
  font-size: 14.5px;
  font-weight: 650;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  row-gap: 2px;
}

.mini-head {
  padding: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.mini-day {
  position: relative;
  display: grid;
  justify-self: center;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s, color 0.15s;
}

.mini-day:hover {
  background: var(--neutral-soft);
}

.mini-out {
  color: #8f8489;
}

.mini-today {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--rose);
}

.mini-day[aria-pressed='true'] {
  background: var(--ink);
  color: #fff;
  font-weight: 650;
}

.mini-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

.mini-day[aria-pressed='true'] .mini-dot {
  background: var(--rose);
}

.rail-section {
  display: grid;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.rail .rail-empty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rail .rail-list {
  margin-top: 8px;
}

.rail-list .rail-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.rail .rail-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}

.rail-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.rail-text strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail .rail-actions {
  flex-wrap: nowrap;
  gap: 2px;
}

.rail-wa {
  color: var(--muted);
}

.rail-ok {
  color: var(--ok);
}

.rail-ok:hover {
  background: var(--ok-soft);
}

/* Mes. */
.mc-day {
  padding-bottom: 14px;
  transition: background-color 0.15s;
}

.mc-today {
  box-shadow: inset 0 0 0 2px var(--rose);
}

.mc-load {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.mc-load span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0.75;
  transform-origin: left;
  animation: load-grow 0.6s ease-out both;
}

/* Teléfono: tira de la semana y el día como línea de tiempo. */
.day-strip button {
  gap: 1px;
  min-height: 64px;
  transition: background-color 0.15s, color 0.15s;
}

.day-strip span:first-child {
  text-transform: capitalize;
}

.strip-dots {
  min-width: 18px;
  height: 16px;
  margin-top: 2px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
}

.day-strip .strip-empty {
  background: transparent;
}

.day-strip .selected .strip-dots {
  background: var(--rose);
  color: #000;
}

.day-strip .selected .strip-empty {
  background: transparent;
}

.day-closed {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--neutral-soft);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.timeline {
  --tl-x: 60px;
  display: grid;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.timeline > li {
  position: relative;
  padding: 0 0 10px calc(var(--tl-x) + 16px);
}

.timeline > li::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tl-x);
  width: 2px;
  margin-left: -1px;
  background: var(--line);
}

.timeline > li:first-child::before {
  top: 18px;
}

.timeline > li:last-child::before {
  bottom: calc(100% - 18px);
}

.timeline > li::after {
  content: '';
  position: absolute;
  top: 13px;
  left: var(--tl-x);
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
}

.tl-appt::after {
  border: 3px solid var(--c);
  background: var(--surface);
}

.tl-free::after {
  top: 18px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--line-strong);
}

.tl-now::after {
  top: 50%;
  margin-top: -11px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(155 74 90 / 0.16);
}

.tl-time {
  position: absolute;
  top: 9px;
  left: 0;
  display: grid;
  width: calc(var(--tl-x) - 14px);
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tl-time strong {
  font-size: 14.5px;
}

.tl-time span {
  color: var(--muted);
  font-size: 12px;
}

.tl-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--c);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(36 23 34 / 0.04);
}

.tl-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 4px 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}

.tl-main .badge {
  grid-column: 2;
  justify-self: start;
}

.tl-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.3;
}

.tl-text strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-staff {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.tl-staff .dot {
  width: 8px;
  height: 8px;
}

.tl-inactive .tl-card {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  opacity: 0.7;
}

.tl-inactive .tl-text strong {
  text-decoration: line-through;
}

.tl-wa {
  gap: 6px;
}

.tl-free button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 6px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tl-free button:hover,
.tl-free button:active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tl-free button > svg {
  flex: none;
}

.tl-free-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.tl-free-text strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.tl-free-text span {
  font-size: 12.5px;
}

.tl-free-dots {
  display: flex;
  flex: none;
  gap: 3px;
}

.tl-free-dots .dot {
  width: 8px;
  height: 8px;
}

.tl-now span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tl-now span::after {
  content: '';
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.5;
}

.enter :is(.timeline > li, .rail-row, .staff-chip, .stat-chip) {
  animation: rise 0.32s ease-out both;
}

.enter .timeline > li:nth-child(2) {
  animation-delay: 40ms;
}

.enter .timeline > li:nth-child(3) {
  animation-delay: 80ms;
}

.enter .timeline > li:nth-child(4) {
  animation-delay: 120ms;
}

.enter .timeline > li:nth-child(n + 5) {
  animation-delay: 160ms;
}

@media (max-width: 1080px) {
  .rail {
    grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
  }

  .rail-section {
    padding-top: 0;
    border-top: 0;
  }

  .mini-day {
    width: 38px;
    height: 38px;
    font-size: 13.5px;
  }
}

@media (max-width: 760px) {
  .agenda-head {
    gap: 12px;
    margin-bottom: 12px;
  }

  .agenda-summary {
    min-height: 26px;
  }

  .stat-chip {
    height: 26px;
    padding: 0 9px;
    font-size: 12.5px;
  }

  .agenda-block {
    width: 40px;
    padding: 0;
  }

  .agenda-block .btn-label {
    display: none;
  }

  .agenda-new {
    display: none;
  }

  /* Nueva cita queda flotando a la mano, encima del menú. */
  .main > .agenda-fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
    z-index: 9;
    display: inline-flex;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 99px;
    box-shadow: 0 10px 26px rgb(36 23 34 / 0.3);
    animation: rise 0.35s 0.15s ease-out both;
  }

  .agenda-content {
    padding-bottom: 64px;
  }

  .mc-day {
    padding-bottom: 10px;
  }

  .mc-count {
    top: 4px;
    bottom: auto;
  }

  .mc-load {
    left: 4px;
    right: 4px;
    bottom: 4px;
  }
}

@media (max-width: 360px) {
  .timeline {
    --tl-x: 50px;
  }

  .timeline > li {
    padding-left: calc(var(--tl-x) + 12px);
  }

  .tl-time strong {
    font-size: 13.5px;
  }
}

/* --- Recordatorio del día anterior ------------------------------------------------ */

.rmd {
  display: grid;
  gap: 6px;
  align-content: start;
}

.rmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rmd-count {
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rmd-bar {
  position: relative;
  height: 6px;
  margin: 2px 0 2px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.rmd-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  transform-origin: left;
  animation: load-grow 0.6s ease-out both;
}

.rmd-bar-sent {
  background: var(--rose);
}

.rmd-bar-ok {
  background: var(--ok);
}

.rmd-list {
  display: grid;
  margin-top: 4px;
}

.rmd-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.rmd-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}

.rmd-main:hover strong {
  color: var(--accent);
}

.rmd-text {
  display: grid;
  justify-items: start;
  gap: 1px;
  min-width: 0;
  line-height: 1.3;
}

.rmd-text strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rmd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.rmd-pill-pendiente {
  background: var(--neutral-soft);
  color: var(--muted);
}

.rmd-pill-avisada {
  background: var(--warn-soft);
  color: var(--warn);
}

.rmd-pill-viene {
  background: var(--ok-soft);
  color: var(--ok);
}

.rmd-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rmd-wa {
  color: var(--muted);
}

.icon-btn.rmd-wa:hover {
  background: var(--ok-soft);
  color: var(--ok);
}

.icon-btn.rmd-ok {
  color: var(--ok);
}

.icon-btn.rmd-ok:hover {
  background: var(--ok-soft);
}

.rmd-ok[aria-pressed='true'],
.rmd-ok[aria-pressed='true']:hover {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.btn.rmd-ok {
  color: var(--ok);
}

.btn.rmd-ok[aria-pressed='true'] {
  color: #fff;
}

.rmd-ok[aria-pressed='true'] svg {
  animation: pop 0.3s ease-out;
}

/* En la cuadrícula: doble palomita cuando dijo que sí viene. */
.state-viene {
  background: var(--ok);
  color: #fff;
}

.notice-ok svg {
  color: var(--ok);
}

.detail-summary .rmd-pill {
  justify-self: start;
}

/* Teléfono: recordar desde la línea de tiempo. */
.tl-remind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
}

.tl-remind .rmd-pill {
  margin-top: 0;
}

.tl-remind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-remind-actions .btn {
  gap: 6px;
}

/* Página de clientes: confirmar que viene. */
.attend-ask {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--rose);
  border-radius: 12px;
  background: color-mix(in srgb, var(--rose) 14%, #fff);
}

.attend-question {
  display: grid;
  gap: 2px;
}

.attend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attend-actions .btn {
  gap: 6px;
}

.attend-done {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 650;
}

.next-ask,
.next-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
}

.next-ask {
  color: var(--accent);
}

.next-ok {
  color: var(--ok);
}

/* --- Subir respaldo ------------------------------------------------------------- */

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-actions .btn {
  gap: 6px;
}

/* --- Notificaciones ------------------------------------------------------------- */

.push-list {
  display: grid;
  gap: 4px;
  margin: 2px 0 6px;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted);
  font-size: 14px;
}

.push-status {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.push-status > .btn {
  gap: 6px;
}

.push-on {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 650;
}

.push-help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
  line-height: 1.4;
}

.push-help svg {
  flex: none;
  margin-top: 2px;
}

/* --- Datos por completar y avisos a clientas ------------------------------------ */

.setup {
  margin-bottom: 16px;
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 12%, var(--surface));
}

.setup-list {
  display: grid;
  margin-top: 6px;
}

.setup-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid color-mix(in srgb, var(--rose) 45%, transparent);
  font-size: 14px;
}

.setup-list li:first-child {
  border-top: 0;
}

.setup-list svg {
  color: var(--accent);
}

.client-push {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.client-push p {
  margin: 0;
}

.client-push .btn {
  gap: 6px;
}

.client-push-on {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 650;
}

/* --- Lista de dispositivos con avisos -------------------------------------------- */

.push-devices {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.push-devices-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.push-device-list {
  display: grid;
}

.push-device-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.push-device-list svg {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .flow-pulse,
  .progress::before {
    display: none;
  }
}
