/* Noor Academy — Donation portal front-end styles */

.noor-donation-portal {
	max-width: 860px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	color: #1d2327;
	line-height: 1.6;
}

.noor-donation-portal * {
	box-sizing: border-box;
}

/* ---- Toolbar (receipt view) ---- */
.noor-donation-view__toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	gap: 16px;
	flex-wrap: wrap;
}

.noor-donation-view__back {
	color: #1d5c2e;
	font-weight: 600;
	text-decoration: none;
}

.noor-donation-view__back:hover {
	color: #A8842F;
}

.noor-donation-view__print {
	background: #1d5c2e;
	color: #fff;
	padding: 10px 24px;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background .2s ease;
}

.noor-donation-view__print:hover {
	background: #164623;
}

/* ---- Access denied ---- */
.noor-donation-portal--denied {
	text-align: center;
	padding: 60px 20px;
}

.noor-donation-denied h2 {
	color: #b45309;
	margin-bottom: 8px;
}

.noor-donation-denied p {
	color: #5c6b64;
}

/* ---- Receipt (A4 landscape format, theme colors) ---- */
.noor-donation-receipt--landscape {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

.ndr-page {
	background: #fff;
	border: 2px solid #0B3D2E;
	border-radius: 6px;
	padding: 28px 32px;
	max-width: 1120px;
	margin: 0 auto;
	color: #1a2e27;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Header: logo + org | receipt number box */
.ndr-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	border-bottom: 2px solid #0B3D2E;
	padding-bottom: 12px;
}

.ndr-header__logo {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.ndr-header__logo img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	flex: 0 0 auto;
}

.ndr-header__title {
	min-width: 0;
}

.ndr-header__title h1 {
	margin: 0;
	color: #0B3D2E;
	font-size: 21px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.25;
}

.ndr-header__title p {
	margin: 3px 0 0;
	font-size: 13px;
	color: #3f5449;
	font-weight: 600;
}

.ndr-receipt-no {
	border: 2px solid #0B3D2E;
	border-radius: 4px;
	text-align: center;
	min-width: 170px;
	overflow: hidden;
	flex: 0 0 auto;
}

.ndr-receipt-no__title {
	background-color: #0B3D2E;
	color: #fff;
	font-size: 11px;
	font-weight: bold;
	padding: 3px 10px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ndr-receipt-no__value {
	font-size: 14px;
	font-weight: bold;
	color: #0B3D2E;
	padding: 6px 10px;
	background-color: #FBF8F1;
}

/* Banner title */
.ndr-banner {
	background-color: #0B3D2E;
	color: #fff;
	text-align: center;
	font-size: 16px;
	font-weight: bold;
	letter-spacing: 2px;
	padding: 7px 0;
	margin: 12px 0;
	border-radius: 3px;
}

/* Section headers */
.ndr-section-header {
	background-color: #FBF8F1;
	color: #08281E;
	font-size: 11px;
	font-weight: bold;
	padding: 4px 10px;
	border-left: 4px solid #C9A24B;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
}

/* Donor details grid */
.ndr-data-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 12px;
}

.ndr-data-table td {
	border: 1px solid #d8dcd9;
	padding: 7px 12px;
	font-size: 13px;
	vertical-align: middle;
}

.ndr-label {
	font-weight: bold;
	color: #08281E;
	width: 16%;
	background-color: #FBF8F1;
	white-space: nowrap;
}

.ndr-value {
	color: #1a2e27;
	font-weight: 500;
	width: 34%;
}

.ndr-sub {
	color: #3f5449;
	font-weight: 400;
	font-size: 12px;
}

.ndr-empty {
	color: #7d8a84;
}

/* Donation amount box — centered, words beneath the number */
.ndr-amount-box {
	border: 1px solid #d8dcd9;
	border-radius: 4px;
	padding: 10px 12px 12px;
	margin-bottom: 12px;
}

.ndr-amount-total {
	text-align: center;
	background: #FBF8F1;
	border: 1px solid #E0C479;
	border-radius: 10px;
	padding: 14px 28px;
}

.ndr-amount-total__number {
	display: block;
	font-size: 30px;
	color: #0B3D2E;
	line-height: 1.15;
}

.ndr-amount-total__words {
	display: block;
	font-size: 14px;
	color: #3f5449;
	font-style: italic;
	margin-top: 4px;
}

.ndr-amount-total__words strong {
	color: #0B3D2E;
}

/* Donation details: purpose / method / reference (one box) */
.ndr-details {
	border: 1px solid #d8dcd9;
	border-radius: 4px;
	padding: 10px 12px;
	margin-bottom: 12px;
}

.ndr-details__grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 10px 24px;
}

