/* ============ FAMILIA VÁSQUEZ — estilos ============ */
:root {
  --bg: #FAF3E7;
  --bg-soft: #F3E9D8;
  --card: #FFFFFF;
  --ink: #33302B;
  --ink-2: #7A736A;
  --linea: #EFE6D6;
  --sombra: 0 10px 30px rgba(120, 90, 40, .10), 0 2px 8px rgba(120, 90, 40, .06);
  --sombra-mini: 0 3px 10px rgba(120, 90, 40, .10);
  --radio: 26px;
  --verde: #2FA96A;
  --rojo: #E5484D;
  /* acentos por perfil */
  --c-jenny: #0E9594;   --c-jenny-suave: #E0F4F3;
  --c-jeyccob: #4F6DF5; --c-jeyccob-suave: #E8EDFF;
  --c-maximo: #F59E0B;  --c-maximo-suave: #FFF2DA;
  --c-papas: #7C5CBF;   --c-papas-suave: #EFE9FA;
  --oro: #F7B733;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overscroll-behavior-y: none;
}
h1, h2, h3, .fuente-titulo { font-family: 'Baloo 2', 'Nunito', sans-serif; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

#app { max-width: 1100px; margin: 0 auto; padding: 20px 20px 110px; }

/* ---------- Cargando ---------- */
.cargando { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; gap: 16px; color: var(--ink-2); font-weight: 700; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--linea); border-top-color: var(--c-jenny); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Home ---------- */
.home-cab { text-align: center; padding: 26px 0 8px; }
.home-cab .saludo { font-size: 1.05rem; color: var(--ink-2); font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.home-cab h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.home-cab .fecha { color: var(--ink-2); font-weight: 700; margin-top: 6px; }

.perfiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 26px; }
.perfil-card {
  background: var(--card); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 30px 22px; text-align: center; transition: transform .15s ease, box-shadow .15s ease;
  border: 3px solid transparent; position: relative; overflow: hidden;
}
.perfil-card:active { transform: scale(.97); }
.perfil-card .aura {
  width: 108px; height: 108px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 58px;
}
.perfil-card h2 { font-size: 1.5rem; }
.perfil-card .rol { color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.perfil-card .badge-pts {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  background: linear-gradient(135deg, #FFE9B8, #FFD873); color: #7A5200;
  border-radius: 999px; padding: 7px 16px; font-weight: 900; font-size: 1.05rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), var(--sombra-mini);
}
.pc-jenny .aura { background: var(--c-jenny-suave); } .pc-jenny { border-color: var(--c-jenny-suave); }
.pc-jeyccob .aura { background: var(--c-jeyccob-suave); } .pc-jeyccob { border-color: var(--c-jeyccob-suave); }
.pc-maximo .aura { background: var(--c-maximo-suave); } .pc-maximo { border-color: var(--c-maximo-suave); }
.pc-papas .aura { background: var(--c-papas-suave); } .pc-papas { border-color: var(--c-papas-suave); }

/* ---------- Cabecera de perfil ---------- */
.cab {
  display: flex; align-items: center; gap: 16px; padding: 10px 0 20px; flex-wrap: wrap;
}
.btn-volver {
  width: 52px; height: 52px; border-radius: 18px; background: var(--card); box-shadow: var(--sombra-mini);
  font-size: 24px; display: flex; align-items: center; justify-content: center; flex: none;
}
.cab .avatar {
  width: 66px; height: 66px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; flex: none; box-shadow: var(--sombra-mini);
}
.cab .quien { flex: 1; min-width: 140px; }
.cab .quien h1 { font-size: 1.7rem; line-height: 1.1; }
.cab .quien .sub { color: var(--ink-2); font-weight: 700; }
.saldo-chip {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #FFE9B8, #FFD873);
  border-radius: 22px; padding: 12px 20px; box-shadow: var(--sombra-mini); color: #7A5200;
}
.saldo-chip .num { font-size: 1.7rem; font-weight: 900; font-family: 'Baloo 2'; line-height: 1; }
.saldo-chip .lbl { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 12px 22px; border-radius: 999px; background: var(--card); font-weight: 800; font-size: 1rem;
  color: var(--ink-2); box-shadow: var(--sombra-mini);
}
.tab.activa { color: #fff; }

/* ---------- Lista de actividades ---------- */
.franja-titulo { display: flex; align-items: center; gap: 10px; margin: 22px 4px 12px; color: var(--ink-2); font-weight: 900; text-transform: uppercase; letter-spacing: .6px; font-size: .85rem; }
.franja-titulo::after { content: ''; flex: 1; height: 2px; background: var(--linea); border-radius: 2px; }

.acts { display: grid; gap: 14px; }
.act-card {
  background: var(--card); border-radius: 22px; box-shadow: var(--sombra-mini);
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; min-height: 84px;
  transition: transform .12s ease, opacity .2s;
}
.act-card:active { transform: scale(.985); }
.act-card .icono {
  width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex: none;
}
.act-card .cuerpo { flex: 1; min-width: 0; }
.act-card .titulo { font-weight: 800; font-size: 1.12rem; line-height: 1.25; }
.act-card .meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font-size: .78rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2);
}
.chip.pts { background: #FFF1CC; color: #8A5B00; }
.chip.espera { background: #FFE8E0; color: #A34A00; }
.btn-check {
  width: 62px; height: 62px; border-radius: 50%; flex: none; font-size: 30px;
  border: 3px dashed #D8CDB8; background: var(--bg); color: transparent;
  display: flex; align-items: center; justify-content: center; transition: all .15s ease;
}
.btn-check.hecha { border: none; background: var(--verde); color: #fff; box-shadow: 0 6px 16px rgba(47,169,106,.4); }
.btn-check.pend { border: none; background: var(--oro); color: #fff; box-shadow: 0 6px 16px rgba(247,183,51,.4); font-size: 26px; }
.act-card.completada { opacity: .78; }
.act-card.completada .titulo { text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgba(47,169,106,.5); }

/* Progreso del día */
.progreso {
  background: var(--card); border-radius: 22px; box-shadow: var(--sombra-mini); padding: 18px 20px; margin-bottom: 20px;
}
.progreso .fila { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 10px; }
.barra { height: 16px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.barra > div { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.22,1,.36,1); }
.mensaje-animo { text-align: center; font-weight: 800; color: var(--ink-2); margin-top: 10px; }

/* ---------- Vista semana (Jenny) ---------- */
.semana { display: grid; gap: 14px; }
.dia-col { background: var(--card); border-radius: 22px; box-shadow: var(--sombra-mini); padding: 16px 18px; }
.dia-col.hoy-col { border: 3px solid var(--c-jenny); }
.dia-col h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1.1rem; }
.dia-col h3 .hoy-tag { font-size: .7rem; background: var(--c-jenny); color: #fff; padding: 3px 10px; border-radius: 999px; letter-spacing: .5px; }
.dia-col ul { list-style: none; display: grid; gap: 8px; }
.dia-col li { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: .98rem; }
.dia-col li .hora { color: var(--ink-2); font-size: .82rem; font-weight: 800; min-width: 44px; }
@media (min-width: 860px) { .semana { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Alcancía ---------- */
.alcancia-btn {
  width: 100%; margin-top: 22px; background: linear-gradient(135deg, #FFDf8e, #F7B733);
  border-radius: 22px; padding: 18px; font-weight: 900; font-size: 1.15rem; color: #6B4A00;
  box-shadow: var(--sombra); display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* ---------- Modal ---------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(50, 40, 20, .45); display: flex; align-items: center;
  justify-content: center; padding: 20px; z-index: 50; backdrop-filter: blur(3px);
}
.modal {
  background: var(--card); border-radius: 28px; padding: 26px; width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal h2 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.modal .cerrar { float: right; font-size: 22px; color: var(--ink-2); padding: 4px 10px; }

.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 800; font-size: .88rem; color: var(--ink-2); margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: 13px 15px; border: 2px solid var(--linea); border-radius: 14px; background: var(--bg);
  font-weight: 700; outline: none;
}
.campo input:focus, .campo select:focus { border-color: var(--c-papas); }
.dias-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.dia-toggle {
  width: 46px; height: 46px; border-radius: 14px; background: var(--bg); border: 2px solid var(--linea);
  font-weight: 900; color: var(--ink-2);
}
.dia-toggle.on { background: var(--c-papas); border-color: var(--c-papas); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 16px; font-weight: 900; font-size: 1.02rem; transition: transform .1s;
}
.btn:active { transform: scale(.96); }
.btn-primario { background: var(--c-papas); color: #fff; box-shadow: 0 6px 16px rgba(124,92,191,.35); }
.btn-verde { background: var(--verde); color: #fff; box-shadow: 0 6px 16px rgba(47,169,106,.35); }
.btn-rojo { background: #FFE3E3; color: var(--rojo); }
.btn-suave { background: var(--bg-soft); color: var(--ink); }
.btn-bloque { width: 100%; margin-top: 8px; }

/* PIN */
.pin-caja { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.pin-dig {
  width: 58px; height: 66px; border: 2px solid var(--linea); border-radius: 16px; text-align: center;
  font-size: 1.8rem; font-weight: 900; background: var(--bg);
}
.pin-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-tecla { height: 62px; border-radius: 16px; background: var(--bg); font-size: 1.4rem; font-weight: 900; box-shadow: var(--sombra-mini); }

/* ---------- Panel papás ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: 20px; padding: 16px 18px; box-shadow: var(--sombra-mini); }
.stat .num { font-size: 1.8rem; font-weight: 900; font-family: 'Baloo 2'; }
.stat .lbl { color: var(--ink-2); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }

.pend-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--sombra-mini); }
.pend-card .info { flex: 1; }
.pend-card .info b { display: block; }
.pend-card .info span { color: var(--ink-2); font-size: .88rem; font-weight: 700; }
.pend-acciones { display: flex; gap: 8px; }
.btn-mini { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; display: flex; align-items: center; justify-content: center; }

.lista-admin { display: grid; gap: 10px; }
.admin-item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 16px; box-shadow: var(--sombra-mini); }
.admin-item .em { font-size: 26px; }
.admin-item .tx { flex: 1; min-width: 0; }
.admin-item .tx b { display: block; font-size: 1rem; }
.admin-item .tx span { color: var(--ink-2); font-size: .82rem; font-weight: 700; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 14px 26px; border-radius: 999px; font-weight: 800;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 90; max-width: 90vw; text-align: center;
  animation: toast-in .25s ease;
}
.toast.error { background: var(--rojo); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- Confetti ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confe {
  position: absolute; width: 12px; height: 12px; border-radius: 3px; top: -20px;
  animation: caer linear forwards;
}
@keyframes caer {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}

/* pop de puntos */
.pop-pts {
  position: fixed; z-index: 85; font-family: 'Baloo 2'; font-weight: 800; font-size: 2rem; color: #B8860B;
  pointer-events: none; animation: subir 1.1s ease forwards; text-shadow: 0 2px 0 #fff;
}
@keyframes subir { to { transform: translateY(-90px); opacity: 0; } }

.vacio { text-align: center; color: var(--ink-2); font-weight: 800; padding: 40px 20px; }
.vacio .em { font-size: 54px; display: block; margin-bottom: 10px; }

@media (max-width: 560px) {
  #app { padding: 14px 14px 90px; }
  .cab .quien h1 { font-size: 1.4rem; }
}
