* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f0f0; color: #111; }

.header { background: #111; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.header-logo img { width: 100%; height: 100%; object-fit: cover; }
.header-text h1 { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -0.3px; }
.header-periodo { background: rgba(255,255,255,0.1); border: 0.5px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.65); font-size: 11px; padding: 5px 12px; border-radius: 20px; font-weight: 500; white-space: nowrap; }

.nav { display: flex; background: #fff; border-top: 0.5px solid #e0e0e0; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.nav-btn { flex: 1; padding: 10px 4px 8px; border: none; background: transparent; font-size: 10px; font-weight: 500; color: #aaa; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-btn::before { content: ''; width: 24px; height: 24px; border-radius: 8px; background: #f0f0ee; display: block; }
.nav-btn[data-tab="dashboard"]::before { content: '◼'; font-size: 11px; line-height: 24px; text-align: center; color: #aaa; }
.nav-btn[data-tab="registro"]::before { content: '✓'; font-size: 13px; line-height: 24px; text-align: center; color: #aaa; }
.nav-btn[data-tab="personas"]::before { content: '☰'; font-size: 13px; line-height: 24px; text-align: center; color: #aaa; }
.nav-btn[data-tab="consolidacion"]::before { content: '◎'; font-size: 11px; line-height: 24px; text-align: center; color: #aaa; }
.nav-btn[data-tab="gestion"]::before { content: '⊕'; font-size: 13px; line-height: 24px; text-align: center; color: #aaa; }
.nav-btn.active { color: #1db000; }
.nav-btn.active::before { background: #e6f5e3; color: #1db000; }

.content { padding: 16px 16px 80px; max-width: 600px; margin: 0 auto; }
.section { display: none; }
.section.active { display: block; }

.card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card-title { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 2px; }

.periodo-pill-inline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.periodo-pill-inline select { background: #fff; border: 2px solid #1db000; color: #111; border-radius: 10px; padding: 6px 10px; font-size: 11px; font-weight: 700; }

.badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; display: inline-block; margin-left: 4px; }
.badge-servidor { background: #1db000; color: #fff; }
.badge-miembro { background: #111; color: #fff; }
.badge-nva { background: #e8f5e9; color: #1db000; border: 1px solid #1db000; }
.badge-visita { background: #fff3cd; color: #8a6500; border: 1px solid #f0ad4e; }
.badge-adulto { background: #f0f0f0; color: #555; }
.badge-joven { background: #e8f5e9; color: #1a7000; }
.badge-nino { background: #fff8e1; color: #f57f17; }

.persona-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border-radius: 14px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.persona-info { flex: 1; min-width: 0; }
.persona-nombre { font-size: 13px; font-weight: 700; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-meta { font-size: 11px; color: #888; margin-top: 3px; }
.marca-btns { display: flex; gap: 6px; margin-left: 8px; touch-action: none; }
.marca-btn { width: 38px; height: 38px; border-radius: 10px; border: 2px solid #e0e0e0; background: #f8f8f8; font-size: 11px; font-weight: 800; cursor: pointer; transition: all 0.15s; color: #aaa; }
.marca-btn.A { background: #1db000; border-color: #1db000; color: #fff; }
.marca-btn.F { background: #111; border-color: #111; color: #fff; }
.marca-btn.Fj { background: #e8f5e9; border-color: #1db000; color: #1db000; }

.search { width: 100%; padding: 11px 14px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 14px; margin-bottom: 12px; background: #fff; font-weight: 500; }
.search:focus { outline: none; border-color: #1db000; }

.filter-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn { padding: 6px 14px; border: 2px solid #e0e0e0; border-radius: 20px; background: #fff; font-size: 11px; font-weight: 700; color: #888; cursor: pointer; text-transform: uppercase; letter-spacing: .3px; }
.filter-btn.active { background: #1db000; border-color: #1db000; color: #fff; }

.select-hoja { width: 100%; padding: 11px 14px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 13px; margin-bottom: 14px; background: #fff; font-weight: 600; }
.select-hoja:focus { outline: none; border-color: #1db000; }

.loading { text-align: center; padding: 40px 20px; color: #888; font-size: 13px; }
.spinner { width: 30px; height: 30px; border: 3px solid #e0e0e0; border-top-color: #1db000; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 30px; color: #aaa; font-size: 13px; font-weight: 600; }

.paso-btn { padding: 6px 14px; border-radius: 20px; border: 2px solid #e0e0e0; background: #fff; color: #888; font-size: 11px; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: .3px; }
.paso-btn.active { background: #1db000; border-color: #1db000; color: #fff; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 200; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 20px 20px 0 0; padding: 20px 16px 32px; width: 100%; max-width: 600px; }
.modal-title { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 16px; }
.modal-close { float: right; background: #f0f0f0; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 14px; cursor: pointer; font-weight: 700; color: #555; }

.form-group { margin-bottom: 14px; }
.form-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 11px 14px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 14px; font-weight: 500; background: #fff; }
.form-input:focus { outline: none; border-color: #1db000; }
.form-select { width: 100%; padding: 11px 14px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 14px; font-weight: 500; background: #fff; }
.form-select:focus { outline: none; border-color: #1db000; }

.btn-primary { width: 100%; padding: 14px; background: #1db000; border: none; border-radius: 12px; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 4px; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-secondary { width: 100%; padding: 12px; background: #111; border: none; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px; }

.fab { position: fixed; bottom: 80px; right: 20px; width: 52px; height: 52px; background: #1db000; border: none; border-radius: 50%; color: #fff; font-size: 26px; font-weight: 300; cursor: pointer; box-shadow: 0 4px 16px rgba(29,176,0,0.4); z-index: 99; display: none; align-items: center; justify-content: center; }
.fab.visible { display: flex; }

.accion-row { display: flex; gap: 8px; margin-bottom: 14px; }
.accion-btn { flex: 1; padding: 12px 8px; background: #fff; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 11px; font-weight: 700; color: #111; cursor: pointer; text-align: center; text-transform: uppercase; letter-spacing: .3px; }
.accion-btn:hover { border-color: #1db000; color: #1db000; }

.tag-fecha { display: inline-flex; align-items: center; gap: 6px; background: #e8f5e9; border: 1px solid #1db000; border-radius: 20px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: #1a7000; margin: 4px; }
.tag-fecha button { background: none; border: none; color: #1a7000; cursor: pointer; font-size: 13px; font-weight: 800; padding: 0; line-height: 1; }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: 700; z-index: 300; display: none; white-space: nowrap; }
.toast.show { display: block; }

.persona-card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); cursor: pointer; }
.persona-card.inactivo { opacity: 0.45; }
.persona-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.persona-card-nombre { font-size: 13px; font-weight: 700; color: #111; }
.persona-card-badges { margin-top: 6px; }
.btn-editar-persona { background: #f0f0f0; border: none; border-radius: 8px; padding: 5px 12px; font-size: 11px; font-weight: 700; color: #555; cursor: pointer; flex-shrink: 0; }
.btn-editar-persona:hover { background: #e0e0e0; }
.persona-tel { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.btn-wa { background: #25D366; border: none; border-radius: 8px; padding: 5px 12px; font-size: 11px; font-weight: 700; color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }

.toggle-activo { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 0.5px solid #f0f0f0; margin-top: 4px; }
.toggle-activo span { font-size: 13px; font-weight: 600; color: #111; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
input:checked + .slider { background: #1db000; }
input:checked + .slider:before { transform: translateX(20px); }

.btn-danger { width: 100%; padding: 12px; background: #fff; border: 2px solid #ff3b30; border-radius: 12px; color: #ff3b30; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.filtro-inactivos { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: #888; font-weight: 500; }
.filtro-inactivos input { accent-color: #1db000; width: 15px; height: 15px; }

/* Tendencia - grafica mejorada (v1.2) */
.tendencia-wrap { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 6px 2px 26px; position: relative; }
.tendencia-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; height: 100%; justify-content: flex-end; position: relative; }
.tendencia-pct { font-size: 9px; color: #555; font-weight: 800; }
.tendencia-bar { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #29d000, #159400); transition: height .3s ease; }
.tendencia-fecha { font-size: 9px; color: #999; font-weight: 600; position: absolute; bottom: -20px; white-space: nowrap; }

/* Login */
.login-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); background: #111; }
.login-logo { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; margin-bottom: 20px; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-title { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.login-sub { color: rgba(255,255,255,0.5); font-size: 12px; margin-bottom: 28px; }
.btn-google { display: flex; align-items: center; gap: 10px; background: #fff; border: none; border-radius: 12px; padding: 12px 24px; font-size: 14px; font-weight: 700; color: #111; cursor: pointer; }

body.dark { background:#1a1a1a; color:#fff; }
body.dark .card { background:#2a2a2a; box-shadow:none; }
body.dark .persona-row { background:#2a2a2a; }
body.dark .persona-card { background:#2a2a2a; }
body.dark .nav { background:#111; border-top-color:#333; }
body.dark .search { background:#2a2a2a; border-color:#444; color:#fff; }
body.dark .select-hoja { background:#2a2a2a; border-color:#444; color:#fff; }
body.dark .modal { background:#222; }
body.dark .form-input { background:#2a2a2a; border-color:#444; color:#fff; }
body.dark .form-select { background:#2a2a2a; border-color:#444; color:#fff; }
body.dark .filter-btn { background:#2a2a2a; border-color:#444; color:#aaa; }
body.dark .accion-btn { background:#2a2a2a; border-color:#444; color:#fff; }
body.dark .persona-card-nombre { color:#fff; }
body.dark .persona-nombre { color:#fff; }
body.dark .card-title { color:#fff; }
body.dark .badge-adulto { background:#444; color:#ccc; }
body.dark .badge-joven { background:#1a3a1a; color:#6dbf6d; }
body.dark .badge-nino { background:#3a2a00; color:#f5c842; }
body.dark .btn-editar-persona { background:#444; color:#ccc; }
body.dark .filtro-inactivos { color:#aaa; }
body.dark .toggle-activo span { color:#fff; }
body.dark .persona-tel span { color:#ccc !important; }
body.dark .tendencia-fecha { color:#888; }
body.dark .tendencia-pct { color:#ccc; }

/* ═══════════════════════════════════════════════════════════════════════
   v1.4 — Capa visual moderna: degradados, transiciones, micro-interacciones
   Regla: un solo momento de "delight" real (marcar asistencia). Todo lo
   demás queda disciplinado — transiciones suaves, no efectos por todos lados.
   ═══════════════════════════════════════════════════════════════════════ */

/* Header con degradado sutil en vez de negro plano */
.header.header {
  background: linear-gradient(165deg, #161616 0%, #0d0d0d 100%);
  border-bottom: 1px solid rgba(29,176,0,0.15);
}

/* Nav: el pill activo aparece con un pequeño resorte, no un cambio brusco */
.nav-btn.nav-btn { transition: color .2s ease; }
.nav-btn.nav-btn::before { transition: background .25s ease, transform .25s cubic-bezier(.34,1.56,.64,1); }
.nav-btn.active.active::before { transform: scale(1.06); }

/* Cards: sombra un poco más suave + leve elevación al pasar el cursor (desktop) */
.card.card, .persona-card.persona-card, .persona-row.persona-row {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) {
  .persona-card.persona-card:hover, .card.card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    transform: translateY(-1px);
  }
}

/* Botones primarios y FAB con degradado verde + respuesta al toque */
.btn-primary.btn-primary {
  background: linear-gradient(135deg, #22c400, #189600);
  transition: transform .12s ease, box-shadow .2s ease;
  box-shadow: 0 2px 10px rgba(29,176,0,0.25);
}
.btn-primary.btn-primary:active { transform: scale(0.98); }

.fab.fab {
  background: linear-gradient(135deg, #22c400, #189600);
  box-shadow: 0 4px 18px rgba(29,176,0,0.45);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1);
}
.fab.fab:active { transform: scale(0.92); }

/* Filtros y badges de servidor con el mismo degradado, para consistencia */
.filter-btn.active.active { background: linear-gradient(135deg, #22c400, #189600); }
.badge-servidor.badge-servidor { background: linear-gradient(135deg, #22c400, #189600); }

/* ── EL MOMENTO SIGNATURE: marcar asistencia ──────────────────────────────
   Al tocar A/F/Fj, el botón "aterriza" con un pequeño rebote y un pulso de
   color que se desvanece — la confirmación visual de que sí se guardó. */
.marca-btn.marca-btn {
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.marca-btn.marca-btn:active { transform: scale(0.90); }

@keyframes marcaPop {
  0%   { transform: scale(0.85); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes marcaPulso {
  0%   { box-shadow: 0 0 0 0 rgba(29,176,0,0.45); }
  100% { box-shadow: 0 0 0 10px rgba(29,176,0,0); }
}
.marca-btn.marca-pop {
  animation: marcaPop .32s cubic-bezier(.34,1.56,.64,1), marcaPulso .5s ease-out;
}

.marca-btn.A.A { background: linear-gradient(135deg, #22c400, #189600); border-color: #189600; }

/* Toast: entra deslizando en vez de aparecer de golpe */
.toast.toast {
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
  transform: translate(-50%, 12px);
  opacity: 0;
}
.toast.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Tendencia: barras con punta redondeada y brillo sutil */
.tendencia-bar.tendencia-bar {
  background: linear-gradient(180deg, #2fe000, #159400);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.25);
  transition: height .4s cubic-bezier(.22,1,.36,1);
}

/* Modal: entra deslizando desde abajo con un poco de resorte */
@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-overlay.open .modal { animation: modalSlideUp .28s cubic-bezier(.22,1,.36,1); }

/* Inputs: foco con un leve halo verde en vez de solo cambio de borde */
.search.search:focus, .form-input.form-input:focus, .form-select.form-select:focus {
  box-shadow: 0 0 0 4px rgba(29,176,0,0.12);
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* Dark mode: header y botones mantienen el degradado, se ajusta sombra */
body.dark .header.header { background: linear-gradient(165deg, #202020 0%, #141414 100%); }
body.dark .btn-primary.btn-primary,
body.dark .fab.fab,
body.dark .filter-btn.active.active,
body.dark .badge-servidor.badge-servidor,
body.dark .marca-btn.A.A { background: linear-gradient(135deg, #22c400, #189600); }

/* ═══════════════════════════════════════════════════════════════════════
   v1.5 — Fondo con degradado + tarjetas de estadísticas theme-aware
   (antes estos colores vivían en style="" inline generado por JS, por eso
   el dark mode nunca los alcanzaba — ahora son clases reales)
   ═══════════════════════════════════════════════════════════════════════ */

body.body {
  background: radial-gradient(ellipse 900px 500px at 50% -10%, #eef6ea 0%, #f0f0f0 55%, #eceee9 100%);
  background-attachment: fixed;
}
body.dark.dark {
  background: radial-gradient(ellipse 900px 500px at 50% -10%, #17251a 0%, #14181580 40%, #101210 100%), #121412;
  background-attachment: fixed;
}

/* Resplandor sutil detrás del logo del header — el toque de firma */
.header.header { position: relative; overflow: visible; }
.header.header::before {
  content: '';
  position: absolute;
  top: -20px; left: 24px;
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(29,176,0,0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.header-left, .header > div:last-child { position: relative; z-index: 1; }

/* Cards de estadísticas del Dashboard (grid de género, tono por dato) */
.stat-mini {
  border-radius: 12px; padding: 12px; text-align: center;
  border: 0.5px solid #e8e8e8; background: #fff;
  transition: background .2s ease, border-color .2s ease;
}
.stat-mini .stat-num { font-size: 20px; font-weight: 700; }
.stat-mini .stat-label { font-size: 10px; margin-top: 2px; font-weight: 500; color: #888; }
.stat-mini[data-tone="blue"] .stat-num { color: #1565c0; }
.stat-mini[data-tone="pink"] .stat-num { color: #c2185b; }
.stat-mini[data-tone="purple"] .stat-num { color: #6a1b9a; }
.stat-mini[data-tone="pink2"] .stat-num { color: #ad1457; }
.stat-mini[data-tone="green"] { background: #e6f5e3; border-color: #1db000; }
.stat-mini[data-tone="green"] .stat-num, .stat-mini[data-tone="green"] .stat-label { color: #1db000; }
.stat-mini[data-tone="yellow"] { background: #fff8e1; border-color: #f9a825; }
.stat-mini[data-tone="yellow"] .stat-num, .stat-mini[data-tone="yellow"] .stat-label { color: #f57f17; }
.stat-mini[data-tone="rose"] { background: #fce4ec; border-color: #f48fb1; }
.stat-mini[data-tone="rose"] .stat-num, .stat-mini[data-tone="rose"] .stat-label { color: #c2185b; }
.stat-mini[data-tone="gray"] { background: #f5f5f5; border-color: #e0e0e0; }
.stat-mini[data-tone="gray"] .stat-num, .stat-mini[data-tone="gray"] .stat-label { color: #999; }

body.dark .stat-mini { background: #202a20; border-color: #33402f; }
body.dark .stat-mini .stat-label { color: #9db09a; }
body.dark .stat-mini[data-tone="blue"] .stat-num { color: #6fb3f5; }
body.dark .stat-mini[data-tone="pink"] .stat-num,
body.dark .stat-mini[data-tone="rose"] .stat-num { color: #f28ab0; }
body.dark .stat-mini[data-tone="purple"] .stat-num { color: #c092e0; }
body.dark .stat-mini[data-tone="pink2"] .stat-num { color: #f296bd; }
body.dark .stat-mini[data-tone="green"] { background: rgba(29,176,0,0.14); border-color: #1db000; }
body.dark .stat-mini[data-tone="yellow"] { background: rgba(245,168,37,0.14); border-color: #f5a823; }
body.dark .stat-mini[data-tone="rose"] { background: rgba(244,143,177,0.14); border-color: #f48fb1; }
body.dark .stat-mini[data-tone="gray"] { background: rgba(255,255,255,0.05); border-color: #3a3a3a; }

/* Card verde "Servidores activos" */
.card-highlight {
  border-radius: 12px; padding: 12px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  background: #e6f5e3; border: 0.5px solid #1db000;
}
.card-highlight .ch-label { font-size: 13px; font-weight: 600; color: #111; }
.card-highlight .ch-num { font-size: 22px; font-weight: 800; color: #1db000; }
body.dark .card-highlight { background: rgba(29,176,0,0.12); border-color: #1db000; }
body.dark .card-highlight .ch-label { color: #fff; }

/* Card amarillo de alertas */
.card-alertas {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; margin-top: 10px;
  background: #fff8e6; border: 0.5px solid #f5c842;
}
body.dark .card-alertas { background: rgba(245,168,37,0.10); border-color: #f5a823; }
body.dark .card-alertas > div:first-child > div:nth-child(2) { color: #fff; }

.nva-day-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 0.5px solid rgba(0,0,0,0.06); }
.nva-day-nombre { font-size: 13px; font-weight: 600; color: #111; }
body.dark .nva-day-row { border-bottom-color: rgba(255,255,255,0.08); }
body.dark .nva-day-nombre { color: #fff; }

.alerta-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 0.5px solid rgba(0,0,0,0.06); }
.alerta-nombre { font-size: 13px; font-weight: 600; color: #111; }
body.dark .alerta-row { border-bottom-color: rgba(255,255,255,0.08); }
body.dark .alerta-nombre { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   v1.6 — Segunda pasada de pulido: transiciones entre pestañas, entrada
   escalonada de listas, login con más presencia, Gestión y Consolidación
   con más carácter, y una base de accesibilidad (foco visible, reduced
   motion). Igual que en v1.4: un acento por pantalla, nada saturado.
   ═══════════════════════════════════════════════════════════════════════ */

/* — Transición entre pestañas ————————————————————————————————————————— */
@keyframes tabIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.section.active { animation: tabIn .22s cubic-bezier(.22,1,.36,1); }

/* — Entrada escalonada de listas ———————————————————————————————————————
   Se aplica a las cards/filas generadas dinámicamente (Registro, Personas,
   Consolidación, Dashboard). No requiere tocar el JS: la animación corre
   sola en cuanto el elemento se inserta en el DOM. */
@keyframes itemIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#registro-list > .persona-row,
#personas-list > .persona-card,
#consolidacion-list > .card {
  animation: itemIn .28s cubic-bezier(.22,1,.36,1) both;
}
#registro-list > .persona-row:nth-child(1),  #personas-list > .persona-card:nth-child(1),  #consolidacion-list > .card:nth-child(1)  { animation-delay: .00s; }
#registro-list > .persona-row:nth-child(2),  #personas-list > .persona-card:nth-child(2),  #consolidacion-list > .card:nth-child(2)  { animation-delay: .03s; }
#registro-list > .persona-row:nth-child(3),  #personas-list > .persona-card:nth-child(3),  #consolidacion-list > .card:nth-child(3)  { animation-delay: .06s; }
#registro-list > .persona-row:nth-child(4),  #personas-list > .persona-card:nth-child(4),  #consolidacion-list > .card:nth-child(4)  { animation-delay: .09s; }
#registro-list > .persona-row:nth-child(5),  #personas-list > .persona-card:nth-child(5),  #consolidacion-list > .card:nth-child(5)  { animation-delay: .12s; }
#registro-list > .persona-row:nth-child(6),  #personas-list > .persona-card:nth-child(6),  #consolidacion-list > .card:nth-child(6)  { animation-delay: .15s; }
#registro-list > .persona-row:nth-child(n+7), #personas-list > .persona-card:nth-child(n+7), #consolidacion-list > .card:nth-child(n+7) { animation-delay: .17s; }

.stat-mini { animation: itemIn .3s cubic-bezier(.22,1,.36,1) both; }
.stat-mini:nth-child(1) { animation-delay: .02s; } .stat-mini:nth-child(2) { animation-delay: .05s; }
.stat-mini:nth-child(3) { animation-delay: .08s; } .stat-mini:nth-child(4) { animation-delay: .11s; }
.stat-mini:nth-child(5) { animation-delay: .14s; } .stat-mini:nth-child(6) { animation-delay: .17s; }
.stat-mini:nth-child(7) { animation-delay: .20s; } .stat-mini:nth-child(8) { animation-delay: .23s; }

.tendencia-bar-col .tendencia-bar { animation: barGrow .5s cubic-bezier(.22,1,.36,1) both; }
@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

/* — Login: más presencia sin volverse ruidoso —————————————————————————— */
.login-screen {
  background: radial-gradient(ellipse 700px 500px at 50% 15%, #14200f 0%, #111 60%);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 340px; height: 340px;
  top: -140px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(29,176,0,0.28) 0%, transparent 70%);
  animation: loginGlow 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes loginGlow {
  0%, 100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;  transform: translateX(-50%) scale(1.08); }
}
.login-logo, .login-title, .login-sub, .btn-google, #login-error {
  position: relative; z-index: 1;
  animation: itemIn .5s cubic-bezier(.22,1,.36,1) both;
}
.login-logo  { animation-delay: .03s; box-shadow: 0 8px 30px rgba(29,176,0,0.25); }
.login-title { animation-delay: .10s; }
.login-sub   { animation-delay: .16s; }
.btn-google  { animation-delay: .22s; transition: transform .15s ease, box-shadow .2s ease; box-shadow: 0 4px 16px rgba(0,0,0,0.35); }
.btn-google:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn-google:hover { box-shadow: 0 6px 22px rgba(0,0,0,0.45); transform: translateY(-1px); }
}

/* — Gestión: acciones con ícono propio, se sienten a botones reales ——————— */
.accion-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px 12px;
  transition: transform .12s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.accion-btn::before {
  content: ''; width: 26px; height: 26px; border-radius: 8px;
  background: #f0f0ee; display: block;
}
.accion-btn:active { transform: scale(0.96); }
@media (hover: hover) {
  .accion-btn:hover { box-shadow: 0 4px 14px rgba(29,176,0,0.12); transform: translateY(-1px); }
}
.card .accion-row:nth-of-type(2) .accion-btn:nth-child(1)::before { content: '＋'; font-size: 15px; line-height: 26px; text-align: center; color: #1db000; background: #e6f5e3; }
.card .accion-row:nth-of-type(2) .accion-btn:nth-child(2)::before { content: '📅'; font-size: 13px; line-height: 26px; text-align: center; }
.card .accion-row:nth-of-type(3) .accion-btn:nth-child(1)::before { content: '🗂'; font-size: 13px; line-height: 26px; text-align: center; }
.card .accion-row:nth-of-type(3) .accion-btn:nth-child(2)::before { content: '⚠'; font-size: 13px; line-height: 26px; text-align: center; color: #c62828; background: #fdecea; }
body.dark .accion-btn::before { background: #333; }

/* — Consolidación: los 3 pasos se sienten como un recorrido, no botones sueltos — */
.card > div[style*="flex-wrap"] { position: relative; padding-top: 4px; }
.paso-btn {
  position: relative;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.paso-btn.active {
  background: linear-gradient(135deg, #22c400, #189600);
  box-shadow: 0 2px 10px rgba(29,176,0,0.3);
}
.paso-btn:active { transform: scale(0.95); }
.paso-btn.active::before { content: '✓ '; }

/* — Accesibilidad: foco visible siempre, sin importar el elemento —————————— */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #1db000;
  outline-offset: 2px;
}

/* — Respeta preferencia de movimiento reducido del sistema ————————————————— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}