/* ═══════════════════════════════════════════════════════════
   EXPLOITS MINISTRIES — INSTITUTIONS DEPT
   app.css — Shared Styles
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & ROOT ── */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --blue:    #1A3A8F;
  --blue2:   #2855CC;
  --blue3:   #0D1B3E;
  --blue4:   #7BA7FF;
  --orange:  #E8522A;
  --orange2: #F27340;
  --orange3: #F5A07A;
  --green:   #10C87A;
  --green2:  #0DA865;
  --red:     #E84040;
  --red2:    #FF6B6B;
  --yellow:  #F5C518;
  --bg:      #060D1F;
  --bg2:     #0D1B3E;
  --bg3:     #111827;
  --bg4:     rgba(255,255,255,.04);
  --txt:     rgba(255,255,255,.92);
  --txt2:    rgba(255,255,255,.58);
  --txt3:    rgba(255,255,255,.28);
  --bdr:     rgba(255,255,255,.09);
  --bdr2:    rgba(255,255,255,.17);
  --safe-t:  env(safe-area-inset-top,    0px);
  --safe-b:  env(safe-area-inset-bottom, 0px);
  --safe-l:  env(safe-area-inset-left,   0px);
  --safe-r:  env(safe-area-inset-right,  0px);
  --nav-h:   60px;
  --top-h:   56px;
  --radius:  14px;
}
html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Lato', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}

/* ── BACKGROUND FX ── */
.bg-fx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.bg-fx::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%,  rgba(26,58,143,.30) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 85%,  rgba(232,82,42,.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(16,200,122,.07) 0%, transparent 60%);
}
.bg-fx::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* ── TOP BAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(var(--top-h) + var(--safe-t));
  padding-top: var(--safe-t);
  background: rgba(6,13,31,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center;
  padding-left: 16px; padding-right: 16px;
  gap: 10px; z-index: 100;
}
.topbar-logo { display: flex; align-items: center; gap: 8px; }
.topbar-logo img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(232,82,42,.5)); }
.topbar-logo-title { font-size: 14px; font-weight: 900; color: var(--txt); }
.topbar-logo-sub   { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--orange); }
.topbar-spacer { flex: 1; }
.topbar-title  { font-size: 15px; font-weight: 900; color: var(--txt); flex: 1; text-align: center; }
.topbar-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid var(--bdr);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt2); cursor: pointer; transition: all .2s; flex-shrink: 0;
  position: relative;
}
.topbar-icon:hover { background: rgba(255,255,255,.10); color: var(--txt); }
.topbar-icon svg   { width: 18px; height: 18px; }
.topbar-badge-dot  {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); border: 2px solid var(--bg);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(6,13,31,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bdr);
  display: flex; align-items: center;
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px;
  cursor: pointer; transition: all .2s;
  border: none; background: none;
  color: var(--txt3); position: relative;
}
.nav-item.active { color: var(--orange); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.nav-item .nav-pip {
  position: absolute; top: 6px; right: calc(50% - 16px);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); border: 2px solid var(--bg);
  display: none;
}
.nav-item .nav-pip.show { display: block; }

/* ── MAIN CONTENT ── */
.main {
  position: relative; z-index: 1;
  padding-top: calc(var(--top-h) + var(--safe-t) + 8px);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  min-height: 100dvh;
}
.page-wrap { padding: 16px 16px 24px; max-width: 680px; margin: 0 auto; }

