:root {
  color-scheme: light;
  --brand: #0b6b3a;
  --brand-dark: #084d2a;
  --brand-tint: #e8f3ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --axis: #c3c2b7;
  --page: #f4f6f5;
  --surface: #fcfcfb;
  --card: #ffffff;
  --hover: #f1f4f2;
  --error: #b42318;

  /* chart roles */
  --accent: #0b6b3a;            /* single-series marks */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info: #2a78d6;
  --good-text: #006300;

  --radius: 10px;
  --focus: 0 0 0 3px rgba(11, 107, 58, .28);
  --sidebar: 236px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand: #3fb27a;
    --brand-dark: #0e3d25;
    --brand-tint: #17271f;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --axis: #383835;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --card: #1a1a19;
    --hover: #232321;
    --error: #f97066;
    --accent: #3fb27a;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --info: #3987e5;
    --good-text: #0ca30c;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.sidebar {
  background: var(--brand-dark); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.brand .emblem {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #084d2a;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.brand strong { display: block; font-size: 15px; }
.brand span { font-size: 11.5px; opacity: .8; line-height: 1.3; display: block; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #fff;
  text-decoration: none; opacity: .85; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.nav a.active { background: rgba(255,255,255,.16); opacity: 1; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .sep { height: 1px; background: rgba(255,255,255,.15); margin: 10px 8px; }
.sidebar .me { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; }
.sidebar .me strong { display: block; font-size: 14px; }
.sidebar .me button { margin-top: 8px; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; }

.main { min-width: 0; padding: 22px 28px 40px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 2px 0 0; }
.page-head .grow { flex: 1; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 8px 14px; font-weight: 600;
  border: 1px solid var(--brand); background: transparent; color: var(--brand); cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-tint); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.92); }
.btn.danger { border-color: var(--critical); color: var(--critical); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
input, select, textarea {
  border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
label.field input, label.field select, label.field textarea { width: 100%; }
.field-error { color: var(--error); font-size: 12.5px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filters select, .filters input { padding: 7px 9px; font-size: 14px; max-width: 220px; }
.filters input[type=search] { min-width: 220px; }
.filters .reset { background: none; border: 0; color: var(--brand); cursor: pointer; font-weight: 600; padding: 6px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--brand-tint); color: var(--brand); font-weight: 600; }

/* ---------- cards & tiles ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card h2 { font-size: 16px; margin: 0; }
.card .card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.card .card-head > div { flex: 1; min-width: 0; }
.card .card-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; font-size: 13px; padding: 2px 4px; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.tile .label { font-size: 13px; color: var(--ink-2); }
.tile .value { font-size: 28px; font-weight: 650; margin-top: 4px; letter-spacing: -.01em; }
.tile .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.tile.hero .value { font-size: 52px; line-height: 1.05; }
.meter { height: 6px; border-radius: 3px; background: var(--brand-tint); margin-top: 8px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }

/* ---------- charts ---------- */
.bars { display: grid; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: minmax(90px, 36%) 1fr; gap: 10px; align-items: center;
  padding: 3px 4px; border-radius: 6px; background: none; border: 0; text-align: left; width: 100%;
}
.bar-row.clickable { cursor: pointer; }
.bar-row:hover, .bar-row:focus-visible { background: var(--hover); }
.bar-row .bl { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .bar { height: 14px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.bar-row .bv { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars.scroll { max-height: 380px; overflow-y: auto; padding-right: 4px; }

.cols svg { display: block; width: 100%; height: auto; overflow: visible; }
.cols .grid-line { stroke: var(--line); stroke-width: 1; }
.cols .baseline { stroke: var(--axis); stroke-width: 1; }
.cols .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cols .col { fill: var(--accent); }
.cols .hit { fill: transparent; cursor: default; }
.cols .hit:hover + .col, .cols g.on .col { filter: brightness(1.18); }
.cols .hover-band { fill: var(--hover); }

.stack { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; }
.stack > i { display: block; height: 100%; min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13px; }
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.legend .key b { font-weight: 650; }
.legend .key .muted { font-size: 12.5px; }

.viz-tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); max-width: 260px;
}
.viz-tip .tv { font-size: 15px; font-weight: 650; }
.viz-tip .tl { color: var(--ink-2); }
.viz-tip .row { display: flex; align-items: center; gap: 6px; }
.viz-tip .lk { width: 12px; height: 2px; border-radius: 1px; flex: none; }

.empty { color: var(--ink-2); font-size: 14px; padding: 18px 0; text-align: center; }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.chip .dot { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; line-height: 1; flex: none; }
.chip.s-submitted .dot { background: var(--info); }
.chip.s-under-review .dot { background: var(--warning); color: #0b0b0b; }
.chip.s-approved .dot { background: var(--good); }
.chip.s-returned .dot { background: var(--critical); }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pipeline a { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.pipeline a:hover { background: var(--hover); }
.pipeline .n { font-size: 24px; font-weight: 650; margin-top: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.link { cursor: pointer; }
table.data td.small:first-child { white-space: nowrap; }
table.data tr.link:hover td { background: var(--hover); }
table.data td.title { min-width: 220px; }
table.data td.title a { color: var(--ink); font-weight: 600; text-decoration: none; }
table.data td.title a:hover { color: var(--brand); text-decoration: underline; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; font-size: 13.5px; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recent li:last-child { border: 0; }
.recent a { color: var(--ink); font-weight: 600; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent a:hover { color: var(--brand); }
.recent .meta { font-size: 12.5px; color: var(--ink-2); }
.recent .grow { flex: 1; min-width: 0; }

/* ---------- groups ---------- */
.groups { display: grid; gap: 10px; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.group summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: grid;
  grid-template-columns: minmax(160px, 1.6fr) repeat(4, minmax(90px, 1fr)) minmax(170px, 1.3fr) 18px; gap: 12px; align-items: center;
}
.group summary::-webkit-details-marker { display: none; }
.group summary:hover { background: var(--hover); border-radius: var(--radius); }
.group .gname { font-weight: 650; overflow-wrap: anywhere; }
.group .gbar { height: 6px; border-radius: 0 3px 3px 0; background: var(--accent); margin-top: 6px; min-width: 2px; }
.group .stat .k { font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.group .stat .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.group .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.group .caret { transition: transform .15s; color: var(--muted); }
.group[open] .caret { transform: rotate(90deg); }
.group .gbody { padding: 0 16px 14px; border-top: 1px solid var(--line); }

/* ---------- activity dashboard ---------- */
.dash-head { align-items: flex-end; margin-bottom: 14px; }
.eyebrow-sm { margin: 0 0 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.dash-head h1 { font-size: 26px; }
.head-actions { display: flex; gap: 8px; }
.filter-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 2px; margin-bottom: 16px; }
.filter-panel .filters { margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: 1.7fr repeat(5, 1fr); gap: 12px; margin-bottom: 8px; }
.kpi { padding: 16px; display: flex; flex-direction: column; }
.kpi .label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -.01em; white-space: nowrap; }
.kpi .value .of { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.kpi .sub { font-size: 12.5px; color: var(--ink-2); margin-top: auto; padding-top: 6px; }
.kpi .meter { margin-top: 8px; }
.kpi.hero .value { font-size: 44px; line-height: 1.05; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.spark polyline { stroke: var(--axis); }
.spark circle { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.delta { font-weight: 600; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical); }
.delta.flat { color: var(--ink-2); font-weight: 500; }
.delta b { font-size: 10px; }

.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin: 22px 0 10px;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.grid-3eq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-stats .v { font-size: 20px; font-weight: 650; }
.mini-stats .k { font-size: 12px; color: var(--ink-2); }

table.league th .sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
table.league th .sort:hover { color: var(--brand); }
table.league th[aria-sort=ascending] .sort, table.league th[aria-sort=descending] .sort { color: var(--ink); }
table.league .rank { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.league td { vertical-align: middle; }
.youth-cell { position: relative; min-width: 150px; }
.youth-cell .inline-bar { position: absolute; left: 10px; top: 50%; height: 6px; margin-top: 7px; max-width: calc(100% - 20px); background: var(--accent); opacity: .35; border-radius: 0 3px 3px 0; }
.show-all { margin-top: 10px; }
.silent { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.silent .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--hover); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }

.meters { display: grid; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.meter-head .mk { font-weight: 600; }
.meter-head .mv { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.meter-row:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.grid-3eq .pipeline { grid-template-columns: repeat(2, 1fr); }
.stack-wrap { margin-top: 14px; }
.stack.thin { height: 8px; }
.stack .seg-submitted { background: var(--info); }
.stack .seg-under-review { background: var(--warning); }
.stack .seg-approved { background: var(--good); }
.stack .seg-returned { background: var(--critical); }
.right-num { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Jawan Markaz module ---------- */
.chip.p-on .dot, .status-stack .p-on { background: var(--good); }
.chip.p-ahead .dot, .status-stack .p-ahead { background: var(--info); }
.chip.p-slight .dot, .status-stack .p-slight { background: var(--warning); }
.chip.p-slight .dot { color: #0b0b0b; }
.chip.p-sig .dot, .status-stack .p-sig { background: var(--critical); }
.chip.p-none .dot, .status-stack .p-none { background: var(--axis); color: var(--ink); }
.status-stack { height: 16px; margin-top: 4px; }
.as-overview { margin: 14px 0; }
.as-key { background: none; border: 0; padding: 0; cursor: pointer; }
.as-key:hover .chip { border-color: var(--ink-2); }
.as-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.as-tools { margin-bottom: 10px; }
.as-tools input[type=search] { flex: 1 1 200px; max-width: none; }
.as-count { margin: 0 0 6px; }
.as-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.as-row, .as-body { min-width: 0; }
.as-row { border: 1px solid var(--line); border-radius: 8px; }
.as-row[open] { border-color: var(--axis); }
.as-row summary {
  list-style: none; cursor: pointer; padding: 10px 12px; display: grid; align-items: center; gap: 10px;
  grid-template-columns: minmax(170px, 1.6fr) minmax(150px, auto) minmax(90px, .8fr) minmax(90px, .8fr) 60px 80px 14px;
}
.as-row summary::-webkit-details-marker { display: none; }
.as-row summary:hover { background: var(--hover); border-radius: 8px; }
.as-row .caret { color: var(--muted); transition: transform .15s; }
.as-row[open] .caret { transform: rotate(90deg); }
.as-name strong { display: block; }
.as-flag { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--critical); }
.as-stat { font-size: 13.5px; }
.as-stat span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.as-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.as-latest-head { font-size: 13.5px; padding: 10px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.as-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.as-block { background: var(--hover); border-radius: 8px; padding: 8px 10px; }
.as-block h4 { margin: 0 0 3px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.as-block p { margin: 0; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.as-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.as-photos figure { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.as-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.as-photos figcaption { font-size: 11.5px; padding: 4px 6px; }
.as-hist-title { margin: 16px 0 6px; font-size: 13px; }
.as-issue { max-width: 320px; white-space: normal; }
.jm-card { margin-bottom: 14px; }
.jm-card .status-stack { margin: 10px 0 4px; }
.jm-card .jm-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 12px; }
.jm-card .jm-counts a { text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.jm-card .jm-counts a:hover { background: var(--hover); }
.jm-card .jm-counts .n { font-size: 22px; font-weight: 650; margin-top: 4px; }
@media (max-width: 1100px) {
  .as-layout { grid-template-columns: minmax(0, 1fr); }
  .as-row summary { grid-template-columns: minmax(150px, 1.5fr) auto minmax(80px, .8fr) minmax(80px, .8fr) 14px; }
  .as-row summary .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .as-row summary { grid-template-columns: 1fr auto 14px; }
  .as-row summary .as-stat { display: none; }
}

/* ---------- Jawan Markaz progress report ---------- */
.jr-scope select { min-width: 220px; }
.jr-summary { margin-bottom: 14px; }
.dar-table.jr-sum tbody th { width: 26%; white-space: nowrap; }
.dar-table.jr-sum td.num { width: 90px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.dar-table.jr-sum tr.key td { font-size: 13.5px; font-weight: 400; color: var(--ink); }
.dar-table.jr-sum tr.key td.num { font-size: 18px; font-weight: 700; }
.jr-detail td.wide { white-space: normal; min-width: 220px; max-width: 320px; }
.jr-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; max-height: 220px; overflow-y: auto; }
@media (max-width: 760px) {
  .jr-scope select { min-width: 0; }
  /* Summary rows: label and count side by side, asset names underneath. */
  .dar-table.jr-sum thead { display: none; }
  .dar-table.jr-sum tbody tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); }
  .dar-table.jr-sum tbody th { white-space: normal; width: auto; }
  .dar-table.jr-sum tbody td { border: 0; }
  .dar-table.jr-sum td.num { width: auto; background: var(--hover); }
  .dar-table.jr-sum tbody td:last-child { grid-column: 1 / -1; padding-top: 4px; }
  .jr-detail td.wide { grid-column: 1 / -1; max-width: none; }
  .jr-text { max-height: none; }
}

/* ---------- page tabs (Daily / Yearly reports) ---------- */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.page-tabs a {
  padding: 10px 16px; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.page-tabs a:hover { color: var(--ink); background: var(--hover); }
.page-tabs a[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
@media (max-width: 760px) { .page-tabs a { flex: 1; text-align: center; padding: 10px 8px; } }

/* ---------- Daily Activity Report ---------- */
.dar-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: var(--brand-dark); color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
}
.dar-banner .emblem { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #084d2a; display: grid; place-items: center; font-weight: 700; flex: none; }
.dar-banner h1 { margin: 0; font-size: clamp(17px, 2.2vw, 22px); letter-spacing: .02em; text-transform: uppercase; }
.dar-banner p { margin: 2px 0 0; font-size: clamp(11px, 1.2vw, 13px); opacity: .85; text-transform: uppercase; letter-spacing: .05em; }

.dar-controls { padding: 12px 14px; margin-bottom: 12px; }
.dar-controls-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dar-controls-row .spacer { flex: 1; }
.dar-day, .dar-range, .dar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dar-range label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dar-controls input[type=date] { padding: 6px 8px; min-width: 0; }
.dar-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.chip-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; cursor: pointer;
}
.chip-btn:hover { background: var(--hover); color: var(--ink); }
.chip-btn[aria-pressed=true] { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.dar-date-strip {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--warning); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
}
.dar-date-strip > span:first-child { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.dar-date-strip strong { font-size: 18px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hover); border: 1px solid var(--line); }
.dar-jumps { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* Wide screens: three columns. Laptops: two, chart below. Phones: one. */
.dar-grid {
  display: grid; gap: 12px; margin-bottom: 14px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  grid-template-areas: "metrics highlights" "chart chart";
}
.dar-metrics { grid-area: metrics; }
.dar-highlights { grid-area: highlights; }
.dar-chart { grid-area: chart; }
@media (min-width: 1560px) {
  .dar-grid { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr) minmax(0, 1.6fr); grid-template-areas: "metrics highlights chart"; }
}
.dar-card { padding: 0; overflow: hidden; }
.dar-card .card-head { padding: 14px 16px 0; }
.dar-card #dar-chart { padding: 0 12px 12px; }

.dar-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dar-table thead th { background: var(--brand-dark); color: #fff; font-weight: 600; text-align: left; padding: 9px 12px; font-size: 13px; }
.dar-table tbody th { text-align: left; font-weight: 600; color: var(--ink); padding: 8px 12px; background: var(--hover); vertical-align: top; }
.dar-table.metrics tbody th { white-space: nowrap; }
.dar-table.highlights tbody th { width: 34%; }
.dar-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dar-table.metrics td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dar-table tbody tr + tr th { border-top: 1px solid var(--card); }
.dar-table tr.key td { font-size: 20px; font-weight: 700; color: var(--critical); }
.dar-table tr.key th, .dar-table tr.key td { background: color-mix(in srgb, var(--info) 10%, var(--card)); }
.dar-table .mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; color: #fff; margin-right: 6px; vertical-align: -2px; }
.dar-table .mark.ok { background: var(--good); }
.dar-table .mark.no { background: var(--critical); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tags.collapsed [data-extra] { display: none; }
.tags-toggle { padding: 2px 6px; }
.tag.ok { background: color-mix(in srgb, var(--good) 12%, var(--card)); border-color: color-mix(in srgb, var(--good) 35%, var(--card)); color: var(--ink); }
.tag.no { background: color-mix(in srgb, var(--critical) 8%, var(--card)); border-color: color-mix(in srgb, var(--critical) 25%, var(--card)); color: var(--ink); }

.dar-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 16px; color: var(--ink-2); }
.dar-empty strong { color: var(--ink); }
.dar-empty .dar-jumps { margin: 0; }
.small-empty { padding: 36px 16px 40px; }

.legend-top { margin: 0 0 6px; }
.cols .tick.val { fill: var(--ink-2); font-size: 10px; }
.cols.scroll-x { overflow-x: auto; }
table.data.dar-detail thead th { white-space: nowrap; background: var(--brand-dark); color: #fff; border-bottom: 0; }
.dar-detail th:first-child { border-top-left-radius: 6px; }
.dar-detail th:last-child { border-top-right-radius: 6px; }
.dar-detail td { white-space: nowrap; }
.dar-detail td.title { white-space: normal; min-width: 220px; }
.dar-detail tfoot th, .dar-detail tfoot td { background: var(--brand-tint); color: var(--ink); font-weight: 700; padding: 9px 10px; }
.dar-detail tfoot th { text-align: left; }
.nowrap { white-space: nowrap; }

@media (max-width: 760px) {
  .dar-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "metrics" "highlights" "chart"; }
  .dar-controls-row .spacer { display: none; }
  .dar-day, .dar-range, .dar-actions, .dar-controls-row > .seg { width: 100%; }
  .dar-day input { flex: 1; }
  .dar-range label { flex: 1 1 140px; }
  .dar-range input { flex: 1; }
  .dar-actions .btn { flex: 1; justify-content: center; }
  .dar-jumps { margin-left: 0; }
  .dar-table.metrics tbody th { white-space: normal; }
  .dar-table.highlights thead { display: none; }
  .dar-table.highlights tbody tr { display: block; border-bottom: 1px solid var(--line); }
  .dar-table.highlights tbody th, .dar-table.highlights tbody td { display: block; width: auto; border: 0; }
  .dar-table.highlights tbody th { padding-bottom: 4px; }

  /* Activity table becomes one card per activity. */
  .dar-detail thead { display: none; }
  .dar-detail, .dar-detail tbody, .dar-detail tfoot { display: block; }
  .dar-detail tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
  .dar-detail td, .dar-detail tfoot th { border: 0; padding: 3px 0; white-space: normal; text-align: left !important; background: none; }
  .dar-detail td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
  .dar-detail td.title { grid-column: 1 / -1; min-width: 0; order: -1; }
  .dar-detail td.title::before, .dar-detail td.no-print::before, .dar-detail td.filler { display: none; }
  .dar-detail tfoot tr { background: var(--brand-tint); }
  .dar-detail tfoot th { grid-column: 1 / -1; }
}

/* ---------- Yearly report ---------- */
.yr-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.yr-field select { max-width: 100%; }
.yr-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
}
.yr-hero-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-2); }
.yr-hero-value { font-size: clamp(40px, 6vw, 56px); font-weight: 700; line-height: 1.05; margin: 4px 0; }
.yr-hero-sub { font-size: 13px; color: var(--ink-2); }
.yr-gender { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.yr-gender div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.yr-gender span { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.yr-gender strong { font-size: 24px; }
/* Four category cards: 2 x 2, four across on very wide screens, one column on phones. */
.yr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
@media (min-width: 1700px) { .yr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .yr-grid { grid-template-columns: minmax(0, 1fr); } }
.yr-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.yr-table th { text-align: left; font-weight: 500; padding: 7px 0; border-bottom: 1px solid var(--line); }
.yr-table td { padding: 7px 0 7px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.yr-table td.num:nth-child(2) { font-weight: 650; }
.yr-table tr.total th, .yr-table tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--axis); }
.yr-sub-head { margin-top: 18px; }
.yr-note { margin: 12px 0 0; }
.yr-block { margin-bottom: 14px; }
.yr-block .table-wrap { margin-top: 14px; }
.yr-wide th, .yr-wide td { white-space: nowrap; }
.yr-wide tr.yr-total th, .yr-wide tr.yr-total td { background: var(--brand-tint); font-weight: 700; }
@media (max-width: 760px) {
  .yr-gender { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .yr-gender div { padding: 8px 10px; }
  .yr-gender strong { font-size: 18px; }
  .yr-field { width: 100%; }
  .yr-field select { flex: 1; }
}

/* ---------- download menu ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px;
}
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 7px; padding: 9px 10px; cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--hover); outline: none; }
.menu-list strong { display: block; font-size: 14px; }
.menu-list span { display: block; font-size: 12.5px; color: var(--ink-2); }
.pdf-link { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ---------- district portal ---------- */
.upload-cta {
  display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink);
  border: 2px dashed var(--brand); background: var(--brand-tint); margin-bottom: 14px; padding: 22px;
}
.upload-cta:hover { filter: brightness(.98); }
.upload-cta .plus {
  width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff; flex: none;
  display: grid; place-items: center; font-size: 28px; line-height: 1;
}
.upload-cta strong { display: block; font-size: 17px; }
.upload-cta .muted { display: block; font-size: 14px; }
.needs-fix { border-left: 4px solid var(--critical); margin-bottom: 14px; }
.district-tiles { grid-template-columns: repeat(5, 1fr); }
.district-tiles a.tile { text-decoration: none; color: var(--ink); }
.district-tiles a.tile:hover { background: var(--hover); }
.district-tiles .chip { margin-bottom: 2px; }

/* ---------- report detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.kv { display: grid; grid-template-columns: minmax(150px, 36%) 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-card + .section-card { margin-top: 14px; }
.section-card h2 { margin-bottom: 12px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
.timeline li::after { content: ''; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--ink-2); font-size: 12px; }
.timeline .body { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.plain-list { margin: 0; padding-left: 18px; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.photo-gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-gallery figcaption { padding: 6px 10px; font-size: 12.5px; display: grid; gap: 2px; }
.geo.ok { color: var(--brand); font-weight: 600; }
.geo.no { color: var(--critical); font-weight: 600; }
.coverage img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-top: 6px; }
.notice { border-left: 4px solid var(--brand); background: var(--brand-tint); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.notice.warn { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--card)); }

/* ---------- dialog & toast ---------- */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: var(--hover); padding: 10px 12px; border-radius: 8px; user-select: all; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 8px; z-index: 60; font-size: 14px; max-width: calc(100vw - 32px); }

.loading { opacity: .55; transition: opacity .15s; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-3eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3eq > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tiles .hero { grid-column: 1 / -1; }
  .group summary { grid-template-columns: 1fr 1fr 1fr 18px; }
  .group summary .hide-md { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-dark); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; }
  .main { padding: 16px; }
  .grid-2, .grid-3, .grid-3eq, .detail-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis .hero { grid-column: 1 / -1; }
  .dash-head .head-actions { width: 100%; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: 8px; }
  .two { grid-template-columns: 1fr; }
  .filters select, .filters input, .filters input[type=search] { flex: 1 1 140px; max-width: none; min-width: 0; }
}
@media (max-width: 520px) {
  .tile.hero .value { font-size: 44px; }
  .tile .value { font-size: 22px; white-space: nowrap; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .group summary { grid-template-columns: 1fr 1fr 18px; }
  .group summary > div:first-child { grid-column: 1 / -1; }
  .group summary .hide-sm { display: none; }
}

@media print {
  .sidebar, .topbar, .filters, .actions-row, .no-print, .link-btn { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .card { border: 0; padding: 0 0 12px; }
  .detail-grid { grid-template-columns: 1fr; }
}
.attach-title { font-size: 14px; margin: 16px 0 8px; }

/* ---------- Ehsas Nowjawan module ---------- */
.en-alert { border-left: 4px solid var(--critical); margin: 14px 0; }
.en-dups { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.en-dup-tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--critical); border: 1px solid color-mix(in srgb, var(--critical) 40%, var(--card)); border-radius: 999px; padding: 0 7px; }
.en-dup-row td { background: color-mix(in srgb, var(--critical) 6%, var(--card)); }
.en-pipeline { grid-template-columns: repeat(2, 1fr); }
.en-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.en-summary { margin-bottom: 14px; }
.dar-table.en-sum tbody th { width: auto; }
.dar-table.en-sum tfoot th, .dar-table.en-sum tfoot td { background: var(--brand-tint); font-weight: 700; padding: 8px 12px; }
.dar-table.en-sum tfoot td { text-align: right; }
.er-search { flex: 1 1 260px; min-width: 0; padding: 5px 10px; border-radius: 999px; }
.en-card .en-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 4px; }
.en-card .en-figs div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.en-card .en-figs span { display: block; font-size: 12px; color: var(--ink-2); }
.en-card .en-figs strong { font-size: 20px; }
@media (max-width: 900px) { .en-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dar-table.en-sum thead { display: table-header-group; }
  .dar-table.en-sum tbody tr { display: table-row; }
  .dar-table.en-sum tbody td:last-child { padding-top: 8px; }
}

/* ---------- Human Resources ---------- */
.hr-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; border: 1px solid var(--line); }
.hr-initials { display: inline-grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.hr-districts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hr-district { display: grid; gap: 2px; text-decoration: none; color: var(--ink); padding: 12px 14px; }
.hr-district:hover { background: var(--hover); }
.hr-district-n { font-size: 20px; font-weight: 700; margin-top: 4px; }
.hr-table td { vertical-align: middle; }
.hr-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.hr-profile-head h1 { margin: 2px 0; font-size: 24px; }
.hr-profile-head p { margin: 0; }
.hr-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; color: var(--ink-2); }
.hr-chain a { color: var(--ink); }
.hr-chain small { color: var(--ink-2); }
.hr-form { max-width: 1000px; }
.hr-form fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.hr-form legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.hr-form-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: start; }
.hr-photo { display: grid; justify-items: center; gap: 8px; text-align: center; }
.hr-form-h { font-size: 14px; color: var(--brand); border-top: 1px solid var(--line); padding-top: 14px; margin: 8px 0 10px; }
.hr-form .field-error { display: block; margin-top: 3px; }
.hr-officer { grid-column: 1 / -1; }
dialog.wide-dialog { width: min(760px, calc(100vw - 32px)); }

.hr-tree, .hr-tree ul { list-style: none; margin: 0; padding: 0; }
.hr-tree ul { padding-left: 22px; border-left: 1px dashed var(--axis); margin-left: 9px; }
.hr-tree li { margin: 2px 0; }
.hr-tree summary { cursor: pointer; list-style: none; padding: 3px 0; }
.hr-tree summary::-webkit-details-marker { display: none; }
.hr-tree summary::before { content: '▸'; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
.hr-tree details[open] > summary::before { transform: rotate(90deg); }
.hr-tree .tr-leaf { padding: 3px 0 3px 16px; }
.tr-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 6px; border-radius: 6px; }
.tr-row.tr-hit { background: color-mix(in srgb, var(--warning) 35%, var(--card)); }
.tr-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.tr-name:hover { color: var(--brand); text-decoration: underline; }
.tr-desig { color: var(--ink-2); font-size: 13.5px; }
.tr-count { font-size: 12px; color: var(--muted); }
.tr-root strong { font-size: 15px; }

.hr-report-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 14px; }
.hr-report-btn { text-align: left; cursor: pointer; padding: 10px 12px; font: inherit; font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.hr-report-btn:hover { background: var(--hover); }
.hr-report-btn[aria-pressed=true] { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.hr-report-head h2 { font-size: 20px; margin: 2px 0; }
.hr-report-head p { margin: 0 0 10px; }
.hr-report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.hr-report-summary div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.hr-report-summary span { display: block; font-size: 12px; color: var(--ink-2); }
.hr-report-summary strong { font-size: 20px; }
.hr-report-group { font-size: 14px; margin: 16px 0 6px; color: var(--brand); }
.hr-report-table td, .hr-report-table th { font-size: 12.5px; padding: 6px 8px; }
.hr-pre { white-space: pre; }
@media (max-width: 760px) {
  .hr-form-grid { grid-template-columns: 1fr; }
  .hr-tree ul { padding-left: 12px; }
}
@media print {
  .hr-report-picker, .page-tabs { display: none !important; }
  .hr-report-table td, .hr-report-table th { font-size: 10px; padding: 3px 5px; }
  .hr-tree details > summary::before { display: none; }
}

/* ---------- Ehsaas Naujawan bank partners ---------- */
.pu-bank { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pu-bank .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.pu-banks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.pu-bank-card { padding: 16px; }
.pu-bank-card p { margin: 6px 0 0; }
.pu-bank-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; }
.pu-due { font-size: 13.5px; font-weight: 600; }
.pu-due.late { color: var(--error); }
.pu-due.ok { color: var(--good-text); }
.pu-ret { color: var(--error); }
.pu-warn { font-size: 12px; color: var(--ink); background: color-mix(in srgb, var(--warning) 25%, var(--card)); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.pu-kpis, .pu-kpis6 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.pu-kpis6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pu-kpis .kpi .value, .pu-kpis6 .kpi .value { font-size: 24px; }
.pu-checks { border-left: 4px solid var(--warning); margin-bottom: 14px; }
.pu-checks h2 { font-size: 15px; margin: 0 0 6px; }
.pu-checks ul { margin: 0; padding-left: 18px; }
.pu-figures td:first-child { width: 28px; }
.pu-up { color: var(--good-text); white-space: nowrap; }
.pu-down { color: var(--error); white-space: nowrap; }
.pu-files { list-style: none; margin: 0; padding: 0; }
.pu-files li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pu-files li:first-child { border-top: 0; }
.pu-files a { overflow-wrap: anywhere; }
.pu-status-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pu-actions { flex-wrap: wrap; }

.pf-intro { max-width: 760px; }
.pf-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; overflow-x: auto; counter-reset: s; }
.pf-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pf-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); font-weight: 700; font-size: 12px; }
.pf-steps li.done span { background: var(--brand-tint); color: var(--brand); }
.pf-steps li[aria-current=step] { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.pf-steps li[aria-current=step] span { background: var(--brand); color: #fff; }
.pf-form { max-width: 980px; padding: 20px 22px; }
.pf-form h2 { font-size: 18px; margin: 0 0 12px; }
.pf-sub { font-size: 14px; color: var(--brand); margin: 16px 0 10px; }
.pf-note { background: var(--brand-tint); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.pf-num { display: flex !important; flex-direction: column; }
.pf-num > span { flex: 1; font-weight: 500 !important; }
.pf-num em, .pf-file em { color: var(--ink-2); font-style: normal; }
.pf-num input { max-width: 260px; font-variant-numeric: tabular-nums; }
.pf-date input { max-width: 220px; }
.pf-partners { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; max-width: 420px; }
.pf-partners legend { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.pf-radio { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--muted); }
.pf-radio.on { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); font-weight: 600; }
.pf-file { border-top: 1px solid var(--line); padding-top: 12px; }
.pf-file:first-of-type { border-top: 0; padding-top: 0; }
.pf-file small { display: block; margin-top: 4px; }
.pf-file input[type=file] { padding: 6px; }
.pf-review th { font-weight: 500; color: var(--ink-2); text-align: left; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.pf-actions .spacer { flex: 1; }
.pu-returned { border-left: 4px solid var(--critical); margin-bottom: 14px; }

@media (max-width: 1280px) { .pu-kpis6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .pu-kpis, .pu-kpis6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pu-actions { width: 100%; }
  .pu-actions .btn.primary { order: -1; flex: 1 0 100%; text-align: center; }
  .pu-actions select, .pu-actions .btn { flex: 1 1 auto; }
  .pf-num input { max-width: none; }
  .pf-form { padding: 16px; }
  .pf-steps li:not([aria-current=step]) { font-size: 0; gap: 0; padding: 6px; }
}
@media print {
  .pf-steps, .pf-actions, .pu-status-filter { display: none !important; }
}

/* ---------- Ehsaas Naujawan funds ---------- */
.fd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; }
.fd-kpis.fd-kpis3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fd-kpis .kpi .value { font-size: 24px; }
.fd-summary { margin-bottom: 14px; }
.fd-summary td:first-child { font-weight: 500; }
.data tr.fd-key td { font-weight: 700; background: var(--brand-tint); }
.fd-kind { font-size: 12.5px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: var(--hover); }
.fd-kind.k-gov_release { color: var(--good-text); }
.fd-kind.k-allocation { color: var(--ink-2); }
.fd-kind.k-bank_release { color: var(--brand); background: var(--brand-tint); }
.fd-hint { min-height: 1em; margin: 0; }
@media (max-width: 1100px) { .fd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .fd-kpis, .fd-kpis.fd-kpis3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pu-funds { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding: 14px 18px; margin-bottom: 12px; color: inherit; text-decoration: none; border-left: 4px solid var(--brand); }
.pu-funds:hover { background: var(--hover); }
.pu-funds .label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.pu-funds strong { font-size: 20px; }
.pu-funds .link-btn { margin-left: auto; }
.fd-summary th.num { text-align: right; }

/* ---------- Proposals & sponsorships ---------- */
.chip.ps-received .dot { background: var(--info); }
.chip.ps-under-review .dot { background: var(--warning); color: #0b0b0b; }
.chip.ps-approved .dot { background: var(--good); }
.chip.ps-rejected .dot { background: var(--critical); }
.chip.ps-first-release .dot { background: var(--series-2); }
.chip.ps-report-received .dot { background: var(--series-3); }
.chip.ps-completed .dot { background: var(--good-text); }
.pp-flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.pp-flow a { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.pp-flow a:hover { background: var(--hover); }
.pp-flow strong { font-size: 22px; }
.pp-steps { list-style: none; margin: 0; padding: 0; }
.pp-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pp-steps li:first-child { border-top: 0; }
.pp-tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--axis); display: grid; place-items: center; font-size: 13px; flex: none; }
.pp-steps li.done .pp-tick { background: var(--good); border-color: var(--good); color: #fff; }
@media (max-width: 1100px) { .pp-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pp-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pp-steps .grow { flex: 1; min-width: 0; }
.pp-steps .right-num { font-weight: 650; white-space: nowrap; }
.chip.ps-submitted .dot { background: var(--info); }
.chip.ps-pending-approval .dot { background: var(--serious); }
.chip.ps-for-signature .dot, .chip.ps-signed .dot { background: var(--series-2); }
.chip.ps-issued .dot { background: var(--series-3); }
.pp-flow { grid-template-columns: repeat(9, minmax(0, 1fr)); }
@media (max-width: 1300px) { .pp-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pp-desks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pp-desks a { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.pp-desks a:hover { background: var(--hover); }
.pp-desks a.mine { border-color: var(--brand); background: var(--brand-tint); }
.pp-desks strong { font-size: 26px; }
.pp-desk-name { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 1100px) { .pp-desks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pp-desks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pp-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 14px; border-left: 4px solid var(--brand); }
.pp-action h2 { margin: 2px 0; font-size: 18px; }
.pp-action p { margin: 0; }
.pp-action .grow { flex: 1; min-width: 240px; }
tr.pp-late td { background: color-mix(in srgb, var(--critical) 6%, transparent); }
.rt-phase { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 10px 0 6px; }
.rt-list { list-style: none; margin: 0; padding: 0; }
.rt-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13.5px; position: relative; }
.rt-list li:not(:last-child)::after { content: ''; position: absolute; left: 10.5px; top: 26px; bottom: -6px; width: 1px; background: var(--line); }
.rt-n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--axis); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: var(--card); z-index: 1; }
.rt-done .rt-n { background: var(--good); border-color: var(--good); color: #fff; }
.rt-current .rt-n { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 3px var(--brand-tint); }
.rt-current strong { color: var(--brand); }
.rt-skipped { opacity: .45; }
.rt-now { font-size: 11.5px; font-weight: 700; color: var(--brand); background: var(--brand-tint); border-radius: 999px; padding: 1px 7px; }
.nt-badge { margin-left: auto; background: var(--critical); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-list li a { display: grid; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.nt-list li:first-child a { border-top: 0; }
.nt-list li a:hover { background: var(--hover); }
.nt-list li.unread a { border-left: 3px solid var(--brand); background: var(--brand-tint); }
.pp-flow { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; }

/* ---------- Directorate overview (main dashboard) ---------- */
/* ---------- Main dashboard ---------- */
.dh-hero { margin-bottom: 14px; padding: 24px 28px; border-radius: 14px; color: #fff;
  background: linear-gradient(115deg, #084d2a 0%, #0b6b3a 62%, #128a4d 100%); }
.dh-hero-top { display: flex; align-items: flex-start; gap: 20px; }
.dh-hero .grow { flex: 1; min-width: 0; }
.dh-date { margin: 0 0 4px; font-size: 13px; opacity: .88; }
.dh-hero h1 { margin: 0; font-size: 30px; color: #fff; letter-spacing: -.01em; }
.dh-sum { margin: 6px 0 0; font-size: 15.5px; }
.dh-logos { display: flex; gap: 8px; flex: none; }
.dh-logos img { width: 58px; height: 58px; object-fit: contain; padding: 4px; background: #fff; border-radius: 12px; }
.dh-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dh-total { --t: var(--accent); padding: 26px 28px; border-top: 4px solid var(--t); }
.dh-youth { --t: var(--series-1); }
.dh-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; color: var(--t); background: color-mix(in srgb, var(--t) 14%, var(--card)); }
.dh-ico svg { width: 25px; height: 25px; }
.dh-total h2 { margin: 16px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.dh-total-value { margin: 4px 0 0; font-size: 52px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dh-total-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 760px) {
  .dh-hero { padding: 18px; }
  .dh-hero h1 { font-size: 24px; }
  .dh-logos img { width: 44px; height: 44px; }
  .dh-totals { grid-template-columns: minmax(0, 1fr); }
  .dh-total-value { font-size: 40px; }
}
@media print { .dh-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* DAR refinements: left-aligned letterhead with report details, key figures, district board */
.dar-banner:has(.dar-meta) { justify-content: flex-start; text-align: left; padding: 14px 20px;
  background: linear-gradient(100deg, var(--brand-dark) 0%, color-mix(in srgb, var(--brand-dark) 82%, var(--brand)) 100%); }
.dar-banner:has(.dar-meta) p { margin: 0 0 2px; font-size: 11.5px; }
.dar-banner:has(.dar-meta) h1 { font-size: clamp(18px, 2vw, 22px); }
.dar-banner .grow { flex: 1; min-width: 0; }
.dar-meta { display: flex; gap: 22px; margin: 0; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.25); }
.dar-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.dar-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; white-space: nowrap; }
.dar-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dar-kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.dar-kpi .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dar-kpi strong { font-size: 26px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.dar-kpi strong .of { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.dar-kpi .sub { font-size: 12.5px; color: var(--ink-2); }
.dar-kpi .meter { margin-top: 2px; }
.dar-split { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 2px; }
.dar-split i, .dar-kpi .sw { display: inline-block; }
.dar-kpi .sw { width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.dar-split .m, .dar-kpi .sw.m { background: var(--series-1); }
.dar-split .f, .dar-kpi .sw.f { background: var(--series-2); }
.dar-split .t, .dar-kpi .sw.t { background: var(--series-3); }
.dar-table tr.key td { color: var(--ink) !important; font-size: 18px; }
.dar-table tr.key th, .dar-table tr.key td { background: var(--brand-tint) !important; }
.dar-hl-sub { display: block; font-size: 12.5px; color: var(--ink-2); }
.dar-hl-empty { text-align: center; color: var(--ink-2); padding: 22px 12px !important; background: var(--hover); }
.dar-board-card { margin-bottom: 14px; }
.dar-board-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.dar-board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.dar-board li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; border: 1px solid var(--line); min-width: 0; }
.dar-board li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dar-board li.ok { background: color-mix(in srgb, var(--good) 9%, var(--card)); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); font-weight: 600; }
.dar-board li.no { color: var(--ink-2); }
.dar-board .mark, .dar-board-legend .mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; color: #fff; flex: none; }
.dar-board .mark.ok, .dar-board-legend .mark.ok { background: var(--good); }
.dar-board .mark.no, .dar-board-legend .mark.no { background: var(--critical); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1000px) { .dar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dar-meta { display: none; }
  .dar-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .dar-banner:has(.dar-meta) { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.dar-board-legend { margin-left: auto; }

/* ---------- grouped admin navigation + header bar ---------- */
:root { --sidebar: 262px; }
.sidebar { overflow: hidden; }
.nav-groups { overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.nav-group { margin-bottom: 2px; }
.nav-single { margin-bottom: 2px; text-decoration: none; }
.nav-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: #fff;
  font: inherit; font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; opacity: .9; }
.nav-head:hover { background: rgba(255,255,255,.08); opacity: 1; }
.nav-head svg { width: 18px; height: 18px; flex: none; }
.nav-head span { flex: 1; min-width: 0; }
.nav-head .chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); opacity: .7; transition: transform .15s; flex: none; margin-right: 2px; }
.nav-group.open .nav-head .chev { transform: rotate(45deg); }
.nav-group.current > .nav-head { opacity: 1; }
.nav-group.current > .nav-head svg { color: #9be3bd; }
.nav-head:focus-visible, .nav-sub a:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.nav-sub { position: relative; margin: 2px 0 8px 21px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); }
.nav .nav-sub a { padding: 7px 10px; font-size: 13.5px; font-weight: 500; opacity: .78; gap: 8px; }
.nav .nav-sub a:hover { opacity: 1; }
.nav .nav-sub a.active { background: rgba(255,255,255,.16); opacity: 1; font-weight: 600; position: relative; }
.nav .nav-sub a.active::before { content: ''; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: #9be3bd; }
.nav-sub a span { flex: 1; min-width: 0; }
.nav-head .nt-badge, .nav-sub .nt-badge { margin-left: auto; }

.appbar { display: flex; align-items: center; gap: 16px; padding: 10px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; min-height: 56px; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.crumbs strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--muted); }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.appbar-bell { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.appbar-bell:hover { background: var(--hover); color: var(--ink); }
.appbar-bell svg { width: 20px; height: 20px; }
.appbar-bell .nt-badge { position: absolute; top: 2px; right: 0; margin: 0; padding: 0 5px; font-size: 10px; line-height: 16px; }
.appbar-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; color: inherit; text-decoration: none; border: 1px solid var(--line); }
.appbar-user:hover { background: var(--hover); }
.appbar-user strong { display: block; font-size: 13.5px; line-height: 1.2; }
.appbar-user small { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.2; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
@media (max-width: 900px) { .appbar { display: none; } }
@media print { .appbar { display: none !important; } }

/* ---------- proposal case file ---------- */
.pd-head { margin-bottom: 14px; }
.pd-crumb { margin: 0 0 6px; }
.pd-crumb a { color: var(--brand); }
.pd-title { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.pd-title .grow { flex: 1; min-width: 260px; }
.pd-title h1 { margin: 2px 0 0; font-size: 26px; letter-spacing: -.01em; }
.pd-ref { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.pd-meta { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 14px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pd-meta > div { padding: 10px 14px; border-left: 1px solid var(--line); min-width: 0; }
.pd-meta > div:first-child { border-left: 0; }
.pd-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.pd-meta dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-stages { padding: 16px 18px; margin-bottom: 14px; }
.pd-stages ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.pd-stages li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 4px; }
.pd-stages li:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line); }
.pd-stages li.pd-st-done:not(:last-child)::after { background: var(--good); }
.pd-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--axis); background: var(--card); color: var(--ink-2); z-index: 1; }
.pd-st-done .pd-dot { background: var(--good); border-color: var(--good); color: #fff; }
.pd-st-current .pd-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-tint); }
.pd-st-rejected .pd-dot { background: var(--critical); border-color: var(--critical); color: #fff; }
.pd-st-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.pd-st-todo .pd-st-label { color: var(--ink-2); font-weight: 500; }
.pd-st-current .pd-st-label { color: var(--brand); }
.pd-st-rejected .pd-st-label { color: var(--critical); }
.pd-st-date { font-size: 11.5px; color: var(--ink-2); }
.pd-money { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.pd-money > div { padding: 14px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-money > div:first-child { border-left: 0; }
.pd-money span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pd-money strong { font-size: 22px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-money strong.pd-letter { font-size: 17px; padding: 3px 0; }
.pd-money small { font-size: 12.5px; color: var(--ink-2); }
.pd-money .meter { margin-top: 6px; }
.pd-section + .pd-section { margin-top: 14px; }
.pd-section h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 4px; }
.pd-sub { font-size: 13px; font-weight: 500; }
.pd-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-tint); display: grid; place-items: center; font-size: 15px; }
.pd-group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pd-group:first-of-type { border-top: 0; padding-top: 4px; }
.pd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 10px 0 0; }
.pd-fields > div { min-width: 0; }
.pd-fields > div.wide { grid-column: 1 / -1; }
.pd-fields dt { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }
.pd-fields dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pd-docs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pd-docs li { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pd-docs li:hover { background: var(--hover); }
.pd-docs .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pd-docs a { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-docs a:hover { color: var(--brand); text-decoration: underline; }
.pd-docs .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file { width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; flex: none; background: var(--ink-2); }
.pd-file.k-PDF { background: #c43d3d; } .pd-file.k-DOC { background: #2a62b8; } .pd-file.k-XLS { background: #1f7a4a; } .pd-file.k-IMG { background: #8a5cc2; }
.pd-route .meter { margin: 0 0 10px; }
.pd-phase { border-top: 1px solid var(--line); padding: 8px 0; }
.pd-phase summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; list-style: none; }
.pd-phase summary::-webkit-details-marker { display: none; }
.pd-phase summary::before { content: '▸'; color: var(--ink-2); margin-right: -4px; }
.pd-phase[open] summary::before { content: '▾'; }
.pd-phase summary span:first-of-type { flex: 1; }
.pd-ok { color: var(--good-text); font-weight: 600; }
.pd-phase .rt-list { margin-top: 6px; }
@media (max-width: 1200px) { .pd-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pd-meta > div:nth-child(4) { border-left: 0; } .pd-meta > div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) {
  .pd-stages ol { grid-auto-flow: row; grid-auto-columns: auto; gap: 6px; }
  .pd-stages li { flex-direction: row; text-align: left; gap: 10px; }
  .pd-stages li::after { display: none; }
  .pd-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-money > div:nth-child(3) { border-left: 0; }
  .pd-money > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .pd-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-meta > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .pd-fields, .pd-docs { grid-template-columns: minmax(0, 1fr); }
}
.pd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 10px 0 12px; }
.pd-gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.pd-thumb { display: block; width: 100%; padding: 8px; border: 0; background: var(--hover); cursor: zoom-in; }
.pd-thumb img { display: block; width: 100%; aspect-ratio: 856 / 540; object-fit: contain; border-radius: 6px; background: #fff; }
.pd-thumb:hover img, .pd-thumb:focus-visible img { box-shadow: 0 0 0 2px var(--brand); }
.pd-gallery figcaption { padding: 8px 10px; display: flex; flex-direction: column; font-size: 13px; }
.pd-gallery figcaption span { font-size: 12px; color: var(--ink-2); }
.pd-lightbox img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; border: 1px solid var(--line); }
@media print { .pd-gallery { grid-template-columns: repeat(2, 1fr); } .pd-thumb { padding: 0; } }
/* Identity documents (CNIC etc.) show whole, never cropped. */
.photo-gallery.doc-gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 340px)); }
.photo-gallery.doc-gallery img { object-fit: contain; aspect-ratio: 856 / 540; background: #fff; padding: 8px; }

/* ---------- team hierarchy: summary, org chart and directory tree ---------- */
.th-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.th-summary > div { padding: 12px 16px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.th-summary > div:first-child { border-left: 0; }
.th-summary span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.th-summary strong { font-size: 22px; font-weight: 650; }
.th-summary small { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; }
.th-bar select, .th-bar input[type=search] { padding: 7px 9px; font-size: 14px; }
.th-bar input[type=search] { min-width: 220px; }
.th-bar .spacer { flex: 1; }
.th-zoom { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.th-zoom[hidden] { display: none; }
.th-zoom span { min-width: 44px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.th-card { padding: 0; overflow: hidden; }
.th-tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--hover); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.th-tag.hq { background: var(--brand-tint); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.th-toggle { min-width: 30px; height: 22px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.th-toggle:hover { border-color: var(--brand); color: var(--brand); }
.th-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.th-hit { background: color-mix(in srgb, var(--warning) 30%, var(--card)) !important; outline: 2px solid var(--warning); }

/* org chart (connector lines drawn with borders) */
.oc-viewport { overflow: auto; max-height: 75vh; padding: 24px 16px 32px; background:
  radial-gradient(circle, color-mix(in srgb, var(--axis) 60%, transparent) 1px, transparent 1.2px) 0 0 / 18px 18px; }
.oc-canvas { width: max-content; min-width: 100%; }
.oc, .oc ul { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.oc ul { padding-top: 22px; position: relative; }
.oc li { list-style: none; position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.oc > li { padding-top: 0; }
.oc li::before, .oc li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--axis); }
.oc li::after { right: auto; left: 50%; border-left: 2px solid var(--axis); }
.oc > li::before, .oc > li::after, .oc li:only-child::before { display: none; }
.oc li:only-child::after { border-top: 0; }
.oc li:first-child::before, .oc li:last-child::after { border: 0; }
.oc li:last-child::before { border-right: 2px solid var(--axis); border-radius: 0 8px 0 0; }
.oc li:first-child::after { border-radius: 8px 0 0 0; }
.oc ul ul::before, .oc > li > ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--axis); }
.oc li.collapsed > ul { display: none; }
.oc-node { position: relative; display: flex; align-items: center; gap: 10px; width: 236px; padding: 10px 12px; background: var(--card); text-align: left;
  border: 1px solid var(--line); border-top: 4px solid var(--axis); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.oc-node:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.oc-node.lvl-0 { border-top-color: var(--brand-dark); background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.oc-node.lvl-1 { border-top-color: var(--brand); }
.oc-node.lvl-2 { border-top-color: var(--series-1); }
.oc-node.lvl-3 { border-top-color: var(--series-3); }
.oc-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.oc-name { font-weight: 650; color: var(--ink); text-decoration: none; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-name:hover { color: var(--brand); text-decoration: underline; }
.oc-desig { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.oc-count { position: absolute; top: -10px; right: 10px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand-dark); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.oc-node .th-toggle { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); z-index: 1; }
.oc li.collapsed > .oc-node { box-shadow: 0 1px 2px rgba(0,0,0,.06), 4px 4px 0 -1px var(--card), 4px 4px 0 0 var(--line); }
.oc-stack { display: flex !important; flex-direction: column; gap: 6px; padding: 26px 0 0 18px !important; align-items: flex-start; position: relative; }
.oc-stack::before { content: ''; position: absolute; top: 0; bottom: 18px; left: 50% !important; }
.oc li.has-stack > .oc-stack { border-left: 0; }
.oc-stack li { padding: 0 !important; }
.oc-stack li::before { display: block !important; content: ''; position: absolute; left: -10px !important; right: auto !important; top: 50% !important; width: 10px !important; height: 0 !important;
  border-top: 2px solid var(--axis) !important; border-right: 0 !important; border-radius: 0 !important; }
.oc-stack li::after { display: none !important; }
.oc li.has-stack > .oc-stack { margin-left: 0; }
.oc li.has-stack > .oc-stack::after { content: ''; position: absolute; left: 8px; top: 0; bottom: 18px; border-left: 2px solid var(--axis); }
.oc li.has-stack > .oc-stack::before { content: ''; position: absolute; top: 0; left: 8px; width: calc(50% - 8px); height: 0; border-top: 0; }
.oc-leaf { display: flex; align-items: center; gap: 8px; width: 210px; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.oc-leaf > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.oc-leaf .oc-name { font-size: 13px; }

/* directory tree */
.dt-head { display: grid; grid-template-columns: minmax(0, 1fr) 180px 160px; padding: 10px 18px; background: var(--hover); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.dt-tree, .dt-tree ul { list-style: none; margin: 0; padding: 0; }
.dt-tree { padding: 6px 0 10px; }
.dt-tree ul { margin-left: 33px; border-left: 1px solid var(--line); }
.dt-tree li.collapsed > ul { display: none; }
.dt-row { display: grid; grid-template-columns: 30px 30px minmax(0, 1fr) 180px 160px; align-items: center; gap: 10px; padding: 6px 18px 6px 12px; position: relative; }
.dt-row:has(.th-tag ~ .chip) { grid-template-columns: 30px 30px minmax(0, 1fr) auto auto 160px; }
.dt-tree ul .dt-row::before { content: ''; position: absolute; left: 0; top: 50%; width: 10px; border-top: 1px solid var(--line); }
.dt-row:hover { background: var(--hover); }
.th-toggle-space { width: 30px; }
.dt-main { display: flex; flex-direction: column; min-width: 0; }
.dt-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-name:hover { color: var(--brand); text-decoration: underline; }
.dt-desig { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-row .th-tag { justify-self: start; }
.dt-team { font-size: 12.5px; color: var(--ink-2); text-align: right; white-space: nowrap; }
@media (max-width: 900px) {
  .th-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-summary > div { border-left: 0; border-top: 1px solid var(--line); }
  .dt-head { display: none; }
  .dt-row { grid-template-columns: 30px 30px minmax(0, 1fr); }
  .dt-row .th-tag, .dt-row .chip, .dt-team { grid-column: 3; justify-self: start; text-align: left; }
  .dt-tree ul { margin-left: 16px; }
}
@media print {
  .oc-viewport { max-height: none; overflow: visible; background: none; }
  .th-toggle { display: none; }
}
.oc li.collapsed > ul.oc-stack, .oc li.collapsed > ul.oc-grid { display: none !important; }
.oc .oc-grid { display: grid !important; grid-template-columns: repeat(5, max-content); gap: 18px 16px; align-items: start; justify-content: center;
  margin-top: 22px; padding: 26px 18px 18px !important; border: 1px dashed var(--axis); border-radius: 14px; background: color-mix(in srgb, var(--card) 70%, transparent); position: relative; }
.oc .oc-grid::before { content: ''; position: absolute; top: -24px; left: 50%; height: 24px; border-left: 2px solid var(--axis); }
.oc .oc-grid > li { padding: 0 !important; }
.oc .oc-grid > li::before, .oc .oc-grid > li::after { display: none !important; }
.oc .oc-grid { grid-template-columns: repeat(4, max-content); }
.oc-viewport { cursor: grab; user-select: none; }
.oc-viewport.dragging { cursor: grabbing; }
.oc-viewport a, .oc-viewport button { cursor: pointer; }
.oc-hint { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); background: var(--card); }

/* ---------- logos ---------- */
.brand .emblem.emblem-img { background: #fff; padding: 4px; overflow: hidden; width: 44px; height: 44px; }
.brand .emblem.emblem-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.side-logos { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.15); font-size: 11.5px; line-height: 1.3; opacity: .9; }
.side-logos img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; flex: none; }
.side-logos img.wide { width: auto; height: 40px; max-width: 100%; border-radius: 8px; padding: 4px 8px; }
.sidebar .me { border-top: 0; padding-top: 4px; margin-top: 0; }
.nav-groups + .side-logos, .nav + .side-logos { margin-top: auto; }
.prog-banner { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.prog-logo { height: 52px; width: auto; display: block; }
.prog-banner .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prog-banner strong { font-size: 16px; }
.prog-banner .grow span { font-size: 12.5px; color: var(--ink-2); }
.prog-partners { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.prog-partners span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.prog-partners img { height: 40px; width: auto; display: block; border-radius: 6px; }
.bank-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: #fff; border: 1px solid var(--line); padding: 1px; }
.bank-h1 { display: flex; align-items: center; gap: 12px; }
.bank-h1 img { height: 44px; width: auto; border-radius: 8px; background: #fff; border: 1px solid var(--line); padding: 3px; }
@media (max-width: 760px) { .prog-partners { display: none; } .prog-logo { height: 40px; } }
@media print { .prog-banner { break-inside: avoid; } }

/* ---------- database & backups ---------- */
.sys-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.sys-cards .card { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.sys-cards .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sys-cards strong { font-size: 22px; font-weight: 650; }
.sys-cards strong.ok { color: var(--good-text); } .sys-cards strong.bad { color: var(--error); } .sys-cards .warn { color: #8a5a00; }
.sys-cards small { font-size: 12.5px; color: var(--ink-2); }
.sys-backups { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; }
.sys-backups li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sys-backups .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sys-backups small { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-kind { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sys-kind.k-auto { background: var(--brand-tint); color: var(--brand); }
.sys-kind.k-manual { background: color-mix(in srgb, var(--info) 14%, var(--card)); color: var(--info); }
.sys-kind.k-pre { background: color-mix(in srgb, var(--warning) 25%, var(--card)); color: #7a5300; }
.sys-help { margin-top: 14px; }
.sys-help ol { margin: 8px 0; padding-left: 20px; line-height: 1.6; font-size: 14px; }
.sys-help code { background: var(--hover); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .sys-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notice.public-sub { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, var(--card)); }
.fd-kpis.fd-kpis4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fd-kpis.fd-kpis1 { grid-template-columns: minmax(0, 360px); }
@media (max-width: 1100px) { .fd-kpis.fd-kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- funds management: flow of funds ---------- */
.fd-page table.data th.num { text-align: right; }
.fd-flow { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr); align-items: stretch; margin-bottom: 14px; }
.fd-stage { display: flex; flex-direction: column; padding: 18px 20px; }
.fd-stage header { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.fd-stage h2 { font-size: 15px; margin: 0; }
.fd-stage header p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-2); }
.fd-step { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand-dark); color: #fff; font-size: 12.5px; font-weight: 700; }
.fd-logo { width: 38px; height: 38px; object-fit: contain; flex: none; border-radius: 8px; background: #fff; }
.fd-amount { font-size: 32px; font-weight: 650; letter-spacing: -.015em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fd-amount.none { font-size: 22px; color: var(--ink-2); padding: 5px 0; }
.fd-note { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.fd-remark { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.fd-rows { margin-top: 12px; }
.fd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.fd-row span { color: var(--ink-2); min-width: 0; }
.fd-row strong { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd-row small { font-weight: 400; color: var(--ink-2); }
.fd-bankrow span { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.fd-bankrow img { width: 24px; height: 24px; object-fit: contain; flex: none; border-radius: 4px; background: #fff; border: 1px solid var(--line); }
.fd-stage > .btn { margin-top: auto; justify-content: center; text-align: center; width: 100%; }
.fd-stage > .fd-rows + .btn, .fd-stage > .btn { position: relative; }
.fd-stage > :nth-last-child(2) { margin-bottom: 14px; }
.fd-arrow { position: relative; align-self: center; height: 2px; background: var(--axis); }
.fd-arrow::after { content: ''; position: absolute; right: 0; top: -4px; border-left: 8px solid var(--axis); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.fd-page .fd-curq td { background: var(--brand-tint); }
.fd-now { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--brand); }
.fd-ledger { margin-top: 14px; }
.fd-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fd-party { white-space: nowrap; font-size: 13.5px; }
.fd-party i { font-style: normal; color: var(--muted); margin: 0 3px; }
.fd-kind.k-gov_release { background: color-mix(in srgb, var(--series-3) 14%, var(--card)); color: var(--good-text); }
@media (max-width: 1000px) {
  .fd-flow { grid-template-columns: minmax(0, 1fr); }
  .fd-arrow { justify-self: center; width: 2px; height: 20px; }
  .fd-arrow::after { right: -4px; top: auto; bottom: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--axis); border-bottom: 0; }
}
@media print { .fd-stage { break-inside: avoid; } }
.fd-kind.k-gov_release { background: var(--hover); color: var(--ink); }
.fd-howto { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.fd-howto .link-btn { font-size: 14px; padding: 0; text-decoration: underline; }
.fd-example td, .fd-example th { font-size: 12.5px; padding-top: 5px; padding-bottom: 5px; }
.fd-upload table.data th.num { text-align: right; }
.fu-msg { margin: 8px 0; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.fu-msg.good { background: var(--brand-tint); color: var(--brand); }
.fu-msg.bad { background: color-mix(in srgb, var(--critical) 9%, var(--card)); color: var(--error); }
.fu-table { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.fu-table td, .fu-table th { font-size: 12.5px; padding: 5px 8px; }
.fu-table tr.fu-bad td { background: color-mix(in srgb, var(--critical) 8%, var(--card)); }
.fu-table tr.fu-dup td { color: var(--ink-2); background: var(--hover); }

/* ---------- bank partners ---------- */
.pb-card { display: flex; flex-direction: column; padding: 18px 20px; }
.pb-card header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pb-card .grow { flex: 1; min-width: 0; }
.pb-card h2 { font-size: 16px; margin: 0; }
.pb-card header p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.pb-logo { width: 52px; height: 52px; object-fit: contain; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 3px; }
.pb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 12px; }
.pb-stats dt { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pb-stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb-meter span { display: block; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.pb-meter .meter { margin-top: 0; }
.pb-card footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: auto; padding-top: 12px; }
.pb-card footer .pu-due { margin: 0; }
.pb-totals { padding: 0; margin-bottom: 14px; }
.pb-totals-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pb-totals-head h2 { font-size: 15px; }
.pb-totals-head p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.pb-totals dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.pb-totals dl > div { padding: 14px 20px; border-left: 1px solid var(--line); min-width: 0; }
.pb-totals dl > div:first-child { border-left: 0; }
.pb-totals dt { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pb-totals dd { margin: 3px 0 2px; font-size: 22px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb-totals small { display: block; font-size: 12px; color: var(--ink-2); }
.cmp { display: grid; gap: 12px; }
.cmp-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: center; }
.cmp-label { font-size: 13px; color: var(--ink-2); }
.cmp-bars { display: grid; gap: 3px; }
.cmp-bar { display: flex; align-items: center; gap: 6px; min-height: 16px; }
.cmp-bar i { display: block; height: 12px; min-width: 2px; flex: none; border-radius: 0 4px 4px 0; }
.cmp-bar span { font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 1280px) {
  .pb-totals dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pb-totals dl > div:nth-child(4) { border-left: 0; }
  .pb-totals dl > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .pb-totals dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-totals dl > div { border-left: 0 !important; border-top: 1px solid var(--line); padding: 12px 16px; }
  .pb-totals dl > div:nth-child(-n+2) { border-top: 0; }
  .pb-totals dd, .pb-stats dd { font-size: 19px; }
  .cmp-row { grid-template-columns: 84px minmax(0, 1fr); }
}
.fu-table td:last-child { min-width: 250px; }

/* ---------- beneficiary report ---------- */
img.emblem { object-fit: contain; padding: 4px; }
.er-filters { padding: 12px 16px; margin-bottom: 14px; }
.er-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.er-reset { margin-left: auto; }
.er-fields { display: grid; grid-template-columns: 150px 150px minmax(170px, 1fr) 150px minmax(220px, 1.6fr); gap: 10px; }
.er-fields label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.er-fields label > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.er-fields input, .er-fields select { width: 100%; padding: 7px 9px; font-size: 14px; }
.er-totals { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.er-flag { color: var(--error); }
.er-section { margin-bottom: 14px; }
.er-section .card-head { align-items: center; }
.er-districts th.num, .en-reg th.num { text-align: right; }
.er-districts tbody tr { cursor: pointer; }
.er-districts tbody tr:hover td { background: var(--hover); }
.er-barcol { min-width: 200px; }
.er-barcell { display: grid; grid-template-columns: minmax(0, 1fr) 84px; align-items: center; gap: 8px; }
.er-barcell span { text-align: right; font-variant-numeric: tabular-nums; }
.er-districts th.er-barcol { text-align: right; }
.er-bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--brand-tint); overflow: hidden; }
.er-bar i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.er-more { margin-top: 10px; }
table.data.dar-detail.en-reg thead th { background: none; color: var(--ink-2); border-bottom: 1px solid var(--axis); border-radius: 0; }
.en-reg td { white-space: normal; vertical-align: top; }
.en-reg td.nowrap, .en-reg .nowrap { white-space: nowrap; }
.en-reg td.title { min-width: 170px; }
.en-reg.only-dups tbody tr:not(.en-dup-row), .en-reg.only-dups tfoot { display: none; }
@media (max-width: 1280px) { .er-totals { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 900px) { .er-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .er-q { grid-column: 1 / -1; } }
@media (max-width: 640px) { .er-barcol { min-width: 90px; } .er-barcell { grid-template-columns: minmax(0, 1fr); } .er-bar { display: none; } .er-totals { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ---------- ehsas program overview ---------- */
.eo-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.eo-card { display: flex; flex-direction: column; padding: 18px 20px; }
.eo-card header { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.eo-card header h2 { font-size: 15px; }
.eo-card header p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-2); }
.eo-link { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--brand); text-decoration: none; }
.eo-link:hover { text-decoration: underline; }
.eo-alert { display: flex; gap: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--critical); border-radius: var(--radius); }
.eo-alert-ico { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--critical); color: #fff; font-weight: 800; font-size: 13px; }
.eo-alert ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13.5px; color: var(--ink-2); }
.eo-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.eo-status a { display: block; padding: 8px 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.eo-status a:hover { background: var(--hover); }
.eo-st-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eo-st-head strong { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.eo-status .meter { display: block; margin-top: 7px; }
@media (max-width: 1000px) { .eo-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Youth Activity Calendar ---------- */
.chip.s-completed .dot { background: var(--good); }
.chip.s-in-review .dot, .chip.s-approval-requested .dot { background: var(--warning); color: #0b0b0b; }
.chip.s-overdue .dot { background: var(--critical); }
.chip.s-due-this-month .dot { background: var(--info); }
.chip.s-upcoming .dot, .chip.s-postponed .dot, .chip.s-cancelled .dot { background: var(--ink-2); }
.cal-fields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important; }
.cal-status-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-status-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cal-status { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; }
.cal-status-row .er-reset { margin: 0; white-space: nowrap; }
.cal-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.cal-kpi { display: flex; flex-direction: column; padding: 16px 18px; }
.cal-kpi-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.cal-kpi-big { margin-top: 4px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-kpi-big small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.cal-kpi-note { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.cal-kpi-alert { border-left: 4px solid var(--critical); }
.cal-kpi-alert .cal-kpi-big { color: var(--critical); }
.cal-kpi-clear .cal-kpi-note { color: var(--good-text); font-weight: 600; }
.cal-mini { display: block; height: 7px; margin-top: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.cal-mini i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.cal-tabs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.cal-tabs-head h2 { margin: 0; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.cal-legend .link-btn { font-size: 13px; font-weight: 600; }
.cal-legend i { display: inline-block; width: 12px; height: 8px; margin-right: 5px; border-radius: 2px; }
.cal-legend .a { background: var(--good); }
.cal-legend .b { background: color-mix(in srgb, var(--good) 40%, var(--card)); }
.cal-hint { margin: 0 0 8px; }
.cal-barcell { display: grid; grid-template-columns: minmax(70px, 130px) auto; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.cal-barcell .cal-mini { margin: 0; }
.cal-standing { font-size: 13px; }
table.data.cal-districts th.num { text-align: right; }
table.data.dar-detail.cal-reg tr.cal-group td { padding: 12px 8px 6px; font-weight: 700; font-size: 14px; background: var(--hover); border-bottom: 1px solid var(--axis); white-space: normal; }
.cal-group em { margin-left: 6px; padding: 1px 7px; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; }
.cal-group small { margin-left: 8px; font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.cal-month > strong em { margin-left: 5px; padding: 0 6px; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 999px; vertical-align: 1px; }
.cal-status b { margin-left: 3px; font-variant-numeric: tabular-nums; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.cal-year-note { margin: 0 0 14px; }
.cal-remove { margin: 0 0 14px; text-align: right; }
.cal-remove .link-btn { font-size: 13px; color: var(--ink-2); }
.cal-month { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cal-month:hover { background: var(--hover); }
.cal-month.now { border-color: var(--brand); }
.cal-month.on { background: var(--brand-tint); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-month > strong { font-size: 13px; white-space: nowrap; }
.cal-month > small { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.cal-num { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-num small { font-size: 11.5px; font-weight: 400; color: var(--ink-2); }
.cal-late { color: var(--critical); font-weight: 650; }
.cal-districts td, .cal-districts th { white-space: nowrap; }
table.data.cal-districts td.title { min-width: 150px; }
table.data.dar-detail.cal-reg thead th { white-space: normal; vertical-align: bottom; }
.cal-reg td, table.data.dar-detail.cal-reg thead th { padding-left: 8px; padding-right: 8px; }
.cal-reg td.cal-wrap { white-space: normal; min-width: 120px; }
.cal-reg td.cal-wrap a { white-space: nowrap; }
.dar-detail.cal-reg td.title { min-width: 200px; }
.cal-reg .num { text-align: right; }
@media (max-width: 1100px) { .cal-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cal-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-kpis { grid-template-columns: minmax(0, 1fr); }
  .cal-status-row { flex-wrap: wrap; }
  .cal-status { flex-basis: 100%; order: 3; }
  .cal-status-row .er-reset { margin-left: auto; }
  .dar-detail.cal-reg tr.cal-group { display: block; padding: 0; border: 0; margin: 14px 0 6px; background: none; }
  table.data.dar-detail.cal-reg tr.cal-group td { display: block; padding: 4px 0; background: none; border: 0; }
  .cal-group td::before { display: none !important; }
  .cal-districts .cal-mini, .cal-districts th:nth-child(4), .cal-districts td:nth-child(4), .cal-districts th:nth-child(5), .cal-districts td:nth-child(5) { display: none; }
  .cal-districts .cal-barcell { display: block; }
  table.data.cal-districts td.title { min-width: 0; white-space: normal; }
  table.data.cal-districts th { white-space: normal; }
}

/* ---------- Activity tracker ---------- */
.tr-dots { display: inline-flex; align-items: center; margin-left: 8px; vertical-align: middle; }
.tr-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tr-dots i + i { margin-left: 8px; position: relative; }
.tr-dots i + i::before { content: ''; position: absolute; right: 8px; top: 3px; width: 8px; height: 2px; background: var(--line); }
.tr-dots i.on { background: var(--good); }
.tr-dots i.stop { background: var(--critical); }
td.tr-cell { white-space: nowrap; }
.tr-card { margin-bottom: 14px; }
.tr-strip { display: flex; align-items: stretch; gap: 6px; }
.tr-stage { flex: 1 1 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 10px; font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.tr-stage:hover { background: var(--hover); }
.tr-stage[aria-pressed=true] { background: var(--brand-tint); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.tr-stage b { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tr-stage small { font-size: 12px; color: var(--ink-2); }
.tr-arrow { align-self: center; color: var(--muted); }
.tr-gap { width: 1px; margin: 4px 6px; background: var(--line); }
.tr-journey { margin-bottom: 14px; }
.tr-journey h2 { margin: 0 0 14px; }
.tr-steps { list-style: none; display: flex; margin: 0; padding: 0; }
.tr-steps li { position: relative; flex: 1 1 0; min-width: 0; padding-right: 12px; display: flex; flex-direction: column; font-size: 14px; }
.tr-steps li:not(:last-child)::after { content: ''; position: absolute; left: 34px; right: 4px; top: 13px; height: 2px; background: var(--line); }
.tr-steps li.done:not(:last-child)::after { background: var(--good); }
.tr-mark { width: 28px; height: 28px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--ink-2); background: var(--card); border: 2px solid var(--axis); }
.tr-steps .done .tr-mark { color: #fff; background: var(--good); border-color: var(--good); }
.tr-steps .now .tr-mark { color: #0b0b0b; background: var(--warning); border-color: var(--warning); }
.tr-steps .back .tr-mark { color: #fff; background: var(--critical); border-color: var(--critical); }
.tr-steps .next .tr-mark { border-color: var(--brand); }
.tr-steps small { font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.tr-next { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
@media (max-width: 640px) {
  .tr-strip { flex-wrap: wrap; }
  .tr-stage { flex: 1 1 40%; }
  .tr-arrow, .tr-gap { display: none; }
  .tr-steps { flex-direction: column; gap: 12px; }
  .tr-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; padding: 0; }
  .tr-steps li::after { display: none; }
  .tr-mark { grid-row: 1 / span 2; margin: 0; }
}

/* Calendar row tracker */
.chip.s-preparing .dot { background: var(--info); }
.chip.s-report-due .dot { background: var(--warning); color: #0b0b0b; }
.cal-reg td.cal-track { white-space: normal; min-width: 170px; }
.cal-line { display: flex; width: 170px; max-width: 100%; height: 9px; margin: 7px 0 4px; border-radius: 5px; overflow: hidden; background: var(--line); }
.cal-line i { display: block; height: 100%; background: var(--good); }
.cal-line i.wait { background: color-mix(in srgb, var(--good) 40%, var(--card)); }
.cal-line-text { display: block; font-size: 12.5px; font-weight: 600; }
.chip.s-partly-done .dot { background: var(--info); }
.cal-report { margin-top: 8px; }
@media (max-width: 640px) { .cal-reg td.cal-wrap a { white-space: normal; overflow-wrap: anywhere; } }

/* ---------- DYO activity form inside the portal ---------- */
.uf-steps { list-style: none; display: flex; gap: 6px; margin: 0 0 14px; padding: 0; overflow-x: auto; }
.uf-steps li { flex: 1 1 0; min-width: 96px; border-top: 4px solid var(--line); }
.uf-steps li.done { border-color: var(--brand-dark); }
.uf-steps li.current { border-color: var(--brand); }
.uf-steps button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 2px; font: inherit; font-size: 13px; text-align: left; color: var(--ink-2); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.uf-steps button span { width: 20px; height: 20px; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; border-radius: 50%; background: var(--line); color: var(--ink-2); }
.uf-steps .done button span { background: var(--brand-dark); color: #fff; }
.uf-steps .current button { color: var(--brand); font-weight: 600; }
.uf-steps .current button span { background: var(--brand); color: #fff; }
.uf-step { padding: 22px 24px; margin-bottom: 14px; }
.uf-step > h2 { margin: 0 0 6px; font-size: 19px; }
.uf-intro p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.uf-sub { margin: 20px 0 4px; font-size: 14.5px; color: var(--brand); }
.uf-field { margin-top: 16px; min-width: 0; }
.uf-field label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.uf-field p.small { margin: 0 0 5px; }
.uf-field input:not([type=file]), .uf-field select, .uf-field textarea { width: 100%; padding: 9px 11px; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--card); border: 1px solid var(--axis); border-radius: 8px; }
.uf-field input[readonly] { background: var(--brand-tint); font-weight: 700; }
.uf-field.invalid input, .uf-field.invalid select, .uf-field.invalid textarea { border-color: var(--error); }
.uf-field .field-error { margin: 4px 0 0; }
.uf-req { color: var(--error); }
.uf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.uf-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.uf-type { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--axis); border-radius: 10px; cursor: pointer; }
.uf-type:hover { background: var(--hover); }
.uf-type strong { font-size: 16px; }
.uf-type span { font-size: 13.5px; color: var(--ink-2); }
.uf-type.on { background: var(--brand-tint); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.uf-officer { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; margin: 6px 0 0; padding: 12px 14px; background: var(--hover); border-radius: 8px; }
.uf-officer dt { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.uf-officer dd { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.uf-other { margin: 16px 0 0; }
.uf-plan { margin-top: 10px; padding: 12px 14px; font-size: 14px; background: var(--brand-tint); border-left: 4px solid var(--brand); border-radius: 6px; }
.uf-plan[hidden] { display: none; }
.uf-plan-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 0 0 8px; }
.uf-plan-title span { color: var(--ink-2); }
.uf-plan dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 12px; margin: 0 0 8px; }
.uf-plan dt { color: var(--ink-2); }
.uf-plan dd { margin: 0; }
.uf-plan p.small { margin: 0; }
.uf-plan .cal-line { width: 100%; margin: 0 0 8px; }
.uf-warn { margin-top: 16px; }
.uf-warn ul { margin: 4px 0 0; padding-left: 18px; }
.uf-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.uf-actions .grow { flex: 1; }
.uf-rev { padding: 12px 0; border-bottom: 1px solid var(--line); }
.uf-rev header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.uf-rev h3 { margin: 0; font-size: 14.5px; }
.uf-rev dd { overflow-wrap: anywhere; }
.uf-check { display: flex; gap: 10px; margin-top: 16px; font-size: 14px; cursor: pointer; }
.uf-check input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.uf-done { padding: 30px 24px; text-align: center; }
.uf-done h2 { margin: 10px 0 6px; }
.uf-done p { margin: 0 0 6px; }
.uf-tick { width: 46px; height: 46px; display: inline-grid; place-items: center; font-size: 24px; font-weight: 700; color: #fff; background: var(--good); border-radius: 50%; }
.uf-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
@media (max-width: 640px) {
  .uf-types { grid-template-columns: minmax(0, 1fr); }
  .uf-step { padding: 18px 16px; }
  .uf-plan dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .uf-plan dd { margin-bottom: 6px; }
  .uf-actions { flex-wrap: wrap; }
}

/* District filter on the Daily Report */
.dar-district { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dar-district select { min-width: 0; max-width: 240px; padding: 6px 8px; font-size: 13.5px; }

/* ---------- Downloads on a phone ---------- */
@media (max-width: 640px) {
  /* Download menus open across the full width instead of running off the screen. */
  details.menu { position: static; width: 100%; }
  details.menu > summary { width: 100%; justify-content: center; text-align: center; }
  .page-head, .dash-head, .head-actions, .pu-actions { position: relative; }
  .menu-list { left: 0; right: 0; width: auto; }
  .menu-list button { padding: 11px 12px; }
  .cal-legend .link-btn { padding: 8px 0; min-height: 36px; }
  /* Report lists become cards; the PDF button is a full-size button. */
  table.data.rr-table thead { display: none; }
  table.data.rr-table, .rr-table tbody { display: block; }
  .rr-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; }
  table.data.rr-table td { border: 0; padding: 3px 0; text-align: left; white-space: normal; min-width: 0; }
  .rr-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
  table.data.rr-table td.title { grid-column: 1 / -1; order: -1; min-width: 0; }
  .rr-table td.no-print { grid-column: 1 / -1; }
  .rr-table .pdf-link { display: block; width: 100%; padding: 9px; text-align: center; border: 1px solid var(--line); border-radius: 8px; }
}
/* Tablets: download links big enough to tap. */
@media (max-width: 900px) {
  table.data .pdf-link { display: inline-block; padding: 8px 10px; }
  .cal-legend .link-btn { display: inline-block; padding: 8px 0; }
}

/* Activity Management: performance ranking */
.rank-by { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.rank-by select { padding: 6px 10px; font-size: 13.5px; }
.rank-no { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-right: 8px; padding: 0 5px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--hover); border-radius: 11px; vertical-align: 1px; }
.group[data-i="0"] .rank-no { color: #fff; background: var(--brand); }
.rank-sub { margin-top: 3px; }
.rank-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 4px 0 2px; border-left: 4px solid var(--brand); }
.rank-top strong { display: block; font-size: 17px; }
.rank-medal { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--brand); border-radius: 50%; }
.rank-value { margin-left: auto; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .rank-by { margin-left: 0; width: 100%; } .rank-by select { flex: 1; } .rank-top { flex-wrap: wrap; } .rank-value { margin-left: 48px; } }

/* Administration > Districts */
.dist-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dist-new { margin-left: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; }
.dist-grp { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
@media (max-width: 900px) { .dist-groups { grid-template-columns: minmax(0, 1fr); } }
.dist-field > span:first-child { display: block; margin-bottom: 6px; font-weight: 600; }

/* District portal > User Accounts */
.team-note { margin: 0 0 14px; }
.team-email { overflow-wrap: anywhere; }
.team-actions { white-space: nowrap; text-align: right; }
.team-actions .btn + .btn { margin-left: 6px; }
.team-pass dd code { font-size: 16px; font-weight: 700; letter-spacing: .03em; }
@media (max-width: 640px) { .team-actions { white-space: normal; text-align: left; } .team-actions .btn { width: 100%; margin: 4px 0 0 !important; } }

/* DYO form: breakdown of each gender */
.uf-bd { margin-top: 20px; }
.uf-bd > .notice { margin-bottom: 10px; }
.uf-bd-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.uf-bd-panel > summary { display: flex; align-items: center; gap: 4px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 15px; }
.uf-bd-panel > summary::-webkit-details-marker { display: none; }
.uf-bd-panel > summary::before { content: '▸'; margin-right: 6px; color: var(--muted); transition: transform .15s; }
.uf-bd-panel[open] > summary::before { transform: rotate(90deg); }
.uf-bd-panel[open] > summary { border-bottom: 1px solid var(--line); background: var(--brand-tint); border-radius: 10px 10px 0 0; }
.uf-bd-filled { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.uf-bd-panel > .uf-grid { padding: 0 14px 14px; }
.uf-rev-sub { margin: 12px 0 6px; font-size: 13.5px; }
.bd-table td:first-child { white-space: nowrap; }

/* ---------- Ehsaas Naujawan registrations ---------- */
.chip.s-pending .dot { background: var(--info); }
.chip.s-under-verification .dot { background: var(--warning); color: #0b0b0b; }
.chip.s-rejected .dot { background: var(--critical); }
.chip.s-disbursed .dot { background: var(--good); }
.en-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; margin-bottom: 14px; border-left: 4px solid var(--brand); }
.en-link > div { flex: 1 1 260px; display: flex; flex-direction: column; }
.en-link > div span { font-size: 13px; color: var(--ink-2); }
.en-link code { padding: 6px 10px; font-size: 13px; background: var(--hover); border-radius: 6px; overflow-wrap: anywhere; }
.en-pipe { margin-bottom: 14px; padding: 14px 16px; }
.en-pipe-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.en-pipe-head h2 { margin: 0; font-size: 15px; }
.en-pipe-head img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.en-pipes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.en-pipes .en-pipe { margin-bottom: 14px; }
.en-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
.en-count { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.en-count:hover { background: var(--hover); }
.en-count[aria-pressed=true] { background: var(--brand-tint); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.en-count span { font-size: 12.5px; color: var(--ink-2); }
.en-count b { font-size: 22px; font-variant-numeric: tabular-nums; }
.en-count small { font-size: 11.5px; color: var(--ink-2); }
.en-fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
.en-loc-badge { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.en-loc-badge.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 14%, var(--card)); }
.en-loc-badge.warn { color: #7a5200; background: color-mix(in srgb, var(--warning) 22%, var(--card)); }
.en-loc-badge.info { color: var(--ink-2); background: var(--hover); border-color: var(--line); }
.en-loc-badge.bad { color: #fff; background: var(--critical); }
.en-head-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.en-partner-tag { padding: 3px 10px; font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; }
.en-actions { margin-bottom: 14px; }
.en-next { margin: 0 0 8px; padding: 10px 14px; background: var(--brand-tint); border-radius: 8px; font-size: 14px; }
.en-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.en-cnic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.en-cnic figure, .en-photo { margin: 0; }
.en-cnic img { width: 100%; aspect-ratio: 1.58; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--hover); }
.en-cnic figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.en-map { height: 360px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; background: var(--hover); }
.en-map-key { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.en-pin { width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: #2a78d6; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.en-pin-icon { background: none; border: 0; }
.en-dot { width: 12px; height: 12px; display: inline-block; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.en-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.en-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--hover); }
.en-photo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 6px; }
.en-photo dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; }
.en-photo dt { color: var(--ink-2); }
.en-photo dd { margin: 0; overflow-wrap: anywhere; }
.en-partner-pick { display: grid; gap: 8px; }
.en-partner-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; }
.en-partner-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.en-partner-pick img { width: 30px; height: 30px; object-fit: contain; }
@media (max-width: 1100px) { .en-detail { grid-template-columns: minmax(0, 1fr); } .en-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .en-pipes { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .en-photo-grid { grid-template-columns: minmax(0, 1fr); } .en-map { height: 280px; } }
.en-badge { margin-left: auto; padding: 1px 7px; font-size: 11px; font-weight: 700; color: #fff; background: var(--critical); border-radius: 999px; }
.nav-head .en-badge { margin-right: 6px; }

/* ---------- Applicant portal: My Proposals ---------- */
.mp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-card .card-head { align-items: flex-start; gap: 12px; }
.mp-card h2 { margin: 2px 0 0; }
.mp-ref { margin: 0; }
.mp-msg { margin: 4px 0 10px; }
.mp-reason { background: var(--hover); border-left: 3px solid #b3261e; padding: 8px 12px; border-radius: 6px; }
.mp-kv { margin-bottom: 12px; }
.mp-history { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 0; }
.mp-history li { display: flex; flex-direction: column; font-size: 12.5px; padding: 0 16px 0 0; margin-right: 16px; position: relative; }
.mp-history li:not(:last-child)::after { content: '→'; position: absolute; right: -10px; top: 0; color: var(--ink-2); }
.mp-history li span { color: var(--ink-2); }
.mp-empty { text-align: center; padding: 32px 16px; }
@media (max-width: 720px) { .mp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Activity report: participation step (gender cards + category table) ---------- */
.uf-step[data-step="participation"] { --pt-m: var(--series-1); --pt-f: #c2457a; --pt-t: #7c5cc4; }
.pt-m { --pt: var(--pt-m); } .pt-f { --pt: var(--pt-f); } .pt-t { --pt: var(--pt-t); }
.pt-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pt-head .uf-sub { margin-top: 0; }
.pt-head p { margin: 0 0 12px; max-width: 760px; }
.pt-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--pt, var(--brand)); flex: none; }

.pt-gender { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.15fr); gap: 12px; }
.pt-card.uf-field { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-top: 3px solid var(--pt, var(--brand)); border-radius: 10px; background: var(--card); }
.pt-card label { display: flex; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.pt-card input:not([type=file]) { font-size: 22px; font-weight: 650; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.pt-card.pt-total { border-top-color: var(--brand); background: var(--brand-tint); }
.pt-card.pt-total input[readonly] { padding: 2px 0; font-size: 30px; color: var(--brand); background: transparent; border: 0; box-shadow: none; }
.pt-card.pt-total p.small { margin: 0; color: var(--ink-2); }

.pt-split { margin-top: 14px; }
.pt-bar { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: var(--line); }
.pt-bar i { display: block; height: 100%; background: var(--pt); transition: width .25s ease; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.pt-legend li { display: flex; align-items: center; }
.pt-legend strong { margin-left: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
#uf-count { margin-top: 14px; }

.pt-empty { padding: 18px; font-size: 14px; text-align: center; color: var(--ink-2); border: 1px dashed var(--axis); border-radius: 10px; background: var(--hover); }
.pt-wrap { border: 1px solid var(--line); border-radius: 10px; }
.pt-matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-matrix th, .pt-matrix td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.pt-matrix tbody tr:last-child > * { border-bottom: 0; }
.pt-matrix thead th { position: sticky; top: 0; z-index: 1; padding: 10px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); background: var(--hover); white-space: nowrap; }
.pt-matrix thead th small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pt-matrix thead .pt-col { border-bottom: 2px solid var(--pt, var(--brand)); }
.pt-matrix tbody th { width: 30%; padding-top: 14px; font-weight: 600; }
.pt-matrix tbody tr:hover { background: var(--hover); }
.pt-matrix .pt-cell.uf-field { margin: 0; }
.pt-matrix .pt-cell input { min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.pt-matrix .pt-cell input:disabled { color: var(--muted); background: var(--hover); border-style: dashed; cursor: not-allowed; }
.pt-matrix .pt-sum { background: var(--brand-tint); }
.pt-matrix .pt-sum .pt-cell input[readonly] { color: var(--brand); background: transparent; border-color: transparent; }
.pt-matrix .pt-off { opacity: .55; }
.pt-matrix .field-error { font-size: 12px; text-align: right; }

@media (max-width: 900px) {
  .pt-gender { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phones: each category becomes a small card with the genders side by side. */
@media (max-width: 640px) {
  .pt-gender { gap: 10px; }
  .pt-card.uf-field { padding: 10px 12px 12px; }
  .pt-card input:not([type=file]) { font-size: 19px; }
  .pt-card.pt-total input[readonly] { font-size: 26px; }
  .pt-wrap { border: 0; overflow: visible; }
  .pt-matrix, .pt-matrix tbody { display: block; }
  .pt-matrix thead { display: none; }
  .pt-matrix tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
  .pt-matrix tbody tr:hover { background: var(--card); }
  .pt-matrix tbody th { grid-column: 1 / -1; width: auto; padding: 0 0 2px; border: 0; }
  .pt-matrix tbody td { display: block; padding: 0; border: 0; background: none; }
  .pt-matrix tbody td::before { content: attr(data-label); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
  .pt-matrix tbody td[data-col]::before { border-bottom: 2px solid var(--pt); padding-bottom: 2px; }
  .pt-matrix .pt-sum { background: none; }
  .pt-matrix .pt-sum .pt-cell input[readonly] { background: var(--brand-tint); }
  .pt-matrix .pt-cell input { min-width: 0; padding: 7px 8px; text-align: center; }
}
.pt-card label .uf-req { margin-left: 3px; }
.pt-legend strong { white-space: nowrap; }
@media (max-width: 640px) {
  .pt-matrix tbody td { min-width: 0; }
  .pt-matrix .field-error { text-align: left; font-size: 11.5px; line-height: 1.3; }
}
