/* Youth Enterprise GrowthLink — forest green for growth, copper for Zambia, warm paper for calm. */
:root {
    color-scheme: light;
    --bg: #f6f5f0;
    --surface: #fff;
    --surface-muted: #f1f0ea;
    --ink: #17271f;
    --ink-soft: #3f4f46;
    --muted: #66726b;
    --line: #e3e3da;
    --line-soft: #ecebe4;
    --green-900: #10322a;
    --green-800: #164234;
    --green-700: #1d5a43;
    --green-600: #266f52;
    --green-200: #cfe2d4;
    --green-100: #e4efe6;
    --green-50: #f0f6f1;
    --copper-700: #9a4f22;
    --copper-600: #b5622f;
    --copper-200: #f0d6c2;
    --copper-100: #f7e9dd;
    --copper-50: #fbf4ee;
    --flag-green: #198a00;
    --flag-red: #de2010;
    --flag-black: #000;
    --flag-orange: #ef7d00;
    --danger: #a8402c;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 50, 42, .04), 0 6px 20px rgba(16, 50, 42, .05);
    --shadow-lift: 0 2px 4px rgba(16, 50, 42, .05), 0 14px 32px rgba(16, 50, 42, .1);
    --sidebar: 264px;
    --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-head: Manrope, "DM Sans", system-ui, sans-serif;
    font-family: var(--font-body);
    font-size: 16px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--ink); font-size: .9375rem; line-height: 1.6; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, blockquote, fieldset { margin: 0; }
h1, h2, h3, blockquote { font-family: var(--font-head); color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(38, 111, 82, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--green-200); color: var(--green-900); }
button, a, input, select, label { -webkit-tap-highlight-color: transparent; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-size: .875rem; }

