*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:#06080d;color:#1e293b;line-height:1.5;min-height:100vh;display:flex;align-items:center;justify-content:center}
.wrap{width:100%;max-width:480px;padding:20px 14px;margin:auto}
.wrap.wide{max-width:850px}
.card{background:#ffffff;border:1px solid #e2e8f0;border-radius:24px;padding:36px 30px;box-shadow:0 25px 60px rgba(0,0,0,0.5);position:relative}

/* Top bar with brand and close button */
.card-top-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.brand{display:flex;align-items:center;gap:12px}
.brand-icon{width:40px;height:40px;background:linear-gradient(135deg, #4f46e5, #0ea5e9);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;box-shadow:0 4px 14px rgba(79, 70, 229, 0.3)}
.brand-name{font-size:22px;font-weight:800;color:#0f172a;letter-spacing:-0.02em;line-height:1.1}
.brand-name span{color:#4f46e5}
.brand-sub{font-size:11px;color:#64748b;font-weight:600;letter-spacing:0.02em;margin-top:2px}

.close-btn{width:32px;height:32px;border-radius:8px;background:#f8fafc;border:1px solid #e2e8f0;display:flex;align-items:center;justify-content:center;color:#64748b;text-decoration:none;transition:all 0.2s}
.close-btn:hover{background:#fee2e2;color:#ef4444;border-color:#fca5a5}

/* Invoice Header */
.inv-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid #f1f5f9}
.muted{color:#64748b;font-weight:500;font-size:13px}
.inv-no{font-size:22px;font-weight:800;color:#0f172a;letter-spacing:-0.01em;margin-top:2px}
.badge{font-size:11px;font-weight:700;padding:4px 12px;border-radius:999px;letter-spacing:.04em}
.badge.due{background:#fee2e2;color:#dc2626}
.badge.ok{background:#dcfce7;color:#15803d}

/* Details Rows */
.rowline{display:flex;justify-content:space-between;align-items:center;padding:14px 0;border-bottom:1px solid #f1f5f9;font-size:15px;color:#334155}
.row-label{color:#334155;font-weight:500}
.row-val strong{color:#0f172a}

/* Payment Box */
.pay-block{margin-top:24px}

/* Note */
.note{padding:12px 16px;border-radius:10px;margin:14px 0;font-size:13px;font-weight:500}
.note.ok{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}
.note.due{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}
.hidden{display:none}

.foot{text-align:center;color:#64748b;font-size:12px;margin:24px 0 0;font-weight:500}

/* Receipt Page */
.pv-inv{background:#fff;border:1px solid #e2e8f0;border-radius:20px;padding:36px 30px;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.pv-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px}
.pv-paid-badge{display:inline-block;background:#16a34a;color:#fff;text-transform:uppercase;font-size:12px;font-weight:800;letter-spacing:.06em;padding:5px 18px;border-radius:999px;box-shadow:0 2px 6px rgba(22,163,74,.25)}
.pv-table{width:100%;border-collapse:collapse;margin:20px 0}
.pv-table th,.pv-table td{padding:12px 14px;border-bottom:1px solid #f1f5f9;text-align:left;font-size:14px}
.pv-table th{background:#f8fafc;color:#64748b;font-weight:600}
.pv-table .tr{text-align:right}
.pv-thanks{text-align:center;color:#15803d;font-weight:600;margin:20px 0 16px;font-size:14.5px;padding:12px;background:#f0fdf4;border-radius:12px;border:1px solid #bbf7d0}

@media (max-width: 480px) {
  .wrap{padding:12px}
  .card{padding:26px 20px;border-radius:20px}
  .inv-no{font-size:19px}
  .brand-name{font-size:20px}
}
