/* ===================================================================
   GrowNPO - Site Stylesheet
   Light, professional design. White top menu, green primary actions.
   =================================================================== */

/* --- Design Tokens --- */
:root {
    --gn-green: #206f4a;
    --gn-green-dark: #1a5b3c;
    --gn-green-darker: #1f5130;
    --gn-green-light: #2e9e6a;
    --gn-green-soft: #f0f5f2;
    --gn-amber: #f59f0a;
    --gn-amber-dark: #d98806;
    --gn-ink: #181f25;
    --gn-muted: #67737e;
    --gn-border: #e2e6e9;
    --gn-surface: #ffffff;
    --gn-surface-subtle: #f6f9f7;
    --gn-danger: #ef4444;
    --gn-danger-dark: #c9302c;
    --gn-radius: 10px;
    --gn-hero: linear-gradient(135deg, #206f4a, #1f5130);
    --gn-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gn-font-head: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --- Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: var(--gn-font-body);
    color: var(--gn-ink);
    background-color: var(--gn-surface-subtle);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gn-font-head);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- Links --- */
a {
    color: var(--gn-green);
}

a:hover {
    color: var(--gn-green-dark);
}

/* --- Focus Styles --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(32, 111, 74, 0.45);
}

.form-control:focus, .form-select:focus {
    border-color: var(--gn-green);
}

/* ===================================================================
   Navbar - white bar, green buttons
   =================================================================== */
.navbar-portal {
    background-color: #ffffff;
    border-bottom: 1px solid var(--gn-border);
    padding-top: 0;
    padding-bottom: 0;
    min-height: 60px;
    box-shadow: 0 1px 2px rgba(24, 31, 37, 0.04);
}

.navbar-portal-brand {
    color: var(--gn-ink) !important;
    font-family: var(--gn-font-head);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0;
    padding: 10px 16px 10px 0;
}

.navbar-portal-brand:hover {
    color: var(--gn-green) !important;
}

.navbar-portal-link {
    color: var(--gn-muted) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 19px 14px !important;
    white-space: nowrap;
}

.navbar-portal-link:hover,
.navbar-portal-link:focus {
    color: var(--gn-green) !important;
    background-color: rgba(32, 111, 74, 0.06);
}

.navbar-portal .navbar-toggler {
    border-color: var(--gn-border);
}

.navbar-portal .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2824, 31, 37, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-portal-dropdown {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: 8px;
    min-width: 180px;
    padding: 6px 0;
    margin-top: 0 !important;
    box-shadow: 0 8px 24px rgba(24, 31, 37, 0.1);
}

.navbar-portal-dropdown-item {
    color: var(--gn-ink) !important;
    font-size: 0.875rem;
    padding: 8px 16px;
}

.navbar-portal-dropdown-item:hover,
.navbar-portal-dropdown-item:focus {
    color: var(--gn-green) !important;
    background-color: var(--gn-green-soft);
}

.navbar-portal-dropdown .dropdown-divider {
    border-color: var(--gn-border);
}

.navbar-brand {
    white-space: normal;
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 30px;
    width: auto;
}

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
    transition: all 0.2s ease-in-out;
    font-weight: 600;
}

/* Primary button - the main action on the page (1 Primary, rest Secondary) */
.btn-primary {
    color: #fff;
    background-color: var(--gn-green);
    border-color: var(--gn-green);
}

.btn-primary:hover {
    color: #fff;
    background-color: var(--gn-green-dark);
    border-color: var(--gn-green-dark);
}

.btn-primary:active, .btn-primary:focus {
    background-color: var(--gn-green-darker);
    border-color: var(--gn-green-darker);
}

/* Secondary button - all other actions */
.btn-secondary {
    color: var(--gn-ink);
    background-color: #ffffff;
    border-color: var(--gn-border);
}

.btn-secondary:hover {
    color: var(--gn-green);
    background-color: var(--gn-green-soft);
    border-color: #c9d6cf;
}

.btn-secondary:active, .btn-secondary:focus {
    color: var(--gn-green);
    background-color: #e6efe9;
    border-color: #b4c8bd;
}

/* Danger button */
.btn-danger {
    color: #fff;
    background-color: var(--gn-danger);
    border-color: var(--gn-danger);
}

.btn-danger:hover {
    color: #fff;
    background-color: var(--gn-danger-dark);
    border-color: var(--gn-danger-dark);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--gn-green);
    border-color: var(--gn-green);
}

/* ===================================================================
   Layout helpers
   =================================================================== */
.border-top {
    border-top: 1px solid var(--gn-border);
}

.border-bottom {
    border-bottom: 1px solid var(--gn-border);
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(24, 31, 37, .05);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    font-size: 0.85rem;
}

/* ===================================================================
   Tables
   =================================================================== */
.table {
    font-size: 0.8rem;
    border-collapse: collapse;
    margin-bottom: 0;
}

/* Table header - dark, bold, tight */
.table thead th {
    background-color: #2c3340;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    padding: 8px 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.table thead th a {
    color: #fff;
    text-decoration: none;
}

.table thead th a:hover {
    color: #cfe8dc;
    text-decoration: underline;
}

/* Body rows - compact, clean */
.table tbody td {
    padding: 5px 10px;
    vertical-align: middle;
    border-top: 1px solid #e8eaed;
    border-bottom: none;
    color: #333;
}

/* Stripe: disabled - all rows white */
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff;
}

/* Hover: clear highlight */
.table-hover > tbody > tr:hover > * {
    background-color: var(--gn-green-soft) !important;
    color: #111;
}

