/*
 * Página Células: moldura visual do Site PIBH atual e mapa integral legado.
 * O cabeçalho compacto replica a composição usada em Devocionais.
 * Marcadores, cores, popup, marcador da igreja, categorias e controles abaixo
 * foram preservados do mapa do site anterior.
 */
.cells-page {
    max-width: 1480px;
    margin: 0 auto;
    padding: 42px 28px 72px;
}
.cells-page .devotional-compact-hero {
    margin-bottom: 28px;
}
.cells-page .devotional-compact-hero h1 {
    margin-bottom: 10px;
}
.cells-page .farol-map-layout {
    display: grid;
    height: 500px;
    grid-template-columns: 275px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d9d5df;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(29, 33, 52, .08);
}
.cells-page .farol-map-canvas,
.cells-page #cellsMap {
    width: 100%;
    height: 500px;
    min-height: 500px;
}
.cells-page .leaflet-container {
    z-index: 1;
}
@media (max-width: 820px) {
    .cells-page {
        padding: 28px 14px 48px;
    }
    .cells-page .farol-map-layout {
        height: auto;
        grid-template-columns: 1fr;
    }
    .cells-page .farol-map-sidebar {
        max-height: 350px;
        border-right: 0;
        border-bottom: 1px solid #ddd6e4;
    }
    .cells-page .farol-map-canvas,
    .cells-page #cellsMap {
        height: 440px;
        min-height: 440px;
    }
}

