/*
 * SACRISTIA DIGITAL - Sistema de Gestão Paroquial
 * 
 * © 2026 TODOS OS DIREITOS RESERVADOS
 * Desenvolvido EXCLUSIVAMENTE por Rodrigo Dionízio
 * Instagram: @rodrigodionizio
 * https://www.instagram.com/rodrigodionizio/
 * 
 * PROIBIDA a reprodução, distribuição ou modificação
 * sem autorização expressa do autor.
 * 
 * ARQUIVO: styles.css
 * DESCRIÇÃO: Estilos Globais e Design System
 * VERSÃO: 5.0
 */

/* ==========================================================================
   1. DESIGN SYSTEM & VARIÁVEIS
   ========================================================================== */
:root {
  /* Paleta Institucional */
  --cor-cereja: #c82038;
  --cor-vinho: #a41d31;
  --cor-dourado: #fbb558;
  --cor-bege: #fceccb;
  --cor-fundo: #fff8e7;
  --text-main: #2c0e12;

  /* Liturgia Backgrounds (Tarjas) */
  --bg-verde: #2e7d32;
  --bg-branco: #f5f5f5;
  --bg-dourado: #fbb558;
  --bg-roxo: #6a1b9a;
  --bg-vermelho: #d32f2f;

  /* Liturgia Textos (Contraste Acessível) */
  --txt-verde: #2e7d32;
  --txt-branco: #575757;
  /* Cinza Escuro para ler no fundo claro */
  --txt-dourado: #a67c00;
  --txt-roxo: #6a1b9a;
  --txt-vermelho: #d32f2f;

  /* UI Metrics */
  --radius-main: 16px;

  /* Tipografia */
  --font-titulo: "Neulis", "Roboto", "Helvetica", "Arial", sans-serif;
  --font-texto: "AntennaCond", "Segoe UI", "Roboto", "Arial", sans-serif;

  /* ========================================
     EXTENSÃO: Variações HSL (SDS v6.8)
     Compatível com sistema atual
     ======================================== */

  /* Conversão das cores institucionais para HSL */
  --vinho-hsl: 351 70% 38%;
  /* Equivalente a #a41d31 */
  --dourado-hsl: 41 95% 66%;
  /* Equivalente a #fbb558 */

  /* Variações de Vinho (para sutilezas) */
  --vinho-profundo: 351 75% 15%;
  /* Vinho muito escuro */
  --vinho-medio: 351 70% 38%;
  /* Vinho base (atual) */
  --vinho-claro: 351 50% 60%;
  /* Vinho médio */
  --vinho-suave: 351 40% 95%;
  /* Vinho quase branco */

  /* Variações de Dourado (para destaques) */
  --dourado-escuro: 41 60% 35%;
  /* Dourado profundo */
  --dourado-medio: 41 95% 66%;
  /* Dourado base (atual) */
  --dourado-claro: 41 95% 85%;
  /* Dourado suave */

  /* Efeitos Modernos */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(164, 29, 49, 0.1);
  --shadow-solene: 0 10px 30px -10px rgba(164, 29, 49, 0.15);
}

/* ==========================================================================
   1.1 ACESSIBILIDADE (A11Y) — Utilitários WCAG 2.1 AA
   ========================================================================== */

/* Oculta visualmente mas mantém acessível para leitores de tela (A11Y-005) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Badges de prioridade com contraste mínimo WCAG AA 4.5:1 (A11Y-007) */
/* Urgente: #C62828 branco = 5.12:1 ✅ */
.badge-prioridade-urgente {
  display: inline-block;
  padding: 3px 8px;
  background: #C62828;
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Importante: #BF360C laranja escuro branco = 4.6:1 ✅ */
.badge-prioridade-importante {
  display: inline-block;
  padding: 3px 8px;
  background: #BF360C;
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Normal: #1565C0 azul escuro branco = 5.9:1 ✅ */
.badge-prioridade-normal {
  display: inline-block;
  padding: 3px 8px;
  background: #1565C0;
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Indicadores de tempo litúrgico acessíveis (A11Y-003) */
.liturgia-tempo-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* UX-001: área de toque expandida nos dots mobile — mínimo 44×44px (Google Material / Apple HIG) */
.event-dot-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
  margin: -18px -10px;
  cursor: pointer;
}

/* UX-005: skeleton loading do grid de calendário */
.skeleton-cell {
  background: linear-gradient(
    90deg,
    var(--color-surface, #f3f4f6) 25%,
    var(--color-surface-hover, #e5e7eb) 50%,
    var(--color-surface, #f3f4f6) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  animation-delay: calc(var(--sk-i, 0) * 25ms);
  border-radius: 4px;
  min-height: 60px;
}

.skeleton-day-num {
  display: block;
  width: 24px;
  height: 16px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  margin: 6px 0 0 6px;
}

@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* UX-006: fade-out na borda inferior do mural indicando mais conteúdo */
.mural-avisos-wrapper {
  position: relative;
}

.mural-avisos-wrapper::after {
  content: '';
  position: absolute;
  bottom: 48px; /* acima do botão "Ver Todos" */
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--color-background, #f8f9fa));
  pointer-events: none;
}

/* ==========================================================================
   2. FONT FACES (IMPORTAÇÃO TIPOGRAFIA)
   ========================================================================== */
/* Humming */
@font-face {
  font-family: "Humming";
  src: url("../fonts/Humming.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Neulis (Família Completa) */
@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-BlackItalic.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-ExtraBold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-ExtraBoldItalic.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-ExtraLight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-ExtraLightItalic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-LightItalic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-MediumItalic.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-SemiBold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-SemiBoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neulis";
  src: url("../fonts/Neulis-ThinItalic.otf") format("opentype");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}

/* AntennaCond (Família Completa) */
@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-blackitalic.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-bold-italic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-extra-light-italic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-extralight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-light-italic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-medium-italic.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-thin-italiclic.otf") format("opentype");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond-thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AntennaCond";
  src: url("../fonts/antennacond_.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   3. RESET & BASE
   ========================================================================== */
body {
  background-color: var(--cor-fundo) !important;
  color: var(--text-main);
  font-family: "AntennaCond", "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* App-like feel, impede scroll no body */

  /* NOVO: Background Radial Sutil (SDS v6.8) */
  background-image:
    radial-gradient(at 0% 0%, rgba(251, 181, 88, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(164, 29, 49, 0.03) 0px, transparent 50%);
}

/* ==========================================================================
   4. CABEÇALHO (HEADER)
   ========================================================================== */
header {
  background-color: var(--cor-vinho);
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border-bottom: 4px solid var(--cor-dourado);
  position: relative;
  /* Para posicionar o botão mobile */
}

.header-logo-container {
  height: 50px;
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* Botão Menu Mobile (Padrão: Escondido no Desktop) */
#btn-mobile-menu {
  display: none;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
  position: absolute;
  left: 15px;
  /* Fica na esquerda no mobile */
}

/* ==========================================================================
   5. LAYOUT GERAL & SIDEBAR
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  background-color: var(--cor-fundo);
  background: var(--cor-fundo);
}

.sidebar {
  width: 260px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  box-sizing: border-box;
}

/* Container do Mural e Mini-Calendário */
.mini-calendar {
  /* Se for usado como placeholder, senão o Mural substitui */
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #888;
  font-size: 0.8rem;
}

/* Filtros */
.filter-group h3 {
  font-family: "Neulis", sans-serif;
  /* ALTERADO: Fonte segura para acentos */
  font-size: 0.85rem;
  /* Levemente maior pois a Neulis é mais larga */
  text-transform: uppercase;
  color: var(--cor-vinho);
  margin-bottom: 10px;
  opacity: 1;
  /* Removida opacidade para ficar mais nítido */
  font-weight: 700;
  letter-spacing: 0.5px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #444;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--cor-vinho);
  border-radius: 4px;
  display: inline-block;
}

.checkbox-custom.checked {
  background-color: var(--cor-vinho);
}

/* Scroll na lista de equipes se for muito grande */
#filtro-equipes {
  overflow-y: auto;
  flex: 1;
  /* Ocupa o espaço disponível */
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--cor-vinho) #eee;
}

#filtro-equipes::-webkit-scrollbar {
  width: 6px;
}

#filtro-equipes::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 3px;
}

#filtro-equipes::-webkit-scrollbar-thumb {
  background-color: var(--cor-vinho);
  border-radius: 3px;
}

/* 🆕 Scroll e estilos para filtro de comunidades */
#filtro-comunidades {
  overflow-y: auto;
  max-height: 300px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--cor-dourado) #eee;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#filtro-comunidades::-webkit-scrollbar {
  width: 6px;
}

#filtro-comunidades::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 3px;
}

#filtro-comunidades::-webkit-scrollbar-thumb {
  background-color: var(--cor-dourado);
  border-radius: 3px;
}

