﻿/* ============================================================
   ICT Admin â€” Inner City Tabernacle brand
   navy #1A2A52 Â· red #C0392B Â· gold #C8A227
   Light backgrounds, dark text; dark bands for header/sidebar.
   ============================================================ */
:root {
  --navy: #1A2A52;
  --navy-deep: #131f3d;
  --red: #C0392B;
  --red-dark: #a02f23;
  --gold: #C8A227;
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #6b7280;
  --line: #e4e7ee;
  --ok: #1e7e46;
  --warn: #b45309;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 42, 82, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; font-size: .85em; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 70%);
  padding: 24px;
}
.login-card {
  background: var(--card); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  padding: 36px; width: 100%; max-width: 400px;
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 20px; margin: 12px 0 2px; color: var(--navy); }
.login-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.monogram {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; letter-spacing: 1px;
  border: 2px solid var(--gold);
}
.monogram.small { width: 42px; height: 42px; font-size: 14px; margin: 0; flex: none; }
.login-note { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }

/* Logo badge (real ICT logo) */
.logo-badge {
  width: 42px; height: 42px; border-radius: 50%; flex: none; overflow: hidden;
  background: #fff; border: 2px solid var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.logo-badge-lg { width: 72px; height: 72px; margin: 0 auto; display: flex; }
.login-back {
  display: block; text-align: center; margin-top: 16px; font-size: 13px;
  color: var(--muted); text-decoration: none;
}
.login-back:hover { color: var(--red); text-decoration: underline; }
.login-strong { color: var(--red); font-weight: 600; }

/* Staff sign-up */
.ministry-picker {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  max-height: 160px; overflow-y: auto; background: #fff;
}
.ministry-picker label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; margin: 0 0 6px; color: var(--ink); font-size: 14px;
}
.ministry-picker label:last-child { margin-bottom: 0; }
.ministry-picker input { width: auto; }
.form-success {
  background: #e5f3ea; color: #1e7e46; border: 1px solid #bfe3cc;
  padding: 10px 12px; border-radius: 8px; margin-top: 12px; font-size: 13px; font-weight: 600;
}
.signup-note { font-size: 12px; color: var(--muted); max-width: 220px; }