/* Wrap the table for a card-like border */
.table-responsive,
.table-wrapper {
    border: 1px solid #d0d4da;
    border-radius: 4px;
    /* Scrolls rather than clips. Columns marked gn-hide-sm drop away on a phone so this
       should never actually be needed, but a stray wide value can never cut content off. */
    overflow-x: auto;
}

/* Columns that carry detail rather than identity are hidden on a phone, so every table
   stays readable without scrolling sideways. Marked on the th and the matching td. */
@media (max-width: 767.98px) {
    .table th.gn-hide-sm,
    .table td.gn-hide-sm {
        display: none;
    }
}

/* A second tier for the widest tables. These columns drop away on a laptop, where the
   table would otherwise be cut off at the edge of the container. */
@media (max-width: 1399.98px) {
    .table th.gn-hide-md,
    .table td.gn-hide-md {
        display: none;
    }
}

/* When a table does still have to scroll, make the scrollbar visible so it is obvious
   there is more to the right rather than the content just appearing to stop. */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: #c6cdd3;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-track {
    background-color: #f1f3f5;
}

/* Sortable table styles */
.sortable th {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable th:hover {
    background-color: #1e2530;
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    opacity: 0.35;
    font-size: 0.7rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

.sortable th.no-sort {
    cursor: default;
}

.sortable th.no-sort::after {
    content: '';
}

/* --- Action Links in Tables --- */
.table-action-link {
    color: var(--gn-green);
    text-decoration: none;
    font-size: 0.78rem;
    white-space: nowrap;
}

.table-action-link:hover {
    color: var(--gn-green-dark);
    text-decoration: underline;
}

.table-action-delete {
    color: #c0392b;
}

.table-action-delete:hover {
    color: #922b21;
}

/* --- Action Icons in Tables --- */
.action-icon {
    width: 18px;
    height: 18px;
    margin: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* ===================================================================
   Cards, forms, alerts
   =================================================================== */
.card {
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
}

.form-control, .form-select {
    border-color: var(--gn-border);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.alert {
    font-size: 0.9rem;
}

/* --- Login Page --- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
}

/* ===================================================================
   PUBLIC SITE - landing page, get started, registration
   =================================================================== */
.public-body {
    margin-bottom: 0;
    background-color: #ffffff;
}

.public-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--gn-border);
    min-height: 64px;
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.public-navbar .navbar-brand img {
    height: 30px;
    width: auto;
}

.btn-public-login {
    color: var(--gn-ink);
    background-color: transparent;
    border-color: transparent;
    font-weight: 500;
    padding: 0.45rem 1rem;
}

.btn-public-login:hover {
    color: var(--gn-green);
    background-color: var(--gn-green-soft);
}

.btn-public-start {
    color: #fff;
    background-color: var(--gn-green);
    border-color: var(--gn-green);
    font-weight: 600;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
}

.btn-public-start:hover {
    color: #fff;
    background-color: var(--gn-green-dark);
    border-color: var(--gn-green-dark);
}

/* --- Section scaffolding --- */
.public-section {
    padding: 5rem 0;
}

.public-section-subtle {
    background-color: var(--gn-surface-subtle);
}

.eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gn-green);
    background-color: var(--gn-green-soft);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1rem;
}

.eyebrow-amber {
    color: var(--gn-amber-dark);
    background-color: #fdf3e0;
}

.section-title {
    font-family: var(--gn-font-head);
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gn-ink);
    margin-bottom: 1rem;
}

.section-title .accent {
    color: var(--gn-green);
}