/* Badge de cor da comunidade */
.community-badge {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Item de filtro ativo */
.filter-item.active {
  background: rgba(251, 181, 88, 0.1);
  padding: 8px;
  margin: 0 -8px 8px -8px;
  border-radius: 6px;
  font-weight: 600;
}

/* ==========================================================================
   10. MODAL DE EDIÇÃO E FORMULÁRIOS
   ========================================================================== */

/* --- PILLS POR CATEGORIA (GRID CALENDÁRIO - SDS v6.6) --- */

/* Base da Pílula (Atomic Component) */
.pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-texto);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  /* UX: Indica clicável */
  transition: transform 0.1s;
}

.pill:hover {
  transform: scale(1.02);
}

/* 1. PADRE (Dark Charcoal - Novo Cor) */
.pill--padre {
  border-left: 4px solid #2e3fd1ff !important;
  background-color: #f6f7f6;
  color: #2e3fd1ff;
}

/* 2. REUNIÃO (Slate Blue) */
.pill--reuniao {
  border-left: 4px solid #475569 !important;
  background-color: #f1f5f9;
  color: #475569;
}

/* 3. FESTA (Dourado) */
.pill--festa {
  border-left: 4px solid var(--cor-dourado) !important;
  background-color: #fffdf5;
  color: #a67c00;
}

/* 4. LITURGIA (Mantém a cor litúrgica dinâmica como borda) */
.pill--liturgia {
  background-color: #f8f9fa;
  color: var(--text-main);
  font-weight: 300;
  /* Hierarquia Visual: Mais destaque */
}

/* ==========================================================================
   HIERARQUIA VISUAL DE EVENTOS (SDS v6.7 - Refinamento Tipográfico)
   ========================================================================== */
/* 
 * PRIORIDADE DE DESTAQUE:
 * 1. Liturgia (font-weight: 600) - Celebrações litúrgicas têm máxima prioridade
 * 2. Reunião (font-weight: 500) - Atividades pastorais e reuniões
 * 3. Atendimento (font-weight: 400) - Atendimentos e compromissos do padre
 */

.pill--reuniao {
  font-weight: 300;
  /* Hierarquia Visual: Destaque médio */
}

.pill--padre {
  font-weight: 300;
  /* Hierarquia Visual: Destaque suave */
}

.pill--festa {
  font-weight: 300;
  /* Hierarquia Visual: Destaque médio (eventos sociais) */
}

/* ==========================================================================
   6. MURAL DE AVISOS (NOVA FEATURE)
   ========================================================================== */
.mural-avisos-wrapper {
  margin-top: 30px;
  margin-bottom: 30px;
}

.mural-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mural-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  border-bottom: 2px solid var(--cor-vinho);
  padding-bottom: 5px;
}

.mural-title {
  font-family: "Neulis", sans-serif;
  /* ALTERADO */
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cor-vinho);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mural-badge {
  background: var(--cor-cereja);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.aviso-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #ccc;
  transition: transform 0.2s;
  cursor: default;
  position: relative; /* Para posicionar "Ler Mais" absoluto */
}

.aviso-card:hover {
  transform: translateX(3px);
}

/* Prioridades do Mural */
.prio-1 {
  border-left-color: var(--cor-cereja);
  background-color: #fff5f5;
}

/* Urgente */
.prio-2 {
  border-left-color: var(--cor-dourado);
}

/* Atenção */
.prio-3 {
  border-left-color: #2196f3;
}

/* Info */

/* Tipografia do Aviso */
.aviso-tag {
  font-family: "Neulis", sans-serif;
  /* ALTERADO: Para ler melhor "AMANHÃ" */
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  background-color: #eee;
  color: #555;
}

.tag-urgente {
  background-color: var(--cor-cereja);
  color: white;
  animation: pulse 2s infinite;
}

.aviso-titulo {
  font-family: "Neulis", sans-serif;
  /* ALTERADO */
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.3;
  margin-bottom: 4px;
}

