/* =====================================================================
   Well Impact Map™ — custom styles on top of Bootstrap 5
   Layout: full-height, non-scrolling desktop "app" shell that stacks
   and scrolls on small screens.
   ===================================================================== */

:root {
    --navy:        #0e2c4f;   /* sidebar + stats bar */
    --navy-dark:   #0a2444;   /* stats bar / deepest */
    --navy-line:   #1b3a5e;   /* subtle dividers on navy */
    --tab-active:  #1c4d7d;   /* highlighted sidebar tab */
    --tab-accent:  #35a0e0;   /* left accent bar on active tab */
    --brand-navy:  #123a63;
    --brand-teal:  #16b4cd;
    --accent-blue: #1877d4;   /* primary buttons + active nav */
    --accent-blue-d:#1466b8;
    --text-dark:   #16273d;
    --text-muted:  #7a8798;
    --panel-border:#e7ebf0;
    --sidebar-w:   132px;
    --panel-w:     340px;
    --scroll-thumb: #b7c6d8;
    --scroll-thumb-hover: #8ea6c1;
    --scroll-track: #eef2f7;
}

* { box-sizing: border-box; }

/* ---------------------------------------------------------------------
   Stylish, slim custom scrollbars (light scrollable areas)
   --------------------------------------------------------------------- */
* {
    scrollbar-width: thin;                                  /* Firefox */
    scrollbar-color: var(--scroll-thumb) transparent;       /* Firefox */
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    background-clip: content-box;
}

/* Darker thumb over the navy sidebar so it stays visible */
.impact-sidebar { scrollbar-color: #3a5b82 transparent; }
.impact-sidebar::-webkit-scrollbar-thumb { background: #3a5b82; background-clip: content-box; }
.impact-sidebar::-webkit-scrollbar-thumb:hover { background: #4d7096; background-clip: content-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    background: #fff;
}

/* Impact map page uses the shared Elementor site header */
body.impact-map-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.impact-map-page #page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

body.impact-map-page #content.impact-map-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

body.impact-map-page .impact-map-content .app-shell {
    flex: 1 1 auto;
    min-height: 0;
}

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.app-navbar {
    background: #ffffff;
    border-bottom: 1px solid #edf0f4;
    box-shadow: 0 1px 6px rgba(16, 42, 74, .04);
    flex: 0 0 auto;
    padding-top: .5rem;
    padding-bottom: .5rem;
}
/* Boxed header: constrain nav content to a centred container */
.app-navbar .container {
    max-width: 1320px;
}
.brand-img { height: 72px; width: auto; display: block; }
.brand-logo { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: .5px;
    color: var(--brand-navy);
}
.brand-name-accent { color: var(--brand-teal); }
.brand-name-sub { color: var(--brand-navy); font-weight: 700; }
.brand-tagline {
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .3px;
    color: #8a97a7;
    margin-top: 1px;
}
.app-navbar .navbar-nav { gap: .1rem; }
.app-navbar .nav-link {
    color: #35485f;
    font-weight: 500;
    font-size: .92rem;
    padding: .3rem .7rem;
    white-space: nowrap;
    position: relative;
}
.app-navbar .nav-link:hover { color: var(--accent-blue); }
.app-navbar .nav-link.active {
    color: var(--accent-blue);
    font-weight: 600;
}
.app-navbar .nav-link.active::after {
    content: "";
    position: absolute;
    left: .9rem; right: .9rem; bottom: -2px;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
}
.app-navbar .dropdown-menu {
    border: 1px solid #edf0f4;
    border-radius: .5rem;
    box-shadow: 0 8px 24px rgba(16, 42, 74, .12);
    padding: .35rem 0;
    min-width: 16rem;
}
.app-navbar .dropdown-item {
    font-size: .88rem;
    font-weight: 500;
    color: #35485f;
    padding: .45rem 1rem;
    white-space: normal;
}
.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    background: #f0f6fa;
    color: var(--accent-blue);
}
.app-navbar .dropdown-toggle::after {
    margin-left: .35rem;
    vertical-align: .15em;
}
.btn-sponsor {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    border-radius: 7px;
    padding: .5rem 1.15rem;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(24, 119, 212, .3);
}
.btn-sponsor:hover { background: var(--accent-blue-d); color: #fff; }

/* ---------------------------------------------------------------------
   App shell layout
   --------------------------------------------------------------------- */
.app-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.app-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

/* ---------------------------------------------------------------------
   Left icon sidebar
   --------------------------------------------------------------------- */
.impact-sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    background: var(--navy);
    color: #cdd8e6;
    display: flex;
    flex-direction: column;
    padding: 14px 0 10px;
    overflow-y: auto;
}
.sidebar-title {
    text-align: center;
    font-weight: 700;
    font-size: .92rem;
    line-height: 1.2;
    color: #eaf1f8;
    padding: 0 6px 14px;
}
.sidebar-title .tm { font-size: .6rem; vertical-align: super; }
.sidebar-nav { gap: 2px; }
.sidebar-tab {
    background: transparent;
    border: 0;
    color: #b6c4d6;
    width: 100%;
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sidebar-tab .tab-icon { font-size: 1.45rem; display: inline-flex; }
.sidebar-tab .tab-icon svg { width: 26px; height: 26px; }
.sidebar-tab .tab-label { display: block; max-width: 116px; }
.sidebar-tab:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-tab.active {
    background: var(--tab-active);
    color: #fff;
}
.sidebar-tab.active::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--tab-accent);
}
.sidebar-tab-bottom { margin-top: auto; }

