/* Mural Studio · app interna */

:root {
  color-scheme: light dark;
  --bg: #F5F2EB;
  --card: #FFFFFF;
  --card-2: #F8F6F1;
  --texto: #1A1A1A;
  --suave: #6F6A62;
  --tenue: #A59F95;
  --borde: rgba(26, 26, 26, .08);
  --borde-2: rgba(26, 26, 26, .15);
  --sombra: 0 1px 2px rgba(26, 26, 26, .04), 0 10px 28px rgba(26, 26, 26, .05);
  --hero: #161616;
  --hero-2: #22211F;
  --hero-texto: #F5F2EB;
  --hero-suave: rgba(245, 242, 235, .6);
  --primario: #1A1A1A;
  --primario-texto: #FFFFFF;
  --verde: #1E8214;
  --verde-bg: rgba(30, 130, 20, .10);
  --amarillo: #F7C11E;
  --amarillo-txt: #946A00;
  --amarillo-bg: rgba(247, 193, 30, .20);
  --celeste: #89CFF0;
  --celeste-txt: #1F76A6;
  --celeste-bg: rgba(137, 207, 240, .26);
  --rojo: #CD2828;
  --rojo-bg: rgba(205, 40, 40, .09);
  --gris: #8A8177;
  --gris-bg: rgba(138, 129, 119, .14);
  --naranja: #B85F00;
  --naranja-bg: rgba(247, 150, 30, .16);
  --boda: #1A1A1A;
  --boda-bg: rgba(26, 26, 26, .08);
  --tabbar: rgba(255, 255, 255, .86);
  --radio: 20px;
  --arriba: env(safe-area-inset-top, 0px);
  --abajo: env(safe-area-inset-bottom, 0px);
  --fuente: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --titulos: "Poppins", "Inter", -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0C;
    --card: #17171A;
    --card-2: #1E1E21;
    --texto: #F2F1EF;
    --suave: #A39E96;
    --tenue: #6E6A64;
    --borde: rgba(255, 255, 255, .08);
    --borde-2: rgba(255, 255, 255, .15);
    --sombra: none;
    --hero: #161618;
    --hero-2: #1F1E1C;
    --primario: #F2F1EF;
    --primario-texto: #111111;
    --verde: #4DBB40;
    --verde-bg: rgba(77, 187, 64, .15);
    --amarillo-txt: #F7C11E;
    --amarillo-bg: rgba(247, 193, 30, .15);
    --celeste-txt: #89CFF0;
    --celeste-bg: rgba(137, 207, 240, .14);
    --rojo: #FF5A4E;
    --rojo-bg: rgba(255, 90, 78, .13);
    --gris: #9C948A;
    --gris-bg: rgba(156, 148, 138, .16);
    --naranja: #FFA23A;
    --naranja-bg: rgba(255, 162, 58, .15);
    --boda: #F2F1EF;
    --boda-bg: rgba(255, 255, 255, .11);
    --tabbar: rgba(20, 20, 22, .86);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--hero); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.sin-scroll { overflow: hidden; }