.aviso-meta {
  font-size: 0.75rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Descrição truncada com "Ler Mais" */
.aviso-descricao {
  font-size: 0.85rem;
  color: #666;
  max-height: 70px;
  overflow: hidden;
  margin-top: 6px;
  line-height: 1.5;
  padding-bottom: 25px; /* Espaço para o link "Ler Mais" */
}

.aviso-ler-mais {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: var(--cor-vinho);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.aviso-ler-mais:hover {
  color: var(--cor-cereja);
  text-decoration: underline;
}

/* Botão "Ver Todos os Avisos" */
.btn-ver-todos {
  width: 100%;
  padding: 10px;
  background: var(--cor-vinho);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-family: "Neulis", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.btn-ver-todos:hover {
  background: var(--cor-cereja);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

/* ==========================================================================
   7. CONTEÚDO PRINCIPAL (CALENDÁRIO)
   ========================================================================== */
.main-content {
  background-color: #fff8e7 !important;
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.scroll-wrapper {
  background-color: #fff8e7 !important;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.month-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c0e12;
  margin: 0;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.btn-nav {
  border: 1px solid #ccc;
  background: transparent;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-nav:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Grid Container */
.calendar-wrapper {
  border: 1px solid #ddd;
  border-radius: var(--radius-main);
  overflow: hidden;
  background-color: #ddd;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

.day-header {
  background-color: #fff;
  padding: 10px 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
}

.day-cell {
  background-color: #fff;
  min-height: 120px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.day-cell:hover {
  background-color: #fafafa;
}

/* ==========================================================================
   DESTAQUE DO DIA ATUAL (Feature "Hoje")
   ========================================================================== */
.day-cell.today {
  position: relative;
  background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%) !important;
  border: 2px solid var(--cor-dourado) !important;
  box-shadow: 0 4px 12px rgba(251, 181, 88, 0.3) !important;
  transform: scale(1.02);
  z-index: 10; /* Garante que fique acima de células adjacentes */
}

/* Indicador visual extra (círculo dourado no canto superior direito) */
.day-cell.today::before {
  content: "●";
  position: absolute;
  top: 5px;
  right: 8px;
  color: var(--cor-dourado);
  font-size: 1.2rem;
  animation: pulse-today 2s ease-in-out infinite;
}

@keyframes pulse-today {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

/* Responsividade Mobile: Destaque mais discreto */
@media (max-width: 768px) {
  .day-cell.today {
    border-width: 2px;
    transform: scale(1);
  }
  
  .day-cell.today::before {
    font-size: 0.9rem;
    top: 2px;
    right: 2px;
  }
}

.day-number {
  font-weight: 700;
  font-size: 1rem;
  color: #333;
  margin-bottom: 5px;
  display: block;
}

.other-month {
  background-color: #f4f4f4;
  opacity: 0.85;
  pointer-events: none;
}

/* Filtros Visuais (Grid) */
.hidden-by-filter {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(100%);
}

.highlight-filter {
  background-color: #fff9e6;
  border: 2px solid var(--cor-dourado);
}

/* Pílulas de Evento (Grid) */
.pill {
  font-size: 0.75rem;
  margin-bottom: 2px;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: var(--cor-vinho);
  color: #fff;
  border-left: 3px solid var(--cor-dourado);
}

.pill--glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(164, 29, 49, 0.15);
  color: var(--text-main);
}

.pill.solenidade {
  background-color: var(--cor-dourado);
  color: var(--cor-vinho);
  border-left: 3px solid #fff;
}

/* ==========================================================================
   8. RODAPÉ (FOOTER)
   ========================================================================== */
.main-footer {
  background-color: var(--cor-vinho);
  color: var(--cor-bege);
  padding: 50px 20px 20px 20px;
  border-top: 5px solid var(--cor-dourado);
  margin-top: auto;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-logo {
  max-width: 180px;
  margin-bottom: 15px;
  opacity: 0.9;
}

.footer-heading {
  color: var(--cor-dourado);
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(251, 181, 88, 0.3);
  padding-bottom: 10px;
  margin-bottom: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.footer-col p {
  margin: 5px 0;
  font-size: 0.95rem;
}

.footer-subtitle {
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.8;
}

.destaque-atendimento {
  color: var(--cor-dourado) !important;
  font-weight: bold;
}

.destaque-atendimento span {
  font-weight: normal;
  color: var(--cor-bege);
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--cor-bege);
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: fit-content;
  margin-bottom: 15px;
  font-size: 0.9rem;
  transition: 0.3s;
}

.btn-whatsapp:hover {
  background-color: #25d366;
  border-color: #25d366;
  color: #fff;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.social-links a {
  color: var(--cor-bege);
  transition: transform 0.2s;
}

.social-links a:hover {
  color: var(--cor-dourado);
  transform: scale(1.1);
}

.footer-copyright {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   9. COMPONENTE: MODAL (POPUP)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 14, 18, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  width: 95%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-sidebar-color {
  width: 10px;
  flex-shrink: 0;
}

.modal-body {
  padding: 20px;
  flex: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.modal-day {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
}

.modal-month {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cor-vinho);
}

.modal-weekday {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
}

.modal-liturgia {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-titulo {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-main);
  line-height: 1.2;
}

/* Lista de Escalas */
.escala-item {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px dashed #eee;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.escala-hora {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 10px;
  color: #555;
}

.equipe-row {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  flex-wrap: nowrap;
}

.equipe-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  opacity: 0.8;
  flex-shrink: 0;
}

.equipe-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #999;
  margin-right: 5px;
  font-weight: 600;
  width: 55px;
  flex-shrink: 0;
}

.equipe-val {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
  white-space: normal;
  line-height: 1.2;
}

.btn-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  background: #eee;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  border: none;
  font-weight: bold;
  font-size: 1.2rem;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botão Admin */
.btn-admin-action {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background-color: #2c0e12;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s;
}

.btn-admin-action:hover {
  background-color: var(--cor-cereja);
}

/* ==========================================================================
   10. RESPONSIVIDADE (MEDIA QUERIES) & MENU MOBILE
   ========================================================================== */

/* MÁSCARA ESCURA (Overlay do Menu) */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

#sidebar-overlay.active {
  display: block;
}

/* DESKTOP (Telas maiores que 768px) */
@media (min-width: 768px) {
  .header-logo-container {
    height: 60px;
    margin: 0;
  }

  header {
    justify-content: space-between;
  }

  .modal-card {
    width: 600px;
    max-width: 600px;
  }

  .modal-body {
    padding: 35px;
  }

  .modal-day {
    font-size: 2.8rem;
  }

  .modal-titulo {
    font-size: 1.5rem;
  }

  .modal-sidebar-color {
    width: 15px;
  }
}

/* MOBILE (Celulares menores que 768px) */
@media (max-width: 768px) {
  /* Mostra botão de menu */
  #btn-mobile-menu {
    display: block;
  }

  header {
    justify-content: center;
  }

  .header-logo-img {
    max-height: 40px;
  }

  /* SIDEBAR VIRA GAVETA */
  .sidebar {
    display: flex !important;
    /* Força exibir para animação */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    background: #fff;
    z-index: 100;
    transform: translateX(-100%);
    /* Esconde na esquerda */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Desliza para dentro */

  .month-name {
    font-size: 1.4rem;
  }

  .day-header {
    font-size: 0.65rem;
    padding: 5px 0;
  }

  /* Grid Compacto */
  .day-cell {
    min-height: 55px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px;
  }

  .pill {
    font-size: 0px;
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: inline-block;
    margin: 2px 1px;
  }

  .footer-container {
    text-align: center;
  }

  .footer-col {
    align-items: center;
  }

  .btn-whatsapp {
    margin: 0 auto 15px auto;
  }

  .social-links {
    justify-content: center;
  }
}

/* ==========================================================================
   11. ESTILOS DE IMPRESSÃO (PDF A4)
   ========================================================================== */
/* REGRA DE OURO: Esconde o relatório na tela normal */

/* 1. Esconde o relatório da tela do navegador */
#relatorio-impressao,
.print-only {
  display: none !important;
}

@media print {
  /* 2. "Reseta" o corpo da página para impressão */
  html,
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* 3. ESCONDE TUDO (Header, Sidebar, App, Modais, etc.) */
  body > *:not(#relatorio-impressao) {
    display: none !important;
  }

  /* 4. EXIBE APENAS O RELATÓRIO */
  #relatorio-impressao {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 5. CABEÇALHO DO PDF (SDS v6.0 - Novo Shell) */
  /* 5. CABEÇALHO DO PDF (SDS v6.0 - Novo Shell Refined) */
  .print-header {
    display: grid !important;
    grid-template-columns: 80px 1fr 200px !important;
    /* Grid Fix: 80px Logo | 1fr Title | 200px Period */
    align-items: center !important;
    border-bottom: 2px solid var(--cor-vinho) !important;
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
  }

  .print-header__logo {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .print-logo-circ {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 !important;
  }

  .print-header__info {
    padding-left: 20px !important;
  }

  .print-header__title {
    font-family:
      "Neulis", "Roboto", "Helvetica", "Arial", sans-serif !important;
    font-size: 16pt !important;
    color: var(--cor-vinho) !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  .print-header__subtitle {
    font-family:
      "AntennaCond", "Segoe UI", "Roboto", "Arial", sans-serif !important;
    font-size: 11pt !important;
    color: #666 !important;
    margin-top: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    font-weight: normal !important;
  }

  .print-header__period {
    text-align: right !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    border-left: 1px solid #ddd !important;
    padding-left: 15px !important;
  }

  .print-header__label {
    font-size: 8pt !important;
    text-transform: uppercase !important;
    color: #666 !important;
    display: block !important;
    font-family: "AntennaCond", sans-serif !important;
  }

  .print-header__month {
    font-size: 18pt !important;
    color: var(--cor-vinho) !important;
    line-height: 1 !important;
    margin: 0 !important;
    font-family: "Neulis", "Roboto", "Arial", sans-serif !important;
  }

  .print-header__year {
    font-size: 12pt !important;
    color: var(--cor-dourado) !important;
    font-weight: bold !important;
    font-family: "AntennaCond", sans-serif !important;
  }

  /* 6. TABELA DE DADOS */
  .print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 5px !important;
    table-layout: auto !important;
  }

  .print-table th {
    background-color: #a41d31 !important;
    color: white !important;
    padding: 10px !important;
    text-align: left !important;
    font-size: 9pt !important;
    text-transform: uppercase !important;
    border-bottom: 3px solid #fbb558 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-table td {
    padding: 10px !important;
    border-bottom: 1px solid #ddd !important;
    vertical-align: top !important;
    font-size: 10pt !important;
  }

  /* Destaque para Domingos e Solenidades */
  .row-domingo {
    background-color: #fff9e6 !important;
    /* Bege/Dourado claríssimo */
    border-left: 6px solid var(--cor-dourado) !important;
    -webkit-print-color-adjust: exact;
    /* Força a cor no PDF */
    print-color-adjust: exact;
  }

  .row-domingo .dia-grande {
    color: var(--cor-vinho) !important;
    font-weight: 900 !important;
  }

  /* --- DESTAQUES POR CATEGORIA (fundos sólidos — rgba de baixa opacidade desaparece na impressão) --- */
  .cat-padre {
    background-color: #fef6f7 !important;
    border-left: 6px solid #a41d31 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cat-reuniao {
    background-color: #f4f6f8 !important;
    border-left: 6px solid #607d8b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cat-festa {
    background-color: #fffbf0 !important;
    border-left: 6px solid var(--cor-dourado) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Faixas laterais coloridas por tempo litúrgico (missas feriais) */
  .row-liturgia-verde {
    background-color: #f0f7f1 !important;
    border-left: 6px solid #2e7d32 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .row-liturgia-roxo {
    background-color: #f5f0fa !important;
    border-left: 6px solid #6a1b9a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .row-liturgia-vermelho {
    background-color: #fff0f0 !important;
    border-left: 6px solid #c62828 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .row-liturgia-rosa {
    background-color: #fce4ec !important;
    border-left: 6px solid #d81b60 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Estilização das Colunas */
  .col-data {
    width: 12% !important;
    text-align: center !important;
    border-right: 1px solid #eee !important;
  }

  .dia-grande {
    font-size: 16pt !important;
    font-weight: 700 !important;
    color: #a41d31 !important;
    display: block !important;
  }

  .dia-sem {
    font-size: 8pt !important;
    text-transform: uppercase !important;
    color: #888 !important;
  }

  .print-titulo {
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    font-size: 11pt !important;
  }

  .print-liturgia {
    font-size: 8pt !important;
    color: #666 !important;
    text-transform: uppercase !important;
  }

  /* Verticalização da Coluna de Detalhes (SDS v6.0 Refined) */
  .print-escala-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .print-escala-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
  }

  .print-escala-icon {
    font-size: 12pt !important;
    line-height: 1 !important;
    width: 16px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }

  .print-escala-content {
    display: flex !important;
    flex-direction: column !important;
  }

  .print-escala-label {
    font-size: 7pt !important;
    color: #666 !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    margin-bottom: 1px !important;
  }

  .print-escala-value {
    font-weight: 600 !important;
    color: #222 !important;
    font-size: 10.5pt !important;
  }

  /* Badge de horário de cada celebração */
  .print-hora {
    display: inline-block !important;
    background: #a41d31 !important;
    color: #ffffff !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Variantes de cor do badge por categoria de linha */
  .cat-reuniao .print-hora {
    background: #607d8b !important;
  }

  .cat-festa .print-hora {
    background: #7a5a00 !important;
  }

  /* Texto de equipes ao lado do badge de horário */
  .print-equipes {
    font-size: 9pt !important;
    line-height: 1.5 !important;
    color: #333 !important;
    flex: 1 !important;
  }

  /* 7. RODAPÉ DO PAPEL — usa fluxo normal para não sobrepor conteúdo em multi-páginas */
  .print-footer {
    margin-top: 24pt !important;
    border-top: 1px solid #ccc !important;
    padding: 10px 0 !important;
    font-size: 8pt !important;
    color: #888 !important;
    display: flex !important;
    justify-content: space-between !important;
  }

  /* Separador de mês em relatórios multi-mês (trimestre / ano) */
  .print-mes-separator {
    background-color: #a41d31 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 8pt !important;
    letter-spacing: 1px !important;
    padding: 7px 10px !important;
    border-top: 10px solid white !important;
    border-bottom: 3px solid #fbb558 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Legenda de cores litúrgicas no final do relatório */
  .print-legend {
    margin-top: 14pt !important;
    padding-top: 8pt !important;
    border-top: 1px solid #e0e0e0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
  }

  .print-legend__label {
    font-size: 7pt !important;
    color: #777 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  .print-legend__item {
    font-size: 7pt !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
  }

  /* Evita quebra de linha no meio de um evento */
  tr {
    page-break-inside: avoid;
  }

  @page {
    size: A4;
    margin: 1.5cm 1cm 2cm 1cm !important;
  }
}

/* ==========================================================================
   12. COMPONENTES DE SINCRONIZAÇÃO (PÚBLICO E ADMIN)
   ========================================================================== */

.c-sync-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
}

.c-sync-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-family: "AntennaCond", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.c-sync-button:hover {
  border-color: var(--cor-dourado);
  background: #fdfaf3;
  transform: translateY(-2px);
}

/* Bell de Lembrete SDS */
.c-alert-bell {
  font-size: 1.4rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.3s;
}

.c-alert-bell.is-active {
  color: var(--cor-dourado);
  filter: drop-shadow(0 0 5px rgba(251, 181, 88, 0.4));
}

/* ==========================================================================
   13. ANIMAÇÕES PARA AUTO-REFRESH
   ========================================================================== */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ==========================================================================
   14. UTILITÁRIOS MODERNOS "SOLENE" (SDS v6.8)
   Efeitos visuais opcionais - Não afetam componentes existentes
   ========================================================================== */

/* Glassmorphism Card (Efeito Vidro Fosco) */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Safari */
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-solene);
}

/* Variante: Glass com fundo vinho */
.glass-card--vinho {
  background: rgba(164, 29, 49, 0.05);
  border: 1px solid rgba(164, 29, 49, 0.15);
}

/* Variante: Glass com fundo dourado */
.glass-card--dourado {
  background: rgba(251, 181, 88, 0.05);
  border: 1px solid rgba(251, 181, 88, 0.15);
}

/* Gradiente de Texto Vinho */
.text-gradient-vinho {
  background: linear-gradient(135deg, #a41d31, #5a0f1a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #a41d31;
  /* Fallback para navegadores antigos */
}

/* Gradiente de Texto Dourado */
.text-gradient-dourado {
  background: linear-gradient(135deg, #fbb558, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #fbb558;
  /* Fallback */
}

/* Sombra Solene (Mais Suave) */
.shadow-solene {
  box-shadow: var(--shadow-solene);
}

/* Sombra Solene Forte */
.shadow-solene-strong {
  box-shadow: 0 20px 50px -15px rgba(164, 29, 49, 0.25);
}

/* Hover: Elevação Suave */
.hover-elevate {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.hover-elevate:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px -12px rgba(164, 29, 49, 0.2);
}

/* Background Radial Sutil (Opcional para body) */
.bg-radial-solene {
  background-image:
    radial-gradient(at 0% 0%, rgba(251, 181, 88, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(164, 29, 49, 0.03) 0px, transparent 50%);
}

/* ==========================================================================
   EXTENSÃO: MINISTÉRIOS EXPANDIDOS (SDS v7.0)
   ========================================================================== */
.escala-equipes-expanded {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ministerio-row {
  display: grid;
  grid-template-columns: 24px 100px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.ministerio-row:last-child {
  border-bottom: none;
}

.ministerio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ministerio-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 0.5px;
}

.ministerio-value {
  font-weight: 700;
  color: #333;
  font-size: 0.95rem;
}

.ministerio-value-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.nome-pill {
  background: rgba(164, 29, 49, 0.05);
  color: var(--cor-vinho);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(164, 29, 49, 0.1);
}

.nome-pill--coroinha {
  background: rgba(251, 181, 88, 0.1);
  color: #a67c00;
  border-color: rgba(251, 181, 88, 0.2);
}

/* Responsividade Modal */
@media (max-width: 480px) {
  .ministerio-row {
    grid-template-columns: 24px 1fr;
  }
  .ministerio-label {
    grid-column: 2;
    margin-bottom: -5px;
  }
  .ministerio-value,
  .ministerio-value-lista {
    grid-column: 2;
  }
}
/* ==========================================================================
   ACESSIBILIDADE (A11Y) - MELHORIAS v2.0
   ========================================================================== */

/* Remove outline padrão feio mas mantém funcionalidade */
*:focus {
  outline: none;
}

/* Adiciona outline personalizado para navegação por teclado */
*:focus-visible {
  outline: 3px solid var(--cor-dourado);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Focus especial para botões */
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cor-dourado);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(251, 181, 88, 0.2);
}

/* Skip link para acessibilidade */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--cor-vinho);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Melhor contraste para textos */
.text-low-contrast {
  color: #666;
}

/* Estados hover mais evidentes */
button:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* Indicador de loading acessível */
.loading-spinner[role="status"]::after {
  content: "Carregando...";
  position: absolute;
  left: -9999px;
}

/* Melhor visibilidade dos links */
a {
  text-decoration-skip-ink: auto;
}

a:hover {
  text-decoration: underline;
}

/* Estados disabled mais claros */
button:disabled,
input:disabled,
select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Melhor contraste de cores do calendário */
.day-event {
  min-height: 44px; /* Área de toque mínima WCAG */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Screen reader only (elemento visível apenas para leitores de tela) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mensagens de erro mais visíveis */
.error-message {
  color: #c82038;
  font-weight: 600;
  padding: 12px;
  background: #fff5f5;
  border-left: 4px solid #c82038;
  border-radius: 4px;
  margin: 8px 0;
}

/* Tooltips acessíveis */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
}

/* Redução de movimento para usuários sensíveis */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Alto contraste para usuários com necessidades especiais */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }

  .day-event {
    border: 2px solid currentColor !important;
  }
}

/* ========================================================================
   COMPONENTES SDS v6.0: FILTRO DE COMUNIDADES (PÚBLICO)
   ======================================================================== */

/* Wrapper do filtro no header do calendário público */
#public-community-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Select estilizado seguindo SDS v6.0 */
.sds-select {
  min-width: 180px;
  max-width: 280px;
  padding: 8px 32px 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  background-color: white;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width=%2714%27 height=%278%27 viewBox=%270 0 14 8%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M1 1l6 6 6-6%27 stroke=%27%23a41d31%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

.sds-select:hover {
  border-color: var(--cor-vinho);
  box-shadow: 0 2px 8px rgba(164, 29, 49, 0.1);
}

.sds-select:focus {
  outline: none;
  border-color: var(--cor-dourado);
  box-shadow: 0 0 0 3px rgba(251, 181, 88, 0.1);
}

.sds-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f9fafb;
}

/* Label do filtro */
#public-community-filter-wrapper label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cor-vinho);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Responsividade do filtro público */
@media (max-width: 768px) {
  #public-community-filter-wrapper {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
  }

  .sds-select {
    width: 100%;
    max-width: 100%;
  }

  #public-community-filter-wrapper label {
    font-size: 0.85rem;
  }
  
  .month-header {
    flex-direction: column;
    align-items: stretch;
  }
}

  @media (prefers-color-scheme: dark) {
    :root {
      --text-main: #e0e0e0;
      --cor-fundo: #1a1a1a;
    }
  }


/* ==========================================================================
   14. PWA SYNC STATUS - Indicadores de Sincronização
   ========================================================================== */

/* Indicador de status no header */
.sync-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  border: 1px solid #e0e0e0;
}

.sync-indicator:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sync-indicator .sync-icon {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

/* Estados do indicador */
.sync-indicator.sync-synced {
  color: #10b981;
  border-color: #d1fae5;
}

.sync-indicator.sync-syncing {
  color: var(--cor-dourado);
  border-color: #fef3c7;
}

.sync-indicator.sync-syncing .sync-icon {
  animation: spin 1s linear infinite;
}

.sync-indicator.sync-offline {
  color: #6b7280;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.sync-indicator.sync-error {
  color: #ef4444;
  border-color: #fecaca;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Toast de notificação */
.sync-toast {
  position: fixed;
  bottom: 70px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1001;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sync-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sync-toast-success {
  background: #10b981;
  color: #fff;
}

.sync-toast-info {
  background: var(--cor-vinho);
  color: #fff;
}

.sync-toast-warning {
  background: #f59e0b;
  color: #fff;
}

.sync-toast-error {
  background: #ef4444;
  color: #fff;
}

/* Banner de atualização do app */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--cor-vinho) 0%, #7b1429 100%);
  color: #fff;
  padding: 12px 20px;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.update-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.update-content span {
  font-weight: 600;
  font-size: 0.9rem;
}

#btn-update-app {
  background: #fff;
  color: var(--cor-vinho);
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-update-app:hover {
  background: var(--cor-dourado);
  color: #fff;
  transform: scale(1.05);
}

.btn-dismiss {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.btn-dismiss:hover {
  color: #fff;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .sync-indicator {
    bottom: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 0.7rem;
  }
  
  .sync-toast {
    left: 15px;
    right: 15px;
    bottom: 60px;
    max-width: none;
  }
  
  .update-banner {
    padding: 10px 15px;
  }
  
  .update-content {
    gap: 10px;
  }
  
  .update-content span {
    font-size: 0.8rem;
  }
  
  #btn-update-app {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   15. GRAÇA DESIGN SYSTEM — TOKEN EXTENSION (v4.0 NovoDesign)
   Tokens usados pelo novo calendário (NovoDesign port).
   Não alteram componentes existentes — apenas adicionam variáveis novas.
   ========================================================================== */

:root {
  /* Paleta Graça DS — família terracota/dourado */
  --graca-red:      #B53325;
  --graca-red-100:  #FAEDE9;
  --graca-red-300:  #D9826D;
  --graca-red-700:  #7B1D11;
  --gold:           #D9A441;
  --gold-deep:      #A9772A;
  --gold-ray:       #F0CE7A;

  /* Gradientes */
  --grad-bold:  linear-gradient(135deg, #881A0D 0%, #B53325 55%, #D94B1F 100%);
  --grad-dawn:  linear-gradient(135deg, rgba(217,164,65,0.13) 0%, rgba(181,51,37,0.06) 100%);
  --grad-ray:   radial-gradient(ellipse at 20% 0%, rgba(181,51,37,0.05) 0%, transparent 65%);

  /* Superfícies */
  --surface-page:   #FDFAF6;
  --surface-raised: #FFFFFF;
  --surface-card:   #F9F6F1;

  /* Texto */
  --text-strong:   #1A1108;
  --text-body:     #3D2E1E;
  --text-muted:    #6E5C50;
  --text-faint:    #9C8A7C;
  --text-on-bold:  #FFFFFF;
  --ink-700:       #2A1E18;

  /* Bordas & overlay */
  --border: rgba(181,51,37,0.12);
  --scrim:  rgba(10,5,0,0.52);

  /* Cremes */
  --cream-50:  #FEFCF8;
  --cream-200: #F2EAE0;

  /* Tipografia DS (sobrescreve tokens com as fontes paroquiais) */
  --font-serif:   'Neulis', Georgia, serif;
  --font-display: 'Neulis', Georgia, serif;
  --font-sans:    'AntennaCond', system-ui, sans-serif;
  --font-body:    'AntennaCond', system-ui, sans-serif;

  /* Escala de espaçamento 4px */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 48px;

  /* Raios */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.10);

  /* Motion */
  --dur-fast: 100ms;
  --dur:      200ms;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);

  /* Bordas espessura */
  --bw-hair: 1px;
  --bw:      1.5px;

  /* Containers & gutter */
  --container-xl: 1280px;
  --container-md: 760px;
  --gutter: clamp(14px, 4vw, 24px);

  /* Tipografia scale */
  --text-2xs:  10px;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   20px;

  /* Font weights */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extra:    800;

  /* Espaçamento de letras */
  --tracking-wide:   0.04em;
  --tracking-wider:  0.08em;

  /* Altura de linha */
  --leading-relaxed: 1.6;
  --leading-tight:   1.25;

  /* Focus ring acessível */
  --focus-ring: 0 0 0 3px rgba(59,130,246,0.5);
}

/* ==========================================================================
   16. NOVO CALENDÁRIO — COMPONENTES (NovoDesign v4.0)
   Todas as classes .sd-* são exclusivas do novo design.
   Não colidem com classes existentes (.day-cell, .calendar-wrapper, etc.).
   ========================================================================== */

/* --- Animações --- */
@keyframes sdFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sdRiseIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sdPulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@keyframes sdSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* --- Body (reset mínimo quando novo design está ativo) --- */
body.sd-active {
  background-color: var(--surface-page) !important;
  background-image: var(--grad-ray) !important;
  color: var(--text-body) !important;
  font-family: var(--font-sans) !important;
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
  overflow-x: hidden !important;
  display: block !important;
  margin: 0;
}

/* --- Header --- */
.sd-header {
  background: var(--grad-bold);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sd-header-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: var(--space-3);
}
.sd-header-logo {
  max-height: 36px;
  width: auto;
  display: block;
}
.sd-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sd-btn-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-pill);
  color: var(--text-on-bold);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-bold);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sd-btn-admin:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.35);
  text-decoration: none;
}

/* --- Barra do Mês --- */
.sd-month-bar {
  background: var(--surface-raised);
  border-bottom: var(--bw-hair) solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 58px;
  z-index: 190;
}
.sd-month-bar-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-3) var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.sd-month-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.sd-month-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
}
.sd-btn-nav {
  width: 34px;
  height: 34px;
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-body);
  font-size: 16px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.sd-btn-nav:hover {
  background: var(--graca-red-100);
  color: var(--graca-red);
  border-color: var(--graca-red-300);
}
.sd-btn-hoje {
  padding: 6px 12px;
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--tracking-wide);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.sd-btn-hoje:hover {
  background: var(--graca-red-100);
  color: var(--graca-red);
}
.sd-bar-spacer { flex: 1; }
.sd-community-select {
  padding: 7px 28px 7px 10px;
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width%3d%2212%27 height%3d%228%27 viewBox%3d%220 0 12 8%27 fill%3d%27none%27 xmlns%3d%27http%3a%2f%2fwww.w3.org%2f2000%2fsvg%27%3e%3cpath d%3d%27M1 1l5 5 5-5%27 stroke%3d%27%23B53325%27 stroke-width%3d%271.5%27 stroke-linecap%3d%27round%27%2f%3e%3c%2fsvg%3e');
  background-repeat: no-repeat;
  background-position: right 8px center;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--text-body);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 160px;
  transition: border-color var(--dur) var(--ease);
}
.sd-community-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,164,65,0.15);
}
.sd-vista-group {
  display: flex;
  gap: 2px;
  background: var(--cream-200);
  padding: 3px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sd-btn-vista {
  padding: 5px 12px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wider);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  background: transparent;
  color: var(--text-muted);
}
.sd-btn-vista.sd-ativo {
  background: var(--graca-red);
  color: var(--text-on-bold);
  box-shadow: var(--shadow-sm);
}
.sd-btn-imprimir {
  width: 34px;
  height: 34px;
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.sd-btn-imprimir:hover {
  background: var(--graca-red-100);
  color: var(--graca-red);
  border-color: var(--graca-red-300);
}

/* --- Chips de equipes --- */
.sd-chips-bar {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-3);
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  align-items: center;
  scrollbar-width: none;
}
.sd-chips-bar::-webkit-scrollbar { display: none; }
.sd-chips-label {
  font-size: var(--text-2xs);
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wider);
  color: var(--text-faint);
  text-transform: uppercase;
  white-space: nowrap;
}
.sd-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: var(--fw-bold);
  border: var(--bw) solid var(--border);
  background: var(--surface-raised);
  color: var(--text-body);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sd-chip.sd-ativo {
  background: var(--graca-red);
  border-color: var(--graca-red);
  color: var(--text-on-bold);
}

