.table-scroll { overflow: auto; max-height: 420px; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { position: sticky; top: 0; background: var(--heading); color: var(--primary-contrast); padding: 10px 8px; text-align: left; cursor: pointer; }
tbody td { padding: 8px 10px; border-top: 1px solid var(--border); background: #fff; }
tbody tr:nth-child(even) td { background: #f3f4f6; }
tbody tr:hover td { background: #fef3f2; }
th.num, td.num { text-align: right; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .5px; }
.pill-PAID { background: #107a2e; color: #fff; }
.pill-PENDING { background: #e7b008; color: #111; }
.pill-FAILED { background: #b42318; color: #fff; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
/* Detail card */
#detailCard { max-width: 640px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.detail-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.detail-item h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.detail-item p { margin: 0; font-size: 14px; font-weight: 600; }
/* Pager */
.pager { display: flex; justify-content: center; gap: 14px; align-items: center; margin-top: 12px; }
/* Sort indicator */
th.sort-asc::after { content: ' \25B2'; }
th.sort-desc::after { content: ' \25BC'; }

/* Generator specific receipt layout */
.generated-receipt { margin-top: 12px; }
.receipt-sheet { background:#fff; border:2px solid var(--border); border-radius:12px; padding:24px 26px; font-size:14px; line-height:1.4; box-shadow:0 6px 18px rgba(0,0,0,0.08); }
.receipt-head { display:flex; justify-content:space-between; align-items:flex-start; border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:18px; }
.receipt-head h3 { margin:0; font-size:20px; color: var(--heading); }
.id-block { text-align:right; font-size:12px; }
.party-block { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; margin-bottom:18px; }
.party-block h4 { margin:0 0 4px; font-size:13px; font-weight:600; color: var(--muted); }
.summary-table { width:100%; border-collapse:collapse; margin-bottom:14px; }
.summary-table th, .summary-table td { border:1px solid var(--border); padding:8px 10px; text-align:left; }
.summary-table thead th { background:#f1f5f9; font-size:12px; }
.summary-table tfoot th { background:#e2e8f0; }
.status-block { display:flex; flex-wrap:wrap; gap:20px; margin:14px 0 18px; font-size:13px; }
.notes-block h4 { margin:0 0 6px; font-size:13px; font-weight:600; color: var(--muted); }
.receipt-foot { margin-top:20px; text-align:center; }

/* Official simple conference receipt format */
.official-receipt { background:#fff; padding:40px 46px 32px; max-width:760px; margin:0 auto; border:1px solid var(--border); box-shadow:0 4px 12px rgba(0,0,0,.08); font-size:15px; line-height:1.5; }
.official-receipt .official-letterhead { display:flex; flex-direction:column; align-items:center; text-align:center; margin-bottom:24px; }
.official-receipt .official-letterhead img { max-width:100%; height:auto; margin-bottom:12px; }
.official-receipt #headerImg { max-width:680px; width:100%; height:auto; display:block; margin:0 auto 14px; }
.official-receipt #topLogo { max-width:546px; width:473px; height:auto; display:block; margin:0 auto 12px; }
@media print { .official-receipt #topLogo { width:102mm; max-width:none; } }
.official-receipt .official-letterhead .fallback-logo { font-size:34px; font-weight:700; margin-bottom:12px; }
.official-receipt .conf-lines strong { display:block; font-size:14px; margin-bottom:6px; }
.official-receipt h2 { margin:4px 0 6px; font-size:26px; letter-spacing:.5px; color:#7a1d19; }
.official-receipt .dates { font-size:13px; color:#7a1d19; font-weight:600; }
.official-receipt .title { text-align:center; letter-spacing:2px; margin:10px 0 28px; font-size:16px; }
.official-receipt p { margin:0 0 14px; }
.official-receipt p.dated { margin-top:28px; }
.official-receipt .fill { font-weight:600; min-width:120px; display:inline-block; }
.official-receipt .signature-block {
	margin:80px 0 16px;
	font-weight:600;
	display:flex;
	flex-direction:column;
	align-items:flex-end;
	text-align:right;
	min-height:120px;
}
.official-receipt .signature-block #sigImg {
	width:220px;
	height:auto;
	display:block;
	margin:0 0 6px 0;
	filter:contrast(1.1);
}
/* Removed dotted line under signature */
.official-receipt .sig-line { display:none; }
@media print { .official-receipt { box-shadow:none; border:none; padding:20mm 18mm 12mm; } body { background:#fff; } }

/* Center receipt container on page */
#receiptRoot, .generated-receipt { display: flex; justify-content: center; }
.official-receipt { margin: 18px auto; }

/* Ensure hidden raw receipt never shows */
#receiptRoot[hidden] { display: none !important; }

/* Print only the receipt on this page */
@media print {
	/* Remove layout transforms that can offset or hide content */
	.center-offset { transform: none !important; }

	/* Hide the UI and show only the generated receipt */
	h1, .form-card, #status, #outCard .actions, footer { display: none !important; }

	#outCard { box-shadow: none; border: 0; margin: 0; padding: 0; }
	#receiptRoot { display: block !important; }
}

/* Loading spinner */
.spinner { width:34px; height:34px; border:4px solid #d9d9d9; border-top-color:#7a1d19; border-radius:50%; animation:spin .9s linear infinite; margin:12px auto 4px; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Status emphasis when loading */
.loading-active #status { color:#7a1d19; font-weight:600; }
