/* ==========================================================================
   Tarjeta — sistema visual
   Estructura y disciplina tomadas de DESIGN.md (Apple):
   un solo acento racionado, cero sombras, radio 28, tracking negativo.
   El acento viene de ej1.png (dorado), no el azul de Apple.
   ========================================================================== */

:root {
  /* Lienzo y superficies — la elevacion es tonal, nunca sombra */
  --canvas:        #08080a;
  --surface-1:     #121213;
  --surface-2:     #1d1d1f;
  --surface-3:     #2a2a2c;
  --hairline:      rgba(134,134,139,.24);
  --hairline-soft: rgba(134,134,139,.12);

  /* Texto */
  --text:          #f5f5f7;
  --text-2:        #a1a1a6;
  --text-3:        #6e6e73;

  /* El acento, racionado: accion primaria y dato clave, nada mas */
  --gold:          #e3bd80;
  --gold-bright:   #f2d6a8;
  --gold-deep:     #b8925c;
  --on-gold:       #1a1408;

  /* Semanticos, con cuentagotas */
  --good:          #7ac79b;
  --alert:         #e08585;

  /* Tipografia */
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;

  --t-display:    34px;  --lh-display:    1.06;  --tr-display:    -.022em;
  --t-heading:    28px;  --lh-heading:    1.12;  --tr-heading:    -.016em;
  --t-subheading: 22px;  --lh-subheading: 1.20;  --tr-subheading: -.010em;
  --t-title:      17px;  --lh-title:      1.30;  --tr-title:      -.012em;
  --t-body:       16px;  --lh-body:       1.47;  --tr-body:       -.011em;
  --t-caption:    13px;  --lh-caption:    1.35;  --tr-caption:    -.004em;
  --t-micro:      11px;  --lh-micro:      1.30;  --tr-micro:       .02em;

  /* Espaciado — escala unica */
  --s4:4px; --s8:8px; --s12:12px; --s16:16px; --s20:20px;
  --s24:24px; --s28:28px; --s32:32px; --s40:40px; --s48:48px; --s64:64px;

  --gutter: 20px;

  /* Radios — solo estos */
  --r-card: 28px;
  --r-tile: 18px;
  --r-field: 14px;
  --r-pill: 9999px;

  /* LA PERILLA DE LA LUZ.
     Sube o baja estos cuatro numeros y cambia la profundidad de todo el
     tablero. No hay que tocar ninguna regla suelta. */
  --filo:        rgba(255,255,255,.18);   /* el reflejo de arriba, tarjeta chica */
  --filo-fuerte: rgba(255,255,255,.28);   /* el de la tarjeta protagonista */
  --lustre:      rgba(255,255,255,.075);  /* el degradado que cae desde arriba */
  --halo:        .20;                     /* el aura del color del negocio */

  --nav-h: 64px;
  --ease: cubic-bezier(.32,.72,0,1);
}

/* --------------------------------------------------------------- base --- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, textarea, select { -webkit-appearance: none; appearance: none; }
a { color: var(--gold); text-decoration: none; }

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.num { font-variant-numeric: tabular-nums; }
.balance { text-wrap: balance; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.oculto { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ tipografia */
.display    { font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: 600; }
.heading    { font-size: var(--t-heading); line-height: var(--lh-heading); letter-spacing: var(--tr-heading); font-weight: 600; }
.subheading { font-size: var(--t-subheading); line-height: var(--lh-subheading); letter-spacing: var(--tr-subheading); font-weight: 600; }
.title      { font-size: var(--t-title); line-height: var(--lh-title); letter-spacing: var(--tr-title); font-weight: 600; }
.caption    { font-size: var(--t-caption); line-height: var(--lh-caption); letter-spacing: var(--tr-caption); color: var(--text-2); }
.micro      { font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; font-weight: 600; }
.dim        { color: var(--text-2); }
.dimmer     { color: var(--text-3); }
.oro        { color: var(--gold); }