/* --- Grade --- */
.sd-grade-wrap {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-4) var(--gutter) 8px;
  box-sizing: border-box;
  animation: sdFadeIn 0.3s var(--ease);
}
.sd-grade {
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  box-sizing: border-box;
}
.sd-day-header {
  background: var(--surface-card);
  padding: var(--space-2) 0;
  text-align: center;
  font-size: var(--text-2xs);
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
}
.sd-cell {
  text-align: left;
  font-family: inherit;
  border: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  overflow: hidden;
  transition: background var(--dur-fast) var(--ease);
}
.sd-cell:hover { filter: brightness(0.96); }
.sd-cell--fora {
  background: var(--cream-200) !important;
  cursor: default !important;
  opacity: 1 !important;
}
.sd-cell--hoje { background: var(--grad-dawn); }
.sd-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.sd-cell-num {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: 15px;
  color: var(--ink-700);
  flex-shrink: 0;
}
.sd-cell-hoje-badge {
  font-size: 9px;
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wide);
  color: var(--gold-deep);
  background: var(--gold-ray);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}
.sd-cell-num--hoje { color: var(--graca-red); }
.sd-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.25;
  padding: 3px 7px 3px 6px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.sd-pill-hora {
  font-size: 10.5px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.sd-pill-titulo {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sd-cell-mais {
  font-size: 10.5px;
  font-weight: var(--fw-bold);
  color: var(--graca-red);
  padding-left: 6px;
}
.sd-cell-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  padding-top: 2px;
}
.sd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.sd-legenda {
  margin: var(--space-2) 2px 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}
.sd-legenda-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sd-legenda-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-xs);
}

