:root{
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #5B667A;
  --border: rgba(15, 23, 42, 0.10);

  --brand: #0B2A5B;
  --brand2:#0EA5E9;
  --danger:#EF4444;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(2,6,23,0.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background: var(--bg);
}

.container{ max-width: 1050px; margin: 0 auto; padding: 0 18px; }

.header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(90deg, var(--brand), #08306A);
  color:#fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.header-inner{ display:flex; align-items:center; justify-content:space-between; padding: 14px 0; }

.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  width:44px; height:44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand2), #60A5FA);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; letter-spacing:0.5px;
  box-shadow: 0 8px 18px rgba(14,165,233,0.35);
}
.brand-name{ font-weight:800; letter-spacing: 1px; }
.brand-sub{ font-size: 12px; opacity:0.85; margin-top:2px; }

.nav{ display:flex; gap: 10px; }
.nav-link{
  color:#fff; text-decoration:none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}
.nav-link:hover{ background: rgba(255,255,255,0.10); }

.page{ padding: 22px 0 40px; }

.hero{
  border-radius: var(--radius);
  padding: 18px;
  background: radial-gradient(1200px 400px at 10% 0%, rgba(14,165,233,0.22), transparent 55%),
              radial-gradient(1000px 350px at 80% 10%, rgba(34,197,94,0.16), transparent 55%),
              linear-gradient(180deg, #ffffff, #ffffff);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.hero h1{ margin: 0 0 6px; font-size: 26px; letter-spacing: -0.3px; }
.hero p{ margin: 0; color: var(--muted); }

.badges{ margin-top: 12px; display:flex; flex-wrap:wrap; gap:8px; }
.badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  max-width: 720px;
}

.row{ display:flex; flex-direction:column; margin-bottom: 12px; }
label{ font-size: 12px; color: var(--muted); margin: 0 0 6px; }
input{
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  outline: none;
}
input:focus{
  border-color: rgba(14,165,233,0.45);
  box-shadow: 0 0 0 4px rgba(14,165,233,0.12);
}

.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px){ .grid2{ grid-template-columns: 1fr; } }

.divider{ height:1px; background: var(--border); margin: 14px 0; }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  width: 100%;
  border: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #0B3B8A);
  color:#fff;
  cursor:pointer;
  text-decoration:none;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 12px 22px rgba(11,42,91,0.20);
}
.btn:hover{ filter: brightness(1.02); }
.btn:active{ transform: translateY(1px); }

.btn-secondary{
  background: linear-gradient(135deg, #0EA5E9, #2563EB);
  box-shadow: 0 12px 22px rgba(14,165,233,0.20);
}

.hint{ margin-top: 10px; font-size: 13px; color: var(--muted); }
.hint.ok{ color: #0F7A3A; }
.hint.err{ color: var(--danger); }

.kv{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 12px;
}
.k{ color: var(--muted); font-size: 12px; }
.v{ font-weight: 700; word-break: break-all; }

.actions{ margin-top: 14px; display:grid; gap:10px; }

.footer{
  margin-top: 34px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  background: #fff;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.dot{ opacity:0.5; }

/* ================= Receipt Theme ================= */
.receipt-wrap{
  min-height: calc(100vh - 120px);
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding: 32px 12px;
  background: linear-gradient(180deg, #F6F8FF 0%, #FFFFFF 55%, #F6F8FF 100%);
}
.receipt-shell{
  width: min(980px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(11,42,91,0.12);
  overflow: hidden;
}
.receipt-topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 18px;
  padding: 20px 22px;
  background: radial-gradient(1200px 260px at 10% 0%, rgba(37,99,235,0.15) 0%, rgba(37,99,235,0) 70%),
              radial-gradient(800px 220px at 85% 0%, rgba(14,165,233,0.18) 0%, rgba(14,165,233,0) 65%),
              linear-gradient(180deg, #FFFFFF 0%, #FBFCFF 100%);
  border-bottom: 1px solid var(--border);
}
.badge-success,.badge-info{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-success{ background: rgba(34,197,94,0.12); color: #0F7A3A; border: 1px solid rgba(34,197,94,0.25);} 
.badge-info{ background: rgba(37,99,235,0.10); color: #1D4ED8; border: 1px solid rgba(37,99,235,0.22);} 
.receipt-title{ margin: 10px 0 0 0; font-size: 22px; font-weight: 900; color: var(--ink); }
.receipt-sub{ margin: 6px 0 0 0; font-size: 13px; color: var(--muted); }
.receipt-actions{ display:flex; flex-wrap:wrap; gap: 10px; }
.btn-ghost{
  appearance:none; border: 1px solid var(--border);
  background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 12px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(11,42,91,0.08);
  cursor:pointer; text-decoration:none;
}
.btn-ghost:hover{ filter: brightness(0.99); }

.receipt-body{ padding: 18px 22px 22px 22px; }
.receipt-grid{ display:grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.receipt-card{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFF 100%);
}
.receipt-card h3{ margin: 0 0 10px 0; font-size: 14px; font-weight: 900; color: var(--ink); }
.r-row{ display:flex; justify-content:space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(15,23,42,0.12);} 
.r-row:last-child{ border-bottom: none; }
.r-k{ color: var(--muted); font-size: 12px; }
.r-v{ font-weight: 900; color: var(--ink); text-align:right; word-break: break-word; }
.amt{ font-size: 18px; }
.muted{ color: var(--muted); }
.receipt-table{ width:100%; border-collapse:collapse; margin-top: 14px; }
.receipt-table th, .receipt-table td{ padding: 10px 12px; border-bottom: 1px solid rgba(15,23,42,0.08); font-size: 13px; }
.receipt-table th{ text-align:left; color: var(--muted); font-weight: 900; font-size: 12px; letter-spacing: 0.3px; text-transform: uppercase; }
.receipt-table td:last-child, .receipt-table th:last-child{ text-align:right; }

.due-box {
    margin: 10px 0 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: radial-gradient(900px 260px at 20% 0%, rgba(14,165,233,0.16), transparent 55%), linear-gradient(180deg, #ffffff, #ffffff);
}

.due-label {
    font-size: 12px;
    color: var(--muted);
}

.due-value {
    font-size: 26px;
    font-weight: 900;
    margin-top: 4px;
    color: var(--brand);
}


.qr-box{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  border: 1px dashed rgba(37,99,235,0.35);
  border-radius: 16px;
  padding: 14px;
  background: rgba(37,99,235,0.03);
}
.qr-box img{ width: 180px; height: 180px; border-radius: 12px; border: 1px solid rgba(15,23,42,0.08); background:#fff; }
.qr-note{ margin-top: 10px; font-size: 12px; color: var(--muted); text-align:center; }
.receipt-footer{
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap: 10px;
  background:#fff;
}
.receipt-footer .small{ font-size: 12px; color: var(--muted); }

@media (max-width: 860px){
  .receipt-topbar{ flex-direction:column; }
  .receipt-grid{ grid-template-columns: 1fr; }
}

@media print{
  .navbar, .footer, .receipt-actions{ display:none !important; }
  body{ background:#fff !important; }
  .receipt-wrap{ padding:0 !important; }
  .receipt-shell{ box-shadow:none !important; border:none !important; }
}

/* Print layout */
@media print {

    @page {
        size: A4;
        margin: 12mm;
    }

    .navbar, .footer, .receipt-actions {
        display: none !important;
    }

    body {
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 0;
    }

    .receipt-shell {
        box-shadow: none !important;
    }
}
