/* =====================================================================
   Agenda · Isabel Makeup
   Identidad: marfil, rosa suave y champagne (propuesta de Visual Producer,
   contrastes AA verificados). Serif editorial solo en titulares y nombres;
   todo dato operativo (hora, estado, teléfono) en sans con cifras tabulares.
   Vidrio solo en navegación y controles, nunca en tarjetas de contenido.
   Primero iPhone: nada depende de hover y no hay escalado global de lienzo.
   ===================================================================== */

:root {
  --ivory: #fbf7f2;
  --card: #ffffff;
  --rose-soft: #f6e4e4;
  --rose-mist: #fbefee;
  --champagne: #efe3d3;
  --ink: #2b2326;
  --ink-2: #6b5a5e;
  --ink-3: #9a8a8e;
  --accent: #9e4a5c;
  --accent-hi: #b25c70;
  --accent-deep: #84394b;
  --champ-dark: #7a5c35;
  --gold: #c9a77a;
  --line: rgba(43, 35, 38, 0.09);
  --line-2: rgba(43, 35, 38, 0.14);

  --st-prog-bg: #e8eef7;
  --st-prog-fg: #2f4a73;
  --st-conf-bg: #e3f1ea;
  --st-conf-fg: #25624a;
  --st-canc-bg: #f7e3e3;
  --st-canc-fg: #8e2c2c;
  --st-aten-bg: #ece8e3;
  --st-aten-fg: #4d4540;
  --st-cont-bg: #fbebd9;
  --st-cont-fg: #8a4b12;

  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(43, 35, 38, 0.05);
  --sh-2:
    0 2px 6px rgba(43, 35, 38, 0.04), 0 10px 28px -12px rgba(90, 50, 60, 0.16);
  --sh-3:
    0 6px 16px rgba(43, 35, 38, 0.06), 0 24px 48px -20px rgba(90, 50, 60, 0.28);
  --e-out: cubic-bezier(0.16, 1, 0.3, 1);
  --e-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ivory);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Luces del fondo: div fijo, no background-attachment (iOS lo ignora). */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      38vmax 30vmax at 12% 8%,
      rgba(246, 214, 220, 0.85),
      transparent 70%
    ),
    radial-gradient(
      40vmax 34vmax at 92% 30%,
      rgba(239, 227, 211, 0.9),
      transparent 70%
    ),
    radial-gradient(
      36vmax 30vmax at 30% 96%,
      rgba(250, 236, 232, 0.9),
      transparent 70%
    );
}

body.has-sheet {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

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

.serif {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings:
    "tnum" 1,
    "lnum" 1;
}

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

.small {
  font-size: 13px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--champ-dark);
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
}

.ico--xs {
  width: 13px;
  height: 13px;
}

.ico--sm {
  width: 17px;
  height: 17px;
}

.ico--lg {
  width: 30px;
  height: 30px;
}

/* ---------------------------------------------------------------------
   Vidrio líquido sobre fondo claro.
   Cuatro propiedades registradas para que transicionen; el JS solo escribe
   la posición del dedo. Borde de luz y brillo en tonos cálidos (sobre marfil
   el blanco puro desaparece), texto siempre oscuro o sobre tinte sólido.
   --------------------------------------------------------------------- */