button, a { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-decoration: none; text-align: inherit; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
input, select, textarea { font: inherit; color: var(--texto); }
:focus-visible { outline: 2px solid var(--celeste-txt); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.en-linea { width: 17px; height: 17px; display: inline-block; vertical-align: -3px; }
strong, b { font-weight: 600; }

/* ---------- Carga inicial ---------- */
body.en-carga { background: var(--hero); }
.pantalla-carga { min-height: 100dvh; display: grid; place-items: center; background: var(--hero); }
.pantalla-carga img { animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 0%, 100% { opacity: .55; transform: scale(.98); } 50% { opacity: 1; transform: scale(1); } }

.barra-estado { position: fixed; top: 0; left: 0; right: 0; height: var(--arriba); background: var(--hero); z-index: 50; }

/* ---------- Encabezado oscuro (hero) ---------- */
.hero {
  position: relative;
  color: var(--hero-texto);
  padding: calc(var(--arriba) + 10px) 20px 46px;
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(247, 193, 30, .07) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(137, 207, 240, .06) 0%, transparent 60%),
    linear-gradient(180deg, var(--hero) 0%, var(--hero-2) 100%);
}
.hero-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.hero-logo { height: 30px; width: auto; }
.hero-acciones { display: flex; align-items: center; gap: 8px; }
.boton-redondo {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); color: var(--hero-texto);
  transition: background .15s, transform .1s;
}
.boton-redondo:active, .pastilla:active { transform: scale(.94); background: rgba(255, 255, 255, .18); }
.pastilla { height: 36px; padding: 0 16px; border-radius: 18px; background: rgba(255, 255, 255, .1); color: var(--hero-texto); font-weight: 600; font-size: 14px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #F7C11E, #CD2828);
  color: #fff; font-family: var(--titulos); font-weight: 700; font-size: 16px;
}
.avatar.grande { width: 56px; height: 56px; font-size: 22px; flex: none; }
.marca-barra { display: inline-flex; gap: 4px; }
.marca-barra i { width: 16px; height: 5px; border-radius: 3px; }
.marca-barra i:nth-child(1) { background: #F7C11E; }
.marca-barra i:nth-child(2) { background: #89CFF0; }
.marca-barra i:nth-child(3) { background: #1E8214; }
.marca-barra i:nth-child(4) { background: #CD2828; }
.hero-titulo { font-family: var(--titulos); font-weight: 700; font-size: 31px; line-height: 1.12; letter-spacing: -.015em; margin-top: 14px; }
.hero-sub { color: var(--hero-suave); margin-top: 5px; font-size: 15px; }
.hero-etiqueta { color: var(--hero-suave); font-size: 13.5px; font-weight: 500; }
.mt-hero { margin-top: 18px; }
.hero-grande { font-family: var(--titulos); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero-metricas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.metrica {
  text-align: left; border-radius: 18px; padding: 13px 15px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  color: var(--hero-texto); transition: transform .1s;
}
.metrica:active { transform: scale(.98); }
.metrica span { display: block; font-size: 12.5px; color: var(--hero-suave); }
.metrica b { display: block; font-family: var(--titulos); font-size: 20px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.anios { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
.anios::-webkit-scrollbar { display: none; }
.anio { height: 32px; padding: 0 15px; border-radius: 16px; background: rgba(255, 255, 255, .08); color: var(--hero-suave); font-weight: 600; font-size: 14px; flex: none; display: inline-grid; place-items: center; }
.anio.activo { background: var(--hero-texto); color: #161616; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.kpi { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .07); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.kpi span { display: block; font-size: 12px; color: var(--hero-suave); }
.kpi b { display: block; font-family: var(--titulos); font-size: 15px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---------- Contenido ---------- */
.contenido {
  position: relative;
  margin-top: -26px;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 20px 16px calc(112px + var(--abajo));
  min-height: 55vh;
}
.seccion { margin-top: 26px; }
.contenido > .seccion:first-child { margin-top: 2px; }
.seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.seccion-cab h2 { font-family: var(--titulos); font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.enlace { display: inline-flex; align-items: center; gap: 4px; color: var(--suave); font-size: 14px; font-weight: 600; }
.enlace .ico { width: 16px; height: 16px; }
.total-cab { font-weight: 600; font-size: 14px; color: var(--suave); font-variant-numeric: tabular-nums; }
.relativo { font-size: 13.5px; font-weight: 600; color: var(--suave); }
.tarjeta { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.tarjeta.pad { padding: 16px; }
.lista > * + * { border-top: 1px solid var(--borde); }
.suave { color: var(--suave); }
.txt-pend { color: var(--naranja); font-style: normal; font-weight: 600; }
.txt-falta { color: var(--rojo); font-style: normal; }
.txt-ok { color: var(--verde); }
.nota-pie { color: var(--tenue); font-size: 12.5px; margin: 10px 6px 0; line-height: 1.4; }
.centro { text-align: center; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 12px; }
.sin-mt { margin-top: 0 !important; }
.oculto { display: none !important; }

/* Filas de lista */
.fila { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 60px; text-align: left; }
button.fila:active, a.fila:active { background: var(--card-2); }
.fila-icono { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.fila-icono .ico { width: 20px; height: 20px; }
.fila-icono.suave { background: var(--card-2); color: var(--suave); }
.fila-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fila-texto b { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-texto small { color: var(--suave); font-size: 13px; margin-top: 1px; line-height: 1.35; }
.fila-texto.multilinea b { white-space: normal; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fila-texto .valor { font-size: 15.5px; margin-top: 1px; word-break: break-word; }
.fila-monto { font-size: 13.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fila-monto.falta { color: var(--rojo); }
.fila-monto.ok { color: var(--verde); }
.fila-flecha { width: 16px; height: 16px; color: var(--tenue); }
.acciones-fila { display: flex; gap: 8px; }
.mini-boton { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--texto); flex: none; }
.mini-boton .ico { width: 18px; height: 18px; }
.mini-boton.verde { background: var(--verde-bg); color: var(--verde); }
.mini-boton.rojo { background: var(--rojo-bg); color: var(--rojo); }

/* Chips y colores por tipo */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.chip .ico { width: 15px; height: 15px; }
.suave-chip { background: var(--card); border: 1px solid var(--borde); color: var(--suave); font-weight: 500; }
.tipo-masc { background: var(--verde-bg); color: var(--verde); }
.tipo-ses { background: var(--amarillo-bg); color: var(--amarillo-txt); }
.tipo-boda { background: var(--boda-bg); color: var(--boda); }
.tipo-off { background: var(--gris-bg); color: var(--gris); }
.tipo-pend { background: var(--naranja-bg); color: var(--naranja); }
.tipo-cel { background: var(--celeste-bg); color: var(--celeste-txt); }
.tipo-rojo, .tipo-nav { background: var(--rojo-bg); color: var(--rojo); }
.p-mascotas { background: var(--verde); }
.p-sesion, .p-pareja { background: var(--amarillo); }
.p-navidad { background: var(--rojo); }
.p-embarazo { background: var(--celeste); }
.p-boda { background: var(--boda); }
.p-off { background: var(--gris); }
.p-pend { background: var(--naranja); }

/* Estados vacíos, carga y fallas */
.vacio { padding: 28px 18px; text-align: center; color: var(--suave); font-size: 14.5px; }
.vacio > .ico { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--tenue); display: block; }
.vacio .btn { margin-top: 14px; }
.cargando-hoja { display: grid; place-items: center; padding: 60px 0; }
.girando { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: girar .7s linear infinite; opacity: .8; }
@keyframes girar { to { transform: rotate(360deg); } }
.esq { background: linear-gradient(90deg, var(--borde) 0%, var(--card-2) 50%, var(--borde) 100%); background-size: 200% 100%; animation: brillo 1.3s ease-in-out infinite; border-radius: 8px; }
.esq-linea { display: block; height: 12px; width: 62%; margin: 4px 0; }
.esq-linea.corta { width: 38%; }
.fila-icono.esq { border-radius: 12px; }
@keyframes brillo { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.falla { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: calc(var(--arriba) + 40px) 32px 40px; }
.falla > .ico { width: 36px; height: 36px; color: var(--tenue); }
.falla h2 { font-family: var(--titulos); font-size: 20px; }
.falla p { color: var(--suave); }
.falla .btn { max-width: 260px; margin-top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border-radius: 16px;
  background: var(--primario); color: var(--primario-texto);
  font-family: var(--titulos); font-weight: 600; font-size: 15.5px;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; }
.btn .ico { width: 19px; height: 19px; }
.btn.sec { background: var(--card); color: var(--texto); border: 1px solid var(--borde-2); }
.btn.peligro { background: var(--rojo-bg); color: var(--rojo); }
.btn.verde { background: var(--verde); color: #fff; }
.btn.claro { background: #F5F2EB; color: #161616; }
.btn.contorno { background: transparent; color: #F5F2EB; border: 1px solid rgba(245, 242, 235, .28); }
.btns { display: grid; gap: 10px; margin-top: 18px; }
.btns.dos { grid-template-columns: 1fr 1fr; }

/* ---------- Formularios ---------- */
.campo { display: block; margin-top: 14px; }
.campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--suave); margin: 0 4px 6px; }
.entrada {
  display: block; width: 100%; height: 50px; border-radius: 14px;
  border: 1px solid var(--borde-2); background: var(--card);
  padding: 0 14px; font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
}
textarea.entrada { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.entrada { background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.entrada:focus { border-color: var(--texto); }
.entrada::placeholder { color: var(--tenue); }
input[type="date"].entrada, input[type="time"].entrada { display: flex; align-items: center; min-width: 0; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.entrada-monto { position: relative; }
.entrada-monto::before { content: "₡"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--suave); font-weight: 600; pointer-events: none; }
.entrada-monto .entrada { padding-left: 30px; font-variant-numeric: tabular-nums; }
.entrada-monto.grande .entrada { height: 62px; font-size: 26px; font-family: var(--titulos); font-weight: 600; padding-left: 36px; }
.entrada-monto.grande::before { font-size: 22px; left: 15px; }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fila-campos > .campo { min-width: 0; }
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 12px 0 16px; margin-top: 14px;
  background: var(--card); border: 1px solid var(--borde-2); border-radius: 14px;
  font-weight: 500; font-size: 15.5px;
}
.switch input { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--borde-2); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: transform .2s; }
.switch input:checked { background: var(--verde); }
.switch input:checked::after { transform: translateX(20px); }

.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: 14px; background: var(--borde); }
.segmento button { height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--suave); transition: background .15s, color .15s; min-width: 0; }
.segmento button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmento button .ico { width: 17px; height: 17px; }
.segmento button.activo { background: var(--card); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmento.con-iconos button { height: 42px; }
@media (prefers-color-scheme: dark) {
  .segmento button.activo { background: #3A3A3F; box-shadow: none; }
}
@media (max-width: 380px) { .segmento.con-iconos button { flex-direction: column; gap: 1px; height: 50px; font-size: 12px; } }
.chips > button, .chip-op {
  height: 38px; padding: 0 15px; border-radius: 19px;
  border: 1px solid var(--borde-2); background: var(--card);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s;
}
.chips > button .ico { width: 16px; height: 16px; }
.chips > button.activo, .chip-op.activo { background: var(--primario); color: var(--primario-texto); border-color: transparent; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip-op { flex: none; }

/* ---------- Pestañas ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(4px + var(--abajo));
  background: var(--tabbar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--borde);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0 4px; color: var(--tenue); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tab-icono { position: relative; width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s; }
.tab-icono .ico { width: 23px; height: 23px; }
.tab.activo { color: var(--texto); }
.tab.activo .tab-icono { background: var(--borde); }
.burbuja { position: absolute; top: -2px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--rojo); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 700; display: grid; place-items: center; line-height: 1; }

/* ---------- Hojas (sheets) ---------- */
.hoja-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .3s; }
.hoja-fondo.abierta { opacity: 1; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto;
  width: 100%; max-width: 680px;
  max-height: calc(100dvh - var(--arriba) - 10px);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  transform: translateY(105%);
  transition: transform .36s cubic-bezier(.2, .85, .25, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .2);
}
.hoja.abierta { transform: translateY(0); }
.hoja.hoja-alta { height: calc(100dvh - var(--arriba) - 10px); }
.hoja-cab { position: relative; flex: none; padding: 8px 60px 12px 20px; touch-action: none; }
.hoja-asa { width: 38px; height: 5px; border-radius: 3px; background: var(--borde-2); margin: 0 auto 12px; }
.hoja-titulo { font-family: var(--titulos); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.hoja-cerrar { position: absolute; right: 14px; top: 20px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--borde); color: var(--suave); }
.hoja-cerrar .ico { width: 16px; height: 16px; }
.hoja-cuerpo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 2px 20px calc(26px + var(--abajo)); }

/* Alerta de confirmación */
.alerta-fondo { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .2s; }
.alerta-fondo.abierta { opacity: 1; }
.alerta { width: min(320px, 100%); background: var(--card); border-radius: 20px; overflow: hidden; text-align: center; transform: scale(1.06); transition: transform .2s; }
.alerta-fondo.abierta .alerta { transform: scale(1); }
.alerta h3 { font-family: var(--titulos); font-size: 17px; font-weight: 600; padding: 22px 20px 6px; }
.alerta p { color: var(--suave); font-size: 14px; padding: 0 20px 18px; }
.alerta h3:has(+ .alerta-botones) { padding-bottom: 18px; }
.alerta-lista { list-style: none; text-align: left; margin: -6px 18px 16px; padding: 10px 12px; border-radius: 12px; background: var(--rojo-bg); color: var(--texto); font-size: 13.5px; line-height: 1.4; }
.alerta-lista li + li { margin-top: 5px; }
.alerta-botones { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--borde); }
.alerta-botones button { height: 50px; font-size: 16px; font-weight: 500; }
.alerta-botones button + button { border-left: 1px solid var(--borde); }
.alerta-botones .principal { font-weight: 700; }
.alerta-botones button:focus { outline: none; }
.alerta-botones button:focus-visible { background: var(--borde); }
.alerta-botones .peligro { color: var(--rojo); font-weight: 700; }

/* Aviso flotante */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--abajo)); z-index: 950;
  transform: translate(-50%, 16px); opacity: 0;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 36px); padding: 12px 16px; border-radius: 16px;
  background: var(--primario); color: var(--primario-texto);
  font-weight: 600; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--rojo); color: #fff; }
.toast .ico { width: 18px; height: 18px; }

/* Formulario de evento: tipo de sesión y ubicación */
.chips-horario { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips-horario > button { justify-content: center; height: 46px; font-size: 15px; }
.alerta-dia { margin-top: 14px; padding: 14px 14px 12px; border-radius: 16px; background: var(--rojo-bg); border: 1px solid rgba(205, 40, 40, .28); color: var(--texto); }
.alerta-dia-cab { display: flex; align-items: center; gap: 8px; color: var(--rojo); }
.alerta-dia-cab b { font-family: var(--titulos); font-size: 15px; }
.alerta-dia ul { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.alerta-dia li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); }
.alerta-dia li.choca { box-shadow: inset 0 0 0 1.5px var(--rojo); }
.alerta-dia-hora { flex: none; min-width: 64px; font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.alerta-dia-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alerta-dia-texto b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta-dia-texto small { color: var(--suave); font-size: 12.5px; }
.alerta-dia li { align-items: flex-start; }
.alerta-dia-hora { padding-top: 1px; }
.alerta-dia-conflicto { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--rojo); font-size: 12.5px; font-weight: 700; }
.alerta-dia-conflicto .ico { width: 14px; height: 14px; }
.alerta-dia p { color: var(--rojo); font-size: 13px; font-weight: 500; margin-top: 10px; }
.select-paquete { position: relative; }
.select-paquete .op-icono { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.select-paquete select.entrada { height: 56px; padding-left: 54px; font-weight: 600; font-size: 16px; }
.select-paquete select.entrada:invalid { color: var(--tenue); font-weight: 500; }
.op-icono { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.op-icono .ico { width: 19px; height: 19px; }
.vacio-icono { background: var(--card-2); color: var(--tenue); }
.opcional { font-style: normal; font-weight: 500; color: var(--tenue); margin-left: 4px; }
.bloque-lugar .segmento { margin-bottom: 10px; }
.lugar-estudio { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lugar-estudio .fila-texto b { font-size: 15px; }
.lugar-estudio .enlace { flex: none; }
.lugar-otro .btn { height: 46px; font-size: 14.5px; }
.enlace-lugar { color: inherit; }
.enlace-lugar:active { opacity: .6; }

/* ---------- Evento ---------- */
.evento-fecha { margin-top: 14px; }
.evento-fecha b { display: block; font-family: var(--titulos); font-size: 21px; font-weight: 600; line-height: 1.25; }
.evento-fecha span { color: var(--suave); font-size: 15px; }
.aviso-pend { margin-top: 16px; background: var(--naranja-bg); border-color: transparent; }
.aviso-pend b { color: var(--naranja); font-family: var(--titulos); }
.aviso-pend p { color: var(--suave); font-size: 14px; margin-top: 4px; }
.aviso-pend .btns { margin-top: 14px; }
.pagos-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.pagos-top small { display: block; color: var(--suave); font-size: 12.5px; }
.pagos-top b { display: block; font-family: var(--titulos); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pagos-top .der { text-align: right; }
.pagos-lista { margin: 14px -16px 0; border-top: 1px solid var(--borde); }
.fila.pago { min-height: 56px; padding: 10px 16px; }
.barra { display: block; height: 8px; border-radius: 4px; background: var(--borde); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 4px; background: var(--verde); transition: width .5s cubic-bezier(.2, .85, .25, 1); }
.barra.fina { height: 5px; }
.barra.grande { height: 12px; border-radius: 6px; }

/* ---------- Inicio ---------- */
.hero-inicio .hero-titulo { margin-top: 18px; }
.pendientes { background: var(--naranja-bg); border-color: transparent; box-shadow: none; }
.pend-cab { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; color: var(--naranja); }
.pend-cab b { font-family: var(--titulos); font-size: 16px; }
.pendientes > p { color: var(--suave); font-size: 13.5px; padding: 4px 16px 10px; }
.pendientes .lista { background: var(--card); border-top: 1px solid var(--borde); }
.proximo { padding: 18px; }
.proximo-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.proximo h3 { font-family: var(--titulos); font-size: 23px; font-weight: 700; line-height: 1.2; margin-top: 14px; letter-spacing: -.01em; }
.detalle { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; color: var(--suave); font-size: 14.5px; }
.detalle-linea { display: flex; align-items: center; gap: 8px; }
.detalle-linea .ico { width: 17px; height: 17px; color: var(--tenue); }
.proximo .btns { margin-top: 16px; }
.accesos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acceso { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px; text-align: left; transition: transform .1s; }
.acceso:active { transform: scale(.98); }
.acceso-icono { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 8px; }
.acceso-icono .ico { width: 22px; height: 22px; }
.acceso b { font-family: var(--titulos); font-weight: 600; font-size: 15px; }
.acceso small { color: var(--suave); font-size: 12.5px; }
.instalar b { display: flex; align-items: center; gap: 8px; font-family: var(--titulos); }
.instalar ol { margin: 10px 0 0 20px; color: var(--suave); font-size: 14px; display: grid; gap: 4px; }

/* ---------- Calendario ---------- */
.cal-cab { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px; }
.cal-mes { font-family: var(--titulos); font-weight: 700; font-size: 19px; }
.cal-mes small { color: var(--suave); font-weight: 500; font-size: 17px; }
.cal-nav { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.cal-nav:active { background: var(--borde); }
.cal-semana, .cal-grilla { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 6px; }
.cal-semana span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--tenue); padding: 6px 0 4px; }
.cal-grilla { padding-bottom: 8px; row-gap: 2px; touch-action: pan-y; }
.cal-dia { height: 50px; display: flex; flex-direction: column; align-items: center; padding-top: 5px; border-radius: 14px; position: relative; }
.cal-dia.vacio { pointer-events: none; }
.cal-dia .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15.5px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .15s; }
.cal-dia.finde .num { font-weight: 600; }
.cal-dia.pasado .num { color: var(--tenue); }
.cal-dia.bloq .num { background: var(--gris-bg); }
.cal-dia.hoy .num { color: var(--rojo); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--rojo); }
.cal-dia.sel .num { background: var(--texto); color: var(--bg); font-weight: 700; box-shadow: none; }
.cal-dia.hoy.sel .num { background: var(--rojo); color: #fff; }
.cal-puntos { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.cal-puntos i { width: 6px; height: 6px; border-radius: 50%; }
.leyenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 10px 12px 14px; border-top: 1px solid var(--borde); font-size: 12px; color: var(--suave); }
.leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda i { width: 8px; height: 8px; border-radius: 50%; }
.dia-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 4px 10px; }
.dia-cab h2 { font-family: var(--titulos); font-size: 18px; font-weight: 600; line-height: 1.2; }
.dia-cab small { color: var(--suave); font-size: 13px; }
.grupo-fecha { margin-top: 20px; }
.grupo-fecha:first-child { margin-top: 0; }
.grupo-fecha h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 8px; font-family: var(--titulos); font-size: 15.5px; font-weight: 600; }
.grupo-fecha h3 small { font-family: var(--fuente); color: var(--suave); font-size: 13px; font-weight: 500; }

/* ---------- Finanzas ---------- */
.grafico { padding: 16px 14px 12px; }
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.g-base { stroke: var(--borde-2); stroke-width: 1; }
.g-pactado { fill: var(--borde-2); }
.g-cobrado { fill: var(--verde); }
.g-etq { fill: var(--tenue); font-size: 11px; font-weight: 600; font-family: var(--fuente); }
.g-barra { cursor: pointer; }
.g-barra.sel .g-etq { fill: var(--texto); }
.g-barra.sel .g-pactado { fill: var(--tenue); opacity: .55; }
.grafico-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--borde); font-size: 13px; color: var(--suave); }
.grafico-pie b { color: var(--texto); font-family: var(--titulos); font-size: 14px; margin-right: auto; }
.grafico-pie span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.grafico-pie i { width: 9px; height: 9px; border-radius: 3px; }
.p-cobrado { background: var(--verde); }
.p-pactado { background: var(--borde-2); }
.fila-dato { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14.5px; }
.fila-dato span { color: var(--suave); }
.fila-dato b { font-variant-numeric: tabular-nums; }

/* ---------- Listas ---------- */
.kits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kit { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; min-height: 158px; transition: transform .1s; }
.kit:active { transform: scale(.98); }
.kit-icono { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 6px; }
.kit-icono .ico { width: 23px; height: 23px; }
.kit b { font-family: var(--titulos); font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.kit small { color: var(--suave); font-size: 12.5px; }
.kit .barra { width: 100%; height: 5px; margin-top: auto; }
.lista-para { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.lista-para .ico { width: 17px; height: 17px; }
.progreso-lista { display: flex; align-items: center; gap: 16px; padding: 16px; }
.progreso-lista b { display: block; font-family: var(--titulos); font-size: 18px; font-weight: 600; }
.progreso-lista small { color: var(--suave); font-size: 13.5px; }
.anillo-caja { position: relative; width: 56px; height: 56px; flex: none; }
.anillo-caja span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.anillo { transform: rotate(-90deg); }
.anillo-fondo { fill: none; stroke: var(--borde); stroke-width: 6; }
.anillo-valor { fill: none; stroke: var(--verde); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.2, .85, .25, 1); }
.check { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 12px 14px; text-align: left; }
button.check:active { background: var(--card-2); }
.check .circulo { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--borde-2); display: grid; place-items: center; flex: none; color: transparent; transition: background .15s, border-color .15s, transform .15s; }
.check .circulo .ico { width: 16px; height: 16px; stroke-width: 3; }
.check.hecho .circulo { background: var(--verde); border-color: var(--verde); color: #fff; transform: scale(1.04); }
.check-texto { flex: 1; min-width: 0; }
.check-texto b { display: block; font-weight: 500; font-size: 15.5px; line-height: 1.3; transition: color .15s; }
.check-texto small { color: var(--tenue); font-size: 12.5px; }
.check.hecho .check-texto b { color: var(--suave); text-decoration: line-through; text-decoration-color: var(--tenue); }
.cantidad { font-style: normal; color: var(--suave); font-weight: 600; }

/* ---------- Ajustes ---------- */
.perfil { display: flex; align-items: center; gap: 14px; padding: 16px; }
.perfil b { display: block; font-family: var(--titulos); font-size: 18px; }
.perfil small { color: var(--suave); }
.estado-ok { display: flex; align-items: center; gap: 8px; color: var(--verde); font-weight: 600; }

/* ---------- Oferta de Face ID ---------- */
.oferta-faceid { text-align: center; padding: 10px 6px 4px; }
.oferta-icono { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--celeste-bg); color: var(--celeste-txt); }
.oferta-icono .ico { width: 38px; height: 38px; }
.oferta-faceid p { font-size: 15.5px; }
.oferta-faceid p.suave { font-size: 13.5px; margin-top: 8px; }

/* ---------- Entrada (login) ---------- */
body.en-login {
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(247, 193, 30, .09) 0%, transparent 55%),
    radial-gradient(100% 70% at 0% 100%, rgba(137, 207, 240, .08) 0%, transparent 60%),
    #141414;
  color: #F5F2EB;
}
.login { min-height: 100dvh; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--arriba) + 32px) 26px calc(var(--abajo) + 32px); }
.login-marca { text-align: center; margin-bottom: 34px; }
.login-logo { width: 62%; max-width: 250px; height: auto; margin: 0 auto; }
.login-sub { margin-top: 14px; color: rgba(245, 242, 235, .55); font-size: 14px; letter-spacing: .02em; }
.login-error { background: rgba(255, 90, 78, .14); color: #FF8A80; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.login .campo > span { color: rgba(245, 242, 235, .6); }
.login .entrada { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); color: #F5F2EB; }
.login .entrada:focus { border-color: rgba(245, 242, 235, .6); }
.login .btn.claro { margin-top: 22px; }
.separador-o { display: flex; align-items: center; gap: 12px; color: rgba(245, 242, 235, .4); font-size: 13px; margin: 20px 0 14px; }
.separador-o::before, .separador-o::after { content: ""; flex: 1; height: 1px; background: rgba(245, 242, 235, .14); }
.login-nota { margin-top: 26px; text-align: center; color: rgba(245, 242, 235, .5); font-size: 13px; line-height: 1.5; }
.login-nota b { color: rgba(245, 242, 235, .75); }

/* Pantallas más anchas (iPad / escritorio) */
@media (min-width: 720px) {
  .hero, .contenido { padding-left: max(20px, calc((100vw - 680px) / 2)); padding-right: max(20px, calc((100vw - 680px) / 2)); }
  .tabbar { padding-left: calc((100vw - 560px) / 2); padding-right: calc((100vw - 560px) / 2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
