/* =====================================================================
   Njia Field ITR — shared design system ("clean & light")
   Colours come from the County Government of Kiambu logo:
   teal #1A5C4A · dark blue #0A3A52 · red #D63031 · gold accent.
   Every page loads this first; page CSS builds on these tokens.
   ===================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, Arial, sans-serif;
  /* brand */
  --brand: #1A5C4A;          /* Kiambu teal */
  --brand-strong: #134537;
  --brand-soft: #E7F2EE;
  --brand-tint: #CFE5DC;
  --navy: #0A3A52;           /* Kiambu dark blue */
  --navy-soft: #E6EEF3;
  --red: #D63031;            /* Kiambu red */
  --red-soft: #FDECEC;
  --gold: #C98A0C;
  --gold-soft: #FDF4E1;
  --ok: #1F8A5B;
  --ok-soft: #E5F5EC;
  /* neutrals */
  --bg: #F3F6F5;
  --surface: #FFFFFF;
  --surface-2: #F8FAF9;
  --line: #E2E9E7;
  --line-strong: #CCD8D4;
  --text: #13232B;
  --text-2: #3E4F58;
  --muted: #6B7B84;
  /* shape */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(10, 40, 50, .05);
  --shadow: 0 1px 2px rgba(10, 40, 50, .04), 0 6px 20px rgba(10, 40, 50, .06);
  --shadow-lg: 0 12px 40px rgba(10, 40, 50, .14);
  --focus: 0 0 0 3px rgba(26, 92, 74, .22);
  --appbar-h: 60px;
  color-scheme: light;
}

/* The dashboard keeps its dark theme toggle; tokens follow it. */
[data-theme="dark"] {
  --brand: #2FBF8F; --brand-strong: #49D3A3; --brand-soft: rgba(47,191,143,.12); --brand-tint: rgba(47,191,143,.22);
  --navy: #9CC3DA; --navy-soft: rgba(156,195,218,.10);
  --red: #FF6B6B; --red-soft: rgba(255,107,107,.12);
  --gold: #F5B73F; --gold-soft: rgba(245,183,63,.12);
  --ok: #2FD39C; --ok-soft: rgba(47,211,156,.12);
  --bg: #08141B; --surface: #0E212C; --surface-2: #112836; --line: #1B3747; --line-strong: #27495C;
  --text: #E6F0F5; --text-2: #BCD0DA; --muted: #8AA3B0;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --focus: 0 0 0 3px rgba(47,191,143,.3);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ------------------------------------------------------------------ app bar */
.itr-appbar { position: sticky; top: 0; z-index: 900; height: var(--appbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 max(16px, env(safe-area-inset-left)); background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); font-family: var(--font); }
[data-theme="dark"] .itr-appbar { background: rgba(14,33,44,.88); }
.itr-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.itr-brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.itr-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.itr-brand-text b { font-size: 15px; font-weight: 750; color: var(--text); letter-spacing: -.01em; }
.itr-brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itr-nav { display: flex; gap: 4px; margin-left: 8px; }
.itr-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; transition: background .15s, color .15s; }
.itr-nav a svg { width: 17px; height: 17px; }
.itr-nav a:hover { background: var(--surface-2); color: var(--text); }
.itr-nav a.on { background: var(--brand-soft); color: var(--brand); }
.itr-spacer { flex: 1; }
.itr-demo-tag { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #6B4A00; background: #FFE7A3; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.itr-user { position: relative; }
.itr-user > button { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text); }
.itr-user > button:hover { border-color: var(--line-strong); }
.itr-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.itr-user-name { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.itr-user-name b { font-size: 13px; font-weight: 650; }
.itr-user-name span { font-size: 11px; color: var(--muted); }
.itr-caret { width: 14px; height: 14px; color: var(--muted); }
.itr-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.itr-menu.open { display: block; }
.itr-menu .itr-menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.itr-menu .itr-menu-head b { display: block; font-size: 14px; }
.itr-menu .itr-menu-head span { font-size: 12px; color: var(--muted); }
.itr-menu a, .itr-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: var(--r-sm); font-size: 14px; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; }
.itr-menu a:hover, .itr-menu button:hover { background: var(--surface-2); }
.itr-menu svg { width: 17px; height: 17px; color: var(--muted); }
.itr-menu .itr-menu-mobile { display: none; }
@media (max-width: 760px) {
  .itr-nav { display: none; }
  .itr-user-name, .itr-caret { display: none; }
  .itr-user > button { padding: 3px; }
  .itr-menu .itr-menu-mobile { display: flex; }
  .itr-demo-tag { font-size: 10px; padding: 3px 8px; }
}

/* ------------------------------------------------------------------ shared building blocks */
.ui-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-sm); padding: 10px 16px; font-size: 14px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none; }
.ui-btn:active { transform: translateY(1px); }
.ui-btn-primary { background: var(--brand); color: #fff; }
.ui-btn-primary:hover { background: var(--brand-strong); }
.ui-btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.ui-btn-ghost:hover { background: var(--surface-2); }
.ui-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--navy-soft); color: var(--navy); }

/* Show / hide password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted, #6b7a86); border-radius: 8px; cursor: pointer; padding: 0; }
.pw-eye:hover { color: var(--brand, #1A5C4A); background: var(--brand-soft, rgba(26,92,74,.08)); }
.pw-eye:focus-visible { outline: 2px solid var(--brand, #1A5C4A); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; position: static !important; transform: none !important; pointer-events: none; }
input[type="password"]::-ms-reveal { display: none; }

/* Installable app: suggestion banner (field tool) and iPhone help */
.itr-install-item[hidden] { display: none !important; }
.itr-install-banner { display: flex; align-items: center; gap: 12px; margin: 12px auto 0; max-width: 560px; width: calc(100% - 24px); padding: 10px 12px; background: #fff; border: 1px solid var(--line, #d6e3df); border-left: 5px solid var(--brand, #1A5C4A); border-radius: 12px; box-shadow: 0 6px 18px rgba(10,58,82,.08); font-size: 13.5px; }
.itr-install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.itr-install-banner div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.itr-install-banner b { color: var(--text, #13232b); font-size: 14px; }
.itr-install-banner span { color: var(--muted, #6b7a86); line-height: 1.35; }
.itr-install-banner .itr-ib-go { flex: none; width: auto !important; margin: 0 !important; padding: 8px 14px !important; border: 0; border-radius: 999px; background: var(--brand, #1A5C4A) !important; color: #fff !important; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: none !important; }
.itr-install-banner .itr-ib-x { flex: none; width: 32px !important; height: 32px; margin: 0 !important; padding: 0 !important; border: 0; background: transparent !important; color: var(--muted, #6b7a86) !important; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: none !important; }
.itr-ios-help { position: fixed; inset: 0; z-index: 10000; background: rgba(10,30,40,.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.itr-ios-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 20px; font-size: 15px; line-height: 1.5; color: #13232b; }
.itr-ios-card ol { padding-left: 20px; margin: 10px 0; }
.itr-ios-card p { margin: 0 0 12px; color: #5a6b78; }
.itr-ios-card button { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #1A5C4A; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }

/* "Payments last updated" warning (ITR.freshness) */
.itr-stale { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #FFF6E5; border: 1px solid #F3D9A4; color: #6B4600; font-size: 14px; line-height: 1.45; }
.itr-stale a { color: inherit; font-weight: 700; }
