/* PracticePilot — Student Purchase History (Phase 5), §18 of the spec.
   Strongly scoped under .ppilot-ph-*; reuses the SAME --ppilot-* tokens
   and .ppilot-dash-card/.ppilot-btn conventions already used across the
   student dashboard/admin screens — no new colors invented here.
   Responsive at 320/400/768/1440px, no horizontal overflow: the card
   grid collapses to a single column below 560px and the modal never
   exceeds the viewport width. */

.ppilot-ph-section { margin-bottom: 20px; }

.ppilot-ph-grid {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 560px) {
	.ppilot-ph-grid { grid-template-columns: 1fr; }
}

.ppilot-ph-card {
	border: 1px solid var(--ppilot-border); border-radius: 16px; padding: 16px;
	background: #fff; min-width: 0; display: flex; flex-direction: column; gap: 8px;
}

.ppilot-ph-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ppilot-ph-card-title { font-size: 14px; font-weight: 700; margin: 0; color: var(--ppilot-navy); line-height: 1.3; }
.ppilot-ph-card-exam { font-size: 12px; color: var(--ppilot-muted); margin: 0; }

.ppilot-ph-badge {
	display: inline-flex; align-items: center; flex-shrink: 0;
	font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
	padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.ppilot-ph-badge-active  { background: var(--ppilot-success-bg); color: var(--ppilot-success); }
.ppilot-ph-badge-expired { background: var(--ppilot-warning-bg); color: var(--ppilot-warning); }
.ppilot-ph-badge-pending { background: #eef2ff; color: #3730a3; }
.ppilot-ph-badge-failed  { background: var(--ppilot-danger-bg); color: var(--ppilot-danger); }
.ppilot-ph-badge-unknown { background: var(--ppilot-border); color: var(--ppilot-muted); }
/* §razorpay-refunds-lifecycle (Phase 6), §18 of the spec: a distinct,
   non-"success"/non-"failure" tone for a refund-state badge — it is
   informational only and never implies anything about current access
   (access is always a SEPARATE badge, computed from access_state). */
.ppilot-ph-badge-refund { background: #f3e8ff; color: #6b21a8; }

.ppilot-ph-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ppilot-ph-card-amount { font-size: 18px; font-weight: 800; color: var(--ppilot-ink); }
.ppilot-ph-card-date, .ppilot-ph-card-access { font-size: 12px; color: var(--ppilot-muted); margin: 0; }

.ppilot-ph-card-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ppilot-ph-card-actions a, .ppilot-ph-card-actions button { text-decoration: none; }

/* --- Detail modal ---------------------------------------------------- */
.ppilot-ph-modal-overlay {
	position: fixed; inset: 0; background: rgba(15, 15, 25, 0.55);
	display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10000;
}
.ppilot-ph-modal {
	background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 480px;
	max-height: 90vh; overflow-y: auto; position: relative; box-sizing: border-box;
}
.ppilot-ph-modal-close {
	position: absolute; top: 12px; right: 14px; border: none; background: transparent;
	font-size: 22px; line-height: 1; cursor: pointer; color: var(--ppilot-muted); padding: 4px;
}
.ppilot-ph-modal-title { font-size: 17px; font-weight: 800; margin: 0 0 14px; color: var(--ppilot-navy); }

.ppilot-ph-detail-headline { font-weight: 700; font-size: 14px; margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; display: inline-block; }

.ppilot-ph-detail-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 12px; margin: 0; }
.ppilot-ph-detail-list dt { font-size: 12px; color: var(--ppilot-muted); font-weight: 600; }
.ppilot-ph-detail-list dd { font-size: 13px; color: var(--ppilot-ink); margin: 0; word-break: break-word; }

.ppilot-ph-detail-actions { margin-top: 18px; display: flex; gap: 8px; }
.ppilot-ph-detail-actions a { text-decoration: none; }

@media (max-width: 400px) {
	.ppilot-ph-modal { padding: 18px; }
	.ppilot-ph-detail-list { grid-template-columns: 1fr; }
}