/* Estrutura visual original do mapa anterior. */
.cell-marker{border:0!important;background:transparent!important}
.cell-marker span{display:grid;width:38px;height:38px;place-items:center;border:3px solid #fff;border-radius:50% 50% 50% 0;background:var(--cell);color:#fff;transform:rotate(-45deg);box-shadow:0 4px 10px rgba(0,0,0,.3)}
.cell-marker i{transform:rotate(45deg)}
.farol-map-layout{display:grid;max-width:1500px;height:calc(100% - 78px);grid-template-columns:275px 1fr;margin:auto;overflow:hidden;border:1px solid #d9d5df;border-radius:15px;background:#fff;box-shadow:0 8px 25px rgba(29,33,52,.08)}
.farol-map-sidebar{display:flex;min-height:0;flex-direction:column;border-right:1px solid #ddd6e4;background:#fff}
.map-filter{position:relative;margin:10px 10px 0}
.map-filter i{position:absolute;left:11px;top:50%;z-index:2;transform:translateY(-50%);color:#788695}
.map-filter input,.map-filter select{width:100%;height:36px;padding:0 10px 0 34px;border:1px solid #dcd5e3;border-radius:9px;background:#faf8fc;font-size:.72rem}
.municipality-status{margin:8px 10px 3px;padding:6px 8px;border-radius:8px;background:#f4f4f4;color:#76808a;font-size:.63rem}
.municipality-status.success{background:#edf6eb;color:#447236}
.municipality-status.error{background:#fff1f1;color:#954343}
.farol-map-list{min-height:0;overflow:auto;padding:6px 8px 12px}
.map-category-group{margin-bottom:8px}
.map-category-group h3{display:flex;align-items:center;gap:6px;margin:0 2px 4px;padding:6px 7px;border-radius:8px;background:#f3eef7;color:#5e4075;font-size:.65rem;text-transform:uppercase}
.map-category-group h3 span{margin-left:auto;padding:1px 6px;border-radius:999px;background:#fff}
.map-category-group button{display:grid;width:100%;grid-template-columns:9px 1fr auto;align-items:center;gap:8px;padding:8px 6px;border:0;border-bottom:1px solid #eee;background:#fff;text-align:left;cursor:pointer}
.map-category-group button>i{width:8px;height:27px;border-radius:99px;background:var(--legend-color)}
.map-category-group button span,.map-category-group button strong,.map-category-group button small{display:block;min-width:0}
.map-category-group button strong{overflow:hidden;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}
.map-category-group button small{overflow:hidden;color:#78818d;font-size:.57rem;text-overflow:ellipsis;white-space:nowrap}
.map-category-group button em{color:#8a909a;font-size:.53rem;font-style:normal}
.farol-map-canvas{min-width:0;height:100%;background:#e8ecef}
.farol-cell-marker{border:0!important;background:transparent!important}
.farol-cell-marker>span{position:absolute;left:0;bottom:0;display:grid;width:35px;height:35px;place-items:center;border:2px solid #fff;border-radius:50% 50% 50% 0;background:var(--cell);transform:rotate(-45deg);box-shadow:0 4px 12px rgba(0,0,0,.3)}
.farol-cell-marker>span i{width:9px;height:9px;border-radius:50%;background:var(--text);transform:rotate(45deg)}
.farol-cell-marker>b{position:absolute;left:43px;top:7px;max-width:210px;overflow:hidden;padding:5px 8px;border:1px solid rgba(255,255,255,.8);border-radius:7px;background:var(--cell);color:var(--text);font-size:.58rem;text-overflow:ellipsis;white-space:nowrap;box-shadow:0 3px 10px rgba(0,0,0,.2)}
.faithful-popup{min-width:270px}
.faithful-popup header{display:flex;align-items:center;gap:10px;padding-bottom:10px;border-bottom:3px solid var(--cell)}
.faithful-popup header>span{display:grid;width:34px;height:34px;place-items:center;border-radius:9px;background:var(--cell);color:#fff}
.faithful-popup header strong,.faithful-popup header small{display:block}
.faithful-popup dl{margin:10px 0}
.faithful-popup dl>div{margin:7px 0}
.faithful-popup dt{color:#667281;font-size:.62rem;font-weight:700}
.faithful-popup dd{margin:1px 0;font-size:.72rem}
.faithful-popup footer{display:flex;gap:7px}
.faithful-popup footer a{flex:1;padding:8px;border-radius:8px;background:#edf4df;color:#536d1b;font-size:.68rem;font-weight:800;text-align:center}
.church-image-marker{filter:drop-shadow(0 5px 7px rgba(0,0,0,.3))}
@media (max-width:900px){.farol-map-layout{height:auto;grid-template-columns:1fr}
.farol-map-sidebar{max-height:280px;border-right:0;border-bottom:1px solid #ddd}
.farol-map-canvas{height:570px}}
@media (max-width:620px){.farol-map-canvas{height:520px}
.farol-map-layout{border-radius:12px}}
.ctrl-zoom-notice{display:flex;max-width:245px;align-items:center;gap:8px;padding:9px 11px;border:1px solid rgba(21,25,47,.16);border-radius:10px;background:rgba(255,255,255,.94);color:#364152;font:600 .68rem/1.3 var(--body);box-shadow:0 5px 16px rgba(21,25,47,.13);backdrop-filter:blur(8px)}
.ctrl-zoom-notice i{color:#6f4e8c;font-size:1rem}
.ctrl-zoom-notice strong{color:#15192f}
@media (max-width:620px){.ctrl-zoom-notice{max-width:190px;font-size:.61rem}}
.leaflet-popup.cell-public-popup .leaflet-popup-content-wrapper{padding:0;border-radius:18px;overflow:hidden}
.cell-public-popup .leaflet-popup-content{width:360px!important;margin:0}
.cell-detail-popup{width:360px;background:#fff;color:#334155}
.cell-detail-popup header{display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:12px;padding:17px 42px 15px 17px;background:color-mix(in srgb,var(--cell) 16%,#fff)}
.cell-popup-icon{display:grid;width:44px;height:44px;place-items:center;border-radius:13px;background:var(--cell);color:#fff}
.cell-detail-popup header strong,.cell-detail-popup header small{display:block}
.cell-detail-popup header small{color:#64748b;font-size:.7rem}
.cell-popup-status{padding:4px 9px;border-radius:999px;background:#fff;color:#607085;font-size:.62rem}
.cell-detail-popup dl{margin:0;padding:8px 17px}
.cell-detail-popup dl>div{display:grid;grid-template-columns:110px 1fr;gap:10px;padding:10px 0;border-bottom:1px solid #e7eaf0}
.cell-detail-popup dt{color:#64748b;font-size:.7rem;font-weight:800}
.cell-detail-popup dt i{margin-right:7px;color:var(--cell)}
.cell-detail-popup dd{margin:0;font-size:.72rem;line-height:1.45}
.cell-detail-popup footer{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:12px 17px 16px;background:#f8fafc}
.cell-detail-popup footer a,.cell-detail-popup footer span{display:flex;min-height:42px;align-items:center;justify-content:center;gap:7px;border:1px solid #dde4ec;border-radius:11px;color:#60758a;font-size:.72rem;font-weight:800}
.cell-popup-loading{display:flex;min-height:130px;align-items:center;justify-content:center;gap:9px;color:#64748b}
.cell-popup-loading i{animation:secure-spin 1s linear infinite}
.cell-popup-loading.is-error{color:#9b3b3b}
.cell-popup-loading.is-error i{animation:none}
@media (max-width:620px){.cell-public-popup .leaflet-popup-content,.cell-detail-popup{width:300px!important}
.cell-detail-popup dl>div{grid-template-columns:90px 1fr}}
.church-fixed-label{background:#0f2034!important;border:1px solid rgba(230,190,83,.85)!important;border-radius:999px!important;color:#fff!important;font-size:.72rem!important;font-weight:800!important;padding:6px 10px!important;box-shadow:0 8px 22px rgba(15,32,52,.25)!important}
.church-fixed-label:before{border-top-color:#0f2034!important}
.leaflet-popup.cell-public-popup .leaflet-popup-content-wrapper{border-radius:20px;box-shadow:0 18px 50px rgba(15,23,42,.24)}
.cell-detail-popup header{grid-template-columns:48px minmax(0,1fr) auto;padding:14px 38px 14px 14px}
.cell-popup-photo,.cell-popup-icon{width:48px;height:48px;border-radius:13px;overflow:hidden;box-shadow:0 6px 16px color-mix(in srgb,var(--cell) 28%,transparent)}
.cell-popup-photo img{width:100%;height:100%;object-fit:cover}
.cell-detail-popup header strong{overflow:hidden;color:#17324a;font-size:.9rem;text-overflow:ellipsis;white-space:nowrap}
.cell-detail-popup header small{font-size:.66rem}
.cell-popup-status{font-weight:850}
.cell-detail-popup dl{padding:7px 15px}
.cell-detail-popup dl>div{grid-template-columns:92px minmax(0,1fr);padding:9px 0}
.cell-detail-popup dd{color:#263b50}
.cell-detail-popup dd small{display:block;margin-top:2px;color:#778596;font-size:.58rem}
.cell-detail-popup footer{display:block;padding:12px 15px 14px}
.cell-detail-popup footer>small{display:flex;align-items:flex-start;gap:6px;margin-top:9px;color:#738092;font-size:.56rem;line-height:1.35}
.church-fixed-label{display:none!important}
.cell-popup-photo{position:relative;display:block;padding:0;border:0;background:transparent;cursor:zoom-in}
.cell-popup-photo>span{position:absolute;right:3px;bottom:3px;display:grid;place-items:center;width:18px;height:18px;border-radius:6px;background:rgba(10,27,42,.78);color:#fff;font-size:.55rem;opacity:0;transition:opacity .16s ease}
.cell-popup-photo:hover>span,.cell-popup-photo:focus-visible>span{opacity:1}
.cell-popup-photo:focus-visible{outline:2px solid #fff;outline-offset:2px}
.cell-photo-dialog{width:min(900px,calc(100vw - 32px));max-width:none;padding:0;border:0;border-radius:18px;background:#0b1722;box-shadow:0 24px 80px rgba(0,0,0,.45)}
.cell-photo-dialog::backdrop{background:rgba(4,12,20,.78);backdrop-filter:blur(5px)}
.cell-photo-dialog img{display:block;width:100%;max-height:82vh;object-fit:contain}
.cell-photo-dialog-close{position:absolute;z-index:2;top:12px;right:12px;display:grid;place-items:center;width:38px;height:38px;border:1px solid rgba(255,255,255,.28);border-radius:50%;background:rgba(9,24,36,.82);color:#fff}
.cell-photo-dialog-close:hover{background:#fff;color:#162b3d}

/* Versão 3.0.88: conteúdo abaixo do menu fixo e relação de células sempre visível. */
.cells-page {
    padding-top: 104px !important;
}

.cells-page .farol-map-sidebar {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.cells-page .farol-map-list {
    display: block;
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cells-page .map-category-group {
    display: block;
}

.cells-page .map-category-group button {
    display: grid;
}

@media (max-width: 820px) {
    .cells-page {
        padding-top: 86px !important;
    }
}
