:root {
  --bg: #f0f4f8;
  --card: #fff;
  --text: #1a2535;
  --muted: #6b7785;
  --border: rgba(15, 23, 42, 0.1);
  --primary: #2f6f7e;
  --accent: #7bc8b7;
  --pastoral: #1e3a5f;
  --finance: #27ae60;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 88px;
}

.hero {
  background: linear-gradient(135deg, #1d5162, #2f6f7e 55%, #4a9ba8);
  color: #fff;
  padding: 22px 18px;
}
.hero-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.hero h1 { margin: 4px 0 0; font-size: 1.45rem; }
.hero-parish { opacity: 0.75; font-size: 0.88rem; }
.hero-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.tab-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.tab-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
}
.tab-btn {
  flex-shrink: 0;
  padding: 12px 18px;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn[data-grupo="pastoral"].active { color: var(--pastoral); border-bottom-color: var(--pastoral); }
.tab-btn[data-grupo="financeiro"].active { color: var(--finance); border-bottom-color: var(--finance); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 14px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Liturgia (ABP) */
.liturgia-links { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.liturgia-link-btn {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border: 1.5px solid rgba(47, 111, 126, 0.2);
  border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.liturgia-link-btn:hover { border-color: var(--primary); background: #eef6f8; }
.liturgia-link-icon { font-size: 1.8rem; }
.liturgia-link-titulo { font-weight: 700; font-size: 0.95rem; color: var(--pastoral); }
.liturgia-link-desc { font-size: 0.78rem; color: var(--muted); }
.liturgia-link-arrow { font-size: 1.4rem; color: var(--primary); margin-left: auto; }
.liturgia-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; margin-bottom: 12px; background: #e8f2f5; color: var(--primary); }
.card-title-lit { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: var(--pastoral); margin: 12px 0 8px; }
.leitura-item { border-left: 3px solid var(--accent); padding: 10px 14px; margin-bottom: 10px; background: #f8fafb; border-radius: 0 8px 8px 0; }
.leitura-ref { font-size: 0.78rem; color: var(--primary); font-weight: 700; margin-bottom: 4px; }
.leitura-titulo { font-size: 0.78rem; font-weight: 600; color: #555; margin-bottom: 4px; }
.leitura-texto { font-size: 0.92rem; line-height: 1.6; white-space: pre-line; }
.salmo-block { background: #f5f0e6; border-radius: 8px; padding: 12px 14px; margin: 10px 0; font-style: italic; }
.salmo-ref { font-size: 0.78rem; color: var(--primary); font-weight: 700; margin-bottom: 4px; font-style: normal; }
.salmo-refrão { font-weight: 700; color: var(--pastoral); margin-bottom: 6px; }
.evangelho-block { border: 2px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.evangelho-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #b8860b; letter-spacing: 1px; margin-bottom: 6px; }
.btn-liturgia-link, .btn-liturgia-retry { display: block; margin-top: 10px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; text-align: center; }
.btn-liturgia-link { background: var(--primary); color: #fff; text-decoration: none; }
.btn-liturgia-retry { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); width: 100%; }

/* Mural (ABP) */
.mural-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.mural-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mural-avatar { width: 38px; height: 38px; border-radius: 50%; background: #e8f2f5; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.mural-autor { font-weight: 700; font-size: 0.88rem; }
.mural-paroquia { font-size: 0.75rem; color: var(--muted); }
.mural-data { font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.mural-conteudo { font-size: 0.9rem; line-height: 1.6; }
.mural-foto { width: 100%; border-radius: 8px; margin-top: 10px; max-height: 300px; object-fit: cover; cursor: zoom-in; }
.mural-foto-preview { width: 100%; border-radius: 8px; margin-top: 10px; max-height: 200px; object-fit: cover; }
.mural-foto-group { margin: 10px 0; }
.mural-foto-remove { margin-top: 8px; }
.mural-lightbox { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.93); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.mural-lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.mural-lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.2); border: none; color: #fff; font-size: 1.2rem; padding: 8px 12px; border-radius: 8px; cursor: pointer; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.inner-card { margin-top: 8px; padding: 12px; }
.card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.88rem; }
.ok-msg { color: var(--finance); font-weight: 700; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stat {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: #eaf4f7;
}
.stat-val { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; }

.progress { height: 8px; background: #e5edf2; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.93rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
}
textarea { width: 100%; min-height: 90px; }
button, .btn {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
.btn-outline {
  background: #eef4f6;
  color: var(--primary);
  border: 1px solid var(--border);
  display: block;
  width: 100%;
  margin: 6px 0;
  text-align: left;
}
.quiz-opcoes { margin-top: 10px; }

.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
#appStatus { text-align: center; padding: 8px; color: var(--muted); }

.badge-grupo {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.badge-pastoral { background: rgba(30, 58, 95, 0.12); color: var(--pastoral); }
.badge-finance { background: rgba(39, 174, 96, 0.12); color: var(--finance); }
