/* =========================================================================
   eWelfare - centralised stylesheet
   Same look and conventions as the OR Case & Task Management System:
   white sticky top bar, navy brand colour, centred form cards, pill action
   buttons, stat tiles, DataTables lists. Every page links this file; pages
   carry no <style> blocks of their own. Theme colour, font and nav layout
   are overridden per installation by app/Views/partials/theme-style.php.
   ========================================================================= */

@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/source-sans-3/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 500; font-display: swap; src: url('../vendor/source-sans-3/source-sans-3-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/source-sans-3/source-sans-3-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700; font-display: swap; src: url('../vendor/source-sans-3/source-sans-3-latin-700-normal.woff2') format('woff2'); }

:root {
  --brand-navy: #1F3864;
  --brand-navy-dark: #16294a;
  --brand-danger: #8b0000;
  --bg: #f4f6f8;
  --border: #e2e6ea;
}

* { box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  margin: 0;
}

h4 { color: #16232e; font-weight: 600; }
h6 { color: var(--brand-navy); font-weight: 700; }

/* ---------- Brand buttons (replace inline style="background:#1F3864") ---- */
.btn-brand { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-navy-dark); border-color: var(--brand-navy-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand-navy); color: var(--brand-navy); }
.btn-outline-brand:hover { background: var(--brand-navy); color: #fff; }
a { color: var(--brand-navy); }

/* ---------- Brand / logo ---- */
.brand-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.brand-logo img { max-width: 130px; max-height: 80px; height: auto; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand-navy); color: #fff; font-size: 18px;
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 28px; border-radius: 12px; }
.brand-name { font-weight: 700; color: var(--brand-navy); font-size: 15px; line-height: 1.1; max-width: 220px; white-space: normal; }

/* ---------- Auth cards: login, change password, installer ---- */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}
.auth-card {
  background: #fff; width: 100%; max-width: 380px; margin: 0 auto;
  padding: 32px 28px; border-radius: 10px; box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.auth-card.wide { max-width: 760px; }
.auth-card h1, .auth-card h2 { font-size: 18px; color: var(--brand-navy); margin: 0 0 4px; text-align: center; }
.auth-card p.sub { color: #667; font-size: 13px; margin: 0 0 20px; text-align: center; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; color: #333; margin: 14px 0 4px; }
.auth-card input[type=text],
.auth-card input[type=password],
.auth-card input[type=email],
.auth-card input[type=tel] {
  width: 100%; padding: 10px 12px; border: 1px solid #ccd2d9; border-radius: 6px; font-size: 14px;
}
.auth-card button[type=submit] {
  width: 100%; margin-top: 22px; padding: 11px; background: var(--brand-navy); color: #fff;
  border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.auth-card button[type=submit]:hover { background: var(--brand-navy-dark); }
.auth-card .links { margin-top: 14px; text-align: center; font-size: 13px; }
.auth-card .links a { color: var(--brand-navy); text-decoration: none; }
.auth-card .alert { background: #fdecea; color: var(--brand-danger); padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; border: 0; }
.auth-card .ok { background: #e7f6ec; color: #155724; padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.auth-card .warn { background: #fff8e1; color: #7a5c00; padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.auth-card .field-error { color: var(--brand-danger); font-size: 12.5px; margin-top: 3px; }
.auth-card .section-label { margin: 22px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #667; }
.auth-card .hint { color: #667; font-size: 12.5px; margin-top: 3px; }

/* ---------- Sign-in pages: Harambee identity (green and maize) ----
   Scoped to body.ew-hb so the theme colour (--brand-navy) of the app is not affected. */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../vendor/harambee/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/harambee/nunito-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/harambee/nunito-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../vendor/harambee/nunito-sans-latin-700-normal.woff2') format('woff2'); }
body.ew-hb {
  --hb-green: #14532d; --hb-green-dark: #0b3a1f; --hb-maize: #f2b630; --hb-maize-dark: #dc9f17;
  --hb-paper: #f6f4ee; --hb-ink: #1b2a22; --hb-muted: #4a5a50; --hb-line: #b9c4bc;
  margin: 0; min-height: 100vh; background: var(--hb-paper); color: var(--hb-ink);
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ew-hb-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.ew-hb-story {
  flex: 1 1 520px; min-width: 0; box-sizing: border-box; padding: 56px 64px;
  background: var(--hb-green); color: #fff; display: flex; flex-direction: column; gap: 40px;
}
.ew-hb-mark { display: flex; align-items: center; gap: 14px; }
.ew-hb-mark span { font-family: 'Bricolage Grotesque', 'Nunito Sans', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -.5px; }
.ew-hb-copy { display: flex; flex-direction: column; gap: 18px; max-width: 540px; }
.ew-hb-logo { width: fit-content; padding: 12px; background: #fff; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.ew-hb-logo img { display: block; max-width: 320px; max-height: 150px; width: auto; height: auto; }
.ew-hb-kicker { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--hb-maize); }
.ew-hb-story h1 { margin: 0; font-family: 'Bricolage Grotesque', 'Nunito Sans', sans-serif; font-weight: 800; font-size: clamp(36px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -1.5px; }
.ew-hb-lead { margin: 0; font-size: 18px; line-height: 1.55; color: #d9eadf; }
.ew-hb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 580px; }
.ew-hb-tiles div { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 14px; background: rgba(255,255,255,.08); }
.ew-hb-tiles svg { color: var(--hb-maize); }
.ew-hb-tiles strong { font-size: 16px; }
.ew-hb-tiles span { font-size: 14px; color: #cfe3d6; line-height: 1.4; }
.ew-hb-pay { margin: auto 0 0; font-size: 14px; color: #cfe3d6; }
.ew-hb-pay strong { color: #fff; }

.ew-hb-panel { flex: 1 1 420px; min-width: 0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.ew-hb .auth-card { max-width: 400px; margin: 0; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.ew-hb .auth-card .brand-logo { display: none; }
.ew-hb .auth-card h1, .ew-hb .auth-card h2 {
  text-align: left; margin: 0 0 6px; color: var(--hb-green);
  font-family: 'Bricolage Grotesque', 'Nunito Sans', sans-serif; font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -.8px;
}
.ew-hb .auth-card p.sub { text-align: left; color: var(--hb-muted); font-size: 16px; margin: 0 0 10px; }
.ew-hb .auth-card label { font-size: 15px; font-weight: 700; color: var(--hb-ink); margin: 16px 0 6px; }
.ew-hb .auth-card input[type=text], .ew-hb .auth-card input[type=password],
.ew-hb .auth-card input[type=email], .ew-hb .auth-card input[type=tel] {
  box-sizing: border-box; height: 50px; padding: 0 14px; font-size: 16px; font-family: inherit;
  border: 1.5px solid var(--hb-line); border-radius: 12px; background: #fff; color: var(--hb-ink);
}
.ew-hb .auth-card input:focus { outline: 3px solid var(--hb-maize); outline-offset: 1px; border-color: var(--hb-green); }
.ew-hb .auth-card button[type=submit] {
  height: 52px; margin-top: 22px; padding: 0 16px; border-radius: 12px; background: var(--hb-maize); color: var(--hb-green);
  font-family: 'Bricolage Grotesque', 'Nunito Sans', sans-serif; font-weight: 800; font-size: 18px;
}
.ew-hb .auth-card button[type=submit]:hover { background: var(--hb-maize-dark); }
.ew-hb .auth-card button[type=submit]:focus-visible { outline: 3px solid var(--hb-green); outline-offset: 2px; }
.ew-hb .auth-card .links { text-align: left; font-size: 15px; margin-top: 16px; }
.ew-hb .auth-card .links a, .ew-hb .auth-card a, .ew-hb .auth-card .btn-link-plain { color: var(--hb-green); font-weight: 600; }
.ew-hb .auth-card .links a:hover, .ew-hb .auth-card a:hover { color: var(--hb-green-dark); text-decoration: underline; }
.ew-hb .auth-card .btn-link-plain, .ew-hb .auth-card button[type=submit].btn-link-plain {
  width: auto; height: auto; margin: 0; padding: 0; background: none; border: 0; border-radius: 0;
  color: var(--hb-green); font-family: inherit; font-weight: 600; font-size: 15px;
}
.ew-hb .auth-card button[type=submit].btn-link-plain:hover { background: none; text-decoration: underline; }
.ew-hb .auth-card .alert, .ew-hb .auth-card .ok, .ew-hb .auth-card .warn { border-radius: 10px; font-size: 14px; padding: 11px 13px; margin: 6px 0; }
.ew-hb .auth-card .hint { font-size: 13.5px; color: var(--hb-muted); }
.ew-hb .auth-card .captcha-row { gap: 10px; }
.ew-hb .auth-card .captcha-img { border: 1.5px solid var(--hb-line); border-radius: 12px; background: #eef1ec; max-width: calc(100% - 60px); }
.ew-hb .auth-card .captcha-new { width: 50px; height: 50px; border: 1.5px solid var(--hb-line); border-radius: 12px; color: var(--hb-green); font-size: 20px; }
.ew-hb .auth-card .captcha-new:hover { background: #eef1ec; }
.ew-hb .auth-card .captcha-input { margin-top: 10px; }
.ew-hb .auth-card .links + .hint { margin-top: 12px; }
/* show or hide the typed password */
.auth-card .pw-field { position: relative; }
.auth-card .pw-field input { padding-right: 46px; }
.auth-card .pw-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; border-radius: 8px;
  color: #667; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.auth-card .pw-toggle:hover { color: var(--brand-navy); background: rgba(0,0,0,.05); }
.ew-hb .auth-card .pw-field input { padding-right: 52px; }
.ew-hb .auth-card .pw-toggle { right: 5px; color: var(--hb-muted); font-size: 20px; }
.ew-hb .auth-card .pw-toggle:hover { color: var(--hb-green); background: #eef1ec; }
.ew-hb .auth-card .pw-toggle:focus-visible { outline: 3px solid var(--hb-maize); outline-offset: 0; }
.ew-hb-join { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #dde3de; font-size: 14px; color: var(--hb-muted); }

@media (max-width: 960px) {
  .ew-hb-story { padding: 36px 28px 32px; gap: 24px; }
  .ew-hb-tiles { max-width: none; }
  .ew-hb-pay { margin-top: 0; }
  .ew-hb-logo img { max-height: 120px; }
  .ew-hb-panel { padding: 32px 24px 48px; }
}
@media (max-width: 600px) {
  .ew-hb-story { padding: 24px 16px 26px; gap: 18px; }
  .ew-hb-mark svg { width: 36px; height: 36px; }
  .ew-hb-mark span { font-size: 22px; }
  .ew-hb-logo { padding: 8px; border-radius: 14px; }
  .ew-hb-logo img { max-width: 220px; max-height: 96px; }
  .ew-hb-kicker { font-size: 13px; letter-spacing: 1px; }
  .ew-hb-story h1 { font-size: 32px; letter-spacing: -1px; }
  .ew-hb-lead { font-size: 16px; }
  .ew-hb-tiles { grid-template-columns: 1fr; gap: 8px; }
  .ew-hb-tiles div { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
  .ew-hb-tiles svg { flex: 0 0 auto; width: 24px; height: 24px; }
  .ew-hb-tiles strong { flex: 0 0 auto; font-size: 15px; }
  .ew-hb-tiles span { font-size: 13px; }
  .ew-hb-panel { padding: 28px 16px 40px; }
  .ew-hb .auth-card h1, .ew-hb .auth-card h2 { font-size: 28px; }
}

/* ---------- Top bar / nav ---- */
header.topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
  position: sticky; top: 0; z-index: 200;
}
header.topbar .left { display: flex; align-items: center; gap: 4px; }
header.topbar .right { display: flex; align-items: center; gap: 4px; }
header.topbar .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 8px 14px 8px 0; white-space: nowrap; }
header.topbar .brand img { height: 52px; width: auto; }
.navlink { position: relative; color: var(--brand-navy); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.navlink:hover { background: #f0f2f5; color: var(--brand-navy); }
.navlink.active { background: #eaf1fb; }
.navlink i, .menu > button i { font-size: 15px; }

.nav-links { display: contents; }
.nav-toggle {
  display: none; background: none; border: none; font-size: 20px; line-height: 1;
  color: var(--brand-navy); padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.nav-toggle:hover { background: #f0f2f5; }

.menu { position: relative; }
.menu > button { background: none; border: none; font-size: 14px; font-weight: 600; color: var(--brand-navy); padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.menu > button:hover, .menu.open > button, .menu.active > button { background: #f0f2f5; }
.menu .caret { font-size: 10px; opacity: .6; }
.menu-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.08);
  padding: 6px; z-index: 50;
}
.menu-panel.align-right { left: auto; right: 0; }
.menu.open .menu-panel { display: block; }
.menu-panel a, .menu-panel button.menu-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: #333; text-decoration: none; font-size: 14px;
  width: 100%; background: none; border: 0; text-align: left; font-family: inherit; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button.menu-item:hover { background: #f0f2f5; color: var(--brand-navy); }
.menu-panel a i, .menu-panel button.menu-item i { font-size: 14px; width: 16px; text-align: center; color: #888; }
.menu-panel a:hover i, .menu-panel button.menu-item:hover i { color: var(--brand-navy); }
.menu-panel .divider { border-top: 1px solid #eee; margin: 4px 0; }
.menu-panel form { margin: 0; }

.notif-badge {
  position: absolute; top: 2px; right: 2px; background: #C0392B; color: #fff; font-size: 10px; font-weight: 700;
  line-height: 1; padding: 2px 5px; border-radius: 999px; min-width: 16px; text-align: center;
}

.user-menu { text-align: right; }
.user-menu > button { font-weight: 600; color: var(--brand-navy); }
.user-menu .sub { font-weight: 400; color: #888; font-size: 12px; }

.wrap { max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.wrap-wide { max-width: 1600px; }

.app-footer { border-top: 1px solid #e2e8f0; color: #888; }

/* ---------- Form cards ---- */
.form-card {
  background: #fff; max-width: 640px; margin: 0 auto;
  padding: 24px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.form-card-wide { max-width: 900px; }
.form-card-title {
  margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  font-size: 18px; font-weight: 600; color: var(--brand-navy);
}
.form-section-title { margin: 8px 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #52657d; }
.form-label { font-weight: 600; font-size: 14px; color: #333; }
.form-text { font-size: 12.5px; }

/* ---------- Panels (view pages) ---- */
.panel { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; }
.panel h6 { margin: 0 0 10px; font-size: 15px; }
.kv-table th { color: #667085; font-weight: 600; width: 42%; font-size: 14px; }
.kv-table td { color: #27364d; font-size: 14px; }
.back-link { color: var(--brand-navy); font-size: 14px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---------- Table horizontal scroll on narrow screens ---- */
.table-scroll { overflow-x: auto; }
.table thead th { font-size: 14px; font-weight: 700; white-space: nowrap; color: #27364d; }

/* ---------- Action pills (list-table buttons) ---- */
.pill-btn {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  text-decoration: none; margin-right: 4px; border: 1px solid transparent; white-space: nowrap; cursor: pointer;
}
.pill-view { background: #eaf1fb; color: var(--brand-navy); }
.pill-view:hover { background: #d7e3f5; color: var(--brand-navy); }
.pill-edit { background: #fff4e0; color: #8a5a00; }
.pill-edit:hover { background: #ffe9c2; color: #8a5a00; }
.pill-success { background: #e7f6ec; color: #155724; }
.pill-success:hover { background: #d3f0dd; color: #155724; }
.pill-danger { background: #fdecea; color: var(--brand-danger); }
.pill-danger:hover { background: #fbdad6; color: var(--brand-danger); }
.pill-download { background: #eef1f5; color: #475569; }
.pill-download:hover { background: #e2e6ec; color: #334155; }
.pill-btn-form { display: inline; margin: 0; padding: 0; }

.status-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #eaf1fb; color: var(--brand-navy); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill.s-active { background: #e7f6ec; color: #155724; }
.status-pill.s-pending { background: #fff4e0; color: #8a5a00; }
.status-pill.s-dormant, .status-pill.s-disabled, .status-pill.s-removed { background: #eef1f5; color: #475569; }
.status-pill.s-suspended, .status-pill.s-locked { background: #fdecea; color: var(--brand-danger); }
.status-pill.s-exited, .status-pill.s-deceased { background: #e9ebef; color: #27364d; }
.plain-tag { display: inline-block; font-weight: 400; color: #475569; white-space: nowrap; }

/* ---------- Stat tiles (dashboard) ---- */
.dash-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-tile {
  background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid var(--brand-navy);
  border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-tile .stat-value { font-size: 22px; font-weight: 700; color: var(--brand-navy); line-height: 1.15; }
.stat-tile .stat-label { font-size: 12.5px; color: #64748b; margin-top: 4px; }
.stat-tile-link { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.stat-tile-link:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.10); transform: translateY(-1px); color: inherit; }
.stat-tile.t-amber { border-left-color: #c77700; }
.stat-tile.t-green { border-left-color: #1e7e34; }
.stat-tile.t-grey { border-left-color: #94a3b8; }
.stat-tile.t-amber .stat-value { color: #8a5a00; }
.stat-tile.t-green .stat-value { color: #155724; }

/* ---------- Summary banners ---- */
.summary-ok { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #b9d5c1; border-left: 4px solid #1e7e34; border-radius: 6px; background: #eef8f0; color: #155724; font-size: 14px; }
.summary-warn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #ecd29b; border-left: 4px solid #c77700; border-radius: 6px; background: #fff8e8; color: #7a4b00; font-size: 14px; }
.credential-box { font-family: Consolas, monospace; font-size: 18px; letter-spacing: .08em; }

/* ---------- Tabs (view pages) ---- */
.ew-tabs { display: flex; gap: 0; border-bottom: 1px solid #dbe4ef; margin: 20px 0 16px; overflow-x: auto; }
.ew-tab { background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 0; color: #52657d; font: inherit; font-size: 13px; font-weight: 600; padding: 9px 12px; white-space: nowrap; cursor: pointer; }
.ew-tab:hover { color: #1f3864; border-color: #edf1f6; background: #f8fafc; }
.ew-tab.active { color: var(--brand-navy); background: #fff; border-color: #dbe4ef #dbe4ef #fff; }
.ew-section[hidden] { display: none !important; }

/* ---------- Filter toggle chips ---- */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #b9c4d6; border-radius: 6px; background: #fff; color: #1F3864; font-size: 13px; font-weight: 600; text-decoration: none; }
.filter-chip:hover { background: #eef2f8; color: var(--brand-navy); }
.filter-chip.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.filter-chip .count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 11.5px; }
.filter-chip.active .count { background: rgba(255,255,255,.25); }

/* ---------- Permission management ---- */
.permission-option { margin: 0; padding: 9px 10px 9px 30px; border: 1px solid #e7edf4; border-radius: 6px; background: #fbfcfe; }
.permission-option .form-check-input { margin-left: -20px; }
.permission-options { display: grid; gap: 8px; }
.permission-group-title { margin: 0 0 8px; color: var(--brand-navy); font-size: 14px; font-weight: 700; text-transform: capitalize; }
.perm-matrix th, .perm-matrix td { text-align: center; white-space: nowrap; font-size: 13px; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; white-space: normal; }

/* ---------- Timeline (history) ---- */
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { border-left: 2px solid #e4e7ec; padding: 0 0 .9rem 1rem; position: relative; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-navy); opacity: .5; }

/* ---------- Live password checklist ---- */
.password-rules { list-style: none; margin: 8px 0 16px; padding: 0; font-size: 13px; }
.password-rules li { position: relative; padding-left: 22px; margin-bottom: 5px; color: #888; }
.password-rules li::before { content: "\2716"; position: absolute; left: 0; top: 0; color: var(--brand-danger); font-size: 12px; }
.password-rules li.met { color: #1e7e34; }
.password-rules li.met::before { content: "\2714"; color: #1e7e34; }

/* ---------- Theme swatches (Settings) ---- */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid #dbe4ef; border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; }
.swatch span.dot { width: 20px; height: 20px; border-radius: 50%; display: inline-block; }
.swatch input { display: none; }
.swatch.selected, .swatch:has(input:checked) { border-color: var(--brand-navy); box-shadow: 0 0 0 2px rgba(31,56,100,.15); }

/* ---------- DataTables tweaks ---- */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
  content: '+' !important; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 4px 0 0;
  border: 0; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: 15px; font-weight: 700; line-height: 1; box-shadow: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before { content: '-' !important; background: #c77700; }
div.dataTables_wrapper div.dataTables_filter input { margin-left: .5em; }
.page-item.active .page-link { background-color: var(--brand-navy); border-color: var(--brand-navy); }
.page-link { color: var(--brand-navy); }

/* ---------- Responsive breakpoint ---- */
@media (max-width: 900px) {
  header.topbar { padding: 6px 12px; height: 52px; }
  header.topbar .brand img { height: 44px; }
  header.topbar .brand { padding: 4px 8px 4px 0; }
  .brand-name { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,.10); padding: 8px 12px; z-index: 150;
    max-height: calc(100vh - 52px); overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links .navlink, .nav-links .menu > button { width: 100%; justify-content: flex-start; }
  .nav-links .menu { width: 100%; }
  .nav-links .menu-panel { position: static; display: none; box-shadow: none; border: none; padding: 2px 2px 2px 22px; min-width: 0; }
  .nav-links .menu.open .menu-panel { display: block; }
  .user-menu .sub, .user-menu-name { display: none; }
  .menu > button { padding: 6px 8px; font-size: 13px; }
  .wrap { margin: 16px auto; padding: 0 12px; }
  .auth-card { padding: 26px 20px; }
  .form-card { padding: 18px; }
}

/* ---------- Vertical nav layout (Settings > Layout) ---- */
@media (min-width: 901px) {
  body.nav-vertical { padding-left: 220px; }
  body.nav-vertical header.topbar {
    position: fixed; top: 0; left: 0; z-index: 200; width: 220px; height: 100vh;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 16px 12px; border-bottom: 0; border-right: 1px solid var(--border);
  }
  body.nav-vertical header.topbar .left,
  body.nav-vertical header.topbar .right { flex-direction: column; align-items: stretch; gap: 2px; }
  body.nav-vertical header.topbar .right { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
  body.nav-vertical header.topbar .brand { padding: 4px 8px 16px; white-space: normal; }
  /* side menu: the logo uses the width of the menu, so its wording stays readable */
  body.nav-vertical header.topbar .brand:has(img) { justify-content: center; padding: 0 4px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
  body.nav-vertical header.topbar .brand img { width: auto; height: auto; max-width: 75%; max-height: 99px; }
  body.nav-vertical .navlink, body.nav-vertical .menu > button { width: 100%; justify-content: flex-start; }
  body.nav-vertical .menu { width: 100%; }
  body.nav-vertical .menu-panel { left: 100% !important; right: auto !important; margin-left: 8px; top: 0; }
  body.nav-vertical header.topbar .right .menu-panel { top: auto; bottom: 0; }
  body.nav-vertical .user-menu { text-align: left; }
}

/* ---------- Small consistency fixes ---- */
button, input, select, textarea { font-family: inherit; }
.btn-link { color: var(--brand-navy); }
.btn-link:hover { color: var(--brand-navy-dark); }
div.dataTables_wrapper .pagination { --bs-pagination-font-size: .875rem; --bs-pagination-padding-x: .6rem; --bs-pagination-padding-y: .25rem; }
div.dataTables_wrapper div.dataTables_info { font-size: 13px; color: #64748b; }
.navlink .notif-badge { top: -2px; right: -4px; }
@media (min-width: 901px) {
  body.nav-vertical .user-menu .sub { display: none; }
  body.nav-vertical .user-menu > button { justify-content: flex-start; text-align: left; }
}

/* ---------- Module 4: receipts (print layout) ---------- */
.print-page { background: #eef1f5; padding: 24px 12px; }
.receipt-actions { max-width: 720px; margin: 0 auto 12px; display: flex; justify-content: space-between; gap: 8px; }
.receipt { max-width: 720px; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 28px; }
.receipt-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--brand-navy); padding-bottom: 14px; margin-bottom: 16px; }
.receipt-brand img { max-height: 56px; max-width: 120px; }
.receipt-org { font-size: 1.25rem; font-weight: 700; color: var(--brand-navy); }
.receipt-title { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: #555; }
.receipt-no { margin-left: auto; text-align: right; }
.receipt-void { border: 2px solid var(--brand-danger); color: var(--brand-danger); font-weight: 700; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.receipt-kv th { width: 34%; }
.receipt-foot { display: flex; flex-wrap: wrap; gap: 28px; background: #f6f8fb; border-radius: 6px; padding: 12px 16px; }
@media (max-width: 575px) { .receipt { padding: 16px; } .receipt-head { flex-wrap: wrap; } .receipt-no { margin-left: 0; text-align: left; } }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; padding: 0; }
  .receipt { box-shadow: none; max-width: none; padding: 0; }
}

/* ---------- Section tabs as links, breadcrumbs ---------- */
.ew-tabs-links a.ew-tab { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ew-crumbs { font-size: 13px; color: #64748b; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ew-crumbs a { color: var(--brand-navy); text-decoration: none; }
.ew-crumbs a:hover { text-decoration: underline; }
.ew-crumbs .bi { font-size: 10px; }
.ew-crumbs span { color: #334155; }
.action-bar { display: flex; flex-wrap: wrap; gap: 6px; }

/* Investments: sums that add up (label, amount, operator) */
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: 0 0 8px; }
.sum-list { display: flex; flex-direction: column; }
.sum-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed #e2e8f0; }
.sum-row:last-child { border-bottom: 0; }
.sum-op { color: #94a3b8; font-weight: 700; text-align: center; }
.sum-label { color: #334155; }
.sum-label small { display: block; color: #64748b; font-size: 12px; }
.sum-amt { font-weight: 600; color: var(--brand-navy); white-space: nowrap; text-align: right; }
.sum-total { border-top: 2px solid var(--brand-navy); border-bottom: 0; margin-top: 2px; padding-top: 9px; }
.sum-total .sum-label { font-weight: 700; }
.sum-total .sum-amt { font-size: 18px; font-weight: 700; color: #155724; }

/* Dashboard: welfare at a glance */
.dash-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
@media (min-width: 992px) { .dash-hero { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.hero-card { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.hero-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.10); transform: translateY(-1px); color: inherit; }
.hero-label { font-size: 13px; color: #64748b; font-weight: 600; }
.hero-label .bi { color: var(--brand-navy); margin-right: 4px; }
.hero-value { font-size: 28px; font-weight: 700; color: var(--brand-navy); line-height: 1.2; margin: 4px 0 2px; }
.hero-sub { font-size: 12.5px; color: #64748b; }
.meter { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 6px 0 6px; }
.meter span { display: block; height: 100%; background: #1e7e34; border-radius: 4px; }
.all-clear { color: #155724; background: #e9f7ee; border-radius: 6px; padding: 10px 12px; }
.todo-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #f1d9a6; background: #fff8eb; border-radius: 6px; color: #5c4400; text-decoration: none; }
.todo-item:hover { background: #fdf0d5; color: #5c4400; }
.todo-item > .bi:first-child { color: #c77700; font-size: 17px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: stretch; height: 100%; position: relative; outline: none; }
.bar-track { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid #cbd5e1; }
.bar { width: 100%; max-width: 36px; margin: 0 auto; background: #93a7c8; border-radius: 4px 4px 0 0; }
.bar.bar-now { background: var(--brand-navy); }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--brand-navy-dark); }
.bar-label { font-size: 11px; color: #64748b; text-align: center; margin-top: 3px; }
.bar-col[data-tip]:hover::after, .bar-col[data-tip]:focus::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 5; pointer-events: none; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; border-top: 1px solid #e2e8f0; padding-top: 10px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 6px; color: inherit; text-decoration: none; background: #fff; }
.status-chip:hover { background: #f8fafc; color: inherit; }
@media (max-width: 575px) { .bars { gap: 3px; height: 140px; } .bar-label { font-size: 10px; } .hero-value { font-size: 24px; } }
.status-chip.st-active { border-left: 4px solid #1e7e34; }
.status-chip.st-pending { border-left: 4px solid #c77700; }
.status-chip.st-dormant, .status-chip.st-suspended { border-left: 4px solid #94a3b8; }
.status-chip.st-exited, .status-chip.st-deceased { border-left: 4px solid #64748b; }
/* many menus: keep the header on one line on laptop widths */
@media (min-width: 992px) and (max-width: 1440px) {
  header.topbar .brand-name { display: none; }
  header.topbar .user-menu .sub { display: none; }
  header.topbar .navlink, header.topbar .menu > button { padding-left: 8px; padding-right: 8px; }
}

/* Reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.report-head { margin-bottom: 10px; }
.report-org { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 600; }
.report-title { color: var(--brand-navy); }
.report-grid { font-size: 13px; }
.report-grid th, .report-grid td { white-space: nowrap; }
.report-grid td:first-child, .report-grid th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
@media print {
  header.topbar, footer.app-footer, .app-footer, nav.ew-tabs, .flash, .alert { display: none !important; }
  body { background: #fff !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .bg-white, .panel, .stat-tile, .hero-card { box-shadow: none !important; border: 1px solid #ddd; }
  .page-break { break-before: page; }
  .statement-page { break-after: page; }
  .statement-page:last-child { break-after: auto; }
  .table-scroll { overflow: visible !important; }
  .report-grid { font-size: 9.5px; }
  a { color: inherit !important; text-decoration: none !important; }
  @page { size: A4; margin: 12mm; }
  .agm-cover { min-height: 60vh; }
}
header.topbar .nav-bell { position: relative; font-size: 18px; padding: 6px 10px; }
header.topbar .nav-bell .notif-badge { position: absolute; top: 0; right: 0; }

/* Meeting minutes */
.minutes-doc .minute-head { font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-navy); margin: 1.1rem 0 .35rem; font-weight: 700; }
.minutes-body p { max-width: 75ch; line-height: 1.65; }
.minutes-adopt { border-top: 2px solid var(--brand-navy); padding-top: .75rem; }
@media print { .no-print, .app-header, nav, .flash, footer { display: none !important; } .minutes-doc { box-shadow: none !important; max-width: none !important; } }
.user-menu-name { white-space: nowrap; }
.text-brand { color: var(--brand-navy); }
.minute-item { background: #fbfcfe; }
.minute-resolution { border-left: 3px solid var(--brand-navy); padding-left: .75rem; font-weight: 600; max-width: 75ch; }
.minute-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--brand-navy); border-radius: 4px; padding: 1px 6px; margin-right: .5rem; vertical-align: 1px; }
.minute-action { max-width: 75ch; }
.minute-action .minute-tag { background: #9a6400; }
.minute-who { display: block; font-size: .85rem; color: #5a6479; margin-top: .15rem; padding-left: .1rem; }
.minute-resolution { font-weight: 400; }
.attendance-table td { padding: .2rem .4rem; font-size: .9rem; } .attendance-table td:first-child { padding-left: 0; }
/* officials with every menu: drop the menu icons and tighten spacing so the bar stays on one line */
@media (min-width: 901px) and (max-width: 1366px) {
  header.topbar .nav-links > .navlink i, header.topbar .nav-links > .menu > button > i:first-child { display: none; }
  header.topbar .navlink, header.topbar .menu > button { padding-left: 7px; padding-right: 7px; font-size: 13.5px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  header.topbar .user-menu-name { display: none; }
}
.summary-info { background: #eaf1fb; border-left: 4px solid var(--brand-navy); border-radius: 6px; padding: 10px 14px; font-size: .92rem; }
/* selected tab: filled with the theme colour so it is obvious which section is open (all tabbed pages) */
.ew-tabs .ew-tab.active, .ew-tabs .ew-tab.active:hover { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.ew-tabs .ew-tab.active i { color: #fff; }
.ew-tabs .ew-tab { border-top-left-radius: 6px; border-top-right-radius: 6px; }
/* section tabs above a centred form card line up with the card */
.tabs-for-card-wide { max-width: 900px; margin: 0 auto; }
/* sign-in picture code */
.auth-card .captcha-row { display: flex; align-items: center; gap: 8px; }
.auth-card .captcha-img { border: 1px solid #dbe2ea; border-radius: 6px; background: #f1f4f9; max-width: calc(100% - 46px); height: auto; }
.auth-card .captcha-new { width: 38px; height: 38px; border: 1px solid #cfd8e3; background: #fff; border-radius: 6px; color: var(--brand-navy); cursor: pointer; font-size: 18px; }
.auth-card .captcha-new:hover { background: #f1f4f9; }
.auth-card .btn-link-plain { background: none; border: 0; padding: 0; color: var(--brand-navy); font-size: 13px; cursor: pointer; }
.auth-card .password-rules { font-size: 12.5px; margin: 10px 0 0; }
.password-rules li.note::before { content: "\2022"; color: #94a3b8; }
.auth-card .captcha-input { text-transform: uppercase; letter-spacing: 2px; }
.auth-card .captcha-input::placeholder { text-transform: none; letter-spacing: normal; }

/* audit log: keep the changes column readable */
#auditTable td.audit-changes { max-width: 460px; word-break: break-word; }
#outboxTable td.outbox-msg { max-width: 420px; word-break: break-word; }
.filter-chip.filter-chip-warn:not(.active) { border-color: #e6c27a; color: #7a5c00; background: #fff8e1; }

/* User manual and technical reference shown inside the app */
.help-wrap { margin-top: 16px; margin-bottom: 0; }
.help-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.help-frame { display: block; width: 100%; height: calc(100vh - 110px); min-height: 480px; border: 1px solid var(--border, #dfe3e8); border-radius: 8px; background: #fff; }
@media (max-width: 900px) { .help-frame { height: calc(100vh - 170px); } }