.section-lead {
    color: var(--gn-muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

/* --- Hero --- */
.public-hero {
    background: var(--gn-hero);
    color: #fff;
    padding: 5rem 0;
}

.public-hero .hero-title {
    font-family: var(--gn-font-head);
    font-size: 3.1rem;
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.public-hero .hero-title .accent {
    color: var(--gn-amber);
    display: block;
}

.public-hero .hero-sub {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.public-hero .hero-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    max-width: 32rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    margin: 0 0.5rem 1.25rem 0;
    background-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-pill.active {
    background-color: #ffffff;
    color: var(--gn-green);
    border-color: #ffffff;
}

.btn-hero-primary {
    color: var(--gn-green);
    background-color: #ffffff;
    border-color: #ffffff;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
}

.btn-hero-primary:hover {
    color: var(--gn-green-dark);
    background-color: #f0f5f2;
    border-color: #f0f5f2;
}

.btn-hero-ghost {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
}

.btn-hero-ghost:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
    display: block;
}

/* --- Info cards --- */
.info-card {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.info-card h5 {
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--gn-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.section-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--gn-border);
    display: block;
}

/* --- Stats --- */
.stat-block {
    text-align: center;
    padding: 1rem 0.5rem;
}

.stat-block .stat-value {
    font-family: var(--gn-font-head);
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--gn-green);
    line-height: 1.1;
}

.stat-block .stat-label {
    color: var(--gn-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* --- Compliance grid --- */
.compliance-panel {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 10px 30px rgba(24, 31, 37, 0.05);
}

.compliance-item {
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1rem 1.1rem;
    height: 100%;
}

.compliance-item h6 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.compliance-item p {
    color: var(--gn-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.dot-green {
    background-color: var(--gn-green);
}

.dot-amber {
    background-color: var(--gn-amber);
}

/* --- Benefit cards --- */
.benefit-card {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.5rem 1.1rem;
    text-align: center;
    height: 100%;
}

.benefit-card .benefit-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.75rem;
}

.benefit-card h6 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.benefit-card p {
    color: var(--gn-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.corporate-panel {
    background-color: var(--gn-surface-subtle);
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    padding: 2.25rem;
    text-align: center;
}

/* --- Pricing --- */
.price-card {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    position: relative;
}

.price-card.featured {
    border-color: var(--gn-green);
    box-shadow: 0 14px 36px rgba(32, 111, 74, 0.14);
}

.price-badge {
    position: absolute;
    top: -0.85rem;
    right: 1.5rem;
    background-color: var(--gn-green);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
}

.price-card h5 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.price-card .price-desc {
    color: var(--gn-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    min-height: 2.8rem;
}

.price-amount {
    font-family: var(--gn-font-head);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--gn-ink);
}

.price-period {
    color: var(--gn-muted);
    font-size: 0.85rem;
}

.price-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    border-top: 1px solid var(--gn-border);
    padding-top: 1.25rem;
}

.price-features li {
    color: var(--gn-ink);
    font-size: 0.86rem;
    padding: 0.35rem 0 0.35rem 1.6rem;
    position: relative;
}

.price-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--gn-green);
    font-weight: 700;
}

/* --- Closing CTA --- */
.public-cta {
    position: relative;
    padding: 5rem 0;
    background-color: #2b3340;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
}

.public-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(24, 31, 37, 0.78);
}

.public-cta .container {
    position: relative;
}

.public-cta h2 {
    font-family: var(--gn-font-head);
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.public-cta p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 34rem;
    margin: 0 auto 1.75rem;
}

/* --- Public footer --- */
.public-footer {
    position: static;
    background-color: #ffffff;
    border-top: 1px solid var(--gn-border);
    padding: 3rem 0 1.5rem;
    line-height: normal;
    white-space: normal;
}

.public-footer img {
    height: 28px;
    width: auto;
    margin-bottom: 1rem;
}

.public-footer p,
.public-footer a {
    color: var(--gn-muted);
    font-size: 0.86rem;
    text-decoration: none;
}

.public-footer a:hover {
    color: var(--gn-green);
}

.public-footer h6 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gn-ink);
    margin-bottom: 0.9rem;
}

.public-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.public-footer li {
    margin-bottom: 0.45rem;
}

.public-footer-bottom {
    border-top: 1px solid var(--gn-border);
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    text-align: center;
}

/* --- POPIA consent checkbox on the registration form --- */
.consent-check .form-check-label {
    font-size: 0.88rem;
    color: var(--gn-ink);
}

/* --- Manage Account: the email is the username, so say so plainly --- */
.account-warning {
    font-size: 0.8rem;
    color: #8a5a00;
    background-color: #fdf2dd;
    border: 1px solid #f0d9a6;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    margin-top: 0.4rem;
}

/* --- Privacy notice --- */
.privacy-notice p,
.privacy-notice li {
    font-size: 0.92rem;
    color: var(--gn-ink);
}

.privacy-notice ul {
    margin-bottom: 1rem;
}

.privacy-notice li {
    margin-bottom: 0.4rem;
}

/* ===================================================================
   PILLS - small, rounded, uppercase status and category markers.
   Defined once here and reused everywhere so a value always looks
   the same on every screen.
   =================================================================== */
.gn-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* --- Document type category --- */
.gn-pill-mandatory {
    color: #17603f;
    background-color: #e4f2ea;
    border-color: #b7dbc8;
}

.gn-pill-recommended {
    color: #5b666f;
    background-color: #eef1f3;
    border-color: #d7dde1;
}

/* --- Application status. Used on the NPO Home page, the admin NPO list,
       the review workspace and the dashboard, so a status always looks
       the same everywhere. --- */
.gn-pill-registered {
    color: #5b666f;
    background-color: #eef1f3;
    border-color: #d7dde1;
}

.gn-pill-inprogress {
    color: #1c5b96;
    background-color: #e5eff8;
    border-color: #b9d4ea;
}

.gn-pill-underreview {
    color: #8a5a00;
    background-color: #fdf2dd;
    border-color: #f0d9a6;
}

.gn-pill-awaitinginformation {
    color: #a32b23;
    background-color: #fbe9e7;
    border-color: #f2c4bf;
}

.gn-pill-readyforverification {
    color: #10666b;
    background-color: #e2f2f3;
    border-color: #b3dcdf;
}

.gn-pill-vetted {
    color: #17603f;
    background-color: #e4f2ea;
    border-color: #b7dbc8;
}

.gn-pill-declined {
    color: #7a1c17;
    background-color: #f6dedb;
    border-color: #e3b0aa;
}

/* --- Document status --- */
.gn-pill-notuploaded {
    color: #6b7680;
    background-color: transparent;
    border-color: #cdd4d9;
}

.gn-pill-pendingreview {
    color: #8a5a00;
    background-color: #fdf2dd;
    border-color: #f0d9a6;
}

.gn-pill-approved {
    color: #17603f;
    background-color: #e4f2ea;
    border-color: #b7dbc8;
}

.gn-pill-returned {
    color: #a32b23;
    background-color: #fbe9e7;
    border-color: #f2c4bf;
}

.gn-pill-expired {
    color: #7a1c17;
    background-color: #f6dedb;
    border-color: #e3b0aa;
}

/* A larger pill for the status banner, where it is the headline. */
.gn-pill-lg {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
}

/* On a phone the longest status, Awaiting Information, is wide enough on its own to
   push a table past the screen. Tighten the pill rather than truncate the status. */
@media (max-width: 575.98px) {
    .table .gn-pill {
        font-size: 0.6rem;
        letter-spacing: 0.02em;
        padding: 0.18rem 0.4rem;
    }

    /* Denser cells on a phone, so the columns that remain all fit the screen. */
    .table thead th {
        font-size: 0.66rem;
        padding: 5px 6px;
    }

    .table tbody td {
        font-size: 0.75rem;
        padding: 5px 6px;
    }

    .npo-doc-bar {
        width: 34px;
    }
}

/* ===================================================================
   DOCUMENT PREVIEW MODAL - used everywhere a document is opened
   =================================================================== */
.doc-preview-meta {
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin-top: 0.2rem;
}

/* The body scrolls internally rather than growing the modal off the screen. */
.doc-preview-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

.doc-preview-pdf {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
}

.doc-preview-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Scaled to fit, never stretched. */
.doc-preview-image {
    max-width: 100%;
    max-height: 66vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.doc-preview-fallback {
    text-align: center;
    color: var(--gn-muted);
    padding: 3rem 1.5rem;
}

.doc-preview-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

/* A document name is always a link that opens the preview. */
.doc-link {
    color: var(--gn-green);
    text-decoration: none;
    word-break: break-word;
}

.doc-link:hover {
    color: var(--gn-green-dark);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    /* Full width on a phone, and the PDF viewer must not trap scrolling. */
    .doc-preview-body {
        max-height: none;
    }

    .doc-preview-pdf {
        height: 60vh;
    }
}

/* ===================================================================
   NPO PORTAL - the shell around every page a logged in NPO can see
   =================================================================== */
.npo-body {
    background-color: var(--gn-surface-subtle);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.npo-body > .container {
    flex: 1 0 auto;
    padding-top: 1.5rem;
}

/* The NPO footer is the public footer cut down to contact details and copyright. */
.npo-footer {
    flex-shrink: 0;
    padding: 2rem 0 1.25rem;
}

.npo-footer .public-footer-bottom {
    margin-top: 1.5rem;
}

/* ===================================================================
   NPO HOME - one page that scrolls. No tabs, no accordion, no wizard.
   =================================================================== */

/* --- Status banner --- */
.npo-banner {
    background: var(--gn-hero);
    color: #ffffff;
    border-radius: var(--gn-radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.npo-banner-main {
    min-width: 0;
}

.npo-banner-name {
    font-family: var(--gn-font-head);
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
    word-break: break-word;
}

.npo-banner-contact {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    margin: 0.15rem 0 0.9rem;
}

.npo-banner-status {
    margin-bottom: 0.75rem;
}

/* The status pill sits on the green banner, so it gets a solid light background. */
.npo-banner-status .gn-pill {
    background-color: rgba(255, 255, 255, 0.95);
}

.npo-banner-explanation {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.95);
}

/* --- Circular progress ring --- */
.npo-banner-ring {
    flex-shrink: 0;
    text-align: center;
    width: 190px;
}

.npo-banner-ring svg {
    width: 130px;
    height: 130px;
    transform: rotate(-90deg);
}

.npo-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 10;
}

.npo-ring-value {
    fill: none;
    stroke: #ffffff;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.npo-ring-text {
    fill: #ffffff;
    font-family: var(--gn-font-head);
    font-size: 1.5rem;
    font-weight: 800;
    transform: rotate(90deg);
    transform-origin: 60px 60px;
}

.npo-ring-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    margin: 0.4rem 0 0;
    line-height: 1.35;
}

/* --- Section headings --- */
.npo-section {
    margin-bottom: 1.5rem;
}

.npo-section-title {
    font-family: var(--gn-font-head);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gn-muted);
    margin-bottom: 0.85rem;
}

/* --- Next Steps strip --- */
.npo-next-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.npo-step-card {
    display: flex;
    gap: 0.85rem;
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-left: 4px solid var(--gn-green);
    border-radius: var(--gn-radius);
    padding: 1rem 1.1rem;
}

.npo-step-positive {
    border-left-color: var(--gn-green-light);
}

.npo-step-icon {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gn-green);
    line-height: 1.4;
}

