:root{
  --bg0:#f8fafc;
  --bg1:#eef2ff;
  --card:#ffffff;
  --card2:#f8fafc;
  --border:rgba(15,23,42,.10);
  --text:#0f172a;
  --muted:#64748b;
  --brand:#16a34a;
  --brand2:#0ea5e9;
  --warn:#f59e0b;
  --danger:#ef4444;
  --shadow:0 16px 44px rgba(2,6,23,.08);
  --ring:0 0 0 4px rgba(22,163,74,.20);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1000px 650px at 10% -10%, rgba(22,163,74,.20) 0%, rgba(248,250,252,0) 60%),
    radial-gradient(1100px 700px at 95% 0%, rgba(14,165,233,.18) 0%, rgba(248,250,252,0) 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

a{color:var(--brand2);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1120px;margin:0 auto;padding:22px}
.app{min-height:100vh}

h1,h2,h3{margin:0 0 10px 0;letter-spacing:-.02em}
h1{font-size:28px}
h2{font-size:22px}
h3{font-size:18px}

.muted{color:var(--muted)}
.small{font-size:12px}

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

.card.soft{box-shadow:none;background:var(--card2)}

.row{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.stack{display:flex;flex-direction:column;gap:10px}
.grid{display:grid;gap:12px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}

@media (max-width:900px){
  .grid-3{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
}

.topbar{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:240px;
}
.logo{
  width:36px;height:36px;border-radius:12px;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow:0 10px 20px rgba(22,163,74,.16);
}
.brand-title{font-weight:700}

.navbar{
  position:sticky;
  top:0;
  z-index:50;
  margin-bottom:18px;
}
.navbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(14px);
  box-shadow:0 14px 40px rgba(2,6,23,.10);
}
.navbar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:240px;
  color:var(--text);
  text-decoration:none;
}
.navbar-brand:hover{text-decoration:none}
.navbar-menu{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  flex:1 1 auto;
  min-width:280px;
}
.navbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
}

.nav-links{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}
.nav-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 10px;
  border-radius:12px;
  border:0;
  background:transparent;
  color:var(--text);
  text-decoration:none;
  font-weight:800;
  font-size:14px;
  letter-spacing:-.01em;
}
.nav-link:hover{background:rgba(15,23,42,.04);text-decoration:none}
.nav-link.active{
  color:#14532d;
  box-shadow:inset 0 -2px 0 rgba(22,163,74,.95);
}

