/* =========================================================
   Tú Iglesia — Portal de líderes (login + dashboard + reporte)
   ========================================================= */

:root {
  --flame-1: #fbb040;
  --flame-2: #f26f21;
  --flame-3: #e12128;
  --flame-4: #d0155f;
  --accent: #e2542a;
  --ink: #17151a;
  --dark: #1d141a;
  --dark-2: #150f14;
  --muted: #6f6a72;
  --bg: #f6f2f3;
  --line: #e8e0e3;
  --white: #fff;
  --ok: #1e9e62;
  --warn: #e0a200;
  --grad: linear-gradient(120deg, var(--flame-2), var(--flame-3) 55%, var(--flame-4));
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --radius: 16px;
  --shadow: 0 18px 40px -20px rgba(29, 20, 26, 0.35);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1.5px solid transparent; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  padding: 0.7rem 1.3rem; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -12px rgba(208,21,95,0.6); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-danger { background: #fff; border-color: #f1c9cf; color: #c0182f; }
.btn-danger:hover { background: #fdecef; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- LOGIN ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(242,111,33,0.28), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(208,21,95,0.30), transparent 52%),
    linear-gradient(160deg, #2a1a22, #150f14);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--white); border-radius: 20px;
  box-shadow: var(--shadow); padding: 2rem; }
.auth-logo { display: block; height: 64px; margin: 0 auto 1.2rem; }
.auth-tabs { display: flex; gap: 0.5rem; background: #f1ecee; border-radius: 999px; padding: 5px; margin-bottom: 1.4rem; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 0.6rem; border-radius: 999px; font-weight: 600; color: var(--muted); }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -8px rgba(0,0,0,0.3); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-back { display: block; text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- Campos ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 1rem; background: #fcfbfc; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--flame-2); box-shadow: 0 0 0 4px rgba(242,111,33,0.13);
}
.note { min-height: 1.2em; font-size: 0.9rem; margin-top: 0.6rem; }
.note.error { color: #c0182f; }
.note.success { color: var(--ok); }
.row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ---------- PORTAL layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1.2rem; background: var(--dark-2); color: #fff;
}
.topbar .brand { display: flex; align-items: center; gap: 0.6rem; }
.topbar .brand img { height: 42px; }
.topbar .who { font-size: 0.85rem; color: rgba(255,255,255,0.75); text-align: right; }
.topbar .who strong { color: #fff; display: block; font-size: 0.95rem; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 60px); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1rem 0.8rem; }
.sidebar button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 0.7rem 0.9rem; border-radius: 12px; font-weight: 600; color: var(--ink); font-size: 0.95rem; margin-bottom: 0.2rem;
}
.sidebar button:hover { background: #f4eef0; }
.sidebar button.active { background: var(--grad); color: #fff; }
.sidebar .ico { font-size: 1.1rem; }
.content { padding: 1.6rem clamp(1rem, 3vw, 2.2rem); max-width: 1100px; }
.section { display: none; }
.section.active { display: block; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.6rem; color: var(--ink); }
.section-head .sub { color: var(--muted); font-size: 0.92rem; }

/* ---------- Cards / tablas ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: 0 8px 24px -18px rgba(0,0,0,0.25); margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 24px -18px rgba(0,0,0,0.25); }
.table th, .table td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.table th { background: #faf6f7; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge.especial { background: #fde7ef; color: var(--flame-4); }
.badge.normal { background: #eef0f3; color: #475; }
.badge.pending { background: #fff4d6; color: #8a6a00; }
.badge.active { background: #dcf3e7; color: var(--ok); }
.badge.disabled { background: #eee; color: #888; }
.badge.admin { background: var(--grad); color: #fff; }

/* Próximas actividades + navegación por mes */
.block-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); margin: 1.6rem 0 0.7rem; }
.proximas { display: grid; gap: 0.55rem; }
.prox-item { display: flex; align-items: center; gap: 0.9rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.9rem; }
.prox-item.hoy { border-color: var(--flame-3); box-shadow: 0 0 0 3px rgba(225,33,40,0.10); }
.prox-when { flex-shrink: 0; min-width: 96px; font-weight: 700; font-size: 0.82rem; color: var(--accent); text-transform: capitalize; }
.prox-when small { display: block; font-weight: 600; color: var(--muted); font-size: 0.74rem; }
.prox-body { flex: 1; }
.prox-body .t { font-weight: 600; }
.prox-hora { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.mes-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.mes-tab { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0.4rem 0.85rem; border-radius: 999px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.mes-tab:hover { background: #faf4f6; }
.mes-tab.active { background: var(--grad); color: #fff; border-color: transparent; }

.event-card { display: flex; gap: 1rem; align-items: flex-start; }
.event-card.hoy { border-color: var(--flame-3); box-shadow: 0 0 0 3px rgba(225,33,40,0.10); }
.event-date { flex-shrink: 0; width: 64px; height: 64px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; text-align: center; }
.event-date .d { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.event-date .m { font-size: 0.7rem; letter-spacing: 0.08em; color: #ffe0b8; text-transform: uppercase; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,15,20,0.55); display: none; place-items: center; z-index: 50; padding: 20px; }
.modal-backdrop.open { display: grid; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; padding: 1.6rem; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--ink); }
.modal .actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ---------- Feedback flotante ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(140%); background: var(--ink); color: #fff; padding: 0.8rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: 0.9rem; z-index: 80; transition: transform 0.3s; box-shadow: var(--shadow); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #c0182f; }
.toast.success { background: var(--ok); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; gap: 0.4rem; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.6rem; }
  .sidebar button { width: auto; white-space: nowrap; margin: 0; }
  .topbar .who { display: none; }
}

/* ---------- REPORTE imprimible ---------- */
.report { max-width: 900px; margin: 0 auto; padding: 2rem; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.report h1 { font-size: 1.8rem; color: var(--ink); }
.report .mini { color: var(--muted); font-size: 0.9rem; }
.report-group { margin-bottom: 2rem; }
.report-group h2 { font-size: 1.2rem; color: var(--flame-4); border-bottom: 2px solid var(--line); padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .report { padding: 0; }
  .table { box-shadow: none; }
}