.npo-step-title {
    font-family: var(--gn-font-head);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.npo-step-text {
    font-size: 0.85rem;
    color: var(--gn-muted);
    margin: 0 0 0.65rem;
}

/* --- Page layout: main column plus right rail --- */
.npo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.npo-main {
    min-width: 0;
}

.npo-rail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Panels --- */
.npo-panel {
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.npo-panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.npo-panel-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gn-green);
    white-space: nowrap;
}

.npo-panel-lead {
    font-size: 0.86rem;
    color: var(--gn-muted);
    margin: 0.35rem 0 1rem;
}

.npo-panel-actions {
    margin-top: 1.25rem;
}

.npo-empty {
    font-size: 0.88rem;
    color: var(--gn-muted);
    font-style: italic;
}

/* --- Checklist rows --- */
.npo-row {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 0;
    border-top: 1px solid var(--gn-border);
    transition: background-color 0.3s ease-in-out;
}

.npo-row:first-of-type {
    border-top: 0;
}

.npo-row-dragover {
    background-color: var(--gn-green-soft);
}

.npo-row-highlight {
    background-color: var(--gn-green-soft);
}

.npo-row-icon {
    font-size: 1.5rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.npo-row-icon-empty {
    opacity: 0.3;
}

.npo-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.npo-row-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.npo-row-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.npo-help {
    border: 1px solid var(--gn-border);
    background-color: transparent;
    color: var(--gn-muted);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.npo-help:hover {
    color: var(--gn-green);
    border-color: var(--gn-green);
}

.npo-row-desc {
    font-size: 0.83rem;
    color: var(--gn-muted);
    margin: 0.2rem 0 0;
}

.npo-row-file {
    margin: 0.45rem 0 0;
    font-size: 0.88rem;
    word-break: break-word;
}

.npo-row-version {
    color: var(--gn-muted);
    font-size: 0.8rem;
}

.npo-row-date {
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin: 0.1rem 0 0;
}

/* The reason a document came back is shown in the row itself, never behind a click. */
.npo-row-returned {
    background-color: #fbe9e7;
    border: 1px solid #f2c4bf;
    border-radius: 6px;
    color: #8c2620;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    margin-top: 0.6rem;
}

.npo-row-expiry {
    font-size: 0.8rem;
    color: var(--gn-muted);
    margin: 0.45rem 0 0;
}

.npo-expiry-soon {
    color: #8a5a00;
    font-weight: 600;
}

.npo-expiry-past {
    color: #a32b23;
    font-weight: 600;
}

.npo-row-nothave {
    display: inline-block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.npo-row-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.npo-row-history {
    font-size: 0.78rem;
}

.npo-current-flag {
    font-size: 0.68rem;
    color: var(--gn-green);
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Upload modal dropzone --- */
.npo-dropzone {
    border: 2px dashed var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.25rem;
    text-align: center;
    color: var(--gn-muted);
    font-size: 0.88rem;
}

.npo-dropzone-active {
    border-color: var(--gn-green);
    background-color: var(--gn-green-soft);
}

.npo-dropzone-selected {
    font-size: 0.85rem;
    color: var(--gn-ink);
    font-weight: 600;
    margin: 0.65rem 0 0;
    word-break: break-word;
}

/* --- Profile panel --- */
.npo-progress {
    height: 8px;
    background-color: #eef1f3;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.npo-progress-bar {
    height: 100%;
    background-color: var(--gn-green);
    border-radius: 999px;
    transition: width 0.5s ease-in-out;
}

.npo-profile-list {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 0.55rem 1.25rem;
    margin: 0;
    font-size: 0.88rem;
}

.npo-profile-list dt {
    font-weight: 600;
    color: var(--gn-muted);
}

.npo-profile-list dd {
    margin: 0;
    word-break: break-word;
}

.npo-not-provided {
    color: #9aa4ac;
    font-style: italic;
}

/* --- Right rail cards --- */
.npo-card {
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.1rem;
}

.npo-card-title {
    font-family: var(--gn-font-head);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gn-muted);
    margin-bottom: 0.85rem;
}

.npo-card-text {
    font-size: 0.85rem;
    color: var(--gn-muted);
    margin-bottom: 0.85rem;
}

/* --- Application timeline --- */
.npo-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1rem;
    border-left: 2px solid var(--gn-border);
}

.npo-timeline-item {
    position: relative;
    padding-bottom: 1rem;
    font-size: 0.83rem;
}

.npo-timeline-item:last-child {
    padding-bottom: 0;
}

.npo-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.42rem;
    top: 0.35rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--gn-green);
    border: 2px solid var(--gn-surface);
}

