/**
 * NAVCDP public landing — v2 (bento dashboard)
 */

:root {
    --green: #2d6a30;
    --green-dark: #0f281c;
    --green-mid: #40916c;
    --green-glow: #52b788;
    --green-tint: #e8f5ec;
    --gold: #d1a63a;
    --brown: #7a5230;
    --brown-mid: #99693d;
    --accent: var(--green-mid);
    --accent-cyan: var(--gold);
    --ink: #0f172a;
    --ink-soft: #475569;
    --ink-muted: #64748b;
    --ink-on-dark: #d8e8de;
    --ink-on-dark-muted: #8fad9a;
    --surface: #f6faf7;
    --surface-muted: #eef4f0;
    --border: #d5e0d9;
    --canvas: #0b1612;
    --canvas-mid: #122820;
    --radius: 24px;
    --radius-sm: 14px;
    --radius-pill: 999px;
    --shadow-card: 0 28px 56px -32px rgba(0, 0, 0, 0.65);
    --shadow-soft: 0 16px 40px -24px rgba(0, 0, 0, 0.55);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --spotlight: linear-gradient(155deg, #1a4d32 0%, #0f281c 42%, #081810 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.portal-v2 {
    font-family: var(--font);
    color: var(--ink-on-dark);
    line-height: 1.55;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(90% 70% at 0% 0%, rgba(64, 145, 108, 0.22), transparent 55%),
        radial-gradient(70% 50% at 100% 0%, rgba(209, 166, 58, 0.12), transparent 50%),
        linear-gradient(180deg, var(--canvas-mid) 0%, var(--canvas) 100%);
    background-attachment: fixed;
}

body.modal-open { overflow: hidden; }

.tricolor { display: flex; height: 3px; position: relative; z-index: 60; }
.tricolor span:nth-child(1) { flex: 1; background: #111; }
.tricolor span:nth-child(2) { flex: 1; background: #b3261e; }
.tricolor span:nth-child(3) { flex: 1; background: var(--green); }

/* ── Header ── */
.app-header {
    flex-shrink: 0;
    z-index: 50;
    padding: 0.65rem 1rem;
    background: rgba(11, 22, 18, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(64, 145, 108, 0.25);
}

.app-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.app-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 2px;
    border: 1px solid var(--border);
}

.app-brand-text strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f2f8f4;
}

.app-brand-text span {
    display: block;
    font-size: 0.68rem;
    color: var(--ink-on-dark-muted);
    font-weight: 600;
}

.pill-nav {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.28rem;
    background: rgba(15, 40, 28, 0.85);
    border-radius: var(--radius-pill);
    box-shadow: inset 0 0 0 1px rgba(64, 145, 108, 0.35);
    border: 1px solid rgba(209, 166, 58, 0.15);
    max-width: 100%;
}

@media (max-width: 767px) {
    .app-header-inner { justify-content: space-between; }
    .pill-nav {
        order: 3;
        width: 100%;
        margin-top: 0.35rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }
    .pill-nav::-webkit-scrollbar { display: none; }
    .pill-nav-link {
        flex-shrink: 0;
        font-size: 0.68rem;
        padding: 0.4rem 0.62rem;
    }
    .app-brand-text strong { font-size: 0.82rem; }
    .app-brand-text span { font-size: 0.62rem; }
}

.pill-nav-link {
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-on-dark-muted);
    text-decoration: none;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pill-nav-link:hover { color: var(--ink-on-dark); background: rgba(64, 145, 108, 0.2); }

.pill-nav-link.is-active {
    color: #f2f8f4;
    background: rgba(45, 106, 48, 0.55);
    box-shadow: 0 0 0 1px rgba(209, 166, 58, 0.45), 0 0 18px -6px rgba(82, 183, 136, 0.5);
}

.pill-nav-link:focus { outline: none; }
.pill-nav-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(209, 166, 58, 0.65);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(64, 145, 108, 0.4);
    background: rgba(15, 40, 28, 0.6);
    color: var(--gold);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}

.tool-btn:hover {
    background: rgba(45, 106, 48, 0.45);
    border-color: rgba(209, 166, 58, 0.5);
    color: #f5e6bc;
}

.app-header-actions .meta-stamp {
    font-size: 0.7rem;
    color: var(--ink-on-dark-muted);
    max-width: 10rem;
    line-height: 1.3;
    text-align: right;
    display: none;
}

@media (min-width: 900px) {
    .app-header-actions .meta-stamp { display: block; }
}

.app-header-logo {
    height: 32px;
    width: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 2px 6px;
    object-fit: contain;
}

.btn-login {
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(209, 166, 58, 0.35);
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green) 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.55);
}

.btn-login:hover { filter: brightness(1.08); border-color: var(--gold); }

/* ── Layout (single viewport, tab panels) ── */
.app-canvas {
    padding: 0.85rem 1rem 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.app-wrap {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.app-stage {
    flex: 1;
    min-height: 0;
    position: relative;
}

.tab-panel {
    display: none;
    height: 100%;
    overflow: hidden;
    animation: tab-in 0.22s ease;
}

.tab-panel[hidden] {
    display: none !important;
}

.tab-panel.is-active { display: block; }

@keyframes tab-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-panel-fill {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tab-panel-fill .ui-card-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.app-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.15rem 0.55rem;
    font-size: 0.72rem;
    color: var(--ink-on-dark-muted);
}

.app-bar a {
    color: var(--ink-on-dark-muted);
    font-weight: 600;
    text-decoration: none;
}

.app-bar a:hover { color: var(--gold); }

.bento--overview {
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

@media (max-width: 1099px) {
    .bento--overview {
        overflow: auto;
    }
}

.overview-kpi-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

@media (min-width: 768px) {
    .overview-kpi-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }
}

.bento-kpis--compact .kpi-band-title {
    margin-bottom: 0.15rem;
}

.bento-kpis--compact .stat-card {
    padding: 0.5rem 0.55rem 0.55rem;
}

.bento-kpis--compact .stat-card .stat-value {
    font-size: 1.05rem;
}

.bento-kpis--compact .stat-card .stat-icon {
    font-size: 0.85rem;
    opacity: 0.35;
}

.ui-card--spotlight.overview-reporting {
    gap: 0.65rem;
    padding: 1rem 0.95rem 0.95rem;
    justify-content: space-between;
}

.report-block {
    padding: 0.55rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.report-block:first-of-type {
    border-top: none;
    padding-top: 0.15rem;
}

.report-block__title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(232, 245, 236, 0.92);
}

.report-block__title--fpo {
    color: rgba(232, 212, 180, 0.95);
}

.report-block__period {
    font-size: 0.65rem;
    color: rgba(226, 232, 240, 0.65);
    margin: 0.2rem 0 0.35rem;
}

.report-pipeline {
    display: grid;
    gap: 0.35rem;
}

.report-pipeline div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.72rem;
}

.report-pipeline dt {
    color: rgba(226, 232, 240, 0.72);
    font-weight: 500;
}

.report-pipeline dd {
    font-weight: 800;
    color: #fff;
}

.report-block--fpo .report-pipeline dd,
.overview-reporting .report-block:last-of-type .report-pipeline dd {
    color: #f0dcc0;
}

.overview-donuts {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
}

.ui-card-head--tight {
    padding: 0.55rem 0.85rem 0.4rem;
}

.ui-card-head--tight h2 {
    font-size: 0.82rem;
}

.ui-chart--donut {
    min-height: 0;
    flex: 1;
    padding: 0.25rem 0.65rem 0.45rem;
}

.overview-methodology {
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--ink-on-dark-muted);
    padding: 0 0.2rem;
}