/* ---------- Brand ---------- */
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; }
.logo { display: block; width: auto; height: 52px; flex: none; }
.logo-word { font-family: Montserrat, Poppins, var(--font-head); font-size: 168px; font-weight: 800; }
/* Reversed logo for dark backgrounds: dark green → white, mid green lifted, white cut-outs take the panel colour. */
.logo-reversed .logo-ink { fill: #fff; }
.logo-reversed .logo-ink-stop { stop-color: #fff; }
.logo-reversed .logo-mid { fill: #9bcb4e; }
.logo-reversed .logo-mid-stop { stop-color: #9bcb4e; }
.logo-reversed .logo-cut[stroke] { stroke: var(--green-700); }
.logo-reversed .logo-cut[fill="#FFFFFF"] { fill: var(--green-700); }
.brand-tag { padding: 2px 8px; border-radius: 99px; background: var(--copper-50); color: var(--copper-700); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.flag-stripe { display: inline-flex; overflow: hidden; height: 4px; border-radius: 2px; }
.flag-stripe i { width: 7px; background: var(--flag-red); }
.flag-stripe i:nth-child(2) { background: var(--flag-black); }
.flag-stripe i:nth-child(3) { background: var(--flag-orange); }

/* ---------- Shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: var(--sidebar); flex-direction: column; padding: 26px 18px 18px; background: var(--surface); border-right: 1px solid var(--line-soft); }
.side-nav { display: grid; gap: 4px; margin-top: 40px; }
.nav-label { margin: 0 12px 8px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 12px; color: var(--ink-soft); font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; }
.nav-link .icon { color: var(--muted); transition: color .15s; }
.nav-link:hover { background: var(--surface-muted); color: var(--ink); }
.nav-link.is-active { background: var(--green-100); color: var(--green-800); font-weight: 700; }
.nav-link.is-active .icon { color: var(--green-700); }
.nav-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--copper-600); }
.nav-link { white-space: nowrap; }
.sidebar-bottom { display: grid; gap: 14px; margin-top: auto; }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--green-50); color: var(--green-800); font-size: .8rem; line-height: 1.5; }
.privacy-note .icon { margin-top: 1px; }
.profile { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.avatar { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 50%; background: var(--copper-100); color: var(--copper-700); font-size: .8rem; font-weight: 700; }
.profile-copy { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.profile-copy strong { overflow: hidden; font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.profile form { margin: 0; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.1rem; }
.icon-button:hover { background: var(--surface-muted); color: var(--ink); }

.main-area { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; height: 64px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 40px; border-bottom: 1px solid var(--line-soft); background: rgba(246, 245, 240, .9); backdrop-filter: blur(12px); }
.brand-compact { display: none; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .875rem; }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right form { margin: 0; }
.location-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink-soft); font-size: .82rem; }
.location-chip .icon { color: var(--copper-600); }
.content { max-width: 1200px; margin: 0 auto; padding: 40px 40px 32px; }
.tab-bar { display: none; }

.page-section { display: none; }
.page-section.is-visible { display: block; animation: rise-in .25s ease both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Type & headers ---------- */
.eyebrow { color: var(--green-600); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { max-width: 20ch; margin: 8px 0 10px; font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 700; line-height: 1.12; letter-spacing: -.025em; }
.lead { max-width: 58ch; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.header-icon { display: grid; width: 88px; height: 88px; flex: none; place-items: center; border-radius: 28px; background: var(--green-100); color: var(--green-700); font-size: 2.6rem; transform: rotate(-4deg); }
.header-icon .icon { stroke-width: 1.5; }
.section-heading { margin: 40px 0 16px; }
.section-heading h2 { margin-top: 4px; font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; }

/* ---------- Buttons ---------- */
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-size: .9rem; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--green-700); color: #fff; }
.button-primary:hover { background: var(--green-800); box-shadow: 0 6px 16px rgba(29, 90, 67, .22); }
.button-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-soft); }
.button-ghost:hover { border-color: var(--green-200); background: var(--green-50); color: var(--green-800); }
.button-light { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: #fff; }
.button-light:hover { background: rgba(255, 255, 255, .24); }
.button-small { min-height: 38px; padding: 0 14px; font-size: .84rem; }
.button-block { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--green-700); font-size: .875rem; font-weight: 700; text-align: left; }
.text-button .icon { transition: transform .15s; }
.text-button:hover { color: var(--green-900); }
.text-button:hover .icon:last-child { transform: translateX(3px); }
.text-button-danger { color: var(--danger); }
.text-button-danger:hover { color: #7f2c1c; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-icon { display: inline-grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 12px; background: var(--green-100); color: var(--green-700); font-size: 1.2rem; }
.card-icon-copper { background: var(--copper-100); color: var(--copper-600); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 1.1rem; font-weight: 700; }

/* ---------- Overview ---------- */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.month-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 22px; padding: 26px; border: 0; background: linear-gradient(140deg, var(--green-700), var(--green-900)); color: #fff; }
.month-card::after { position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255, 255, 255, .03), 0 0 0 60px rgba(255, 255, 255, .025); content: ""; pointer-events: none; }
.month-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow-light { color: var(--green-200); }
.month-balance { display: grid; margin-top: 10px; }
.month-balance span { color: rgba(255, 255, 255, .72); font-size: .875rem; }
.month-balance strong { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.month-figures { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.month-figures > div { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.figure-label { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .75); font-size: .82rem; }
.month-figures > div:first-child .icon { color: #9be3b2; }
.month-figures > div:last-child .icon { color: #f4b98f; }
.month-figures strong { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.split-bar { position: relative; z-index: 1; overflow: hidden; height: 8px; border-radius: 99px; background: #e9925a; }
.split-bar span { display: block; height: 100%; border-radius: 99px 0 0 99px; background: #8ad8a3; }
.split-bar.is-empty { background: rgba(255, 255, 255, .15); }
.month-foot { position: relative; z-index: 1; margin-top: -10px; color: rgba(255, 255, 255, .78); font-size: .85rem; }

.focus-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px; background: linear-gradient(160deg, var(--copper-50), var(--surface) 60%); }
.focus-card .card-icon { margin-bottom: 8px; }
.focus-card h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.focus-card p:not(.eyebrow) { color: var(--muted); font-size: .9rem; }
.focus-card .button { margin-top: auto; }
.focus-card p:not(.eyebrow) + .button { margin-top: 14px; }

.pillar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pillar { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .18s, box-shadow .18s, border-color .18s; }
.pillar:hover { transform: translateY(-3px); border-color: var(--green-200); box-shadow: var(--shadow-lift); }
.pillar-top { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pillar-step { color: var(--line); font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.pillar strong { font-family: var(--font-head); font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.pillar-text { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.pillar-meta { margin-top: auto; padding-top: 10px; color: var(--green-700); font-size: .8rem; font-weight: 700; }
.pillar-learning .card-icon, .pillar-support .card-icon { background: var(--copper-100); color: var(--copper-600); }

.overview-bottom { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.activity-card { padding: 22px 24px; }
.activity-list { display: grid; padding: 0; list-style: none; }
.activity-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.activity-icon { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 10px; }
.activity-sale { background: var(--green-100); color: var(--green-700); }
.activity-expense { background: var(--copper-100); color: var(--copper-600); }
.activity-copy { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.activity-copy strong { overflow: hidden; font-size: .92rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy small { color: var(--muted); font-size: .8rem; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-in { color: var(--green-700); }
.amount-out { color: var(--copper-700); }
.quote-card { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 26px; border: 0; background: var(--green-100); box-shadow: none; }
.quote-icon { color: var(--green-700); font-size: 1.8rem; }
.quote-card blockquote { color: var(--green-900); font-size: 1.2rem; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }

.empty-state { display: grid; justify-items: center; gap: 12px; padding: 36px 16px; color: var(--muted); text-align: center; }
.empty-state-compact { justify-items: start; padding: 12px 0 4px; text-align: left; }

/* ---------- Split layouts & notes ---------- */
.split-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, .8fr); gap: 18px; align-items: start; }
.side-note { display: grid; gap: 10px; padding: 24px; border: 0; background: var(--green-50); box-shadow: none; }
.side-note h3 { margin-top: 6px; font-size: 1.1rem; font-weight: 700; }
.side-note p { color: var(--ink-soft); font-size: .9rem; }
.side-note-warm { background: var(--copper-50); }
.check-list { display: grid; gap: 8px; margin-top: 6px; padding: 0; list-style: none; color: var(--ink-soft); font-size: .88rem; }
.check-list li { display: flex; align-items: center; gap: 8px; }
.check-list .icon { color: var(--green-600); }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--copper-200); border-radius: 12px; background: var(--copper-50); color: var(--ink-soft); font-size: .9rem; }
.notice > .icon { margin-top: 2px; color: var(--copper-600); }
.notice strong { color: var(--ink); }
.status-message { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 13px 16px; border: 1px solid var(--green-200); border-radius: 12px; background: var(--green-50); color: var(--green-800); font-size: .9rem; font-weight: 500; }

/* ---------- Check-up ---------- */
.assessment-card { min-height: 380px; padding: 28px; }
.form-progress { display: grid; gap: 10px; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.progress { overflow: hidden; height: 6px; border-radius: 99px; background: var(--surface-muted); }
.progress i { display: block; width: 20%; height: 100%; border-radius: 99px; background: var(--green-600); transition: width .25s ease; }
.question-prompt { margin: 26px 0 18px; font-size: 1.3rem; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; }
.answer-list { display: grid; gap: 10px; }
.answer-option { position: relative; display: flex; min-height: 54px; align-items: center; gap: 14px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-size: .95rem; transition: background .15s, border-color .15s; }
.answer-option:hover { border-color: var(--green-200); background: var(--green-50); }
.answer-option.is-selected { border-color: var(--green-600); background: var(--green-50); color: var(--green-900); font-weight: 600; }
.answer-option:has(input:focus-visible) { outline: 3px solid rgba(38, 111, 82, .45); outline-offset: 2px; }
.answer-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.answer-radio { display: grid; width: 20px; height: 20px; flex: none; place-items: center; border: 2px solid #c6cbc4; border-radius: 50%; }
.is-selected .answer-radio { border-color: var(--green-600); }
.is-selected .answer-radio::after { width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); content: ""; }
.answer-hint { display: none; margin-top: 10px; color: var(--danger); font-size: .85rem; font-weight: 500; }
.needs-answer .answer-hint { display: block; }
.needs-answer .answer-option { border-color: #e7b9a5; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.form-actions .button-primary:only-child, .form-actions [hidden] + .button-primary { margin-left: auto; }

.assessment-result { padding-top: 22px; }
.assessment-result h2 { margin: 6px 0 8px; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.assessment-result > p:not(.eyebrow):not(.also-label) { max-width: 52ch; color: var(--muted); }
.result-actions { display: grid; gap: 10px; margin-top: 22px; }
.result-option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.result-option:hover { border-color: var(--green-600); background: var(--green-50); }
.result-option > span:nth-child(2) { display: grid; flex: 1; line-height: 1.35; }
.result-option small { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.result-option strong { font-size: .98rem; }
.result-option > .icon { color: var(--green-700); }
.also-label { margin: 22px 0 10px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-muted); color: var(--ink-soft); font-size: .85rem; font-weight: 600; }
.chip:hover { border-color: var(--green-200); background: var(--green-50); color: var(--green-800); }
.chip .icon { color: var(--green-600); }
.retake-button { margin-top: 22px; color: var(--muted); font-weight: 600; }

/* ---------- Money & records ---------- */
.money-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.money-card { display: grid; gap: 4px; padding: 20px; }
.money-card .card-icon { margin-bottom: 10px; }
.money-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.money-card strong { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.money-card small { color: var(--muted); font-size: .8rem; }
.money-out .card-icon { background: var(--copper-100); color: var(--copper-600); }
.money-left { border-color: var(--green-200); background: var(--green-50); }
.money-left .card-icon { background: var(--green-700); color: #fff; }
.split-layout-wide { grid-template-columns: minmax(0, 2fr) minmax(240px, .8fr); }
.records-card { padding: 22px 24px; }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.records-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.records-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.records-table td { padding: 14px 8px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.records-table tbody tr:hover { background: #fafaf6; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table .cell-desc { color: var(--ink); font-weight: 500; }
.records-table .cell-date { color: var(--muted); white-space: nowrap; }
.num { text-align: right !important; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.pill-sale { background: var(--green-100); color: var(--green-700); }
.pill-expense { background: var(--copper-100); color: var(--copper-700); }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions .text-button { padding: 4px 6px; font-size: .84rem; }
.delete-record-form { display: inline; margin: 0; }
.page-footnote { margin-top: 18px; color: var(--muted); font-size: .82rem; }

/* ---------- Learning & opportunities ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 24px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile:hover { transform: translateY(-3px); border-color: var(--green-200); box-shadow: var(--shadow-lift); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tile h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.tile > p:not(.eyebrow) { color: var(--muted); font-size: .92rem; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.read-time { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; }
.suggested-badge { padding: 4px 10px; border-radius: 99px; background: var(--green-700); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.tile:has(.suggested-badge:not([hidden])) { border-color: var(--green-200); }
/* A support area that isn't available yet: greyed out, not clickable, spanning the row. */
.tile-coming-soon { grid-column: 1 / -1; border-color: #cfd0ca; background: #e2e3de; box-shadow: none; cursor: default; }
.tile-coming-soon:hover { transform: none; border-color: #cfd0ca; box-shadow: none; }
.tile-coming-soon .card-icon { background: #cfd0ca; color: #5d635f; }
.tile-coming-soon .eyebrow, .tile-coming-soon h2, .tile-coming-soon > p:not(.eyebrow) { color: #5d635f; }
.coming-soon-badge { padding: 4px 12px; border-radius: 99px; background: #5d635f; color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }

/* ---------- Modal ---------- */
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; overflow-y: auto; place-items: center; padding: 18px; background: rgba(16, 40, 32, .5); backdrop-filter: blur(4px); animation: fade-in .15s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.modal-panel { position: relative; width: min(100%, 520px); max-height: min(90vh, 760px); overflow-y: auto; padding: 30px; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 80px rgba(10, 30, 22, .28); animation: rise-in .2s ease both; }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.modal-panel h2 { margin: 16px 0 8px; font-size: 1.45rem; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.modal-intro { color: var(--muted); }
.modal-subheading { margin: 22px 0 12px; font-size: .95rem; font-weight: 700; }
.step-list { display: grid; gap: 10px; padding: 0; list-style: none; counter-reset: step; }
.step-list li { position: relative; padding: 12px 14px 12px 50px; border-radius: 12px; background: var(--surface-muted); color: var(--ink-soft); font-size: .92rem; counter-increment: step; }
.step-list li::before { position: absolute; top: 11px; left: 14px; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--green-700); color: #fff; content: counter(step); font-size: .78rem; font-weight: 700; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.record-form { display: grid; gap: 8px; margin-top: 20px; }
.record-form > label, .type-toggle legend { margin-top: 8px; color: var(--ink); font-size: .875rem; font-weight: 600; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; border: 0; }
.type-toggle legend { margin: 0 0 8px; padding: 0; }
.type-option input { position: absolute; opacity: 0; }
.type-option span { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700; transition: border-color .15s, background .15s; }
.type-option small { grid-column: 2; color: var(--muted); font-size: .78rem; font-weight: 500; }
.type-option span:hover { border-color: var(--green-200); }
.type-sale input:checked + span { border-color: var(--green-600); background: var(--green-50); color: var(--green-800); }
.type-expense input:checked + span { border-color: var(--copper-600); background: var(--copper-50); color: var(--copper-700); }
.type-option input:focus-visible + span { outline: 3px solid rgba(38, 111, 82, .45); outline-offset: 2px; }
.record-form input:not([type="radio"]):not([type="hidden"]) { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: var(--surface); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.record-form input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(38, 111, 82, .12); }
.amount-input { position: relative; }
.amount-input span { position: absolute; top: 50%; left: 14px; color: var(--muted); font-weight: 700; transform: translateY(-50%); }
/* :not() matches the specificity of the generic input rule above, so this padding wins and the K never overlaps the amount. */
.record-form .amount-input input:not([type="hidden"]) { padding-left: 38px; font-variant-numeric: tabular-nums; }
.amount-input span { pointer-events: none; }
.record-form .button { margin-top: 14px; }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 500; }


/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; background: var(--bg); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 24px; padding: 40px clamp(32px, 5vw, 72px); background: radial-gradient(ellipse at 85% 10%, rgba(239, 125, 0, .18), transparent 45%), linear-gradient(150deg, var(--green-700), var(--green-900)); color: #fff; }
.auth-story .brand { align-self: flex-start; }
.auth-story-body { display: grid; gap: 18px; margin: auto 0; max-width: 520px; }
.auth-story .eyebrow { color: var(--green-200); }
.auth-story h2 { color: #fff; font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.auth-story h2 span { color: #f4b98f; }
.auth-story p:not(.eyebrow) { max-width: 44ch; color: rgba(255, 255, 255, .8); font-size: 1rem; }
.auth-features { display: grid; gap: 12px; margin-top: 8px; padding: 0; list-style: none; }
.auth-features li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); font-size: .95rem; }
.auth-features .card-icon { width: 38px; height: 38px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.1rem; }
.zambia-landscape { overflow: hidden; height: 150px; margin: 0 calc(-1 * clamp(32px, 5vw, 72px)) -40px; opacity: .95; }
.zambia-landscape svg { display: block; width: 100%; height: 100%; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 24px; }
.auth-card { width: min(100%, 440px); padding: 36px; }
.auth-card h1 { margin: 8px 0 8px; font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.auth-intro { margin-bottom: 22px; color: var(--muted); }
.auth-form { display: grid; gap: 6px; }
.auth-form > label:not(.remember-option) { margin-top: 10px; font-size: .875rem; font-weight: 600; }
.auth-form > input { min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: var(--surface); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.auth-form > input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(38, 111, 82, .12); }
.optional-label { margin-left: 6px; color: var(--muted); font-size: .75rem; font-weight: 500; }
.remember-option { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; color: var(--ink-soft); font-size: .9rem; }
.remember-option input { width: 18px; height: 18px; accent-color: var(--green-700); }
.auth-submit { width: 100%; min-height: 50px; margin-top: 14px; font-size: .95rem; }
.auth-switch { margin-top: 20px; color: var(--muted); font-size: .9rem; text-align: center; }
.auth-switch a { color: var(--green-700); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }
.auth-switch-quiet { margin-top: 8px; font-size: .85rem; }
.auth-switch-quiet a { color: var(--muted); font-weight: 600; }
.nowrap { white-space: nowrap; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-form > .code-input { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; letter-spacing: .5em; text-align: center; }
.resend-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: .9rem; }
/* While a sign-in or sign-up form is being sent (public/js/auth.js): its button spins, the others wait. */
.button:disabled, .text-button:disabled { cursor: not-allowed; opacity: .6; }
.button.is-busy, .text-button.is-busy { cursor: progress; opacity: 1; }
.button-primary.is-busy, .button-primary.is-busy:hover { background: var(--green-600); box-shadow: none; transform: none; }
.is-busy::before { content: ""; width: 1em; height: 1em; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .7s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
.notice-testing { margin-bottom: 14px; }
.form-errors { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #ecc9bb; border-radius: 12px; background: #fcf1ec; color: var(--danger); font-size: .88rem; }
.form-errors ul { margin-top: 4px; padding-left: 18px; }

/* ---------- Getting started & onboarding ---------- */
.setup-card { margin-bottom: 18px; padding: 22px 24px; }
.setup-card .card-head h2 { margin-top: 4px; }
.setup-list { display: grid; gap: 4px; padding: 0; list-style: none; }
.setup-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.setup-list li:first-child { border-top: 0; }
.setup-mark { display: grid; width: 28px; height: 28px; flex: none; place-items: center; border: 2px solid #c6cbc4; border-radius: 50%; color: transparent; font-size: .85rem; }
.setup-mark .icon { stroke-width: 2.6; }
.setup-list li.is-done .setup-mark { border-color: var(--green-600); background: var(--green-600); color: #fff; }
.setup-copy { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.setup-copy strong { color: var(--ink); font-size: .95rem; }
.setup-copy small { color: var(--muted); font-size: .84rem; }
.setup-list li.is-done .setup-copy strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.onboarding-progress { margin-bottom: 18px; }
.skip-button { display: flex; margin: 16px auto 0; color: var(--muted); font-weight: 600; }
.skip-button:hover { color: var(--ink); }
.retake-date { color: var(--muted); font-weight: 500; }
.save-warning { margin-top: 18px; padding: 12px 14px; border: 1px solid #ecc9bb; border-radius: 12px; background: #fcf1ec; color: var(--danger); font-size: .88rem; }
.save-warning .text-button { display: inline; padding: 0; color: inherit; text-decoration: underline; }
a.location-chip:hover { border-color: var(--green-200); color: var(--green-800); }
a.profile-copy:hover strong { color: var(--green-700); }
.show-sm { display: none; }

/* ---------- Month navigation, paging & quick add ---------- */
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.month-nav .icon-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.month-nav .icon-button:hover { border-color: var(--green-200); background: var(--green-50); color: var(--green-800); }
.month-nav-label { min-width: 9.5em; font-family: var(--font-head); font-size: 1.05rem; text-align: center; }
.month-nav-today { margin-left: 8px; }
.icon-flip .icon { transform: scaleX(-1); }
.is-disabled { opacity: .4; pointer-events: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.fab { display: none; }

/* ---------- Site footer ---------- */
.site-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .875rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 28px; }
.footer-about { display: grid; align-content: start; gap: 14px; }
.footer-about p { max-width: 34ch; color: var(--muted); }
.footer-col h2 { margin-bottom: 12px; color: var(--ink); font-family: var(--font-body); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.footer-col ul, .footer-social { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--ink-soft); transition: color .15s; }
.site-footer a:hover { color: var(--green-700); text-decoration: underline; }
.footer-contact li { display: flex; align-items: flex-start; gap: 9px; overflow-wrap: anywhere; }
.footer-contact .icon { margin-top: 2px; color: var(--copper-600); }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .8rem; font-weight: 600; }
.footer-social a:hover { border-color: var(--green-200); text-decoration: none; }
.footer-notice { display: flex; align-items: flex-start; gap: 10px; margin-top: 28px; padding: 14px 16px; border-radius: 12px; background: var(--green-50); color: var(--green-900); }
.footer-notice .icon { margin-top: 2px; color: var(--green-700); }
.footer-notice a { color: var(--green-800); font-weight: 600; text-decoration: underline; }
.footer-bottom { display: grid; gap: 4px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .8rem; }
.footer-made { display: inline-flex; align-items: center; gap: 8px; }
.site-footer-compact { display: grid; justify-items: center; gap: 8px; margin-top: 0; padding-top: 0; border-top: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.site-footer-compact p { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.site-footer-compact .footer-legal a { color: var(--muted); }
.consent-option { align-items: flex-start; }
.consent-option input { margin-top: 3px; flex: none; }
.consent-option a { color: var(--green-700); font-weight: 600; text-decoration: underline; }

/* ---------- Public information pages ---------- */
.info-header { position: sticky; z-index: 4; top: 0; border-bottom: 1px solid var(--line-soft); background: rgba(246, 245, 240, .92); backdrop-filter: blur(12px); }
.info-header-inner { display: flex; max-width: 1080px; height: 68px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto; padding: 0 24px; }
.info-nav { display: flex; align-items: center; gap: 22px; font-size: .9rem; font-weight: 600; }
.info-nav a:not(.button) { color: var(--ink-soft); }
.info-nav a:not(.button):hover, .info-nav a[aria-current] { color: var(--green-700); }
.info-main { max-width: 780px; margin: 0 auto; padding: 56px 24px 0; }
.info-hero { margin-bottom: 36px; }
.info-hero h1 { margin: 10px 0 14px; font-size: clamp(2rem, 4.2vw, 2.8rem); font-weight: 700; line-height: 1.12; letter-spacing: -.025em; }
.info-hero .lead { font-size: 1.08rem; }
.info-updated { margin-top: 14px; color: var(--muted); font-size: .85rem; }
.prose { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.prose h2 { margin: 40px 0 12px; font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; scroll-margin-top: 90px; }
.prose p + p, .prose p + ul, .prose ul + p, .prose ol + p { margin-top: 12px; }
.prose > ul:not([class]) { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.prose a { color: var(--green-700); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }
.prose .notice { margin: 24px 0; }
.prose .step-list { margin: 16px 0; }
.notice-urgent { border-color: #ecc9bb; background: #fcf1ec; }
.notice-urgent > .icon { color: var(--danger); }
.info-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.info-cards li { display: grid; align-content: start; gap: 4px; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: .92rem; overflow-wrap: anywhere; }
.info-cards .card-icon { margin-bottom: 8px; }
.info-cards strong { font-family: var(--font-head); font-size: 1rem; }
.info-list { gap: 12px; font-size: 1rem; }
.info-list li { align-items: flex-start; }
.info-list .icon { margin-top: 4px; }
.info-footer-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 24px 32px; }

/* ---------- Admin ---------- */
.admin-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid var(--green-200); border-radius: 12px; background: var(--green-50); color: var(--green-900); font-size: .9rem; }
.admin-banner > .icon { color: var(--green-700); }
.admin-banner p { flex: 1; min-width: 220px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .875rem; font-weight: 600; }
.label-row a { color: var(--green-700); font-size: .82rem; font-weight: 600; }
.label-row a:hover { text-decoration: underline; }
.nav-label-spaced { margin-top: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-tile { display: grid; align-content: start; gap: 4px; padding: 20px; }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat-tile strong { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-tile small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.chart-card { margin-top: 18px; padding: 22px 24px; }
.chart-card .card-head p { margin-top: 2px; }
.split-layout-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.column-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 200px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.column { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.column-bar { width: min(100%, 36px); border-radius: 4px 4px 0 0; background: var(--green-600); transition: background .15s; }
.column:hover .column-bar, .column:focus-visible .column-bar { background: var(--green-800); }
.column-label { position: absolute; bottom: -24px; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.column:nth-child(even) .column-label { visibility: hidden; }
.column[data-tip]:hover::after, .column[data-tip]:focus-visible::after { position: absolute; z-index: 2; bottom: calc(100% + 6px); left: 50%; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; content: attr(data-tip); font-size: .78rem; font-weight: 600; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.column:nth-child(-n+2)[data-tip]:hover::after, .column:nth-child(-n+2)[data-tip]:focus-visible::after { left: 0; transform: none; }
.column:nth-last-child(-n+2)[data-tip]:hover::after, .column:nth-last-child(-n+2)[data-tip]:focus-visible::after { right: 0; left: auto; transform: none; }
.chart-table { margin-top: 36px; font-size: .85rem; }
.chart-table summary { color: var(--green-700); font-weight: 700; cursor: pointer; }
.chart-table .data-table { min-width: 0; margin-top: 10px; }
.bar-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
.bar-list-label { color: var(--ink-soft); font-size: .88rem; }
.bar-list-value { grid-row: 1; grid-column: 2; color: var(--ink); font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-list-track { grid-column: 1 / -1; height: 10px; border-radius: 4px; background: var(--surface-muted); }
.bar-list-bar { display: block; height: 100%; min-width: 4px; border-radius: 4px; background: var(--green-600); }
.chart-note { margin-top: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .9rem; }
.filter-bar input { flex: 1; min-width: 220px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 4px rgba(38, 111, 82, .12); }
.table-scroll { overflow-x: auto; margin: 0 -8px; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; font-size: .9rem; }
.data-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 8px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafaf6; }
.data-table .cell-desc { color: var(--ink); font-weight: 500; }
.data-table .cell-date { color: var(--muted); white-space: nowrap; }
.row-link { color: var(--green-800); font-weight: 700; }
.row-link:hover { text-decoration: underline; }
.cell-sub { display: block; color: var(--muted); font-size: .8rem; }
.pill-admin { background: var(--surface-muted); color: var(--ink-soft); }
.back-link { margin-bottom: 14px; }
.admin-stack { display: grid; gap: 18px; align-content: start; }
.detail-card { display: grid; gap: 12px; padding: 22px 24px; }
.detail-card h2 { font-size: 1.05rem; font-weight: 700; }
.detail-list { display: grid; margin: 0; }
.detail-list div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.detail-list div:first-child { border-top: 0; }
.detail-list dt { color: var(--muted); font-size: .86rem; }
.detail-list dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.detail-note { display: flex; align-items: flex-start; gap: 8px; font-size: .84rem; }
.detail-note .icon { margin-top: 2px; color: var(--green-700); }
.audit-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.audit-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.audit-list span { color: var(--muted); }
.action-list { display: grid; gap: 10px; }
.action-list form { margin: 0; }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: #8a3322; }
.danger-zone { border-color: #ecc9bb; }
.danger-zone h2 { color: var(--danger); }
.danger-zone .auth-form label { margin-top: 0; font-weight: 500; overflow-wrap: anywhere; }
.danger-zone .button { margin-top: 6px; }

/* ---------- Mentors ---------- */
.mentor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mentor-card { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 20px; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.mentor-card:hover { transform: translateY(-3px); border-color: var(--green-200); box-shadow: var(--shadow-lift); }
.mentor-card .tile-foot { padding-top: 4px; }
.mentor-card-head { display: flex; min-width: 0; align-items: center; gap: 14px; }
.mentor-card-title { min-width: 0; }
.mentor-card-title h3 { overflow: hidden; font-size: 1.05rem; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.mentor-card-title p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.mentor-avatar { display: grid; width: 56px; height: 56px; flex: none; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-800); font-family: var(--font-head); font-size: 1.05rem; font-weight: 800; object-fit: cover; }
.mentor-avatar-small { width: 38px; height: 38px; font-size: .8rem; }
.mentor-avatar-large { width: 72px; height: 72px; font-size: 1.4rem; }
.availability { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; padding: 4px 11px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.availability::before { width: 8px; height: 8px; border-radius: 50%; background: currentColor; content: ""; }
.availability.is-open { background: var(--green-100); color: var(--green-700); }
.availability.is-full { background: var(--surface-muted); color: var(--muted); }
.modal-head .availability { margin-top: 4px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.tag-list li { max-width: 100%; overflow: hidden; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-muted); color: var(--ink-soft); font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mentor-meta { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.mentor-meta .icon { flex: none; margin-top: 3px; color: var(--green-600); }
.modal-panel .mentor-meta { margin-top: 6px; }
.modal-panel .tag-list { margin-top: 14px; }
.mentor-bio { color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.strength-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.strength-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-soft); font-size: .92rem; overflow-wrap: anywhere; }
.strength-list .icon { flex: none; margin-top: 3px; color: var(--green-600); }
.mentor-connect { display: grid; gap: 10px; margin-top: 8px; }
.mentor-connect .modal-subheading { display: block; margin-bottom: 0; }
.mentor-topic-pick { min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 1rem; }
.mentor-topic-pick:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 4px rgba(38, 111, 82, .12); }
.button-whatsapp { min-height: 52px; background: #137a43; color: #fff; font-size: .95rem; text-align: center; white-space: normal; }
.button-whatsapp:hover { background: #0f6236; box-shadow: 0 6px 16px rgba(19, 122, 67, .25); }
.mentor-connect-note { color: var(--muted); font-size: .8rem; text-align: center; }
.mentor-full { margin: 14px 0 0; }
.mentor-safety { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .8rem; }
.mentor-safety .icon { flex: none; margin-top: 2px; color: var(--green-700); }
.mentor-safety a { color: var(--green-700); font-weight: 700; text-decoration: underline; }
.mentor-no-match { padding: 24px 0; }
.modal-panel.is-wide { width: min(100%, 760px); }
.modal-panel .mentor-filter { margin: 18px 0 14px; }
.modal-panel .mentor-card, .modal-panel .funding-card { box-shadow: none; }
.modal-panel .mentor-card:hover { transform: none; }
.modal-back { margin: -6px 0 12px; }
.funding-card { display: flex; min-width: 0; flex-direction: column; gap: 10px; padding: 20px; }
.funding-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.funding-type { padding: 3px 10px; border-radius: 99px; background: var(--copper-100); color: var(--copper-700); font-size: .76rem; font-weight: 700; }
.funding-deadline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.funding-deadline.is-soon { color: var(--copper-700); }
.funding-card .mentor-card-title h3 { white-space: normal; overflow-wrap: anywhere; }
.funding-description { color: var(--ink-soft); font-size: .9rem; overflow-wrap: anywhere; }
.funding-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 6px; }
.funding-domain { min-width: 0; overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }

/* Admin mentor list and form */
.mentor-cell { display: flex; align-items: center; gap: 12px; }
.row-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.row-actions form { margin: 0; }
.text-button-danger { color: var(--danger); }
.text-button-danger:hover { color: #8a3322; }
.mentor-form-card { max-width: 760px; }
.form-section-title { margin: 22px 0 2px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 1rem; font-weight: 700; }
.form-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.field-hint { color: var(--muted); font-size: .8rem; }
.auth-form > textarea, .auth-form > select { min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: var(--surface); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.auth-form > textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.auth-form > textarea:focus, .auth-form > select:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(38, 111, 82, .12); }
.auth-form > input[type="file"] { min-height: 0; padding: 10px 12px; font-size: .9rem; }
.mentor-form .remember-option { align-items: flex-start; }
.mentor-form .remember-option input { flex: none; margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    :root { --sidebar: 232px; }
    .content { padding: 32px 28px 28px; }
    .topbar { padding: 0 28px; }
    .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-about, .footer-contact { grid-column: span 3; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .sidebar { display: none; }
    .main-area { margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
    .topbar { height: 60px; padding: 0 16px; }
    .brand-compact { display: flex; }
    .brand-compact .logo { height: 38px; }
    .breadcrumbs { display: none; }
    .content { padding: 24px 16px 24px; }
    .tab-bar { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); }
    .tab-link { display: grid; min-height: 56px; place-items: center; align-content: center; gap: 3px; border-radius: 12px; color: var(--muted); font-size: .72rem; font-weight: 600; }
    .tab-link .icon { font-size: 1.35rem; }
    .tab-link.is-active { background: var(--green-100); color: var(--green-800); }
    .show-sm { display: grid; }
    .fab { position: fixed; z-index: 9; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); display: inline-flex; min-height: 52px; align-items: center; gap: 8px; padding: 0 20px 0 16px; border: 0; border-radius: 99px; background: var(--green-700); box-shadow: 0 10px 24px rgba(16, 50, 42, .28); color: #fff; font-size: .9rem; font-weight: 700; }
    .fab .icon { font-size: 1.3rem; stroke-width: 2.2; }
    .fab:active { transform: translateY(1px); }
    body[data-current-page="assessment"] .fab { display: none; }
    .main-area { padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px)); }
    .overview-grid, .overview-bottom, .split-layout, .split-layout-wide { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-about, .footer-contact { grid-column: 1 / -1; }
    .split-layout-even { grid-template-columns: 1fr; }
    .tab-bar-3 { grid-template-columns: repeat(3, 1fr); }
    .tab-bar-4 { grid-template-columns: repeat(4, 1fr); }
    .admin-page .main-area { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
    .header-icon { display: none; }
    .page-header { flex-wrap: wrap; align-items: flex-start; }
}

@media (max-width: 600px) {
    .hide-sm { display: none; }
    .location-chip { display: none; }
    .page-header { margin-bottom: 20px; }
    .page-header h1 { font-size: 1.75rem; }
    .page-header > .button { width: 100%; }
    .month-card { padding: 22px 20px; }
    .month-head { flex-direction: column; }
    .month-figures > div { padding: 12px; }
    .month-figures strong { font-size: 1.05rem; }
    .pillar-grid { grid-template-columns: 1fr; gap: 10px; }
    .pillar { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; }
    .pillar-top { grid-row: span 3; width: auto; margin: 0; }
    .pillar-step { display: none; }
    .pillar-meta { padding-top: 4px; }
    .money-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
    .money-left { grid-column: 1 / -1; }
    .money-card { padding: 16px; }
    .money-card .card-icon { width: 36px; height: 36px; margin-bottom: 6px; }
    .money-card strong { font-size: 1.3rem; }
    .records-card, .activity-card { padding: 18px 16px; }
    .table-wrap { overflow: visible; margin: 0; }
    .records-table thead { display: none; }
    .records-table, .records-table tbody { display: block; }
    .records-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
    .records-table tbody tr:last-child { border-bottom: 0; }
    .records-table tbody tr:hover { background: none; }
    .records-table td { padding: 0; border: 0; }
    .records-table .cell-desc { grid-column: 1; grid-row: 1; }
    .records-table .cell-amount { grid-column: 2; grid-row: 1; }
    .records-table .cell-type { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 8px; }
    .records-table .cell-date { grid-column: 2; grid-row: 2; text-align: right; font-size: .82rem; }
    .records-table .cell-actions { grid-column: 1 / -1; grid-row: 3; text-align: left; }
    .cell-actions .text-button:first-child { padding-left: 0; }
    .tile-grid { grid-template-columns: 1fr; gap: 12px; }
    .tile { padding: 20px; }
    .assessment-card { min-height: 0; padding: 20px 16px; }
    .question-prompt { font-size: 1.15rem; }
    .form-actions .button-primary { flex: 1; }
    .modal-backdrop { align-items: end; padding: 0; }
    .modal-panel { width: 100%; max-height: 92vh; padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; }
    .modal-actions .button { flex: 1; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
    .footer-contact { grid-column: 1 / -1; }
    .info-main { padding: 32px 16px 0; }
    .info-header-inner { padding: 0 16px; }
    .info-footer-wrap { padding: 16px 16px 28px; }
    .info-cards { grid-template-columns: 1fr; }
    .stat-grid { gap: 10px; }
    .stat-tile { padding: 16px; }
    .stat-tile strong { font-size: 1.5rem; }
    .detail-list div { grid-template-columns: 1fr; gap: 2px; }
    .detail-card, .chart-card { padding: 18px 16px; }
    .filter-bar input { min-width: 0; flex-basis: 100%; }
    .mentor-filter select { flex: 1; }
    .mentor-grid { grid-template-columns: 1fr; gap: 12px; }
    .mentor-card, .funding-card { padding: 18px 16px; }
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { gap: 16px; padding: 24px 20px 0; }
    .auth-story-body { gap: 10px; margin: 8px 0 0; }
    .auth-story h2 { font-size: 1.75rem; }
    .auth-story p:not(.eyebrow) { font-size: .92rem; }
    .auth-features { display: none; }
    .zambia-landscape { height: 90px; margin: 0 -20px; }
    .auth-main { justify-content: flex-start; padding: 0 16px 28px; }
    .auth-card { margin-top: -28px; padding: 26px 20px; position: relative; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