.npo-timeline-date {
    display: block;
    color: var(--gn-muted);
    font-size: 0.76rem;
}

.npo-timeline-status {
    display: block;
    font-weight: 600;
}

.npo-timeline-by {
    display: block;
    color: var(--gn-muted);
    font-size: 0.76rem;
}

.npo-timeline-reason {
    display: block;
    color: var(--gn-muted);
    font-size: 0.78rem;
    font-style: italic;
    margin-top: 0.15rem;
}

/* --- Chips: used for multi-selects and to display multi-value fields --- */
.npo-chipset {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.npo-chip {
    display: inline-block;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--gn-border);
    background-color: var(--gn-surface);
    color: var(--gn-ink);
}

.npo-chip-static {
    margin: 0 0.25rem 0.25rem 0;
    background-color: var(--gn-green-soft);
    border-color: #cfe2d7;
    color: #17603f;
}

.npo-chip-toggle {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.npo-chip-toggle:hover {
    border-color: var(--gn-green);
    color: var(--gn-green);
}

.npo-chip-selected {
    background-color: var(--gn-green);
    border-color: var(--gn-green);
    color: #ffffff;
}

.npo-chip-selected:hover {
    background-color: var(--gn-green-dark);
    border-color: var(--gn-green-dark);
    color: #ffffff;
}

/* --- Edit profile --- */
.npo-help-lead {
    background-color: var(--gn-green-soft);
    border-left: 3px solid var(--gn-green);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin: 0;
}

.npo-logo-current {
    font-size: 0.85rem;
    color: var(--gn-muted);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

/* --- Open assistance requests shown in the Need help card --- */
.npo-open-requests {
    border-top: 1px solid var(--gn-border);
    margin-top: 1rem;
    padding-top: 0.85rem;
}

.npo-open-requests-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gn-muted);
    margin-bottom: 0.5rem;
}

.npo-open-request {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    margin-bottom: 0.45rem;
}

.npo-open-request-what {
    font-weight: 600;
}

.npo-open-request-date {
    color: var(--gn-muted);
    font-size: 0.75rem;
}

/* --- Request status pills. Separate from the application status pills because a lead
       that is In Progress is amber, while an application In Progress is blue. --- */
.gn-pill-request-new {
    color: #1c5b96;
    background-color: #e5eff8;
    border-color: #b9d4ea;
}

.gn-pill-request-inprogress {
    color: #8a5a00;
    background-color: #fdf2dd;
    border-color: #f0d9a6;
}