/* --- Agenda --- */
.sd-agenda-wrap {
  max-width: var(--container-md);
  margin: 0 auto;
  padding: var(--space-4) var(--gutter) 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: sdFadeIn 0.3s var(--ease);
}
.sd-agenda-card {
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface-raised);
  border: var(--bw-hair) solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}
.sd-agenda-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.sd-agenda-data {
  width: 68px;
  flex-shrink: 0;
  background: var(--cream-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: var(--space-3) 6px;
  border-right: var(--bw-hair) solid var(--border);
}
.sd-agenda-num {
  font-family: var(--font-serif);
  font-weight: var(--fw-bold);
  font-size: 26px;
  line-height: 1;
  color: var(--text-strong);
}
.sd-agenda-num--hoje { color: var(--graca-red); }
.sd-agenda-diasem {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.sd-agenda-hoje-badge {
  margin-top: 4px;
  font-size: 8.5px;
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wide);
  color: var(--gold-deep);
  background: var(--gold-ray);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}
.sd-agenda-eventos {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-4);
  min-width: 0;
}
.sd-agenda-ev-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  min-width: 0;
}
.sd-agenda-hora {
  flex-shrink: 0;
  background: var(--cream-200);
  color: var(--gold-deep);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  min-width: 44px;
  text-align: center;
}
.sd-agenda-ev-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sd-agenda-ev-titulo {
  font-size: 15px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  line-height: 1.25;
}
.sd-agenda-ev-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}
.sd-agenda-arrow {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  color: var(--graca-red-300);
  font-size: 18px;
  flex-shrink: 0;
}
.sd-agenda-vazia {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  background: var(--surface-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* --- Mural --- */
.sd-mural-wrap {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) 8px;
  box-sizing: border-box;
}
.sd-mural-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 2px solid var(--graca-red);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}
.sd-mural-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--graca-red);
}
.sd-mural-count {
  background: var(--graca-red);
  color: var(--text-on-bold);
  font-size: 11px;
  font-weight: var(--fw-bold);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}