@property --lgx {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.25;
}
@property --lgy {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --lgon {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --lgpress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.lg {
  --lgx: 0.25;
  --lgy: 0;
  --lgon: 0;
  --lgpress: 0;
  --lg-tint: rgba(255, 255, 255, 0.58);
  --lg-rim: rgba(255, 255, 255, 0.95);
  --lg-rim-shade: rgba(122, 92, 53, 0.22);
  --lg-press-time: 0.5s;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0.08) 48%,
      rgba(255, 255, 255, 0.3)
    ),
    var(--lg-tint);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow:
    0 1px 1px rgba(90, 50, 60, 0.06),
    0 6px 16px -8px rgba(90, 50, 60, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -6px 10px -8px rgba(122, 92, 53, 0.22);
  transform: translateY(calc(-0.8px * var(--lgon) + 1px * var(--lgpress)))
    scale(calc(1 - 0.012 * var(--lgpress)), calc(1 - 0.03 * var(--lgpress)));
  /* Primero la transición universal; la de linear() la reemplaza donde exista
     (si un navegador no reconoce linear(), descarta solo esa declaración). */
  transition:
    --lgx 0.18s ease-out,
    --lgy 0.18s ease-out,
    --lgon 0.4s cubic-bezier(0.3, 0.7, 0.2, 1),
    --lgpress var(--lg-press-time) cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.2s var(--e-smooth);
  transition:
    --lgx 0.18s ease-out,
    --lgy 0.18s ease-out,
    --lgon 0.4s cubic-bezier(0.3, 0.7, 0.2, 1),
    --lgpress var(--lg-press-time)
      linear(
        0,
        0.087,
        0.289,
        0.528,
        0.749,
        0.923,
        1.04,
        1.103,
        1.124,
        1.116,
        1.093,
        1.064,
        1.036,
        1.014,
        0.999,
        0.991,
        0.989,
        0.991,
        0.995,
        0.998,
        1
      ),
    background-color 0.2s var(--e-smooth);
}

.lg::before {
  /* Borde de luz que gira hacia el dedo. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.2px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(
    from calc(atan2(var(--lgy) - 0.5, var(--lgx) - 0.5) + 40deg),
    var(--lg-rim) 0deg,
    rgba(255, 255, 255, 0.4) 70deg,
    var(--lg-rim-shade) 140deg,
    rgba(255, 255, 255, 0.55) 200deg,
    var(--lg-rim) 250deg,
    var(--lg-rim-shade) 320deg,
    var(--lg-rim) 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

.lg::after {
  /* Brillo que sigue al dedo. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    5em 2.6em at calc(var(--lgx) * 100%) calc(var(--lgy) * 100%),
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.15) 45%,
    transparent 75%
  );
  opacity: calc(0.25 + 0.75 * var(--lgon));
}

.lg[data-pressed] {
  --lgpress: 1;
  --lg-press-time: 0.12s;
}

@media (hover: hover) {
  .lg:hover {
    --lgon: 1;
  }
}

.lg:focus-visible {
  --lgon: 1;
}

@media (prefers-reduced-motion: reduce) {
  .lg {
    transform: none !important;
    transition: background-color 0.2s;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .lg,
  .tabbar,
  .topbar,
  .sheet-backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .lg {
    background: var(--card);
  }
  .lg::after {
    display: none;
  }
}

/* ---------------------------------------------------------------------
   Botones
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
}

.btn > span {
  position: relative;
}

.btn--sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.btn--lg {
  min-height: 54px;
  width: 100%;
  font-size: 16px;
}

.btn--icon {
  width: 44px;
  padding: 0;
}

.btn--primary {
  --lg-tint: rgba(158, 74, 92, 0.94);
  --lg-rim: rgba(255, 220, 228, 0.9);
  --lg-rim-shade: rgba(60, 20, 30, 0.35);
  color: #fff;
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0) 50%,
      rgba(255, 255, 255, 0.08)
    ),
    linear-gradient(
      135deg,
      var(--accent-hi),
      var(--accent) 55%,
      var(--accent-deep)
    );
}

.btn--primary::after {
  background: radial-gradient(
    5em 2.6em at calc(var(--lgx) * 100%) calc(var(--lgy) * 100%),
    rgba(255, 255, 255, 0.38),
    transparent 70%
  );
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line-2);
}

.btn--danger {
  background: #fff;
  color: var(--st-canc-fg);
  border: 1px solid #ecc9c6;
}

.btn--plain {
  background: transparent;
  color: var(--ink-2);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (hover: hover) {
  .btn--ghost:hover,
  .btn--plain:hover {
    background: rgba(255, 255, 255, 0.6);
  }
  .btn--danger:hover {
    background: var(--st-canc-bg);
  }
}

/* ---------------------------------------------------------------------
   Estados (siempre texto + ícono + color)
   --------------------------------------------------------------------- */
.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.st[data-st="PROGRAMADA"] {
  background: var(--st-prog-bg);
  color: var(--st-prog-fg);
}
.st[data-st="CONFIRMADA"] {
  background: var(--st-conf-bg);
  color: var(--st-conf-fg);
}
.st[data-st="CANCELADA"] {
  background: var(--st-canc-bg);
  color: var(--st-canc-fg);
}
.st[data-st="ATENDIDA"] {
  background: var(--st-aten-bg);
  color: var(--st-aten-fg);
}
.st[data-st="CONTACTO"] {
  background: var(--st-cont-bg);
  color: var(--st-cont-fg);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.badge--soft {
  background: var(--champagne);
  color: var(--champ-dark);
}

/* ---------------------------------------------------------------------
   Cascarón
   --------------------------------------------------------------------- */
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-2);
}

.boot__mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--rose-soft),
    var(--accent),
    var(--gold),
    var(--rose-soft)
  );
  animation: spin 1.4s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%);
  mask: radial-gradient(circle, transparent 54%, #000 56%);
}

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

.app {
  min-height: 100dvh;
  padding-bottom: calc(96px + var(--safe-b));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) var(--gutter) 10px;
  background: linear-gradient(
    to bottom,
    rgba(251, 247, 242, 0.92),
    rgba(251, 247, 242, 0.72)
  );
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  box-shadow: 0 6px 14px -6px rgba(158, 74, 92, 0.6);
}

