/* PGF Console: same navy / gold / cream look as the earlier admin panel. */
:root {
  --navy: #1a2340; --gold: #b58a3b; --cream: #f7f3ec; --line: #e3ddd2; --ink: #1a2340; --soft: #46526b;
  --good: #2f7d4a; --bad: #b0392f; --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
       background: var(--cream); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: #2a4ba0; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--navy); }
ul, ol { margin: 6px 0 10px; padding-left: 20px; }

/* top bar + navigation */
header.top { background: var(--navy); color: #fff; padding: 0 20px; display: flex; align-items: center;
             justify-content: space-between; min-height: 56px; gap: 12px; flex-wrap: wrap; }
header.top .logo { font-weight: 700; font-size: 15px; color: #fff; text-decoration: none; }
header.top .logo span { color: var(--gold); }
header.top .who { font-size: 13px; color: #cdd9f0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
header.top .who a, header.top .linklike { color: #fff; font-size: 12px; text-decoration: none; background: none;
             border: 1px solid rgba(255,255,255,.3); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.nav { background: var(--paper); border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; gap: 2px; overflow-x: auto; }
.nav a { padding: 13px 14px; font-size: 13.5px; font-weight: 600; color: var(--soft); text-decoration: none;
         border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--navy); }
.nav a.active { color: var(--navy); border-bottom-color: var(--gold); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }

/* headings, tabs, crumbs */
h1.page { font-size: 22px; margin: 0 0 16px; color: var(--navy); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { margin: 0 0 4px; font-size: 12.5px; color: var(--soft); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: 13.5px; color: var(--soft); text-decoration: none;
          border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }

/* messages */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; overflow-wrap: anywhere; }
.flash.ok { background: #eafaf0; border: 1px solid #bfe6cd; color: #1c6b3a; }
.flash.err { background: #fbe9e7; border: 1px solid #f3c0b8; color: #9b2c20; }
.flash ul { margin: 6px 0 0; }
.muted { color: var(--soft); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; }
.notice { background: #fff6e6; border: 1px solid #ecd49a; color: #6b4700; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.bad-text { color: var(--bad); }

/* cards and panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.statcard { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: inherit; display: block; }
.statcard:hover { border-color: var(--gold); }
.statcard .n { font-size: 28px; font-weight: 800; color: var(--navy); }
.statcard .l { font-size: 12.5px; color: var(--soft); margin-top: 4px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; }
.panel.narrow { max-width: 520px; }
.panel > table { border: none; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.center-card { max-width: 480px; margin: 12vh auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
        font-size: 13.5px; margin-bottom: 6px; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--cream); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap-cell, td.wrap { overflow-wrap: anywhere; max-width: 420px; }
.push-right { margin-left: auto; }

/* buttons and pills */
.btn { display: inline-block; background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: 7px 14px; border-radius: 8px;
       font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.3; }
.btn:hover { filter: brightness(1.12); }
.btn.good { background: var(--good); border-color: var(--good); }
.btn.bad { background: var(--bad); border-color: var(--bad); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 12px; border-radius: 999px; margin-top: 18px; font-size: 14px; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; background: #eef0f4; color: var(--soft); }
.pill.new { background: #eef3ff; color: #2a4ba0; }
.pill.approved, .pill.active, .pill.listed, .pill.rated, .pill.published { background: #eafaf0; color: #1c6b3a; }
.pill.rejected, .pill.expired, .pill.cancelled, .pill.locked { background: #fbe9e7; color: #9b2c20; }
.pill.pending, .pill.trialing, .pill.under_review, .pill.draft { background: #fff6e6; color: #8a5a00; }

/* forms */
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
input:disabled, select:disabled, textarea:disabled { background: #f4f1ea; color: var(--soft); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
label { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 4px; color: var(--soft); }
.field { margin-bottom: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.span2 { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: 13.5px; margin: 6px 0; }
.check input { width: auto; margin-top: 3px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=search], .filters input[type=text] { min-width: 200px; }
form.inline { display: inline; }
input.short { width: 84px; text-align: right; }
fieldset.flags { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 4px 0 0; }
fieldset.flags legend { font-size: 12.5px; font-weight: 600; color: var(--soft); padding: 0 6px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--soft); }
ol.how li { margin-bottom: 3px; }

/* assessment */
.result { position: sticky; top: 0; z-index: 2; box-shadow: 0 6px 18px rgba(26,35,64,.06); }
.result-main { display: flex; align-items: center; gap: 18px; }
.result .big { font-size: 44px; font-weight: 800; color: var(--navy); line-height: 1; min-width: 96px; }
.result .band { font-size: 17px; font-weight: 700; color: var(--gold); }
.result-pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 14px; margin: 14px 0 6px; }
.pv-pillar { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pv-pillar .lbl { font-size: 12px; color: var(--soft); }
.pv-pillar .val { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
table.indicators td:first-child { width: 38%; }
table.indicators select { width: 70px; }
table.indicators input { width: 100%; min-width: 150px; }
.sticky-actions { position: sticky; bottom: 0; box-shadow: 0 -6px 18px rgba(26,35,64,.08); }

/* sign-in */
body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px; width: 100%; max-width: 400px;
              box-shadow: 0 20px 60px rgba(26,35,64,.10); }
.login-card .brand { text-align: center; margin-bottom: 20px; }
.login-card .eyebrow { font-variant: small-caps; letter-spacing: .18em; color: var(--gold); font-weight: 700; font-size: 13px; }
.login-card h1 { font-size: 22px; margin: 6px 0 0; color: var(--navy); }
.login-card label { margin-top: 14px; }
.login-card input { width: 100%; padding: 11px 13px; border-radius: 10px; }
.login-card .note { font-size: 11.5px; color: var(--soft); text-align: center; margin: 16px 0 0; }

body.login { flex-direction: column; gap: 14px; }
.login-below { margin: 0; }
.linklike.dark { background: none; border: none; color: var(--soft); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; }
.code-input { font-size: 22px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }

/* authenticator */
h3 { font-size: 14px; margin: 14px 0 4px; color: var(--navy); }
.pill.on, .pill.required { background: #eafaf0; color: #1c6b3a; }
.pill.off, .pill.optional, .pill.inactive { background: #eef0f4; color: var(--soft); }
.setup { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.setup > div:last-child { flex: 1; min-width: 280px; max-width: 560px; }
svg.qr { display: block; border: 1px solid var(--line); border-radius: 10px; max-width: 100%; height: auto; }
.setup-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; letter-spacing: .06em;
             background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: inline-block; margin: 0 0 12px; }
.recovery { border-color: var(--gold); }
ul.codes { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
ul.codes li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; background: var(--cream);
              border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; text-align: center; }

/* document viewer */
.doc-frame { width: 100%; height: 82vh; min-height: 480px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: block; }
.doc-image { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.doc-image img { max-width: 100%; height: auto; }
.doc-text { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0;
            white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; max-height: 82vh; overflow: auto; }
.doc-table { overflow: auto; max-height: 82vh; border: 1px solid var(--line); border-radius: 12px; }
.doc-table table { border: none; margin: 0; }
.doc-table th { position: sticky; top: 0; }

/* one NGO record */
.record-head { align-items: center; margin-bottom: 6px; }
.record-head h1.page { margin: 0; overflow-wrap: anywhere; }
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper .where { font-size: 13px; color: var(--soft); min-width: 104px; text-align: center; font-variant-numeric: tabular-nums; }
.btn.off { opacity: .45; cursor: default; pointer-events: none; }
.record-sub { margin: 0 0 12px; font-size: 13px; color: var(--soft); display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.record { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.record-form h2 { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.record-form h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
.hint { font-size: 12px; color: var(--soft); margin-top: 3px; min-height: 16px; font-variant-numeric: tabular-nums; }
.record-side .panel { padding: 16px 18px; margin-bottom: 14px; }
.record-side p { margin: 8px 0 0; }
.score-line { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.score-big { font-size: 40px; font-weight: 800; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.score-line .band { font-size: 16px; font-weight: 700; color: var(--gold); }
dl.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 8px 0; font-size: 13.5px; }
dl.facts dt { color: var(--soft); }
dl.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 40px; gap: 8px; align-items: center; font-size: 12.5px; margin: 5px 0; }
.bar-row progress { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--line); overflow: hidden;
                    -webkit-appearance: none; appearance: none; accent-color: var(--gold); }
.bar-row progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.bar-row progress::-webkit-progress-value { background: var(--gold); border-radius: 4px; }
.bar-row progress::-moz-progress-bar { background: var(--gold); border-radius: 4px; }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
ul.plain { list-style: none; padding: 0; margin: 4px 0 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
ul.plain li:last-child { border-bottom: none; }
ul.plain li .small { display: block; }

@media (max-width: 980px) {
  .record { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .wrap { padding: 16px 12px 60px; }
  table { display: block; overflow-x: auto; }
  .result { position: static; }
  .result .big { font-size: 34px; min-width: 70px; }
}