.sd-mural-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.sd-aviso-card {
  background: var(--surface-card);
  border: var(--bw-hair) solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.sd-aviso-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.sd-aviso-tag {
  font-size: 10.5px;
  font-weight: var(--fw-extra);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}
.sd-aviso-data-fmt {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.sd-aviso-titulo {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: 1.3;
}
.sd-aviso-local {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sd-aviso-desc {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}

/* --- Footer --- */
.sd-footer {
  margin-top: var(--space-7);
  background: var(--grad-bold);
  color: var(--text-on-bold);
  border-top: 4px solid var(--gold);
  padding: var(--space-7) var(--gutter) var(--space-4);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sd-footer-inner {
  max-width: var(--container-md);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}
.sd-footer-logo { max-width: 180px; opacity: 0.94; }
.sd-footer-subtitle { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: 15px; opacity: 0.85; }
.sd-footer-heading {
  margin: 0 0 var(--space-3);
  color: var(--gold-ray);
  font-size: var(--text-sm);
  font-weight: var(--fw-extra);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-bottom: var(--bw-hair) solid rgba(255,200,120,0.3);
  padding-bottom: 9px;
}
.sd-footer-p { margin: 4px 0; font-size: 14.5px; }
.sd-footer-destaque { margin: var(--space-3) 0 0; color: var(--gold-ray); font-weight: var(--fw-bold); font-size: 14.5px; }
.sd-footer-destaque span { font-weight: 400; color: var(--text-on-bold); }
.sd-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.06);
  color: var(--text-on-bold);
  text-decoration: none;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: var(--bw-hair) solid rgba(255,255,255,0.14);
  font-size: 14px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sd-btn-whatsapp:hover { background: #25d366; border-color: #25d366; text-decoration: none; }
.sd-social { display: flex; gap: var(--space-3); margin-top: var(--space-3); }
.sd-social a { color: var(--text-on-bold); transition: color var(--dur) var(--ease); }
.sd-social a:hover { color: var(--gold-ray); }
.sd-footer-copy {
  text-align: center;
  font-size: 12.5px;
  opacity: 0.72;
  margin: var(--space-8) 0 0;
  padding-top: var(--space-4);
  border-top: var(--bw-hair) solid rgba(255,255,255,0.08);
}

/* --- Modal de detalhes do dia --- */
.sd-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: sdFadeIn 0.18s var(--ease);
}
.sd-modal-overlay.sd-hidden { display: none; }
.sd-modal-panel {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  width: min(560px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  display: flex;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: sdRiseIn 0.28s var(--ease);
}
.sd-modal-stripe {
  width: 10px;
  flex-shrink: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.sd-modal-content {
  flex: 1;
  padding: var(--space-6) var(--space-6) var(--space-5);
  min-width: 0;
}
.sd-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream-200);
  color: var(--text-muted);
  font-size: 18px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sd-modal-close:hover { background: var(--graca-red-100); color: var(--graca-red); }
.sd-modal-date-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  border-bottom: var(--bw-hair) solid var(--border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}
.sd-modal-day-num {
  font-family: var(--font-serif);
  font-weight: var(--fw-bold);
  font-size: 48px;
  line-height: 0.9;
  color: var(--text-strong);
}
.sd-modal-date-info { display: flex; flex-direction: column; gap: 1px; padding-bottom: 2px; }
.sd-modal-month { font-size: var(--text-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--graca-red); }
.sd-modal-weekday { font-size: 11.5px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-faint); }
.sd-modal-ev-tempo { margin: 0 0 2px; font-size: 12px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.sd-modal-ev-titulo { margin: 0 0 var(--space-3); font-size: 21px; font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.25; font-family: var(--font-serif); }
.sd-modal-comunidade {
  margin: 0 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--graca-red-100);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: var(--fw-bold);
  color: var(--graca-red-700);
}
.sd-modal-info-row { margin: 0 0 6px; font-size: 14px; color: var(--text-body); display: flex; gap: 6px; }
.sd-modal-info-key { color: var(--text-strong); min-width: 92px; display: inline-block; font-weight: var(--fw-bold); }
.sd-escala-group { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-4); }
.sd-escala-hora {
  flex-shrink: 0;
  background: var(--graca-red);
  color: var(--text-on-bold);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
}
.sd-escala-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sd-escala-row {
  display: grid;
  grid-template-columns: 22px 92px 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}
.sd-escala-icon { width: 18px; height: 18px; object-fit: contain; opacity: 0.85; }
.sd-escala-label { font-size: 10.5px; font-weight: var(--fw-extra); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-faint); }
.sd-escala-valor { font-size: 14.5px; font-weight: var(--fw-bold); color: var(--text-strong); }
.sd-escala-lista-row {
  display: grid;
  grid-template-columns: 22px 92px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}
.sd-escala-lista-label { font-size: 10.5px; font-weight: var(--fw-extra); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-faint); padding-top: 3px; }
.sd-escala-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.sd-modal-cal-actions {
  margin-top: var(--space-4);
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
}
.sd-modal-cal-title { margin: 0 0 var(--space-3); font-size: 11px; font-weight: var(--fw-extra); letter-spacing: var(--tracking-wide); color: var(--text-faint); text-transform: uppercase; text-align: center; }
.sd-modal-cal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.sd-btn-cal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 42px;
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.sd-btn-cal:hover { border-color: var(--gold); background: var(--cream-50); }

