:root {

    --bg: #f6f4ef;

    --card: #fff;

    --text: #1a1a1a;

    --accent: #c45c26;

    --ok: #1b6b3a;

    --warn: #8a5a00;

}



* { box-sizing: border-box; }



body {

    margin: 0;

    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    background: var(--bg);

    color: var(--text);

    line-height: 1.5;

}



.site-header {

    display: flex;

    flex-wrap: wrap;

    justify-content: space-between;

    align-items: center;

    padding: 1rem 1.25rem;

    background: var(--card);

    border-bottom: 1px solid #e5e0d8;

}



.brand { font-weight: 700; color: var(--accent); font-size: 1.125rem; }

.header-brand {

    flex: 1 1 auto;

    min-width: 0;

}

.brand-lockup {

    display: inline-flex;

    align-items: center;

    gap: 0.65rem;

    text-decoration: none;

    color: inherit;

    max-width: 100%;

}

.brand-lockup:hover .brand { text-decoration: underline; text-underline-offset: 3px; }

.brand-logo {

    flex-shrink: 0;

    display: block;

    height: 2.75rem;

    width: auto;

    max-width: min(220px, 58vw);

    object-fit: contain;

    object-position: left center;

}



.site-main {

    max-width: 900px;

    margin: 0 auto;

    padding: 1.5rem 1.25rem;

}



.site-footer {

    text-align: center;

    padding: 2rem;

    color: #666;

    font-size: 0.875rem;

}



.card {

    background: var(--card);

    border-radius: 12px;

    padding: 1.5rem;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

}



.card-narrow {

    max-width: 420px;

    margin-left: auto;

    margin-right: auto;

}



.nav-toggle {

    display: none;

    background: transparent;

    border: 1px solid #ddd;

    border-radius: 8px;

    padding: 0.35rem 0.6rem;

    font-size: 1.25rem;

    cursor: pointer;

}



.site-nav {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 0.75rem;

}



.site-nav a { color: var(--text); text-decoration: none; }



.nav-form-inline { display: inline; margin: 0; padding: 0; }

.nav-form-inline .btn-link { margin: 0; padding: 0; vertical-align: baseline; }



.mt-16 { margin-top: 1rem; }