/* Super Admin: preview-as-tier */
.viewas-wrap {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(200, 162, 39, .10);
}
.viewas-label { display: block; font-size: 11px; color: var(--gold); letter-spacing: .5px; margin-bottom: 6px; font-weight: 700; }
.viewas-wrap select {
  width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25);
  background: var(--navy-deep); color: #dfe4f0; font: inherit; font-size: 13px;
}
.viewas-banner {
  background: #f7efd8; color: #8a6d14; border: 1px solid #e6d391;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}

/* Annual plan: goals + tasks */
.goal-block {
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0;
}
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.task-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  font-size: 14px; border-bottom: 1px dashed var(--line);
}
.task-row:last-of-type { border-bottom: none; }
.task-row input[type="checkbox"] { width: auto; flex: none; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-row .muted { font-size: 12px; margin-left: auto; text-align: right; }
.task-add { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.task-add input[name="title"] { flex: 1; min-width: 160px; }
.task-add input[type="date"] { width: auto; }
.badge-navy { background: #e8ecf5; color: var(--navy); }

/* Budget milestones + utilization bars */
.milestones { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.ms-step {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef0f4; color: var(--muted); border: 1px solid var(--line);
}
.ms-step.done { background: #e5f3ea; color: var(--ok); border-color: #bfe3cc; }
.ms-link { flex: none; width: 14px; height: 2px; background: var(--line); }
.util-bar {
  display: inline-block; vertical-align: middle; width: 70px; height: 8px;
  background: #edf0f6; border-radius: 4px; overflow: hidden; margin-right: 6px;
}
.util-bar > div { height: 100%; border-radius: 4px; }
.util-green > div { background: #4a7d5f; }
.util-amber > div { background: #a8823f; }
.util-red > div { background: #a8564a; }
.soft-rule { border: none; border-top: 1px solid var(--line); margin: 18px 0 14px; }

/* Highlights (My Ministries) */
.highlight-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-top: 16px;
}
.highlight-card {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 1px 3px rgba(26,42,82,.08);
}
.highlight-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.hl-note { padding: 10px 12px 4px; font-size: 14px; }
.hl-meta { padding: 0 12px 10px; font-size: 12px; }
.contrib-form textarea { margin-bottom: 4px; }

/* My Ministry: compact activity rows */
.mini-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.mini-row:last-child { border-bottom: none; }
.mini-row .badge { flex: none; }
.link-danger { color: var(--red); }
.temppass-box {
  font-family: Consolas, monospace; font-size: 20px; font-weight: 700;
  background: var(--bg); border: 2px dashed var(--gold); border-radius: 10px;
  padding: 16px; text-align: center; letter-spacing: 1px; color: var(--navy);
  user-select: all; margin: 10px 0;
}
.sidebar-site-link {
  display: block; font-size: 13px; color: #dfe4f0; text-decoration: none; margin-bottom: 10px;
}
.sidebar-site-link:hover { color: var(--gold); }

/* ---------------- Forms ---------------- */
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; color: var(--navy); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold);
}
.form-error {
  background: #fdecea; color: var(--red); border: 1px solid #f5c6c0;
  padding: 9px 12px; border-radius: 8px; margin-top: 12px; font-size: 13px;
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 14px; }
.check input { width: auto; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; padding: 4px 14px 14px; }
.fieldset legend { font-weight: 600; color: var(--navy); font-size: 13px; padding: 0 6px; }

/* ---------------- Buttons ---------------- */
.btn {
  font: inherit; font-weight: 600; border: none; border-radius: 8px;
  padding: 9px 16px; cursor: pointer; transition: background .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { background: #d9948c; cursor: wait; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: #fdecea; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(26,42,82,.06); }
.btn-block { width: 100%; margin-top: 18px; }

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--navy); color: #dfe4f0;
  display: flex; flex-direction: column;
}
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); text-decoration: none; }
.brand-name { font-weight: 700; color: #fff; }
.brand-sub { font-size: 11px; color: #9aa6c8; }
.sidebar-nav { flex: 1; padding: 12px 8px; }
.sidebar-nav a {
  display: block; padding: 10px 12px; border-radius: 8px; color: #dfe4f0;
  text-decoration: none; font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); }
.sidebar-nav a.active { background: var(--red); color: #fff; }
.sidebar-user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.12); }
.user-email { font-size: 13px; color: #fff; word-break: break-all; }
.user-role { font-size: 11px; color: var(--gold); margin: 2px 0 10px; letter-spacing: .5px; }
.sidebar-user .btn-ghost { color: #dfe4f0; border-color: rgba(255,255,255,.25); }

.main { flex: 1; padding: 0 28px 40px; min-width: 0; }
.topbar { padding: 20px 0 6px; border-bottom: 2px solid var(--gold); margin-bottom: 18px; }
.topbar h2 { margin: 0; color: var(--navy); font-size: 22px; }
.page-alert {
  background: #fdecea; color: var(--red); border: 1px solid #f5c6c0;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px;
}

/* ---------------- Dashboard ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border-top: 3px solid var(--gold); }
.stat-card .num { font-size: 30px; font-weight: 700; color: var(--navy); }
.stat-card .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card.accent-red { border-top-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .sidebar { width: 200px; } }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; overflow-x: auto; }
.panel h3 { margin: 0 0 12px; color: var(--navy); font-size: 15px; }

.funnel-row { margin-bottom: 10px; }
.funnel-row .frow-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.funnel-bar { height: 14px; background: #edf0f6; border-radius: 7px; overflow: hidden; }
.funnel-bar > div { height: 100%; background: var(--navy); border-radius: 7px; min-width: 2px; }

.flag { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.flag:last-child { border-bottom: none; }
.flag-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; top: 1px; }
.flag-high .flag-dot { background: var(--red); }
.flag-medium .flag-dot { background: var(--warn); }
.flag-low .flag-dot { background: var(--gold); }
.all-clear { color: var(--ok); font-size: 14px; padding: 6px 0; }

.opp { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.opp:last-child { border-bottom: none; }
.opp .count { font-weight: 700; color: var(--navy); flex: none; }

/* ---------------- Tables ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 280px; }
.toolbar select { max-width: 200px; width: auto; }
.spacer { flex: 1; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 10px;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #f8f9fc; }
.table select { padding: 5px 8px; width: auto; }
.empty-row td { text-align: center; color: var(--muted); padding: 26px 10px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ACTIVE { background: #e5f3ea; color: var(--ok); }
.badge-INACTIVE { background: #eef0f4; color: var(--muted); }
.badge-LEAVING { background: #fdf1e3; color: var(--warn); }
.badge-LEFT { background: #fdecea; color: var(--red); }
.badge-yes { background: #e5f3ea; color: var(--ok); }
.badge-no { background: #eef0f4; color: var(--muted); }

.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding-top: 12px; font-size: 13px; color: var(--muted); }

.link-btn { background: none; border: none; color: var(--red); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------------- Modals ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(19, 31, 61, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--card); border-radius: 14px; padding: 22px 26px;
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal h3 { margin: 0 0 6px; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------------- Phase 6: structured report writer ---------------- */
.rep-section {
  border: 1px solid var(--line); border-left: 3px solid var(--navy);
  border-radius: 10px; padding: 10px 14px 12px; margin: 10px 0; background: #fff;
}
.rep-sec-head { display: flex; align-items: center; gap: 10px; }
.rep-sec-head .sec-heading {
  flex: 1; font-weight: 700; color: var(--navy); border: none; border-bottom: 1.5px solid var(--gold);
  border-radius: 0; padding: 6px 2px; background: transparent; font-size: 15px;
}
.rep-sec-head .sec-heading:focus { outline: none; border-bottom-color: var(--navy); }
.rep-section textarea.sec-body { margin-top: 8px; width: 100%; }
.sec-photo { margin-top: 8px; font-size: 13px; }
.sec-photo img { max-width: 220px; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 4px; }
.sec-photo-add { color: var(--navy); }

/* Suggested budget sub-section chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--navy);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--gold); background: #fdf9ec; }

/* Mission & vision linkage */
.mission-line {
  font-size: 13px; color: var(--navy); background: #fdf9ec;
  border-left: 3px solid var(--gold); border-radius: 6px; padding: 5px 10px; margin: 4px 0 8px;
}
.mission-add { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.mission-add input { flex: 1; font-size: 13px; }

/* Overview analytics */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.aog-controls { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.aog-controls input[type="date"], .aog-controls select { padding: 5px 8px; width: auto; font-size: 13px; }

/* Panel full-screen toggle */
.panel-expand {
  float: right; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; padding: 2px 9px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.panel-expand:hover { border-color: var(--gold); color: var(--navy); }
.panel.panel-full {
  position: fixed; inset: 12px; z-index: 90; overflow-y: auto; margin: 0;
  box-shadow: 0 16px 60px rgba(0, 0, 0, .35);
}

/* Document preview modal (letterhead) */
.modal-wide { max-width: 860px; }
.preview-body {
  max-height: 68vh; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}

/* Contribution photo thumbnails in the leader's report panel */
.contrib-thumb {
  width: 84px; height: 64px; object-fit: cover; flex: none;
  border-radius: 8px; border: 1px solid var(--line);
}

/* ---------------- Phase 7: sub-tabs ---------------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.subtab {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.subtab:hover { border-color: var(--gold); }
.subtab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.grid-2.tabbed { display: block; }
.grid-2.tabbed > div { width: 100%; }

/* Distinguishable buttons: stronger primary, clearer ghost, visible focus */
.btn { font-weight: 700; letter-spacing: .2px; }
.btn-primary { box-shadow: 0 2px 6px rgba(26, 42, 82, .28); border: 1.5px solid transparent; }
.btn-primary:hover { box-shadow: 0 3px 10px rgba(26, 42, 82, .38); }
.btn-ghost { border: 1.5px solid var(--navy) !important; color: var(--navy) !important; background: #fff; }
.btn-ghost:hover { background: #eef1f8; }
.btn-danger { border: 1.5px solid transparent; }
.btn:focus-visible, .subtab:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

/* Budget communication thread */
.thread-note {
  border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 13.5px;
  max-width: 92%;
}
.thread-note.from-treasurer { background: #eef1f8; border-left: 3px solid var(--navy); }
.thread-note.from-ministry { background: #fdf9ec; border-left: 3px solid var(--gold); margin-left: 8%; }

/* AOG plan dashboard */
.aog-sub { font-size: 13px; margin: 6px 0; }
.aog-sub ul { margin: 2px 0 6px; padding-left: 20px; }
.aog-sub li { margin: 2px 0; }
.badge-gold2 { background: #fdf3d5; color: #8a6d10; }
.contrib-thumb { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }

/* Mission drill-down affordance */
.donut-clickable { cursor: pointer; }
.donut-clickable:hover svg { filter: drop-shadow(0 2px 6px rgba(200, 162, 39, .5)); }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px; font-size: 11px; overflow: hidden; background: #fff;
}
.cal-empty { background: transparent; border-style: dashed; }
.cal-today { border: 2px solid var(--gold); background: #fffdf4; }
.cal-day { font-weight: 700; color: var(--muted); font-size: 11px; }
.cal-chip {
  display: block; border-radius: 5px; padding: 1px 5px; margin: 2px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 10.5px; font-weight: 600; color: #fff;
}
.cal-EVENT { background: var(--navy); }
.cal-PREACHING { background: #3f6f66; }
.cal-PLAN_GOAL { background: #9a7b3e; }
.cal-PLAN_TASK { background: #6a7590; }
.cal-PASTORAL { background: #9c5a46; }
span.cal-key { color: var(--ink); font-weight: 600; }
span.cal-key.cal-EVENT, span.cal-key.cal-PLAN_GOAL, span.cal-key.cal-PLAN_TASK, span.cal-key.cal-PASTORAL {
  background: transparent; display: inline; padding: 0 2px; border-radius: 3px;
}
span.cal-key.cal-EVENT { color: var(--navy); }
span.cal-key.cal-PREACHING { color: #3f6f66; }
span.cal-key.cal-PLAN_GOAL { color: #7a6230; }
span.cal-key.cal-PLAN_TASK { color: #545e75; }
span.cal-key.cal-PASTORAL { color: #8a4c3a; }

/* Finance detail + church budget row inputs */
.fin-month-row input, .fin-line-row input, .fin-line-row select { font-size: 13px; }
#cb-lines select, #cb-lines input { font-size: 13px; padding: 6px 8px; }

/* Walk-in welcome-desk call-to-action on the Visitors page */
.welcome-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-left: 4px solid var(--gold); }
.welcome-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Welcome-from-the-pulpit live panel (pastor dashboard) */
.welcome-pulpit { border-left: 4px solid var(--gold); }
.wp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wp-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wp-dot { width: 9px; height: 9px; border-radius: 50%; background: #1e7e46; animation: wp-pulse 1.8s infinite; }
@keyframes wp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(30,126,70,.45); }
  70% { box-shadow: 0 0 0 8px rgba(30,126,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(30,126,70,0); }
}
.wp-row { padding: 11px 4px; border-bottom: 1px solid var(--line); }
.wp-row:last-child { border-bottom: none; }
.wp-first { background: #fbf6e6; border-radius: 8px; padding: 11px 12px; border-bottom: none; margin-bottom: 4px; }
.wp-name { font-weight: 700; color: var(--navy); font-size: 16px; }
.wp-meta { font-size: 13px; margin-top: 2px; }

/* ---- Modules ---- */
/* A module switched off for this tier. Kept separate from .hidden so it never
   fights with the page/sub-tab show-hide logic. */
.module-off { display: none !important; }

/* Role x module matrix on the Customize page */
.cz-matrix-wrap { overflow-x: auto; }
.cz-matrix { min-width: 780px; }
.cz-matrix th, .cz-matrix td { vertical-align: middle; }
.cz-role-h { text-align: center; font-size: 11.5px; line-height: 1.25; white-space: normal; max-width: 76px; }
.cz-cell { text-align: center; }
.cz-cell input { width: 16px; height: 16px; cursor: pointer; }
.cz-na { color: #c3c8d4; }
/* A cell where ticking the box grants access the role doesn't have by default */
.cz-grant { background: #fbf6e6; }
.cz-grant input:checked { accent-color: var(--gold); }
.cz-mod-page td { border-top: 2px solid var(--line); }
.cz-mod-page td:first-child { color: var(--navy); }
.cz-mod-sub td { background: var(--bg-alt); }
.cz-sub-name { color: var(--muted); font-size: 13px; padding-left: 10px; }

/* Report/highlight thumbnails: a short summary that opens the full document */
.hl-clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.hl-clickable:hover, .hl-clickable:focus-visible {
  box-shadow: 0 8px 20px rgba(26,42,82,.14); transform: translateY(-2px); border-color: var(--gold); outline: none;
}
.hl-note {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hl-open { color: var(--red); font-weight: 700; font-size: 12.5px; margin: 6px 0 2px; }

/* ---- Health Check (NCD) ---- */
.hc-doc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hc-bars { margin: 6px 0 4px; }
.hc-bar-row { display: grid; grid-template-columns: 220px 1fr 52px; align-items: center; gap: 12px; padding: 7px 0; }
.hc-bar-lbl { font-weight: 600; color: var(--navy); font-size: 14px; }
.hc-bar-track { height: 16px; background: #eef0f5; border-radius: 8px; overflow: hidden; }
.hc-bar-fill { height: 100%; background: var(--navy); border-radius: 8px; }
.hc-bar-val { text-align: right; font-weight: 700; color: var(--navy); font-size: 14px; }
.hc-bar-min .hc-bar-fill { background: var(--red); }
.hc-bar-min .hc-bar-lbl, .hc-bar-min .hc-bar-val { color: var(--red); }
.hc-min-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: #fdecea; color: var(--red); border-radius: 6px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.hc-timothy { margin-top: 16px; display: grid; gap: 14px; }
.hc-tblock { background: var(--bg-alt); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 12px 16px; }
.hc-tblock h4 { margin: 0 0 6px; color: var(--navy); font-size: 15px; }
.hc-tbody p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.hc-timothy-cta { margin-top: 14px; background: var(--bg-alt); border: 1px dashed var(--gold); border-radius: 10px; padding: 14px 16px; }
.hc-timothy-cta p { margin: 0 0 10px; }
.hc-survey { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.hc-survey-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hc-survey-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hc-history { display: grid; gap: 8px; }
.hc-hist { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; cursor: pointer; }
.hc-hist:hover { border-color: var(--gold); background: var(--bg-alt); }
.hc-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.hc-ex { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.hc-ex b { color: var(--navy); display: block; margin-bottom: 3px; }
.hc-ex span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
@media (max-width: 720px) {
  .hc-bar-row { grid-template-columns: 130px 1fr 44px; gap: 8px; }
  .hc-bar-lbl { font-size: 12.5px; }
  .hc-explain { grid-template-columns: 1fr; }
}

/* Hamburger toggle for the admin app (mobile only — hidden on desktop where
   the full sidebar shows). */
.admin-nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 38px; padding: 0 10px; flex: none; cursor: pointer;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22); border-radius: 9px;
}
.admin-nav-toggle span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
.admin-nav-toggle[aria-expanded="true"] { background: rgba(200,162,39,.28); border-color: var(--gold); }
.admin-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.admin-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Mobile (admin app) ---------------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100% !important; position: sticky; top: 0; z-index: 60;
    display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px;
    overflow: visible;
  }
  /* Logo on the left; sign-out + hamburger cluster on the far right */
  .sidebar-brand { flex: none; padding: 0; border: none; margin-right: auto; }
  .sidebar-brand .brand-sub { display: none; }
  .admin-nav-toggle { display: inline-flex; order: 3; }
  /* Nav becomes a dropdown panel revealed by the hamburger */
  .sidebar-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 65;
    flex-direction: column; gap: 4px; padding: 10px;
    background: var(--navy-deep); box-shadow: 0 14px 32px rgba(0,0,0,.45);
    max-height: 74vh; overflow-y: auto;
  }
  .sidebar-nav.nav-open { display: flex; }
  .sidebar-nav a { white-space: normal; padding: 12px 14px; font-size: 15px; border-radius: 8px; }
  .viewas-wrap { display: none; }
  .sidebar-user { display: flex; align-items: center; gap: 6px; padding: 0; border: none; flex: none; order: 2; }
  .sidebar-user .user-email, .sidebar-user .user-role, .sidebar-site-link { display: none; }
  .sidebar-user .btn { width: auto; padding: 8px 12px; font-size: 12px; }
  .main { padding: 12px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .toolbar { gap: 6px; }
  .table { font-size: 12.5px; display: block; overflow-x: auto; }
  .cal-cell { min-height: 56px; }
  .cal-chip { font-size: 9px; }
  .btn { padding: 10px 14px; } /* comfortable touch targets */
  .modal { padding: 16px; }
  .panel.panel-full { inset: 4px; }
}


/* ---------------- Preaching roster ---------------- */
.pre-month { margin: 10px 0; }
.pre-month-head { padding: 4px 0; border-bottom: 1.5px solid var(--gold); margin-bottom: 4px; }
.pre-slot.pre-mine {
  background: #f0f7f2; border-left: 3px solid var(--ok);
  border-radius: 8px; padding-left: 10px;
}

/* ---------------- Masi (tapa) watermark — Pacific feel ---------------- */
body { background-image: url(../assets/masi-bg.svg); }
.login-wrap { background-image: url(../assets/masi-band.svg), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 70%); }