/* --------------------------------------------------------------- shell --- */
#app { min-height: 100dvh; display: flex; flex-direction: column; }

.pantalla {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--s32));
  animation: entra .28s var(--ease) both;
}
.pantalla--sin-nav { padding-bottom: calc(env(safe-area-inset-bottom) + var(--s32)); }
.pantalla--con-acciones { padding-bottom: calc(84px + env(safe-area-inset-bottom) + var(--s24)); }

@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.cabecera {
  padding-top: calc(env(safe-area-inset-top) + var(--s24));
  padding-bottom: var(--s20);
}
.cabecera__fila { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s16); }
.cabecera .caption { margin-top: var(--s4); }

.volver {
  display: inline-flex; align-items: center; gap: var(--s4);
  color: var(--gold); font-size: var(--t-title); font-weight: 400;
  margin-bottom: var(--s12); margin-left: -4px; padding: 4px 4px 4px 0;
}
.volver svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------- nav --- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(18,18,19,.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--hairline-soft);
}
.nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .01em;
  transition: color .2s var(--ease);
}
.nav__item svg { width: 22px; height: 22px; }
.nav__item[aria-current="page"] { color: var(--gold); }

/* -------------------------------------------------------------- botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s8);
  min-height: 52px; padding: 0 var(--s24);
  border-radius: var(--r-pill);
  font-size: var(--t-title); font-weight: 600; letter-spacing: var(--tr-title);
  transition: transform .15s var(--ease), background-color .2s var(--ease), opacity .2s var(--ease);
}
.btn:active { transform: scale(.975); }
.btn--pri { background: var(--gold); color: var(--on-gold); }
.btn--pri:hover { background: var(--gold-bright); }
.btn--sec { background: var(--surface-3); color: var(--text); }
.btn--ghost { background: transparent; color: var(--gold); }
.btn--peligro { background: transparent; color: var(--alert); }
.btn--bloque { width: 100%; }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-chico {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 var(--s16);
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--text);
  font-size: var(--t-caption); font-weight: 600; letter-spacing: 0;
}
.btn-chico--oro { background: var(--gold); color: var(--on-gold); }
.btn-chico--alerta { color: var(--alert); }
.btn-chico svg { width: 16px; height: 16px; }

.acciones-fijas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: var(--s16) var(--gutter) calc(var(--s16) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--canvas) 62%, rgba(0,0,0,0));
  display: flex; gap: var(--s12);
}
.acciones-fijas .btn { flex: 1; }

/* --------------------------------------------------------------- cards --- */
.card {
  position: relative;
  border-radius: var(--r-card);
  padding: var(--s24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.012) 40%, rgba(255,255,255,0) 75%),
    var(--surface-2);
  border: 1px solid rgba(255,255,255,.055);
  border-top-color: var(--filo);
  box-shadow: inset 0 1px 0 var(--filo);
}
.card--plano { background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.01) 40%, rgba(255,255,255,0) 75%),
    var(--surface-1); }

.tile {
  background: var(--surface-2);
  border-radius: var(--r-tile);
  padding: var(--s16);
}

.lista { display: flex; flex-direction: column; gap: 2px; }
.lista__item {
  display: flex; align-items: center; gap: var(--s16);
  width: 100%; text-align: left;
  padding: var(--s16);
  background: var(--surface-1);
  transition: background-color .2s var(--ease);
}
.lista__item:first-child { border-radius: var(--r-tile) var(--r-tile) 4px 4px; }
.lista__item:last-child  { border-radius: 4px 4px var(--r-tile) var(--r-tile); }
.lista__item:only-child  { border-radius: var(--r-tile); }
.lista__item:active { background: var(--surface-2); }
.lista__cuerpo { flex: 1; min-width: 0; }
.lista__cuerpo .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista__meta { flex: none; text-align: right; }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--gold);
  font-size: var(--t-title); font-weight: 600; letter-spacing: 0;
}
.chevron { flex: none; width: 18px; height: 18px; color: var(--text-3); }

