:root {
  --navy: #0F172A;
  --blue: #1e40af;
  --blue-deep: #1e3a8a;
  --blue-soft: #dbeafe;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 16px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --accent-program: #2563eb;
  --accent-event: #d97706;
  --accent-serve: #0d9488;
  --accent-bday: #e11d48;
  --gold: #fef3c7;
  --gold-text: #92400e;
  --soli-night: #0F172A;
  --soli-sun: #F59E0B;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

/* -------------------------------------------------------------------------- */
/* Top bar                                                                    */
/* -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  background: var(--navy);
  color: #fff;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soli-night);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.brand-copy span {
  font-size: 11px;
  color: #93c5fd;
  font-weight: 500;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar__nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.topbar__nav a:hover,
.topbar__nav a.is-active {
  color: #fff;
  background: rgba(147, 197, 253, 0.18);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  justify-content: flex-end;
}

.pix-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.pix-chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pix-chip:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Page layout                                                                */
/* -------------------------------------------------------------------------- */

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 48px;
}

.hero {
  background: linear-gradient(135deg, #0f2c5c 0%, #1e40af 72%, #2563eb 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.22);
}

.hero__label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 8px 0 0;
  color: #dbeafe;
  font-size: 14px;
}

.grid-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stack {
  margin-bottom: 16px;
  scroll-margin-top: 84px;
}

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 18px;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--kpi-accent, var(--blue));
}

.kpi--program { --kpi-accent: var(--accent-program); }
.kpi--event { --kpi-accent: var(--accent-event); }
.kpi--serve { --kpi-accent: var(--accent-serve); }
.kpi--bday { --kpi-accent: var(--accent-bday); }

.kpi__label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi__value {
  margin: 8px 0 6px;
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: -0.04em;
}

.kpi__hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.panel {
  padding: 22px 24px 20px;
  scroll-margin-top: 84px;
}

.panel__header {
  margin-bottom: 16px;
}

.panel__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.panel__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Programação                                                                */
/* -------------------------------------------------------------------------- */

.schedule {
  list-style: none;
  margin: 0;
  padding: 0;
}

.schedule li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed #eef2f7;
}

.schedule li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.badge {
  flex-shrink: 0;
  min-width: 92px;
  text-align: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  border-radius: 8px;
}

.badge--highlight {
  background: var(--gold);
  color: var(--gold-text);
}

.schedule span:last-child {
  font-size: 14px;
  color: #334155;
  padding-top: 3px;
}

/* -------------------------------------------------------------------------- */
/* Eventos                                                                    */
/* -------------------------------------------------------------------------- */

.events {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent-event);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(217, 119, 6, 0.12);
}

.event__date {
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 8px 0;
  color: var(--accent-event);
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.08);
}

.event__date strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.event__date small {
  color: #b45309; /* âmbar mais escuro: letra pequena precisa de contraste 4,5:1 */
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.event__body strong {
  display: block;
  font-size: 14px;
  color: var(--navy);
}

.event__body span {
  font-size: 12px;
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Avisos (Conteúdo › Avisos no painel)                                       */
/* -------------------------------------------------------------------------- */

.notices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
}

.notice__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.notice__header strong {
  font-size: 14px;
  color: var(--navy);
}

.notice__header small {
  font-size: 11px;
  font-weight: 700;
  color: #475569; /* contraste 4,5:1 sobre o azul-claro do aviso */
}

.notice__body {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

/* -------------------------------------------------------------------------- */
/* Tabelas                                                                    */
/* -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--blue-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
}

.data-table th:first-child {
  border-radius: 8px 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 8px 0 0;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.data-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.data-table tbody tr:hover td {
  background: #eff6ff;
}

.data-table .date-cell {
  font-weight: 800;
  color: var(--accent-program);
  text-align: center;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Aniversariantes                                                            */
/* -------------------------------------------------------------------------- */

.bday-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.bday {
  text-align: center;
  padding: 14px 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.bday:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #fecdd3;
}

.bday strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-bday);
  line-height: 1;
}

.bday span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.pix-key {
  font-variant-numeric: tabular-nums;
}

.footnote {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }

  .topbar__brand,
  .topbar__actions {
    min-width: 0;
  }

  .topbar__nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .grid-kpis,
  .grid-2,
  .bday-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .brand-copy span,
  .pix-key {
    display: none;
  }

  .grid-kpis,
  .bday-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .event {
    grid-template-columns: 56px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  .topbar,
  .pix-chip {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page {
    width: auto;
    margin: 0;
  }

  .card,
  .bday,
  .event {
    box-shadow: none;
    break-inside: avoid;
  }

  .card:hover,
  .bday:hover,
  .event:hover {
    transform: none;
  }
}

.empty-state {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 32px;
  text-align: center;
}

.empty-state h1 {
  margin: 0 0 8px;
  color: var(--navy);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.soli-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 36px auto 0;
  padding: 28px 16px 24px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background: #fff;
}

.soli-footer img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.soli-footer strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.38em;
  color: #b45309; /* o dourado do Soli mais escuro: letra pequena sobre o branco (contraste 4,5:1) */
}

.soli-footer span {
  font-size: 12px;
}

.highlight-copy {
  color: #550505;
  font-weight: 700;
}


/* -------------------------------------------------------------------------- */
/* Compartilhar e acesso ao painel (Soli em Rails)                            */
/* -------------------------------------------------------------------------- */

.topbar__actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.topbar-chip {
  display: inline-flex;
  align-items: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-chip:hover { background: rgba(255, 255, 255, 0.2); }
.topbar-chip--sun { color: var(--soli-night); background: var(--soli-sun); }
.topbar-chip--sun:hover { background: #fbbf24; }
.topbar-chip[hidden] { display: none; }
.bday__church { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
.schedule__empty { color: var(--muted); font-style: italic; }
