﻿/* â”€â”€â”€ CSS Variables globais â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
  --font-app: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-container-max: 1480px;
  --app-module-bg: rgba(255, 255, 255, .70);
  --app-module-border: rgba(255, 255, 255, .48);
  --app-module-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  --app-module-radius: 18px;
  --app-module-padding: 24px;
  --app-bottom-nav-offset: 76px;
  --mc-glass-bg:     rgba(255, 255, 255, 0.68);
  --mc-glass-border: rgba(255, 255, 255, 0.42);
  --mc-shadow:       0 8px 32px rgba(15, 23, 42, 0.09);
  --mc-radius:       20px;
  --mc-primary:      #2563eb;
  --mc-text:         #0f172a;
  --mc-muted:        #64748b;
  --mc-sidebar-bg:   #f1f5f9;
  --mc-sidebar-soft: #e2e8f0;
  --mc-sidebar-text: #334155;
  --mc-sidebar-muted:#64748b;
}

/* === BASE === */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 8%,  rgba(37, 99, 235, 0.08) 0%, transparent 28rem),
    radial-gradient(circle at 85% 5%,  color-mix(in srgb, var(--brand-secondary) 7%, transparent) 0%, transparent 26rem),
    linear-gradient(160deg, #f8fbff 0%, #eef4ff 55%, #f7f2ff 100%);
  background-attachment: fixed;
  font-family: var(--font-app);
  overflow-x: hidden;
}

html,
body,
button,
input,
select,
textarea,
table {
  font-family: var(--font-app);
}

/* Container principal padrão WeChurch: a PÁGINA INTEIRA (cabeçalho + conteúdo)
   vive dentro de UM card branco centralizado, como o .card-membros do WeChurch. */
.content > .app-page-container {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  background: var(--app-module-bg);
  border: 1px solid var(--app-module-border);
  border-radius: var(--app-module-radius);
  box-shadow: var(--app-module-shadow);
  padding: clamp(18px, 1.8vw, 30px);
}

/* Barra de contexto: super admin operando DENTRO de uma organização-cliente.
   Sinaliza a impersonação e oferece a saída rápida para o painel da plataforma. */
.sa-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(100deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 6px 18px rgba(79, 70, 229, .28);
}
.sa-context-bar__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  min-width: 0;
}
.sa-context-bar__label i { font-size: 1.05rem; opacity: .95; }
.sa-context-bar__label strong { font-weight: 700; }
.sa-context-bar__exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  transition: background .15s ease;
}
.sa-context-bar__exit:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.content > .container,
.content .container.py-4 {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
}

/* Dentro do card-página, as seções (cards) ficam SEM moldura própria, em
   qualquer profundidade — evita "card dentro de card". KPIs mantêm o visual. */
.app-page-container:not(.app-page-container--wide) .app-card,
.app-page-container:not(.app-page-container--wide) .app-section,
.app-page-container:not(.app-page-container--wide) .app-table-card,
.app-page-container:not(.app-page-container--wide) .app-filter-panel,
.app-page-container:not(.app-page-container--wide) .mc-table-card,
.app-page-container:not(.app-page-container--wide) .mc-form-card,
.app-page-container:not(.app-page-container--wide) .mc-module-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Páginas que querem largura total (boards, inbox) — sem card, full-bleed. */
.content > .container-fluid,
.content .container-fluid.py-4,
.content > .app-page-container.app-page-container--wide {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Dropdown da engrenagem (Gestão) reusa o estilo do menu de perfil
   (.sidebar-perfil-menu) — só adiciona o realce de item ativo. */
.sidebar-perfil-menu .dropdown-item.active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: 600;
}
.sidebar-perfil-menu .dropdown-item.active > i { color: var(--brand-primary); }

/* Botão "Preferências" no dropdown do sino — pequeno e colorido.
   Especificidade alta p/ vencer .notification-dropdown-head a. */
.notification-dropdown-head a.notification-prefs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
  border-radius: 8px;
  line-height: 1;
}
.notification-dropdown-head a.notification-prefs-btn:hover,
.notification-dropdown-head a.notification-prefs-btn:focus {
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.app-page-container,
.app-page,
.app-container,
.module-container,
.app-shell,
.content-shell,
.ec-page,
.gc-page,
.finance-page,
.ev-page,
.dashboard-layout,
.mc-page-shell {
  width: 100%;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.app-module-card,
.app-card,
.app-section,
.ec-module,
.gc-module,
.finance-page,
.ev-page,
.card-membros {
  border-radius: var(--app-module-radius);
}

.app-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.app-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.app-filter-panel {
  background: rgba(255, 255, 255, .68);
  border: 1px solid #eef2f7;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  border-radius: 16px;
  padding: 14px;
}

.app-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.app-table-card {
  background: rgba(255, 255, 255, .68);
  border: 1px solid #eef2f7;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  border-radius: 16px;
  padding: 18px;
}

.app-mobile-stack {
  display: grid;
  gap: 12px;
}

.app-mobile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-responsive-grid,
.app-form-grid {
  display: grid;
  gap: 14px;
}

.app-responsive-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.app-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-mobile-table-cards {
  display: grid;
  gap: 10px;
}

.app-mobile-row-card,
.app-mobile-list-card,
.app-mobile-form-card,
.app-empty-state {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.app-empty-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #475569;
}

.app-empty-state i {
  flex: 0 0 auto;
  margin-top: 1px;
}

.app-mobile-preview {
  width: 100%;
  max-width: 390px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 28px;
  padding: 10px;
  background: #0f172a;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
}

.app-mobile-screen {
  position: relative;
  height: 760px;
  max-height: 78dvh;
  overflow: hidden;
  border-radius: 20px;
  background: #f8fafc;
}

.app-mobile-content {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 0 96px;
  box-sizing: border-box;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-mobile-content::-webkit-scrollbar {
  display: none;
}

.app-mobile-screen .app-mobile-filter-fab {
  display: inline-flex;
  position: absolute;
  right: 16px;
  bottom: 82px;
  z-index: 5;
}

.app-mobile-screen .app-mobile-bottom-nav {
  display: flex;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  min-height: 66px;
  padding: 7px 10px;
  border-radius: 0 0 20px 20px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, .12);
}

.app-mobile-shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-x: hidden;
}

.app-mobile-container,
.app-mobile-section {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--app-module-bg);
  border: 1px solid var(--app-module-border);
  border-radius: 16px;
  box-shadow: var(--app-module-shadow);
}

.app-mobile-container {
  padding: 16px;
}

.app-mobile-section {
  padding: 14px;
}

.app-mobile-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.app-mobile-eyebrow {
  margin: 0;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
}

.app-mobile-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f172a;
  font-size: 1.3rem;
  font-weight: 850;
}