/* -------------------------------------------------------------- campos --- */
.campo { display: block; margin-bottom: var(--s20); }
.campo__label { display: block; margin-bottom: var(--s8); font-size: var(--t-caption); font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.campo__ayuda { margin-top: var(--s8); font-size: var(--t-caption); color: var(--text-3); }

.input, .textarea, .select {
  width: 100%; min-height: 52px; padding: 0 var(--s16);
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--r-field); color: var(--text);
  font-size: var(--t-title);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.textarea { min-height: 96px; padding: var(--s12) var(--s16); line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--gold); background: var(--surface-1); }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
  padding-right: var(--s40);
}

.input-dinero { position: relative; }
.input-dinero .input { padding-left: var(--s32); font-size: var(--t-subheading); font-weight: 600; }
.input-dinero__signo {
  position: absolute; left: var(--s16); top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: var(--t-subheading); font-weight: 600; pointer-events: none;
}

/* El porcentaje se lee despues del numero, no antes. */
.input-dinero--pct .input { padding-left: var(--s16); padding-right: var(--s40); }
.input-dinero--pct .input-dinero__signo { left: auto; right: var(--s16); }

.switch-fila {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s16);
  padding: var(--s16); background: var(--surface-2); border-radius: var(--r-field);
}
.switch-fila + .switch-fila { margin-top: var(--s8); }

.switch { position: relative; flex: none; width: 52px; height: 31px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch__pista {
  position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3);
  transition: background-color .22s var(--ease);
}
.switch__pista::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: var(--r-pill); background: #fff;
  transition: transform .22s var(--ease);
}
.switch input:checked + .switch__pista { background: var(--gold); }
.switch input:checked + .switch__pista::after { transform: translateX(21px); }

.segmentado {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: var(--r-pill);
}
.segmentado button {
  flex: 1; min-height: 38px; border-radius: var(--r-pill);
  font-size: var(--t-caption); font-weight: 600; color: var(--text-2); letter-spacing: 0;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.segmentado button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

/* --------------------------------------------------------- tarjeta card --- */
.tarjeta {
  position: relative; overflow: hidden;
  border-radius: var(--r-card);
  padding: var(--s24) var(--s20) var(--s20);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(227,189,128,.10), transparent 62%),
    var(--surface-2);
  border: 1px solid var(--hairline-soft);
}
.tarjeta__marca {
  font-family: var(--serif);
  font-size: var(--t-caption); letter-spacing: .20em; text-transform: uppercase;
  color: var(--gold); text-align: center;
}
.tarjeta__servicio {
  margin-top: var(--s4); text-align: center;
  font-size: var(--t-subheading); font-weight: 600; letter-spacing: var(--tr-subheading);
}
.tarjeta__progreso { margin-top: 2px; text-align: center; font-size: var(--t-caption); color: var(--text-2); }

.sellos {
  margin: var(--s20) 0 var(--s16);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s12) var(--s8);
  justify-items: center;
}
.sellos--densa { grid-template-columns: repeat(6, 1fr); }

.sello {
  position: relative; width: 100%; aspect-ratio: 1; max-width: 52px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  color: var(--text-3);
  font-size: var(--t-caption); font-weight: 600; letter-spacing: 0;
  transition: transform .2s var(--ease);
}
.sello--premio { border-color: var(--gold-deep); color: var(--gold); border-style: dashed; }
.sello--lleno {
  background: var(--gold); border-color: var(--gold); color: var(--on-gold);
  border-style: solid;
}
.sello--lleno.sello--premio { background: var(--gold-bright); }
.sello--siguiente { border-color: var(--text-2); color: var(--text-2); }
.sello__glifo { font-size: 20px; line-height: 1; }
.sello--nuevo { animation: sella .45s var(--ease) both; }
@keyframes sella {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.14); opacity: 1; }
  100% { transform: scale(1); }
}