.gn-pill-request-closed {
    color: #5b666f;
    background-color: #eef1f3;
    border-color: #d7dde1;
}

/* --- The full message inside the admin lead modal --- */
.npo-lead-message {
    background-color: var(--gn-surface-subtle);
    border: 1px solid var(--gn-border);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===================================================================
   CORPORATE SPONSOR - the welcome page, until the directory is built
   =================================================================== */
.sponsor-banner {
    align-items: flex-start;
}

.sponsor-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.sponsor-feature {
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.25rem;
}

.sponsor-feature-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

.sponsor-feature-title {
    font-family: var(--gn-font-head);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}

.sponsor-feature-text {
    font-size: 0.85rem;
    color: var(--gn-muted);
    margin: 0;
}

/* ===================================================================
   CORPORATE SPONSOR DIRECTORY - the list of vetted NPOs
   =================================================================== */
.sponsor-directory-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1.25rem;
}

.sponsor-directory-title {
    font-family: var(--gn-font-head);
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
}

.sponsor-directory-lead {
    font-size: 0.92rem;
    color: var(--gn-muted);
    max-width: 46rem;
    margin: 0;
}

.sponsor-directory-count {
    flex: 0 0 auto;
    text-align: right;
}

.sponsor-directory-count-value {
    display: block;
    font-family: var(--gn-font-head);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--gn-green);
}

.sponsor-directory-count-label {
    display: block;
    font-size: 0.78rem;
    color: var(--gn-muted);
}

.sponsor-directory-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* --- The cards --- */
.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* A button, not a div, so the whole card is keyboard reachable. */
.sponsor-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.sponsor-card:hover,
.sponsor-card:focus-visible {
    border-color: var(--gn-green);
    box-shadow: 0 4px 14px rgba(32, 111, 74, 0.14);
    transform: translateY(-2px);
}

.sponsor-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.sponsor-card-vetted {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #17603f;
    background-color: #e4f2ea;
    border: 1px solid #b7dbc8;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
}

.sponsor-card-score {
    font-family: var(--gn-font-head);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gn-green);
}

.sponsor-card-name {
    font-family: var(--gn-font-head);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--gn-ink);
}

.sponsor-card-location {
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin: 0 0 0.6rem;
}

.sponsor-card-blurb {
    font-size: 0.86rem;
    color: var(--gn-ink);
    line-height: 1.5;
    margin: 0 0 0.85rem;
    /* Keeps every card the same shape however long the mission statement is. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sponsor-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    margin-bottom: 0.9rem;
}

.sponsor-card-more {
    font-size: 0.72rem;
    color: var(--gn-muted);
}

.sponsor-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gn-border);
    font-size: 0.76rem;
    color: var(--gn-muted);
}

.sponsor-card-open {
    color: var(--gn-green);
    font-weight: 600;
    white-space: nowrap;
}

/* --- The profile modal --- */
.sponsor-modal-header {
    align-items: flex-start;
}

.sponsor-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin-top: 0.35rem;
}

.sponsor-modal-mission {
    font-size: 1rem;
    font-style: italic;
    color: var(--gn-ink);
    background-color: var(--gn-green-soft);
    border-left: 3px solid var(--gn-green);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.sponsor-modal-heading {
    font-family: var(--gn-font-head);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gn-muted);
    margin-bottom: 0.5rem;
}

.sponsor-modal-text {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

@media (max-width: 575.98px) {
    .sponsor-directory-header {
        gap: 1rem;
    }

    .sponsor-directory-count {
        text-align: left;
    }

    .sponsor-directory-filter .form-control,
    .sponsor-directory-filter .form-select {
        width: 100% !important;
    }
}

/* ===================================================================
   RESOURCES - the NPO information pack
   =================================================================== */
.npo-resources-intro {
    font-size: 0.92rem;
    color: var(--gn-muted);
    max-width: 52rem;
    margin-bottom: 1.5rem;
}

.npo-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.npo-resource-card {
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
}

.npo-resource-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

.npo-resource-title {
    font-family: var(--gn-font-head);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    word-break: break-word;
}

.npo-resource-desc {
    font-size: 0.85rem;
    color: var(--gn-muted);
    margin: 0 0 1rem;
    flex: 1 1 auto;
}

.npo-resource-action {
    margin-top: auto;
}

/* ===================================================================
   ADMIN LIST EXTRAS - record counts, document progress, tinted rows
   =================================================================== */
.npo-record-count {
    font-size: 0.82rem;
    color: var(--gn-muted);
    margin-bottom: 0.5rem;
}

.npo-doc-count {
    display: block;
    font-size: 0.8rem;
    white-space: nowrap;
}

.npo-doc-bar {
    display: block;
    width: 60px;
    height: 4px;
    background-color: #eef1f3;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 3px;
}

.npo-doc-bar-fill {
    display: block;
    height: 100%;
    background-color: var(--gn-green);
    border-radius: 999px;
}

.npo-score-overridden {
    color: var(--gn-amber-dark);
    font-weight: 700;
}

/* The ball is with the NPO, not with GrowNPO, so the reviewer can skip past these. */
.table tbody tr.npo-row-waiting > * {
    background-color: #fdf6f5;
}

/* ===================================================================
   REVIEW WORKSPACE - where a reviewer judges an application
   =================================================================== */
.review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.review-header-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 260px;
}

.review-logo {
    max-height: 56px;
    max-width: 110px;
    width: auto;
    border-radius: 6px;
}

.review-name {
    margin: 0 0 0.4rem;
    word-break: break-word;
}