.stat-note-cycle {
    color: var(--ink-muted);
    font-size: 0.58rem;
}

@media (min-width: 1100px) {
    .bento.bento--merged {
        grid-template-columns: minmax(10.5rem, 12.5rem) minmax(0, 1fr) minmax(10.5rem, 12rem);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.55rem 0.75rem;
        align-items: stretch;
    }

    .bento.bento--merged.bento--perf {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .bento.bento--merged > .overview-kpi-row {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .bento.bento--merged > .overview-reporting {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
    }

    .bento.bento--merged.bento--perf > .overview-reporting {
        grid-row: 2;
    }

    .bento.bento--merged > .overview-counties {
        grid-column: 2;
        grid-row: 2;
        min-height: 0;
    }

    .bento.bento--merged.bento--perf > .overview-counties {
        grid-row: 2;
    }

    .bento.bento--merged > .overview-donuts {
        grid-column: 3;
        grid-row: 2;
        min-height: 0;
    }

    .bento.bento--merged.bento--perf > .overview-donuts {
        grid-row: 2;
    }

    .bento.bento--merged .overview-counties,
    .bento.bento--merged .overview-donuts,
    .bento.bento--merged .overview-reporting {
        display: flex;
        flex-direction: column;
    }

    .bento.bento--merged .overview-donuts .ui-card {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .bento.bento--merged .ui-card--spotlight.overview-reporting .btn-spotlight {
        margin-top: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.72rem;
    }
}

.bento--programme {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

@media (min-width: 900px) {
    .bento.bento--programme {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }
    .bento.bento--programme > .programme-stack {
        grid-column: auto;
        min-width: 0;
    }
}

.programme-stack {
    display: grid;
    grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 0.65rem;
    min-width: 0;
    min-height: 0;
}

@media (min-width: 1100px) {
    .bento--overview .ui-card--chart,
    .bento--overview .ui-card--spotlight.overview-reporting {
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .bento--overview .ui-chart,
    .bento--overview .ui-chart--tall {
        flex: 1;
        min-height: 0;
    }
    .bento--overview .ui-chart canvas {
        max-height: none;
    }
    .bento--overview .ui-chart--donut canvas {
        max-height: 100%;
    }
}

.bento--tab-shell {
    height: 100%;
    min-height: 0;
}

.bento--programme.bento--tab-shell {
    align-content: stretch;
}

.bento--programme .dash-module {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .bento--programme .dash-module {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
    .bento--programme .dash-module__hero {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    .bento--programme .dash-module__body {
        grid-row: 2;
        grid-column: 1;
        min-height: 0;
        overflow: auto;
    }
    .bento--programme .dash-module__rail {
        grid-row: 2;
        grid-column: 2;
        margin-top: 0;
        min-height: 0;
        overflow: auto;
        border-top: none;
        border-left: 1px solid var(--border);
    }
}

@media (max-width: 899px) {
    .bento--programme .dash-module__body,
    .bento--programme .dash-module__rail {
        grid-row: auto;
        grid-column: 1;
    }
    .bento--programme .dash-module__rail {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

.bento--programme .fact-list--dash {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.85rem;
}

.bento--programme .ui-card--programme-chart {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.bento--programme .ui-card--programme-chart .ui-chart--compact {
    flex: 1;
    min-height: 8rem;
}

.tab-panel[data-tab-panel="programme"] {
    height: 100%;
    min-height: 0;
}

.tab-panel--counties,
.tab-panel--trends {
    height: 100%;
    min-height: 0;
    display: none;
    flex-direction: column;
    gap: 0.55rem;
}

.tab-panel--counties.is-active,
.tab-panel--trends.is-active {
    display: flex;
}

.tab-panel--trends {
    overflow: hidden;
}

.tab-panel--trends.is-active {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.trends-tab-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem 1rem;
    flex-shrink: 0;
}

.tab-panel--trends .trends-tab-intro {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    flex: 1 1 12rem;
    min-width: 0;
}

.trends-tab-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem 1rem;
    margin-left: auto;
    flex: 0 1 auto;
}

.trends-mode-switch {
    flex-shrink: 0;
    order: 2;
    box-shadow:
        0 0 0 1px rgba(159, 212, 176, 0.28),
        0 6px 20px rgba(0, 0, 0, 0.25);
}

.tab-panel--trends .trends-mode-switch .seg-control-btn {
    padding: 0.42rem 0.9rem;
    font-size: 0.73rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .trends-tab-head__actions {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .trends-view-meta {
        text-align: left;
        max-width: none;
    }
}

.tab-panel--trends .seg-control {
    background: rgba(0, 0, 0, 0.32);
    border-color: rgba(255, 255, 255, 0.14);
}

.tab-panel--trends .seg-control-btn {
    color: rgba(238, 246, 239, 0.78);
}

.tab-panel--trends .seg-control-btn.is-active {
    background: rgba(255, 255, 255, 0.94);
    color: var(--green-dark, #17402a);
}

.trends-view-meta {
    margin: 0;
    order: 1;
    font-size: 0.72rem;
    color: rgba(232, 245, 236, 0.72);
    max-width: 20rem;
    line-height: 1.35;
    text-align: right;
}

.trends-board {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 0.1rem 0.2rem 0.35rem 0;
}

.trends-board::-webkit-scrollbar {
    width: 7px;
}

.trends-board::-webkit-scrollbar-thumb {
    background: rgba(159, 212, 176, 0.35);
    border-radius: 999px;
}

.trends-board::-webkit-scrollbar-track {
    background: transparent;
}

.trends-view {
    display: none;
    gap: 0.65rem;
    align-content: start;
}

.trends-view.is-active {
    display: grid;
}

.trends-grid--sacco {
    grid-template-columns: 1fr;
}

.trends-grid--fpo {
    grid-template-columns: 1fr;
}

@media (min-width: 880px) {
    .trends-grid--sacco {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    }

    .trends-grid--sacco .trends-glass--financial {
        grid-column: 1 / -1;
    }

    .trends-grid--fpo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trends-grid--fpo .trends-glass--hero,
    .trends-grid--fpo .trends-glass--market {
        grid-column: 1 / -1;
    }
}

.trends-glass {
    position: relative;
    isolation: isolate;
    min-width: 0;
    padding: 0.85rem 1rem 0.75rem;
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(22, 58, 40, 0.78) 0%, rgba(8, 28, 19, 0.88) 100%);
    border: 1px solid rgba(159, 212, 176, 0.2);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.trends-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(ellipse 90% 55% at 8% 0%, rgba(82, 183, 136, 0.14), transparent 58%);
}

.trends-glass--fpo::before {
    background: radial-gradient(ellipse 85% 55% at 92% 0%, rgba(209, 166, 58, 0.12), transparent 58%);
}

.trends-glass--hero {
    padding-top: 0.95rem;
}

.trends-metric-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.45rem;
}

.trends-metric-head--hero {
    margin-bottom: 0.35rem;
}

.trends-metric-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(238, 246, 239, 0.95);
}

.trends-metric-caption {
    font-size: 0.68rem;
    color: rgba(232, 245, 236, 0.62);
    flex: 1 1 100%;
}

.trends-metric-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    margin-left: auto;
}

.trends-metric-head--inline-chips {
    align-items: center;
}

.trends-metric-head--inline-chips .trends-metric-title {
    flex: 1 1 auto;
    min-width: 0;
}

.trends-metric-stats--multi {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem 0.65rem;
    flex: 0 1 auto;
    max-width: 100%;
}

@media (min-width: 900px) {
    .trends-metric-head--inline-chips .trends-metric-stats--multi {
        flex-wrap: nowrap;
    }
}

.trends-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(232, 245, 236, 0.62);
    white-space: nowrap;
}

.trends-latest {
    font-size: 0.82rem;
    font-weight: 700;
    color: #eef6ef;
}

.trends-delta,
.trends-stat-chip em {
    font-style: normal;
    font-weight: 600;
    font-size: 0.68rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
}

.trends-delta.is-up,
.trends-stat-chip em.is-up {
    color: #b7e4c7;
    background: rgba(82, 183, 136, 0.28);
}

.trends-delta.is-down,
.trends-stat-chip em.is-down {
    color: #ffb4ab;
    background: rgba(180, 35, 24, 0.28);
}

.trends-delta.is-flat,
.trends-stat-chip em.is-flat {
    color: rgba(232, 245, 236, 0.75);
    background: rgba(255, 255, 255, 0.1);
}

.trends-glass .ui-chart {
    position: relative;
    width: 100%;
}

.ui-chart--trend-hero {
    min-height: clamp(7.25rem, 20vh, 10.5rem);
    height: clamp(7.25rem, 20vh, 10.5rem);
}

.ui-chart--trend-md {
    min-height: clamp(6.75rem, 18vh, 9.5rem);
    height: clamp(6.75rem, 18vh, 9.5rem);
}

.ui-chart--trend-lg {
    min-height: clamp(7.5rem, 21vh, 11rem);
    height: clamp(7.5rem, 21vh, 11rem);
}

.trends-footnote {
    margin: 0;
    padding: 0 0.15rem 0.15rem;
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(232, 245, 236, 0.58);
    max-width: 72rem;
    flex-shrink: 0;
}

.tab-shell-frame {
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

@media (max-width: 899px) {
    .bento--programme .programme-stack {
        grid-template-rows: auto auto;
    }
    .bento--programme {
        overflow: auto;
    }
}

.ui-chart--compact {
    position: relative;
    min-height: 11rem;
    padding: 0.65rem 1rem 1rem;
}

.about-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    overflow: auto;
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 0.5rem;
}

.dash-frame__head--split {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.seg-control--county {
    margin-left: auto;
}

.dash-frame__head .seg-control {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(255, 255, 255, 0.12);
}

.dash-frame__head .seg-control-btn {
    color: rgba(238, 246, 239, 0.78);
}

.dash-frame__head .seg-control-btn.is-active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--green-dark);
    box-shadow: none;
}

.counties-split {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: stretch;
}

@media (min-width: 1100px) {
    .counties-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ui-card--county-table {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: var(--surface);
    border: 1px solid rgba(13, 40, 24, 0.08);
    box-shadow: 0 1px 2px rgba(13, 40, 24, 0.06), 0 4px 14px rgba(13, 40, 24, 0.05);
}

.ui-card-head--county {
    align-items: center;
    padding-bottom: 0.35rem;
}

.ui-card-head--county h2 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.01em;
}

.ui-card-head--county .data-card-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ink-muted);
}

.county-table-filters {
    margin: 0 0.75rem 0.5rem;
}

.tab-panel--counties .county-table-scroll {
    flex: 1;
    min-height: 10rem;
    max-height: calc(100vh - 14rem);
    margin: 0 0.75rem 0;
    overflow: auto;
}

.ui-card--county-table .landing-dt-footer,
.ui-card--county-table .navcdp-dt-footer {
    margin: 0 0.75rem 0.75rem;
    border-radius: 0 0 var(--radius-sm, 0.45rem) var(--radius-sm, 0.45rem);
}

.ui-card--county-table table.landing-dt {
    table-layout: fixed;
    font-size: 0.76rem;
}

.ui-card--county-table table.landing-dt thead th {
    padding: 0.45rem 0.35rem;
    font-size: 0.58rem;
    line-height: 1.25;
    white-space: normal;
    hyphens: auto;
}

.ui-card--county-table table.landing-dt td {
    padding: 0.4rem 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-card--county-table .col-county-sticky {
    min-width: 0;
    width: 30%;
}

.tab-panel--counties .filter-panel {
    background: rgba(246, 250, 247, 0.97);
    border-radius: var(--radius-sm, 0.45rem);
}

.ui-card-head--split {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.seg-control {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    margin-left: auto;
}

.seg-control-btn {
    font-family: var(--font);
    border: none;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.32rem 0.62rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--ink-muted);
}

.seg-control-btn.is-active {
    background: var(--surface);
    color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.page-intro {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem 0.15rem 0.5rem;
}

@media (min-width: 768px) {
    .page-intro {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.page-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 0.35rem;
}

.page-intro h1 {
    font-size: clamp(1.55rem, 3.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.page-lead {
    margin-top: 0.45rem;
    max-width: 52ch;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.page-intro-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .page-intro-meta { align-items: flex-end; }
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--green-dark);
    background: var(--surface);
    border: 1px solid var(--green-tint);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-soft);
}

.badge-verified i { color: var(--green-mid); }

.meta-stamp {
    font-size: 0.75rem;
    color: var(--ink-muted);
    max-width: 22rem;
    text-align: left;
}

@media (min-width: 768px) {
    .meta-stamp { text-align: right; }
}

/* ── Bento grid ── */
.bento {
    display: grid;
    gap: 1.15rem;
    grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
    .bento:not(.bento--merged):not(.bento--programme) {
        grid-template-columns: repeat(12, 1fr);
        gap: 1.25rem;
    }
    .bento:not(.bento--merged):not(.bento--programme) .ui-card--spotlight { grid-column: span 3; }
    .bento:not(.bento--merged):not(.bento--programme) .ui-card--chart.ui-card--span-2 { grid-column: span 6; }
    .bento:not(.bento--merged):not(.bento--programme) .ui-card--chart:not(.ui-card--span-2) { grid-column: span 3; }
    .bento:not(.bento--merged):not(.bento--programme) .bento-kpis--sacco { grid-column: span 6; }
    .bento:not(.bento--merged):not(.bento--programme) .bento-kpis--fpo { grid-column: span 6; }
    .ui-card--detail.ui-card--sacco { grid-column: span 6; }
    .ui-card--detail.ui-card--fpo { grid-column: span 6; }
    .bento-full { grid-column: span 12; }
}

.ui-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.ui-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.ui-card-head h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ui-card-head p {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}

.ui-card-head--stack { border-bottom: none; padding-bottom: 0.35rem; }

.ui-card-body { padding: 1.1rem 1.25rem 1.25rem; }

.ui-card-body--flush { padding: 0 1rem 1.25rem; }

/* Spotlight */
.ui-card--spotlight {
    background: var(--spotlight);
    color: #e2e8f0;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.35rem 1.25rem 1.25rem;
    min-height: 0;
}

.spotlight-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(226, 232, 240, 0.75);
}

.spotlight-metrics {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.65rem;
}

.spotlight-kicker {
    display: block;
    font-size: 0.68rem;
    color: rgba(226, 232, 240, 0.65);
    margin-bottom: 0.2rem;
}

.spotlight-value {
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.spotlight-mid {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.spotlight-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.85);
}

.spotlight-stat strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.spotlight-cycle {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.9);
}

.spotlight-cycle i {
    width: 1.1rem;
    color: var(--accent-cyan);
    margin-right: 0.35rem;
}

.btn-spotlight {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-spotlight:hover { background: rgba(255, 255, 255, 0.18); }

/* Charts */
.ui-chart {
    position: relative;
    min-height: 240px;
    padding: 0.5rem 1rem 1.15rem;
}

.ui-chart--tall { min-height: 300px; }

.ui-chart canvas { max-height: 280px; }

/* KPI bands */
.bento-kpis { display: flex; flex-direction: column; gap: 0.65rem; }

.kpi-band-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 0.15rem;
}

.kpi-band-title--sacco { color: var(--green-dark); }
.kpi-band-title--fpo { color: var(--brown); }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 1100px) {
    .bento--overview .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stat-card {
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 88px;
    height: 88px;
    background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.08), transparent 70%);
    pointer-events: none;
}

.stat-card .stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
    position: relative;
    max-width: 11rem;
    line-height: 1.35;
}

.stat-card .stat-value {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    position: relative;
}

.stat-card .stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.35rem;
    opacity: 0.1;
    color: var(--accent);
}