.tarjeta__pie {
  padding-top: var(--s16); border-top: 1px solid var(--hairline-soft);
  text-align: center; font-size: var(--t-caption); color: var(--text-2);
}
.tarjeta__pie strong { color: var(--gold); font-weight: 600; }

/* --------------------------------------------------------------- avisos --- */
.aviso {
  display: flex; gap: var(--s12); align-items: flex-start;
  padding: var(--s16); border-radius: var(--r-tile);
  background: var(--surface-2); font-size: var(--t-caption); color: var(--text-2);
}
.aviso svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.aviso--oro { background: rgba(227,189,128,.12); color: var(--gold-bright); }
.aviso--oro svg { color: var(--gold); }
.aviso--alerta { background: rgba(224,133,133,.12); color: #f0b4b4; }
.aviso--alerta svg { color: var(--alert); }
.aviso strong { color: var(--text); font-weight: 600; }
.aviso--oro strong { color: var(--gold-bright); }

/* ------------------------------------------------------------ dashboard --- */
/* PROFUNDIDAD SIN SOMBRAS.
   Lo que hace que algo se vea plano no es la falta de sombra, es la falta
   de luz. Aquí la luz viene de arriba, como en un cuarto real, y se arma
   con tres capas que no rompen el minimalismo:
     1. un filo blanco de 1px en el borde superior (el reflejo especular)
     2. un degradado interno que aclara la parte de arriba de la tarjeta
     3. un borde que se apaga hacia abajo, en vez de ser parejo
   Cero box-shadow hacia afuera: eso es lo que se ve barato. */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s8); }

.kpi {
  position: relative;
  border-radius: var(--r-tile);
  padding: var(--s16);
  background:
    linear-gradient(180deg, var(--lustre), rgba(255,255,255,.014) 38%, rgba(255,255,255,0) 72%),
    var(--surface-1);
  border: 1px solid rgba(255,255,255,.06);
  border-top-color: var(--filo);
  box-shadow: inset 0 1px 0 var(--filo);
}

/* La tarjeta grande es la protagonista: más luz y un halo del color
   del negocio, apenas perceptible, cayendo desde arriba. */
