/* Customer loan page (my-loan.php). Uses the colour variables from style.css. */
.loan-page { background: var(--color-bg-light); color: var(--color-text); font-family: 'Inter', system-ui, sans-serif; margin: 0; }
.loan-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.loan-head { background: var(--color-primary); color: #fff; padding: 14px 0; margin-bottom: 16px; }
.loan-head .loan-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.loan-head a { color: var(--color-accent); text-decoration: underline; }
.loan-card { background: #fff; border: 1px solid var(--color-border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.loan-card h1 { font-size: 1.4rem; margin: 0.1rem 0; }
.loan-card h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.loan-muted { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }
.loan-banner { border-radius: 8px; padding: 10px 12px; font-weight: 600; margin: 12px 0; }
.loan-ok { background: #ecfdf5; color: #065f46; }
.loan-late { background: #fef2f2; color: #991b1b; }
.loan-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.loan-stats > div { background: var(--color-bg-light); border-radius: 8px; padding: 10px; }
.loan-stats span { display: block; font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.3; }
.loan-stats strong { display: block; font-size: 1.2rem; margin-top: 4px; }
.loan-stats small { color: var(--color-text-muted); }
.loan-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.loan-dl dt { color: var(--color-text-muted); }
.loan-dl dd { margin: 0; font-weight: 600; text-align: right; }
.loan-table-wrap { overflow-x: auto; }
.loan-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.loan-table th, .loan-table td { padding: 8px 6px; border-bottom: 1px solid var(--color-border); text-align: left; white-space: nowrap; }
.loan-table th { font-size: 0.78rem; color: var(--color-text-muted); font-weight: 600; }
.loan-pill { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--color-bg-light); }
.is-paid .loan-pill { background: #d1fae5; color: #065f46; }
.is-overdue .loan-pill { background: #fee2e2; color: #991b1b; }
.is-overdue td { color: #991b1b; }
.is-part .loan-pill { background: #e0f2fe; color: #075985; }
.loan-contact { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.loan-contact p { margin: 0; flex-basis: 100%; }
@media (min-width: 600px) { .loan-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.loan-form { display: grid; gap: 6px; max-width: 360px; margin-top: 12px; }
.loan-form label { font-size: 0.85rem; font-weight: 600; margin-top: 6px; }
.loan-form input { font-size: 1.1rem; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; }
.loan-form button { margin-top: 10px; }
.loan-error { color: #991b1b; background: #fef2f2; border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }
.loan-inline { margin-top: 10px; }
.loan-pay-btn { display: inline-block; font-size: 1.05rem; padding: 12px 20px; }
.loan-qr { display: block; width: 220px; max-width: 100%; height: auto; margin: 8px 0 12px; border: 1px solid var(--color-border); border-radius: 8px; }
.loan-pay .loan-dl { margin-top: 8px; }
@media print {
  .loan-page { background: #fff; }
  .loan-head { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .loan-pay, .loan-contact, .loan-card form { display: none !important; }
  .loan-card { border: 0; padding: 0 0 8px; break-inside: avoid; }
}
.loan-foot { font-size: 0.8rem; color: var(--color-text-muted); padding: 8px 16px 24px; }
.loan-foot a { color: var(--color-primary); text-decoration: underline; }
