/* ==========================================================
 * ARQUIVO: layout.css
 * LOCALIZAÇÃO: assets/css/
 * ==========================================================
 * DESCRIÇÃO:
 * Este arquivo contém os estilos principais para o layout do
 * sistema PGD. Ele define a estrutura visual, incluindo o
 * comportamento da barra lateral, cabeçalhos e áreas de
 * conteúdo.
 * ==========================================================
 * BOAS PRÁTICAS DE CSS:
 * 1. ORGANIZAÇÃO:
 *    - Estruture o CSS em seções claras e utilize comentários
 *      para identificar diferentes partes do layout.
 *
 * 2. NOMENCLATURA:
 *    - Utilize nomes de classes descritivos e consistentes.
 *      Exemplo: .pgd-sidebar, .pgd-layout-wrapper.
 *
 * 3. RESPONSIVIDADE:
 *    - Sempre considere dispositivos móveis e utilize media
 *      queries para ajustar o layout em diferentes tamanhos
 *      de tela.
 *
 * 4. REUTILIZAÇÃO:
 *    - Evite duplicação de código. Crie classes reutilizáveis
 *      para estilos comuns, como botões e tipografia.
 *
 * 5. EVITAR INLINE:
 *    - Prefira manter os estilos no arquivo CSS ao invés de
 *      inline no HTML, para facilitar a manutenção.
 *
 * 6. PERFORMANCE:
 *    - Minimize o uso de seletores muito específicos ou
 *      aninhados, pois podem impactar a performance.
 * ==========================================================
 */

/* --- REMOVE ESPAÇOS DO WORDPRESS --- */
html, body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Esconde a barra caso o PHP falhe por algum motivo (segurança extra) */
#wpadminbar {
    display: none !important;
}

/* RESET DO LAYOUT (Proteção contra temas do WP) */
.pgd-layout-wrapper {
    --pgd-topbar-height: 55px;
    display: grid;
    /* Coluna 1 (Sidebar): 260px fixo | Coluna 2 (Content): O resto (1fr) */
    grid-template-columns: 260px 1fr; 
    min-height: 100vh;
    background-color: #f4f6f9; /* Fundo cinza claro profissional */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    line-height: 1.5;
}

/* =====================================================
   Itinerário de Pregação Rápida
   ===================================================== */
.pgd-itinerario-templates-section {
    margin-top: 0;
    width: 100%;
}

.pgd-itinerario-templates-wrap {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding: 0;
    background: transparent;
}

@media (max-width: 1024px) {
    .pgd-itinerario-templates-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pgd-itinerario-templates-wrap {
        grid-template-columns: 1fr;
    }
}

.pgd-itinerario-templates-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 10px 0 8px;
}

.pgd-itinerario-templates-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.pgd-itinerario-rapido-btn {
    padding: 4px 10px !important;
    min-height: 28px !important;
    height: 28px !important;
    line-height: 1;
    font-size: 12px;
}

[data-pgd-itinerario-rapido-root] button.pgd-btn.pgd-btn-small.pgd-itinerario-rapido-edit-btn {
    padding: 4px 20px !important;
    min-height: 28px !important;
    height: 28px !important;
    line-height: 1 !important;
    font-size: 12px !important;
}

@media (min-width: 1025px) {
    .pgd-itinerario-templates-grid [data-pgd-itinerario-template-card] ul {
        margin-top: 10px;
    }
}

.pgd-itinerario-template-modal {
    max-width: 640px;
    width: 100%;
}

.pgd-itinerario-template-grid {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.pgd-itinerario-template-days {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    font-size: 12px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pgd-layout-wrapper .pgd-itinerario-template-days button.pgd-btn,
.pgd-layout-wrapper .pgd-itinerario-template-days a.pgd-btn {
    padding: 3px 13px !important;
    min-height: 26px !important;
    height: 26px !important;
    font-size: 14px !important;
    margin-top: 3px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.pgd-itinerario-template-row {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

.pgd-itinerario-template-day {
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
}

[data-pgd-itinerario-template-modal] .pgd-itinerario-template-day {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.pgd-itinerario-template-times {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.pgd-layout-wrapper button.pgd-itinerario-template-remove,
.pgd-layout-wrapper a.pgd-itinerario-template-remove {
    padding: 2px 6px !important;
    min-height: 18px !important;
    height: 18px !important;
    line-height: 1 !important;
    font-size: 10px !important;
}

[data-pgd-itinerario-template-modal] button.pgd-btn.pgd-btn-small.pgd-itinerario-template-remove,
[data-pgd-itinerario-template-modal] a.pgd-btn.pgd-btn-small.pgd-itinerario-template-remove {
    padding: 8px 14px !important;
    min-height: 29px !important;
    height: 29px !important;
    line-height: 1 !important;
    font-size: 14px !important;
}

.pgd-itinerario-template-times .pgd-input {
    max-width: 110px;
    height: 34px;
    padding: 6px 8px;
    font-size: 12px;
}

[data-pgd-itinerario-ocorrencias] .pgd-table tbody tr.pgd-itinerario-sabado td {
    background: #e6f0ff;
    font-weight: 600;
}

[data-pgd-itinerario-ocorrencias].pgd-itinerario-escala-salva {
    border-color: #1848cd !important;
    box-shadow: 0 0 0 1px #1848cd;
}

@media (max-width: 640px) {
    .pgd-itinerario-template-row {
        grid-template-columns: 1fr;
    }
    .pgd-itinerario-template-remove {
        width: 100%;
    }
}


/* --- SIDEBAR (Esquerda) --- */
[data-pgd-itinerario-template-modal] .pgd-modal-footer {
    padding: 0 20px 20px;
    gap: 10px;
}
.pgd-sidebar {
    background-color: #2c3e50; /* Azul Escuro */
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky; /* Mantém fixa ao rolar */
    top: 0;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    z-index: 100;
    overflow: hidden; /* evita barra dupla e mantém o scroll no menu */
}

.pgd-sidebar-header {
    height: var(--pgd-topbar-height) !important;
    min-height: var(--pgd-topbar-height) !important;
    flex: 0 0 var(--pgd-topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: #243342; /* Um pouco mais escuro que a sidebar */
}

.pgd-sidebar-logo {
    max-height: 34px;
    width: auto;
    filter: brightness(0) invert(1); /* Torna a logo branca se for preta */
}

/* Menu */
.pgd-nav {
    flex-grow: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0; /* permite o scroll dentro do flex */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.18) rgba(0,0,0,0.12); /* Firefox */
}

/* Scrollbar sutil na sidebar (WebKit/Chromium) */
.pgd-nav::-webkit-scrollbar {
    width: 6px;
}

.pgd-nav::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.12);
}

.pgd-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.18);
    border-radius: 10px;
}

.pgd-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.28);
}

.pgd-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pgd-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.pgd-nav li a .dashicons {
    margin-right: 12px;
    font-size: 18px;
    color: #95a5a6;
}

.pgd-nav li a:hover,
.pgd-nav li.active a {
    background-color: #34495e;
    color: #fff;
    border-left-color: #3498db; /* Detalhe azul ao passar mouse */
}

.pgd-nav li.active a .dashicons,
.pgd-nav li a:hover .dashicons {
    color: #3498db;
}

.pgd-nav-label {
    padding: 20px 25px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #58697a;
    font-weight: 700;
}