.kpi--ancho {
  grid-column: 1 / -1;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.022) 40%, rgba(255,255,255,0) 78%),
    var(--surface-2);
  border-top-color: var(--filo-fuerte);
  box-shadow: inset 0 1px 0 var(--filo-fuerte);
}
.kpi--ancho::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(130% 80% at 50% -28%,
              rgba(var(--gold-rgb), var(--halo)), rgba(var(--gold-rgb), 0) 62%);
  pointer-events: none;
}
.kpi--ancho > * { position: relative; z-index: 1; }
.kpi__label { font-size: var(--t-micro); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.kpi__valor { margin-top: var(--s8); font-size: var(--t-heading); line-height: 1.05; letter-spacing: var(--tr-heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi--ancho .kpi__valor { font-size: var(--t-display); }
.kpi__nota { margin-top: var(--s4); font-size: var(--t-caption); color: var(--text-2); }
.kpi__nota--sube { color: var(--good); }
.kpi__nota--baja { color: var(--alert); }

.barras { display: flex; flex-direction: column; gap: var(--s12); }
.barra__fila { display: flex; align-items: center; gap: var(--s12); }
.barra__nombre { flex: none; width: 92px; font-size: var(--t-caption); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra__pista { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.barra__valor { height: 100%; border-radius: var(--r-pill); background: var(--gold); }
.barra__cifra { flex: none; width: 46px; text-align: right; font-size: var(--t-caption); font-variant-numeric: tabular-nums; color: var(--text); }

.columnas { display: flex; align-items: flex-end; gap: var(--s8); height: 150px; }
.columna { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s8); height: 100%; }
.columna__valor { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--surface-3); min-height: 3px; }
.columna--activa .columna__valor { background: var(--gold); }
.columna__label { text-align: center; font-size: 10px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.ranking .avatar { font-size: var(--t-caption); }

/* --------------------------------------------------------------- varios --- */
.vacio { text-align: center; padding: var(--s48) var(--s24); }
.vacio__icono { width: 52px; height: 52px; margin: 0 auto var(--s16); color: var(--text-3); }
.vacio__icono svg { width: 100%; height: 100%; }

.buscador { position: relative; margin-bottom: var(--s16); }
.buscador .input { padding-left: var(--s48); border-radius: var(--r-pill); }
.buscador svg { position: absolute; left: var(--s16); top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-3); pointer-events: none; }

.pastilla {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px var(--s12); border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-2);
  font-size: var(--t-micro); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.pastilla--oro { background: rgba(227,189,128,.16); color: var(--gold); }
.pastilla--alerta { background: rgba(224,133,133,.16); color: #f0b4b4; }
.pastilla--media { background: rgba(224,164,88,.16); color: #edc089; }

/* Ticket: monoespaciada, porque las columnas tienen que cuadrar igual
   aquí que en el mensaje de WhatsApp. */
.ticket-vista {
  margin: 0; padding: var(--s16);
  background: var(--surface-2); border-radius: var(--r-field);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.55; letter-spacing: 0;
  color: var(--text); white-space: pre; overflow-x: auto;
}

.seccion { margin-top: var(--s32); }
.seccion__titulo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s12); margin-bottom: var(--s12); }

.divisor { height: 1px; background: var(--hairline-soft); margin: var(--s24) 0; border: 0; }

.fila-botones { display: flex; gap: var(--s8); flex-wrap: wrap; }

/* --------------------------------------------------------------- agenda --- */
.tira-dias {
  display: flex; gap: var(--s8);
  margin-bottom: var(--s20);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: var(--s4);
  -ms-overflow-style: none; scrollbar-width: none;
}
.tira-dias::-webkit-scrollbar { display: none; }

.dia {
  flex: none; scroll-snap-align: start;
  width: 54px; padding: var(--s12) 0 var(--s8);
  border-radius: var(--r-tile);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background:
    linear-gradient(180deg, var(--lustre), rgba(255,255,255,0) 70%),
    var(--surface-1);
  border: 1px solid rgba(255,255,255,.055);
  border-top-color: var(--filo);
  transition: background-color .2s var(--ease);
}
.dia em {
  font-style: normal; font-size: var(--t-micro); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
}
.dia strong {
  font-size: var(--t-subheading); font-weight: 600; letter-spacing: -.01em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
/* El puntito dice si ese día tiene algo, sin tener que abrirlo. */
.dia i { width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--gold); }
.dia i.vacia { background: transparent; }
.dia--hoy em { color: var(--gold); }
.dia--puesto { background: var(--gold); border-color: var(--gold); }
.dia--puesto em, .dia--puesto strong { color: var(--on-gold); }
.dia--puesto i { background: rgba(0,0,0,.35); }
.dia--puesto i.vacia { background: transparent; }

.citas { display: flex; flex-direction: column; gap: var(--s8); }

.cita {
  display: flex; align-items: flex-start; gap: var(--s16);
  padding: var(--s16);
  border-radius: var(--r-tile);
  background:
    linear-gradient(180deg, var(--lustre), rgba(255,255,255,0) 70%),
    var(--surface-1);
  border: 1px solid rgba(255,255,255,.055);
  border-top-color: var(--filo);
  border-left: 3px solid var(--gold);
}
.cita__hora {
  flex: none; width: 64px;
  display: flex; flex-direction: column; gap: 2px;
}
.cita__hora strong {
  font-size: var(--t-title); font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.cita__hora em {
  font-style: normal; font-size: var(--t-micro); color: var(--text-3);
  font-weight: 600; letter-spacing: .03em;
}
.cita__cuerpo { flex: 1; min-width: 0; }
.cita__acciones { flex: none; display: flex; flex-direction: column; gap: var(--s8); }

.cita--atendida { border-left-color: var(--good); opacity: .72; }
.cita--cancelada { border-left-color: var(--text-3); opacity: .5; }
.cita--cancelada .cita__cuerpo .title { text-decoration: line-through; }
.cita--choque { border-left-color: var(--alert); }

/* ---------------------------------------------------- marca del negocio --- */
.marca-logo { flex: none; border-radius: var(--r-tile); }
/* Solo la imagen se vuelve bloque: si esto le pega al avatar de iniciales,
   le mata el grid y las letras se van a la esquina. */
img.marca-logo { display: block; object-fit: cover; background: var(--surface-2); }
.cabecera__marca { flex: none; }

.logo-fila { display: flex; align-items: center; gap: var(--s16); }

/* Los seis acentos curados. No hay selector libre a proposito. */
.acentos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s8); }
.acento {
  display: flex; flex-direction: column; align-items: center; gap: var(--s8);
  padding: var(--s12) var(--s4);
  border-radius: var(--r-tile); background: var(--surface-2);
  transition: background-color .2s var(--ease);
}
.acento span {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--muestra);
  box-sizing: border-box; border: 2px solid transparent;
  transition: box-shadow .2s var(--ease);
}
.acento em {
  font-style: normal; font-size: var(--t-micro); font-weight: 600;
  letter-spacing: .01em; color: var(--text-3); text-align: center;
}
.acento--puesto { background: var(--surface-3); }
.acento--puesto span { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--muestra); }
.acento--puesto em { color: var(--text); }