@media (max-width:900px){
  .navbar-inner{flex-wrap:wrap}
  .navbar-brand{min-width:0}
  .navbar-menu{
    order:3;
    width:100%;
    justify-content:flex-start;
    gap:10px;
    overflow:auto;
    padding-top:6px;
  }
  .navbar-actions{margin-left:auto}
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  color:white;
  padding:10px 14px;
  border-radius:12px;
  border:0;
  cursor:pointer;
  font-weight:600;
  text-decoration:none;
}
.btn:hover{filter:brightness(1.05);text-decoration:none}
.btn:active{transform:translateY(1px)}
.btn.secondary{background:linear-gradient(135deg,#0f172a,#334155)}
.btn.danger{background:linear-gradient(135deg,#b91c1c,var(--danger))}
.btn.small{padding:8px 10px;border-radius:10px;font-size:13px}

input,select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(248,250,252,.95);
  color:var(--text);
  outline:none;
}
input:focus,select:focus{box-shadow:var(--ring);border-color:rgba(22,163,74,.55)}
label{display:block;margin:10px 0 6px 0;color:rgba(15,23,42,.85);font-weight:700;font-size:13px}

.flash{padding:12px 14px;border-radius:14px;margin:12px 0;font-weight:600}
.flash.ok{background:rgba(22,163,74,.10);border:1px solid rgba(22,163,74,.35);color:#14532d}
.flash.err{background:rgba(239,68,68,.10);border:1px solid rgba(239,68,68,.35);color:#7f1d1d}

.table{overflow:auto;border-radius:14px;border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;background:rgba(255,255,255,1)}
th,td{padding:12px 12px;border-bottom:1px solid rgba(15,23,42,.08);text-align:left;vertical-align:top}
th{font-size:12px;color:rgba(15,23,42,.55);letter-spacing:.06em;text-transform:uppercase}
tr:hover td{background:rgba(15,23,42,.03)}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(15,23,42,.03);
  font-weight:700;
  letter-spacing:.04em;
}
.badge.paid{border-color:rgba(22,163,74,.35);background:rgba(22,163,74,.08);color:#166534}
.badge.pending{border-color:rgba(245,158,11,.40);background:rgba(245,158,11,.10);color:#92400e}
.badge.failed{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.10);color:#991b1b}

.kpi{display:flex;flex-direction:column;gap:6px}
.kpi-label{color:rgba(15,23,42,.62);font-weight:700;font-size:13px}
.kpi-value{font-size:28px;font-weight:800;letter-spacing:-.03em}
.kpi-sub{color:rgba(15,23,42,.55);font-size:12px}

.center{max-width:560px;margin:40px auto}
.page-head{display:flex;gap:12px;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;margin:10px 0 14px}
.page-sub{margin:0;color:rgba(15,23,42,.62)}

.hero{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:18px;
}
.hero-kicker{
  display:inline-flex;
  align-self:flex-start;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(22,163,74,.10);
  border:1px solid rgba(22,163,74,.22);
  color:#14532d;
  font-weight:800;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.hero-title{
  font-size:34px;
  line-height:1.08;
  letter-spacing:-.03em;
  margin:0;
}
.hero-sub{
  margin:0;
  color:rgba(15,23,42,.65);
  font-size:14px;
}
.auth-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:14px;
  align-items:start;
  margin-top:10px;
}
@media (max-width:900px){
  .auth-grid{grid-template-columns:1fr}
}
.steps{
  display:grid;
  gap:10px;
}
.step-card{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.9);
}
.step-no{
  width:32px;height:32px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;
  color:white;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  flex:0 0 auto;
}
.step-title{font-weight:800}
.step-desc{margin-top:4px;color:rgba(15,23,42,.62);font-size:13px}
.callout{
  border-radius:14px;
  padding:12px;
  border:1px solid rgba(14,165,233,.22);
  background:rgba(14,165,233,.08);
  color:rgba(15,23,42,.85);
}
.callout strong{color:#0f172a}
.hint{
  margin-top:8px;
  color:rgba(15,23,42,.62);
  font-size:12px;
}

.watermark{
  position:relative;
  overflow:hidden;
}
.watermark::before{
  content:"MUDAHPAY";
  position:absolute;
  top:52%;
  left:50%;
  transform:translate(-50%,-50%) rotate(-22deg);
  font-size:64px;
  font-weight:900;
  letter-spacing:.22em;
  color:rgba(15,23,42,.06);
  pointer-events:none;
  white-space:nowrap;
}
.invoice-preview{
  padding:16px;
}
.invoice-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.invoice-preview-meta{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.invoice-preview-title{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.02em;
}
.invoice-preview-amount{
  font-size:30px;
  font-weight:950;
  letter-spacing:-.03em;
  margin-top:6px;
}
.invoice-preview-kv{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.invoice-preview-kv .kv{
  border:1px solid rgba(15,23,42,.08);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,.9);
}
.invoice-preview-kv .kv-label{
  font-size:12px;
  font-weight:800;
  color:rgba(15,23,42,.55);
  letter-spacing:.06em;
  text-transform:uppercase;
}
.invoice-preview-kv .kv-value{
  margin-top:6px;
  font-weight:800;
  color:rgba(15,23,42,.9);
}

.doc{
  max-width:860px;
  margin:20px auto;
  padding:20px;
}
.doc-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.doc-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.doc-title{
  font-size:22px;
  font-weight:950;
  letter-spacing:-.03em;
  margin:0;
}
.doc-sub{
  margin-top:4px;
  color:rgba(15,23,42,.62);
  font-size:13px;
}
.doc-meta{
  display:grid;
  gap:6px;
  justify-items:end;
}
.doc-meta .badge{justify-self:end}
.doc-meta-line{
  font-size:13px;
  color:rgba(15,23,42,.65);
}
.doc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
@media (max-width:900px){
  .doc-grid{grid-template-columns:1fr}
}
.doc-box{
  border:1px solid rgba(15,23,42,.10);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,.92);
}
.doc-box h3{
  margin:0;
  font-size:13px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(15,23,42,.55);
}
.doc-box .doc-box-body{
  margin-top:8px;
  font-weight:800;
  color:rgba(15,23,42,.92);
}
.doc-table{
  margin-top:14px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.doc-table table{width:100%;border-collapse:collapse}
.doc-table th,.doc-table td{padding:12px;border-bottom:1px solid rgba(15,23,42,.08);vertical-align:top}
.doc-table th{
  font-size:12px;
  color:rgba(15,23,42,.55);
  letter-spacing:.06em;
  text-transform:uppercase;
  background:rgba(15,23,42,.03);
}
.doc-totals{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}
.doc-totals .doc-box{min-width:320px}
.doc-amount{
  font-size:26px;
  font-weight:950;
  letter-spacing:-.03em;
}
.doc-footer{
  margin-top:14px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.doc-sign{
  width:260px;
  border-top:1px dashed rgba(15,23,42,.28);
  padding-top:8px;
  color:rgba(15,23,42,.60);
  font-size:12px;
  text-align:center;
}

@media print{
  .no-print{display:none!important}
  body{background:#fff!important}
  .container{max-width:none;padding:0}
  .navbar{display:none!important}
  .card{box-shadow:none!important}
  @page{size:A4;margin:12mm}
  body{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .doc{
    margin:0;
    max-width:none;
    border:1px solid #e5e7eb;
    border-radius:0;
    padding:12mm;
  }
  .doc-header{padding-bottom:10px;border-bottom:1px solid #e5e7eb}
  .doc-meta-line{font-size:12px}
  .doc-grid{margin-top:12px}
  .doc-box{background:#fff;border-color:#e5e7eb}
  .doc-table{border-color:#e5e7eb}
  .doc-table th{background:#f8fafc}
  .doc-table th,.doc-table td{padding:9px 10px}
  .doc-footer{margin-top:12px}
  .doc-sign{border-top:1px dashed #94a3b8}
  .watermark::before{
    font-size:76px;
    color:rgba(15,23,42,.05);
    letter-spacing:.28em;
  }
  a{color:#111827;text-decoration:none}
}