.pgd-nav-bottom {
    margin-top: auto; /* Empurra para o fim */
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- MAIN (Direita) --- */
.pgd-main {
    display: flex;
    flex-direction: column;
    max-width: 100%; /* Evita estouro */
    overflow-x: hidden;
}

/* Topbar */
.pgd-topbar {
    height: var(--pgd-topbar-height) !important;
    min-height: var(--pgd-topbar-height) !important;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.pgd-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pgd-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pgd-topbar-logo {
    display: none;
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
}

.pgd-mobile-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #2c3e50;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.pgd-mobile-menu-btn:hover { background: #eef2f7; }
.pgd-mobile-menu-btn:active { transform: scale(0.98); }
.pgd-mobile-menu-btn .dashicons { font-size: 22px; width: 22px; height: 22px; }

.pgd-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
}

.pgd-sidebar-close {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #ecf0f1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.pgd-sidebar-close .dashicons { font-size: 22px; width: 22px; height: 22px; }

/* Desktop: menu é fixo, então esconde controles mobile (hambúrguer e fechar) */
@media (min-width: 769px) {
    .pgd-mobile-menu-btn,
    .pgd-sidebar-close {
        display: none !important;
    }

    .pgd-mobile-overlay {
        display: none !important;
    }
}

.pgd-breadcrumbs {
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.pgd-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pgd-user-link {
    text-decoration: none;
    color: inherit;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pgd-user-link:hover {
    background: #f1f5f9;
}

.pgd-user-link:focus {
    outline: none;
}

/* ========================================
   PRINT / PDF STYLES - Sistema melhorado
   ======================================== */

.pgd-print-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.pgd-print-toolbar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.pgd-print-toolbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.pgd-print-toolbar-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pgd-print-option-group {
    display: flex;
    flex-direction: column;
}

.pgd-print-template-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 88px;
}

.pgd-print-template-btn:hover {
    border-color: #1848cd;
    color: #1848cd;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pgd-print-template-btn.active {
    border-color: #1848cd;
    color: #1848cd;
    box-shadow: 0 0 0 3px rgba(24, 72, 205, 0.1);
}

.pgd-print-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 120px;
    background: #fff;
}

.pgd-print-toggle-btn:hover {
    border-color: #1848cd;
    color: #1848cd;
    text-decoration: none;
}

.pgd-print-toggle-btn.active {
    border-color: #1848cd;
    color: #1848cd;
    box-shadow: 0 0 0 3px rgba(24, 72, 205, 0.1);
}

.pgd-btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.pgd-print-pages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 210mm;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

/* Página de impressão */
.pgd-print-page {
    background: var(--page-bg, #fff);
    padding: 5mm;
    margin: 0 0 8px 0;
    border: 1px solid #d1d5db;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    min-height: 297mm; /* A4 height */
    width: 210mm;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Layout vertical: um mês por linha */
.pgd-print-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pgd-print-month {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #374151;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow: visible;
    min-height: 185px;
}

/* Label vertical do mês na lateral esquerda */
.pgd-print-month-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2c3e50;
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 8px 6px;
    min-width: 30px;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pgd-print-month-label span {
    color: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pgd-print-month-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Título antigo escondido (substituído pelo label lateral) */
.pgd-print-month-title {
    display: none;
}

.pgd-print-month-body {
    display: grid;
    grid-template-columns: 155px 1fr;
    gap: 0;
    align-items: stretch;
    flex: 1;
}

.pgd-print-month-cal {
    display: block;
    border-right: 2px solid #374151;
    padding: 4px;
}

.pgd-print-month-events {
    display: flex;
    gap: 8px;
    overflow: visible;
    padding: 4px 6px;
    min-height: 140px;
    width: 100%;
    align-items: flex-start;
}

.pgd-print-events-col {
    flex: 1;
    min-width: 0;
}

/* Calendário mini */
.pgd-mini-cal {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}

.pgd-mini-cal th {
    font-size: 9px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    padding: 3px 1px;
    background: #6b7280;
    border: 1px solid #6b7280;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pgd-mini-cal td {
    border: 1px solid #d1d5db;
    text-align: center;
    vertical-align: middle;
    height: 22px;
    padding: 2px 1px;
    font-size: 10px;
    position: relative;
    background: #ffffff;
    font-weight: 600;
}

.pgd-mini-cal td.empty {
    background: #f9fafb;
    border-color: #f3f4f6;
}

.pgd-mini-cal td.has-event {
    font-weight: 700;
    color: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pgd-mini-cal td .day {
    font-size: 11px;
    line-height: 1;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Lista de eventos com checkmarks */
.pgd-print-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 10px;
    line-height: 1.3;
}

.pgd-print-list li {
    margin-bottom: 2px;
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
    line-height: 1.3;
}

.pgd-print-list li span {
    display: inline;
    vertical-align: top;
}

.pgd-print-event-check {
    display: inline;
    font-size: 9px;
    line-height: 1;
    color: #374151;
    margin-right: 4px;
}

/* Manter classe antiga para compatibilidade */
.pgd-print-event-bullet {
    display: none;
}

.pgd-print-empty {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 16px;
    font-style: italic;
}

/* Logos cabeçalho e rodapé */
.pgd-print-header,
.pgd-print-footer-logo {
    text-align: center;
    margin-bottom: 16px;
}

.pgd-print-footer-logo {
    margin-top: 16px;
    margin-bottom: 8px;
}

.pgd-print-logo {
    max-height: 80px;
    max-width: 100%;
    height: auto;
    width: auto;
}

.pgd-print-header {
    text-align: center;
    margin-bottom: 12px;
}

/* Cabeçalho da página com título dinâmico */
.pgd-print-page-header {
    background: var(--page-header-bg, #4b5563);
    color: #ffffff;
    padding: 12px 16px;
    margin: -5mm -5mm 12px -5mm;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pgd-print-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.pgd-print-page-subtitle {
    margin: 2px 0 0 0;
    font-size: 23px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.pgd-print-footer {
    margin-top: 16px;
    padding-top: 12px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pgd-print-itinerario-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.pgd-print-itinerario-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.pgd-print-itinerario-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.pgd-print-itinerario-meta {
    font-size: 12px;
    color: #6b7280;
}

.pgd-print-itinerario-ident {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 16px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    margin-bottom: 12px;
    font-size: 12px;
}

.pgd-print-itinerario-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.pgd-print-itinerario-message,
.pgd-print-itinerario-ref,
.pgd-print-itinerario-list {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
    margin-bottom: 12px;
}

.pgd-print-itinerario-message-body {
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.pgd-print-itinerario-muted {
    font-size: 12px;
    color: #9ca3af;
}

.pgd-print-itinerario-ref-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.pgd-print-itinerario-day {
    margin-top: 10px;
}

.pgd-print-itinerario-day-title {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.pgd-print-itinerario-day-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.pgd-print-logo-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.pgd-print-logo-modal[aria-hidden="false"] {
    display: block;
}

.pgd-print-logo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.pgd-print-logo-modal-content {
    position: relative;
    max-width: 520px;
    margin: 8vh auto;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.pgd-print-logo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pgd-print-logo-close {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.pgd-print-logo-modal-body {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.pgd-print-logo-preview {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.pgd-print-logo-preview img {
    max-height: 160px;
    max-width: 100%;
    height: auto;
    width: auto;
}

.pgd-print-logo-hint {
    font-size: 12px;
    color: #6b7280;
}

.pgd-print-logo-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

@media (max-width: 900px) {
    .pgd-print-toolbar-options {
        grid-template-columns: 1fr;
    }

    .pgd-print-pages {
        padding: 10px;
        max-width: 100%;
    }

    .pgd-print-page {
        width: 100%;
        min-height: auto;
    }
}

/* Media query para impressão */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        margin: 0;
        padding: 0;
    }

    /* Esconde navegação e controles */
    .pgd-sidebar,
    .pgd-topbar,
    .pgd-nav,
    .pgd-mobile-overlay,
    .pgd-click-blocker,
    .pgd-print-toolbar {
        display: none !important;
    }

    .pgd-main {
        padding: 0 !important;
        margin: 0 !important;
    }

    .pgd-card {
        box-shadow: none !important;
        border: none !important;
    }

    .pgd-print-pages {
        background: transparent !important;
        padding: 0 !important;
        gap: 0 !important;
        min-height: auto !important;
    }

    .pgd-print-page {
        border: none !important;
        margin: 0 !important;
        padding: 5mm !important;
        page-break-after: always;
        break-after: page;
        box-shadow: none !important;
        min-height: 100vh;
        width: 100% !important;
        max-width: 100% !important;
        background: var(--page-bg, #fff) !important;
    }

    .pgd-print-month {
        background: rgba(255, 255, 255, 0.92) !important;
        border: 2px solid #374151 !important;
        min-height: 185px !important;
        overflow: visible !important;
    }

    .pgd-print-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }

    .pgd-print-page-header {
        background: var(--page-header-bg, #4b5563) !important;
        color: #ffffff !important;
        margin: -5mm -5mm 10px -5mm !important;
        padding: 10px 12px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-print-page-title {
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-print-page-subtitle {
        color: rgba(255, 255, 255, 0.9) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Garante cores na impressão - aplicar em todos os elementos com cor */
    .pgd-print-page,
    .pgd-print-month,
    .pgd-print-month-label,
    .pgd-print-page-header,
    .pgd-mini-cal,
    .pgd-mini-cal *,
    .pgd-mini-cal td,
    .pgd-mini-cal th,
    .pgd-mini-cal td.has-event,
    .pgd-mini-cal td.empty {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .pgd-print-month-label {
        background: #2c3e50 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-print-month-label span {
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-mini-cal th {
        background: #6b7280 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-mini-cal td.has-event {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pgd-mini-cal td.empty {
        background: #f9fafb !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ajustes de layout para impressão */
    .pgd-print-grid-vertical {
        gap: 10px;
    }

    .pgd-print-month {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pgd-mini-cal {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pgd-print-list {
        /* Sem colunas CSS, usando divs lado a lado */
    }

    .pgd-print-list li {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        display: block !important;
    }

    .pgd-print-month-events {
        overflow: visible !important;
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }

    .pgd-print-events-col {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

/* ========================================
   FIM PRINT / PDF STYLES
   ======================================== */


.pgd-user-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.pgd-avatar img {
    border-radius: 50%;
    border: 2px solid #e0e0e0;
}

.pgd-user-name {
    font-size: 14px;
    color: #2c3e50;
}

/* Conteúdo */
.pgd-content-wrapper {
    padding: 30px;
    flex-grow: 1;
}

/* Componentes Básicos (Cards) */
.pgd-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.pgd-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pgd-card-stat {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.pgd-card-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.stat-info h3 {
    margin: 0;
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.pgd-footer {
    padding: 20px 30px;
    text-align: center;
    font-size: 12px;
    color: #95a5a6;
    border-top: 1px solid #e0e0e0;
}

/* --- PERFIL (RESUMO / RESPONSABILIDADES) --- */
.pgd-profile-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.pgd-profile-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pgd-profile-summary-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}

.pgd-profile-summary-title .dashicons {
    color: #3498db;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.pgd-profile-summary-note {
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 999px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
}

.pgd-perfil-dados-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pgd-perfil-avatar-meta{
    min-width: 0;
    flex: 1 1 240px;
}

.pgd-perfil-actions{
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pgd-perfil-avatar-form{
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pgd-perfil-page,
.pgd-perfil-page *{
    box-sizing: border-box;
}

.pgd-perfil-page{
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pgd-perfil-page .pgd-tags-container,
.pgd-perfil-page .pgd-tag,
.pgd-perfil-page .pgd-badge{
    max-width: 100%;
}

.pgd-perfil-page .pgd-tag{
    white-space: normal;
    overflow-wrap: anywhere;
}

.pgd-profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.pgd-profile-block {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.pgd-profile-block-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.pgd-profile-block-head .dashicons {
    color: #2c3e50;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.pgd-profile-block-title {
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.pgd-profile-block-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.pgd-profile-kv {
    display: grid;
    gap: 12px;
}

.pgd-profile-k {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    margin-bottom: 6px;
}

.pgd-profile-v {
    font-size: 14px;
    color: #2c3e50;
}

.pgd-tags-container.pgd-tags-readonly {
    background: #f8fafc;
    border-style: solid;
}

.pgd-perfil-field-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;
    align-items: center;
}

.pgd-perfil-field-label {
    margin: 0;
    font-weight: 600;
    color: #34495e;
}

.pgd-perfil-field-control {
    min-width: 0;
}

.pgd-perfil-field-help {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

.pgd-perfil-security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

/* --- PERFIL (FOTO/AVATAR: progresso AJAX) --- */
.pgd-avatar-progress .pgd-progress{
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.pgd-avatar-progress .pgd-progress-bar{
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    transition: width 0.25s ease;
}

@media (max-width: 520px) {
    .pgd-perfil-page.pgd-card{
        padding: 16px;
    }

    .pgd-perfil-actions{
        flex-direction: column;
        align-items: stretch;
    }

    .pgd-perfil-actions .pgd-btn-primary,
    .pgd-perfil-actions .pgd-btn-text{
        width: 100%;
    }

    .pgd-perfil-avatar-form{
        flex-direction: column;
        align-items: stretch;
    }

    .pgd-perfil-avatar-form input[type="file"]{
        width: 100%;
        max-width: 100%;
    }

    .pgd-perfil-avatar-form .pgd-btn-primary{
        width: 100%;
    }

    .pgd-profile-summary-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .pgd-profile-summary-note {
        width: 100%;
        border-radius: 10px;
    }

    .pgd-profile-summary-grid {
        grid-template-columns: 1fr;
    }

    .pgd-perfil-dados-grid{
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .pgd-perfil-field-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .pgd-perfil-security-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
 * TOAST NOTIFICATIONS - Sistema de notificações temporárias
 * ================================================================ */
.pgd-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.pgd-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 300px;
    max-width: 400px;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.pgd-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.pgd-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.pgd-toast-icon svg {
    width: 100%;
    height: 100%;
}

.pgd-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    word-wrap: break-word;
}

.pgd-toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.pgd-toast-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Tipos de toast */
.pgd-toast-success {
    border-left: 4px solid #10b981;
}

.pgd-toast-success .pgd-toast-icon {
    color: #10b981;
}

.pgd-toast-error {
    border-left: 4px solid #ef4444;
}

.pgd-toast-error .pgd-toast-icon {
    color: #ef4444;
}

.pgd-toast-warning {
    border-left: 4px solid #f59e0b;
}

.pgd-toast-warning .pgd-toast-icon {
    color: #f59e0b;
}

.pgd-toast-info {
    border-left: 4px solid #3b82f6;
}

.pgd-toast-info .pgd-toast-icon {
    color: #3b82f6;
}

/* ================================================================
 * SPINNER E LOADING STATES - Feedback de carregamento
 * ================================================================ */

/* Spinner inline para botões */
.pgd-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pgd-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes pgd-spin {
    to { transform: rotate(360deg); }
}

/* Estado de loading em botões */
.pgd-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.pgd-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pgd-spin 0.6s linear infinite;
}

/* Skeleton screens para listagens */
.pgd-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pgd-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes pgd-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pgd-skeleton-line {
    height: 16px;
    margin-bottom: 8px;
}

.pgd-skeleton-line:last-child {
    margin-bottom: 0;
    width: 60%;
}

.pgd-skeleton-card {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Loading overlay para áreas específicas */
.pgd-loading-overlay {
    position: relative;
    pointer-events: none;
}

.pgd-loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.pgd-loading-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: pgd-spin 0.8s linear infinite;
    z-index: 11;
}

/* Mobile responsivo para toasts */
@media (max-width: 768px) {
    .pgd-toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .pgd-toast {
        min-width: auto;
        max-width: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .pgd-layout-wrapper {
        grid-template-columns: 1fr; /* Coluna única */
    }
    /* Drawer do menu no mobile: mantém o mesmo menu lateral, mas off-canvas */
    .pgd-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 290px;
        max-width: 86vw;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 10001;
        box-shadow: 12px 0 30px rgba(0,0,0,0.22);
    }

    .pgd-sidebar-header {
        justify-content: space-between;
        padding: 0 12px;
    }

    .pgd-sidebar-logo {
        max-height: 34px;
    }

    .pgd-mobile-menu-btn { display: inline-flex; }
    .pgd-sidebar-close { display: inline-flex; }

    /* Estética mobile: força visual (evita CSS do tema/plugin causando borda/vermelho) */
    #pgd-mobile-menu-btn,
    #pgd-mobile-menu-close,
    .pgd-topbar .pgd-mobile-menu-btn,
    .pgd-sidebar .pgd-sidebar-close {
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
        box-shadow: none !important;
        background: rgba(255,255,255,0.10) !important;
        border: 1px solid rgba(255,255,255,0.22) !important;
        color: #ffffff !important;
    }

    #pgd-mobile-menu-btn:hover,
    #pgd-mobile-menu-close:hover,
    .pgd-topbar .pgd-mobile-menu-btn:hover,
    .pgd-sidebar .pgd-sidebar-close:hover {
        background: rgba(255,255,255,0.16) !important;
        border-color: rgba(255,255,255,0.26) !important;
    }

    #pgd-mobile-menu-btn:active,
    #pgd-mobile-menu-close:active,
    .pgd-topbar .pgd-mobile-menu-btn:active,
    .pgd-sidebar .pgd-sidebar-close:active {
        transform: scale(0.98);
    }

    #pgd-mobile-menu-btn:focus,
    #pgd-mobile-menu-close:focus,
    .pgd-topbar .pgd-mobile-menu-btn:focus,
    .pgd-sidebar .pgd-sidebar-close:focus {
        outline: none !important;
        box-shadow: none !important;
    }

    #pgd-mobile-menu-btn:focus-visible,
    #pgd-mobile-menu-close:focus-visible,
    .pgd-topbar .pgd-mobile-menu-btn:focus-visible,
    .pgd-sidebar .pgd-sidebar-close:focus-visible {
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.24) !important;
    }

    html.pgd-mobile-menu-open .pgd-sidebar,
    body.pgd-mobile-menu-open .pgd-sidebar {
        transform: translateX(0);
    }

    html.pgd-mobile-menu-open .pgd-mobile-overlay,
    body.pgd-mobile-menu-open .pgd-mobile-overlay {
        opacity: 1;
        visibility: visible;
    }

    html.pgd-mobile-menu-open,
    body.pgd-mobile-menu-open {
        overflow: hidden;
    }

    .pgd-topbar {
        padding: 0 15px;
        background: #243342;
        border-bottom-color: rgba(255,255,255,0.12);
        gap: 12px;
    }

    .pgd-topbar-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .pgd-topbar-right {
        flex: 0 0 auto;
    }

    /* Cabeçalho mobile limpo: sem breadcrumbs e sem saudação */
    .pgd-breadcrumbs { display: none; }
    .pgd-user-name { display: none; }

    .pgd-topbar-logo { display: block; }

    /* Logo menor no mobile */
    .pgd-topbar-logo {
        height: 25px !important;
        max-width: 138px !important;
        object-fit: contain;
    }

    .pgd-user-info { gap: 0; }
    .pgd-avatar img { border-color: rgba(255,255,255,0.25); }

    /* Garante que o avatar apareça no topo (apenas esconde o texto do nome) */
    .pgd-user-info { display: flex; align-items: center; }
    .pgd-avatar { display: flex; align-items: center; justify-content: center; }
    .pgd-topbar .pgd-avatar img { width: 34px; height: 34px; }

    /* Avatar no topo: borda mais suave e elegante */
    .pgd-topbar .pgd-avatar img {
        border-radius: 999px;
        border: 2px solid rgba(255,255,255,0.14) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25);
        background: rgba(255,255,255,0.06);
    }
    .pgd-content-wrapper {
        padding: 15px;
    }
}

/* --- MODULO DE REGIÕES (CARDS) --- */
.pgd-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* --- ATUALIZAÇÃO DO GRID DE CARDS --- */
.pgd-cards-grid {
    display: grid;
    /* MUDANÇA 1: De 'auto-fill' para 'auto-fit' (Isso força os cards a ocuparem o espaço vazio) */
    /* MUDANÇA 2: Aumentei de 300px para 350px (Cards mais largos e robustos em telas grandes) */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    
    /* Espaçamento um pouco maior para ficar elegante */
    gap: 24px; 
    margin-bottom: 30px;
}

/* Opcional: Se a tela for GIGANTE (Ultra-wide), impede que os cards fiquem esticados demais */
@media (min-width: 2000px) {
    .pgd-cards-grid {
        grid-template-columns: repeat(4, 1fr); /* Trava em 4 colunas máximas */
    }
}

/* Design do Card */
.pgd-region-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.pgd-region-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.pgd-rc-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
    border-radius: 8px 8px 0 0;
}
.pgd-rc-header h3 { margin: 0; font-size: 16px; color: #2c3e50; font-weight: 600; }

.pgd-rc-body {
    padding: 20px;
    display: flex;
    justify-content: space-around;
}

.pgd-stat-box { text-align: center; }
.pgd-stat-value { font-size: 24px; font-weight: bold; color: #34495e; display: block; }
.pgd-stat-label { font-size: 11px; color: #95a5a6; text-transform: uppercase; letter-spacing: 0.5px; }

.pgd-rc-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 8px 8px;
    flex-grow: 1;
}
.pgd-rc-districts-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #7f8c8d;

    /* Mostra todos com rolagem quando necessário */
    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;
}
.pgd-rc-districts-list li { margin-bottom: 4px; display: flex; align-items: center; }
.pgd-rc-districts-list li:before { content: "•"; color: #bdc3c7; margin-right: 6px; }

/* Status Badges */
.badge-active { background: #e8f5e9; color: #27ae60; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; }
.badge-inactive { background: #ffebee; color: #c0392b; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; }

/* MODAL (FORMULÁRIO) */
.pgd-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s;
}
.pgd-modal-overlay.open { opacity: 1; visibility: visible; }


.pgd-modal-content {
    background: #fff; width: 90%; max-width: 600px;
    border-radius: 8px; box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transform: translateY(-20px); transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}
.pgd-modal-content.pgd-modal-lg {
    max-width: 820px;
}
.pgd-modal-overlay.open .pgd-modal-content { transform: translateY(0); }

.pgd-modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.pgd-modal-body { padding: 20px; overflow-y: auto; }
.pgd-modal-header .pgd-modal-close {
    cursor: pointer;
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;

    appearance: none !important;
    -webkit-appearance: none !important;

    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    color: #64748b !important;

    box-shadow: none !important;
    outline: none !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pgd-modal-header .pgd-modal-close:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

.pgd-modal-header .pgd-modal-close:focus,
.pgd-modal-header .pgd-modal-close:focus-visible,
.pgd-modal-header .pgd-modal-close:active {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Agenda: modal do Calendário Eclesiástico (mais “Google-like”) */
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-modal-content{
    border-radius: 14px;
    border-top: 0;
    border-left: 8px solid #2c3e50;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-modal-header{
    display: flex;
    align-items: center;
    padding: 16px 18px;
    gap: 14px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-modal-header-actions{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-header-action{
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-header-action:hover{
    background: #ffffff;
    border-color: #cbd5e1;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-header-action.is-active{
    background: #2c3e50;
    border-color: #2c3e50;
    color: #ffffff;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-modal-title-wrap{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] [data-pgd-agenda-modal-title]{
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-modal-subtitle{
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-modal--new .pgd-modal-content,
.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-modal--edit .pgd-modal-content{
    border-top: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-modal-body{
    padding: 16px 18px;
}

/* Espaçamento melhorado no formulário */
.pgd-layout-wrapper [data-pgd-agenda-modal] form[data-pgd-agenda-form]{
    padding: 4px 0;
}

/* Agenda: quando está no painel Detalhes (sem títulos superiores) */
.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-panel--details .pgd-modal-header{
    display: none;
}

.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-panel--details .pgd-modal-body{
    padding: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row{
    display: grid !important;
    gap: 12px;
    align-items: start;
    margin-top: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--full{
    grid-template-columns: 1fr;
    margin-top: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--classification{
    grid-template-columns: 1.4fr 1fr;
    margin-top: 16px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--top{
    grid-template-columns: 2fr 1fr;
    margin-top: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--dates{
    grid-template-columns: 1fr 1fr 1.2fr;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-adv-toggles{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-adv-toggle{
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    border: 1px solid #e5e7eb;
    color: #111827;
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-adv-toggle:hover{
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-adv-toggle.is-active{
    background: #2c3e50;
    border-color: #2c3e50;
    color: #ffffff;
}

/* Agenda modal: fallback sem `.pgd-layout-wrapper` (algumas telas renderizam o calendário direto) */
[data-pgd-agenda-modal] .pgd-agenda-adv-toggles{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-adv-toggle{
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #111827;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-adv-toggle:hover{
    border-color: #cbd5e1;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-adv-toggle.is-active{
    background: #2c3e50 !important;
    border-color: #2c3e50 !important;
    color: #ffffff !important;
}

[data-pgd-agenda-modal] .pgd-agenda-adv-section{
    margin-top: 10px;
}

[data-pgd-agenda-modal] .pgd-agenda-modal-header-actions{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Agenda List: destaque para linhas de sábado */
.pgd-agenda-row-saturday {

    background: #e5f3ff !important;
    font-weight: 500;
}

.pgd-agenda-row-saturday:hover {
    background: #c9dfff !important;
}

.pgd-agenda-row-saturday-alt {

    background: #f0f7ff !important;
    font-weight: 500;
}

.pgd-agenda-row-saturday-alt:hover {
    background: #b3d9ff !important;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-header-action{
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #111827;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-header-action:hover{
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-pgd-agenda-modal] button.pgd-btn.pgd-agenda-header-action.is-active{
    background: #2c3e50 !important;
    border-color: #2c3e50 !important;
    color: #ffffff !important;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-adv-section{
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    animation: fadeInUp 0.25s ease-out;
}

/* Agenda: modo Detalhes (visual) */
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details{
    display: grid;
    gap: 14px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover{
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    position: relative;
    min-height: 160px;
}

/* Capa “na borda” do modal (edge-to-edge) */
.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-panel--details .pgd-agenda-details{
    gap: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-panel--details .pgd-agenda-details-cover{
    border-radius: 14px 14px 0 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal].pgd-agenda-panel--details .pgd-agenda-details-body{
    padding: 16px 18px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-close{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.55);
    background: rgba(255,255,255,0.92);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
    transition: transform 0.12s, background 0.12s, border-color 0.12s;
    z-index: 2;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-close:hover{
    transform: translateY(-1px);
    background: rgba(255,255,255,0.98);
    border-color: rgba(148,163,184,0.85);
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-close:active{
    transform: translateY(0);
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-close .dashicons{
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover-img{
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: 50% 50%;
    display: block;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover-fallback{
    min-height: 260px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0b1220 100%);
    display: flex;
    align-items: flex-end;
    padding: 18px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover-title{
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 18px rgba(0,0,0,0.45);
    line-height: 1.05;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-body{
    display: grid;
    gap: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-title-inline{
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-row{
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    color: #111827;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-row .dashicons{
    color: #64748b;
    margin-top: 2px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-sep{
    margin: 0 6px;
    color: #cbd5e1;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-desc{
    color: #334155;
    font-size: 13px;
    line-height: 1.35;
    white-space: pre-wrap;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-link{
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
    word-break: break-word;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-link:hover{
    text-decoration: underline;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-actions{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Agenda: imagem (editor) */
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-field{
    display: grid;
    gap: 8px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-preview{
    width: 100%;
    /* Proporção real do cover no modal Detalhes (aprox. 1025×326) */
    aspect-ratio: 1025 / 326;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: grab;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-preview.is-dragging{
    cursor: grabbing;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-preview::after{
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to right, rgba(255,255,255,0.18) 1px, transparent 1px) 0 0 / 33.333% 100%,
        linear-gradient(to bottom, rgba(255,255,255,0.18) 1px, transparent 1px) 0 0 / 100% 33.333%;
    opacity: 0.8;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-hint{
    font-size: 12px;
    color: #64748b;
    line-height: 1.25;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-link-hint{
    font-size: 12px;
    color: #64748b;
    line-height: 1.25;
    margin-top: 6px;
}

@media (max-width: 640px) {
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover-img{
        height: 210px;
    }
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-details-cover-fallback{
        min-height: 210px;
    }
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-image-actions{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row .pgd-field{
    min-width: 0 !important;
}

/* Melhorias estéticas do formulário */
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-field label{
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-input,
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-select{
    transition: border-color 0.15s, box-shadow 0.15s;
    border: 1.5px solid #e2e8f0;
    font-size: 14px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] input[type="datetime-local"].pgd-input{
    padding: 9px 12px;
    color: #1e293b;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-input:hover,
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-select:hover{
    border-color: #cbd5e1;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-input:focus,
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-select:focus{
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-input::placeholder{
    color: #94a3b8;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] textarea.pgd-input{
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] textarea.pgd-input::placeholder{
    color: #94a3b8;
    font-style: italic;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-field small{
    display: block;
    margin-top: 4px;
    line-height: 1.4;
    font-weight: 400;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-color-group{
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-color-picker{
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

/* Ajustes do input[type=color] para ficar consistente */
.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-color-picker::-webkit-color-swatch-wrapper{
    padding: 0;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-color-picker::-webkit-color-swatch{
    border: none;
    border-radius: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-color-picker::-moz-color-swatch{
    border: none;
    border-radius: 10px;
}

@media (max-width: 980px){
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--classification{
        grid-template-columns: 1.2fr 1fr;
    }
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--top{
        grid-template-columns: 1.6fr 1fr;
    }
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--dates{
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px){
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--classification,
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--top,
    .pgd-layout-wrapper [data-pgd-agenda-modal] .pgd-agenda-form-row--dates{
        grid-template-columns: 1fr;
    }
}

/* Em telas com pouca altura (notebooks), permitir rolagem do overlay e evitar modal "cortado" */
@media (max-height: 720px) {
    .pgd-modal-overlay {
        align-items: center;
        overflow-y: auto;
        padding: 20px;
    }
}

/* Modal "Nova Cidade (IBGE)": um pouco mais alto e sempre centralizado */
#modal-cidade.pgd-modal-overlay {
    align-items: center;
    padding: 20px;
}

#modal-cidade .pgd-modal-content {
    min-height: 420px;
    max-height: 85vh;
}

/* Espaço entre campos (UF/Cidade) e botões (Cancelar/Habilitar) */
#modal-cidade #form-cidade-ibge .pgd-ibge-actions {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 62px;
}

/* Estado Vazio */
.pgd-empty-state { text-align: center; padding: 60px; color: #95a5a6; background: #fff; border-radius: 8px; border: 2px dashed #e0e0e0; }
.pgd-empty-state .dashicons { font-size: 40px; width: 40px; height: 40px; margin-bottom: 15px; }

/* --- Botões de ferramentas (Cidades) --- */
.pgd-desktop-only{ display:flex; }
@media (max-width: 980px){
    .pgd-desktop-only{ display:none !important; }
}


/* Mantém <a> e <button> idênticos (tema não pode sobrescrever) */
.pgd-btn-square,
a.pgd-btn-square,
button.pgd-btn-square{
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    border: 1px solid #dbeafe !important;
    background: #fff !important;
    color: #3498db !important; /* identidade azul */
    cursor: pointer;
    padding: 0 !important;
    box-sizing: border-box;
    text-decoration: none !important;
    line-height: 1 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.pgd-btn-square:hover,
a.pgd-btn-square:hover,
button.pgd-btn-square:hover{
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}

.pgd-btn-square:active,
a.pgd-btn-square:active,
button.pgd-btn-square:active{
    transform: scale(0.98);
}

.pgd-btn-square:focus,
.pgd-btn-square:focus-visible,
a.pgd-btn-square:focus,
a.pgd-btn-square:focus-visible,
button.pgd-btn-square:focus,
button.pgd-btn-square:focus-visible{
    outline: none !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.22) !important;
}

.pgd-btn-square .dashicons{
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pgd-btn-square.is-loading{
    opacity: 0.7;
    pointer-events: none;
}

button.pgd-btn-square:disabled{
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.pgd-btn-square.is-loading .dashicons{
    animation: pgdSpin 1s linear infinite;
}

@keyframes pgdSpin{
    from{ transform: rotate(0deg); }
    to{ transform: rotate(360deg); }
}

.pgd-sync-status{
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
    line-height: 1;
}

.pgd-sync-status.is-ok{
    color: #065f46;
    border-color: #a7f3d0;
    background: #d1fae5;
}

.pgd-sync-status.is-warn{
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb;
}

/* --- Detalhes da Cidade: Mapa (Leaflet) --- */
.pgd-city-map{
    height: 520px;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

@media (max-width: 768px){
    .pgd-city-map{height: 360px;}
}

/* --- Detalhes da Cidade: KPIs compactos --- */
.pgd-city-indicators{
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 14px;
    align-items: start;
    margin-top: 12px;
}

.pgd-city-indicators-left{
    min-width: 0;
}

.pgd-city-indicators-right{
    min-width: 0;
    padding-right: 10px;
    box-sizing: border-box;
}

.pgd-compare-sub{
    display:block;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.2;
    margin-top: 2px;
}

.pgd-compare-wrap{
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.pgd-kpi-grid-3{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pgd-kpi-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pgd-kpi{
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 12px;
}

.pgd-kpi .kpi-label{
    font-size: 11px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 6px;
}

.pgd-kpi .kpi-value{
    font-size: 18px;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1.1;
}

.pgd-kpi .kpi-sub{
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
}

.pgd-kpi.pgd-kpi-highlight{
    background: #ecfeff;
    border-color: #a5f3fc;
}

.pgd-kpi.pgd-kpi-highlight .kpi-value{
    color: #155e75;
}

.pgd-compare-table{
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.pgd-compare-table th,
.pgd-compare-table td{
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pgd-compare-table th{
    text-align: left;
    color: #64748b;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pgd-compare-table td strong{
    font-weight: 800;
    color: #2c3e50;
}

@media (max-width: 980px){
    .pgd-kpi-grid{grid-template-columns: repeat(2, minmax(0, 1fr));}
    .pgd-kpi-grid-3{grid-template-columns: repeat(2, minmax(0, 1fr));}
    .pgd-city-indicators{grid-template-columns: 1fr;}
}

/* --- ALERTAS E MENSAGENS (Adicione ao final do arquivo) --- */
.pgd-alert {
    padding: 15px 20px;
    margin-bottom: 30px; /* <--- ISSO RESOLVE O ENCAVALAMENTO */
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pgd-alert.success {
    background-color: #d1fae5; /* Verde Suave */
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pgd-alert.error {
    background-color: #fee2e2; /* Vermelho Suave */
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pgd-alert.warning {
    background-color: #fff7ed; /* Âmbar suave */
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* Ícones automáticos antes da mensagem */
.pgd-alert.success::before {
    content: "\f147"; /* Ícone Check */
    font-family: "dashicons";
    margin-right: 10px;
    font-size: 20px;
}

.pgd-alert.error::before {
    content: "\f158"; /* Ícone X */
    font-family: "dashicons";
    margin-right: 10px;
    font-size: 20px;
}

.pgd-alert.warning::before {
    content: "\f534"; /* Ícone aviso */
    font-family: "dashicons";
    margin-right: 10px;
    font-size: 20px;
}

/* --- UTILITÁRIOS (GRID) --- */
.pgd-grid-2col{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 680px){
    .pgd-grid-2col{grid-template-columns: 1fr;}
}

/* --- CAMPOS (INPUTS / SELECTS) --- */
.pgd-input,
.pgd-select {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #2c3e50 !important;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

/* Select precisa de padding levemente diferente para não "apertar" o texto */
.pgd-select {
    padding: 10px 10px;
}

.pgd-input:focus,
.pgd-select:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15) !important;
}

/* Tabelas (blindagem contra tema/Elementor) */
.pgd-layout-wrapper table.pgd-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.pgd-layout-wrapper .pgd-table thead th {
    background: #ffffff !important;
    color: #7f8c8d !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

.pgd-layout-wrapper .pgd-table tbody td {
    color: #2c3e50 !important;
}

/* --- BOTÕES E ELEMENTOS DE AÇÃO --- */

/* Base de botões do PGD (secundário / padrão)
 * OBS: precisamos vencer Elementor/tema (cores/underline/border-radius).
 */
.pgd-layout-wrapper button.pgd-btn,
.pgd-layout-wrapper a.pgd-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #ffffff !important;
    color: #2c3e50 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    line-height: 1 !important;
    text-shadow: none !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06) !important;
    font-family: inherit !important;
    min-height: 44px !important;
}

.pgd-layout-wrapper button.pgd-btn:hover,
.pgd-layout-wrapper a.pgd-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px);
    color: #2c3e50 !important;
}

.pgd-layout-wrapper button.pgd-btn:active,
.pgd-layout-wrapper a.pgd-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05) !important;
}

.pgd-layout-wrapper button.pgd-btn:focus,
.pgd-layout-wrapper button.pgd-btn:focus-visible,
.pgd-layout-wrapper a.pgd-btn:focus,
.pgd-layout-wrapper a.pgd-btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.22) !important;
}

.pgd-layout-wrapper a.pgd-btn:visited {
    color: #2c3e50 !important;
}

.pgd-layout-wrapper .pgd-btn-small {
    padding: 8px 14px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    min-height: 38px !important;
}

.pgd-layout-wrapper button.pgd-btn-danger,
.pgd-layout-wrapper a.pgd-btn-danger {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.18) !important;
}

.pgd-layout-wrapper button.pgd-btn-danger:hover,
.pgd-layout-wrapper a.pgd-btn-danger:hover {
    background: #991b1b !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
}

.pgd-layout-wrapper a.pgd-btn-danger:visited {
    color: #ffffff !important;
}

/* 1. Botão Primário (Salvar / Criar)
 * OBS: precisa valer também para <a> (Elementor costuma sobrescrever links)
 */
.pgd-layout-wrapper button.pgd-btn-primary,
.pgd-layout-wrapper a.pgd-btn-primary {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #2c3e50 !important; /* Azul Vibrante (Google/Facebook style) */
    color: #ffffff !important;
    border: none !important;
    padding: 10px 24px !important; /* Um pouco mais largo */
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2) !important;
    text-decoration: none !important;
    line-height: 1 !important;
    text-shadow: none !important; /* Remove sombra de texto do tema */
    font-family: inherit !important;
}

/* Hover do Primário */
.pgd-layout-wrapper button.pgd-btn-primary:hover,
.pgd-layout-wrapper a.pgd-btn-primary:hover {
    background-color: #435a71 !important; /* Azul mais escuro */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3) !important;
    color: #ffffff !important;
}

/* Active do Primário */
.pgd-layout-wrapper button.pgd-btn-primary:active,
.pgd-layout-wrapper a.pgd-btn-primary:active {
    transform: translateY(0);
    box-shadow: none !important;
}

/* Focus do Primário (acessibilidade + Elementor) */
.pgd-layout-wrapper button.pgd-btn-primary:focus,
.pgd-layout-wrapper button.pgd-btn-primary:focus-visible,
.pgd-layout-wrapper a.pgd-btn-primary:focus,
.pgd-layout-wrapper a.pgd-btn-primary:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.22) !important;
}

/* Visited do Primário (Elementor costuma alterar cor de link visitado) */
.pgd-layout-wrapper a.pgd-btn-primary:visited {
    color: #ffffff !important;
}

/* Ícone dentro do botão */
.pgd-layout-wrapper button.pgd-btn-primary .dashicons,
.pgd-layout-wrapper a.pgd-btn-primary .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: -2px; /* Ajuste fino de alinhamento */
}

/* 2. Botão Secundário (para ações menos importantes, como links externos)
 * OBS: tom mais discreto que o primário, mas ainda destacado
 */
.pgd-layout-wrapper button.pgd-btn-secondary,
.pgd-layout-wrapper a.pgd-btn-secondary {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #6366f1 !important; /* Indigo moderno */
    color: #ffffff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2) !important;
    text-decoration: none !important;
    line-height: 1 !important;
    text-shadow: none !important;
    font-family: inherit !important;
}

/* Hover do Secundário */
.pgd-layout-wrapper button.pgd-btn-secondary:hover,
.pgd-layout-wrapper a.pgd-btn-secondary:hover {
    background-color: #4f46e5 !important; /* Indigo mais escuro */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
}

/* Active do Secundário */
.pgd-layout-wrapper button.pgd-btn-secondary:active,
.pgd-layout-wrapper a.pgd-btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2) !important;
}

/* Focus do Secundário */
.pgd-layout-wrapper button.pgd-btn-secondary:focus,
.pgd-layout-wrapper button.pgd-btn-secondary:focus-visible,
.pgd-layout-wrapper a.pgd-btn-secondary:focus,
.pgd-layout-wrapper a.pgd-btn-secondary:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
}

/* Visited do Secundário */
.pgd-layout-wrapper a.pgd-btn-secondary:visited {
    color: #ffffff !important;
}

/* Ícone dentro do botão secundário */
.pgd-layout-wrapper button.pgd-btn-secondary .dashicons,
.pgd-layout-wrapper a.pgd-btn-secondary .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: -2px;
}

/* Botão Accent (Verde/Teal para funcionalidades especiais) */
.pgd-layout-wrapper button.pgd-btn-accent,
.pgd-layout-wrapper a.pgd-btn-accent {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #10b981 !important; /* Verde moderno (Tailwind green-500) */
    border: none !important;
    color: #ffffff !important;
    padding: 8px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15) !important;
    text-shadow: none !important;
    text-decoration: none !important;
    line-height: 1 !important;
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-right: 0 !important;
}

.pgd-layout-wrapper button.pgd-btn-accent:hover,
.pgd-layout-wrapper a.pgd-btn-accent:hover {
    background-color: #059669 !important; /* Verde mais escuro (Tailwind green-600) */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25) !important;
}

.pgd-layout-wrapper button.pgd-btn-accent:active,
.pgd-layout-wrapper a.pgd-btn-accent:active {
    transform: translateY(0px);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15) !important;
}

.pgd-layout-wrapper button.pgd-btn-accent:focus,
.pgd-layout-wrapper button.pgd-btn-accent:focus-visible,
.pgd-layout-wrapper a.pgd-btn-accent:focus,
.pgd-layout-wrapper a.pgd-btn-accent:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}

.pgd-layout-wrapper a.pgd-btn-accent:visited {
    color: #ffffff !important;
}

.pgd-layout-wrapper button.pgd-btn-accent .dashicons,
.pgd-layout-wrapper a.pgd-btn-accent .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: -2px;
}



/* 2. Botão de Texto (Cancelar / Voltar)
 * OBS: precisa valer também para <a> (atalhos e links do Dashboard)
 */
.pgd-layout-wrapper button.pgd-btn-text,
.pgd-layout-wrapper a.pgd-btn-text {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: transparent !important;
    border: 1px solid transparent !important; /* Mantém o tamanho alinhado */
    color: #636e72 !important; /* Cinza Escuro bem visível */
    padding: 5px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px !important;
    box-shadow: none !important;
    text-shadow: none !important; /* Importante: remove sombra branca que esconde o texto */
    text-decoration: none !important;
    line-height: 1 !important;
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-right: 0 !important;
}

/* Hover do Botão de Texto */
.pgd-layout-wrapper button.pgd-btn-text:hover,
.pgd-layout-wrapper a.pgd-btn-text:hover {
    color: #2d3436 !important; /* Quase preto */
    transform: translateY(-2px);
    background-color: #dfe6e9 !important; /* Cinza bem clarinho no fundo */
}

/* Focus do Botão de Texto */
.pgd-layout-wrapper button.pgd-btn-text:focus,
.pgd-layout-wrapper button.pgd-btn-text:focus-visible,
.pgd-layout-wrapper a.pgd-btn-text:focus,
.pgd-layout-wrapper a.pgd-btn-text:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.22) !important;
}

/* Visited do Botão de Texto */
.pgd-layout-wrapper a.pgd-btn-text:visited {
    color: #636e72 !important;
}


/* 3. Botões de Ícone (Editar/Excluir nos Cards) */
.pgd-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none !important;
    padding: 0 !important;
    min-width: 32px;
    box-sizing: border-box;
    outline: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.pgd-icon-btn:focus,
.pgd-icon-btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.22);
}

.pgd-icon-btn.delete:focus,
.pgd-icon-btn.delete:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.22);
}

/* Botão Editar (Azul Suave -> Azul Forte) */
.pgd-icon-btn {
    background-color: #e3f2fd; /* Fundo azul bem claro */
    color: #1976d2; /* Ícone azul */
}
.pgd-icon-btn:hover {
    background-color: #1976d2; /* Fundo azul forte */
    color: #ffffff; /* Ícone branco */
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(25, 118, 210, 0.2);
}

/* Botão Excluir (Vermelho Suave -> Vermelho Forte) */
.pgd-icon-btn.delete {
    background-color: #ffebee; /* Fundo vermelho claro */
    color: #d32f2f; /* Ícone vermelho */
}
.pgd-icon-btn.delete:hover {
    background-color: #d32f2f;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(211, 47, 47, 0.2);
}

/* Botão Salvar (Verde Suave -> Verde Forte) */
.pgd-icon-btn.save {
    background-color: #ecfdf5; /* Fundo verde claro */
    color: #059669; /* Ícone verde */
}
.pgd-icon-btn.save:hover {
    background-color: #059669;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}
.pgd-icon-btn.save:focus,
.pgd-icon-btn.save:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22);
}

/* Botão "Adicionar Igrejas" (Azul identidade visual) */
.pgd-icon-btn.pgd-icon-btn--add-igrejas {
    background-color: #e3f2fd;
    color: #1976d2;
}
.pgd-icon-btn.pgd-icon-btn--add-igrejas:hover {
    background-color: #1976d2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(25, 118, 210, 0.2);
}
.pgd-icon-btn.pgd-icon-btn--add-igrejas .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border: 0 !important;
    outline: 0 !important;
}

.pgd-icon-btn-sm.pgd-icon-btn--add-igrejas {
    background: #e3f2fd;
    color: #1976d2;
}
.pgd-icon-btn-sm.pgd-icon-btn--add-igrejas .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border: 0 !important;
    outline: 0 !important;
}

/* Telefone + WhatsApp (Pastores) */
.pgd-phone-green {
    color: #16a34a;
    font-weight: 600;
}

.pgd-wa-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    background-color: #dcfce7;
    color: #16a34a;
    text-decoration: none !important;
    flex: 0 0 auto;
}

.pgd-wa-btn:hover {
    background-color: #16a34a;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.2);
}

.pgd-wa-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --- AJUSTES DE TEXTO DO RODAPÉ DO CARD --- */

/* 1. Lista de Distritos (Ex: Jerusalém) */
ul.pgd-rc-districts-list li {
    font-size: 15px !important; /* Aumentei para 15px (padrão era 13px) */
    line-height: 1.6 !important; /* Mais espaçamento entre as linhas */
    color: #2c3e50 !important;   /* Cor mais escura para facilitar leitura */
    font-weight: 500 !important;
}

/* 2. Texto "Nenhum distrito vinculado" */
.pgd-rc-footer small {
    font-size: 14px !important; /* Aumentei para 14px */
    color: #95a5a6 !important;   /* Cinza médio elegante */
    font-style: italic;
    display: block;              /* Garante alinhamento */
    padding-top: 5px;
}

/* --- TABELAS MINIMALISTAS --- */
.pgd-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 8px; overflow: hidden;
}
.pgd-table thead th {
    background: #fff; color: #7f8c8d; font-weight: 600; font-size: 13px;
    text-transform: uppercase; padding: 15px 20px; border-bottom: 2px solid #f0f0f0; text-align: left;
}
.pgd-table tbody tr { transition: background 0.1s; }
.pgd-table tbody tr:nth-child(even) { background-color: #fbfbfb; }
.pgd-table tbody td { padding: 14px 20px; border-bottom: 1px solid #f5f5f5; color: #2c3e50; font-size: 14px; vertical-align: middle; }
.pgd-table tbody tr:hover { background-color: #f0f8ff; }

/* --- TOOLTIP --- */
.pgd-city-group { display: flex; align-items: center; gap: 8px; }
.pgd-more-badge {
    background: #e2e8f0; color: #475569; font-size: 11px; font-weight: bold;
    padding: 2px 6px; border-radius: 10px; cursor: help; position: relative;
}
.pgd-more-badge:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: #2c3e50; color: #fff; padding: 5px 10px; border-radius: 4px; font-size: 12px;
    white-space: pre-wrap; min-width: 150px; text-align: center; z-index: 10; margin-bottom: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- RESPONSIVIDADE AVANÇADA (DISTRITOS) --- */

/* Padrão: Mostra Desktop, Esconde Mobile */
.pgd-desktop-view { display: block; }
.pgd-mobile-view { display: none; }

/* TABLET E CELULAR (Abaixo de 768px) */
@media (max-width: 768px) {
    .pgd-desktop-view { display: none; } /* Esconde Tabela */
    .pgd-mobile-view { 
        display: grid; 
        grid-template-columns: 1fr; 
        gap: 15px; 
    } /* Mostra Cards */
}

/* --- ESTILO DOS CARDS MOBILE (Inspirado no Print) --- */
.pgd-mobile-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    overflow: hidden;
}

.pgd-mc-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #fafafa;
}

.pgd-mc-title h4 { margin: 0 0 3px 0; font-size: 16px; color: #2c3e50; }
.pgd-mc-title small { color: #7f8c8d; font-size: 12px; text-transform: uppercase; }

.pgd-mc-actions { display: flex; gap: 8px; }

/* Botões Pequenos do Mobile */
.pgd-icon-btn-sm {
    width: 30px; height: 30px; border-radius: 50%; border: none !important;
    padding: 0 !important;
    min-width: 30px;
    box-sizing: border-box;
    outline: none !important;
    display: flex; align-items: center; justify-content: center;
    background: #2c3e50; color: #fff; cursor: pointer;
}
.pgd-icon-btn-sm.delete { background: #e74c3c; }

.pgd-icon-btn-sm:focus,
.pgd-icon-btn-sm:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.22);
}

.pgd-icon-btn-sm.delete:focus,
.pgd-icon-btn-sm.delete:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.22);
}

/* Grid de Mini-Stats */
.pgd-mc-stats-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas */
    gap: 10px;
}

.pgd-mini-stat {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pgd-mini-stat.full-width {
    grid-column: span 2; /* Ocupa a linha toda */
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
}

.stat-label { font-size: 11px; color: #95a5a6; margin-bottom: 5px; text-transform: uppercase; }
.pgd-mini-stat.full-width .stat-label { margin-bottom: 0; }

.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

/* Cores das Badges (Iguais ao print) */
.badge-grey { background-color: #636e72; }
.badge-blue { background-color: #3498db; }
.badge-green { background-color: #27ae60; }
.badge-red { background-color: #e74c3c; }
.badge-yellow { background-color: #f1c40f; color: #2c3e50; }

.stat-text-list { font-size: 13px; color: #2c3e50; }


/* --- ORDENAÇÃO --- */
.pgd-sort-link {
    color: #7f8c8d;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.pgd-sort-link:hover { color: #3498db; }

/* --- LISTAS EXPANSÍVEIS (IGREJAS/CIDADES) --- */
.pgd-expandable-container {
    font-size: 13px;
}

.pgd-expand-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pgd-count-badge {
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
}

.pgd-btn-toggle {
    background: none;
    border: none;
    color: #3498db;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.pgd-btn-toggle:hover { color: #2980b9; }
.pgd-btn-toggle.active { color: #e74c3c; text-decoration: none; }

.pgd-hidden-list {
    display: none; /* Oculto por padrão */
    margin: 8px 0 0 0;
    padding: 0 0 0 15px; /* Recuo */
    list-style: disc;
    color: #636e72;
    border-left: 2px solid #eee;
    font-size: 12px;
}

.pgd-hidden-list li {
    margin-bottom: 2px;
}

/* --- BOTÃO DE TOGGLE NO HEADER --- */
.pgd-header-toggle {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 10px;
    font-size: 10px;
    cursor: pointer;
    color: #475569;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s;
}
.pgd-header-toggle:hover {
    background: #cbd5e1;
}
.pgd-header-toggle.active {
    background: #3498db;
    color: #fff;
}

/* Override forte (Elementor/tema costuma sobrescrever estilos de <button>) */
.pgd-table thead .pgd-header-toggle,
.pgd-table thead .pgd-header-toggle:visited {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 3px 10px !important;
    margin-left: 10px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    outline: none !important;
}

.pgd-table thead .pgd-header-toggle:hover {
    background: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

.pgd-table thead .pgd-header-toggle.active {
    background: #3498db !important;
    border-color: #3498db !important;
    color: #ffffff !important;
}

.pgd-table thead .pgd-header-toggle:focus,
.pgd-table thead .pgd-header-toggle:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.22) !important;
}

/* --- LOGICA DE EXIBIÇÃO (PADRÃO: MOSTRA COUNT, ESCONDE LISTA) --- */
.col-igrejas .view-count,
.col-cidades .view-count,
.col-distritos .view-count { display: block; }

.col-igrejas .view-list,
.col-cidades .view-list,
.col-distritos .view-list { display: none; }

/* --- QUANDO A CLASSE 'show-list-igrejas' ESTÁ ATIVA NA TABELA --- */
.show-list-igrejas .col-igrejas .view-count { display: none; }
.show-list-igrejas .col-igrejas .view-list { display: block; }

/* --- QUANDO A CLASSE 'show-list-cidades' ESTÁ ATIVA NA TABELA --- */
.show-list-cidades .col-cidades .view-count { display: none; }
.show-list-cidades .col-cidades .view-list { display: block; }

/* --- QUANDO A CLASSE 'show-list-distritos' ESTÁ ATIVA NA TABELA --- */
.show-list-distritos .col-distritos .view-count { display: none; }
.show-list-distritos .col-distritos .view-list { display: block; }

/* --- ESTILO DA LISTA LIMPA --- */
.view-list {
    font-size: 13px;
    color: #34495e;
    line-height: 1.4;
}
.view-list .list-item {
    padding: 2px 0;
    border-bottom: 1px dashed #eee;
}
.view-list .list-item:last-child { border-bottom: none; }

/* --- BOTÕES DE AÇÃO (ESTILO NOVO) --- */
.pgd-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

/* Botão Editar (Azul Suave -> Azul Forte) */
.pgd-icon-btn {
    background-color: #e3f2fd; /* Fundo azul bem claro */
    color: #1976d2; /* Ícone azul */
}
.pgd-icon-btn:hover {
    background-color: #1976d2; /* Fundo azul forte */
    color: #ffffff; /* Ícone branco */
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(25, 118, 210, 0.2);
}

/* Botão Excluir (Vermelho Suave -> Vermelho Forte) */
.pgd-icon-btn.delete {
    background-color: #ffebee; /* Fundo vermelho claro */
    color: #d32f2f; /* Ícone vermelho */
}
.pgd-icon-btn.delete:hover {
    background-color: #d32f2f;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(211, 47, 47, 0.2);
}

/* --- BADGES CLICÁVEIS (IGREJAS/CIDADES) --- */
.pgd-badge{
    display: inline-block;
    padding: 5px 10px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    border: 1px solid rgba(0,0,0,0.06);
}

.pgd-expand-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    user-select: none;
}
.pgd-expand-trigger:hover .pgd-badge-count {
    background-color: #cbd5e1; /* Escurece levemente ao passar o mouse */
    transform: scale(1.05);
}
.pgd-expand-trigger:active .pgd-badge-count {
    transform: scale(0.95);
}

/* Badge de Contagem Grande */
.pgd-badge-count {
    background: #f1f2f6;
    color: #2c3e50;
    font-weight: 800;
    font-size: 15px;
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

/* --- LISTAS EXPANSÍVEIS --- */
.pgd-hidden-list {
    display: none;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 10;
    position: relative;
    text-align: left;
}
.pgd-hidden-list li {
    list-style: none;
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
    font-size: 12px;
    color: #555;
}
.pgd-hidden-list li:last-child { border-bottom: none; }


/* --- COMPONENTES DE BUSCA E TAGS (CIDADE) --- */

/* Wrapper relativo para posicionar o dropdown */
.pgd-search-wrapper {
    position: relative;
    width: 100%;
}

/* O Dropdown de resultados flutuante */
.pgd-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    display: none; /* Oculto por padrão */
}

/* Item da lista de resultados */
.pgd-search-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #2c3e50;
    transition: background 0.1s;
}
.pgd-search-item:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}
.pgd-search-item strong {
    color: #3498db;
}

/* Container onde ficam as cidades selecionadas (Tags) */
.pgd-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 5px;
    border: 1px dashed #e2e8f0;
    border-radius: 6px;
    min-height: 40px;
    background: #f9f9f9;
}

/* A Etiqueta (Tag) da cidade */
.pgd-tag {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Botão X para remover */
.pgd-tag-remove {
    cursor: pointer;
    color: #e74c3c;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}
.pgd-tag-remove:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* --- CORREÇÃO DE ESPAÇAMENTO (LABEL) --- */
.pgd-form-group label {
    margin-bottom: 12px !important; /* Mais respiro */
    margin-top: 12px !important;
    display: block;
    font-weight: 600;
    color: #34495e;
}

/* --- VALIDAÇÃO CLIENT-SIDE --- */
.pgd-field-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.pgd-field-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

input.pgd-field-invalid:focus,
textarea.pgd-field-invalid:focus,
select.pgd-field-invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Feedback positivo (opcional - para campos válidos) */
.pgd-field-valid {
    border-color: #10b981 !important;
}

input.pgd-field-valid:focus,
textarea.pgd-field-valid:focus,
select.pgd-field-valid:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* --- GRUPO DE BUSCA COM BOTÃO (COMBOBOX) --- */
.pgd-search-group {
    display: flex;
    position: relative;
    width: 100%;
    align-items: stretch;
}

/* --- FILTROS (CIDADES): melhor disposição no desktop --- */
.pgd-filters-form {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
}

/* Busca de cidade: não ocupar largura total no desktop */
.pgd-filters-form .pgd-filter-city {
    flex: 1 1 520px;
    min-width: 260px;
}

/* Busca de distrito: largura mais compacta */
.pgd-filters-form .pgd-filter-distrito {
    flex: 0 0 320px;
    min-width: 220px;
}

.pgd-filters-form .pgd-filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 0 0 auto;
}

.pgd-filters-form .pgd-btn-primary {
    height: 44px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
}

@media (min-width: 1024px) {
    .pgd-filters-form {
        flex-wrap: nowrap;
    }

    /* No desktop, deixa o campo de cidade ocupar o espaço livre */
    .pgd-filters-form .pgd-filter-city {
        flex: 1 1 auto;
        min-width: 360px;
    }
}

/* O Input ocupa todo o espaço, mas sem borda direita */
.pgd-search-group input,
.pgd-search-group .pgd-input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
    z-index: 2; /* Fica acima se precisar */
}

/* O Botão da Setinha */
.pgd-search-group .pgd-search-toggle-btn {
    width: 44px;
    height: 44px;
    background: #f8f9fa !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 1px solid #cbd5e1 !important;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d !important;
    outline: none !important;
    box-shadow: none !important;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.pgd-search-group .pgd-search-toggle-btn:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #2c3e50 !important;
}

/* Neutraliza estilos do tema (borda vermelha, foco e sombras) */
.pgd-search-group:focus-within .pgd-search-toggle-btn,
.pgd-search-group .pgd-search-toggle-btn:focus,
.pgd-search-group .pgd-search-toggle-btn:focus-visible,
.pgd-search-group .pgd-search-toggle-btn:active {
    border-color: #94a3b8 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Ajuste no Dropdown para ele alinhar com o grupo todo */
.pgd-search-results {
    top: 100%; /* Logo abaixo do grupo */
    width: 100%;
    z-index: 1000; /* Garantir que fique por cima de tudo */
    /* (Mantenha o resto do estilo anterior: background, border, max-height, etc) */
}

/* --- MELHORIA ESTÉTICA DA TABELA (Adicione ao final do layout.css) --- */

/* 1. Cabeçalho da Tabela: Texto mais escuro e mais alto */
.pgd-table thead th {
    background: #fff;
    color: #485d73; /* Mais escuro (antes era cinza claro) */
    font-weight: 700; /* Mais negrito */
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 24px; /* Aumentei o espaço vertical */
    border-bottom: 2px solid #eaeff5; /* Linha sutilmente mais grossa */
}

/* 2. Linhas da Tabela: Mais "ar" entre os itens */
.pgd-table tbody td {
    padding: 16px 24px; /* Mais espaçamento (Descanso visual) */
    color: #4a5568; /* Cinza escuro profissional */
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Efeito Hover nas linhas */
.pgd-table tbody tr:hover {
    background-color: #f8fafc; /* Azul/Cinza muito pálido */
}

/* 3. Remove espaço branco sob a tabela */
.pgd-desktop-view > div {
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); /* Sombra mais suave e moderna */
    border: 1px solid #e2e8f0;
    margin-bottom: 0; /* Remove margem inferior excessiva */
}

/* --- BARRA DE PAGINAÇÃO PROFISSIONAL --- */
.pgd-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eaeff5;
    border-radius: 0 0 8px 8px; /* Arredonda só em baixo */
}

.pgd-pagination-info {
    font-size: 13px;
    color: #7f8c8d;
}

.pgd-pagination-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.pgd-pagination-ellipsis {
    padding: 6px 8px;
    color: #94a3b8;
    font-weight: 700;
}

.pgd-pagination-controls .pgd-page-disabled {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
}

.pgd-pagination-controls a {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.pgd-pagination-controls a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.pgd-pagination-controls a.active {
    background: #2c3e50;
    color: #fff;
}

/* Select de "Itens por página" */
.pgd-limit-selector {
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #555;
    background: #fff;
    cursor: pointer;
}

/* --- ACMS Sync (MVP) --- */
#pgd-app .pgd-progress{
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

#pgd-app .pgd-progress-bar{
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    transition: width 0.25s ease;
}

#pgd-app .pgd-acms-upload .pgd-form-row{
    margin-bottom: 18px;
}

#pgd-app .pgd-acms-upload label{
    display:block;
    margin-bottom: 8px;
    line-height: 1.35;
}

#pgd-app .pgd-acms-upload input[type="file"],
#pgd-app .pgd-acms-upload select{
    margin-top: 2px;
}

#pgd-app .pgd-help{
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

/* Aviso sutil de “última atualização ACMS” (fora do módulo ACMS) */
.pgd-layout-wrapper .pgd-acms-last-sync-note{
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 400;
    line-height: 1.45;
}

#pgd-app .pgd-acms-note{
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
}

/* ACMS: Histórico mais compacto (evita rolagem horizontal em notebooks) */
#pgd-app .pgd-acms-history .pgd-table{
    table-layout: fixed;
}

#pgd-app .pgd-acms-history .pgd-table thead th{
    padding: 10px 10px;
    font-size: 12px;
}

#pgd-app .pgd-acms-history .pgd-table tbody td{
    padding: 10px 10px;
    font-size: 13px;
}

#pgd-app .pgd-acms-history .pgd-table td,
#pgd-app .pgd-acms-history .pgd-table th{
    white-space: normal;
    word-break: break-word;
}

/* ACMS: estado "concluído" (lúdico) */
#pgd-app .pgd-acms-progress.pgd-acms-progress--done{
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
}

#pgd-app .pgd-acms-progress.pgd-acms-progress--done h3{
    color: #166534;
}

#pgd-app .pgd-acms-progress.pgd-acms-progress--done .pgd-progress-bar{
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* ============================
   AGENDA (Etapa 1) - Calendário visual
   ============================ */
.pgd-layout-wrapper [hidden] {
    display: none !important;
}

/* Toolbar (menos poluição no cabeçalho) */
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-left,
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-right{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-title{
    font-weight: 800;
    color: #111827;
    min-width: 220px;
    text-align: center;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-page-title-suffix{
    color: #686b70;
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: -0.01em;
}

@media (max-width: 820px){
    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-title{
        font-size: 18px;
    }
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-select.pgd-select-compact{
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    min-height: 38px;
}

/* Evita selects em 100% (Elementor/tema) */
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-ctl{
    width: auto !important;
    max-width: 240px;
    flex: 0 0 auto;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-ctl--mode{
    width: 100px !important;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-ctl--tipo{
    width: 110px !important;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-ctl--depto{
    width: 210px !important;
}

.pgd-layout-wrapper .pgd-agenda-list-title-wrap{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper .pgd-agenda-list-header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper .pgd-agenda-list-controls{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper .pgd-agenda-list-subline{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.pgd-layout-wrapper .pgd-agenda-list-count{
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.pgd-layout-wrapper .pgd-agenda-list-title{
    margin: 0;
}

.pgd-layout-wrapper .pgd-agenda-list-period{
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-filters{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-filter-item{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-filter-item input[type="checkbox"]{
    margin: 0;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-cell{
    min-width: 220px;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-items{
    display: grid;
    gap: 6px;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-item{
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-tag{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    border: 1px solid transparent;
    flex: 0 0 auto;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-tag--geral{
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-tag--administrativo{
    color: #475569;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-title{
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-time{
    color: #64748b;
    font-size: 11px;
}

.pgd-layout-wrapper .pgd-agenda-eclesiastico-empty{
    color: #94a3b8;
    font-size: 12px;
}

@media (min-width: 980px){
    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-right{
        flex-wrap: nowrap;
    }
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-icon-btn{
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 999px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-icon-btn .dashicons{
    margin: 0 !important;
}

@media (max-width: 820px){
    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-title{
        text-align: left;
        flex: 1 1 100%;
        min-width: 0;
        order: 3;
    }
}

.pgd-agenda-tab.active {
    background: #111827;
    color: #fff;
}

/* Força visual neutro das abas no tema/Elementor */
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-tab {
    border-color: #cbd5e1 !important;
    color: #2c3e50 !important;
    background: #ffffff !important;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-tab.active {
    border-color: #111827 !important;
    background: #111827 !important;
    color: #ffffff !important;
}

.pgd-agenda-month {
    margin-top: 12px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend{
    display: none;
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-title{
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-hint{
    font-size: 11px;
    color: #6b7280;
    line-height: 1.35;
    margin: -2px 0 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-date{
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    margin: 10px 0 6px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-ev{
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-ev:hover{
    background: rgba(17,24,39,0.03);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-dot{
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 3px;
    flex: 0 0 10px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-meta{
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    margin-bottom: 3px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-name{
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
    word-break: break-word;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend-empty{
    font-size: 12px;
    color: #6b7280;
    padding: 8px 2px;
}

.pgd-agenda-week {
    margin-top: 12px;
}

/* Year view */
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year{
    margin-top: 12px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1100px) {
    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-grid{
        grid-template-columns: 1fr;
    }
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-month{
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(180px, 1fr);
    grid-template-rows: auto 1fr;
    gap: 14px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-month-head{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-month-title{
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    cursor: pointer;
    text-align: left;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-month-title:hover{
    text-decoration: underline;
}


.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-events{
    border-left: none;
    padding-left: 12px;
    overflow: auto;
    max-height: 260px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-empty{
    color: #6b7280;
    font-size: 12px;
    padding: 6px 4px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-ev{
    border: none;
    background: transparent;
    box-shadow: none;
    margin: 0;
    padding: 4px 2px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-ev:hover{
    background: rgba(17,24,39,0.04);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-ev-dot{
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 9px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-ev .time{
    font-size: 10px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-ev .title{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-month-grid{
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-dow{
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .05em;
    text-align: center;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-day{
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 800;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-day.is-today{
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.10);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-day.is-out{
    background: #fafafa;
    color: #9ca3af;
    cursor: default;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-dots{
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-year-dot{
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #2563eb;
}

.pgd-agenda-tooltip {
    position: fixed;
    z-index: 100000;
    max-width: 320px;
    background: linear-gradient(180deg, #f5f7fa 0%, #edf2f7 100%);
    color: #1e293b;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22), 0 6px 16px rgba(15, 23, 42, 0.12);
    border: 1px solid #d6dee9;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
}

.pgd-agenda-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.pgd-agenda-tooltip-title {
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 8px;
    color: #0f172a;
    letter-spacing: 0.2px;
}

.pgd-agenda-tooltip-body {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #334155;
}

.pgd-agenda-tooltip-section-title {
    font-weight: 700;
    font-size: 11px;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 4px;
    border-bottom: 1px solid #dbeafe;
    padding-bottom: 3px;
    margin-bottom: 2px;
}

.pgd-agenda-tooltip-row {
    line-height: 1.45;
    color: #334155;
}

.pgd-agenda-tooltip-row strong {
    color: #1e293b;
    font-weight: 700;
}

.pgd-agenda-tooltip-footer {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.pgd-agenda-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

/* Indicador de eventos no dia: por padrão NÃO aparece (desktop) */
.pgd-agenda-day-dot{
    display: none;
}

/* Month view: agrupa 7 dias por semana e desenha barras multi-dia */
.pgd-agenda-month-week {
    grid-column: 1 / -1;
    position: relative;
}

.pgd-agenda-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

/* Mobile: experiência do mês (só celular) */
@media (max-width: 820px){
    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-ctl--depto{
        display: none !important;
    }

    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-toolbar-right{
        flex-wrap: nowrap;
    }

    .pgd-agenda-month-grid{
        gap: 6px;
        overflow: hidden;
    }

    .pgd-agenda-month-week{
        overflow: hidden;
        border-radius: 12px;
        background: #e5e7eb;
    }

    .pgd-agenda-week-days{
        gap: 1px;
        background: transparent;
        width: 100%;
        max-width: 100%;
    }

    .pgd-agenda-week-bars{
        display: none !important;
    }

    .pgd-agenda-ev.pgd-agenda-ev-bar{
        display: none !important;
    }

    .pgd-agenda-month-week .pgd-agenda-day .pgd-agenda-events{
        padding-top: 0 !important;
    }

    .pgd-agenda-dow{
        font-size: 11px;
        padding: 2px 0;
        text-align: center;
    }

    .pgd-agenda-day{
        position: relative;
        border: 0;
        border-radius: 0;
        padding: 4px 2px;
        min-height: 0;
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        background: #fff;
    }

    .pgd-agenda-day.is-out{
        background: #f3f4f6;
        color: #9ca3af;
    }

    .pgd-agenda-day-header{
        justify-content: center;
        margin: 0;
    }

    .pgd-agenda-day-drop{
        display: none;
    }

    /* No mobile, eventos dentro do quadradinho ficam ilegíveis; usa a legenda abaixo */
    .pgd-agenda-day .pgd-agenda-events{
        display: none;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day-dot{
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #2563eb; /* 1 evento (azul) */
        border: 0;
        padding: 0;
        cursor: pointer;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day-dot--multi{
        background: #16a34a; /* 2+ eventos (verde) */
    }

    .pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-month-legend{
        display: block;
    }
}

.pgd-agenda-month-week .pgd-agenda-day .pgd-agenda-events {
    /* Reserva espaço para as lanes de eventos all-day multi-dia */
    padding-top: var(--pgd-agenda-bars-h, 0px);
}

.pgd-agenda-week-bars {
    position: absolute;
    left: 0;
    right: 0;
    top: 32px; /* abaixo do header do dia */
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    pointer-events: none; /* permite clicar nos dias; as barras reabilitam */
}

.pgd-agenda-ev.pgd-agenda-ev-bar {
    border-radius: 7px;
    padding: 2px 5px;
    min-height: 15px;
    pointer-events: auto;
    margin-bottom: 0.5px;
}

.pgd-agenda-ev.pgd-agenda-ev-bar .time {
    display: none;
}

/* Continuidade visual quando o evento continua fora da semana */
.pgd-agenda-ev.pgd-agenda-ev-bar.cont-left {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.pgd-agenda-ev.pgd-agenda-ev-bar.cont-right {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.pgd-agenda-dow {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 2px;
}

.pgd-agenda-day {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-height: 98px;
    padding: 6px;
    background: #fff;
    position: relative;
}

.pgd-agenda-day.is-out {
    background: #e5e7eb;
    color: #9ca3af;
}

.pgd-agenda-day.is-today {
    border-color: #e5e7eb;
    box-shadow: none;
}

.pgd-agenda-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
    margin-bottom: 0px;
}

.pgd-agenda-oficial-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231848cd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/12px no-repeat;
    border: none;
    box-shadow: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pgd-agenda-oficial-dot:hover {
    background: #1848cd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/12px no-repeat;
}

.pgd-agenda-oficial-picker {
    position: fixed;
    z-index: 100001;
    min-width: 220px;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15,23,42,0.18);
    padding: 10px;
}

.pgd-agenda-oficial-picker-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.pgd-agenda-oficial-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
}

.pgd-agenda-oficial-item + .pgd-agenda-oficial-item {
    margin-top: 6px;
}

.pgd-agenda-oficial-item:hover {
    border-color: #cbd5e1;
    background: #eef2ff;
}

.pgd-agenda-oficial-item .time {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
}

.pgd-agenda-oficial-item .title {
    font-size: 12px;
    color: #0f172a;
    font-weight: 800;
}

.pgd-agenda-week-col {
    position: relative;
}

.pgd-agenda-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.pgd-agenda-stat {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    background: #f8fafc;
}

.pgd-agenda-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 6px;
}

.pgd-agenda-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.pgd-agenda-stats-period-meta {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.pgd-agenda-stats-list {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.pgd-agenda-stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.pgd-agenda-stats-item strong {
    font-weight: 700;
    color: #0f172a;
}

.pgd-agenda-stats-item .count {
    font-weight: 800;
    color: #1848cd;
}

.pgd-agenda-stats-empty {
    font-size: 13px;
    color: #94a3b8;
    padding: 10px 2px;
}

.pgd-agenda-day-num {
    font-weight: 800;
    font-size: 12px;
}

/* Hoje: destaque apenas no número do dia (estilo “bolinha”) */
.pgd-agenda-day.is-today .pgd-agenda-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37,99,235,0.25);
    line-height: 1;
}

.pgd-agenda-day-drop {
    font-size: 11px;
    color: #6b7280;
}

.pgd-agenda-events {
    display: flex;
    flex-direction: column;
    gap: 0.5px;
}

.pgd-agenda-ev {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 2px 4px;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
    background: #f5f7fa;
    box-shadow: 0 1px 2px rgba(37,99,235,0.04);
    cursor: pointer;
    user-select: none;
    line-height: 1.02;
    font-size: 11px;
    margin-left: 8px;
    margin-right: 4px;
    transition: box-shadow 0.15s, background 0.15s;
}

.pgd-agenda-ev:hover {
    background: #e8f0fe;
    box-shadow: 0 2px 6px rgba(37,99,235,0.10);
}

.pgd-agenda-ev .time {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
}

.pgd-agenda-ev .title {
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgd-agenda-ev.readonly {
    opacity: .75;
    cursor: default;
}

.pgd-agenda-ev.dragging {
    opacity: .55;
}

.pgd-agenda-day.drag-over,
.pgd-agenda-week-col.drag-over {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.12);
}

.pgd-agenda-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.pgd-agenda-week-col {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    min-height: 260px;
}

.pgd-agenda-week-col h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
}

/* Botão + (Novo evento) no calendário */
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-add-btn{
    background: linear-gradient(180deg, #2c3e50 0%, #243342 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 10px 18px rgba(44,62,80,0.28);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-add-btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(44,62,80,0.34);
    filter: brightness(1.02);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-add-btn:focus,
.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-add-btn:focus-visible{
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(44,62,80,0.28), 0 14px 22px rgba(44,62,80,0.34);
}

.pgd-layout-wrapper [data-pgd-agenda-calendario] .pgd-agenda-add-btn .dashicons{
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Mobile overrides (no final para não serem sobrescritos) */
@media (max-width: 820px){
    [data-pgd-agenda-calendario] .pgd-agenda-month-grid{
        gap: 6px !important;
        overflow: hidden;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-month-week{
        overflow: hidden;
        border-radius: 12px;
        background: #e5e7eb;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-week-days{
        gap: 1px !important;
        background: transparent;
        width: 100%;
        max-width: 100%;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-week-bars,
    [data-pgd-agenda-calendario] .pgd-agenda-ev.pgd-agenda-ev-bar{
        display: none !important;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-month-week .pgd-agenda-day .pgd-agenda-events{
        padding-top: 0 !important;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-dow{
        font-size: 11px;
        padding: 2px 0;
        text-align: center;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day{
        position: relative !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 4px 2px !important;
        min-height: 0 !important;
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        background: #fff;
        overflow: hidden;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day.is-out{
        background: #f3f4f6 !important;
        color: #9ca3af;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day-header{
        justify-content: center;
        margin: 0;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day-drop{
        display: none !important;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day .pgd-agenda-events{
        display: none !important;
    }

    [data-pgd-agenda-calendario] .pgd-agenda-day-dot{
        z-index: 2;
    }
}

/* =====================================================
   Mapa de Atendimento Distrital
   ===================================================== */
.pgd-mapa-card {
    padding: 20px;
}

.pgd-mapa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pgd-mapa-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.pgd-mapa-distrito-field {
    min-width: 240px;
}

.pgd-mapa-distrito-current {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #475569;
}

.pgd-mapa-distrito-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.pgd-mapa-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.pgd-mapa-section {
    padding: 16px;
}

.pgd-mapa-section .pgd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pgd-mapa-accordion {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.pgd-mapa-accordion:first-of-type {
    margin-top: 0;
}

.pgd-mapa-accordion-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pgd-mapa-accordion-summary::-webkit-details-marker {
    display: none;
}

.pgd-mapa-accordion[open] .pgd-mapa-accordion-summary {
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.pgd-mapa-accordion-body {
    padding: 12px 14px 16px;
}

.pgd-mapa-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.pgd-mapa-plan {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    padding-top: 28px;
    background: #f8fafc;
    max-width: 100%;
}

.pgd-mapa-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    flex-direction: row;
}

.pgd-mapa-plan-header h4 {
    margin: 0;
    font-size: 14px;
    text-align: left;
    flex-shrink: 0;
}

.pgd-mapa-plan-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.pgd-mapa-plan-actions .pgd-btn.pgd-btn-small,
.pgd-mapa-plan-table .pgd-btn.pgd-btn-small,
.pgd-mapa-actions-wrap .pgd-btn.pgd-btn-small {
    padding: 4px 8px !important;
    min-height: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    line-height: 1 !important;
}

.pgd-mapa-plan-table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.pgd-mapa-plan-table .pgd-mapa-col-days {
    min-width: 120px;
}

.pgd-mapa-plan[data-pgd-plano="cultos"] .pgd-mapa-col-days {
    min-width: 70px;
}

.pgd-mapa-plan-table .pgd-mapa-col-order {
    width: 140px;
}

.pgd-mapa-plan-table .pgd-mapa-col-actions {
    width: 90px;
    text-align: right;
}

.pgd-mapa-actions-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.pgd-mapa-plan-table[data-plan-has-days="0"] .pgd-mapa-col-days {
    display: none;
}

/* Cards de visualização dos planos */
.pgd-mapa-plan-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    align-items: stretch;
    grid-auto-rows: 1fr;
    width: 100%;
}

@media (max-width: 1024px) {
    .pgd-mapa-plan-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.pgd-mapa-plan-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #ffffff;
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100%;
}

.pgd-mapa-plan-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.pgd-mapa-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    transition: height 0.3s ease;
}

.pgd-mapa-plan-card.priority-1::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.pgd-mapa-plan-card.priority-2::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.pgd-mapa-plan-card.priority-3::before {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.pgd-mapa-plan-card:hover::before {
    height: 8px;
}

.pgd-mapa-plan-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 16px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    height: 110px;
    flex-shrink: 0;
    gap: 6px;
}

.pgd-mapa-plan-card-number {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    position: relative;
}

.pgd-mapa-plan-card.priority-1 .pgd-mapa-plan-card-number {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.pgd-mapa-plan-card.priority-2 .pgd-mapa-plan-card-number {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.pgd-mapa-plan-card.priority-3 .pgd-mapa-plan-card-number {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.pgd-mapa-plan-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
}

.pgd-mapa-plan-card-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 0;
    height: auto;
    line-height: 1;
    order: -1;
}

.pgd-mapa-plan-card-frequency {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    min-height: auto;
}

.pgd-mapa-plan-card-freq-number {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #475569;
    text-align: center;
}

.pgd-mapa-plan-card.priority-1 .pgd-mapa-plan-card-freq-number {
    color: #475569;
}

.pgd-mapa-plan-card.priority-2 .pgd-mapa-plan-card-freq-number {
    color: #475569;
}

.pgd-mapa-plan-card.priority-3 .pgd-mapa-plan-card-freq-number {
    color: #475569;
}

.pgd-mapa-plan-card-freq-label {
    font-size: 14px;
    font-weight: 400;
    color: #475569;
    line-height: 1.5;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}

.pgd-mapa-plan-card-freq-unit {
    display: inline;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: #475569;
}

.pgd-mapa-plan-card-freq-strong {
    font-weight: 700;
}

.pgd-mapa-plan-card.priority-1 .pgd-mapa-plan-card-freq-unit {
    color: #10b981;
}

.pgd-mapa-plan-card.priority-2 .pgd-mapa-plan-card-freq-unit {
    color: #f59e0b;
}

.pgd-mapa-plan-card.priority-3 .pgd-mapa-plan-card-freq-unit {
    color: #3b82f6;
}

.pgd-mapa-plan-card-days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-content: flex-start;
    padding-bottom: 8px;
}

.pgd-mapa-plan-card-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px !important;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 600;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 2px solid #cbd5e1;
    min-width: 54px;
    height: 28px;
}

/* Lista de igrejas no card de plano */
.pgd-mapa-plan-card-igrejas {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.pgd-mapa-plan-card-igrejas-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pgd-mapa-plan-card-igrejas-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pgd-mapa-plan-card-igreja {
    font-size: 12px;
    color: #475569;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 5px;
    border-left: 3px solid #3b82f6;
    transition: all 0.2s ease;
}

.pgd-mapa-plan-card-igreja:hover {
    background: #e0e7ff;
    border-left-color: #1e40af;
}

.pgd-mapa-plan-card-activity {
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgd-mapa-plan-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pgd-mapa-plan-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.pgd-mapa-plan-card-text {
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    font-weight: 500;
}

/* Ocultar tabela no modo view, mostrar cards */
.pgd-mapa-plan[data-pgd-plano-mode="view"] .pgd-mapa-table-wrap {
    display: none;
}

.pgd-mapa-plan[data-pgd-plano-mode="view"] .pgd-mapa-plan-summary {
    display: none;
}

.pgd-mapa-plan[data-pgd-plano-mode="view"] .pgd-mapa-plan-cards {
    display: flex;
}

/* Ocultar cards no modo edit, mostrar tabela */
.pgd-mapa-plan[data-pgd-plano-mode="edit"] .pgd-mapa-table-wrap {
    display: block;
}

.pgd-mapa-plan[data-pgd-plano-mode="edit"] .pgd-mapa-plan-summary {
    display: block;
}

.pgd-mapa-plan[data-pgd-plano-mode="edit"] .pgd-mapa-plan-cards {
    display: none;
}

.pgd-mapa-tabs {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.pgd-mapa-tabs-nav {
    display: flex;
    gap: 12px;
    padding: 0;
    border-bottom: 2px solid #e2e8f0;
}

.pgd-mapa-tab-btn {
    flex: 1;
    padding: 14px 24px;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.pgd-mapa-tab-btn:hover {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #818cf8;
    transform: translateY(-2px);
}

.pgd-mapa-tab-btn.active {
    background: #fff;
    color: #1e40af;
    border-color: #3b82f6;
    border-bottom: 2px solid #fff;
    font-weight: 700;
}

.pgd-mapa-tab-content {
    display: none;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.pgd-mapa-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sub-abas dos planos */
.pgd-mapa-subtabs-nav {
    display: flex;
    gap: 8px;
    padding: 0;
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px;
}

.pgd-mapa-subtab-btn {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pgd-mapa-subtab-btn:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.pgd-mapa-subtab-btn.active {
    background: #fff;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid #3b82f6;
    font-weight: 700;
}

.pgd-mapa-subtab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.pgd-mapa-subtab-content.active {
    display: block;
}

.pgd-mapa-muted {
    color: #94a3b8;
    font-style: italic;
}

.pgd-hidden {
    display: none !important;
}

.pgd-mapa-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: #0f172a;
    font-weight: 700;
    font-size: 12px;
}

.pgd-mapa-priority-1 {
    background: #bbf7d0;
    color: #166534;
}

.pgd-mapa-priority-2 {
    background: #fde68a;
    color: #92400e;
}

.pgd-mapa-priority-3 {
    background: #bfdbfe;
    color: #1e3a8a;
}

.pgd-mapa-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.pgd-mapa-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pgd-mapa-table-wrap {
    overflow-x: auto;
}

.pgd-mapa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pgd-mapa-table th,
.pgd-mapa-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.pgd-mapa-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
}

.pgd-mapa-empty {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 14px 10px;
}

.pgd-mapa-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
}

.pgd-mapa-legend {
    display: grid;
    gap: 4px;
}

.pgd-mapa-legend-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

/* Novo layout de cards da legenda */
.pgd-mapa-legend-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.pgd-mapa-legend-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.pgd-mapa-legend-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.pgd-mapa-legend-card-1 {
    border-left: 4px solid #10b981;
}

.pgd-mapa-legend-card-2 {
    border-left: 4px solid #f59e0b;
}

.pgd-mapa-legend-card-3 {
    border-left: 4px solid #3b82f6;
}

.pgd-mapa-legend-badge {
    flex-shrink: 0;
}

.pgd-mapa-legend-content h5 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.pgd-mapa-legend-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

/* Texto introdutório quando não há distrito selecionado */
.pgd-mapa-intro-text {
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin-bottom: 20px;
}

.pgd-mapa-intro-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.pgd-mapa-intro-icon svg {
    width: 32px;
    height: 32px;
}

.pgd-mapa-intro-text h4 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.pgd-mapa-intro-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.pgd-mapa-intro-text p:last-child {
    margin-bottom: 0;
}

.pgd-mapa-intro-action {
    margin-top: 20px !important;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600 !important;
    color: #3b82f6 !important;
    display: inline-block;
}

.pgd-mapa-rules .pgd-card-header {
    margin-top: 12px;
}

.pgd-mapa-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 4px;
    min-width: 110px;
}

.pgd-mapa-day {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
}

.pgd-mapa-day input {
    margin: 0;
}

@media (max-width: 768px) {
    .pgd-mapa-header {
        align-items: flex-start;
    }
}

/* =====================================================
   Análise de Atendimento - Mapa
   ===================================================== */

/* Container da análise */
.pgd-mapa-analise-intro {
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin-bottom: 20px;
}

.pgd-mapa-analise-intro p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* Cards de estatísticas */
.pgd-mapa-analise-stats {
    margin-top: 24px;
}

.pgd-mapa-analise-stat-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.pgd-mapa-analise-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.pgd-mapa-analise-stat-card.success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.pgd-mapa-analise-stat-card.warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.pgd-mapa-analise-stat-card.danger {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.pgd-mapa-analise-stat-card h4 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.pgd-mapa-analise-stat-card.success .stat-number {
    color: #10b981;
}

.pgd-mapa-analise-stat-card.warning .stat-number {
    color: #f59e0b;
}

.pgd-mapa-analise-stat-card.danger .stat-number {
    color: #ef4444;
}

.stat-detail {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.6;
}

.stat-detail .text-success {
    color: #10b981;
    font-weight: 600;
}

.stat-detail .text-danger {
    color: #ef4444;
    font-weight: 600;
}

/* Seções de detalhes por tipo */
.pgd-mapa-analise-details {
    margin-top: 32px;
}

.pgd-mapa-analise-section {
    margin-top: 32px;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.pgd-mapa-analise-section:first-child {
    margin-top: 0;
}

.pgd-mapa-analise-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

/* Tabela de análise */
.pgd-mapa-analise-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.pgd-mapa-analise-table th {
    text-align: left;
    padding: 12px;
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pgd-mapa-analise-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #334155;
}

.pgd-mapa-analise-table tr:last-child td {
    border-bottom: none;
}

.pgd-mapa-analise-table tr:hover {
    background-color: #f8fafc;
}

/* Separador visual entre grupos de igrejas */
.pgd-igreja-grupo-separador td {
    border-top: 3px solid #cbd5e1 !important;
}

/* Status badges */
.pgd-mapa-analise-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pgd-mapa-analise-status.ok {
    background-color: #d1fae5;
    color: #065f46;
}

.pgd-mapa-analise-status.parcial {
    background-color: #fef3c7;
    color: #92400e;
}

.pgd-mapa-analise-status.pendente {
    background-color: #fed7aa;
    color: #92400e;
}

/* Loading spinner */
.pgd-mapa-analise-loading {
    padding: 60px 24px;
    text-align: center;
}

.pgd-mapa-analise-loading .dashicons {
    font-size: 48px;
    color: #3b82f6;
}

.pgd-mapa-analise-loading p {
    margin-top: 16px;
    font-size: 14px;
    color: #64748b;
}

/* =====================================================
   Escala Inteligente — Preview Section Inline (Fase 3)
   ===================================================== */

.pgd-escala-preview-section {
    border: 2px solid #6366f1;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.pgd-escala-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-bottom: 1px solid #c7d2fe;
}

/* Stats bar */
.pgd-escala-preview-stats {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.pgd-escala-preview-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.pgd-escala-preview-stat .stat-value {
    font-weight: 700;
    font-size: 15px;
}

.pgd-escala-preview-stat.success .stat-value { color: #10b981; }
.pgd-escala-preview-stat.warning .stat-value { color: #f59e0b; }
.pgd-escala-preview-stat.danger .stat-value  { color: #ef4444; }
.pgd-escala-preview-stat.info .stat-value    { color: #3b82f6; }

/* Toolbar */
.pgd-escala-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-wrap: wrap;
}

.pgd-escala-preview-counter {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.pgd-escala-preview-counter span {
    font-weight: 700;
    color: #1e293b;
}

.pgd-escala-preview-actions-bulk {
    display: flex;
    gap: 6px;
}

/* Table wrap */
.pgd-escala-preview-table-wrap {
    overflow-y: auto;
    max-height: 60vh;
}

.pgd-escala-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pgd-escala-preview-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
}

.pgd-escala-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.pgd-escala-preview-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Row states */
.pgd-escala-preview-table tr.pgd-preview-accepted {
    background: #f0fdf4;
}

.pgd-escala-preview-table tr.pgd-preview-rejected {
    background: #fef2f2;
    opacity: 0.55;
    text-decoration: line-through;
}

.pgd-escala-preview-table tr.pgd-preview-rejected td {
    color: #94a3b8;
}

.pgd-escala-preview-table tr.pgd-preview-conflict {
    border-left: 3px solid #f59e0b;
}

.pgd-escala-preview-table tr.pgd-preview-conflict-high {
    border-left: 3px solid #ef4444;
}

/* Toggle checkbox */
.pgd-escala-preview-toggle {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #10b981;
}

/* Edit button */
.pgd-escala-preview-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6;
    padding: 4px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.15s;
}

.pgd-escala-preview-edit-btn:hover {
    background: #eff6ff;
}

/* Inline edit mode */
.pgd-escala-preview-table tr.pgd-preview-editing {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.pgd-escala-preview-table tr.pgd-preview-editing select,
.pgd-escala-preview-table tr.pgd-preview-editing input {
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    background: #fff;
}

/* Priority badge */
.pgd-preview-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.pgd-preview-priority.p1 { background: #3b82f6; }
.pgd-preview-priority.p2 { background: #f59e0b; }
.pgd-preview-priority.p3 { background: #94a3b8; }

/* Conflict badge */
.pgd-preview-conflict-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 4px;
}

.pgd-preview-conflict-badge.alta {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.pgd-preview-conflict-badge.media {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Alerts section */
.pgd-escala-preview-alerts {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fffbeb;
}

.pgd-escala-preview-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #92400e;
}

.pgd-escala-preview-alert .alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Footer */
.pgd-escala-preview-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Check button (aceitar/rejeitar) */
.pgd-preview-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all .15s ease;
    padding: 0;
}

.pgd-preview-check:hover {
    border-color: #6366f1;
    transform: scale(1.1);
}

.pgd-preview-check-accepted {
    border-color: #16a34a;
    background: #dcfce7;
    color: #16a34a;
}

.pgd-preview-check-rejected {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

/* Row states */
.pgd-preview-row-rejected {
    opacity: 0.45;
    background: #f9fafb !important;
}

.pgd-preview-row-rejected td {
    text-decoration: line-through;
    color: #9ca3af;
}

.pgd-preview-row-rejected td:first-child,
.pgd-preview-row-rejected td:last-child {
    text-decoration: none;
}

.pgd-preview-row-conflict {
    border-left: 3px solid #f59e0b;
}

/* Responsive */
@media (max-width: 768px) {
    .pgd-escala-preview-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .pgd-escala-preview-stats {
        gap: 8px;
        padding: 10px 12px;
    }
    .pgd-escala-preview-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px;
    }
    .pgd-escala-preview-table-wrap {
        overflow-x: auto;
    }
}