.review-vetted-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #17603f;
    background-color: #e4f2ea;
    border: 1px solid #b7dbc8;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.review-identity-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.review-regno {
    font-size: 0.85rem;
    color: var(--gn-muted);
}

.review-dates {
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin: 0;
}

/* --- Score card --- */
.review-score-card {
    flex: 0 1 260px;
    border-left: 1px solid var(--gn-border);
    padding-left: 1.25rem;
}

.review-score-value {
    font-family: var(--gn-font-head);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}

.review-score-outof {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gn-muted);
}

.review-overridden {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a5a00;
    background-color: #fdf2dd;
    border: 1px solid #f0d9a6;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    cursor: help;
}

/* A 10-segment bar, because it is the headline figure a donor eventually sees. */
.review-score-bar {
    display: flex;
    gap: 3px;
    margin: 0.55rem 0 0.4rem;
}

.review-score-seg {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 2px;
    background-color: #eef1f3;
}

.review-score-seg-on {
    background-color: var(--gn-green);
}

.review-score-suggested {
    font-size: 0.76rem;
    color: var(--gn-muted);
    margin: 0 0 0.2rem;
}

.review-score-breakdown {
    font-size: 0.72rem;
    color: var(--gn-muted);
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.review-score-actions {
    font-size: 0.78rem;
}

.review-score-link {
    color: var(--gn-green);
    text-decoration: none;
    font-size: 0.78rem;
}

.review-score-link:hover {
    text-decoration: underline;
}

.review-score-link-button {
    background: none;
    border: 0;
    padding: 0;
}

/* --- Primary action, with nothing competing with it --- */
.review-header-action {
    flex: 0 0 auto;
    text-align: right;
}

.review-action-waiting {
    font-size: 0.82rem;
    color: var(--gn-muted);
    font-style: italic;
}

.review-header-secondary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* --- Layout: tabs plus the internal notes rail --- */
.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: start;
}

.review-main {
    min-width: 0;
}

.review-tabs .nav-link {
    color: var(--gn-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.review-tabs .nav-link.active {
    color: var(--gn-green);
    border-bottom-color: transparent;
}

.review-tab-content {
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-top: 0;
    border-radius: 0 0 var(--gn-radius) var(--gn-radius);
    padding: 1.25rem;
}

/* --- Where they need help: the reason a consultant opens this screen --- */
.review-help-card {
    background-color: var(--gn-green-soft);
    border: 1px solid #cfe2d7;
    border-left: 4px solid var(--gn-green);
    border-radius: var(--gn-radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
}

.review-help-title {
    font-family: var(--gn-font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gn-green);
    margin-bottom: 0.6rem;
}

.review-help-detail {
    font-size: 0.88rem;
    margin: 0.5rem 0 0;
}

/* --- Consent record --- */
.review-consent {
    background-color: var(--gn-surface-subtle);
    border: 1px solid var(--gn-border);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
}

.review-consent-text {
    font-size: 0.88rem;
    font-style: italic;
    margin: 0 0 0.4rem;
}

.review-consent-meta {
    font-size: 0.76rem;
    color: var(--gn-muted);
    margin: 0;
}

/* --- Document rows on the review side --- */
.review-doc-row .npo-row-actions {
    align-items: flex-end;
}

.review-doc-link {
    font-weight: 600;
}

.review-adhoc-flag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1c5b96;
    background-color: #e5eff8;
    border: 1px solid #b9d4ea;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.review-reason-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* --- Activity feed --- */
.review-feed {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.1rem;
    border-left: 2px solid var(--gn-border);
}

.review-feed-item {
    position: relative;
    padding-bottom: 1rem;
    font-size: 0.85rem;
}

.review-feed-item::before {
    content: "";
    position: absolute;
    left: -1.52rem;
    top: 0.35rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--gn-muted);
    border: 2px solid var(--gn-surface);
}

.review-feed-status::before { background-color: var(--gn-green); }
.review-feed-upload::before { background-color: #7fb0d8; }
.review-feed-review::before { background-color: var(--gn-amber); }

.review-feed-date {
    display: block;
    font-size: 0.74rem;
    color: var(--gn-muted);
}

.review-feed-title {
    display: block;
    font-weight: 600;
}

.review-feed-detail {
    display: block;
    color: var(--gn-ink);
}

.review-feed-actor {
    display: block;
    font-size: 0.74rem;
    color: var(--gn-muted);
}

/* --- Internal notes --- */
.review-notes-warning {
    font-size: 0.74rem;
    color: #a32b23;
    background-color: #fbe9e7;
    border: 1px solid #f2c4bf;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.85rem;
}

.review-note {
    border-top: 1px solid var(--gn-border);
    padding-top: 0.6rem;
    margin-top: 0.6rem;
}

.review-note-text {
    font-size: 0.85rem;
    margin: 0 0 0.2rem;
    white-space: pre-wrap;
}

.review-note-meta {
    font-size: 0.72rem;
    color: var(--gn-muted);
    margin: 0;
}

/* ===================================================================
   ADMIN DASHBOARD
   =================================================================== */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    display: block;
    background-color: var(--gn-surface);
    border: 1px solid var(--gn-border);
    border-top: 3px solid var(--gn-border);
    border-radius: var(--gn-radius);
    padding: 1rem;
    text-decoration: none;
    color: var(--gn-ink);
    transition: all 0.15s ease-in-out;
}

.dash-card:hover {
    color: var(--gn-ink);
    border-color: var(--gn-green);
    box-shadow: 0 2px 8px rgba(32, 111, 74, 0.12);
}

.dash-card-value {
    display: block;
    font-family: var(--gn-font-head);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
}

.dash-card-label {
    display: block;
    font-size: 0.78rem;
    color: var(--gn-muted);
    font-weight: 600;
}

.dash-card-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--gn-muted);
    margin-top: 0.2rem;
}