.brand__name {
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topnav {
  display: none;
  position: relative;
  margin: 0 auto;
  padding: 5px;
  gap: 2px;
  border-radius: 999px;
}

.topnav__mark {
  position: absolute;
  top: 5px;
  left: 0;
  height: calc(100% - 10px);
  border-radius: 999px;
  background: var(--ink);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.topnav__link {
  position: relative;
  z-index: 1;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}

.topnav__link[aria-current="page"] {
  color: var(--ivory);
  background: var(--ink);
}

.topnav__mark {
  display: none;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bell {
  position: relative;
}

.bell__count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ivory);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.only-wide {
  display: none;
}

.view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px var(--gutter) 24px;
  outline: none;
}

/* Barra inferior (iPhone): zona del pulgar, vidrio más opaco para leerse
   sobre cualquier contenido. */
.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-b));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 68px;
  padding: 0 6px;
  border-radius: 26px;
  background: rgba(255, 252, 249, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 12px 30px -12px rgba(90, 50, 60, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 56px;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.tab[aria-current="page"] {
  color: var(--accent);
}

.tab--new {
  --lg-tint: rgba(158, 74, 92, 0.95);
  --lg-rim: rgba(255, 220, 228, 0.9);
  justify-self: center;
  width: 56px;
  height: 56px;
  min-height: 56px;
  margin-top: -18px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  box-shadow: 0 12px 24px -8px rgba(158, 74, 92, 0.65);
}

.tab--new .ico {
  width: 26px;
  height: 26px;
}

.sandbox-flag {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(86px + var(--safe-b));
  z-index: 25;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(239, 227, 211, 0.92);
  color: var(--champ-dark);
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   Tarjetas
   --------------------------------------------------------------------- */
.card {
  position: relative;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-2);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.card + .card {
  margin-top: 14px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card__head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.card__head p {
  margin: 2px 0 0;
  font-size: 13px;
}

.card--ink {
  background: linear-gradient(158deg, #3a2f33 0%, #2b2326 55%, #211a1c 100%);
  color: var(--ivory);
  border-color: transparent;
}

.card--ink .muted {
  color: rgba(251, 247, 242, 0.7);
}

.card--feature {
  background: linear-gradient(150deg, #fff 0%, var(--rose-mist) 100%);
}

.card--list {
  padding: 6px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--champagne);
  color: var(--ink);
  font-size: 14px;
  border: 0;
  text-align: left;
  width: 100%;
}

.notice p {
  margin: 2px 0 0;
}

.notice .ico {
  margin-top: 2px;
}

.notice--contact {
  background: var(--st-cont-bg);
  color: var(--st-cont-fg);
  flex-wrap: wrap;
}

.notice--contact > div {
  flex: 1;
  min-width: 180px;
}

.notice--bad {
  background: var(--st-canc-bg);
  color: var(--st-canc-fg);
}

.notice--ok {
  background: var(--st-conf-bg);
  color: var(--st-conf-fg);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-2);
}

.empty .ico {
  color: var(--gold);
}

.empty h3 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
}

.empty p {
  margin: 0;
  max-width: 34ch;
}

.skeleton {
  height: 120px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, #f4ede6 0%, #fbf7f2 50%, #f4ede6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton--slots {
  height: 96px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.row-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  text-align: left;
}

@media (hover: hover) {
  .row-btn:hover {
    background: var(--rose-mist);
  }
}

.mini-list,
.feed,
.people,
.svc-list,
.outbox-list,
.history,
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list__day {
  width: 52px;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--champ-dark);
}

.mini-list__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Nombres y servicios largos se envuelven por palabras. `break-word` y no
   `anywhere`: con `anywhere` el ancho mínimo de la columna cae a una letra y,
   si la fila trae dos estados, el nombre se apila letra por letra. */
.mini-list__main {
  flex: 1 1 150px;
  min-width: 120px;
}

.mini-list__main b,
.mini-list__main i {
  overflow-wrap: break-word;
}

/* Si no caben nombre y estados en una línea, los estados bajan. */
.mini-list .row-btn {
  flex-wrap: wrap;
}

@media (max-width: 519px) {
  .mini-list .row-btn {
    flex-wrap: wrap;
  }

  .mini-list .row-btn > .chips {
    flex-basis: 100%;
    padding-left: 64px;
  }

  .mini-list .row-btn > .mini-list__main:first-child + .chips {
    padding-left: 0;
  }
}

.mini-list__main i {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------------
   HOY
   --------------------------------------------------------------------- */
.today__lead {
  display: grid;
  gap: 16px;
}

.hello {
  margin: 4px 0 0;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  padding: 12px 12px 10px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--sh-1);
}

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

.metric b {
  display: block;
  margin-top: 2px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.funnel {
  margin-top: 16px;
}

.funnel__bar {
  display: flex;
  gap: 4px;
  height: 30px;
}

.funnel__bar span {
  display: grid;
  place-items: center;
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  animation: grow 0.6s var(--e-out) forwards;
  animation-delay: calc(var(--i) * 90ms);
}

@keyframes grow {
  to {
    width: max(var(--w), 44px);
  }
}

.funnel__bar [data-st="CONFIRMADA"] {
  background: var(--ink);
  color: var(--ivory);
}
.funnel__bar [data-st="PROGRAMADA"] {
  background: #f0cdd5;
  color: #6e2f3e;
}
.funnel__bar [data-st="ATENDIDA"] {
  background: repeating-linear-gradient(115deg, #f3ece2 0 6px, #e6d9c6 6px 9px);
  color: var(--st-aten-fg);
}
.funnel__bar [data-st="CANCELADA"] {
  background: var(--st-aten-bg);
  color: var(--st-aten-fg);
}

.funnel__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.funnel__keys span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
}

.funnel__keys [data-st="CONFIRMADA"]::before {
  background: var(--ink);
}
.funnel__keys [data-st="PROGRAMADA"]::before {
  background: #e3a8b6;
}
.funnel__keys [data-st="ATENDIDA"]::before {
  background: var(--gold);
}
.funnel__keys [data-st="CANCELADA"]::before {
  background: #c9c0b8;
}

.week-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 18px -6px 14px;
}

.week-strip__days {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.day-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 62px;
  padding: 8px 0 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  transition: background 0.2s;
}

.day-pill i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-2);
}