.ndr-detail {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ndr-detail__label {
	font-size: 11px;
	font-weight: bold;
	color: #08281E;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ndr-detail__value {
	font-size: 14px;
	color: #1a2e27;
	font-weight: 600;
	border-bottom: 1px dotted #8a958f;
	padding-bottom: 2px;
	overflow-wrap: anywhere;
}

/* Payment details rows (authorization) — one shared grid so the
   value lines align in a column across all rows (like the PDF). */
.ndr-payment {
	font-size: 12px;
	display: grid;
	grid-template-columns: max-content 1fr;
	column-gap: 8px;
	row-gap: 7px;
	align-items: end;
}

.ndr-payment__row {
	display: contents;
}

.ndr-payment__row strong {
	color: #08281E;
	white-space: nowrap;
}

.ndr-line {
	border-bottom: 1px dotted #8a958f;
	min-height: 15px;
	padding-bottom: 1px;
	color: #1a2e27;
	font-weight: 500;
}

.ndr-line--strong {
	font-weight: bold;
	color: #0B3D2E;
}

/* Notes */
.ndr-notes {
	margin-bottom: 12px;
}

.ndr-notes p {
	margin: 0;
	font-size: 12px;
	color: #2c3f37;
}

/* Authorization */
.ndr-auth {
	border: 1px solid #d8dcd9;
	border-radius: 4px;
	padding: 10px;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	min-width: 0;
	margin-bottom: 12px;
}

.ndr-auth__fields {
	width: 55%;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
}

.ndr-signature {
	width: 40%;
	border: 1px dashed #b9c2bd;
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fdfdfb;
	padding: 6px;
}

.ndr-signature__seal {
	max-width: 120px;
	max-height: 72px;
	object-fit: contain;
}

.ndr-signature__title {
	font-size: 10px;
	font-weight: bold;
	color: #0B3D2E;
	margin-top: 5px;
	border-top: 1px solid #d8dcd9;
	width: 90%;
	text-align: center;
	padding-top: 3px;
}

.ndr-signature__name {
	font-size: 10px;
	color: #3f5449;
	margin-top: 2px;
}

/* Footer banner */
.ndr-footer {
	background-color: #0B3D2E;
	color: #fff;
	font-size: 11px;
	text-align: center;
	padding: 7px 12px;
	border-radius: 3px;
	line-height: 1.4;
	margin-top: 2px;
}

.ndr-footer__retain em {
	color: #E0C479;
}

/* ---- Donor history ---- */
.noor-donation-history__header {
	text-align: center;
	margin-bottom: 28px;
}

.noor-donation-history__header h2 {
	color: #0B3D2E;
	margin-bottom: 4px;
}

.noor-donation-history__header p {
	color: #5c6b64;
	margin: 0 0 16px;
}

.noor-donation-history__total {
	display: inline-block;
	background: #FBF8F1;
	border: 1px solid #E0C479;
	border-radius: 10px;
	padding: 12px 28px;
}

.noor-donation-history__total span {
	display: block;
	font-size: 12px;
	color: #5c6b64;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.noor-donation-history__total strong {
	font-size: 24px;
	color: #0B3D2E;
}

.noor-donation-history__table,
.noor-donor-list__table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	overflow: hidden;
}

.noor-donation-history__table th,
.noor-donor-list__table th {
	text-align: left;
	padding: 12px 16px;
	background: #f8faf9;
	border-bottom: 2px solid #1d5c2e;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: #646970;
}

.noor-donation-history__table td,
.noor-donor-list__table td {
	padding: 14px 16px;
	border-bottom: 1px solid #f0f0f1;
	font-size: 14px;
}

.noor-donation-history__table a {
	color: #1d5c2e;
	font-weight: 600;
}

/* History pagination */
.noor-donation-history__pagination {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	margin-top: 16px;
	font-size: 13px;
	color: #5c6b64;
}

.noor-donation-history__pagination a {
	color: #1d5c2e;
	font-weight: 600;
	text-decoration: none;
	padding: 6px 14px;
	border: 1px solid #d8dcd9;
	border-radius: 6px;
	background: #fff;
	transition: border-color .2s ease, background .2s ease;
}