.muted { color: #555; font-size: 0.95rem; }

.small { font-size: 0.875rem; }

.req { color: #b33; font-weight: 600; }



.status-ok { color: var(--ok); }

.status-warn { color: var(--warn); }



.next-steps { margin-top: 1rem; padding-left: 1.25rem; }



code {

    background: #eee;

    padding: 0.1em 0.35em;

    border-radius: 4px;

    font-size: 0.9em;

}



.btn {

    display: inline-block;

    padding: 0.55rem 1rem;

    border-radius: 8px;

    border: 1px solid #ccc;

    background: var(--card);

    color: var(--text);

    text-decoration: none;

    cursor: pointer;

    font-size: 1rem;

}



.btn-primary {

    background: var(--accent);

    border-color: var(--accent);

    color: #fff;

}



.btn-block { width: 100%; text-align: center; }



.btn-outline {

    border-color: #999;

    background: #fafafa;

}



.btn-link {

    border: none;

    background: none;

    color: var(--accent);

    text-decoration: underline;

    padding: 0.25rem 0.35rem;

    font-size: inherit;

}



.form-footer {

    margin-top: 1rem;

    font-size: 0.9rem;

    color: #555;

}



.form-stack label { display: block; margin-bottom: 0.75rem; }

.form-grid fieldset {

    margin: 0 0 1.25rem 0;

    padding: 0;

    border: none;

}



.form-grid legend {

    font-weight: 700;

    margin-bottom: 0.75rem;

    font-size: 1.05rem;

}



.field-span { grid-column: 1 / -1; }



.label {

    display: block;

    font-size: 0.9rem;

    margin-bottom: 0.85rem;

}



.input {

    display: block;

    width: 100%;

    margin-top: 0.25rem;

    padding: 0.55rem 0.65rem;

    border: 1px solid #cfc8bc;

    border-radius: 8px;

    font-size: 1rem;

}



.form-grid {

    display: grid;

    grid-template-columns: 1fr;

}



.alert {

    list-style: none;

    padding: 0.75rem 1rem;

    margin: 0 0 1rem 0;

    border-radius: 8px;

}



.alert-error {

    background: #fdeceb;

    color: #7a2318;

}



.alert-info {

    background: #eaf4ff;

    color: #0d3d6b;

}



.def-list dt { font-weight: 600; margin-top: 0.65rem; }

.def-list dd { margin: 0; }



.quote {

    margin: 0;

    padding: 1rem;

    background: #f3f3f3;

    border-radius: 8px;

    border-left: 4px solid var(--accent);

}



.applicant-card {

    border-top: 1px solid #e5e0d8;

    padding-top: 1rem;

    margin-top: 1rem;

}



.applicant-head {

    display: flex;

    flex-direction: column;

    gap: 0.25rem;

}



.admin-actions {

    margin-top: 1rem;

    display: flex;

    flex-direction: column;

    gap: 1rem;

}



.inline-form-grow {

    display: flex;

    flex-wrap: wrap;

    gap: 0.5rem;

    align-items: stretch;

}



.inline-select { flex: 1 1 200px; }



.reject-form {

    display: flex;

    flex-wrap: wrap;

    gap: 0.5rem;

    align-items: center;

}



.reject-form .input {

    flex: 1 1 220px;

    margin-top: 0;

}



.sr-only {

    position: absolute;

    width: 1px;

    height: 1px;

    overflow: hidden;

    clip: rect(0 0 0 0);

    white-space: nowrap;

}



@media (max-width: 640px) {

    .nav-toggle { display: inline-block; }

    .site-nav {

        width: 100%;

        flex-direction: column;

        align-items: flex-start;

        max-height: 0;

        overflow: hidden;

    }



    .site-nav.open {

        max-height: min(90vh, 720px);


        margin-top: 0.5rem;

        padding-bottom: 0.5rem;

        border-bottom: 1px solid #e5e0d8;

    }



    .site-header { gap: 0.5rem; align-items: flex-start; flex-direction: row; justify-content: space-between; }

}



@media (min-width: 641px) {

    .site-nav { justify-content: flex-end; align-items: center; }

}


.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tab {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid #cfc8bc;
    background: var(--card);
    font-size: 0.9rem;
}
.tab-active {
    border-color: var(--accent);
    background: #fff5ef;
    font-weight: 600;
}
.table-responsive { overflow-x: auto; margin-top: 0.5rem; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th,
.data-table td {
    padding: 0.5rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #e5e0d8;
}
.data-table th {
    font-weight: 600;
    background: #faf8f5;
}
.inline-role-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.compact-select {
    max-width: 240px;
    display: inline-block;
    margin-top: 0;
}
.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}
.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: capitalize;
}
.badge-approved { background: #e8f5e9; color: #1b5e20; }
.badge-pending { background: #fff8e1; color: #8a6d00; }
.badge-rejected { background: #ffebee; color: #c62828; }

.error-list { color: #a22; padding-left: 1.35rem; }
.fieldset-block { margin: 0 0 1.25rem; padding: 0; border: 1px solid #e5e0d8; border-radius: 10px; padding: 0.75rem 1rem 1rem; }
.fieldset-block legend { font-weight: 600; padding: 0 0.35rem; }
.card-subtle { background: #faf8f5; padding: 0.65rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.95rem; }
.form-grid-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem 1rem; align-items: start; }
.field-span-wide { grid-column: 1 / -1; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; }
.checkbox-label input { margin-top: 0.25rem; }
.donor-suggest { list-style: none; margin: 0 0 0.75rem; padding: 0; border: 1px solid #dfc; background: #f9fff5; border-radius: 8px; max-height: 14rem; overflow: auto; }
.donor-suggest-item { padding: 0.45rem 0.65rem; cursor: pointer; border-bottom: 1px solid #e8ebe0; }
.donor-suggest-item:last-child { border-bottom: none; }
.donor-suggest-item:focus { outline: 2px solid var(--accent); }
.payment-line-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.card-inner { background: #fcfbfa; border: 1px solid #eae5de; border-radius: 10px; padding: 1rem 1rem 1.25rem; margin-bottom: 1rem; }
.inline-label select { margin-top: 0.35rem; }
.grid-cols-pay { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.65rem; }
.compact-def dt { margin-top: 0.35rem; }
.inline-mini-form { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: flex-end; margin-top: 0.75rem; }
.finance-edit summary { cursor: pointer; font-weight: 600; margin-top: 0.75rem; }
.donation-line-detail h3 { font-size: 1.05rem; margin: 0 0 0.5rem 0; }

.finance-subnav { font-size: 0.925rem; margin: 0.5rem 0 1rem; }
.finance-subnav a { color: var(--accent); }
.directory-search-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; }
.directory-search-field { flex: 1 1 220px; min-width: 200px; }
.filters-row-inline { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: flex-end; margin-bottom: 1rem; }
.table-wide-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stripe-table tbody tr:nth-child(even):not(.muted-row) { background: #faf9f7; }
.muted-row td { padding-top: 0.35rem !important; padding-bottom: 0.65rem !important; font-size: 0.88rem !important; color: #555 !important; border-bottom: none !important; }
.table-compact-mini th,
.table-compact-mini td { font-size: 0.82rem; padding: 0.35rem 0.45rem; }
.compact-meta dt { margin-top: 0.35rem; }
.compact-meta dd { margin-left: 0; }

/* Donation register: contactable days × time slots */
.contact-sched-wrap { overflow-x: auto; margin-top: 0.45rem; -webkit-overflow-scrolling: touch; }
table.contact-sched { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.8125rem; }
table.contact-sched th,
table.contact-sched td {
    border: 1px solid #e2ddd4;
    padding: 0.35rem 0.4rem;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}
table.contact-sched thead th.contact-sched-corner { border-right: none; background: transparent; border-top: none; border-left: none; }
table.contact-sched thead th.contact-sched-slot-head {
    font-weight: 600;
    background: #f6f4f0;
    white-space: nowrap;
}
table.contact-sched .contact-sched-day-head {
    text-align: left;
    font-weight: 600;
    background: #faf8f5;
    white-space: nowrap;
    border-left: 1px solid #e2ddd4;
}
table.contact-sched .contact-sched-cell { padding: 0.25rem; }
table.contact-sched input.contact-sched-cb { width: 1.05rem; height: 1.05rem; cursor: pointer; margin: 0; }
.label-text { display: block; font-weight: 600; margin-bottom: 0.2rem; }

.approval-pending-banner {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fff8e6;
    border: 1px solid #e9d8a3;
    border-radius: 8px;
}

table.diff-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 0.5rem 0 0.25rem;
}
table.diff-mini-table th,
table.diff-mini-table td {
    border: 1px solid #e2ddd4;
    padding: 0.35rem 0.45rem;
    vertical-align: top;
}
table.diff-mini-table th { background: #faf8f5; text-align: left; }
table.diff-mini-table .diff-before { background: #fce8e8; }
table.diff-mini-table .diff-after { background: #e8f5e9; }

.approval-review-card { margin-bottom: 1rem; }
.approval-actions-row { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: flex-end; margin-top: 0.75rem; }
.inline-form-mini { display: inline; }
.reject-details { flex: 1 1 240px; }
.reject-details summary { cursor: pointer; }
.rejection-form { margin-top: 0.35rem; max-width: 32rem; }

.approvals-out-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.approval-out-card {
    border: 1px solid #eae5de;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.65rem;
}
.mini-diff-shell { margin-top: 0.5rem; overflow-x: auto; }
.mt-24 { margin-top: 1.5rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }

/* Header flyouts: hover + focus-within on desktop; tap to toggle on mobile (see main layout script) */
.nav-flyout {
    position: relative;
}
.nav-flyout-btn {
    cursor: pointer;
    background: transparent;
    border: none;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    padding: 0.35rem 0;
    text-align: inherit;
}
.nav-flyout-panel {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0 0 0.75rem;
}
.nav-flyout-panel a {
    color: var(--text);
    text-decoration: none;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}
.nav-flyout-panel a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 640px) {
    .nav-flyout-panel {
        display: none;
    }
    .nav-flyout.is-open .nav-flyout-panel {
        display: flex;
    }
}

@media (min-width: 641px) {
    .nav-flyout {
        align-self: center;
    }
    .nav-flyout-panel {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 14rem;
        padding: 0.45rem 0.65rem;
        margin: 0;
        margin-top: 2px;
        background: var(--card);
        border: 1px solid #e5e0d8;
        border-radius: 10px;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
        z-index: 100;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.12s ease, visibility 0.12s ease;
    }
    /* Invisible hover bridge so pointer can move from button to panel */
    .nav-flyout-panel::before {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        height: 14px;
    }
    .nav-flyout:hover .nav-flyout-panel,
    .nav-flyout-panel:focus-within {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-flyout-panel a {
        padding: 0.42rem 0.4rem;
        border-radius: 6px;
        font-size: 0.88rem;
    }
    .nav-flyout-panel a:hover {
        background: #faf8f5;
        text-decoration: none;
    }
    .nav-flyout:hover > .nav-flyout-btn {
        color: var(--accent);
    }
}

/* Donation dashboard chart filters */
.form-inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin: 1rem 0 0.5rem;
}

.label.inline-label {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0;
}

.input.input-narrow {
    max-width: 8.5rem;
}

.donation-chart-card .chart-canvas-wrap {
    margin-top: 1rem;
    position: relative;
    max-height: min(56vh, 420px);
}

.h3-like {
    font-size: 1.125rem;
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.5rem;
}

.data-table-compact th,
.data-table-compact td {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
}

.expense-approval-path .expense-tier-preview-line {
    margin: 0 0 0.75rem;
    min-height: 1.25em;
}
