:root { color-scheme: light; --green: #16634a; --ink: #163e32; --muted: #65766e; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f6f8f5; color: var(--ink); font-family: 'Noto Sans Bengali', sans-serif; line-height: 1.8; }
.page-shell a { color: var(--green); text-decoration: none; }
.page-shell a:hover { text-decoration: underline; }
.page-shell button, .page-shell select { font: inherit; }
.page-shell button, .page-shell .receipt-link { cursor: pointer; border: 1px solid #d5e2da; border-radius: 10px; padding: 9px 17px; background: white; color: var(--green); font-weight: 600; }
.page-shell button:hover, .page-shell .receipt-link:hover { background: #eaf2ec; }
.page-shell .receipt-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.page-shell button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid #ba891b; outline-offset: 4px; }




.page-shell { color: var(--ink); max-width: 1120px; margin: 128px auto 72px; line-height: 1.7; padding: 0 24px; }
.eyebrow { color: var(--green); font-weight: 600; margin-bottom: 8px; }
.page-shell h1 { font-weight: 700; font-size: clamp(30px, 4vw, 44px); margin: 0; letter-spacing: -.04em; }
.page-shell h2 { font-weight: 700; font-size: 24px; margin: 0; }
.page-shell p { margin: 10px 0; }
.muted { color: var(--muted); font-size: 14px; }
#message:not(:empty) { padding: 24px; background: white; border: 1px solid #dbe5dc; border-radius: 14px; margin: 24px 0; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 32px 0 44px; }
.summary article { padding: 24px; background: white; border: 1px solid #dde7df; border-radius: 18px; }
.summary article:first-child { background: var(--green); color: white; border-color: var(--green); }
.summary span { display: block; font-size: 14px; }
.summary strong { display: block; margin-top: 12px; font-size: clamp(20px, 2.5vw, 29px); overflow-wrap: anywhere; }
.history-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 28px; margin: 30px 0 24px; }
.history-copy h2 { margin: 0; }
.page-shell .history-copy .muted { max-width: none; margin: 6px 0 0; line-height: 1.65; }
.history-toolbar .filters { grid-column: 2; grid-row: 1 / span 2; }
.filters { display: flex; gap: 12px; }
.filters label { font-size: 13px; }
.page-shell select { display: block; border: 1px solid #d5e2da; border-radius: 9px; padding: 9px 12px; background: white; color: var(--ink); }
.history-list { display: grid; gap: 12px; margin-top: 20px; }
.donation-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 26px; background: white; border: 1px solid #dde7df; border-radius: 16px; padding: 22px 24px; }
.donation-row h3 { margin: 4px 0; font-size: 18px; }
.donation-row time { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; border-radius: 6px; padding: 2px 8px; background: #eef4ef; color: var(--green); font-size: 12px; }
.donation-amount { font-size: 23px; white-space: nowrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 28px; }
.receipt-shell { max-width: 850px; }
.receipt-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 22px; }
#print { background: var(--green); color: white; }
.receipt { padding: 42px; background: white; border: 1px solid #d8e3db; border-radius: 14px; }
.receipt-brand { text-align: center; }
.receipt-brand img { display: block; margin-inline: auto; width: 72px; height: 72px; object-fit: contain; }
.receipt-brand h1 { font-size: 28px; }
.receipt-brand p { font-size: 13px; color: var(--muted); margin: 4px; }
.receipt-title { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 2px solid var(--green); border-bottom: 1px solid #d8e3db; padding: 20px 0; margin-top: 26px; }
.page-shell dl { display: grid; grid-template-columns: 150px 1fr; gap: 15px; margin: 28px 0; }
.page-shell dt { color: var(--muted); }
.page-shell dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.receipt-amount { padding: 20px; border: 1px solid #cfdfd3; background: #f4f8f4; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.receipt-amount strong { font-size: 27px; }
#receipt-notice { margin-top: 22px; }
.receipt-thanks { text-align: center; margin-top: 32px; }
.receipt-footnote { color: var(--muted); font-size: 12px; text-align: center; border-top: 1px solid #d8e3db; padding-top: 18px; }
/* Donor identity uses the same quiet surfaces as the public website. */
.donor-profile { display: flex; align-items: center; gap: 24px; padding: 26px 28px; margin-top: 22px; border: 1px solid #e8e4d9; border-radius: 18px; background: var(--surface); }
.profile-avatar { width: 96px; height: 96px; flex: 0 0 96px; border: 4px solid var(--paper); border-radius: 50%; overflow: hidden; background: var(--surface-sage); box-shadow: 0 0 0 1px #dce4d6; }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--primary); font-size: 34px; }
.profile-details { min-width: 0; }
.page-shell .profile-label { margin: 0 0 5px; color: var(--body-text); font-size: 13px; }
.page-shell .donor-profile h1 { font-size: clamp(22px, 3vw, 32px); line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }
.page-shell .profile-member-id { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; color: var(--body-text); font-size: 14px; }
.profile-member-id strong { color: var(--primary-dark); font-weight: 600; letter-spacing: .04em; }
@media (max-width: 600px) {
    .donor-profile { gap: 16px; padding: 20px 16px; }
    .profile-avatar { width: 68px; height: 68px; flex-basis: 68px; border-width: 3px; }
    .profile-avatar span { font-size: 26px; }
    .page-shell .donor-profile h1 { font-size: 22px; }
}

/* Use the public website palette throughout the donor history page. */
body[data-page="history"] {
    --green: var(--primary);
    --ink: var(--heading-text);
    --muted: var(--body-text);
    --donor-border: #e8e4d9;
    background: var(--paper);
}
body[data-page="history"] .page-shell h1,
body[data-page="history"] .page-shell h2,
body[data-page="history"] .donation-amount { color: var(--primary-dark); }
body[data-page="history"] .eyebrow { color: var(--body-text); border-color: var(--gold); }
body[data-page="history"] .summary article,
body[data-page="history"] .donation-row,
body[data-page="history"] #message:not(:empty) {
    background: var(--surface);
    border-color: var(--donor-border);
}
body[data-page="history"] .summary article:first-child {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}
body[data-page="history"] .summary article:nth-child(2) { background: var(--surface-sage); }
body[data-page="history"] .summary article:nth-child(3) { background: var(--surface-warm); }
body[data-page="history"] .page-shell button,
body[data-page="history"] .page-shell select {
    background: var(--surface);
    border-color: var(--donor-border);
    color: var(--primary-dark);
}
body[data-page="history"] .page-shell .receipt-link {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}
body[data-page="history"] .page-shell .receipt-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}
body[data-page="history"] .page-shell button:hover { background: var(--surface-sage); }
body[data-page="history"] .badge { background: var(--surface-sage); color: var(--primary); }
body[data-page="history"] .page-shell :focus-visible { outline-color: var(--gold); }
@media (max-width: 600px) {



    .page-shell { padding: 0 16px; margin-top: 110px; }
    .summary { gap: 10px; grid-template-columns: 1fr; margin-bottom: 28px; }
    .summary article { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .summary strong { margin: 0; font-size: 21px; }
    .history-toolbar { grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 26px 0 18px; }
    .history-toolbar .filters { grid-column: 1; grid-row: auto; }
    .page-shell .history-copy .muted { max-width: none; }
    .filters label { flex: 1; min-width: 0; }
    .page-shell select { width: 100%; }
    .donation-row { grid-template-columns: 1fr auto; gap: 14px; padding: 18px; }
    .donation-amount { font-size: 20px; }
    .receipt-link { grid-column: 1 / -1; text-align: center; }
    .pagination { gap: 10px; font-size: 12px; }
    .pagination button { padding: 8px 10px; }
    .receipt { padding: 22px; }
    .page-shell dl { grid-template-columns: 95px 1fr; gap: 12px; font-size: 14px; }
    .receipt-amount { flex-wrap: wrap; }
}
/* Match the donation page on screen while retaining a plain print layout. */
@media screen {
    body[data-page="receipt"] {
        --green: var(--primary);
        --ink: var(--heading-text);
        --muted: var(--body-text);
        background: var(--paper);
    }
    body[data-page="receipt"] .receipt,
    body[data-page="receipt"] #message:not(:empty) {
        background: var(--surface);
        border-color: #e8e4d9;
    }
    body[data-page="receipt"] .receipt { border-radius: 18px; }
    body[data-page="receipt"] .page-shell h1,
    body[data-page="receipt"] .page-shell h2,
    body[data-page="receipt"] #receipt-number,
    body[data-page="receipt"] .receipt-amount { color: var(--primary-dark); }
    body[data-page="receipt"] .receipt-title { border-top-color: var(--gold); border-bottom-color: #e8e4d9; }
    body[data-page="receipt"] .receipt-amount { background: var(--surface-sage); border-color: #dce4d6; border-radius: 12px; }
    body[data-page="receipt"] .receipt-footnote { border-color: #e8e4d9; }
    body[data-page="receipt"] .receipt-actions a { color: var(--primary-dark); }
    body[data-page="receipt"] #print { background: var(--primary-dark); border-color: var(--primary-dark); }
    body[data-page="receipt"] #print:hover { background: var(--primary); border-color: var(--primary); }
    body[data-page="receipt"] #retry { background: var(--surface); border-color: #e8e4d9; color: var(--primary-dark); }
    body[data-page="receipt"] .page-shell :focus-visible { outline-color: var(--gold); }
}
@media print {
    @page { size: A4; margin: 16mm; }
    body { background: white; color: black; }
    .glass-nav, #mobileMenu, .site-footer, .receipt-actions, #message, #retry { display: none !important; }
    .page-shell { max-width: none; margin: 0; padding: 0; }
    .receipt { border: 0; border-radius: 0; padding: 0; }
    .receipt-amount, .receipt-title { break-inside: avoid; }
    .receipt-footnote, .receipt-thanks { break-inside: avoid; }
}

.receipt-tools { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.page-shell .download-link { padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--primary-dark); text-decoration: underline; text-underline-offset: 5px; }
.page-shell .download-link:hover { background: transparent; color: var(--primary); }
