/* =====================================================================
   MiesApp — COMPONENTES
   Cada pieza reutilizable de la UI: botones, formularios, cards, listas,
   pills, tabs, chat, overlays. Mismo rol visual = misma clase.
   Los constructores de estas piezas viven en js/ui.js (nada de estilos
   inline en el JS: si algo necesita estilo, se le hace una clase acá).
   ===================================================================== */

/* ---- Botones ----
   Cinco roles: primario (.appbtn), secundario (.ghostbtn), peligro (.dangerbtn),
   link de texto (.btn-link) y "sobre acento" (.btn-on, en estilob). Dos tamaños:
   md (52px, el default, igual que los inputs) y .btn-sm (40px, ancho al contenido). */
.appbtn {
  width: 100%;
  min-height: 52px;
  border-radius: var(--rad);
  border: none;
  background: var(--acento, var(--primary));   /* usa el color de marca */
  color: #ffffff;
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.appbtn:active   { transform: scale(.98); }
.appbtn:disabled { opacity: .5; }

.ghostbtn {
  width: 100%;
  min-height: 52px;
  border-radius: var(--rad);
  border: 1px solid var(--border2);
  background: none;
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ghostbtn:active { transform: scale(.98); }

.dangerbtn {
  width: 100%;
  min-height: 52px;
  border-radius: var(--rad);
  border: 1px solid var(--badbg);
  background: var(--badbg);
  color: var(--bad);
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Tamaño chico: ancho al contenido (Subir/Cambiar/Copiar, CTA del welcome, empty states). */
.btn-sm, .empty-btn { width: auto; min-height: 40px; padding: 0 16px; font-size: var(--fs-md); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* Link de texto (acción secundaria sin caja). .bad = rojo. */
.btn-link, .fac-link, .plan-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 10px 2px;
  border: none; background: none; font: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--mies); cursor: pointer; text-align: left;
}
.btn-link .ico, .fac-link .ico { width: 17px; height: 17px; }
.btn-link.bad, .fac-link.bad, .plan-link.bad { color: var(--bad); }
.btn-link:active, .fac-link:active, .plan-link:active { opacity: .6; }
/* Link inline dentro de un párrafo (subrayado). */
.lnk, .cfg-inline-link, .rc-aviso-link { display: inline; padding: 0; border: none; background: none; font: inherit; font-weight: 600; color: var(--mies); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---- Opción (.opt) — ÚNICA fila de "menú de opciones" ----
   La usan los wizards (¿de quién?, ¿cómo pagó?), los estados de sesión, los
   sheets (+ de Dinero, Avisar) y la página de Configuración.
   Suelta = caja con borde y aire (wizards). Dentro de .opt-list = lista agrupada
   con divisores, sin borde (sheets, Configuración). */
.opt {
  width: 100%;
  min-height: 52px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin: 0 0 8px;
  border: 1px solid var(--border2);
  border-radius: var(--rad);
  background: var(--bg);
  color: var(--text);
  font-family: inherit; font-size: var(--fs-lg); font-weight: 500;
  text-align: left; cursor: pointer;
}
.opt:active { background: var(--surf); }
/* Ícono de fila: SOLO el ícono, sin círculo de fondo. Gris neutro por defecto; color fuerte únicamente cuando significa algo. */
.opt-ic { flex: 0 0 auto; width: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--sec); }
.opt-ic .ico { width: 22px; height: 22px; }
.opt-ic.ok   { color: var(--ok); }
.opt-ic.bad  { color: var(--bad); }
.opt-ic.mut  { color: var(--sec); }
.opt-ic.warn { color: var(--warn); }
.opt-ic.mies { color: var(--mies); }
.opt-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-t  { font-weight: 600; }
.opt-s  { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.opt-chev { flex: 0 0 auto; color: var(--muted); display: inline-flex; }
.opt .debe { margin-left: auto; font-size: var(--fs-sm); color: var(--bad); }
.opt-hi { color: var(--mies); }
.opt-hi .opt-ic { color: var(--mies); }
.opt-list { display: flex; flex-direction: column; }
.opt-list .opt { border: none; border-radius: 0; border-bottom: 1px solid var(--border); margin: 0; padding: 12px 4px; background: none; }
.opt-list .opt:last-child { border-bottom: none; }
.opt-list .opt-t { font-weight: 500; }
/* En lista el ícono es más chico y, si es neutro, sin círculo gris (solo los tintados lo conservan). */
.opt-list .opt-ic { width: 32px; height: 32px; }
.opt-list .opt-ic:not(.ok):not(.bad):not(.warn):not(.mies) { background: none; }
/* Dentro de un sheet: el primer ítem arranca pegado a la línea del título. */
.sheet-body > .opt-list:first-child { margin-top: -14px; }

/* ---- Interruptor (.tgl) — prender/apagar un ajuste que se lee solo (Configuración > Reservas).
   <button class="tgl on" role="switch" aria-checked="true"><span></span></button> */
.tgl { position: relative; flex: 0 0 auto; width: 48px; height: 28px; padding: 0; border: none; border-radius: 14px;
  background: var(--border2); cursor: pointer; transition: background-color .2s ease; }
.tgl span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.34, 1.3, .64, 1); }
.tgl.on { background: var(--mies); }
.tgl.on span { transform: translateX(20px); }

/* ---- Formularios ---- */
.fld { margin: 0 0 14px; }
.fld label { display: block; font-size: var(--fs-sm); color: var(--sec); margin: 0 0 6px; font-weight: 500; }

.seg { display: flex; gap: 6px; }
.seg button, .chip {
  height: 46px;
  border-radius: var(--rad-sm);
  border: 1px solid var(--border2);
  background: none;
  font-size: var(--fs-md);
  cursor: pointer;
  color: var(--sec);
  font-family: inherit;
  font-weight: 500;
}
.seg button { flex: 1; }
.chip { flex: 1; min-width: 0; }
.seg button.sel, .chip.sel { background: var(--sec); color: #fff; border-color: var(--sec); }

/* ---- Bloques de datos (clave/valor, hint) ---- */
.kv { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.kv + .kv { margin-top: 5px; }
.kv .k { color: var(--sec); }
.kv .v { font-weight: 600; text-align: right; }
.hint { background: var(--accbg); color: var(--acc); padding: 12px; border-radius: var(--rad-sm); font-size: var(--fs-sm); line-height: 1.4; margin-bottom: 14px; font-weight: 500; }

/* ---- Cards ---- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--rad-lg); padding: 13px 16px; margin-bottom: 10px; }

/* ---- Pills / estados ---- */
/* Estado en una lista (Debe / A favor / Al día / Borrador…): solo texto con color fuerte, sin pastilla de fondo lavado
   (mismo criterio que los montos de Dinero y los íconos). */
.pill { font-size: var(--fs-sm); padding: 0; border-radius: 0; flex-shrink: 0; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-bad { color: var(--bad); }
.p-ok  { color: var(--ok); }
.p-neu { color: var(--sec); }
.p-warn{ color: var(--warnfg); }   /* ámbar (texto) */

/* Colores de texto sueltos. Reemplazan a los `elemento.style.color = …`
   que el JS de FlorApp escribía a mano (ej. el color del CC en la ficha):
   ahora se togglea una clase, nunca un estilo inline. */
.t-ok  { color: var(--ok); }
.t-bad { color: var(--bad); }
.t-sec { color: var(--sec); }
.t-mut { color: var(--muted); }   /* mismo gris que el subtítulo de Dinero (.row-s) */
.t-warn{ color: var(--warn); }   /* igual que .ic-warn, para que icono y label matcheen */
.t-acc { color: var(--acc); }
/* Estados del login (Enviando…, Verificando…, etc.): en azul mies, no verde. */
.auth-msg.t-ok { color: var(--mies); }

/* ---- Etiqueta de modalidad (Virtual) en filas de agenda ---- */
.mod-tag {
  display: inline-block; vertical-align: middle; margin-left: 5px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  padding: 0 8px; border-radius: var(--rad-round);
  color: var(--acento); background-color: color-mix(in srgb, var(--acento) 15%, transparent);
}

/* ---- Avatar ---- */
.avat {
  width: 40px;
  height: 40px;
  border-radius: var(--rad-round);
  background-color: color-mix(in srgb, var(--acento) 15%, transparent);
  color: var(--acento);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: bold;
  flex-shrink: 0;
}

/* ---- Fila (.row) — ÚNICA fila plana de lista ----
   Pacientes, Dinero, Deudas y Agenda del inicio, Recibos, Facturar.
   [lead: avatar | fecha (.row-k) | ícono] [main: título + sub] [trail: valor | pill | chevrón] */
.row {
  width: 100%;
  min-height: var(--row-h);
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px;
  border: none; border-bottom: 1px solid var(--border);
  background: none; color: var(--text);
  font-family: inherit; text-align: left; cursor: pointer;
}
.row:last-child { border-bottom: none; }   /* el último no lleva la línea (queda "colgando") */
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-t { margin: 0; font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-s { margin: 0; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-t .row-s { display: inline; margin-left: 4px; font-weight: 400; }   /* subtítulo en la misma línea (Dinero) */
.row-k { flex: 0 0 58px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.row-v { flex: 0 0 auto; font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-v.hoy { color: var(--mies); }
.row-chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
/* Pacientes inactivos: al final de la lista, en gris; se tocan para reactivar. */
.row-dim .avat, .row-dim .row-t, .row-dim .row-s { opacity: .5; }
.past { opacity: .65; }

/* Agenda del inicio: la fecha una vez a la izquierda (gris, mayúsculas) y las
   sesiones de ese día como filas compactas a la derecha. */
.hg { display: flex; gap: 14px; padding: 4px 0; }
.hg + .hg { border-top: 1px solid var(--border); }
.hg:last-child { padding-bottom: 0; }
.hg-day { flex: 0 0 auto; width: 78px; padding-top: 14px; font-size: var(--fs-xs); font-weight: 600;
          text-transform: uppercase; color: var(--sec); }
.hg-ses { flex: 1; min-width: 0; }
.hg-ses .row { padding: 6px 0; border-bottom: none; }
.hg-ses .row-t { font-size: var(--fs-md); }
.hg-ses .row-v { font-size: var(--fs-sm); color: var(--sec); }
.hg-ses .row-v.hoy { color: var(--mies); }
/* Mobile: filas del mismo día más juntas (40 → 36 px de alto; WCAG 2.5.8 pide ≥24). */
@media (max-width: 767px) {
  .hg-ses .row { min-height: 36px; padding: 4px 0; }
}

/* Botón de facturado: ícono plano, mismo criterio que .ses-ic (sin círculo ni fondo lavado).
   Gris = sin facturar; verde = facturada. */
.fses-fac { flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.fses-fac .ico { width: 22px; height: 22px; }
.fses-fac.on { color: var(--ok); }
.fses-fac:active { transform: scale(.94); }

/* ---- Ficha v2: tarjeta CC con botón, próxima sesión ---- (el título con subtítulo es .htit) */
.ficha-cc-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; margin-bottom: 10px; }
/* Línea divisoria full-bleed debajo del bloque de Cuenta corriente (como los head),
   con aire arriba y abajo parejo (~11px), igual que el padding de otros head (Caja). */
.ficha-cc-card::after { content: ''; position: absolute; left: calc(-1 * var(--scr-x)); right: calc(-1 * var(--scr-x)); bottom: -10px; height: 1px; background: var(--border); }
.ficha-cc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ficha-cc-info .k { color: var(--muted); font-size: var(--fs-sm); }
.ficha-cc-val { font-size: var(--fs-2xl); font-weight: 700; white-space: nowrap; }
.ficha-cc-btn { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ficha-cc-btn .ico { width: 22px; height: 22px; }
.ficha-cc-btn:active { transform: scale(.95); }
.ficha-cc-btn[hidden] { display: none; }

/* ---- Card de sesión (.ses) — ÚNICA para Agenda y Ficha (UI.sesCard) ----
   [fecha: Hoy/Mañana/Dow · dd/mm · hora]  [card: ícono de estado | título + sub | valor + acción] */
.cta-mes { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; margin: 14px 2px 8px; }
#ficha-cta-list .cta-mes:first-child { margin-top: 0; }
.cta-mes:first-child { margin-top: 2px; }
.ses { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.ses-date { flex: 0 0 auto; width: 46px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ses-dow  { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.ses-dm   { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; text-transform: uppercase; }   /* mismo formato que el mes (DICIEMBRE 2026) */
.ses-hora { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ses-card { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--rad-lg); cursor: pointer; background: var(--bg); }
/* Ícono de estado de la sesión: solo el ícono (sin círculo lavado); color fuerte según el estado. */
.ses-ic { flex: 0 0 auto; width: 26px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.ses-ic .ico { width: 22px; height: 22px; }
.ses-ic.ic-ok   { color: var(--ok); }
.ses-ic.ic-bad  { color: var(--bad); }
.ses-ic.ic-mut  { color: var(--muted); }
.ses-ic.ic-warn { color: var(--warn); }
.ses-main { flex: 1 1 auto; min-width: 0; }
.ses-t { margin: 0; font-size: var(--fs-md); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ses-s { margin: 2px 0 0; font-size: var(--fs-sm); }
.ses-r { flex: 0 0 auto; font-weight: 600; font-size: var(--fs-md); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ses-chev { flex: 0 0 auto; display: inline-flex; color: var(--muted); }
.ses-chev .ico { width: 18px; height: 18px; }

/* Header con subtítulo (sesión / editar movimiento): descripción más prolija */
.htit { display: flex; flex-direction: column; min-width: 0; }
.htit h2 { margin: 0; }
.htit-sub { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--sec); }

/* Ficha: dos acciones a la derecha de la CC ($ registrar mov + globito avisar) */
.ficha-cc-acts { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.ficha-cc-btn2 { background: var(--mies); color: #fff; border: none; }

/* Filtro de la ficha: banda full-bleed con línea arriba y abajo (formato agenda),
   arriba del botón "Editar". El pill (.tabbar) va adentro con el espaciado normal. */
.ficha-filtro-band { flex: 0 0 auto; margin: 0 calc(-1 * var(--scr-x)); padding: 8px var(--scr-x); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); }
.ficha-filtro-band .tabbar { margin-bottom: 0; }

/* "¿Qué pasó con esta sesión?": 2x2 de fichas. Ícono del color del estado, texto neutro, sin círculos lavados.
   La ficha del estado ACTUAL se rellena con su color (mismo criterio que los segmentados de la app: lo elegido va lleno). */
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.est-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px;
  min-height: 88px; padding: 14px; border-radius: var(--rad);
  border: 1px solid var(--border2); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: var(--fs-md); font-weight: 600; text-align: left; cursor: pointer;
}
.est-btn .ico { width: 26px; height: 26px; stroke-width: 1.7; }
.est-btn:active { transform: scale(.98); }
.est-btn.ok   .ico { color: var(--ok); }
.est-btn.bad  .ico { color: var(--bad); }
.est-btn.warn .ico { color: var(--warn); }
.est-btn.mut  .ico { color: var(--sec); }
.est-btn.sel { color: #fff; }
.est-btn.sel .ico { color: #fff; }
.est-btn.sel.ok   { background: var(--ok);   border-color: color-mix(in srgb, var(--ok) 78%, #000); }
.est-btn.sel.bad  { background: var(--bad);  border-color: color-mix(in srgb, var(--bad) 78%, #000); }
.est-btn.sel.warn { background: var(--warn); border-color: color-mix(in srgb, var(--warn) 78%, #000); }
.est-btn.sel.mut  { background: var(--sec);  border-color: color-mix(in srgb, var(--sec) 78%, #000); }

/* Acción destructiva dentro de una pantalla (eliminar, desactivar, anular, desconectar): texto rojo, sin caja.
   Siempre va debajo de todo y se distingue de los botones normales; la confirmación la pide el diálogo. */
.dangerlink {
  display: block; width: 100%; min-height: 48px; margin: 6px 0 0; padding: 0 12px;
  background: none; border: none; border-radius: var(--rad);
  color: var(--bad); font-family: inherit; font-size: var(--fs-md); font-weight: 600; text-align: center; cursor: pointer;
}
.dangerlink:active { opacity: .6; }

/* Monto grande sin caja: [$] 12.500,00 — se edita tocándolo (el cursor titila al enfocar). Reusable en cualquier pantalla. */
.amt-block { margin: 4px 0 6px; }
.amt-label { display: block; margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--sec); }
.amt-row { display: flex; align-items: baseline; gap: 2px; }
.amt-cur { font-size: 46px; font-weight: 500; line-height: 1.1; color: var(--text); }
.amt-row .amt-input {
  flex: 1; min-width: 0; width: 100%; height: auto; min-height: 0; margin: 0; padding: 0;
  border: none; border-radius: 0; background: none; box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
  font-family: inherit; font-size: 46px; font-weight: 500; line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--text); caret-color: var(--acento);
}
.amt-row .amt-input::placeholder { color: var(--border2); }
/* Tooltip celeste (1ª vez) que explica el botón de facturado. */
.factura-tip { position: fixed; z-index: var(--z-toast); max-width: 250px; background: var(--mies); color: #fff; font-size: var(--fs-sm); line-height: 1.4; padding: 11px 13px; border-radius: 13px; box-shadow: var(--sh-toast); opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.factura-tip.visible { opacity: 1; transform: translateY(0); }
.factura-tip.salir { opacity: 0; }
.factura-tip b { font-weight: 700; }
.factura-tip::after { content: ''; position: absolute; bottom: -6px; right: 15px; width: 12px; height: 12px; background: var(--mies); transform: rotate(45deg); border-radius: 2px; }
/* Header de la ficha (CC + horario + tabs): fijo, no scrollea con la lista. */
#s-ficha .ficha-top { flex-shrink: 0; }
#s-ficha .body-in { padding-top: 12px; }

/* ---- Tabs ---- */
.tabbar { display: flex; gap: 6px; background: var(--surf); border-radius: var(--rad); padding: 4px; margin-bottom: 10px; }
.tab { flex: 1; height: 42px; border-radius: var(--rad-xs); border: none; background: none; font-size: var(--fs-md); cursor: pointer; color: var(--sec); font-family: inherit; font-weight: 500; }
.tab.sel { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: var(--sh-tab); }

/* ---- Iconos de línea (inline SVG, ver js/icons.js) ---- */
/* El grosor de línea se define acá una sola vez para toda la app. */
.ico { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; flex-shrink: 0; }
/* Botones del header (Perfil, Reservas, Notificaciones…): todos con el mismo chrome neutro; lo único que llama la
   atención es el globito rojo de pendientes. */
/* Íconos de acción del header (campana, refresh, tacho, doble check): mismo tamaño para todos. */
.bk .ico { width: 22px; height: 22px; }
.ic-ok   { color: var(--ok); }
.ic-bad  { color: var(--bad); }
.ic-warn { color: var(--warn); }
.ic-mut  { color: var(--sec); }

/* ---- Notificaciones: botones de acción dentro de una burbuja ---- */
/* ---- Notificaciones: fila full-width formato notificación ---- */
.noti { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 2px; border-bottom: 1px solid var(--border); }
.noti-ico { flex-shrink: 0; width: 28px; color: var(--acento); display: flex; align-items: center; justify-content: center; margin-top: 4px; }   /* solo el ícono, sin círculo */
.noti-ico .ico { width: 22px; height: 22px; }
.noti-body { flex: 1; min-width: 0; }
.noti-texto { font-size: var(--fs-md); line-height: 1.45; white-space: pre-wrap; color: var(--text); }
.noti-time { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.noti-check { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; padding: 0; margin-top: 1px; color: var(--border2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.noti-check .ico { width: 24px; height: 24px; }
.noti-check:active { background: var(--surf); }
.noti-check:disabled { cursor: default; }
/* Marcada como leída: toda la fila en gris. */
.noti-leida { opacity: .5; }
.noti-leida .noti-ico { color: var(--sec); }
.noti-leida .noti-check { color: var(--sec); }

.notif-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.notif-actions button { flex: 1 1 auto; min-height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border2); background: var(--bg); font-size: var(--fs-sm); font-weight: 600; color: var(--text); font-family: inherit; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.notif-actions button:active { transform: scale(.96); background: var(--surf); }
/* Pago de una sesión: 4 opciones en grilla 2×2 (no en fila con wrap desparejo). */
.notif-actions.notif-pago { display: grid; grid-template-columns: 1fr 1fr; }

/* ---- Overlays globales ---- */
#toast {
  display: none; position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--primary); color: var(--onprimary);
  border-radius: var(--rad); padding: 13px 20px; font-size: var(--fs-md);
  text-align: center; z-index: var(--z-toast); max-width: 90%; width: max-content;
  box-shadow: var(--sh-toast);
}
/* Variante error: fondo rojo, texto a la izquierda y botón "Reportar". */
#toast.is-error { align-items: center; gap: 12px; text-align: left; background: var(--bad); }
#toast .toast-txt { flex: 1; min-width: 0; }
#toast .toast-rep { flex-shrink: 0; background: #fff; color: var(--bad); border-radius: var(--rad-sm); padding: 6px 13px; font-weight: 700; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
#toast .toast-rep:active { transform: scale(.96); }
/* Variante con acción ("Deshacer"): texto a la izquierda y botón claro a la derecha. */
#toast.is-undo { align-items: center; gap: 12px; text-align: left; }
#toast .toast-act { flex-shrink: 0; min-height: 36px; padding: 0 14px; border: none; border-radius: var(--rad-sm); background: #fff; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
#toast .toast-act:active { transform: scale(.96); }

#loader { display: none; position: fixed; inset: 0; background: rgba(255, 255, 255, .75); z-index: var(--z-loader); align-items: center; justify-content: center; }
.spin { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: var(--rad-round); animation: sp .8s linear infinite; }

.vacio { margin: 10px 0 12px; text-align: center; }

/* Empty states (listas/tarjetas sin datos): ícono tenue + guía + CTA */
.empty { text-align: center; padding: 34px 20px; }
.empty-ico { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--border2); }
.empty-ico .ico { width: 40px; height: 40px; }
.empty-t { font-size: var(--fs-md); font-weight: 600; color: var(--sec); margin: 0 0 4px; }
.empty-s { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; margin: 0 0 16px; }

/* Bienvenida (una vez): banner suave con marca, arriba del Home */
.welcome { position: relative; background: var(--mies-tint); border: 1px solid var(--mies-line); border-radius: 14px;
  padding: 13px 42px 13px 16px; margin-bottom: 10px; }
.welcome-t { font-size: var(--fs-md); font-weight: 600; color: var(--text); margin: 0 0 3px; }
.welcome-s { font-size: var(--fs-sm); color: var(--sec); line-height: 1.4; margin: 0; }
.welcome-x { position: absolute; top: 7px; right: 7px; width: 32px; height: 32px; border: none; background: none;
  color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.welcome-x .ico { width: 18px; height: 18px; }
.welcome-cta { margin-top: 11px; }

/* Campo de monto común (formularios): input normal con el $ adentro, a la izquierda. */
.money { position: relative; }
.money-cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-md); pointer-events: none; }
.money input { padding-left: 30px; }

/* Rueda horizontal de números (duración en minutos): tira con snap; el número centrado es el valor. */
.wheel { position: relative; min-width: 0; max-width: 100%; height: 56px; border: 1px solid var(--border2); border-radius: var(--rad); background: var(--bg); overflow: hidden; }
.wheel-list { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 0 calc(50% - 30px); }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-i { flex: 0 0 60px; scroll-snap-align: center; border: none; background: none; padding: 0; font-family: inherit; font-size: var(--fs-lg);
  font-weight: 500; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.wheel-i.on { color: var(--text); font-size: 24px; font-weight: 600; }
.wheel-mark { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 60px; transform: translateX(-50%); border-radius: 12px;
  border: 1.5px solid var(--sec); pointer-events: none; }
.wheel-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: var(--fs-sm); color: var(--muted); pointer-events: none; }

/* ---- Ficha nueva (BETA, flag `beta`; ver MANUAL §12 2026-12-03) ----
   #s-ficha.beta: bloque celeste = nombre + horario + cuenta corriente (+ lápiz); filtros arriba de la lista;
   acciones con texto abajo (zona del pulgar). Sin la clase, la ficha de siempre. */
#s-ficha:not(.beta) .fb-only, #s-ficha.beta .fb-old { display: none; }
#s-ficha.beta .hdr { order: 0; }
#s-ficha.beta .ficha-cc-card { order: 1; align-items: flex-start; }
#s-ficha.beta .ficha-filtro-band { order: 2; border: 0; padding-top: 0; }
#s-ficha.beta .body-in { order: 3; }
#s-ficha.beta .sticky-bottom { order: 4; }
.fb-info { display: flex; flex-direction: column; min-width: 0; }
.fb-n { color: #fff; font-size: var(--fs-2xl); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.fb-s { color: rgba(255, 255, 255, .82); font-size: var(--fs-sm); margin-top: 3px; }
.fb-cc { margin-top: 10px; }
.fb-cc b { color: #fff; font-weight: 600; }
.fb-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: max-content; pointer-events: auto; }   /* columnas iguales: íconos a la misma distancia */   /* vidrio: estilob.css, compartido con #bottomnav */
/* La barra flota (como el nav general): la lista corre por debajo y deja lugar al final. */
#s-ficha.beta .sticky-bottom { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 0 0 calc(var(--dock-gap, 10px) + env(safe-area-inset-bottom)); background: none; border: 0; display: flex; justify-content: center; pointer-events: none; z-index: 60; }
#s-ficha.beta .body-in { padding-bottom: 96px; }
.fb-a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 8px; border: 0; border-radius: 15px; background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 500; line-height: 1; cursor: pointer; }
.fb-a[hidden] { display: none; }
.fb-a .ico { width: 23px; height: 23px; }
.fb-a.fb-vac { color: var(--muted); }

/* ---- Editar paciente: tarifa y duración en dos columnas con número sin caja (.rs-num, la línea punteada la da ese
   mismo estilo en ajustes.css) y el campo del tamaño de su contenido. */
.ep-num { padding: 2px 0 4px; }
.ep-num .rs-u { min-width: 0; }
#s-editpac .ep-num .rs-in { text-align: left; font-size: var(--fs-2xl); }
#s-editpac .ep-num .rs-u { font-size: var(--fs-md); }