.day-pill b {
  font-size: 19px;
  font-weight: 600;
}

.day-pill u {
  display: flex;
  gap: 2px;
  height: 4px;
}

.day-pill u::before {
  content: "";
  width: calc(var(--n, 0) * 1px);
}

.day-pill u[data-n="1"],
.day-pill u[data-n="2"],
.day-pill u[data-n="3"] {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.day-pill u[data-n="2"] {
  width: 12px;
  border-radius: 3px;
}

.day-pill u[data-n="3"] {
  width: 18px;
  border-radius: 3px;
}

.day-pill[data-today="true"] b {
  color: var(--accent);
}

.day-pill[data-active="true"] {
  background: var(--ink);
}

.day-pill[data-active="true"] i {
  color: rgba(251, 247, 242, 0.7);
}

.day-pill[data-active="true"] b {
  color: var(--ivory);
}

.day-pill[data-active="true"] u {
  background: var(--rose-soft);
}

/* minmax(0, 1fr): sin esto una columna toma el ancho mínimo de su contenido
   (nombres largos sin cortar) y la página se desborda de lado en el iPhone. */
.today__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.today__grid > *,
.today__side > *,
.settings__grid > *,
.tl-body,
.wk__cols > * {
  min-width: 0;
}

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

.today__side .card + .card {
  margin-top: 0;
}

.focus-card {
  display: grid;
  gap: 4px;
  justify-items: start;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: var(--r-lg);
  background:
    radial-gradient(
      120% 90% at 100% 0%,
      rgba(178, 92, 112, 0.35),
      transparent 60%
    ),
    linear-gradient(158deg, #3a2f33, #2b2326 60%, #211a1c);
  color: var(--ivory);
  text-align: left;
  box-shadow: var(--sh-3);
}

.focus-card__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9c7cf;
}

.focus-card b {
  font-size: 28px;
  line-height: 1.1;
}

.focus-card > span:not(.focus-card__eyebrow):not(.chips) {
  color: rgba(251, 247, 242, 0.78);
  font-size: 14px;
  margin-bottom: 6px;
}

.feed__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 6px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  border-radius: var(--r-sm);
}

.feed li + li .feed__item {
  border-top: 1px solid rgba(251, 247, 242, 0.1);
}

.sheet .feed li + li .feed__item {
  border-top-color: var(--line);
}

.feed__ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: rgba(251, 247, 242, 0.12);
}

.sheet .feed__ico {
  background: var(--rose-mist);
  color: var(--accent);
}

.feed__item[data-kind="CANCELADA_POR_CLIENTA"] .feed__ico,
.feed__item[data-kind="AVISO_FALLIDO"] .feed__ico {
  color: #f1a9a9;
}

.sheet .feed__item[data-kind="CANCELADA_POR_CLIENTA"] .feed__ico {
  color: var(--st-canc-fg);
  background: var(--st-canc-bg);
}

.feed__item[data-kind="CONTACTO_SOLICITADO"] .feed__ico {
  color: #f3c592;
}

.sheet .feed__item[data-kind="CONTACTO_SOLICITADO"] .feed__ico {
  color: var(--st-cont-fg);
  background: var(--st-cont-bg);
}

.feed__item[data-kind="CONFIRMADA_POR_CLIENTA"] .feed__ico {
  color: #9fd8bd;
}

.sheet .feed__item[data-kind="CONFIRMADA_POR_CLIENTA"] .feed__ico {
  color: var(--st-conf-fg);
  background: var(--st-conf-bg);
}

