/* ---------------------------------------------------------------------------------
2. css/components.css
--------------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border: 1px solid var(--line);
  background: rgba(15, 26, 46, .72);
  backdrop-filter: blur(10px);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
}

.topbar h1 {
  font-size: 28px;
  font-weight: 700;
}

.topbar span {
  font-size: 15px;
}

.topbar nav a {
  font-size: 18px;
  font-weight: 600;
  padding: 10px 16px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 197, 94, .95), rgba(16, 185, 129, .5));
  box-shadow: 0 10px 25px rgba(34, 197, 94, .2);
}

.brand h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .2px;
}

.brand span {
  font-size: 16px;
  color: var(--muted);
}


.btn {
  padding: 12px 22px;
  font-size: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(16, 31, 56, .8);
  color: var(--text);
  cursor: pointer;
  transition: .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, .35)
}

.btn.primary {
  background: linear-gradient(135deg, rgba(34, 197, 94, .95), rgba(16, 185, 129, .75));
  border-color: transparent;
  color: #04140a;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
}

.pill {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 26, 46, .55);
  font-weight: 600px;
}

.pill.ok {
  border-color: #05B615;
  color: #bff2cd;
}

.pill.warn {
  border-color: #f59e0b;
  color: #fde68a;
}

.pill.bad {
  border-color: rgba(239, 68, 68, .45);
  color: #fecaca;
}

.pill.launched {
  background: rgba(34, 197, 94, .15);
  color: #22c55e;
}

.pill.relaunched {
  background: rgba(59, 130, 246, .15);
  color: #3b82f6;
}

.pill.not-launched {
  background: rgba(156, 163, 175, .2);
  color: #9ca3af;
}

.pill.disbanded {
  background: rgba(239, 68, .15);
  color: #ef4444;
}

.card {
  border: 1px solid var(--line);
  background: rgba(16, 31, 56, .72);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  overflow: visible;
}

.card h3 {
  font-size: 28px;
  font-weight: 700;
}

.card .hd {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line)
}

.card .bd {
  padding: 28px;
}

/* Allow dropdowns to escape card body */
.card,
.card .bd {
  overflow: visible;
}

.lobby-card strong {
  font-size: 24px;
  font-weight: 700;
}

/* Allow native select dropdowns to escape the Filters card */
.card-filters {
  overflow: visible;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px
}

.kpi {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(16, 31, 56, .62);
  transition: .2s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(5, 182, 21, .45);
}

.kpi .n {
  font-size: 20px;
  font-weight: 800;
}

.kpi .t {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi .s {
  font-size: 11px;
  opacity: 0.65;
  margin-top: 2px;
}

/* Slight emphasis for filter-driven KPIs */
#kpiPosts,
#kpiPending {
  border-color: rgba(5, 182, 21, 0.35);
  /* subtle green */
}

.input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 18, 32, .6);
  color: var(--text);
  outline: none;
}

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin: 10px 0 6px;
}

/* Emphasize primary filter label */
label[for="constituencySelect"] {
  font-weight: 600;
}

.feed-item {
  display: grid;
  font-size: 20px;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 18, 32, .35);
  transition: .2s ease;
}

.feed-item:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, .26);
}

.feed-meta {
  font-size: 12px;
  color: var(--muted);
}

.thumbrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  width: 52px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
  background-size: cover;
  background-position: center;
}

/* Pending items should stand out slightly */
.feed-item[data-status="Submitted"] {
  border-left: 4px solid rgba(255, 180, 80, 0.9);
  background: rgba(255, 180, 80, 0.06);
}

.feed-item[data-status="Approved"] {
  border-left: 4px solid rgba(5, 182, 21, 0.7);
}

/* Activity feed: keep descriptions scannable */
/* Activity feed: keep descriptions scannable */
.feed-item .muted {
  overflow: visible;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  /* Standard property (future / spec-compliant) */
  line-clamp: 2;
}

/* --- Form controls: ensure selects are readable and not collapsed --- */
select,
.input,
textarea {
  font-size: 14px;
  line-height: 1.2;
  min-height: 42px;
  padding: 10px 12px;
}

/* Ensure select retains its native arrow and doesn't collapse */
select {
  appearance: auto;
  /* restores native control look if a reset broke it */
  -webkit-appearance: auto;
  -moz-appearance: auto;
  background-color: rgba(11, 18, 32, 0.6);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  position: relative;
  z-index: 10;
}

/* Improve focus so it doesn't feel "thin" */
select:focus,
textarea:focus,
.input:focus {
  outline: none;
  border-color: rgba(5, 182, 21, 0.55);
  /* ActionSA green tint */
  box-shadow: 0 0 0 3px rgba(5, 182, 21, 0.18);
}

/* Allow native select dropdowns to escape the Filters body content */
.card-filters .bd {
  overflow: visible;
}

/* CRITICAL: allow native selects to escape dashboard layout */
.layout {
  overflow: visible;
}

/* Branch selector should be compact, not full-width */
.branch-row {
  display: flex;
  flex-direction: column;
  max-width: 250px;
  /* adjust 240–320px if you prefer */
}

.branch-row select {
  width: 100%;
}

/* Shared page width – same as dashboard & approvals */
.container {
  max-width: 1450px;
  margin: 0 auto;
  padding: 16px;
}

.muted {
  font-size: 15px;
}