.app-mobile-description {
  margin: 0;
  color: #64748b;
  font-size: .88rem;
  line-height: 1.35;
}

.app-mobile-kpi-grid,
.app-mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.app-mobile-kpi-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.app-mobile-kpi-card .mc-stat-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 12px;
  font-size: 1rem;
}

.app-mobile-kpi-number {
  display: block;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 850;
  line-height: 1;
}

.app-mobile-kpi-label {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.15;
}

.app-mobile-quick-card {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  color: #334155;
  text-align: center;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

.app-mobile-quick-card i {
  font-size: 1.55rem;
}

.app-mobile-quick-card span {
  color: #334155;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.15;
}

.app-mobile-filter-fab {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: fixed;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 1060;
  min-height: 48px;
  min-width: 112px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
  font-weight: 800;
}

.app-mobile-filter-fab i {
  color: #93c5fd;
  font-size: 1.05rem;
}

.app-mobile-bottom-nav {
  display: none;
}

.app-mobile-bottom-nav a,
.app-mobile-bottom-nav button {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  text-decoration: none;
}

/* â”€â”€â”€ Glass reutilizÃ¡vel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-glass-card,
.mc-dashboard-card,
.mc-chart-card {
  background: var(--mc-glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--mc-glass-border);
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow);
}

/* â”€â”€â”€ Page shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-page-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2px 0 32px;
  box-sizing: border-box;
}

/* â”€â”€â”€ KPI stat card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.mc-kpi-extras {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.mc-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  box-sizing: border-box;
  min-width: 0;
  background: rgba(255,255,255,.78);
  border: 1px solid #eef2f7;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15,23,42,.05);
  transition: box-shadow .22s, transform .22s;
}

.mc-kpi-card:hover {
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.13);
  transform: translateY(-2px);
}

.mc-stat-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(37,99,235,.13), color-mix(in srgb, var(--brand-secondary) 10%, transparent));
  border: 1px solid rgba(255,255,255,.42);
  color: var(--mc-primary);
}

.mc-stat-icon.mc-icon-blue   { background: rgba(37,99,235,.12);   color: #2563eb; }
.mc-stat-icon.mc-icon-green  { background: rgba(5,150,105,.12);   color: #059669; }
.mc-stat-icon.mc-icon-amber  { background: rgba(217,119,6,.12);   color: #d97706; }
.mc-stat-icon.mc-icon-violet { background: color-mix(in srgb, var(--brand-secondary) 12%, transparent);  color: var(--brand-secondary, #7c3aed); }
.mc-stat-icon.mc-icon-rose   { background: rgba(225,29,72,.12);   color: #e11d48; }
.mc-stat-icon.mc-icon-sky    { background: rgba(2,132,199,.12);   color: #0284c7; }
.mc-stat-icon.mc-icon-teal   { background: rgba(13,148,136,.12);  color: #0d9488; }
.mc-stat-icon.mc-icon-orange { background: rgba(234,88,12,.12);   color: #ea580c; }
.mc-stat-icon.mc-icon-pink   { background: rgba(219,39,119,.12);  color: #db2777; }

/* â”€â”€â”€ Design System oficial reutilizÃ¡vel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-button-row,
.mc-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mc-btn,
.mc-module-card .btn,
.mc-form-card .btn,
.mc-tabs .mc-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  font-weight: 700;
}

.mc-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: .9rem;
  line-height: 1.35;
}

.mc-alert i {
  flex: 0 0 auto;
  margin-top: 1px;
}

.mc-alert-success { background: #dcfce7; border-color: #bbf7d0; color: #14532d; }
.mc-alert-danger  { background: #fee2e2; border-color: #fecaca; color: #7f1d1d; }
.mc-alert-warning { background: #fef3c7; border-color: #fde68a; color: #78350f; }
.mc-alert-info    { background: #e0f2fe; border-color: #bae6fd; color: #075985; }

.app-card,
.app-section,
.mc-module-card,
.mc-form-card,
.mc-table-card {
  background: var(--app-module-bg);
  border: 1px solid var(--app-module-border);
  box-shadow: var(--app-module-shadow);
  border-radius: var(--app-module-radius);
  padding: var(--app-module-padding);
}

.mc-section-card {
  background: rgba(255, 255, 255, .68);
  border: 1px solid #eef2f7;
  border-radius: 16px;
  padding: 18px;
}

.mc-kpi-card,
.mc-hover-card {
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease, background-color .22s ease;
}

.mc-kpi-card:hover,
.mc-hover-card:hover {
  border-color: color-mix(in srgb, var(--brand-secondary) 16%, transparent);
  box-shadow: 0 14px 42px rgba(15, 23, 42, .13);
  transform: translateY(-2px);
}

.mc-form-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.mc-form-label i,
.mc-label-icon {
  filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--brand-primary) 12%, transparent));
}

.mc-icon-blue { color: #2563eb !important; }
.mc-icon-green { color: #16a34a !important; }
.mc-icon-amber { color: #d97706 !important; }
.mc-icon-red { color: #dc2626 !important; }
.mc-icon-rose { color: #e11d48 !important; }
.mc-icon-purple { color: var(--brand-secondary, #7c3aed) !important; }
.mc-icon-sky { color: #0284c7 !important; }
.mc-icon-teal { color: #0d9488 !important; }
.mc-icon-orange { color: #ea580c !important; }
.mc-icon-pink { color: #ec4899 !important; }
.mc-icon-indigo { color: #6366f1 !important; }
.mc-icon-muted { color: #64748b !important; }

.mc-form-control,
.mc-form-card .form-control,
.mc-form-card .form-select {
  min-height: 42px;
  border-color: #dbe3ef;
  border-radius: 10px;
  color: #0f172a;
}

.mc-form-control:focus,
.mc-form-card .form-control:focus,
.mc-form-card .form-select:focus {
  border-color: var(--brand-secondary, #7c3aed);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-secondary) 12%, transparent);
}

.mc-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid #eef2f7;
  border-radius: 16px;
}

.mc-tab {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #475569;
  padding: 10px 14px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: .85rem;
  border-radius: 10px;
  transition: background .15s, color .15s;
}

.mc-tab:hover {
  background: rgba(0,0,0,.04);
  color: #1f2937;
  text-decoration: none;
}

.mc-tab:focus {
  text-decoration: none;
  outline: 2px solid color-mix(in srgb, var(--brand-secondary) 30%, transparent);
  outline-offset: -2px;
}

.mc-tab.active {
  background: color-mix(in srgb, var(--brand-secondary) 12%, transparent);
  color: var(--brand-secondary, #7c3aed);
  box-shadow: none;
  text-decoration: none;
}

.mc-tab i {
  font-size: .95rem;
  transition: color .15s;
}

.mc-tab.active i {
  color: var(--brand-secondary, #7c3aed) !important;
}

/* QR Code de pareamento do WhatsApp (tela de Integrações) */
.integ-qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  max-width: 320px;
  text-align: center;
}