.feed__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.feed__text b {
  font-weight: 600;
}

.feed__text i {
  font-style: normal;
  font-size: 13px;
  opacity: 0.75;
}

.feed__item time {
  font-size: 11.5px;
  opacity: 0.6;
  white-space: nowrap;
}

.feed__item[data-unread="true"] b::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent-hi);
  vertical-align: 2px;
}

.feed-empty {
  margin: 0;
  font-size: 14px;
}

.cancelled {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.cancelled summary {
  cursor: pointer;
  padding: 8px 4px;
  font-weight: 600;
  color: var(--ink-2);
}

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

/* ---------------------------------------------------------------------
   Línea de tiempo (tarjetas por hora y duración reales)
   --------------------------------------------------------------------- */
.tl {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
}

.tl-hours {
  position: relative;
}

.tl-hours span {
  position: absolute;
  right: 10px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

.tl-body,
.wk__cols {
  position: relative;
}

.tl-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tl-lines i {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}

.tl-lines i[data-half="true"] {
  border-top-style: dashed;
  border-top-color: rgba(43, 35, 38, 0.05);
}

.tl-col {
  position: relative;
  border-radius: 14px;
  background: repeating-linear-gradient(
    115deg,
    rgba(239, 227, 211, 0.18) 0 6px,
    rgba(239, 227, 211, 0.42) 6px 8px
  );
}

.tl-open {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  cursor: copy;
}

.tl-card {
  position: absolute;
  left: 6px;
  right: 6px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  overflow: hidden;
  padding: 8px 12px 8px 14px;
  border: 0;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  box-shadow:
    var(--sh-1),
    0 6px 14px -10px rgba(90, 50, 60, 0.35);
  transition:
    transform 0.2s var(--e-out),
    box-shadow 0.2s var(--e-out);
}

.tl-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--bar, var(--ink-3));
}

.tl-card[data-st="PROGRAMADA"] {
  background: #f6f8fc;
  --bar: #7d93bd;
}

.tl-card[data-st="CONFIRMADA"] {
  background: #f1f8f4;
  --bar: #4f9a78;
}

.tl-card[data-st="ATENDIDA"] {
  background: #f6f3ef;
  --bar: var(--gold);
  color: var(--st-aten-fg);
}

.tl-card[data-contact="true"] {
  outline: 2px dashed #e1a96d;
  outline-offset: -2px;
}

.tl-card[data-focus="true"] {
  background: linear-gradient(158deg, #3a2f33, #2b2326);
  color: var(--ivory);
  --bar: var(--accent-hi);
  box-shadow: var(--sh-3);
}

.tl-card__time {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-card__inline {
  font-weight: 600;
}

.tl-card__name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-card__svc {
  font-size: 12.5px;
  opacity: 0.8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-card__st {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.75;
}

.tl-card__st {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-card--dense {
  left: 3px;
  right: 3px;
  padding: 6px 8px 6px 11px;
  border-radius: 12px;
}

.tl-card--dense .tl-card__name {
  font-size: 17px;
}

.tl-card--dense .tl-card__svc {
  font-size: 11.5px;
}

.tl-card--dense .tl-card__st {
  font-size: 10px;
  letter-spacing: 0;
}

.tl-card[data-size="xs"] {
  flex-direction: row;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

@media (hover: hover) {
  .tl-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--sh-2);
  }
}

.tl-now {
  position: absolute;
  left: -6px;
  right: 0;
  z-index: 2;
  height: 0;
  border-top: 2px solid var(--accent);
  pointer-events: none;
}

.tl-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(158, 74, 92, 0.18);
}

.tl-col--compact .tl-card {
  left: 2px;
  right: 2px;
  padding: 4px 4px 4px 7px;
  border-radius: 9px;
}

.tl-col--compact .tl-card::before {
  width: 3px;
}

.tl-col--compact .tl-card__time {
  font-size: 10.5px;
}

.tl-col--compact .tl-card__name {
  font-family: var(--sans);
  font-size: 11px;
}

/* ---------------------------------------------------------------------
   CALENDARIO
   --------------------------------------------------------------------- */
.cal__head {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.cal__title h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.05;
}

.cal__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cal__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
}

.seg__mark {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--ink);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seg__btn {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.2s;
}

.seg__btn[data-active="true"] {
  color: var(--ivory);
}

.wk {
  padding: 14px 10px 18px;
  overflow: visible;
}

.wk__days {
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 8px;
}

.wk__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 48px;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: none;
}

.wk__day i {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-2);
}

.wk__day b {
  font-size: 16px;
  font-weight: 600;
}

.wk__day[data-today="true"] {
  background: var(--ink);
}

.wk__day[data-today="true"] i {
  color: rgba(251, 247, 242, 0.7);
}