/* ---------------------------------------------------------------------
   Detail panel
   --------------------------------------------------------------------- */
.detail-panel {
    flex: 0 0 var(--panel-w);
    width: var(--panel-w);
    background: #fff;
    border-right: 1px solid var(--panel-border);
    overflow-y: auto;
}
.detail-inner { padding: 12px 18px 16px; }
.detail-top { margin-bottom: 8px; }
.back-link {
    background: none;
    border: 0;
    color: #6a7889;
    font-size: .78rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.back-link:hover { color: var(--accent-blue); }

.cat-badge {
    display: inline-block;
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .35px;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.35;
}
.cat-memorial      { background: #2fa84f; }
.cat-school        { background: #0d6efd; }
.cat-community     { background: #17a2b8; }
.cat-church        { background: #6f42c1; }
.cat-institutional { background: #fd7e14; }

.detail-title {
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.13;
    color: var(--text-dark);
    margin: 2px 0 2px;
}
.detail-code {
    color: #8b97a6;
    font-size: .76rem;
    margin: 0 0 4px;
}
.detail-meta { margin-bottom: 10px; }
.detail-rows { margin: 0; }
.detail-row {
    display: flex;
    gap: 10px;
    padding: 3.5px 0;
    align-items: flex-start;
}
.row-icon {
    color: #9aa6b4;
    font-size: 1rem;
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
    padding-top: 1px;
}
.row-body { display: flex; flex-direction: column; }
.row-label {
    font-size: .72rem;
    color: #96a2b1;
    font-weight: 500;
}
.row-value {
    font-size: .85rem;
    color: #26374d;
    font-weight: 500;
    line-height: 1.28;
}
.row-quote { font-style: italic; color: #46566c; font-weight: 400; }

.detail-inner { padding: 14px 16px 18px; }

/* Well photo (click → lightbox) */
.detail-photo {
    display: block;
    width: 100%;
    height: 140px;
    border: 0;
    border-radius: 10px;
    background: #e8edf2 center/cover no-repeat;
    position: relative;
    cursor: pointer;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
    transition: opacity .15s;
}
.detail-photo:hover { opacity: .92; }
.detail-photo-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,.92);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.detail-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    color: #b0bcc8;
    font-size: 2rem;
    cursor: default;
}

/* Section cards */
.detail-section {
    background: #f8fafc;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.detail-section-title {
    margin: 0 0 8px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    color: #56657a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-section-title .bi { color: var(--accent-blue); font-size: .9rem; }
.detail-section-body { font-size: .84rem; }
.detail-text { margin: 0 0 8px; line-height: 1.45; color: #3a4a5e; }
.detail-muted { margin: 0; color: #8b97a6; font-size: .82rem; }
.detail-kv {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-top: 1px solid #eef1f5;
}
.detail-kv:first-child { border-top: 0; padding-top: 0; }
.detail-kv-label { font-size: .72rem; color: #8b97a6; font-weight: 500; flex-shrink: 0; }
.detail-kv-value { font-size: .82rem; font-weight: 600; color: var(--text-dark); text-align: right; }

.detail-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    font-weight: 600;
}
.detail-status.iw-status--green  { color: #1e7e34; }
.detail-status.iw-status--yellow { color: #b8860b; }
.detail-status.iw-status--orange { color: #c45c00; }
.detail-status.iw-status--red    { color: #c0392b; }

.detail-actions { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.btn-directions {
    background: #fff;
    color: var(--accent-blue);
    border: 1.5px solid var(--accent-blue);
    font-weight: 600;
    font-size: .88rem;
    border-radius: 8px;
    padding: .5rem 1rem;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-directions:hover { background: #f2f8ff; color: var(--accent-blue-d); }
.btn-report {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 600;
    font-size: .88rem;
    border-radius: 8px;
    padding: .5rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
}
.btn-report:hover { background: var(--accent-blue-d); color: #fff; }
.btn-report:disabled { opacity: .55; cursor: not-allowed; }
.btn-share {
    background: #fff;
    color: #3a4a5e;
    border: 1.5px solid #d8dee6;
    font-weight: 600;
    font-size: .88rem;
    border-radius: 8px;
    padding: .5rem 1rem;
}
.btn-share:hover { background: #f8fafc; border-color: #b8c4d0; }

/* Share dropdown menu */
.share-wrap { position: relative; }
.share-menu {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(100% + 6px);
    background: #fff;
    border: 1px solid #e2e7ee;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,42,74,.14);
    padding: 6px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.share-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: .82rem;
    font-weight: 500;
    color: #3a4a5e;
    cursor: pointer;
    text-align: left;
}
.share-item:hover { background: #f2f6fa; color: var(--accent-blue); }
.share-item .bi { font-size: 1rem; width: 18px; text-align: center; }
.share-item .bi-whatsapp { color: #25d366; }
.share-item .bi-facebook { color: #1877f2; }
.share-item .bi-linkedin { color: #0a66c2; }

.share-qr-img { width: 220px; height: 220px; border-radius: 8px; }
.share-qr-modal .modal-body { padding-bottom: 1.25rem; }

/* Empty / stub state inside the detail panel */
.detail-empty {
    text-align: center;
    color: #9aa6b4;
    padding: 48px 12px;
}
.detail-empty .bi { font-size: 2.2rem; opacity: .55; display: block; margin-bottom: 10px; }
.detail-empty p { margin: 0; font-size: .9rem; line-height: 1.45; }
.detail-empty strong { color: #56657a; }
.detail-loading { display: flex; justify-content: center; padding: 60px 0; }

/* ---------------------------------------------------------------------
   Map column
   --------------------------------------------------------------------- */
.map-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.filter-bar {
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 1px solid var(--panel-border);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.search-wrap {
    position: relative;
    flex: 1 1 auto;
    max-width: 420px;
}
.search-wrap .bi-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa6b4;
    font-size: .95rem;
}
.search-input {
    border-radius: 10px;
    border: 1px solid #e2e7ee;
    background: #fff;
    padding: .55rem .9rem .55rem 2.4rem;
    font-size: .88rem;
    box-shadow: 0 1px 4px rgba(16,42,74,.04);
}
.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(24,119,212,.12);
}
.filter-selects { display: flex; gap: 10px; margin-left: auto; }
.filter-select {
    border-radius: 10px;
    border: 1px solid #e2e7ee;
    font-size: .85rem;
    font-weight: 500;
    color: #3a4a5e;
    padding: .5rem 2rem .5rem .85rem;
    min-width: 132px;
    box-shadow: 0 1px 4px rgba(16,42,74,.04);
    cursor: pointer;
}
.filter-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(24,119,212,.12);
}

.map-wrap {
    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    background: #dfe6ec;
}
.map-canvas { position: absolute; inset: 0; }
.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7c8b9c;
    background:
        radial-gradient(circle at 30% 30%, #eef3f7 0%, #d9e2ea 60%, #cdd8e2 100%);
    text-align: center;
}
.map-placeholder .bi { font-size: 2.6rem; opacity: .5; }
.map-placeholder p { margin: 0; font-size: .95rem; font-weight: 500; }
.map-placeholder small { font-weight: 400; color: #90a0b0; }

/* Custom map controls (bottom-right) */
.map-controls {
    position: absolute;
    right: 14px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    z-index: 5;
}
.map-ctrl-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: #fff;
    color: #3a4a5e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16,42,74,.25);
}
.map-ctrl-btn:hover { background: #f3f6fa; color: var(--accent-blue); }
#geolocateBtn { border-radius: 8px; }
.map-zoom { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(16,42,74,.25); }
.map-zoom .map-ctrl-btn { box-shadow: none; border-radius: 0; }
.map-zoom .map-ctrl-btn:first-child { border-bottom: 1px solid #eef0f3; }

/* ---------------------------------------------------------------------
   Gallery category bar (below map — content opens in lightbox)
   --------------------------------------------------------------------- */
.well-gallery {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid var(--panel-border);
}
.gallery-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.gallery-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e2e7ee;
    border-radius: 999px;
    background: #fff;
    color: #3a4a5e;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.gallery-tab:hover {
    color: var(--accent-blue);
    border-color: #b8d4f0;
    background: #f2f8ff;
    box-shadow: 0 2px 8px rgba(24,119,212,.1);
}
.gallery-tab--empty { opacity: .5; }
.gallery-tab--empty:hover { opacity: .72; }
.gallery-tab-icon { font-size: 1rem; line-height: 1; }
.gallery-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e8f2fb;
    color: var(--accent-blue);
    font-size: .65rem;
    font-weight: 700;
}
.gallery-bar-empty,
.gallery-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b4;
    font-size: .84rem;
    font-weight: 500;
    padding: 12px 16px;
    text-align: center;
}

/* ---------------------------------------------------------------------
   Gallery lightbox
   --------------------------------------------------------------------- */
.gallery-lightbox .modal-dialog {
    max-width: min(960px, calc(100vw - 32px));
    margin: 1rem auto;
}
.gallery-lb-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(10, 24, 44, .35);
    background: #0f1724;
    color: #fff;
}
.gallery-lb-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #152238 0%, #101a2c 100%);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.gallery-lb-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.gallery-lb-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.gallery-lb-titles { min-width: 0; }
.gallery-lb-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.gallery-lb-subtitle {
    margin: 2px 0 0;
    font-size: .78rem;
    color: #9fb2c7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-lb-meta {
    flex: 0 0 auto;
    font-size: .78rem;
    font-weight: 600;
    color: #7eb8ea;
    letter-spacing: .4px;
}
.gallery-lb-close {
    flex: 0 0 auto;
    filter: invert(1) grayscale(1);
    opacity: .75;
}
.gallery-lb-close:hover { opacity: 1; }
.gallery-lb-body {
    padding: 18px 18px 20px;
    background: #0b1220;
}
.gallery-lb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 220px;
    text-align: center;
    color: #8fa3b8;
}
.gallery-lb-empty-icon { font-size: 2.4rem; opacity: .85; }
.gallery-lb-empty p { margin: 0; font-size: .92rem; max-width: 320px; }
.gallery-lb-stage-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gallery-lb-stage {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.gallery-lb-image {
    display: block;
    width: 100%;
    max-height: min(58vh, 520px);
    object-fit: contain;
    margin: 0 auto;
    background: #000;
}
.gallery-lb-video { max-height: min(58vh, 520px); background: #000; }
.gallery-lb-nav {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.gallery-lb-nav:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.28);
}
.gallery-lb-caption {
    margin: 12px 0 0;
    text-align: center;
    font-size: .86rem;
    color: #c5d3e0;
    font-weight: 500;
}
.gallery-lb-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    overflow-x: auto;
    scrollbar-width: thin;
}
.gallery-lb-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    background: #1a2438 center/cover no-repeat;
    position: relative;
    transition: border-color .15s, transform .15s;
}
.gallery-lb-thumb:hover { border-color: rgba(255,255,255,.35); }
.gallery-lb-thumb.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(24,119,212,.35);
}
.gallery-lb-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 1rem;
}
.gallery-lb-thumb--pdf {
    background: linear-gradient(135deg, #2a3548, #1a2438);
    color: #e57373;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gallery-lb-pdf {
    display: flex;
    flex-direction: column;
    min-height: min(58vh, 520px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.gallery-lb-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #f4f7fb;
    color: #2a3a4e;
    font-size: .82rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e7ee;
}
.gallery-lb-pdf-toolbar .bi-file-earmark-pdf { color: #c0392b; margin-right: 4px; }
.gallery-lb-pdf-dl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--accent-blue);
    color: #fff;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
}
.gallery-lb-pdf-dl:hover { background: var(--accent-blue-d); color: #fff; }
.gallery-lb-pdf-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 360px;
    border: 0;
    background: #fff;
}
.play-badge {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
    border: 2px solid rgba(255,255,255,.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ---------------------------------------------------------------------
   Bottom stats bar
   --------------------------------------------------------------------- */
.stats-bar {
    flex: 0 0 auto;
    background: var(--navy-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 12px 20px;
    gap: 12px;
}
.stat-item { display: flex; align-items: center; gap: 12px; }
.stat-icon {
    font-size: 1.5rem;
    color: #5fb2e8;
    display: inline-flex;
}
.stat-body { display: flex; flex-direction: column; line-height: 1.1; }
.stat-value { font-size: 1.35rem; font-weight: 700; }
.stat-label { font-size: .74rem; color: #9fb2c7; font-weight: 500; letter-spacing: .3px; }

/* ---------------------------------------------------------------------
   Map InfoWindow card (marker popup)
   --------------------------------------------------------------------- */

/* Remove Google Maps default scrollbars / padding on the popup shell */
.gm-style-iw-c { padding: 0 !important; max-height: none !important; }
.gm-style-iw-d { overflow: hidden !important; max-height: none !important; }
.gm-style-iw-chr { display: none; } /* hide duplicate close button row gap */

.iw-card {
    width: 260px;
    padding: 16px 16px 14px;
    font-family: 'Poppins', system-ui, sans-serif;
    overflow: hidden;
    box-sizing: border-box;
}
.iw-title {
    margin: 0 0 12px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    /* Prevent long names from causing horizontal scroll */
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.iw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #eef1f5;
}
.iw-row:last-of-type { border-bottom: 0; }
.iw-status-row { padding-bottom: 10px; }
.iw-label {
    font-size: .72rem;
    font-weight: 500;
    color: #8b97a6;
    flex-shrink: 0;
}
.iw-value {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: right;
}
.iw-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 600;
    text-align: right;
    line-height: 1.2;
}
.iw-status-emoji { font-size: .85rem; line-height: 1; }
.iw-status-text { color: var(--text-dark); }
.iw-status--green  .iw-status-text { color: #1e7e34; }
.iw-status--yellow .iw-status-text { color: #b8860b; }
.iw-status--orange .iw-status-text { color: #c45c00; }
.iw-status--red    .iw-status-text { color: #c0392b; }

/* Compact branded CTA button */
.iw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    margin-top: 12px;
    padding: 8px 14px;
    border: 0;
    border-radius: 7px;
    background: var(--accent-blue);
    color: #fff;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(24, 119, 212, .28);
    transition: background .15s, box-shadow .15s;
}
.iw-btn:hover {
    background: var(--accent-blue-d);
    box-shadow: 0 3px 10px rgba(24, 119, 212, .38);
}
.iw-btn .bi { font-size: 1.1rem; line-height: 1; margin-right: -2px; }

/* ---------------------------------------------------------------------
   Loading spinner overlay (used by JS in later steps)
   --------------------------------------------------------------------- */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.loading-overlay.show { display: flex; }

/* Empty state overlay on the map (no wells match filters) */
.map-empty {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    background: rgba(255,255,255,.95);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(16,42,74,.18);
    padding: 16px 22px;
    text-align: center;
    color: #56657a;
}
.map-empty .bi { font-size: 1.6rem; opacity: .5; display: block; margin-bottom: 6px; }
.map-empty p { margin: 0; font-size: .9rem; font-weight: 500; line-height: 1.4; }
.map-empty small { font-weight: 400; color: #90a0b0; }

/* ---------------------------------------------------------------------
   Responsive
   Desktop = fixed full-height app. Below lg the layout stacks & scrolls:
   the icon sidebar becomes a horizontal scrollable tab bar above the map,
   and the detail panel drops below the map.
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    html, body { height: auto; }
    body.impact-map-page { display: block; overflow: auto; }
    body.impact-map-page #content.impact-map-content { overflow: visible; }
    .app-shell { min-height: 0; }
    .app-body { flex-direction: column; }

    /* Sidebar -> horizontal scrollable tab bar (order it to the very top) */
    .impact-sidebar {
        order: 1;
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px 6px;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-title { display: none; }
    .sidebar-nav { flex-direction: row !important; flex-wrap: nowrap; gap: 0; flex: 0 0 auto; }
    .sidebar-tab {
        width: auto;
        min-width: 82px;
        padding: 8px 6px;
        justify-content: center;
    }
    .sidebar-tab .tab-label { max-width: none; white-space: nowrap; }
    .sidebar-tab.active::before { top: auto; bottom: 0; left: 8px; right: 8px; width: auto; height: 3px; border-radius: 3px; }
    .sidebar-tab-bottom { margin-top: 0; }

    /* Map column above the detail panel */
    .map-column { order: 2; }
    .map-wrap { min-height: 360px; }

    /* Detail panel stacks below the map, full width, natural height */
    .detail-panel {
        order: 3;
        flex: 0 0 auto;
        width: 100%;
        border-right: 0;
        border-top: 1px solid var(--panel-border);
        overflow: visible;
    }

    /* Filter bar: search full width on its own row, dropdowns share the next */
    .filter-bar { flex-wrap: wrap; }
    .search-wrap { max-width: none; flex: 1 1 100%; }
    .filter-selects { width: 100%; margin-left: 0; flex-wrap: wrap; }
    .filter-select { flex: 1 1 0; min-width: 0; }

    /* Stats: two-up grid so labels stay readable */
    .stats-bar {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 14px 22px;
        padding: 14px 18px;
    }
    .stat-item { flex: 1 1 40%; }
}

@media (max-width: 575.98px) {
    .brand-tagline { display: none; }
    .brand-name { font-size: 1.15rem; }
    .brand-img { height: 38px; }
    .stat-item { flex: 1 1 100%; }
    .stat-value { font-size: 1.2rem; }
    .gallery-tab { font-size: .72rem; padding: 7px 12px; }
    .gallery-lb-nav { width: 34px; height: 34px; }
    .gallery-lb-thumb { width: 64px; height: 48px; }
    .filter-select { flex: 1 1 45%; }
}
