/* ===== Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
[hidden] { display: none !important; }

/* Defensive: an inline <svg> with only a viewBox (no width/height attribute and no
   sizing CSS) defaults to 300x150 in most browsers — which has bitten us in empty
   states. Cap any unsized SVG to inherit its parent's width. Specific class rules
   ({.nav-item .ico}, {.notif-iconbtn svg}, etc.) still win on size. */
svg { max-width: 100%; height: auto; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #1f2937;
  background: #f4f6f8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  background: #1f4d3d;
  color: #d7e4dc;
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  margin: 0 10px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.brand-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 190px;
}

.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  color: #c2d3ca;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: #2d8a5f;
  color: #fff;
  box-shadow: 0 4px 12px rgba(45,138,95,.25);
}
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}
.nav-item.logout { margin-top: auto; color: #f4b6b6; }

/* ===== Main ===== */
.main { flex: 1; padding: 24px 32px; overflow-x: hidden; }

/* ===== Topbar ===== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle:active { background: #f3f4f6; }
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
.page-title { font-size: 22px; font-weight: 700; color: #111827; }
.breadcrumb { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.breadcrumb a { color: #2d8a5f; font-weight: 500; }

.user { display: flex; align-items: center; gap: 12px; }
.user-info { text-align: right; }
.user-name { font-weight: 600; font-size: 13.5px; color: #111827; }
.user-role { font-size: 11.5px; color: #6b7280; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #2d8a5f, #1f4d3d);
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
  font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  border: 1px solid #eef0f3;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.green  { background: #e8f5ee; color: #2d8a5f; }
.stat-icon.blue   { background: #e6f0fb; color: #2563eb; }
.stat-icon.orange { background: #fef3e2; color: #d97706; }
.stat-icon.red    { background: #fde7e7; color: #dc2626; }
.stat-value { font-size: 24px; font-weight: 700; color: #111827; line-height: 1.1; }
.stat-label { font-size: 13px; color: #374151; font-weight: 600; margin-top: 2px; }
.stat-sub   { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search {
  flex: 1;
  min-width: 260px;
  display: flex; align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
}
.search svg { width: 16px; height: 16px; color: #9ca3af; margin-right: 8px; }
.search input {
  flex: 1; border: none; outline: none;
  font-size: 13px; background: transparent;
}
.select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: filter .15s, transform .05s;
}
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: #2d8a5f; color: #fff; box-shadow: 0 2px 6px rgba(45,138,95,.25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { transform: translateY(1px); }

/* ===== Card / Table ===== */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
table.projects { width: 100%; border-collapse: collapse; }
table.projects thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  background: #fafbfc;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
}
table.projects tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
  color: #374151;
  vertical-align: middle;
}
table.projects tbody tr:last-child td { border-bottom: none; }
table.projects tbody tr:hover { background: #fafbfc; }

.project-cell { display: flex; align-items: center; gap: 12px; }
.project-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.project-icon.education     { background: #2563eb; }
.project-icon.livelihood    { background: #16a34a; }
.project-icon.health        { background: #dc2626; }
.project-icon.ecd           { background: #d97706; }
.project-icon.protection    { background: #7c3aed; }
.project-icon.environment   { background: #0ea5e9; }
.project-name { font-weight: 600; color: #111827; }
.project-sub  { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill.active    { background: #e8f5ee; color: #16794a; }
.pill.inactive  { background: #f3f4f6; color: #6b7280; }
.pill.completed { background: #e6f0fb; color: #1d4ed8; }

.progress {
  display: flex; align-items: center; gap: 10px;
  min-width: 120px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: #eef0f3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #2d8a5f;
  border-radius: 999px;
}
.progress-text { font-size: 12px; font-weight: 600; color: #374151; min-width: 32px; text-align: right; }

.action-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: #6b7280;
  transition: background .15s;
}
.action-btn:hover { background: #f3f4f6; color: #111827; }
.action-btn svg { width: 16px; height: 16px; }

/* ===== Pagination ===== */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}
.page-info { font-size: 12.5px; color: #6b7280; }
.pages { display: flex; gap: 6px; }
.page-btn {
  min-width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 12.5px;
  padding: 0 10px;
}
.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #2d8a5f; color: #fff; border-color: #2d8a5f; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  font-size: 11.5px;
  color: #9ca3af;
  padding: 22px 0 6px;
}

/* ============================================================
   DASHBOARD-SPECIFIC STYLES
   ============================================================ */

/* ---- Welcome banner ---- */
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 22px;
  background: linear-gradient(120deg, #1f4d3d 0%, #2d8a5f 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(31, 77, 61, .18);
}
.welcome-banner h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .1px;
}
.welcome-banner p {
  font-size: 13px;
  margin-top: 4px;
  opacity: .85;
}
.welcome-banner .date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.welcome-banner .date-pill svg { width: 14px; height: 14px; }

/* ---- Clickable stat card ---- */
.stat-card.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stat-card.clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* ---- Section card (with header) ---- */
.section-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 22px;
  overflow: hidden;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f3f5;
}
.section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 3px;
}
.section-action {
  font-size: 12.5px;
  color: #2d8a5f;
  font-weight: 600;
}
.section-action:hover { text-decoration: underline; }

.count-badge {
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.count-badge.red { background: #fde7e7; color: #b91c1c; }

/* ---- Quick Actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 20px;
}
.qa-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  background: #fff;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.qa-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  border-color: #d8e6df;
}
.qa-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
}
.qa-icon svg { width: 22px; height: 22px; }
.qa-icon.green   { background: #e8f5ee; color: #2d8a5f; }
.qa-icon.blue    { background: #e6f0fb; color: #2563eb; }
.qa-icon.orange  { background: #fef3e2; color: #d97706; }
.qa-icon.teal    { background: #e0f5f1; color: #0d9488; }
.qa-icon.red     { background: #fde7e7; color: #dc2626; }
.qa-icon.lime    { background: #ecfae1; color: #65a30d; }
.qa-icon.purple  { background: #f1e8fb; color: #7c3aed; }
.qa-icon.indigo  { background: #e7eafb; color: #4338ca; }
.qa-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  line-height: 1.3;
}

/* ---- Two-column row ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.two-col .section-card { margin-bottom: 0; }

/* ---- Activity feed ---- */
.activity-feed {
  list-style: none;
  padding: 8px 0;
  position: relative;
}
.activity-feed::before {
  content: "";
  position: absolute;
  left: 28px; top: 16px; bottom: 16px;
  width: 1.5px;
  background: #eef0f3;
}
.activity-item {
  position: relative;
  padding: 10px 20px 10px 48px;
  display: block;
}
.activity-dot {
  position: absolute;
  left: 23px;
  top: 16px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #2d8a5f;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px #eef0f3;
}
.activity-dot.green   { background: #2d8a5f; }
.activity-dot.blue    { background: #2563eb; }
.activity-dot.orange  { background: #d97706; }
.activity-dot.red     { background: #dc2626; }
.activity-dot.lime    { background: #65a30d; }
.activity-dot.purple  { background: #7c3aed; }
.activity-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
}
.activity-text b { font-weight: 600; color: #111827; }
.activity-time {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 3px;
}

/* ---- Notifications list (dashboard widget) ---- mirrors /notifications panel */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-item {
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #fbfbfc; }

.notif-item .notif-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Small green bullet at the start of every notification.
   Outlined ring for read, solid green for unread — visible either way. */
.notif-bullet {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #2d8a5f;
  flex-shrink: 0;
  box-sizing: border-box;
}
.notif-item.is-unread .notif-bullet {
  background: #2d8a5f;
  border-color: #2d8a5f;
}

.notif-item .notif-body { flex: 1; min-width: 0; }
.notif-item .notif-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item.is-unread .notif-title { font-weight: 600; color: #111827; }
.notif-item .notif-meta-line {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item .notif-time {
  font-size: 11.5px;
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 8px;
}
.notif-empty-row {
  padding: 28px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 12.5px;
}

/* ---- Sub tables (dashboard returned/draft) ---- */
table.sub-table tbody tr.row-returned { background: #fff8f8; }
table.sub-table tbody tr.row-returned:hover { background: #fff1f1; }
.comment-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
  font-style: italic;
  font-size: 12.5px;
}
.empty-row {
  text-align: center;
  padding: 28px;
  color: #9ca3af;
  font-size: 13px;
}
.link-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #2d8a5f;
  white-space: nowrap;
}
.link-btn:hover { filter: brightness(1.05); }
.link-btn.red { background: #dc2626; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
}

/* Mobile breakpoint — sidebar becomes a slide-in drawer, stats stack, tables scroll. */
@media (max-width: 760px) {
  /* Sidebar as overlay drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open { overflow: hidden; }

  .menu-toggle { display: inline-flex; }
  .main { padding: 16px; width: 100%; }

  /* Topbar: avatar + name stacks compact, hide breadcrumb on tiny screens */
  .topbar { margin-bottom: 16px; }
  .page-title { font-size: 18px; }
  .breadcrumb { font-size: 11px; }
  .user-info { display: none; }
  .avatar { width: 34px; height: 34px; font-size: 12px; }

  /* Grids collapse */
  .stats          { grid-template-columns: 1fr; gap: 12px; }
  .quick-actions  { grid-template-columns: repeat(2, 1fr); }
  .stat-card      { padding: 14px; }
  .stat-value     { font-size: 20px; }

  /* Forms + filter bars stack and grow to full width */
  .toolbar { gap: 8px; }
  .search  { min-width: 0; width: 100%; }
  .period-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .period-bar .select,
  .period-bar input[type=date] { width: 100%; min-width: 0; }
  .period-bar-label { margin-top: 4px; font-size: 12px; }

  /* Section heads and cards */
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-card { margin-bottom: 14px; }

  /* Submission / detail header stacks */
  .submission-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .submission-head .btn { width: 100%; justify-content: center; }
  .submission-meta { flex-wrap: wrap; }

  /* Tables: keep horizontal scroll, tighten cells */
  table.projects thead th,
  table.projects tbody td { padding: 10px 8px; font-size: 12px; }

  /* Form cards */
  .form-card { padding: 18px; }
  .form-card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .form-card-head .btn { width: 100%; justify-content: center; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; min-width: 140px; justify-content: center; }

  /* Charts and matrix table */
  .chart-wrap { height: 220px; padding: 10px; }
  .matrix-wrap { overflow-x: auto; }

  /* Make buttons easier to tap */
  .btn, .select, .search { min-height: 44px; }
  .btn { height: auto; padding: 10px 16px; }
  .select { height: 44px; }
}

/* Extra-small phones */
@media (max-width: 420px) {
  .page-title { font-size: 16px; }
  .breadcrumb { display: none; }
  .main { padding: 12px; }
  .quick-actions  { grid-template-columns: 1fr; }
  .submission-meta span:nth-child(2n) { display: none; } /* hide the '|' separators */
}

/* ============================================================
   AUTH / LOGIN PAGE
   ============================================================ */
body.auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(135deg, #1f4d3d 0%, #2d8a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-wrap {
  width: 100%;
  max-width: 680px;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 56px 64px 40px;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.24),
    0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 0 auto 30px;
}

.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.auth-sub {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 32px;
}

.auth-error {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 18px;
  text-align: left;
}
.auth-error svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field > span {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}
.auth-field > span em {
  color: #dc2626;
  font-style: normal;
  font-weight: 600;
}

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-ico {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}
.auth-field input {
  width: 100%;
  height: 54px;
  padding: 0 18px 0 48px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  background: #fff;
  color: #111827;
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
.auth-field input::placeholder { color: #9ca3af; }
.auth-field input:focus {
  border-color: #2d8a5f;
  box-shadow: 0 0 0 4px rgba(45, 138, 95, .15);
}
.auth-input:focus-within .auth-input-ico { color: #2d8a5f; }

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
}
.auth-checkbox input {
  width: 16px; height: 16px;
  accent-color: #2d8a5f;
}
.auth-link {
  font-size: 14px;
  color: #2d8a5f;
  font-weight: 600;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-submit {
  height: 56px;
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  margin-top: 14px;
  justify-content: center;
  border-radius: 12px;
}

.auth-signup {
  text-align: center;
  font-size: 15px;
  color: #6b7280;
  margin-top: 18px;
}
.auth-signup .auth-link { margin-left: 4px; }

.auth-hint {
  margin-top: 22px;
  padding: 12px 14px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
}
.auth-hint strong { color: #111827; }
.auth-hint code {
  background: #fff;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #111827;
  border: 1px solid #e5e7eb;
}
.auth-hint-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
}

.auth-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
  margin-top: 22px;
  letter-spacing: .2px;
}

@media (max-width: 720px) {
  .auth-card  { padding: 36px 28px 28px; }
  .auth-logo  { max-width: 320px; }
  .auth-title { font-size: 26px; }
}
@media (max-width: 420px) {
  .auth-logo  { max-width: 260px; }
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

/* Banner-style profile card */
.profile-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 22px;
  overflow: hidden;
}
.profile-cover {
  height: 130px;
  background:
    radial-gradient(800px 200px at 90% -20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, #1f4d3d 0%, #2d8a5f 100%);
}
.profile-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px 22px;
  margin-top: -44px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8a5f, #1f4d3d);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar.profile-avatar-large { width: 112px; height: 112px; font-size: 36px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-actions { margin-left: auto; padding-top: 50px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Topbar avatar wrapped in <a> */
a.user { text-decoration: none; color: inherit; }
a.user:hover .avatar { transform: scale(1.03); }
a.user:hover .user-name { color: #2d8a5f; }
.avatar { overflow: hidden; transition: transform .12s; }
.avatar.avatar-img { background: none; padding: 0; }
.avatar.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-identity { padding-top: 50px; min-width: 0; }
.profile-name {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
}
.profile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-meta-item svg { width: 14px; height: 14px; }

.role-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.role-pill.role-project_officer { background: #e8f5ee; color: #2d8a5f; }
.role-pill.role-meal_officer    { background: #e6f0fb; color: #1d4ed8; }
.role-pill.role-admin           { background: #f1e8fb; color: #7c3aed; }

/* Form fields */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 22px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
}
.form-field input,
.form-field select,
.form-field textarea {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  color: #111827;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.form-field input::placeholder { color: #9ca3af; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #2d8a5f;
  box-shadow: 0 0 0 4px rgba(45, 138, 95, .14);
}
.form-field input:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}
.form-hint {
  font-size: 11.5px;
  color: #9ca3af;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* Password-strength tips card */
.password-tips {
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: #4b5563;
  margin-top: -4px;
}
.password-tips strong {
  display: block;
  color: #111827;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.password-tips ul {
  list-style: disc;
  padding-left: 18px;
  line-height: 1.55;
}

/* Page-level alerts */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  font-weight: 500;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-success {
  background: #e8f5ee;
  color: #166534;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  margin: 0 0 4px 0;
}

@media (max-width: 700px) {
  .profile-meta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .profile-identity { padding-top: 0; }
}

/* ============================================================
   BENEFICIARIES / DATA ENTRY / FORMS
   ============================================================ */

/* ----- Tab bar ----- */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid #eef0f3;
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.tab-item:hover { color: #111827; }
.tab-item.active {
  color: #2d8a5f;
  border-bottom-color: #2d8a5f;
}
.tab-count {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.tab-item.active .tab-count {
  background: #e8f5ee;
  color: #2d8a5f;
}

/* ----- Beneficiary pill variants ----- */
.pill.type-lead-farmer     { background: #e8f5ee; color: #166534; }
.pill.type-independent     { background: #f3f4f6; color: #4b5563; }
.pill.type-passed-received { background: #e6f0fb; color: #1d4ed8; }
.pill.type-active          { background: #e8f5ee; color: #166534; }
.pill.type-completed       { background: #e6f0fb; color: #1d4ed8; }
.pill.type-dropped         { background: #fee2e2; color: #991b1b; }

/* ----- HR person-type pills ----- */
.pill.type-employee   { background: #e6f0fb; color: #1d4ed8; font-weight: 600; }
.pill.type-volunteer  { background: #e8f5ee; color: #166534; font-weight: 600; }
.pill.type-intern     { background: #f1e8fb; color: #7c3aed; font-weight: 600; }
.pill.type-consultant { background: #fef3e2; color: #92400e; font-weight: 600; }

/* ----- Form cards / pages ----- */
.form-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: 24px 26px 22px;
  max-width: 880px;
  margin: 0 auto 22px;
}
.form-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid #f1f3f5;
}
.form-card-title {
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.form-card-sub {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.55;
  max-width: 640px;
}

/* Two-column grid form */
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.grid-form .grid-span-2 { grid-column: 1 / -1; }
.grid-form .form-field input,
.grid-form .form-field select,
.grid-form .form-field textarea {
  height: 44px;
}
.grid-form .form-field textarea { min-height: 90px; padding: 10px 14px; resize: vertical; }
.grid-form .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 6px;
}

/* Button variants beyond .primary */
.btn.ghost {
  background: transparent;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.btn.ghost:hover { background: #f9fafb; color: #111827; }
.btn.warning {
  background: #d97706;
  color: #fff;
  box-shadow: 0 2px 6px rgba(217,119,6,.25);
}
.btn.warning:hover { filter: brightness(1.05); }

/* Alert variants */
.alert-warning {
  background: #fef3e2;
  color: #92400e;
  margin-bottom: 18px;
}
.alert-warning ul { font-weight: 400; font-size: 12.5px; }

/* ----- Empty-state (used in the CBCC tab) ----- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}
.empty-state-text {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
}

/* ============================================================
   DATA ENTRY catalog
   ============================================================ */

.data-entry-intro {
  margin-bottom: 22px;
}
.data-entry-intro h2 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}
.data-entry-intro p {
  font-size: 13.5px;
  color: #6b7280;
}

.de-group { margin-bottom: 26px; }
.de-group-head { margin-bottom: 12px; padding: 0 2px; }
.de-group-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.de-group-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 3px;
}

.de-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.de-card {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative;
  color: inherit;
}
.de-card:not(.disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  border-color: #d8e6df;
}
.de-card.disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.de-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.de-card-icon svg { width: 22px; height: 22px; }
.de-card-icon.green   { background: #e8f5ee; color: #2d8a5f; }
.de-card-icon.blue    { background: #e6f0fb; color: #2563eb; }
.de-card-icon.orange  { background: #fef3e2; color: #d97706; }
.de-card-icon.teal    { background: #e0f5f1; color: #0d9488; }
.de-card-icon.red     { background: #fde7e7; color: #dc2626; }
.de-card-icon.lime    { background: #ecfae1; color: #65a30d; }
.de-card-icon.purple  { background: #f1e8fb; color: #7c3aed; }
.de-card-icon.indigo  { background: #e7eafb; color: #4338ca; }
.de-card-body { flex: 1; min-width: 0; }
.de-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.de-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
.de-card-comment {
  font-size: 11.5px;
  color: #92400e;
  background: #fef3e2;
  border-left: 3px solid #d97706;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
  line-height: 1.45;
}
.de-card-arrow {
  width: 18px;
  height: 18px;
  color: #9ca3af;
  flex-shrink: 0;
}
.soon-pill {
  display: inline-block;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

@media (max-width: 1100px) {
  .de-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .de-grid { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .grid-span-2 { grid-column: auto; }
}

/* ============================================================
   MATRIX REPORT FORMS (ASRHR, Service Delivery)
   ============================================================ */

.form-card-wide { max-width: 1100px; }

.matrix-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.matrix-meta .form-field input,
.matrix-meta .form-field select {
  height: 44px;
}

.matrix-wrap {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  overflow: auto;
  margin-bottom: 18px;
}

table.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.matrix-table thead th {
  background: #2d8a5f;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 12px 10px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-right: 1px solid rgba(255,255,255,0.12);
}
table.matrix-table thead th:first-child {
  background: #1f4d3d;
  text-align: left;
  padding-left: 16px;
}
table.matrix-table thead th.row-total-col {
  background: #1f4d3d;
}

table.matrix-table tbody th {
  text-align: left;
  padding: 12px 16px;
  background: #fafbfc;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid #f1f3f5;
  border-right: 1px solid #eef0f3;
  white-space: nowrap;
}
table.matrix-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #f1f3f5;
  border-right: 1px solid #eef0f3;
  text-align: center;
  background: #fff;
}
table.matrix-table tbody td input[type=number] {
  width: 100%;
  max-width: 90px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
table.matrix-table tbody td input[type=number]:focus {
  border-color: #2d8a5f;
  box-shadow: 0 0 0 3px rgba(45,138,95,.14);
}

table.matrix-table tbody td.row-total {
  background: #f3f7f5;
  font-weight: 700;
  color: #1f4d3d;
  font-size: 14px;
}
table.matrix-table tbody td.row-disab {
  background: #fef3e2;
  font-weight: 700;
  color: #92400e;
  font-size: 14px;
}
table.matrix-table tfoot .totals-row .grand-disab {
  background: #d97706;
  color: #fff;
  font-size: 15px;
}
table.matrix-table input.subset-violation {
  border-color: #dc2626 !important;
  background: #fee2e2;
  color: #991b1b;
}

.matrix-hint {
  font-size: 12.5px;
  color: #4b5563;
  padding: 10px 14px;
  background: #fafbfc;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  margin-bottom: 14px;
  line-height: 1.55;
}
.matrix-hint strong { color: #111827; }

table.matrix-table tfoot .totals-row th {
  background: #fef3e2;
  color: #92400e;
  text-align: center;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 700;
  border-top: 2px solid #f1f3f5;
}
table.matrix-table tfoot .totals-row th:first-child {
  text-align: left;
  padding-left: 16px;
}
table.matrix-table tfoot .totals-row .grand-total {
  background: #2d8a5f;
  color: #fff;
  font-size: 15px;
}

@media (max-width: 880px) {
  .matrix-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .matrix-meta { grid-template-columns: 1fr; }
}

/* ============================================================
   SUBMISSIONS / RETURNED REPORTS / SUBMISSION VIEW
   ============================================================ */

/* Status pills */
.pill-status                    { font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; font-size: 10.5px; padding: 3px 9px; }
.pill-status.pill-draft         { background: #fef3e2; color: #92400e; }
.pill-status.pill-submitted     { background: #e6f0fb; color: #1d4ed8; }
.pill-status.pill-returned      { background: #fee2e2; color: #991b1b; }
.pill-status.pill-approved      { background: #e8f5ee; color: #166534; }
.pill.pill-resubmitted {
  background: #fff7ed;
  color: #9a3412;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  margin-left: 4px;
  border: 1px solid #fed7aa;
}

/* Bulk-import admin lock card */
.bulk-lock-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  flex-wrap: wrap;
}
.bulk-lock-state { flex: 1; min-width: 240px; }
.bulk-lock-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bulk-lock-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.bulk-lock-form { margin: 0; }

.pill.type-matrix { background: #f1e8fb; color: #7c3aed; font-weight: 600; }
.pill.type-named  { background: #e0f5f1; color: #0d9488; font-weight: 600; }

/* Lead Farmer below-minimum indicator (programme rule: min 25 households managed) */
.lf-below {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fee2e2; color: #991b1b; font-weight: 700;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
}
.lf-below .lf-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #dc2626; box-shadow: 0 0 0 2px #fee2e2;
}

/* Scope toggle (MEAL/Admin) */
.scope-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.scope-label { font-size: 12.5px; color: #6b7280; font-weight: 600; }
.scope-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  color: #6b7280;
  transition: background .12s, color .12s, border-color .12s;
}
.scope-chip:hover { background: #f9fafb; color: #111827; }
.scope-chip.active { background: #2d8a5f; color: #fff; border-color: #2d8a5f; }

/* Stat card click affordance */
.stat-card.clickable { cursor: pointer; }

/* Ghost link-btn variant for inline View links */
.link-btn.ghost {
  background: transparent;
  color: #2d8a5f;
  border: 1px solid #d8e6df;
}
.link-btn.ghost:hover { background: #e8f5ee; }

/* Returned Reports page */
.returned-intro {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: #fff8f8;
  border: 1px solid #fde7e7;
  border-radius: 14px;
  margin-bottom: 22px;
}
.returned-intro-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: #fee2e2; color: #991b1b;
  display: grid; place-items: center;
}
.returned-intro-icon svg { width: 22px; height: 22px; }
.returned-intro h2 {
  font-size: 16px; font-weight: 700; color: #111827;
}
.returned-intro p { font-size: 13px; color: #6b7280; margin-top: 4px; }
.returned-intro-tag { font-size: 12px; color: #9ca3af; font-weight: 500; margin-left: 6px; }

.returned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.returned-card {
  background: #fff;
  border: 1px solid #eef0f3;
  border-left: 4px solid #dc2626;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.returned-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.returned-card-title { font-size: 14.5px; font-weight: 700; color: #111827; }
.returned-card-meta { font-size: 12px; color: #6b7280; margin-top: 3px; line-height: 1.5; }

.meal-comment {
  background: #fef3e2;
  border: 1px solid #fde7c3;
  border-radius: 10px;
  padding: 12px 14px;
}
.meal-comment-label {
  font-size: 11px; font-weight: 700; color: #92400e;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.meal-comment-body {
  font-size: 13px; color: #4b5563; line-height: 1.55;
}
.meal-comment-inline {
  background: #fef3e2; color: #92400e; border: 1px solid #fde7c3;
}
.meal-comment-inline strong { color: #78350f; }

.returned-card-actions {
  display: flex; justify-content: flex-end;
}

/* Submission View page */
.submission-head {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.submission-head-main { flex: 1; min-width: 0; }
.submission-title-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.submission-title {
  font-size: 20px; font-weight: 700; color: #111827;
}
.submission-meta {
  font-size: 12.5px; color: #6b7280;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.submission-meta strong { color: #374151; }

.workflow-form .form-field { margin-bottom: 16px; }
.workflow-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
.workflow-form textarea:focus {
  border-color: #2d8a5f;
  box-shadow: 0 0 0 4px rgba(45,138,95,.14);
}

/* Key-value grid for named submission view */
.kv-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
  font-size: 13.5px;
  color: #374151;
}
.kv-grid > div:nth-child(odd) { color: #6b7280; font-size: 12.5px; }

/* ============================================================
   NOTIFICATIONS INBOX — minimal style
   ============================================================ */

/* Header row: tabs on the left, range picker on the right */
.notif-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.notif-tabs { margin-bottom: 0; flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .notif-header { flex-direction: column; align-items: stretch; }
  .notif-range  { align-self: flex-start; }
}

/* Legacy class kept for any other callers */
.notif-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
/* Underlined-tabs range picker — matches the All / Unread / Read tab style above */
.notif-range {
  display: inline-flex;
  gap: 4px;
  border-bottom: 1px solid #eef0f3;
}
.notif-range-chip {
  position: relative;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}
.notif-range-chip:hover { color: #111827; }
.notif-range-chip.active {
  color: #2d8a5f;
  font-weight: 600;
  border-bottom-color: #2d8a5f;
}

/* Card shell — flat, no card chrome */
.notif-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  overflow: hidden;
}

/* List */
.notif-full-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-row {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: #fbfbfc; }

.notif-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Tiny status dot — invisible for read, kind-colored for unread */
.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.notif-row.is-unread.kind-success .notif-dot { background: #2d8a5f; }
.notif-row.is-unread.kind-warning .notif-dot { background: #d97706; }
.notif-row.is-unread.kind-info    .notif-dot { background: #2563eb; }

.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-row.is-unread .notif-title { font-weight: 600; color: #111827; }
.notif-meta-line {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 11.5px;
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Row actions — hidden until row hover/focus-within (keeps default state airy) */
.notif-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 14px;
  opacity: 0;
  transition: opacity .12s;
}
.notif-row:hover .notif-row-actions,
.notif-row:focus-within .notif-row-actions { opacity: 1; }

.notif-iform { margin: 0; }
.notif-iconbtn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.notif-iconbtn svg { width: 15px; height: 15px; }
.notif-iconbtn:hover { background: #f3f4f6; color: #374151; }
.notif-iconbtn-danger:hover { background: #fef2f2; color: #b91c1c; }

/* Empty state — quiet, centered, text-only */
.notif-empty {
  padding: 56px 24px;
  text-align: center;
}
.notif-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.notif-empty-text {
  font-size: 12.5px;
  color: #9ca3af;
  margin-top: 4px;
}

/* Footer caption beneath the list */
.notif-footnote {
  margin-top: 12px;
  font-size: 11.5px;
  color: #9ca3af;
  text-align: center;
}

/* Pagination: disabled page button (shared) */
.page-btn.disabled {
  color: #d1d5db;
  cursor: not-allowed;
  pointer-events: none;
  background: #fafbfc;
}

/* ============================================================
   REPORTS / CHART CONTAINERS
   ============================================================ */
.chart-wrap {
  position: relative;
  height: 280px;
  padding: 18px 20px 22px;
}
.chart-wrap-wide {
  height: 360px;
}

@media (max-width: 900px) {
  .chart-wrap { height: 240px; }
  .chart-wrap-wide { height: 320px; }
}

/* Progress-bar bands (used on Indicator Performance) */
.progress-fill.progress-fill-high { background: #2d8a5f; }
.progress-fill.progress-fill-mid  { background: #d97706; }
.progress-fill.progress-fill-low  { background: #dc2626; }

/* Indicator-type pills */
.pill.type-output  { background: #e6f0fb; color: #1d4ed8; font-weight: 600; }
.pill.type-outcome { background: #e8f5ee; color: #166534; font-weight: 600; }
.pill.type-impact  { background: #f1e8fb; color: #7c3aed; font-weight: 600; }

/* Pills used on CBCC sub-views */
.pill.type-trained-yes { background: #e8f5ee; color: #166534; }
.pill.type-trained-no  { background: #f3f4f6; color: #6b7280; }
.pill.type-assessment  { background: #e7eafb; color: #4338ca; font-weight: 600; }

/* Report-kind pills (ASRHR PE vs YCBDA) */
.pill.type-kind-peer_educator { background: #e6f0fb; color: #1d4ed8; font-weight: 600; }
.pill.type-kind-ycbda         { background: #f1e8fb; color: #7c3aed; font-weight: 600; }
.pill.type-kind-standard      { background: #f3f4f6; color: #6b7280; font-weight: 600; }
.count-badge.count-badge-active { background: #e8f5ee; color: #166534; }

/* Sub-tab bar (used on CBCC sub-views inside the main Beneficiaries tab) */
.sub-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sub-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  transition: background .12s, color .12s, border-color .12s;
}
.sub-tab-item:hover { background: #f9fafb; color: #111827; }
.sub-tab-item.active {
  background: #2d8a5f;
  color: #fff;
  border-color: #2d8a5f;
}
.sub-tab-count {
  background: #f3f4f6;
  color: #6b7280;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.sub-tab-item.active .sub-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ============================================================
   PERIOD picker toolbar (used on report pages)
   ============================================================ */
.period-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.period-bar-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.period-bar .select { height: 38px; min-width: 140px; }
.period-bar-active {
  font-size: 12.5px;
  color: #2d8a5f;
  background: #e8f5ee;
  padding: 5px 12px;
  border-radius: 999px;
  margin-left: auto;
}
.period-bar-active strong { color: #1f4d3d; }

/* ============================================================
   PROFILE PHOTO MODAL + Cropper.js
   ============================================================ */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-row .form-field { min-width: 0; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #eef0f3;
}
.modal-head h3 { font-size: 16px; font-weight: 700; color: #111827; }
.modal-close {
  font-size: 24px;
  color: #9ca3af;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: #f3f4f6; color: #111827; }

.modal-body {
  padding: 20px 22px;
  overflow: auto;
}
.modal-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 14px;
  line-height: 1.55;
}
.modal-body input[type=file] {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 13px;
  border: 1.5px dashed #d8e6df;
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  margin-bottom: 14px;
}
.modal-body input[type=file]:hover { background: #f3f7f5; border-color: #2d8a5f; }

.cropper-area {
  position: relative;
  max-height: 380px;
  background: #1f2937;
  border-radius: 10px;
  overflow: hidden;
}
.cropper-area img { display: block; max-width: 100%; max-height: 380px; }

.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

/* Repeatable input rows (CSA support form) */
.repeat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 8px;
}
.repeat-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}
.repeat-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}
.input-row {
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.input-row-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.8fr 0.7fr 36px;
  gap: 10px;
  align-items: end;
}
.input-row-grid .form-field input,
.input-row-grid .form-field select { height: 40px; }
.row-remove {
  width: 36px;
  height: 40px;
  background: transparent;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background .12s, color .12s, border-color .12s;
}
.row-remove:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.row-remove svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .input-row-grid {
    grid-template-columns: 1fr 1fr;
  }
  .row-remove { grid-column: 1 / -1; width: 100%; }
}

/* Livestock pass-on widget (reports-beneficiaries) */
.passon-widget {
  margin: 4px 18px 18px;
  padding: 14px 16px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fafbfc;
}
.passon-head { margin-bottom: 12px; }
.passon-title { font-size: 13px; font-weight: 700; color: #111827; text-transform: uppercase; letter-spacing: .4px; }
.passon-sub   { font-size: 11.5px; color: #6b7280; margin-top: 3px; }
.passon-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.passon-stat {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 10px 12px;
}
.passon-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.passon-pct {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
}
.passon-stat-label { font-size: 11.5px; color: #6b7280; margin-top: 4px; }
.passon-stat-good { background: #e8f5ee; border-color: #cbe5d8; }
.passon-stat-good .passon-stat-value { color: #166534; }
.passon-stat-good .passon-pct { background: #cbe5d8; color: #166534; }
.passon-stat-warn { background: #fef3e2; border-color: #fde7c3; }
.passon-stat-warn .passon-stat-value { color: #92400e; }
.passon-stat-warn .passon-pct { background: #fde7c3; color: #92400e; }
.passon-bar {
  height: 8px;
  background: #fde7c3;
  border-radius: 999px;
  overflow: hidden;
}
.passon-bar-fill {
  height: 100%;
  background: #2d8a5f;
  border-radius: 999px;
  transition: width .3s;
}
@media (max-width: 720px) { .passon-stats { grid-template-columns: 1fr; } }

/* Activity-type pills (Programme Activities page) */
.pill.type-act-csa              { background: #ecfae1; color: #4d7c0f; font-weight: 600; }
.pill.type-act-livestock_dist   { background: #fde7e7; color: #b91c1c; font-weight: 600; }
.pill.type-act-livestock_passon { background: #fef3e2; color: #92400e; font-weight: 600; }
.pill.type-act-assessment       { background: #e7eafb; color: #4338ca; font-weight: 600; }