.wk__day[data-today="true"] b {
  color: var(--ivory);
}

.wk__grid {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
}

.wk__grid .tl-hours span {
  right: 6px;
  font-size: 10px;
}

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

.wk__scroll {
  max-height: none;
}

/* iPhone: semana con columnas legibles y desplazamiento lateral. La columna de
   horas y la esquina quedan fijas a la izquierda mientras se desplaza. */
@media (max-width: 759px) {
  .wk {
    padding: 12px 0 18px;
  }

  .wk__scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0 10px 6px 0;
  }

  .wk__days,
  .wk__grid {
    width: calc(48px + 7 * 122px);
  }

  .wk__days {
    grid-template-columns: 48px repeat(7, minmax(0, 1fr));
  }

  .wk__grid {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .wk__day {
    scroll-snap-align: start;
    scroll-margin-left: 52px;
  }

  .wk__corner,
  .wk__grid .tl-hours {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--card);
  }
}

.pop {
  position: absolute;
  right: 14px;
  bottom: -26px;
  z-index: 5;
  width: min(300px, calc(100% - 28px));
  padding: 16px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(
      120% 90% at 100% 0%,
      rgba(178, 92, 112, 0.4),
      transparent 60%
    ),
    linear-gradient(158deg, #3a2f33, #2b2326 60%, #211a1c);
  color: var(--ivory);
  box-shadow: 0 20px 40px -14px rgba(43, 35, 38, 0.55);
  transition:
    width 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    height 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    padding 0.28s,
    border-radius 0.28s;
}

.pop[data-open="false"] {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.pop[data-open="false"] .pop__body {
  opacity: 0;
  visibility: hidden;
}

.pop__toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.pop[data-open="false"] .pop__toggle {
  inset: 0;
  width: 48px;
  height: 48px;
  background: transparent;
}

.pop__body {
  display: grid;
  gap: 3px;
  transition: opacity 0.2s;
}

.pop__eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9c7cf;
}

.pop__body b {
  font-size: 24px;
  line-height: 1.1;
  padding-right: 36px;
}

.pop__meta {
  font-size: 13.5px;
  color: rgba(251, 247, 242, 0.75);
}

.pop__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.pop__go {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--ink);
}

.mo {
  padding: 10px;
}

.mo__head,
.mo__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.mo__head span {
  padding: 6px 0;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.mo__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 6px 2px;
  border: 0;
  border-radius: 14px;
  background: rgba(251, 247, 242, 0.6);
  text-align: left;
}

.mo__cell b {
  font-size: 15px;
  font-weight: 600;
}

.mo__cell[data-out="true"] {
  opacity: 0.4;
}

.mo__cell[data-closed="true"] {
  background: repeating-linear-gradient(
    115deg,
    rgba(239, 227, 211, 0.25) 0 6px,
    rgba(239, 227, 211, 0.5) 6px 8px
  );
}

.mo__cell[data-today="true"] b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ivory);
}

.mo__items {
  display: none;
}

.mo__dot {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------------------------------------------------------------------
   Detalle
   --------------------------------------------------------------------- */
.detail {
  display: grid;
  gap: 12px;
}

.detail__name {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.detail__svc {
  margin: -6px 0 0;
  color: var(--ink-2);
}

.detail__when {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--rose-mist), #f7efe4);
}

.detail__when .ico {
  color: var(--accent);
}

.detail__when div {
  display: flex;
  flex-direction: column;
}

.detail__when b {
  font-size: 17px;
}

.detail__notes {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ivory);
  border: 1px solid var(--line);
  white-space: pre-wrap;
}

.detail__section {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail__section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--champ-dark);
}

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

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.actions .btn--primary {
  grid-column: 1 / -1;
  min-height: 52px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.outbox {
  padding: 12px 0;
}

.outbox + .outbox {
  border-top: 1px dashed var(--line-2);
}

.outbox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.outbox__st {
  font-size: 12.5px;
  color: var(--ink-2);
}

.outbox[data-st="FALLIDO"] .outbox__st {
  color: var(--st-canc-fg);
  font-weight: 600;
}

.bubble {
  position: relative;
  margin: 8px 0 0;
  padding: 10px 12px;
  max-width: 46ch;
  border-radius: 14px 14px 14px 4px;
  background: #e9f6ec;
  font-size: 14px;
  color: #23332a;
}

.outbox[data-st="OMITIDO"] .bubble {
  opacity: 0.55;
}

.link-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.history li {
  position: relative;
  display: grid;
  padding: 0 0 12px 18px;
}

.history li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.history li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--line-2);
}

.history li:last-child::after {
  display: none;
}

.history span,
.history i {
  font-size: 13px;
  color: var(--ink-2);
  font-style: normal;
}