/* Modal de impressão */
.sd-print-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}
.sd-print-modal-overlay.sd-hidden { display: none; }
.sd-print-modal {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  width: min(460px, 94vw);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
}
.sd-print-modal h3 { margin: 0 0 var(--space-4); font-family: var(--font-serif); font-size: 20px; color: var(--text-strong); }
.sd-print-opt-list { display: flex; flex-direction: column; gap: var(--space-3); }
.sd-print-opt {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--bw-hair) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.sd-print-opt:hover { border-color: var(--graca-red); background: var(--graca-red-100); }
.sd-print-opt span { font-size: 1.2rem; }
.sd-print-cancel {
  margin-top: var(--space-3);
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
}
.sd-print-cancel:hover { color: var(--text-body); }

/* --- Mobile responsiveness --- */
@media (max-width: 640px) {
  .sd-modal-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 88vh !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    animation: sdSlideUp 0.3s var(--ease) !important;
  }
  .sd-modal-stripe { border-radius: var(--radius-lg) 0 0 0; }
  .sd-modal-cal-btns { grid-template-columns: 1fr; }
  .sd-month-bar-inner {
    padding: var(--space-2) var(--gutter);
    gap: var(--space-2);
  }
  .sd-month-title { min-width: 120px; font-size: 17px; }
  .sd-header-inner { min-height: 50px; }
  .sd-bar-spacer { display: none; }
}

@media (max-width: 480px) {
  .sd-escala-row, .sd-escala-lista-row {
    grid-template-columns: 22px 1fr;
  }
  .sd-escala-label { grid-column: 2; margin-bottom: -5px; }
  .sd-escala-valor, .sd-escala-pills { grid-column: 2; }
}

/* --- Print overrides (novo design oculta header/footer correto) --- */
@media print {
  .sd-header, .sd-month-bar, .sd-chips-bar, .sd-grade-wrap,
  .sd-agenda-wrap, .sd-mural-wrap, .sd-footer,
  .sd-modal-overlay, .sd-print-modal-overlay,
  .sync-indicator, .update-banner { display: none !important; }
}

/* --- Motion reduction --- */
@media (prefers-reduced-motion: reduce) {
  .sd-modal-panel, .sd-grade-wrap, .sd-agenda-wrap { animation: none !important; }
}