.integ-qr img {
  width: 240px;
  height: 240px;
  image-rendering: pixelated;
  border-radius: 10px;
}

/* ─── Automações de notificação (grid de cards + chips) ───────────── */
.app-automacao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
  gap: 14px;
}

.mc-automacao { transition: opacity .2s ease; }
.mc-automacao--off { opacity: .72; }
.mc-automacao--off .mc-stat-icon { filter: grayscale(.7); }

/* Chips de canal (checkbox estilizado) — reusável em automações/avisos */
.mc-channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mc-channel-chip input { margin: 0; cursor: pointer; }
.mc-channel-chip:hover { border-color: color-mix(in srgb, var(--brand-secondary) 35%, transparent); }
.mc-channel-chip:has(input:checked) {
  background: color-mix(in srgb, var(--brand-secondary) 10%, transparent);
  border-color: color-mix(in srgb, var(--brand-secondary) 45%, transparent);
  color: var(--brand-secondary, #7c3aed);
}

/* Cartão de canal de comunicação (status na tela de Configurações da Comunicação) */
.mc-channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--app-module-border, #e6ebf2);
  border-radius: 14px;
  background: var(--app-module-bg, #fff);
}
.mc-channel-card-body { flex: 1 1 auto; min-width: 0; }
.mc-channel-card .mc-badge { white-space: nowrap; }

/* Chip de variável (placeholder substituível) */
.mc-var-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .76rem;
  background: rgba(100, 116, 139, .12);
  color: #475569;
}

.mc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 9px;
}

.mc-table th {
  color: #64748b;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 12px 4px;
  white-space: nowrap;
}

.mc-table td {
  background: #fff;
  padding: 12px;
  vertical-align: middle;
  color: #334155;
  border: 0;
}