/* ---------------------------------------------------------------------
   Hojas
   --------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(43, 35, 38, 0.3);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease-out;
}

.sheet-backdrop[data-state="out"] {
  animation: fade 0.2s ease-in reverse forwards;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 92dvh;
  border-radius: 28px 28px 0 0;
  background: var(--ivory);
  box-shadow: 0 -20px 50px -20px rgba(43, 35, 38, 0.4);
  animation: rise 0.32s var(--e-out);
}

.sheet-backdrop[data-state="out"] .sheet {
  animation: rise 0.22s ease-in reverse forwards;
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
}

.sheet__grip {
  width: 40px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--line-2);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 0 20px;
}

.sheet__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.sheet__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(24px + var(--safe-b));
}

/* ---------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------- */
.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--champ-dark);
}

.field__hint {
  font-size: 12.5px;
  color: var(--ink-2);
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  font-size: 16px; /* 16px evita el zoom automático de iOS */
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(158, 74, 92, 0.14);
}

textarea.input {
  min-height: 80px;
  resize: vertical;
}

.input--time {
  width: auto;
  min-width: 118px;
}

.input--search {
  margin-bottom: 12px;
}

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--st-canc-bg);
  color: var(--st-canc-fg);
  font-weight: 600;
}

.form__foot {
  position: sticky;
  bottom: calc(-24px - var(--safe-b));
  margin: 0 -20px calc(-24px - var(--safe-b));
  padding: 12px 20px calc(16px + var(--safe-b));
  background: linear-gradient(to top, var(--ivory) 70%, rgba(251, 247, 242, 0));
}

.lead {
  margin: 0;
  font-weight: 600;
}

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

.chip {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}

.chip__stack {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.chip__stack i {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

.chip[data-active="true"] {
  --lg-tint: rgba(43, 35, 38, 0.94);
  --lg-rim: rgba(255, 255, 255, 0.5);
  background: var(--ink);
  color: var(--ivory);
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.slot {
  min-height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.slot[data-active="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ivory);
}

.manual-time {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.manual-time .input {
  width: auto;
  min-width: 130px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stepper b {
  min-width: 96px;
  text-align: center;
  font-size: 17px;
}

.date-chooser {
  display: grid;
  gap: 10px;
}

.customer-picker {
  display: grid;
  gap: 10px;
}

.suggest {
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggest:empty {
  display: none;
}

.new-customer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--rose-mist);
}

.chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line-2);
}

.chosen > span:nth-child(2),
.row-btn > span:nth-child(2):not(.mini-list__main) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chosen i,
.row-btn i {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-soft), var(--champagne));
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
}

.money-input .input {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 500;
}

.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  margin: 0;
  border-radius: 999px;
  background: #e2d8cf;
  transition: background 0.2s;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(43, 35, 38, 0.2);
  transition: transform 0.22s var(--e-out);
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::after {
  transform: translateX(20px);
}

/* ---------------------------------------------------------------------
   Clientas y ajustes
   --------------------------------------------------------------------- */
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page__head h1 {
  margin: 2px 0 0;
  font-size: clamp(32px, 8vw, 44px);
  line-height: 1;
}

.person {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  text-align: left;
}

@media (hover: hover) {
  button.person:hover {
    background: var(--rose-mist);
  }
}

.person__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.person__main b {
  font-weight: 600;
}

.person__main i {
  font-style: normal;
  font-size: 13.5px;
  color: var(--ink-2);
}

.person--static {
  padding: 0;
}

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

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

.settings__grid .card + .card {
  margin-top: 0;
}

.settings .card > .btn {
  margin-top: 12px;
}

.svc-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--rose-mist);
  color: var(--accent);
}

.row-btn[data-inactive="true"] {
  opacity: 0.55;
}

.hours-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.hours-row .switch {
  min-width: 140px;
  flex: 1;
}

.steps {
  counter-reset: s;
  display: grid;
  gap: 10px;
}

.steps li {
  counter-increment: s;
  position: relative;
  padding-left: 38px;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.ok-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--st-conf-fg);
  font-weight: 600;
}

.evidence {
  margin-top: 12px;
}

.evidence summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 4px;
}

.table td {
  padding: 6px 4px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   Avisos flotantes
   --------------------------------------------------------------------- */
.toasts {
  position: fixed;
  top: calc(12px + var(--safe-t));
  left: 50%;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(43, 35, 38, 0.94);
  color: var(--ivory);
  font-weight: 500;
  box-shadow: var(--sh-3);
  pointer-events: auto;
  animation: drop 0.3s var(--e-out);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.toast--ok {
  border-left: 4px solid #8fd1b2;
}

.toast--bad {
  border-left: 4px solid #f0a3a3;
}

.toast[data-state="out"] {
  opacity: 0;
  transform: translateY(-8px);
}

.toast__action {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 600;
}

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

/* ---------------------------------------------------------------------
   Acceso
   --------------------------------------------------------------------- */
.login {
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  text-align: center;
}

.login h1 {
  margin: 8px 0 0;
  font-size: 44px;
}

.login p {
  margin: 0;
}

.login__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-deep));
  box-shadow: 0 14px 30px -10px rgba(158, 74, 92, 0.6);
}