/* ── SECTION ── */
.section { display: none; }
.section.active { display: block; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--bg4);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 14px 14px;
  position: relative; overflow: hidden;
  transition: transform .2s;
  active: transform translateY(-2px);
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.blue::before    { background: linear-gradient(90deg, var(--blue),  var(--blue2)); }
.stat-card.orange::before  { background: linear-gradient(90deg, var(--orange), var(--orange2)); }
.stat-card.green::before   { background: linear-gradient(90deg, var(--green2), var(--green)); }
.stat-card.yellow::before  { background: linear-gradient(90deg, #B8860B, var(--yellow)); }
.stat-card.purple::before  { background: linear-gradient(90deg, #6B3FA0, #9B59B6); }
.stat-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-icon.blue   { background: rgba(26,58,143,.22); color: var(--blue4); }
.stat-icon.orange { background: rgba(232,82,42,.20); color: var(--orange3); }
.stat-icon.green  { background: rgba(16,200,122,.18); color: var(--green); }
.stat-icon.yellow { background: rgba(245,197,24,.18); color: var(--yellow); }
.stat-icon.purple { background: rgba(107,63,160,.22); color: #C39BD3; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-val  { font-size: 28px; font-weight: 900; line-height: 1; margin-bottom: 2px; }
.stat-lbl  { font-size: 10px; font-weight: 700; color: var(--txt3); text-transform: uppercase; letter-spacing: .5px; }
.stat-sub  { font-size: 10px; color: var(--txt3); margin-top: 2px; }

/* ── CARDS ── */
.card {
  background: var(--bg4);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card.orange-accent { border-left: 3px solid var(--orange); }
.card.blue-accent   { border-left: 3px solid var(--blue2); }
.card.green-accent  { border-left: 3px solid var(--green); }
.card-title {
  font-size: 13px; font-weight: 700; color: var(--txt);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.card-title svg { width: 14px; height: 14px; color: var(--txt3); }

/* ── SECTION HEADER ── */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.section-hdr h2 { font-size: 20px; font-weight: 900; color: var(--txt); }
.section-hdr p  { font-size: 11px; color: var(--txt3); margin-top: 2px; }

/* ── PROGRESS ── */
.progress-bar   { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 3px; transition: width .6s ease; }
.progress-fill.low    { background: linear-gradient(90deg, var(--red),    #FF8A8A); }
.progress-fill.mid    { background: linear-gradient(90deg, var(--orange),  var(--orange2)); }
.progress-fill.high   { background: linear-gradient(90deg, var(--green2),  var(--green)); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.badge.green  { background: rgba(16,200,122,.14); border: 1px solid rgba(16,200,122,.28); color: var(--green); }
.badge.orange { background: rgba(232,82,42,.14);  border: 1px solid rgba(232,82,42,.28);  color: var(--orange3); }
.badge.blue   { background: rgba(26,58,143,.20);  border: 1px solid rgba(26,58,143,.35);  color: var(--blue4); }
.badge.grey   { background: rgba(255,255,255,.07); border: 1px solid var(--bdr);          color: var(--txt3); }
.badge.red    { background: rgba(232,64,64,.14);  border: 1px solid rgba(232,64,64,.28);  color: var(--red2); }
.blink { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity:1 } 50% { opacity:.3 } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border: none; border-radius: 11px;
  font-family: 'Lato', sans-serif;
  font-size: 14px; font-weight: 900; cursor: pointer;
  transition: all .2s; letter-spacing: .3px;
  -webkit-appearance: none; white-space: nowrap;
}
.btn.full { width: 100%; }
.btn svg  { width: 15px; height: 15px; flex-shrink: 0; }
.btn-blue   { background: linear-gradient(135deg, var(--blue),   var(--blue2));   color: #fff; box-shadow: 0 4px 16px rgba(26,58,143,.38); }
.btn-orange { background: linear-gradient(135deg, var(--orange), var(--orange2)); color: #fff; box-shadow: 0 4px 16px rgba(232,82,42,.38); }
.btn-green  { background: linear-gradient(135deg, var(--green2), var(--green));   color: #003322; box-shadow: 0 4px 16px rgba(16,200,122,.30); }
.btn-ghost  { background: rgba(255,255,255,.07); border: 1px solid var(--bdr); color: var(--txt2); }
.btn-danger { background: rgba(232,64,64,.16); border: 1px solid rgba(232,64,64,.28); color: var(--red2); }
.btn:hover  { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }

/* ── FORM ── */
.fg { margin-bottom: 14px; }
.fl {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--txt3); margin-bottom: 5px;
}
.fi, .fs {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,.07);
  border: 1.5px solid var(--bdr);
  border-radius: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 15px; color: var(--txt);
  outline: none; transition: all .2s;
  -webkit-appearance: none;
}
.fi::placeholder { color: var(--txt3); }
.fi:focus, .fs:focus {
  border-color: rgba(232,82,42,.55);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 3px rgba(232,82,42,.10);
}
.fi.blue:focus  { border-color: rgba(26,58,143,.55); box-shadow: 0 0 0 3px rgba(26,58,143,.12); }
.fi.green:focus { border-color: rgba(16,200,122,.45); box-shadow: 0 0 0 3px rgba(16,200,122,.10); }
.fs option      { background: #111827; color: #fff; }
textarea.fi     { resize: vertical; min-height: 88px; line-height: 1.5; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input-wrap { position: relative; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--txt3); cursor: pointer; padding: 4px;
  display: flex; align-items: center;
}
.eye-btn svg { width: 18px; height: 18px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.70);
  z-index: 500; display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding-bottom: var(--safe-b);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg3);
  border: 1px solid var(--bdr2);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 680px;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,.60);
  animation: slideUp .28s cubic-bezier(.34,1.2,.64,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.20); margin: 10px auto 0;
}
.modal-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 900; color: var(--txt); }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: rgba(255,255,255,.08);
  color: var(--txt2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  transition: all .2s;
}
.modal-close:hover { background: rgba(255,255,255,.13); color: var(--txt); }
.modal-body   { padding: 16px 18px; }
.modal-footer { padding: 12px 18px 16px; border-top: 1px solid var(--bdr); display: flex; gap: 8px; justify-content: flex-end; }

/* ── LIST ITEMS ── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; transition: all .2s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255,255,255,.02); }
.list-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900;
}
.list-avatar.blue   { background: rgba(26,58,143,.22);  color: var(--blue4); }
.list-avatar.orange { background: rgba(232,82,42,.20);  color: var(--orange3); }
.list-avatar.green  { background: rgba(16,200,122,.18); color: var(--green); }
.list-body  { flex: 1; min-width: 0; }
.list-title { font-size: 14px; font-weight: 700; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub   { font-size: 11px; color: var(--txt3); margin-top: 2px; }
.list-right { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

/* ── MESSAGES ── */
.msg-bubble {
  padding: 10px 14px; border-radius: 14px;
  max-width: 85%; margin-bottom: 10px; line-height: 1.55;
  font-size: 13px;
}
.msg-bubble.in  { background: rgba(255,255,255,.07); border: 1px solid var(--bdr); color: var(--txt); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble.out { background: linear-gradient(135deg, var(--orange), var(--orange2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; color: var(--txt3); margin-bottom: 4px; }

/* ── EMPTY STATE ── */
.empty-state { padding: 40px 20px; text-align: center; color: var(--txt3); }
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 12px; display: block; opacity: .3; }
.empty-state h3  { font-size: 15px; font-weight: 700; margin-bottom: 5px; color: var(--txt2); }
.empty-state p   { font-size: 13px; line-height: 1.5; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(10,15,26,.97);
  border: 1px solid var(--bdr2);
  color: var(--txt); padding: 10px 20px;
  border-radius: 40px; font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 28px rgba(0,0,0,.50);
  z-index: 9999; transition: transform .3s cubic-bezier(.34,1.2,.64,1);
  white-space: nowrap; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok   { background: rgba(16,200,122,.90);  color: #002211; border-color: transparent; }
.toast.er   { background: rgba(232,64,64,.90);   color: #fff;    border-color: transparent; }
.toast.info { background: rgba(26,58,143,.92);   color: #fff;    border-color: transparent; }

/* ── SPINNER ── */
.spin {
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.90);
  border-radius: 50%; animation: sp .6s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ── INSTALL BANNER ── */
.install-banner {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b));
  left: 0; right: 0;
  background: rgba(13,27,62,.97);
  border-top: 1px solid rgba(232,82,42,.28);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 200;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.34,1.2,.64,1);
  backdrop-filter: blur(16px);
}
.install-banner.show { transform: translateY(0); }
.install-logo { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: rgba(232,82,42,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.install-logo img { width: 30px; height: 30px; object-fit: contain; }
.install-text { flex: 1; min-width: 0; }
.install-text strong { font-size: 13px; font-weight: 900; color: var(--txt); display: block; }
.install-text span   { font-size: 11px; color: var(--txt3); }
.install-actions { display: flex; gap: 7px; flex-shrink: 0; }
.ibtn { padding: 8px 14px; border-radius: 8px; font-family: 'Lato', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; border: none; transition: all .2s; }
.ibtn.go  { background: linear-gradient(135deg, var(--orange), var(--orange2)); color: #fff; }
.ibtn.no  { background: rgba(255,255,255,.08); color: var(--txt3); }

/* ── OFFLINE BANNER ── */
.offline-bar {
  display: none;
  background: rgba(245,197,24,.10);
  border-bottom: 1px solid rgba(245,197,24,.20);
  padding: 8px 16px; text-align: center;
  font-size: 12px; font-weight: 700; color: rgba(245,197,24,.85);
}
.offline-bar.show { display: block; }

/* ── CHARTS ── */
.chart-wrap { position: relative; height: 200px; }

/* ── REPORT STAT INPUTS ── */
.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rpt-stat {
  background: var(--bg4); border: 1px solid var(--bdr);
  border-radius: 11px; padding: 14px; text-align: center;
}
.rpt-stat label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--txt3); display: block; margin-bottom: 6px; }
.rpt-stat input {
  width: 100%; background: none; border: none;
  border-bottom: 2px solid var(--bdr);
  font-family: 'Lato', sans-serif; font-size: 28px; font-weight: 900;
  color: var(--orange); text-align: center;
  outline: none; padding: 4px 0; transition: all .2s;
}
.rpt-stat input:focus { border-color: var(--orange); }

/* ── TARGET CARD ── */
.target-card {
  background: var(--bg4); border: 1px solid var(--bdr);
  border-radius: 11px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  transition: all .2s; margin-bottom: 8px;
}
.target-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.target-dot.reached { background: var(--green); box-shadow: 0 0 8px rgba(16,200,122,.5); }
.target-dot.pending { background: rgba(255,255,255,.20); }

/* ── CHAPTER CARD ── */
.chapter-card {
  background: var(--bg4); border: 1px solid var(--bdr);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 12px; transition: all .2s;
}
.chapter-card:hover { border-color: var(--bdr2); }

/* ── COVERAGE RING ── */
.cov-ring { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.cov-ring svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.cov-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cov-ring-pct  { font-size: 20px; font-weight: 900; }
.cov-ring-lbl  { font-size: 8px; font-weight: 700; color: var(--txt3); text-transform: uppercase; letter-spacing: .5px; }

/* ── RESPONSIVE ── */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .page-wrap  { padding: 20px 24px 28px; }
}
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .rpt-grid   { grid-template-columns: 1fr 1fr; }
}