.noor-donation-history__pagination a:hover {
	border-color: #1d5c2e;
	background: #FBF8F1;
}

/* ---- Public donor list (faculty-style card grid) ---- */
.noor-donor-list__header {
	text-align: center;
	margin-bottom: 24px;
}

.noor-donor-list__header h2 {
	color: #0B3D2E;
	margin-bottom: 6px;
}

.noor-donor-list__header p {
	color: #5c6b64;
}

/* Search box */
.noor-donor-list__search {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-bottom: 32px;
	flex-wrap: wrap;
}

.noor-donor-list__search input[type="search"] {
	font-family: inherit;
	font-size: 1rem;
	padding: 12px 18px;
	border-radius: 999px;
	border: 1.5px solid #e4dcc8;
	background: #fff;
	color: #16241d;
	min-width: 260px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.noor-donor-list__search input[type="search"]:focus {
	outline: none;
	border-color: #1f6b4a;
	box-shadow: 0 0 0 4px rgba(45, 138, 99, .12);
}

.noor-donor-list__search-btn {
	font-family: inherit;
	font-weight: 600;
	font-size: .95rem;
	padding: 12px 24px;
	border-radius: 999px;
	cursor: pointer;
	border: 1.5px solid transparent;
	background: linear-gradient(180deg, #E0C479, #C9A24B);
	color: #052017;
	box-shadow: 0 6px 18px rgba(201, 162, 75, .32);
}

.noor-donor-list__search-clear {
	color: #5c6b64;
	font-size: .9rem;
}

.noor-donor-list__empty {
	text-align: center;
	color: #5c6b64;
	padding: 40px 0;
}

/* Card grid — mirrors the theme's .faculty__grid / .teacher cards */
.noor-donor-list__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
}

.noor-donor-list__card {
	background: #fff;
	border: 1px solid #e4dcc8;
	border-radius: 22px;
	padding: 32px 24px;
	text-align: center;
	box-shadow: 0 1px 2px rgba(11, 61, 46, .06), 0 2px 8px rgba(11, 61, 46, .05);
	transition: transform .28s ease, box-shadow .28s ease;
}

.noor-donor-list__card:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 50px rgba(6, 43, 33, .18);
}