.stat-card.success .stat-icon { color: var(--green-mid); }
.stat-card.info .stat-icon { color: var(--accent); }
.stat-card.warning .stat-icon { color: var(--gold); }

.stat-note {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: var(--ink-muted);
    position: relative;
    line-height: 1.35;
}

.stat-note:empty { display: none; }

.stat-note-highlight {
    color: var(--green-dark);
    font-weight: 800;
}

.bento-kpis--fpo .stat-note-highlight {
    color: var(--brown);
}

.bento-kpis--compact .stat-note {
    font-size: 0.62rem;
}

.bento-kpis--wide {
    grid-column: 1 / -1;
}

.rank-list--rail {
    max-height: 8rem;
    overflow: auto;
    font-size: 0.72rem;
}

.rank-list--rail-tight {
    max-height: 6.25rem;
    font-size: 0.65rem;
}

.ui-card--spotlight .rank-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.4rem;
    border-bottom-color: rgba(255, 255, 255, 0.14);
    font-size: 0.65rem;
    padding: 0.3rem 0;
    align-items: baseline;
}

.ui-card--spotlight .rank-list li span:first-child {
    color: rgba(232, 245, 236, 0.94);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ui-card--spotlight .rank-list li span:last-child {
    color: #7dcea0;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding-right: 0.2rem;
}

.ui-card--spotlight .rank-list.rank-list--rail,
.ui-card--spotlight .rank-list.rank-list--rail-tight {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    padding-right: 0.15rem;
    margin-right: -0.05rem;
}

.ui-card--spotlight .rank-list.rank-list--rail::-webkit-scrollbar,
.ui-card--spotlight .rank-list.rank-list--rail-tight::-webkit-scrollbar {
    width: 5px;
}

.ui-card--spotlight .rank-list.rank-list--rail::-webkit-scrollbar-thumb,
.ui-card--spotlight .rank-list.rank-list--rail-tight::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
}