/* Helper text inside forms should match label/input size */
.bd .muted {
  font-size: 0.8rem;
  line-height: 1.4;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* =========================================================
   Panels and lists (shared vertical rhythm)
   ========================================================= */

.panel {
  margin-bottom: 24px;
}

.card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .card-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* RC-only links shown but inactive */
a.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Ensure form rows use full available width */
.form-row.branch-row select {
  width: 100%;
  max-width: none;
}

.form-row.branch-row {
  display: flex;
  flex-wrap: wrap;
  /* allows hint to drop below and expand */
}

.form-row.branch-row select {
  width: 100%;
}

.card {
  position: relative;
  z-index: 1;
}

.form-row {
  position: relative;
  z-index: 10;
}

.form-row select {
  position: relative;
  z-index: 20;
}

.card,
.card .bd {
  overflow: visible !important;
}

.container {
  overflow: visible;
}

.form-row {
  overflow: visible;
}

/* -------------------------------------------------------
   SUBMIT PAGE: dropdown stability and form layering
   -------------------------------------------------------
   Purpose:
   - Ensure native select dropdowns are not clipped or hidden
   - Keep Add Activity form controls above surrounding card layers
   - Scope changes only to submit.html via .submit-card
*/

.submit-card,
.submit-card .bd,
.submit-card .form-row {
  position: relative;
  overflow: visible !important;
}

/* Keep the submit form above nearby card/card-shadow layers */
.submit-card {
  z-index: 20;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  contain: none !important;
}

/* Keep native select controls visually stable */
.submit-card select {
  position: relative;
  z-index: 50;
  width: 100%;
}

/* Helper text used below form controls */
.submit-card .helper-text {
  font-size: 1px;
  margin-top: 6px;
  line-height: 1.5;
}

/* -------------------------------------------------------
   SUBMIT PAGE: Activity Scope and Submit cards
   -------------------------------------------------------
   Purpose:
   - Keep scope controls separate from activity details
   - Prevent the Add Activity card from visually crowding dropdowns
*/

.scope-card {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.submit-card .bd {
  padding: 28px;
}

.scope-card .bd,
.scope-card .form-row {
  overflow: visible;
}

.scope-card select {
  width: 100%;
  min-height: 42px;
}

.scope-card .helper-text,
.submit-card .helper-text {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}

.submit-card {
  position: relative;
  z-index: 1;
}

.submit-card .hd strong {
  font-size: 24px;
  font-weight: 700;
}

.submit-card label {
  font-size: 16px;
  font-weight: 600;
}

.submit-card .helper-text,
.activity-scope .helper-text {
    font-size: 15px;
    line-height: 1.5;
}

.submit-card input,
.submit-card select,
.submit-card textarea {
    font-size: 16px;
}

/* -------------------------------------------------------
   SUBMIT PAGE: Activity scope controls
   -------------------------------------------------------
   Purpose:
   - Keeps Constituency and Branch/Ward dropdowns outside card layers
   - Avoids native select dropdowns being trapped behind cards
   - Matches visual style without using .card
*/

.activity-scope {
  position: relative;
  z-index: 50;
  padding: 0;
  overflow: visible;
}

.activity-scope label {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
}

.activity-scope select {
  display: block;
  font-size: 18px;
  width: 100%;
  min-height: 42px;
  position: relative;
  z-index: 100;
}

.activity-scope .helper-text {
  font-size: 15px;
  margin-top: 6px;
  line-height: 1.5;
}

/* -------------------------------------------------------
   CRITICAL FIX: Restore clickability to form controls
------------------------------------------------------- */

/* Disable pointer blocking from layout wrappers */
.container,
.card,
.bd,
.form-row {
  pointer-events: auto;
}

/* Kill invisible overlays */
.form-row::before,
.form-row::after,
.card::before,
.card::after {
  pointer-events: none;
}

/* Ensure all form controls are always clickable */
select,
input,
textarea,
button {
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}

.intelligenceBlock {

  margin-top: 12px;

  padding: 12px;

  border-left: 4px solid #2f7d32;

  background: transparent;

}

.intelligenceHeading {

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 0.5px;

  margin-bottom: 8px;

  text-transform: uppercase;

  color: #ffffff;

}

.intelligenceBody {

  font-size: 15px;

  line-height: 1.8;

  white-space: pre-line;

}

.evidenceHeading {

  margin-top: 12px;

  margin-bottom: 8px;

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 0.5px;

}

.activitySummary {
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 16px;
}

.activitySummary div {
  margin-bottom: 4px;
}

.activitySummary strong {
  display: inline-block;
  min-width: 95px;
  color: #9fb3c8;
}

.descriptionBlock {
  margin-top: 10px;
  margin-bottom: 10px;
}

.descriptionHeading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: #9fb3c8;
}

.descriptionBody {
  font-size: 13px;
  line-height: 1.6;
}

#reportSummary {
  padding: 0 20px;
}

/* ──────────────────────────────────────────
   SUPPORTING EVIDENCE
   Purpose:
   - Display evidence attached to activities
   - Improve evidence visibility
   - Support Operational Intelligence review
   ────────────────────────────────────────── */

/* Supporting Evidence List */
.evidenceList {
  margin-top: 8px;
}

/* Individual Evidence Item */
.evidenceItem {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* Evidence Type Icon */
.evidenceIcon {
  font-size: 16px;
}

.branch-card strong {
  font-size: 20px;
  font-weight: 700;
}

.branch-card .muted {
  font-size: 15px;
  line-height: 1.5;
}

.branch-card .bd {
  padding: 20px;
}

.branch-card-body {
  margin-left: 12px;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-title {
  font-size: 2.5rem !important; 
  font-weight: 700;
  letter-spacing: 0.3px;
}