.noor-donor-list__avatar {
	width: 92px;
	height: 92px;
	border-radius: 50%;
	margin: 0 auto 18px;
	display: grid;
	place-items: center;
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 600;
	font-size: 1.6rem;
	color: #fff;
	background: linear-gradient(160deg, #14532D, #062b21);
	box-shadow: 0 8px 20px rgba(11, 61, 46, .25), inset 0 0 0 3px rgba(201, 162, 75, .4);
}

.noor-donor-list__name {
	font-size: 1.16rem;
	margin: 0 0 4px;
	color: #062b21;
}

.noor-donor-list__subtext {
	font-size: .88rem;
	color: #A8842F;
	font-weight: 500;
	margin-bottom: 12px;
}

.noor-donor-list__total {
	font-size: 1.3rem;
	font-weight: 700;
	color: #0B3D2E;
}

.noor-donor-list__count {
	font-size: .85rem;
	color: #5c6b64;
	margin-top: 2px;
}

@media (max-width: 1024px) {
	.noor-donor-list__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
	.noor-donor-list__grid { grid-template-columns: 1fr; }
	.noor-donor-list__search input[type="search"] { min-width: 0; width: 100%; }
	.noor-donor-list__search { flex-direction: column; }
}

/* ---- Responsive (screen only — printing always uses the compact
       single-page layout regardless of device width) ---- */
@media screen and (max-width: 900px) {
	.ndr-details__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media screen and (max-width: 640px) {
	.ndr-page {
		padding: 18px 14px;
		font-size: 13px;
	}

	.ndr-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.ndr-receipt-no {
		align-self: stretch;
		min-width: 0;
	}

	.ndr-data-table {
		display: block;
	}

	.ndr-data-table tr {
		display: block;
	}

	.ndr-data-table td {
		display: block;
		width: auto !important;
		border: none;
		border-bottom: 1px solid #e4e8e5;
		padding: 4px 8px;
	}

	.ndr-data-table td.ndr-value {
		padding-bottom: 10px;
	}

	.ndr-data-table td[colspan] {
		padding-bottom: 10px;
	}

	.ndr-details__grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.ndr-amount-total__number {
		font-size: 26px;
	}

	.ndr-auth {
		flex-direction: column;
	}

	.ndr-auth__fields,
	.ndr-signature {
		width: 100%;
	}

	.ndr-signature__seal {
		max-width: 100px;
		max-height: 60px;
	}

	.noor-donation-history__table,
	.noor-donor-list__table {
		font-size: 12px;
	}

	.noor-donation-history__table th,
	.noor-donation-history__table td,
	.noor-donor-list__table th,
	.noor-donor-list__table td {
		padding: 8px 8px;
	}
}

/* ---- Print: only the receipt, one A4 portrait page ---- */
@media print {
	@page {
		size: A4 portrait;
		margin: 0;
	}

	body.noor-print-donation-receipt {
		background: #fff;
	}

	.noor-donation-view__toolbar {
		display: none !important;
	}

	/*
	 * Print only the receipt, never the whole page.
	 *
	 * The portal adds a noor-print-donation-receipt body class on the
	 * single receipt view.
	 *
	 * Modern engines (support :has()):
	 *   1. Every element that is not the document itself, is not inside
	 *      it and does not contain it (theme navbar, page hero, footer,
	 *      toolbar) is removed from the layout.
	 *   2. The remaining ancestors of the document are stripped of
	 *      their padding/margins/backgrounds so the document starts at
	 *      the top-left corner of the page and fits on one page.
	 *
	 * Older engines (no :has()):
	 *   Everything is hidden via visibility and the document is
	 *   overlaid at the top of the page.
	 */
	@supports selector(:has(*)) {
		body.noor-print-donation-receipt *:not(:has(.noor-donation-receipt)):not(.noor-donation-receipt):not(.noor-donation-receipt *) {
			display: none !important;
		}

		body.noor-print-donation-receipt *:has(.noor-donation-receipt) {
			padding: 0 !important;
			margin: 0 !important;
			border: none !important;
			background: none !important;
			box-shadow: none !important;
			max-width: none !important;
			width: auto !important;
		}
	}

	@supports not selector(:has(*)) {
		body.noor-print-donation-receipt * {
			visibility: hidden;
		}

		body.noor-print-donation-receipt .noor-donation-receipt,
		body.noor-print-donation-receipt .noor-donation-receipt * {
			visibility: visible;
		}

		body.noor-print-donation-receipt .noor-donation-receipt {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
		}
	}

	/* The receipt page fills the printable area with its own border. */
	body.noor-print-donation-receipt .noor-donation-receipt {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* Neutralize the portal max-width so the page spans the full sheet. */
	body.noor-print-donation-receipt .noor-donation-portal {
		max-width: none !important;
	}

	/* Compact spacing so everything fits one page even with long values. */
	.ndr-page {
		border: 2px solid #0B3D2E;
		border-radius: 0;
		box-shadow: none;
		max-width: none;
		width: 210mm;
		height: 297mm;
		padding: 8mm 10mm;
		box-sizing: border-box;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	.ndr-page > * {
		flex: 0 0 auto;
	}

	.ndr-banner {
		margin: 8px 0;
		padding: 5px 0;
	}

	.ndr-data-table {
		margin-bottom: 8px;
	}

	.ndr-data-table td {
		padding: 5px 10px;
		font-size: 11px;
	}

	.ndr-amount-box {
		margin-bottom: 8px;
		padding: 8px 10px 10px;
	}

	.ndr-amount-total {
		padding: 8px 20px;
	}

	.ndr-amount-total__number {
		font-size: 24px;
	}

	.ndr-amount-total__words {
		font-size: 12px;
		margin-top: 2px;
	}

	.ndr-details {
		margin-bottom: 8px;
		padding: 8px 10px;
	}

	.ndr-details__grid {
		grid-template-columns: 1fr 1fr 1fr;
		gap: 6px 16px;
	}

	.ndr-detail__value {
		font-size: 12px;
	}

	.ndr-notes {
		margin-bottom: 8px;
	}

	.ndr-auth {
		padding: 8px;
		margin-bottom: 8px;
	}

	.ndr-footer {
		padding: 5px 10px;
		font-size: 10px;
		margin-top: auto;
	}

	.ndr-page,
	.ndr-page * {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}