.mc-table tr td:first-child { border-radius: 12px 0 0 12px; }
.mc-table tr td:last-child { border-radius: 0 12px 12px 0; }
.mc-table tbody tr:hover td { background: #f8fafc; }

.mc-th-icon,
.mc-cell-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.mc-th-icon i,
.mc-cell-icon i {
  flex: 0 0 auto;
  font-size: .95rem;
}

.mc-cell-main {
  display: block;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

/* Quando o nome é um link (ex.: nome da empresa na lista de leads): sem
   sublinhado por padrão, só realce de cor no hover. */
a.mc-cell-main:hover,
a.mc-cell-main:focus {
  color: var(--brand-primary, #2563eb);
  text-decoration: none;
}

.mc-cell-meta {
  display: block;
  color: #64748b;
  font-size: .78rem;
  line-height: 1.25;
}

.mc-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap;
}

.mc-table-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
}

/* â”€â”€â”€ BotÃµes de aÃ§Ã£o padronizados (tabelas, cards, listas) â”€â”€â”€ */
.mc-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  vertical-align: middle;
  white-space: nowrap;
}
.mc-action-btn:hover { text-decoration: none; }
.mc-action-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Variante: visualizar (azul cÃ©u) */
.mc-action-btn-view { color: #0284c7; border-color: rgba(2,132,199,.25); background: rgba(2,132,199,.08); }
.mc-action-btn-view:hover { background: #0284c7; color: #fff; border-color: #0284c7; }

/* Variante: editar (Ã­ndigo) */
.mc-action-btn-edit { color: var(--brand-primary, #4f46e5); border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent); background: color-mix(in srgb, var(--brand-primary) 8%, transparent); }
.mc-action-btn-edit:hover { background: var(--brand-primary, #4f46e5); color: #fff; border-color: var(--brand-primary, #4f46e5); }

/* Variante: excluir (vermelho) */
.mc-action-btn-delete { color: #dc2626; border-color: rgba(220,38,38,.25); background: rgba(220,38,38,.08); }
.mc-action-btn-delete:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Variante: copiar (teal) */
.mc-action-btn-copy { color: #0d9488; border-color: rgba(13,148,136,.25); background: rgba(13,148,136,.08); }
.mc-action-btn-copy:hover { background: #0d9488; color: #fff; border-color: #0d9488; }

/* Variante: imprimir / neutro (slate) */
.mc-action-btn-print { color: #64748b; border-color: rgba(100,116,139,.25); background: rgba(100,116,139,.08); }
.mc-action-btn-print:hover { background: #64748b; color: #fff; border-color: #64748b; }

/* Variante: enviar / notificar (verde esmeralda) */
.mc-action-btn-send { color: #059669; border-color: rgba(5,150,105,.25); background: rgba(5,150,105,.08); }
.mc-action-btn-send:hover { background: #059669; color: #fff; border-color: #059669; }

/* Variante: configurar (violeta) */
.mc-action-btn-config { color: var(--brand-secondary, #7c3aed); border-color: color-mix(in srgb, var(--brand-secondary) 25%, transparent); background: color-mix(in srgb, var(--brand-secondary) 8%, transparent); }
.mc-action-btn-config:hover { background: var(--brand-secondary, #7c3aed); color: #fff; border-color: var(--brand-secondary, #7c3aed); }

/* Variante: abrir / entrar (escuro) */
.mc-action-btn-open { color: #334155; border-color: rgba(51,65,85,.25); background: rgba(51,65,85,.08); }
.mc-action-btn-open:hover { background: #334155; color: #fff; border-color: #334155; }

.mc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

.mc-badge-success { background: #dcfce7; color: #166534; }
.mc-badge-warning { background: #fef3c7; color: #92400e; }
.mc-badge-danger { background: #fee2e2; color: #991b1b; }
.mc-badge-info { background: #dbeafe; color: #1d4ed8; }
.mc-badge-muted { background: #f1f5f9; color: #475569; }

@media (max-width: 767.98px) {
  .app-card,
  .app-section,
  .app-table-card,
  .mc-module-card,
  .mc-form-card,
  .mc-table-card {
    padding: 16px;
    border-radius: 14px;
  }

  .app-page-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .app-mobile-stack {
    gap: 12px;
  }

  .app-mobile-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-mobile-actions .btn {
    width: 100%;
  }

  .app-mobile-filter-fab {
    display: inline-flex;
  }

  .app-responsive-grid,
  .app-form-grid,
  .app-kpi-grid {
    grid-template-columns: 1fr;
  }

  .app-mobile-shell {
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-mobile-bottom-nav {
    display: flex;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    align-items: center;
    justify-content: space-around;
    min-height: 70px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, .12);
  }

  .app-mobile-bottom-nav a,
  .app-mobile-bottom-nav button {
    display: grid;
    gap: 3px;
    justify-items: center;
    font-size: .68rem;
    font-weight: 800;
  }

  .app-mobile-bottom-nav i {
    font-size: 1.25rem;
  }

  .app-mobile-bottom-nav .is-active,
  .app-mobile-bottom-nav .active {
    color: #2563eb;
  }

  .app-table-responsive {
    scrollbar-width: none;
  }

  .app-table-responsive::-webkit-scrollbar {
    display: none;
  }

  .app-modal-mobile {
    max-width: calc(100% - 1.5rem);
    margin: .75rem auto;
  }

  .app-modal-mobile .modal-content {
    max-height: calc(100dvh - 1.5rem);
    border-radius: 16px;
  }

  .app-modal-mobile .modal-body {
    overflow-y: auto;
  }

  .app-modal-mobile .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .app-modal-mobile .modal-footer .btn {
    width: 100%;
    margin: 0;
  }

  .mc-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mc-tabs::-webkit-scrollbar {
    display: none;
  }

  .mc-tab {
    flex: 0 0 auto;
  }
}

.mc-stat-body { flex: 1; min-width: 0; }

.mc-stat-label {
  font-size: .76rem;
  font-weight: 600;
  color: var(--mc-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--mc-text);
  line-height: 1.1;
  margin: 3px 0 0;
}

/* Dashboard: KPIs em grade BALANCEADA (4 colunas no desktop) para nunca
   sobrar card órfão "no limbo". Quebra para 2 e 1 coluna nas telas menores. */
.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-kpis .mc-kpi-card { gap: 12px; padding: 16px 18px; min-width: 0; }
.dashboard-kpis .mc-stat-icon { width: 44px; height: 44px; flex: 0 0 44px; font-size: 1.1rem; }
.dashboard-kpis .mc-stat-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
/* valor sempre dentro do card — nunca "vaza" (overflow-wrap) */
.dashboard-kpis .mc-stat-value { font-size: 1.4rem; white-space: normal; overflow-wrap: anywhere; }
.dashboard-kpis .mc-stat-meta { white-space: normal; line-height: 1.25; }

/* Linha "hero": KPIs com leve destaque (valor maior, cabe em 1 linha) */
.dashboard-hero .mc-stat-value { font-size: 1.5rem; }

@media (max-width: 1100px) {
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dashboard-kpis { grid-template-columns: 1fr; }
}

/* Container de gráfico com altura FIXA — combinado com maintainAspectRatio:false
   no Chart.js, impede o gráfico de ficar gigante em telas largas. */
.dashboard-chart {
  position: relative;
  height: 300px;
  width: 100%;
}
@media (max-width: 575px) {
  .dashboard-chart { height: 260px; }
}

/* Dashboard: barras horizontais (previsão de receita) */
.dash-bars { display: flex; flex-direction: column; gap: 10px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; }
.dash-bar-label { flex: 0 0 42%; display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dash-bar-track { flex: 1 1 auto; height: 8px; border-radius: 999px; background: rgba(148, 163, 184, .18); overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.dash-bar-val { flex: 0 0 auto; font-size: .8rem; font-weight: 700; color: #0f172a; white-space: nowrap; }
[data-bs-theme="dark"] .dash-bar-label { color: #cbd5e1; }
[data-bs-theme="dark"] .dash-bar-val { color: #e2e8f0; }

/* ─── Busca global (command palette) ───────────────────────────────── */
.busca-overlay { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: flex-start; justify-content: center; }
.busca-overlay[hidden] { display: none; }
.busca-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.busca-box { position: relative; width: min(620px, 92vw); margin-top: 12vh; background: #fff;
  border-radius: 16px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); overflow: hidden; }
[data-bs-theme="dark"] .busca-box { background: #111c2f; }
.busca-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--app-module-border, #eef2f7); }
.busca-input-wrap > i { color: #64748b; font-size: 1.1rem; }
.busca-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.05rem; color: var(--mc-text, #0f172a); }
.busca-esc { font-size: .7rem; color: #94a3b8; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px 6px; }
.busca-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.busca-hint { color: #94a3b8; font-size: .88rem; text-align: center; padding: 22px 12px; }
.busca-group { margin-bottom: 6px; }
.busca-group-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: #94a3b8; padding: 8px 10px 4px; }
.busca-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: inherit; }
.busca-item:hover { background: var(--brand-primary-soft, rgba(37, 99, 235, .08)); }
.busca-item > i { color: var(--brand-primary, #2563eb); flex: 0 0 auto; }
.busca-item-main { font-weight: 600; color: var(--mc-text, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busca-item-meta { margin-left: auto; color: #94a3b8; font-size: .8rem; flex: 0 0 auto; }
[data-bs-theme="dark"] .busca-item-main { color: #e2e8f0; }
body.busca-open { overflow: hidden; }

/* ─── Home (Início): lista de tarefas + mini funil ───────────────── */
.home-task-list { list-style: none; margin: 0; padding: 0; }
.home-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-module-border, #eef2f7);
}
.home-task:last-child { border-bottom: 0; }
.home-task-when {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.home-task-body { flex: 1 1 auto; min-width: 0; }
.home-task-action { flex: 0 0 auto; margin: 0; }

/* Funil de verdade: faixas centralizadas que AFUNILAM (estreitam por etapa) */
.home-funnel-chart { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.home-funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  box-sizing: border-box;
  min-width: 96px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
  transition: width .35s ease;
}
.home-funnel-step-name {
  font-size: .8rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.home-funnel-step-qtd { font-weight: 800; font-size: .95rem; flex-shrink: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .22); }

/* Atalhos rápidos da home */
.home-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 8px; }
.home-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--app-module-border, #eef2f7);
  background: rgba(255, 255, 255, .5);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.home-shortcut:hover {
  border-color: color-mix(in srgb, var(--brand-secondary) 30%, transparent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.home-shortcut .mc-stat-icon { width: 42px; height: 42px; flex: 0 0 42px; font-size: 1.05rem; }
.home-shortcut-text { min-width: 0; }
.home-shortcut-text strong { display: block; color: #0f172a; font-size: .9rem; line-height: 1.2; }
.home-shortcut-text small { display: block; color: #64748b; font-size: .76rem; }
[data-bs-theme="dark"] .home-shortcut { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .home-shortcut-text strong { color: #e2e8f0; }

/* Negócios parados (home) */
.home-parados { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.home-parado { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--app-module-border, #eef2f7); background: rgba(255, 255, 255, .5);
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.home-parado:hover { border-color: rgba(217, 119, 6, .4); box-shadow: 0 6px 18px rgba(15, 23, 42, .07); }
.home-parado-dias { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem;
  font-weight: 800; color: #b45309; background: #fef3c7; border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.home-parado-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.home-parado-body strong { font-size: .86rem; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-parado-body small { color: #64748b; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-parado-valor { flex: 0 0 auto; font-weight: 700; color: #1f845a; font-size: .82rem; white-space: nowrap; }
[data-bs-theme="dark"] .home-parado { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .home-parado-body strong { color: #e2e8f0; }

/* ─── Integrações: selo de WhatsApp conectado ───────────────────── */
.wa-connected-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(22, 163, 74, .1);
  color: #15803d;
  font-weight: 600;
  font-size: .9rem;
}
.wa-connected-bar i { font-size: 1rem; }
.wa-connected-bar strong { color: #0f172a; }
.wa-connected-bar strong:not(.d-none)::before { content: "·"; margin: 0 6px 0 2px; color: #94a3b8; font-weight: 400; }
[data-bs-theme="dark"] .wa-connected-bar { background: rgba(22, 163, 74, .18); color: #4ade80; }
[data-bs-theme="dark"] .wa-connected-bar strong { color: #e2e8f0; }

/* ─── Avisos: central de comunicação (workspace + cards + preview) ── */
.avisos-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
@media (max-width: 991px) { .avisos-workspace { grid-template-columns: 1fr; } }

.avisos-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
@media (max-width: 575px) { .avisos-target-grid { grid-template-columns: 1fr; } }
.avisos-target-card {
  --tc: #2563eb;
  position: relative;
  border: 1px solid color-mix(in srgb, var(--tc) 24%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 6%, transparent), rgba(255, 255, 255, .7));
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.avisos-target-card:hover { border-color: var(--tc); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 23, 42, .08); }
.avisos-target-card input { position: absolute; opacity: 0; pointer-events: none; }
.avisos-target-card:has(input:checked) {
  border-color: var(--tc);
  box-shadow: inset 3px 0 0 var(--tc), 0 10px 26px rgba(15, 23, 42, .10);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 14%, white), rgba(255, 255, 255, .92));
}
.avisos-target-card.target-blue { --tc: #2563eb; }
.avisos-target-card.target-violet { --tc: #7c3aed; }
.avisos-target-card.target-green { --tc: #16a34a; }
.avisos-target-title { display: flex; align-items: center; gap: 7px; font-weight: 800; color: #0f172a; font-size: .9rem; }
.avisos-target-title i { color: var(--tc); }
.avisos-target-desc { display: block; color: #64748b; font-size: .8rem; line-height: 1.35; margin-top: 5px; }
.avisos-target-fields { margin-top: 12px; }
.avisos-target-field[hidden] { display: none !important; }

.avisos-side { position: sticky; top: 16px; }
.avisos-preview { border-radius: 16px; border: 1px solid #e5e7eb; background: #fff; padding: 14px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }
.avisos-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.avisos-preview-app { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: #475569; }
.avisos-preview-title { display: block; color: #0f172a; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.avisos-preview-body { color: #475569; margin: 7px 0 0; line-height: 1.4; overflow-wrap: anywhere; font-size: .9rem; }
[data-bs-theme="dark"] .avisos-target-title { color: #e2e8f0; }
[data-bs-theme="dark"] .avisos-preview { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .avisos-preview-title { color: #e2e8f0; }

/* Logs de comunicação: ícones de canal */
.log-canais { display: inline-flex; gap: 4px; }
.log-canal { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 7px; font-size: .8rem; }
.log-canal-blue { background: rgba(37, 99, 235, .12); color: #2563eb; }
.log-canal-violet { background: color-mix(in srgb, var(--brand-secondary) 12%, transparent); color: var(--brand-secondary, #7c3aed); }
.log-canal-green { background: rgba(22, 163, 74, .12); color: #16a34a; }

/* ─── Templates de aviso: cards ─────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.template-card {
  background: var(--app-module-bg, #fff);
  border: 1px solid var(--app-module-border, #eef2f7);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.template-card:hover {
  box-shadow: 0 12px 30px rgba(15, 23, 42, .09);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-secondary) 18%, transparent);
}
.template-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.template-card-badges { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.template-card-name { font-weight: 800; color: #0f172a; line-height: 1.25; }
.template-card-title { color: #334155; font-size: .9rem; margin-top: 2px; }
.template-card-msg { color: #64748b; font-size: .82rem; line-height: 1.4; margin: 8px 0 0; }
[data-bs-theme="dark"] .template-card { background: rgba(255, 255, 255, .04); border-color: #334155; }
[data-bs-theme="dark"] .template-card-name { color: #e2e8f0; }
[data-bs-theme="dark"] .template-card-title { color: #cbd5e1; }

/* ─── Automações: lista compacta (detalhes recolhidos) ──────────── */
.automacao-list { display: flex; flex-direction: column; gap: 12px; }
.automacao-row {
  display: block;
  background: var(--app-module-bg, #fff);
  border: 1px solid var(--app-module-border, #eef2f7);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.automacao-row--off { opacity: .72; }
.automacao-row--off .mc-stat-icon { filter: grayscale(.7); }
.automacao-row-head { display: flex; align-items: center; gap: 14px; }
.automacao-row-info { flex: 1 1 auto; min-width: 0; }
.automacao-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; color: #0f172a; }
.automacao-row-desc { color: #64748b; font-size: .84rem; margin: 3px 0 0; line-height: 1.35; }
.automacao-row-toggle { flex: 0 0 auto; }
.automacao-row-toggle .form-check-label { color: #64748b; }
.automacao-details { margin-top: 10px; }
.automacao-details > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 700; color: var(--brand-secondary, #7c3aed);
  padding: 5px 11px; border-radius: 8px;
  background: color-mix(in srgb, var(--brand-secondary) 8%, transparent);
  user-select: none;
}
.automacao-details > summary::-webkit-details-marker { display: none; }
.automacao-details > summary::marker { content: ""; }
.automacao-details[open] > summary { margin-bottom: 12px; }
.automacao-details-body { padding-top: 2px; }
.automacao-row-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
[data-bs-theme="dark"] .automacao-row { background: rgba(255, 255, 255, .04); border-color: #334155; }
[data-bs-theme="dark"] .automacao-row-title { color: #e2e8f0; }

/* ─── Negócio (detalhe): linha do tempo + atividades ─────────────── */
.timeline-list { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline-item { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px;
  background: var(--app-module-border, #eef2f7);
}
.timeline-icon {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, .14); font-size: .85rem; z-index: 1;
}
.timeline-body { padding-top: 3px; min-width: 0; }

.atividade-list { list-style: none; margin: 16px 0 0; padding: 0; }
.atividade-item { padding: 11px 0; border-bottom: 1px solid var(--app-module-border, #eef2f7); }
.atividade-item:last-child { border-bottom: 0; padding-bottom: 0; }
.atividade-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.atividade-acoes { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.atividade-acoes form { margin: 0; }
.atividade-acoes .mc-action-btn { width: 30px; height: 30px; min-width: 30px; min-height: 30px; font-size: .85rem; }
.atividade-title { font-weight: 600; color: #0f172a; line-height: 1.3; }
[data-bs-theme="dark"] .atividade-title { color: #e2e8f0; }

/* Variante em grade (largura total da tela de negócio) — cada atividade vira card */
.atividade-list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.atividade-list--grid .atividade-item {
  padding: 12px 14px;
  border: 1px solid var(--app-module-border, #eef2f7);
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
}
.atividade-list--grid .atividade-item:last-child { padding: 12px 14px; }
.atividade-list--grid .app-empty-state { grid-column: 1 / -1; }
[data-bs-theme="dark"] .atividade-list--grid .atividade-item { background: rgba(255, 255, 255, .03); }

/* â”€â”€â”€ Chart grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.mc-chart-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mc-chart-grid.cols-1 {
  grid-template-columns: 1fr;
}

.mc-chart-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  transition: box-shadow .22s, transform .22s;
}

.mc-chart-card.is-wide {
  grid-column: 1 / -1;
}

.mc-chart-card:hover {
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.13);
  transform: translateY(-2px);
}

.mc-chart-header {
  padding: 18px 20px 6px;
}

.mc-chart-title {
  font-size: .88rem;
  font-weight: 700;
  color: #374151;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-chart-body {
  position: relative;
  height: 280px;
  padding: 8px 16px 16px;
  box-sizing: border-box;
}

.mc-chart-body.h-200 { height: 200px; }
.mc-chart-body.h-240 { height: 240px; }

.mc-chart-body canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
}

/* â”€â”€â”€ Section title â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand-secondary, #7c3aed);
  margin: 22px 0 10px;
  padding-left: 2px;
}

/* â”€â”€â”€ Empty chart state â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-empty-chart {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  font-size: .82rem;
  text-align: center;
}

.mc-empty-chart svg { opacity: .3; }

/* â”€â”€â”€ Nav scroll (horizontal tabs com muitos itens) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-nav-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: rgba(255,255,255,.68);
  border: 1px solid #eef2f7;
  border-radius: 14px;
}

.mc-nav-label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 14px 0 6px;
  padding-left: 2px;
}
.mc-nav-label:first-child { margin-top: 0; }

/* â”€â”€â”€ Section title (header dentro de mc-section-card) â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.mc-section-title i { color: var(--brand-secondary, #7c3aed); }

/* â”€â”€â”€ Stat row (key-value dentro de sections) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: .88rem;
}
.mc-stat-row:last-child { border-bottom: none; }
.mc-stat-row .label { color: #6b7280; }
.mc-stat-row .value { font-weight: 700; color: #0f172a; }

/* â”€â”€â”€ Block link (footer link dentro de sections) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-block-link {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand-primary, #4f46e5);
  text-decoration: none;
}
.mc-block-link:hover { color: #3730a3; }

/* â”€â”€â”€ Empty state â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mc-empty {
  text-align: center;
  padding: 48px 18px;
  color: #64748b;
}
.mc-empty i { font-size: 2rem; color: var(--brand-secondary, #7c3aed); display: block; margin-bottom: 10px; }
.mc-empty p { font-size: .95rem; margin: 0; }

/* â”€â”€â”€ Responsive mc-* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1280px) {
  .mc-kpi-extras { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .mc-chart-grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 767.98px) {
  .mc-kpi-grid    { grid-template-columns: 1fr; gap: 12px; }
  .mc-kpi-extras  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .mc-chart-grid,
  .mc-chart-grid.cols-3,
  .mc-chart-grid.cols-1 { grid-template-columns: 1fr; gap: 12px; }
  .mc-kpi-card    { border-radius: 16px; padding: 14px 16px; }
  .mc-chart-card  { border-radius: 16px; }
  .mc-stat-value  { font-size: 1.5rem; }
  .mc-chart-body  { height: 220px; }
  .mc-chart-body.h-200 { height: 180px; }
  .mc-chart-card.is-wide { grid-column: unset; }
  .mc-nav-scroll  { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .mc-nav-scroll::-webkit-scrollbar { display: none; }
  .mc-nav-label   { margin: 10px 0 4px; }
}

@media (max-width: 479.98px) {
  .app-mobile-kpi-grid {
    grid-template-columns: 1fr;
  }

  .mc-kpi-extras  { grid-template-columns: 1fr; }
  .mc-stat-icon   { width: 44px; height: 44px; flex: 0 0 44px; font-size: 1.1rem; }
  .mc-stat-value  { font-size: 1.35rem; }
  .mc-chart-header { padding: 14px 14px 4px; }
  .mc-chart-body  { padding: 6px 12px 12px; height: 200px; }
}

/* === SIDEBAR DE ÃCONES FIXOS === */
.sidebar-icons {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 100vh;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 12px;
}

/* Compactação por altura — definição completa mais abaixo, depois das regras
   base de .sidebar-icons .icon-link, para vencer por ordem do cascade. */

.sidebar-icons button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--mc-sidebar-text);
  margin-bottom: 15px;
  cursor: pointer;
}

.sidebar-icons a {
  color: var(--mc-sidebar-muted);
  font-size: 1.5rem;
  width: 100%;
  text-align: center;
  padding: 10px 0;
  transition: color 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-icons a.active,
.sidebar-icons a:hover {
  color: #0f172a;
}

/* === MENU EXPANDIDO === */
.sidebar-expandido {
  position: fixed;
  top: 0;
  left: 60px;
  width: 260px;
  height: 100vh;
  background: #ffffff;
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.12);
  z-index: 1049;
  overflow-y: auto;
  transition: all 0.3s ease;
  padding-top: 20px;
}

.sidebar-expandido.d-none {
  display: none;
}

.sidebar-expandido .p-3 {
  padding: 20px;
}

.sidebar-expandido h4 {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #343a40;
}

.sidebar-expandido a {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: #495057;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-expandido a i {
  font-size: 1.2rem;
  margin-right: 10px;
  min-width: 24px;
  text-align: center;
}

.sidebar-expandido a:hover {
  background-color: #f8fafc;
  color: #0f172a;
  transform: translateX(2px);
}

.sidebar-expandido a.active {
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.sidebar-expandido a.active i {
  filter: drop-shadow(0 3px 8px rgba(37, 99, 235, 0.18));
}

.sidebar-expandido a.text-danger {
  color: #dc3545;
}

.sidebar-expandido a.text-danger:hover {
  background-color: #f8d7da;
}

/* === PERFIL DO USUÃRIO â€” RODAPÃ‰ DA SIDEBAR === */
.sidebar-perfil {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: 8px;
}

.sidebar-perfil-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 52px;
  transition: background 0.2s;
}
.sidebar-perfil-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.sidebar-perfil-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary, #4f46e5), var(--brand-secondary, #7c3aed));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-perfil-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.sidebar-perfil-nome {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--mc-sidebar-text);
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-perfil-menu {
  min-width: 240px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  border: 1px solid #e5e7eb;
  padding: 0;
  overflow: hidden;
  margin-left: 8px;
}

.sidebar-perfil-header {
  background-color: #f9fafb;
  line-height: 1.4;
}

.sidebar-perfil-menu .dropdown-item {
  padding: 10px 16px;
  font-size: 0.9rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: #374151;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.sidebar-perfil-menu .dropdown-item > i {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-perfil-menu .dropdown-item:hover {
  background-color: #f3f4f6;
}

/* === CONTEÃšDO PRINCIPAL === */
.content {
  margin-left: 60px;
  padding: 30px;
  transition: margin-left 0.3s ease;
}

.sidebar-expandido:not(.d-none) ~ .content {
  margin-left: 320px;
}

/* === HAMBÃšRGUER === */
#toggleHamburger {
  background-color: var(--mc-sidebar-soft);
  color: var(--mc-sidebar-text);
  border: none;
  padding: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.3s ease;
}
#toggleHamburger:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--mc-sidebar-text);
}

/* === ÃCONES DA SIDEBAR === */
.sidebar-icons .icon-link {
  background-color: transparent;
  border: none;
  border-radius: 10px;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  color: var(--mc-sidebar-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  box-shadow: none;
}
.sidebar-icons .icon-link:hover {
  background-color: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.sidebar-icons .icon-link.active {
  background: rgba(37, 99, 235, 0.10) !important;
  color: #1e40af;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.95);
}

.sidebar-icons .icon-link.active i {
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.18));
}

.sidebar-main-link.active,
.sidebar-main-item.active,
.sidebar-icon-link.active,
.sidebar-menu > .sidebar-item.active > .sidebar-link {
  background: rgba(37, 99, 235, 0.10) !important;
  color: var(--mc-primary);
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.10);
}


/* Cores individuais por Ã­cone */
.sidebar-icons .icon-link[data-target="menu-pessoas"] i {
  color: #10b981;
}

.sidebar-icons #homeLink i {
  color: #007bff;
}

.sidebar-icons #eventosLink i,
.sidebar-icons .icon-link[data-target="menu-eventos"] i {
  color: #ec4899;
}


.sidebar-icons .icon-link[data-target="menu-midias"] i {
  color: #3b82f6;
}

.sidebar-icons .icon-link[data-target="menu-grupo"] i,
.sidebar-icons .icon-link[data-target="menu-gc"] i {
  color: #8b5cf6;
}

.sidebar-icons .icon-link[data-target="menu-intercessao"] i {
  color: #ef4444;
}

.sidebar-icons .icon-link[data-target="menu-kids"] i {
  color: #ec4899 !important;
}

.sidebar-icons .icon-link[data-target="menu-financeiro"] i,
.sidebar-icons #financeiroLink i {
  color: #f97316;
}

.sidebar-icons .icon-link[data-target="menu-admin"] i {
  color: #6f42c1;
}
.sidebar-expandido a .bi-grid-fill { color: #007bff; }
.sidebar-expandido a .bi-person-fill { color: #28a745; }
.sidebar-expandido a .bi-person-lines-fill { color: #fd7e14; }
.sidebar-expandido a .bi-hand-index-thumb { color: #6f42c1; }
.sidebar-expandido a .bi-calendar3 { color: #e83e8c; }
.sidebar-expandido a .bi-bar-chart-line-fill { color: #17a2b8; }
.sidebar-expandido a .bi-sliders { color: #ffc107 !important; }
.sidebar-expandido a .bi-people { color: #007bff; }
.sidebar-expandido a .bi-gear { color: #6f42c1; }
.sidebar-expandido a .bi-building { color: #fd7e14 !important; }
.sidebar-expandido a .bi-shield-check { color: #dc3545 !important; }
.sidebar-expandido a .bi-person-gear { color: #28a745 !important; }
.sidebar-expandido a .bi-diagram-3-fill { color: #8b5cf6; }
.sidebar-expandido a .bi-file-earmark-text-fill { color: #0d9488; }
.sidebar-expandido a .bi-person-badge-fill { color: var(--brand-secondary, #7c3aed); }
.sidebar-expandido a .bi-arrow-right-circle-fill { color: #f59e0b; }
.sidebar-expandido a .bi-folder-fill { color: #f97316; }
.sidebar-expandido a .bi-bar-chart-fill { color: #9333ea; }

@media (max-width: 991.98px) {
  .sidebar-icons {
    width: 100%;
    height: 58px;
    min-height: 58px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-icons button,
  #toggleHamburger,
  .sidebar-icons .icon-link {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    font-size: 1.15rem;
  }

  .sidebar-perfil {
    flex: 0 0 auto;
    width: auto;
    margin: 0 0 0 auto;
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.10);
  }

  .sidebar-perfil-btn {
    width: 42px;
    height: 42px;
    padding: 0;
  }

  .sidebar-perfil-nome {
    display: none;
  }

  .sidebar-perfil-menu {
    margin-left: 0;
  }

  .sidebar-expandido {
    top: 58px;
    left: 0;
    width: min(320px, 86vw);
    height: calc(100vh - 58px);
    z-index: 1051;
    padding-top: 8px;
  }

  .content,
  .sidebar-expandido:not(.d-none) ~ .content {
    margin-left: 0;
    padding: 78px 16px 20px;
  }
}

/* Notebooks com altura reduzida (≈768–820px): compacta a sidebar pra caber
   tudo sem precisar rolar nem reduzir zoom. Só desktop (≥992px); abaixo
   disso a sidebar vira bottom-nav. Precisa vir DEPOIS das regras base de
   .sidebar-icons .icon-link pra vencer no cascade (mesma especificidade). */
@media (min-width: 992px) and (max-height: 820px) {
  .sidebar-icons { padding-top: 8px; padding-bottom: 6px; }
  .sidebar-icons .icon-link,
  .sidebar-icons #toggleHamburger {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    margin-bottom: 3px;
  }
  .sidebar-icons #toggleHamburger { margin-bottom: 4px; }
  .sidebar-icons .sidebar-church-brand {
    margin-bottom: 4px;
    transform: scale(0.85);
    transform-origin: center top;
  }
  .sidebar-icons .sidebar-perfil-btn { padding-top: 4px; padding-bottom: 4px; }
  .sidebar-icons .sidebar-perfil-nome { display: none; }
  /* Sino tem margin-top: auto pra ancorar perfil ao rodapé em telas altas,
     mas em flex column com overflow-y:auto o auto calcula espaço fora da
     viewport visível e empurra o perfil pra fora. Em telas baixas, deixamos
     no fluxo natural — a compactação já garante que cabe. */
  .sidebar-icons .notification-bell-wrap.sidebar-near-profile { margin-top: 4px; }
  .sidebar-icons .sidebar-perfil { margin-top: 4px; padding-top: 4px; border-top: 0; }
}

@media (min-width: 992px) and (max-height: 760px) {
  .sidebar-icons { padding-top: 6px; padding-bottom: 6px; }
  .sidebar-icons .icon-link,
  .sidebar-icons #toggleHamburger {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    margin-bottom: 2px;
  }
  .sidebar-icons #toggleHamburger { margin-bottom: 4px; }
  .sidebar-icons .sidebar-church-brand { transform: scale(0.75); margin-bottom: 0; }
  .sidebar-icons .sidebar-perfil {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 0;
  }
  .sidebar-icons .notification-bell-wrap.sidebar-near-profile { margin-top: 2px; }
}

@media (max-width: 575.98px) {
  .content,
  .sidebar-expandido:not(.d-none) ~ .content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sidebar-expandido {
    width: 100%;
  }
}

/* ===== Paginação — ESTILO GLOBAL ÚNICO =====
   Fonte única para todas as telas do sistema (antes estava duplicado em
   membros/financeiro/eventos/atendimentos/escalas_cultos/grupos_conexao).
   flex-wrap evita estouro no mobile; o resto é o visual padronizado. */
.pagination {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.pagination .page-link {
  border-radius: 8px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  background-color: #fff;
  color: var(--brand-primary, #4f46e5);
  font-weight: 500;
  transition: all 0.3s ease;
}
.pagination .page-link:hover {
  background-color: #ede9fe;
  border-color: #c4b5fd;
}
.pagination .page-item.active .page-link {
  background-color: var(--brand-primary, #4f46e5);
  border-color: var(--brand-primary, #4f46e5);
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: #9ca3af;
  background-color: #f9fafb;
  border-color: #e5e7eb;
}
@media (max-width: 575.98px) {
  .pagination .page-link { padding: 6px 10px; min-width: 36px; }
}

/* ===== Ícone de busca nos filtros — ESTILO GLOBAL ÚNICO =====
   Fonte única (antes duplicado em membros/financeiro/eventos/escalas_cultos/
   grupos_conexao/mapa_membresia). Escopado em .ec-filter-icon-wrap, então só
   afeta os campos de filtro que usam esse wrapper. */
.ec-filter-icon-wrap { position: relative; min-width: 200px; }
.ec-filter-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .78rem;
  pointer-events: none;
  z-index: 1;
  color: #94a3b8;
}
.ec-filter-icon-wrap .form-control,
.ec-filter-icon-wrap .form-select { padding-left: 28px !important; }

/* ════════════════════════════════════════════════════════════════════
   UX MOBILE — Snackbar (toast compacto) + Tabelas viram cards
   Fonte: modal.js (showToast monta o snackbar) e responsive-components.js
   (marca tabelas elegíveis com .wc-cardify e injeta data-label por coluna).
   Alvo: .mc-table (canônica) e .table (Bootstrap) com <thead>, exceto as que
   já têm versão mobile própria (escondidas via .d-none) ou estão em modal.
   Cores via var(--wc-*) com fallback claro → funciona em light e dark.
   Opt-out por tabela: classe .mc-no-cards.
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

  /* ─── Snackbar mobile (rodapé, acima da bottom-nav) ─────────────── */
  .swal2-container.swal2-bottom {
    padding: 0 14px calc(env(safe-area-inset-bottom, 0px) + 78px) !important;
  }
  .swal2-popup.swal2-toast.wc-snackbar {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: auto;
    max-width: calc(100vw - 28px);
    margin: 0 auto !important;
    padding: 10px 16px !important;
    border-radius: 999px;
    background: var(--wc-surface, #ffffff);
    border: 1px solid var(--wc-border, #e8edf3);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .22);
    overflow: hidden;
  }
  .wc-snackbar .swal2-icon.wc-snackbar-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .wc-snackbar .swal2-icon .swal2-icon-content {
    font-size: 1.3rem !important;
    line-height: 1 !important;
  }
  .wc-snackbar .swal2-icon.swal2-success .swal2-icon-content { color: #16a34a; }
  .wc-snackbar .swal2-icon.swal2-error .swal2-icon-content   { color: #dc2626; }
  .wc-snackbar .swal2-icon.swal2-warning .swal2-icon-content { color: #d97706; }
  .wc-snackbar .swal2-icon.swal2-info .swal2-icon-content,
  .wc-snackbar .swal2-icon.swal2-question .swal2-icon-content { color: #2563eb; }
  .wc-snackbar .wc-snackbar-title {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: .9rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: var(--wc-text, #1e293b);
    white-space: normal;
    word-break: break-word;
  }

  /* ─── Tabelas marcadas viram cards (marcador aplicado pelo JS) ──── */
  table.wc-cardify {
    display: block;
    width: 100%;
    border-spacing: 0;
  }
  /* cabeçalho some visualmente, mas continua legível por leitor de tela */
  table.wc-cardify thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  table.wc-cardify tbody { display: block; }
  table.wc-cardify tbody tr {
    display: block;
    background: var(--wc-surface, #ffffff);
    border: 1px solid var(--wc-border, #e2e8f0);
    border-radius: 14px;
    padding: 4px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  }
  table.wc-cardify tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: auto;
    min-height: 0;
    padding: 9px 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    text-align: right;
    color: var(--wc-text, #334155);
    white-space: normal;
  }
  table.wc-cardify tbody td + td {
    border-top: 1px solid var(--wc-border-soft, #f1f5f9) !important;
  }
  table.wc-cardify tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    margin-right: auto;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wc-muted, #64748b);
  }
  /* o valor pode encolher/quebrar sem estourar o card */
  table.wc-cardify tbody td > * { min-width: 0; }
  /* células sem cabeçalho (coluna de ações) ocupam a linha, alinhadas à direita */
  table.wc-cardify tbody td[data-fullspan] {
    justify-content: flex-end;
    text-align: right;
  }
  table.wc-cardify tbody td[data-fullspan] .mc-table-actions {
    justify-content: flex-end;
    width: 100%;
    flex-wrap: wrap;
  }
  /* linha de "nenhum registro" (colspan) centralizada, sem cara de campo */
  table.wc-cardify tbody td[colspan] {
    justify-content: center;
    text-align: center;
    color: var(--wc-muted, #64748b);
  }
}