.dash-card-amber { border-top-color: var(--gn-amber); }
.dash-card-red   { border-top-color: var(--gn-danger); }
.dash-card-teal  { border-top-color: #4fb3b8; }
.dash-card-green { border-top-color: var(--gn-green); }

/* --- Charts --- */
.dash-chart-card {
    height: 100%;
}

.dash-chart-title {
    font-family: var(--gn-font-head);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.dash-chart-sub {
    font-size: 0.78rem;
    color: var(--gn-muted);
    margin-bottom: 0.85rem;
}

.dash-chart-holder {
    position: relative;
    height: 260px;
}

.dash-chart-tall {
    height: 340px;
}

.dash-chart-empty {
    display: none;
    text-align: center;
    color: var(--gn-muted);
    font-size: 0.88rem;
    padding: 2.5rem 0;
    margin: 0;
}

/* --- Work queues --- */
.dash-queue-clear {
    font-size: 0.86rem;
    color: #17603f;
    background-color: #e4f2ea;
    border: 1px solid #b7dbc8;
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    margin: 0;
}

.dash-view-all {
    display: inline-block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* The three queues sit in a third of the width each, where a five column table just
   wraps into an unreadable mess. Each entry is a compact two line row instead. */
.dash-queue {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-queue-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--gn-border);
}

.dash-queue-item:first-child {
    border-top: 0;
}

.dash-queue-body {
    min-width: 0;          /* lets the ellipsis actually engage */
    flex: 1 1 auto;
}

.dash-queue-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gn-green);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.dash-queue-title:hover {
    color: var(--gn-green-dark);
    text-decoration: underline;
}

.dash-queue-sub,
.dash-queue-file {
    display: block;
    font-size: 0.78rem;
    color: var(--gn-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-queue-file {
    color: var(--gn-green);
    text-decoration: none;
}

.dash-queue-file:hover {
    text-decoration: underline;
}

.dash-queue-meta {
    flex: 0 0 auto;
    text-align: right;
    white-space: nowrap;
}

.dash-queue-days {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
}

.dash-queue-date {
    display: block;
    font-size: 0.74rem;
    color: var(--gn-muted);
}

/* Past the 48 hour promise, or already expired. */
.dash-queue-overdue .dash-queue-days {
    color: #a32b23;
}

.dash-queue-overdue {
    background-color: #fdf6f5;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Past the 48 hour promise, or already expired. */
.table tbody tr.dash-row-overdue > * {
    background-color: #fbe9e7;
}

/* --- Responsive: the rail moves below the profile panel and everything goes full
       width. Nothing is hidden behind a tab or a toggle at any breakpoint. --- */
@media (max-width: 991.98px) {
    .review-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .review-score-card {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--gn-border);
        padding-top: 0.85rem;
        flex-basis: 100%;
    }

    .review-header-action {
        flex-basis: 100%;
        text-align: left;
    }

    .review-header-secondary {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .dash-chart-holder,
    .dash-chart-tall {
        height: 300px;
    }
}

@media (max-width: 991.98px) {
    .npo-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .npo-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .npo-banner-name {
        font-size: 1.5rem;
    }

    .npo-banner-ring {
        width: 100%;
        text-align: left;
    }

    .npo-banner-ring svg {
        width: 104px;
        height: 104px;
    }

    .npo-next-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .npo-row {
        flex-wrap: wrap;
    }

    .npo-row-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    .npo-profile-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.15rem;
    }

    .npo-profile-list dd {
        margin-bottom: 0.65rem;
    }
}

/* --- Public form pages (Get Started, Registration) --- */
.public-page {
    padding: 3.5rem 0 5rem;
    background-color: var(--gn-surface-subtle);
    min-height: 70vh;
}

.public-panel {
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 10px 30px rgba(24, 31, 37, 0.05);
}

.choice-card {
    display: block;
    background-color: #ffffff;
    border: 1px solid var(--gn-border);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
}

.choice-card:hover {
    color: inherit;
    border-color: var(--gn-green);
    box-shadow: 0 14px 36px rgba(32, 111, 74, 0.14);
    transform: translateY(-2px);
}

.choice-card h5 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.choice-card p {
    color: var(--gn-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.choice-card .choice-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.9rem;
}

.choice-card.disabled {
    opacity: 0.75;
    cursor: default;
}

.choice-card.disabled:hover {
    border-color: var(--gn-border);
    box-shadow: none;
    transform: none;
}

.badge-soon {
    display: inline-block;
    background-color: #fdf3e0;
    color: var(--gn-amber-dark);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
}

.form-section-title {
    font-family: var(--gn-font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gn-green);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    /* The top margin separates a section from whatever came before it. Without it a
       heading sits directly on the last row of the previous section. */
    margin: 2rem 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--gn-border);
}

/* The first section on a page already sits under the page heading, so it needs no gap. */
.form-section-title:first-of-type {
    margin-top: 0;
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .public-hero .hero-title {
        font-size: 2.2rem;
    }

    .section-title,
    .public-cta h2 {
        font-size: 1.8rem;
    }

    .public-section {
        padding: 3rem 0;
    }

    .compliance-panel,
    .corporate-panel,
    .public-panel {
        padding: 1.5rem;
    }
}
