:root {
  --primary: #0D2340;      /* deep brand navy — sampled from the «إنجاز» logo */
  --primary-dark: #071A33;
  --primary-light: #1E4272;
  --accent: #C9A24B;       /* metallic gold — the hero accent */
  --accent-dark: #8A6D2B;  /* readable gold for links/text on light */
  --accent-light: #E4C169;
  --gold: #C9A24B;
  --green: #2E9E6B;
  --red: #C0392B;
  --bg: #F6F7FA;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-soft: #64748B;
  --border: #DDE3EA;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 6px 20px rgba(15,23,42,.05);
  --radius: 16px;
}

/* ---------- Dark mode (mirrors the app's dark theme) ---------- */
html[data-theme="dark"] {
  --primary-light: #24568f;
  --accent-dark: #E4C169;          /* readable gold link on dark */
  --bg: #0B1220;
  --surface: #131F33;
  --text: #E6EBF2;
  --text-soft: #93A2B8;
  --border: #26344A;
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 6px 20px rgba(0,0,0,.4);
}
/* Page-chrome surfaces that hard-code white → follow the surface variable.
   Map markers + overlay controls stay light on purpose (they sit over the
   light map tiles). */
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .kv,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .rsel,
html[data-theme="dark"] .hero-btn.outlined,
html[data-theme="dark"] .search-box input { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .main-bg { background: var(--bg); }
html[data-theme="dark"] .pcard .thumb,
html[data-theme="dark"] .detail-cover { background: #1B2942; }
html[data-theme="dark"] .tile .count { background: #0B1220; color: var(--accent-light); }
html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--text); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[lang="ar"] body, [lang="ar"] { font-family: 'Cairo', 'Tajawal', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Boot splash (before React mounts) ---------- */
.boot-splash {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff;
}
.boot-logo { font-family: 'Cairo'; font-weight: 800; font-size: 44px; letter-spacing: 1px; }
.boot-logo-img { width: 132px; height: 132px; border-radius: 28px; box-shadow: 0 10px 34px rgba(0,0,0,.38); }
.boot-sub { opacity: .85; font-size: 16px; }
.boot-spinner, .spinner {
  width: 34px; height: 34px; margin-top: 14px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.spinner { border-color: rgba(30,58,138,.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 900;
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 12px rgba(15,23,42,.15);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  background: rgba(255,255,255,.14); display: block; flex: none;
}
.brand-name { font-family: 'Cairo'; font-weight: 800; font-size: 20px; line-height: 1; }
.brand-tag { font-size: 12px; opacity: .8; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px;
  color: rgba(255,255,255,.85); transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active { background: #fff; color: var(--primary); }
.lang-toggle {
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px;
  padding: 8px 12px; font-weight: 700; font-size: 14px;
}
.lang-toggle:hover { background: rgba(255,255,255,.24); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.lang-toggle.icon { font-size: 16px; padding: 7px 10px; line-height: 1; }

/* ---------- Primary nav: top on desktop, bottom bar on mobile ---------- */
.bottom-nav { display: none; }
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .head-actions { margin-inline-start: auto; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0,0,0,.10);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 2px; color: var(--text-soft); font-size: 11px; font-weight: 700; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .bn-ic { font-size: 21px; line-height: 1; }
  .content { padding-bottom: 82px; }
  .footer { margin-bottom: 62px; }
}
html[data-theme="dark"] .bottom-nav a.active { color: var(--accent-light); }

.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
/* Home = full-bleed portrait: cancel the container's padding/max-width. */
.content.content-full { max-width: none; padding: 0; }
.footer {
  background: var(--primary-dark); color: rgba(255,255,255,.75);
  text-align: center; padding: 22px 18px; font-size: 14px;
}
.footer strong { color: #fff; }

/* ---------- Generic bits ---------- */
.page-title { font-family: 'Cairo'; font-weight: 800; font-size: 26px; margin: 4px 0 6px; }
.page-sub { color: var(--text-soft); margin: 0 0 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.center-msg { text-align: center; color: var(--text-soft); padding: 60px 20px; }
.loading-wrap { display: grid; place-items: center; padding: 70px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--primary); color: #fff; border: 0; border-radius: 12px;
  padding: 12px 20px; font-weight: 700; font-size: 15px;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--bg); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 999px; font-weight: 700; font-size: 13px; color: #fff;
}

.progress { height: 8px; border-radius: 999px; background: #E9EDF5; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

/* ---------- Home: FULL (uncropped) President portrait on a light background,
   with the two actions in a proportionate column on its right (RTL). ---------- */
.hero-portrait {
  min-height: calc(100vh - 64px); background: #F1F4F8; /* near-white gray */
  display: flex; align-items: center; justify-content: center;
  gap: clamp(20px, 5vw, 60px); padding: 28px clamp(20px, 5vw, 56px); overflow: hidden;
}
/* The portrait: shown COMPLETE (contain), never cropped. */
.hero-bg {
  flex: 0 1 auto;
  max-height: calc(100vh - 130px); max-width: min(56%, 620px);
  width: auto; height: auto; object-fit: contain;
}
/* Right-hand panel: buttons + disclaimer, proportionate width. */
.hero-side {
  flex: 0 0 auto; width: min(400px, 40%);
  display: flex; flex-direction: column; gap: 14px;
}
.hero-actions-col { display: flex; flex-direction: column; gap: 14px; }
.hero-btn {
  display: flex; align-items: center; gap: 14px; text-align: start; width: 100%;
  padding: 16px 18px; border-radius: 18px; border: 1.5px solid transparent;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.hero-btn:hover { transform: translateY(-2px); }
.hero-btn.filled { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 10px 26px rgba(30,58,138,.28); }
.hero-btn.filled:hover { background: var(--primary-light); }
.hero-btn.outlined { background: #fff; border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }
.hero-btn.outlined:hover { background: #EEF2FA; }
.hero-btn .hb-ic { font-size: 24px; flex: none; }
.hero-btn .hb-txt { display: flex; flex-direction: column; line-height: 1.3; }
.hero-btn .hb-txt b { font-family: 'Cairo'; font-weight: 800; font-size: 17px; }
.hero-btn .hb-txt small { font-size: 13px; opacity: .82; }
.hero-disclaimer {
  margin: 4px 2px 0; text-align: start; color: var(--text-soft);
  font-size: 12.5px; font-weight: 600; line-height: 1.6;
}
/* Narrow screens: stack — portrait on top (full), buttons below. */
@media (max-width: 820px) {
  .hero-portrait { flex-direction: column-reverse; justify-content: center; gap: 22px; padding: 22px 16px; }
  .hero-bg { max-width: 88%; max-height: 52vh; }
  .hero-side { width: min(440px, 94%); }
  .hero-disclaimer { text-align: center; }
}

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); text-align: center;
}
.stat .num { font-family: 'Cairo'; font-weight: 800; font-size: 30px; color: var(--primary); }
.stat .lbl { color: var(--text-soft); font-size: 14px; margin-top: 2px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 14px; }
.section-head h2 { font-family: 'Cairo'; font-weight: 800; font-size: 22px; margin: 0; }
.section-head a { color: var(--primary); font-weight: 700; font-size: 14px; }

/* ---------- Project grid + card ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- Sectors ---------- */
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sector-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, border-color .12s;
}
.sector-card:hover { transform: translateY(-2px); border-color: var(--primary-light); }
.sector-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; flex: none; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.sector-name { font-weight: 800; font-size: 16px; font-family: 'Cairo'; }
.sector-meta { color: var(--text-soft); font-size: 13px; margin-top: 3px; }

/* ---------- Reforms ---------- */
.reform-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.reform-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.reform-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,23,42,.12); }
.reform-cover { height: 150px; background: #E9EDF5 center/cover no-repeat; }
.reform-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.reform-body h3 { margin: 0; font-size: 17px; font-weight: 800; font-family: 'Cairo'; line-height: 1.4; }
.reform-body p { margin: 0; color: var(--text-soft); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reform-min { font-size: 13px; color: var(--text-soft); font-weight: 700; }
html[data-theme="dark"] .reform-cover { background: #1B2942; }

/* ---------- National impact / achievements summary ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 6px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.kpi-card b { display: block; font-size: 26px; font-family: 'Cairo'; font-weight: 800; line-height: 1.1; }
.kpi-card span { color: var(--text-soft); font-size: 13px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ach-tile {
  background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--ac, var(--primary));
  border-radius: 12px; padding: 14px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.ach-tile .ach-ic { font-size: 26px; line-height: 1; }
.ach-tile b { font-size: 22px; font-family: 'Cairo'; font-weight: 800; color: var(--ac, var(--primary)); }
.ach-tile .ach-lb { font-size: 13px; color: var(--text-soft); font-weight: 700; }

/* ---------- Notifications feed ---------- */
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-card { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.notif-card.clickable { cursor: pointer; transition: border-color .12s, transform .12s; }
.notif-card.clickable:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.notif-img { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex: none; background: #E9EDF5; }
.notif-body { flex: 1; min-width: 0; }
.notif-head { display: flex; align-items: center; gap: 8px; }
.notif-head b { font-family: 'Cairo'; font-weight: 800; font-size: 16px; }
.notif-time { margin-inline-start: auto; color: var(--text-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.notif-body p { margin: 6px 0 0; color: var(--text-soft); font-size: 14px; line-height: 1.6; }
html[data-theme="dark"] .notif-img { background: #1B2942; }

/* ---------- Follow button ---------- */
.follow-btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 999px;
  padding: 9px 18px; font-weight: 800; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--primary); background: var(--surface); color: var(--primary);
  transition: background .12s, color .12s;
}
.follow-btn.on { background: var(--primary); color: #fff; }
.follow-btn:disabled { opacity: .6; }
.follow-btn .fb-count { background: rgba(0,0,0,.12); border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.follow-btn.on .fb-count { background: rgba(255,255,255,.22); }
html[data-theme="dark"] .follow-btn { border-color: var(--accent); color: var(--accent-light); }
html[data-theme="dark"] .follow-btn.on { background: var(--accent); color: #0B1220; }
.detail-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; }

/* ---------- Settings ---------- */
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 16px; margin-bottom: 16px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 700; font-size: 15px; }
.set-row .set-ic { font-size: 20px; width: 24px; text-align: center; }
.set-row.link { cursor: pointer; }
.set-row .set-chev { margin-inline-start: auto; color: var(--text-soft); font-size: 22px; }
.seg { margin-inline-start: auto; display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-soft); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; font-family: inherit; cursor: pointer; }
.seg button.on { background: var(--primary); color: #fff; }
html[data-theme="dark"] .seg button.on { background: var(--accent); color: #0B1220; }
.set-title { font-family: 'Cairo'; font-weight: 800; font-size: 16px; padding: 12px 0 8px; }
.set-text { color: var(--text); font-size: 14.5px; line-height: 1.8; white-space: pre-line; padding-bottom: 12px; }
.set-contact { display: block; padding: 10px 0; font-weight: 700; color: var(--accent-dark); border-bottom: 1px solid var(--border); }
.set-contact:last-child { border-bottom: 0; }
.mini-map { height: 300px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.site-list { display: flex; flex-direction: column; gap: 10px; }
.site-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.site-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--bg); flex: none; }
.site-info { min-width: 0; }
.site-info b { font-size: 15px; font-family: 'Cairo'; font-weight: 800; }
.site-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--text-soft); }
.site-meta .sm-prog { font-weight: 800; color: var(--primary); }
.pcard { display: flex; flex-direction: column; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,23,42,.12); }
.pcard .thumb { aspect-ratio: 16/10; background: #E9EDF5 center/cover no-repeat; position: relative; }
.pcard .thumb .cat-tag {
  position: absolute; inset-inline-start: 10px; top: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff;
}
.pcard .thumb .no-img { width:100%; height:100%; display:grid; place-items:center; color:#9aa6bd; font-size:34px; }
.pcard .body { padding: 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pcard .body h3 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.4; }
.pcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); margin-top: auto; }

/* ---------- Region browse ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; font-size: 15px; }
.breadcrumb a { color: var(--primary); font-weight: 700; }
.breadcrumb .sep { color: var(--text-soft); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; transition: transform .12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--primary-light); }
.tile .name { font-weight: 700; font-size: 16px; }
.tile .count { background: var(--bg); border-radius: 999px; padding: 3px 12px; font-weight: 700; color: var(--primary); font-size: 14px; }

.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.mini-stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); }
.mini-stat b { font-family: 'Cairo'; font-size: 20px; }
.mini-stat span { color: var(--text-soft); font-size: 13px; margin-inline-start: 6px; }

/* ---------- Map ---------- */
.map-wrap { position: relative; }
#injaz-map { height: 74vh; min-height: 460px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 1; }
.map-filters { margin-bottom: 14px; }
.leaflet-popup-content { margin: 12px 14px; font-family: 'Cairo','Tajawal',sans-serif; }
.map-popup h4 { margin: 0 0 6px; font-size: 15px; }
.map-popup .p-badge { font-size: 12px; }
.map-popup a { display:inline-block; margin-top:8px; color: var(--primary); font-weight:700; }
.marker-dot {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* ---------- Rich project markers (category emoji + photo pins) ---------- */
.mk-pin {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 3px solid var(--mkc, #0D2340);
  box-shadow: 0 2px 6px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center;
}
.mk-pin::after {
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--mkc, #0D2340);
}
.mk-emoji { font-size: 17px; line-height: 1; }
.mk-photo {
  position: relative; width: 50px; height: 50px; border-radius: 12px;
  border: 3px solid var(--mkc, #0D2340); box-shadow: 0 3px 8px rgba(0,0,0,.4); background: #e9edf5;
}
.mk-photo-img { position: absolute; inset: 0; border-radius: 9px; background-size: cover; background-position: center; }
.mk-photo::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--mkc, #0D2340);
}
.mk-photo-badge {
  position: absolute; bottom: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--mkc, #0D2340); display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.3); z-index: 2;
}
.map-popup .mp-img { width: 100%; height: 118px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; display: block; }

/* ---------- Region filter (cascading selects) ---------- */
.region-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rsel {
  font-family: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; color: var(--text); min-width: 150px;
}
.rsel:disabled { opacity: .55; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Map overlay controls ---------- */
.map-ctrls { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.map-ctrls button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; font-size: 19px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.map-ctrls button.on { background: var(--primary); border-color: var(--primary); }
.map-count {
  position: absolute; bottom: 12px; left: 12px; z-index: 5; background: #fff; color: var(--primary);
  font-weight: 800; font-size: 12px; padding: 6px 12px; border-radius: 16px; box-shadow: var(--shadow);
}
.map-legend {
  position: absolute; bottom: 52px; left: 12px; z-index: 5; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; min-width: 130px;
}
.map-legend b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-soft); }
.map-legend .lg-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.map-legend .lg-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* ---------- Project detail ---------- */
.detail-cover { width: 100%; max-height: 380px; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius); background:#E9EDF5; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 18px 0 6px; flex-wrap: wrap; }
.detail-head h1 { font-family: 'Cairo'; font-weight: 800; font-size: 27px; margin: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin: 18px 0; }
.kv { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.kv .k { color: var(--text-soft); font-size: 13px; }
.kv .v { font-weight: 700; font-size: 16px; margin-top: 2px; }
.detail-section { margin-top: 26px; }
.detail-section h2 { font-family: 'Cairo'; font-weight: 800; font-size: 20px; margin: 0 0 12px; }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content:''; position:absolute; inset-inline-start: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 18px; }
.tl-item::before { content:''; position:absolute; inset-inline-start: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border); }
.tl-item .tl-date { color: var(--text-soft); font-size: 13px; }
.tl-item h4 { margin: 2px 0 4px; font-size: 16px; }
.tl-item img { border-radius: 12px; margin-top: 8px; max-height: 260px; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.gallery img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }

/* ---------- Media tiles (image + video) ---------- */
.media-tile { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; cursor: pointer; background: #0d2340; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px;
  background: linear-gradient(135deg, #14284a, #0d2340); }
.media-play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; display: grid; place-items: center;
  color: #fff; font-size: 18px; background: rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%; pointer-events: none; }

/* ---------- Elegant stat cards (beneficiaries / quantity / value) ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin: 6px 0 14px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-inline-start: 4px solid var(--sc, var(--primary));
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card .sc-icon { font-size: 22px; line-height: 1; }
.stat-card .sc-val { font-family: 'Cairo'; font-weight: 800; font-size: 26px; color: var(--sc, var(--primary)); margin-top: 6px; }
.stat-card .sc-label { color: var(--text-soft); font-size: 13px; margin-top: 2px; }

/* ---------- Video modal ---------- */
.vmodal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 1000;
  display: grid; place-items: center; padding: 20px; }
.vmodal { position: relative; width: min(920px, 96vw); }
.vmodal-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.vmodal-frame iframe, .vmodal-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vmodal-close { position: absolute; top: -14px; inset-inline-end: -6px; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: #fff; color: #111; font-size: 18px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.vmodal-cap { color: #fff; text-align: center; margin-top: 10px; font-size: 14px; }

/* ---------- Search ---------- */
.search-box { display: flex; gap: 10px; margin-bottom: 20px; }
.search-box input {
  flex: 1; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border);
  font-size: 16px; font-family: inherit; background: #fff; box-shadow: var(--shadow);
}
.search-box input:focus { outline: 2px solid var(--primary-light); border-color: transparent; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.result-row:hover { background: var(--bg); }
.result-row .r-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .brand-tag { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 30px 20px; }
  .hero h1 { font-size: 26px; }
  .nav a { padding: 7px 10px; font-size: 14px; }
  .content { padding: 16px 12px 50px; }
}