/* --------------------------------------------------------------- modal --- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fundido .2s var(--ease) both;
}
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }
.modal__panel {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface-1);
  border-radius: var(--r-card) var(--r-card) 0 0;
  padding: var(--s16) var(--gutter) calc(var(--s24) + env(safe-area-inset-bottom));
  animation: sube .3s var(--ease) both;
}
@keyframes sube { from { transform: translateY(100%); } to { transform: none; } }
.modal__agarre { width: 36px; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); margin: 0 auto var(--s20); }

/* --------------------------------------------------------------- toast --- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--s16));
  transform: translateX(-50%); z-index: 80;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: var(--s12) var(--s20); border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text);
  font-size: var(--t-caption); font-weight: 600; letter-spacing: 0;
  text-align: center;
  animation: toast-in .3s var(--ease) both;
}
.toast--oro { background: var(--gold); color: var(--on-gold); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --------------------------------------------------------------- clave --- */
.clave-pantalla {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s32);
  padding: var(--s32) var(--gutter);
  text-align: center;
}
.clave-marca { font-family: var(--serif); font-size: var(--t-caption); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
/* La marca de HelloSophia, antes de entrar. Va en blanco a proposito:
   no toma el acento del negocio porque no es del negocio. */
.clave-logo { width: 78px; height: auto; display: block; margin: 0 auto; }
.clave-puntos { display: flex; gap: var(--s16); }
.clave-punto {
  width: 14px; height: 14px; border-radius: var(--r-pill);
  border: 1px solid var(--text-3); transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.clave-punto--lleno { background: var(--gold); border-color: var(--gold); }
.clave-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s16); width: 100%; max-width: 288px; }
.tecla {
  aspect-ratio: 1; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text);
  font-size: var(--t-heading); font-weight: 400; letter-spacing: 0;
  display: grid; place-items: center;
  transition: background-color .12s var(--ease), transform .12s var(--ease);
}
.tecla:active { background: var(--surface-3); transform: scale(.94); }
.tecla--vacia { background: none; pointer-events: none; }
.tecla--accion { background: none; font-size: var(--t-body); color: var(--gold); }
.sacude { animation: sacude .4s var(--ease) both; }
@keyframes sacude {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .pantalla { max-width: 640px; margin: 0 auto; width: 100%; }
  .nav { max-width: 640px; left: 50%; transform: translateX(-50%); }
  .acciones-fijas { max-width: 640px; left: 50%; transform: translateX(-50%); }
}