.perf-rail--fpo .rank-list li span:last-child {
    color: #f0dcc0;
}

.ui-card--spotlight .rank-empty {
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.62rem;
}

.bento--perf .bento-kpis--compact .stat-card {
    min-height: 0;
    padding: 0.42rem 0.48rem 0.48rem;
}

.bento--perf .bento-kpis--compact .stat-card::before {
    width: 48px;
    height: 48px;
}

.bento--perf .bento-kpis--compact .stat-label {
    font-size: 0.58rem;
    margin-bottom: 0.2rem;
    max-width: none;
}

.bento--perf .bento-kpis--compact .stat-value {
    font-size: 0.98rem;
}

.bento--perf .bento-kpis--compact .stat-value--kes {
    font-size: 0.88rem !important;
}

.bento--perf .bento-kpis--compact .stat-note {
    font-size: 0.54rem;
    line-height: 1.25;
    margin-top: 0.12rem;
}

.bento--perf .kpi-grid--perf {
    gap: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1100px) {
    .tab-panel--sacco .bento--perf .kpi-grid--perf,
    .tab-panel--fpo .bento--perf .kpi-grid--perf {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* SACCO/FPO perf KPIs: 2-col below 1100px — mobile polish in max-width 899px block */

.bento--perf .overview-kpi-row--perf {
    gap: 0;
}

.ui-card--spotlight.perf-rail {
    padding: 0.7rem 0.8rem 0.75rem;
    gap: 0.35rem;
    min-height: 0;
}

.perf-rail .report-block {
    padding: 0.3rem 0;
}

.perf-rail .report-block--flush {
    padding-bottom: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.perf-rail .report-block--flush .rank-list--rail,
.perf-rail .report-block--flush .rank-list--rail-tight {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.report-pipeline--compact {
    gap: 0.28rem;
}

.report-pipeline--compact div {
    font-size: 0.65rem;
}

.report-pipeline--compact dd {
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.perf-rail__hint {
    margin: 0.15rem 0 0;
    font-size: 0.58rem;
    line-height: 1.35;
    color: rgba(226, 232, 240, 0.62);
}

.tab-panel--sacco,
.tab-panel--fpo {
    flex-direction: column;
    gap: 0.28rem;
    min-height: 0;
    height: 100%;
}

.tab-panel--sacco.is-active,
.tab-panel--fpo.is-active {
    display: flex;
}

.tab-panel--sacco > .bento--sacco-unified {
    flex: 1 1 auto;
    min-height: 0;
}

.sacco-split,
.fpo-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: start;
    min-width: 0;
}

.sacco-main-column,
.fpo-main-column {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.sacco-cards-grid,
.fpo-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .sacco-cards-grid,
    .fpo-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .sacco-split,
    .fpo-split {
        grid-template-columns: minmax(10.5rem, 12rem) minmax(0, 1fr);
        gap: 0.55rem 0.75rem;
        align-items: stretch;
    }

    .sacco-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: minmax(0, auto);
        align-content: start;
    }

    .fpo-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: minmax(0, auto);
        align-content: start;
    }

    .fpo-split > .fpo-main-column {
        display: flex;
        flex-direction: column;
        min-height: 0;
        align-self: stretch;
    }

    .fpo-cards-grid.fpo-cards-grid--three {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        align-content: stretch;
        grid-auto-rows: 1fr;
        align-items: stretch;
    }

    .fpo-cards-grid.fpo-cards-grid--three > .ui-card {
        height: 100%;
        min-height: 0;
        box-sizing: border-box;
    }

    .sacco-reporting-pad,
    .fpo-reporting-pad {
        min-height: 100%;
        align-self: stretch;
    }

    .fpo-split > .fpo-reporting-pad.ui-card--spotlight {
        height: 100%;
    }
}

.sacco-mis-notice {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem 0.6rem;
    border-radius: var(--radius-md, 0.65rem);
    background: rgba(8, 28, 18, 0.42);
    border: 1px solid rgba(159, 212, 176, 0.2);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.sacco-mis-notice__lead {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.4;
    color: rgba(240, 253, 244, 0.95);
}

.sacco-mis-notice__detail {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.45;
    color: rgba(232, 245, 236, 0.78);
}

@media (min-width: 1100px) {
    .bento.bento--merged.bento--sacco-unified {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: start;
        overflow-y: auto;
        min-height: 0;
    }

    .bento.bento--merged.bento--sacco-unified > .overview-kpi-row {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .bento.bento--merged.bento--sacco-unified > .sacco-split {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow: visible;
        min-height: 0;
    }

    .bento.bento--merged.bento--fpo-unified {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: start;
        overflow-y: auto;
        min-height: 0;
    }

    .bento.bento--merged.bento--fpo-unified > .overview-kpi-row {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .bento.bento--merged.bento--fpo-unified > .fpo-split {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow: visible;
        min-height: 0;
    }
}

.tab-panel--fpo > .bento--fpo-unified {
    flex: 1 1 auto;
    min-height: 0;
}

.fpo-reporting-pad .report-pipeline--compact div,
.sacco-reporting-pad .report-pipeline--compact div {
    font-size: 0.68rem;
}

.ui-card-head--solo {
    display: block;
}

.ui-card-head--solo h2 {
    margin: 0;
}

.sacco-card-kicker {
    margin: 0;
    padding: 0 0.85rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--green-dark);
    letter-spacing: 0.01em;
}

.tab-panel--sacco .sacco-par-card .par-bucket-list {
    padding-top: 0.15rem;
}

.par-bucket-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.par-bucket-item {
    display: grid;
    grid-template-columns: minmax(5.5rem, 6.75rem) minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.68rem;
}

.par-bucket-label {
    color: #475569;
    font-weight: 600;
    line-height: 1.25;
}

.par-bucket-track {
    display: block;
    height: 0.45rem;
    border-radius: 999px;
    background: #eef2eb;
    overflow: hidden;
}

.par-bucket-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    min-width: 2px;
}

.par-bucket-value {
    font-weight: 800;
    color: var(--green-dark);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.par-bucket-empty {
    font-size: 0.68rem;
    color: var(--ink-muted);
    padding: 0.25rem 0;
}

/* Insight visuals (reference-style bars & stack summaries) */
.ui-card-head--insight {
    position: relative;
    padding-bottom: 0.45rem;
    margin-bottom: 0.15rem;
}

.ui-card-head--insight::after {
    content: '';
    display: block;
    width: 2.25rem;
    height: 2px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #2d6a30, #52b788);
}

.tab-panel--fpo .fpo-insight-card {
    border: 1px solid rgba(13, 40, 24, 0.07);
    box-shadow: 0 1px 2px rgba(13, 40, 24, 0.06), 0 4px 14px rgba(13, 40, 24, 0.05);
}

.insight-stack-block {
    padding: 0 0.85rem 0.5rem;
}

.insight-stack-bar {
    display: flex;
    width: 100%;
    height: 0.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: #eef2eb;
}

.insight-stack-bar--summary {
    height: 0.55rem;
}

.insight-stack-bar.is-empty {
    background: #eef2eb;
    min-height: 0.55rem;
}

.insight-stack-segment {
    display: block;
    height: 100%;
    min-width: 2px;
}

.insight-stack-legend {
    list-style: none;
    margin: 0.45rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.insight-stack-legend--compact {
    gap: 0.28rem;
}

.insight-stack-legend-item {
    display: grid;
    grid-template-columns: 0.45rem minmax(0, 1fr) auto auto;
    gap: 0.35rem 0.45rem;
    align-items: center;
    font-size: 0.65rem;
    line-height: 1.25;
}

.insight-stack-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.insight-stack-label {
    color: #475569;
    font-weight: 600;
}

.insight-stack-value {
    font-weight: 800;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.insight-stack-pct {
    font-weight: 700;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    text-align: right;
}

.insight-stack-legend-empty {
    font-size: 0.65rem;
    color: #64748b;
    padding: 0.15rem 0;
}

.insight-bar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.insight-bar-list--rail {
    max-height: 7.5rem;
    overflow-y: auto;
    padding-right: 0.1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.insight-bar-row {
    display: grid;
    grid-template-columns: minmax(3.5rem, 4.75rem) minmax(0, 1fr) auto;
    gap: 0.35rem 0.4rem;
    align-items: center;
    font-size: 0.62rem;
    line-height: 1.2;
}

.insight-bar-label {
    font-weight: 600;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-bar-track {
    display: block;
    height: 0.38rem;
    border-radius: 999px;
    background: #eef2eb;
    overflow: hidden;
}

.insight-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #52b788;
    min-width: 2px;
}

.insight-bar-fill--lead {
    background: linear-gradient(90deg, #2d6a30, #52b788);
}

.insight-bar-value {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--green-dark);
    white-space: nowrap;
}

.insight-bar-empty {
    font-size: 0.62rem;
    color: rgba(232, 245, 236, 0.72);
    padding: 0.2rem 0;
}

.ui-card--spotlight .insight-bar-label {
    color: rgba(232, 245, 236, 0.88);
}

.ui-card--spotlight .insight-bar-value {
    color: #f0dcc0;
}

.ui-card--spotlight .insight-bar-track {
    background: rgba(255, 255, 255, 0.12);
}

.ui-card--spotlight .insight-bar-fill {
    background: rgba(159, 212, 176, 0.85);
}

.ui-card--spotlight .insight-bar-fill--lead {
    background: linear-gradient(90deg, #52b788, #9fd4b0);
}

.par-bucket-list--insight {
    gap: 0.35rem;
    padding-top: 0.25rem;
}

.par-bucket-list--insight .par-bucket-track {
    height: 0.38rem;
}

.fpo-pl-card .insight-stack-block--solo,
.fpo-pl-card .fpo-pl-bucket-block {
    padding-bottom: 0.65rem;
}

.fpo-combined-card .insight-stack-subhead--in-card {
    margin: 0.45rem 0.85rem 0.2rem;
}

.fpo-combined-card .insight-stack-subhead--in-card:first-of-type {
    margin-top: 0.15rem;
}

.fpo-combined-card .fpo-card-section-label {
    padding-top: 0.35rem;
    border-top: 1px solid rgba(45, 106, 48, 0.1);
}

.fpo-volume-sales-card .fpo-pl-bucket-block {
    padding-top: 0;
    padding-bottom: 0.5rem;
}

.fpo-loans-grants-card .fpo-loans-highlight {
    padding-top: 0.1rem;
}

.fpo-loans-grants-card .fpo-loans-highlight + .sacco-card-kicker {
    padding-top: 0.35rem;
}

.fpo-grants-disb-mix {
    padding-top: 0.15rem;
}

.fpo-pl-card .par-bucket-list--insight .par-bucket-label {
    min-width: 4.75rem;
}

.fpo-pl-card .par-bucket-list--insight .par-bucket-value {
    font-size: 0.62rem;
    white-space: nowrap;
}

.tab-panel--fpo .fpo-insight-card .report-pipeline--sacco-detail {
    gap: 0.2rem;
}

.insight-stack-block--inset {
    padding: 0.35rem 0.85rem 0.55rem;
    border-top: 1px solid var(--border);
    margin-top: 0.15rem;
}

.insight-stack-subhead {
    margin: 0 0 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.insight-stack-legend--grants .insight-stack-legend-item {
    grid-template-columns: 0.45rem minmax(3.5rem, 4.25rem) minmax(0, 1fr) auto;
}

.insight-stack-value--grant {
    font-size: 0.6rem;
    font-weight: 700;
    white-space: normal;
    line-height: 1.25;
    text-align: right;
}

.insight-stack-block--grants {
    margin-top: 0;
}

.perf-rail .report-block--flush .insight-bar-list--rail {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.sacco-par-card,
.sacco-grants-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sacco-tab-intro {
    margin: 0;
    flex-shrink: 0;
    padding: 0 0.05rem;
    min-height: 1.5rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(232, 245, 236, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-panel--sacco .sacco-tab-intro,
.tab-panel--fpo .sacco-tab-intro {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
}

.sacco-tab-intro__title {
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--green-glow, #9fd4b0);
}

.sacco-tab-intro__sep {
    margin: 0 0.35rem;
    opacity: 0.55;
}

.sacco-tab-intro__meta {
    font-weight: 500;
    color: rgba(232, 245, 236, 0.72);
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow-card);
    color: var(--ink);
    flex: none;
    align-self: start;
    width: 100%;
    min-height: 0;
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic .ui-card-head,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic .ui-card-head {
    border-bottom-color: var(--border);
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic .ui-card-head h2,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic .ui-card-head h2 {
    color: var(--green-dark);
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic .ui-card-head__meta,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic .ui-card-head__meta {
    color: #475569;
    font-weight: 600;
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic .report-pipeline dt,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic .report-pipeline dt {
    color: #475569;
    font-weight: 600;
}

.tab-panel--sacco .sacco-cards-grid .ui-card--sacco-mosaic .report-pipeline dd,
.tab-panel--fpo .fpo-cards-grid .ui-card--fpo-mosaic .report-pipeline dd {
    color: var(--green-dark);
    font-weight: 800;
}

.report-pipeline--sacco-detail {
    padding: 0 0.85rem 0.35rem;
    align-content: start;
}

.report-pipeline--sacco-detail dd {
    font-weight: 700;
    font-size: 0.82rem;
}

.tab-panel--sacco .sacco-cards-grid .ui-card-footnote--compact,
.tab-panel--fpo .fpo-cards-grid .ui-card-footnote--compact {
    margin: 0;
    padding: 0.45rem 0.85rem 0.65rem;
    font-size: 0.62rem;
    line-height: 1.45;
    color: #475569;
    border-top: 1px solid var(--border);
}

.tab-panel--fpo .fpo-cards-grid .report-pipeline--sacco-detail {
    gap: 0.22rem;
}

.tab-panel--fpo .fpo-cards-grid .ui-card--chart.fpo-card-chart {
    display: flex;
    flex-direction: column;
}

.tab-panel--sacco .sacco-cards-grid .ui-chart,
.tab-panel--fpo .fpo-cards-grid .ui-chart {
    flex: 0 0 auto !important;
    min-height: 9rem !important;
}

.tab-panel--sacco .sacco-cards-grid .ui-chart--county-bars {
    min-height: 8.5rem !important;
    max-height: 10rem;
}

.tab-panel--sacco .sacco-cards-grid .ui-chart--donut-compact,
.tab-panel--fpo .fpo-cards-grid .ui-chart--donut-compact {
    min-height: 8.5rem !important;
    max-height: 10rem;
}

.tab-panel--sacco .sacco-cards-grid .ui-chart canvas,
.tab-panel--fpo .fpo-cards-grid .ui-chart canvas {
    max-height: none;
}

@media (min-width: 1100px) {
    .bento--sacco-unified.bento--overview .sacco-cards-grid .ui-card--chart {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

}

.ui-chart--medium {
    min-height: 10.5rem;
    max-height: 12.5rem;
    padding: 0.25rem 0.65rem 0.55rem;
}

.ui-chart--donut-compact {
    min-height: 7.5rem;
    max-height: 9rem;
}

/* SACCO tab: readable KPIs (not ultra-compact perf sizing) */
.tab-panel--sacco .bento--perf .bento-kpis--compact .stat-card {
    min-height: 5.25rem;
    padding: 0.72rem 0.78rem 0.78rem;
}

.tab-panel--sacco .bento--perf .bento-kpis--compact .stat-label {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.28rem;
}

.tab-panel--sacco .bento--perf .bento-kpis--compact .stat-value {
    font-size: 1.15rem;
}

.tab-panel--sacco .bento--perf .bento-kpis--compact .stat-value--kes {
    font-size: 1.02rem !important;
}

.tab-panel--sacco .bento--perf .bento-kpis--compact .stat-note {
    font-size: 0.62rem;
    line-height: 1.35;
    margin-top: 0.22rem;
}

.seg-control--sacco-sub {
    flex-shrink: 0;
}

.sacco-sub-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sacco-sub-panel[hidden] {
    display: none !important;
}

.sacco-sub-panel > .bento {
    height: 100%;
    min-height: 0;
}

@media (min-width: 1100px) {
    .bento.bento--merged.bento--digest {
        grid-template-columns: minmax(13.5rem, 15.5rem) minmax(0, 1fr) minmax(11.5rem, 13.5rem);
    }
}

.bento--digest > .overview-counties {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bento--digest > .overview-counties .ui-card-head__meta {
    font-size: 0.68rem;
}

.bento--digest .perf-rail {
    padding: 0.85rem 0.9rem 0.9rem;
    gap: 0.5rem;
}

.bento--digest .perf-rail .digest-alert {
    font-size: 0.68rem;
    line-height: 1.5;
    margin: 0;
}

.bento--digest .perf-rail .report-pipeline--compact div {
    font-size: 0.7rem;
}

.bento--digest .perf-rail .report-pipeline--compact dd {
    font-size: 0.88rem;
}

.bento--digest .perf-rail .perf-rail__hint {
    font-size: 0.62rem;
    line-height: 1.45;
}

.digest-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.75rem 1rem 1rem;
}

.ui-card-head__meta {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin: 0.2rem 0 0;
    font-weight: 500;
}

.kpi-grid--digest-fill {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(5.75rem, 1fr);
    gap: 0.65rem;
}

@media (min-width: 900px) {
    .kpi-grid--digest-fill {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(5.75rem, 1fr));
    }
}

.kpi-grid--digest-fill .stat-card {
    min-height: 5.75rem;
    padding: 0.85rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-grid--digest-fill .stat-label {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.kpi-grid--digest-fill .stat-value {
    font-size: 1.12rem;
}

.kpi-grid--digest-fill .stat-value--kes {
    font-size: 1rem !important;
}

.kpi-grid--digest-fill .stat-note {
    font-size: 0.62rem;
    line-height: 1.35;
    margin-top: 0.25rem;
}

.digest-card-body--pipeline {
    justify-content: flex-start;
}

.report-pipeline--readable {
    gap: 0.55rem;
}

.report-pipeline--readable div {
    font-size: 0.72rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.report-pipeline--readable dt {
    font-weight: 600;
    color: var(--ink-muted);
}

.report-pipeline--readable dd {
    font-size: 1rem;
    font-weight: 800;
    color: var(--green-dark);
}

.digest-mismatch-foot {
    margin: 0.65rem 0 0;
    font-size: 0.62rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

.digest-mismatch-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.perf-rail__hint--mis {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.58rem;
    line-height: 1.45;
    color: rgba(226, 232, 240, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.perf-rail--inline {
    flex: 1;
    min-height: 0;
    justify-content: flex-start;
}

.overview-donuts--perf {
    gap: 0.45rem;
}

.overview-donuts--perf .ui-card--chart {
    flex: 1.35;
}

.overview-donuts--perf .perf-rail--inline {
    flex: 0.85;
}

@media (min-width: 1100px) {
    .bento--perf .ui-card-head--tight {
        padding: 0.45rem 0.75rem 0.35rem;
    }

    .bento--perf .ui-card-head--tight h2 {
        font-size: 0.75rem;
    }
}

.perf-rail .report-pipeline dd {
    color: #fff;
}

.perf-rail--fpo .report-pipeline dd {
    color: #f0dcc0;
}

.stat-value--kes { font-size: clamp(0.95rem, 1.8vw, 1.15rem) !important; }

.is-loading {
    color: transparent !important;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 6px;
    min-height: 1.25rem;
    display: inline-block;
    min-width: 3.5rem;
}

.spotlight-value.is-loading,
.spotlight-stat strong.is-loading {
    min-width: 4rem;
    vertical-align: middle;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Detail cards */
.fact-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1rem;
}

.fact-list div {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.fact-list dt {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fact-list dd {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-top: 0.15rem;
}

.rank-block { margin-top: 1rem; }

.rank-block h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
}

.rank-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }

.rank-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border);
}

.rank-list li span:last-child { font-weight: 700; color: var(--green-dark); }

.rank-empty { color: var(--ink-muted); border: none !important; }

.ui-card--detail.ui-card--sacco .ui-card-head h2 { color: var(--green-dark); }
.ui-card--detail.ui-card--fpo .ui-card-head h2 { color: var(--brown); }

/* County tables */
.report-table-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-table-block { display: flex; flex-direction: column; gap: 0.6rem; }

.filter-panel {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
}

.filter-panel--compact { flex-wrap: nowrap; }

.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    flex: 1;
    min-width: 0;
    align-items: flex-end;
}

.filter-field label {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    margin-bottom: 0.2rem;
}

.landing-field {
    font-family: var(--font);
    font-size: 0.82rem;
    padding: 0.35rem 0.55rem;
    min-height: 2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    width: 100%;
}

.filter-field--search { flex: 1 1 140px; max-width: 220px; }
.filter-field--county { flex: 0 0 150px; max-width: 180px; }

.btn-filter-clear {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    min-height: 2rem;
    flex-shrink: 0;
}

.btn-filter-clear:hover { background: #eff6ff; color: var(--accent); }

@media (max-width: 640px) {
    .filter-panel--compact { flex-wrap: wrap; }
    .filter-field--search, .filter-field--county { flex: 1 1 100%; max-width: none; }
}

.data-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.landing-data-card { box-shadow: none; }

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.data-card-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.data-card-title--sacco { color: var(--green-dark); }
.data-card-title--fpo { color: var(--brown); }

.data-card-count {
    font-size: 0.75rem;
    color: var(--ink-muted);
    font-weight: 600;
}

.dashboard-table-scroll {
    max-height: min(480px, calc(100vh - 220px));
    overflow: auto;
}

.landing-table-scroll table.landing-dt {
    width: 100% !important;
    margin: 0 !important;
    font-size: 0.82rem;
}

.landing-table-scroll table.landing-dt thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f5f9;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    padding: 0.6rem 0.65rem;
    border-bottom: 1px solid var(--border);
}

.landing-table-scroll table.landing-dt td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--ink-soft);
}

.landing-table-scroll table.landing-dt td.dt-num,
.landing-table-scroll table.landing-dt thead th:not(.col-county-sticky) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.landing-table-scroll .col-county-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    font-weight: 700;
    color: var(--ink);
    text-align: left !important;
    min-width: 120px;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.04);
}

.landing-table-scroll thead th.col-county-sticky { z-index: 5; background: #f1f5f9; }

.data-card > .navcdp-dt-footer,
.landing-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.navcdp-dt-footer .dataTables_length label,
.navcdp-dt-footer .dataTables_info { margin: 0; }

.navcdp-dt-footer .dataTables_paginate .paginate_button {
    font-family: var(--font);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
}

.navcdp-dt-footer .dataTables_paginate .paginate_button.current {
    background: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    color: var(--accent) !important;
}

.landing-table-scroll .dataTables_filter,
.landing-table-scroll .dataTables_length { display: none; }

/* Steps */
.ui-card--steps { padding-bottom: 0.25rem; }

.steps {
    list-style: none;
    display: grid;
    gap: 0.85rem;
    padding: 0 1.25rem 1.25rem;
}

@media (min-width: 768px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--accent);
    background: #eff6ff;
    border-radius: 12px;
}

.step-body h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.step-body p {
    font-size: 0.82rem;
    color: var(--ink-soft);
}

/* Forms & footer */
.form-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 560px) {
    .form-links { grid-template-columns: 1fr 1fr; }
}

.form-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 0.15s, box-shadow 0.15s;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.form-btn--sacco { color: var(--green-dark); border-color: var(--green-tint); }
.form-btn--fpo { color: var(--brown); border-color: #f7ead8; }

.partners {
    text-align: center;
    padding: 0.5rem 0;
}

.partners img {
    max-width: 100%;
    height: auto;
    max-height: 56px;
    opacity: 0.85;
}

.landing-footer {
    text-align: center;
    padding: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.landing-footer-v1 { margin-top: 0.35rem; }

.landing-footer-v1 a {
    color: var(--ink-soft);
    font-weight: 600;
}

.landing-footer-v1 a:hover { color: var(--accent); }

/* Modal */
.modal[hidden] { display: none; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.modal-panel {
    position: relative;
    width: min(100%, 420px);
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem 1.35rem;
    box-shadow: var(--shadow-card);
}

.modal-panel--login {
    width: min(100%, 420px);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.75rem 1.5rem 1.5rem;
}

.modal-panel--login .modal-sub {
    margin-bottom: 1.25rem;
}

.modal-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.modal-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.modal-tool {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s, border-color 0.15s;
}

.modal-tool:hover {
    background: var(--surface);
    border-color: rgba(45, 106, 48, 0.35);
}

.modal-tool:focus-visible {
    outline: 2px solid var(--green-mid);
    outline-offset: 1px;
}

.modal-tool i {
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    font-size: 0.8rem;
    background: var(--green-tint);
    color: var(--green-dark);
}

.modal-tool--fpo i { background: #f7ead8; color: var(--brown); }

.modal-tool span {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.modal-tool small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--ink-muted);
}

@media (max-width: 420px) {
    .modal-tools { grid-template-columns: 1fr; }
}

.modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    border: none;
    background: var(--surface-muted);
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    cursor: pointer;
    color: var(--ink-soft);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--green-dark);
}

.modal-sub {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0.35rem 0 1.1rem;
}

.modal-options { display: flex; flex-direction: column; gap: 0.65rem; }

.modal-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.modal-option:hover {
    background: var(--surface-muted);
    border-color: rgba(45, 106, 48, 0.35);
}

.modal-option-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1rem;
}

.modal-option--sacco .modal-option-icon { background: var(--green-tint); color: var(--green-dark); }
.modal-option--fpo .modal-option-icon { background: #f7ead8; color: var(--brown); }

.modal-option-text strong {
    display: block;
    font-size: 0.9rem;
}

.modal-option-text span {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.modal-option-arrow {
    margin-left: auto;
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ── Programme / county dashboard shells ── */
.dash-module {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(209, 166, 58, 0.12);
    background: var(--surface);
    color: var(--ink);
}

.dash-module__hero {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #1e4d32 0%, #0f281c 100%);
    color: #eef6ef;
}

.dash-module--fpo .dash-module__hero {
    background: linear-gradient(135deg, #4a3520 0%, #2a1c12 100%);
}

.dash-module__hero h2 {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dash-module__tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgba(209, 166, 58, 0.22);
    color: #f5e6bc;
    border: 1px solid rgba(209, 166, 58, 0.35);
}

.dash-module__body { padding: 1.1rem 1.2rem 0.85rem; }

.dash-module__rail {
    margin-top: auto;
    padding: 0.95rem 1.2rem 1.1rem;
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface) 100%);
    border-top: 1px solid var(--border);
}

.dash-module__rail h4 {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
}

.fact-list--dash dd { color: var(--green-dark); }

.dash-module--fpo .fact-list--dash dd { color: var(--brown); }

.rank-list--dash li span:last-child { color: var(--green); font-weight: 700; }

.dash-module--fpo .rank-list--dash li span:last-child { color: var(--brown-mid); }

.dash-frame {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(64, 145, 108, 0.35);
    box-shadow: var(--shadow-card);
    background: rgba(8, 24, 16, 0.65);
}

.dash-frame__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.2rem;
    background: linear-gradient(135deg, #1a4d32 0%, #0f281c 100%);
    color: #eef6ef;
}

.dash-frame__head h2 {
    font-size: 0.95rem;
    font-weight: 800;
}

.dash-frame__meta {
    font-size: 0.72rem;
    color: rgba(232, 245, 236, 0.72);
}

.dash-frame__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem;
}

.dash-frame .filter-panel {
    background: rgba(246, 250, 247, 0.97);
}

.dash-frame .landing-data-card {
    background: var(--surface);
}

.ui-card {
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ui-card.ui-card--spotlight {
    color: #e8f5ec;
}

.kpi-band-title--sacco { color: var(--green-glow); }
.kpi-band-title--fpo { color: var(--gold); }

.seg-control-btn.is-active {
    background: var(--surface);
    color: var(--green-dark);
    box-shadow: 0 0 0 1px rgba(45, 106, 48, 0.25);
}

.stat-card .stat-icon { color: var(--green-mid); }
.stat-card.info .stat-icon { color: var(--green); }
.stat-card.warning .stat-icon { color: var(--gold); }

/* ── Mobile / narrow: allow vertical scroll (avoid clipped tabs) ── */
@media (max-width: 899px) {
    body.portal-v2 {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .app-canvas {
        flex: 1 1 auto;
        min-height: auto;
        overflow: visible;
        padding-bottom: 1.25rem;
    }

    .app-wrap,
    .app-stage {
        flex: none;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .tab-panel,
    .tab-panel.is-active {
        height: auto;
        overflow: visible;
    }

    .tab-panel--sacco,
    .tab-panel--fpo,
    .tab-panel--counties,
    .tab-panel--trends {
        height: auto;
        overflow: visible;
    }

    .tab-panel--sacco.is-active,
    .tab-panel--fpo.is-active,
    .tab-panel--counties.is-active,
    .tab-panel--trends.is-active {
        flex: none;
        min-height: auto;
        overflow: visible;
    }

    .tab-panel--sacco > .bento--sacco-unified,
    .tab-panel--fpo > .bento--fpo-unified {
        flex: none;
        min-height: auto;
        overflow: visible;
    }

    .bento--overview,
    .bento--tab-shell,
    .bento--merged {
        height: auto !important;
        min-height: auto;
        overflow: visible !important;
    }

    .counties-split {
        flex: none;
        min-height: auto;
        overflow: visible;
    }

    .tab-panel--counties .county-table-scroll,
    .dashboard-table-scroll {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .tab-panel--counties .county-table-scroll {
        width: 100%;
        max-width: 100%;
    }

    .ui-card--county-table .county-table-scroll table.landing-dt {
        table-layout: auto;
        width: max-content !important;
        min-width: 100%;
    }

    .ui-card--county-table .county-table-scroll table.landing-dt thead th {
        white-space: nowrap;
        hyphens: none;
    }

    .ui-card--county-table .county-table-scroll table.landing-dt td {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .ui-card--county-table .county-table-scroll .col-county-sticky {
        width: auto;
        min-width: 6.75rem;
        max-width: none;
    }

    .ui-card--county-table .county-table-scroll table.landing-dt thead th:not(.col-county-sticky),
    .ui-card--county-table .county-table-scroll table.landing-dt td.dt-num {
        min-width: 3.75rem;
    }

    .trends-board {
        flex: none;
        max-height: none;
        overflow: visible;
    }

    .tab-panel--trends {
        overflow: visible;
    }

    .ui-chart {
        min-height: 11rem;
        padding: 0.45rem 0.65rem 0.85rem;
    }

    .ui-chart canvas {
        max-height: 220px;
    }

    .trends-tab-head {
        align-items: flex-start;
    }

    .trends-tab-head__actions {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .trends-view-meta {
        text-align: left;
        max-width: none;
    }

    .trends-mode-switch {
        width: 100%;
        display: inline-flex;
    }

    .tab-panel--trends .trends-mode-switch .seg-control-btn {
        flex: 1 1 0;
        text-align: center;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .trends-metric-head--inline-chips .trends-metric-stats--multi {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .trends-stat-chip {
        white-space: normal;
    }

    /* SACCO / FPO tabs */
    .tab-panel--sacco .kpi-grid--perf,
    .tab-panel--fpo .kpi-grid--perf {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        scroll-snap-type: none;
        padding-bottom: 0;
        gap: 0.55rem;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-card,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-card {
        min-height: 0;
        scroll-snap-align: unset;
        padding: 0.65rem 0.7rem 0.7rem;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-label,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-label {
        font-size: 0.62rem;
        max-width: none;
        line-height: 1.3;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-value,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-value {
        font-size: 1.05rem;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-value--kes,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-value--kes {
        font-size: 0.95rem !important;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-note,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-note {
        font-size: 0.58rem;
        line-height: 1.35;
    }

    .tab-panel--sacco .bento--perf .bento-kpis--compact .stat-icon,
    .tab-panel--fpo .bento--perf .bento-kpis--compact .stat-icon {
        font-size: 1rem;
        opacity: 0.2;
    }

    .sacco-reporting-pad,
    .fpo-reporting-pad {
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .sacco-split,
    .fpo-split {
        gap: 0.65rem;
    }

    .sacco-reporting-pad .report-pipeline div,
    .fpo-reporting-pad .report-pipeline div {
        min-width: 0;
    }

    .sacco-reporting-pad .report-pipeline dt,
    .fpo-reporting-pad .report-pipeline dt {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sacco-reporting-pad .report-pipeline dd,
    .fpo-reporting-pad .report-pipeline dd {
        flex: 0 0 auto;
        text-align: right;
    }

    .perf-rail .insight-bar-row {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
        gap: 0.35rem 0.45rem;
        font-size: 0.65rem;
    }

    .perf-rail .insight-bar-label {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .tab-panel--fpo .fpo-cards-grid.fpo-cards-grid--three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479px) {
    .overview-kpi-row {
        gap: 0.75rem;
    }

    .bento-kpis--compact .stat-card {
        min-height: 0;
    }
}