.pin-dots {
  display: flex;
  gap: 14px;
  margin: 18px 0 6px;
}

.pin-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  transition:
    background 0.15s,
    transform 0.15s;
}

.pin-dots i[data-on="true"] {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.08);
}

.pin-dots.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-4px);
  }
}

.pin-status {
  min-height: 22px;
  color: var(--st-canc-fg);
  font-weight: 600;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px 22px;
  margin-top: 8px;
}

.pin-key {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   Tablet (≥ 760 px): navegación arriba, semana amplia.
   --------------------------------------------------------------------- */
@media (min-width: 760px) {
  :root {
    --gutter: 24px;
  }

  .app {
    padding-bottom: 32px;
  }

  .tabbar {
    display: none;
  }

  .topnav {
    display: inline-flex;
  }

  .only-wide {
    display: inline-flex;
  }

  .brand__name {
    font-size: 24px;
  }

  .sandbox-flag {
    left: auto;
    right: 20px;
    bottom: 18px;
    transform: none;
  }

  .today__lead {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .metrics {
    gap: 12px;
  }

  .metric {
    min-width: 128px;
  }

  .cal__head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .wk {
    padding: 18px 16px 30px;
  }

  .wk__days {
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  }

  .wk__grid {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .wk__cols,
  .wk__days {
    gap: 6px;
  }

  .mo__cell {
    min-height: 104px;
    align-items: stretch;
    padding: 8px;
  }

  .mo__cell b {
    align-self: flex-start;
  }

  .mo__items {
    display: grid;
    gap: 3px;
  }

  .mo__items i {
    display: block;
    padding: 2px 6px;
    border-radius: 6px;
    font-style: normal;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--st-prog-bg);
    color: var(--st-prog-fg);
  }

  .mo__items i[data-st="CONFIRMADA"] {
    background: var(--st-conf-bg);
    color: var(--st-conf-fg);
  }

  .mo__items i[data-st="ATENDIDA"] {
    background: var(--st-aten-bg);
    color: var(--st-aten-fg);
  }

  .mo__items em {
    font-style: normal;
    font-size: 11px;
    color: var(--ink-2);
  }

  .mo__dot {
    display: none;
  }

  .sheet-backdrop {
    align-items: stretch;
    justify-content: flex-end;
    padding: 16px;
  }

  .sheet {
    width: 480px;
    max-height: none;
    border-radius: var(--r-xl);
    animation-name: slide;
  }

  .sheet--wide {
    width: 620px;
  }

  .sheet-backdrop[data-state="out"] .sheet {
    animation-name: slide;
  }

  @keyframes slide {
    from {
      transform: translateX(110%);
    }
  }

  .sheet__grip {
    display: none;
  }

  .sheet__head {
    padding-top: 16px;
  }

  .settings__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .settings__grid .card--feature {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------------
   Escritorio (≥ 1080 px): el calendario es protagonista.
   --------------------------------------------------------------------- */
@media (min-width: 1080px) {
  :root {
    --gutter: 32px;
  }

  .today__grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .metric b {
    font-size: 36px;
  }

  .pop {
    right: -14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .funnel__bar span {
    width: max(var(--w), 44px);
  }
}

/* ---------------------------------------------------------------------
   Ajustes de la revisión visual móvil (PR #235, comentario 6096286085).
   --------------------------------------------------------------------- */

/* Nombres largos: dos líneas en tarjetas grandes y en la tarjeta flotante,
   nunca una tarjeta que tape media semana. */
.tl-card[data-size="md"] .tl-card__name,
.pop__body b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  overflow: hidden;
}

.pop__meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* En el teléfono el aviso de modo prueba vive en el detalle y en Ajustes:
   flotando sobre la barra tapaba citas. */
@media (max-width: 759px) {
  .sandbox-flag {
    display: none;
  }
}

/* iPhone SE y pantallas de 320 px: que las tres cifras quepan sin cortarse. */
@media (max-width: 359px) {
  .metric {
    padding: 10px 8px 8px;
  }

  .metric__label {
    font-size: 11px;
  }

  .metric__label .ico {
    display: none;
  }

  .metric b {
    font-size: 26px;
  }
}

/* Firma EGO: discreta, sin competir con la marca de Isabel. */
.app-foot {
  display: flex;
  justify-content: center;
  padding: 8px var(--gutter) 20px;
}

.ego-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  opacity: 0.85;
}

.ego-credit img {
  width: 20px;
  height: 20px;
}

.ego-credit b {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login .ego-credit {
  margin-top: 26px;
}
