:root {
  --nfn-primary: #003580;
  --nfn-secondary: #d21034;
  --nfn-bg: #f4f6f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --active: #10b981;
  --quiet: #f59e0b;
  --inactive: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--nfn-bg);
  color: var(--text);
  padding: 16px;
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
}

.container { max-width: 1140px; margin: 0 auto; }

.brand-header {
  background: linear-gradient(135deg, var(--nfn-primary) 0%, #002255 100%);
  color: #ffffff;
  padding: 20px 22px;
  border-radius: 12px;
  border-bottom: 4px solid var(--nfn-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-header h1 { font-size: 1.3rem; font-weight: 700; }
.brand-subtitle { font-size: 0.84rem; opacity: 0.88; }
.updated-badge {
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 17px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  min-width: 0;
}

.kpi-value { font-size: 1.55rem; font-weight: 700; color: var(--nfn-primary); }
.kpi-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nfn-primary);
  margin: 22px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ministries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
}

.ministry-card {
  cursor: pointer;
  border-top: 4px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ministry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.ministry-card.selected {
  background: #f0f7ff;
  border-color: var(--nfn-primary);
}

.ministry-card.status-Active { border-top-color: var(--active); }
.ministry-card.status-Quiet { border-top-color: var(--quiet); }
.ministry-card.status-Inactive { border-top-color: var(--inactive); }

.ministry-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.ministry-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--nfn-primary);
  line-height: 1.35;
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-Active { background: #d1fae5; color: #065f46; }
.pill-Quiet { background: #fef3c7; color: #92400e; }
.pill-Inactive { background: #fee2e2; color: #991b1b; }

.ministry-metrics { font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.ministry-last { font-size: 0.74rem; color: var(--muted); }

.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.post-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-title {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.post-title:hover { color: var(--nfn-secondary); }
.post-meta { font-size: 0.78rem; color: var(--muted); }

.media-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.clear-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nfn-secondary);
  background: #ffffff;
  border: 1px solid var(--nfn-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 600px) {
  body { padding: 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .ministries-grid { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; gap: 8px; }
}
