:root {
  --pp-blue:#003087;
  --pp-blue-dark:#001c64;
  --pp-cyan:#009cde;
  --pp-gold:#ffc439;
  --pp-gold-dark:#f0b90b;
  --ink:#2c2e2f;
  --ink-soft:#6c7378;
  --bg:#f7f9fc;
  --card:#ffffff;
  --line:#e6ebf1;
  --success:#1f8a4c;
  --danger:#d0021b;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow:0 4px 14px rgba(16,24,40,.08);
  --shadow-lg:0 20px 50px -10px rgba(0,48,135,.25);
  --radius:10px;
  --radius-lg:18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pp-blue); }
a:hover { color: var(--pp-cyan); }
h1,h2,h3,h4 { color: var(--pp-blue-dark); letter-spacing: -0.01em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ===== Top Bar ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.topbar .nav { display: flex; justify-content: space-between; align-items: center; height: 64px; flex-wrap: wrap; }
.brand {
  font-size: 22px; font-weight: 800; text-decoration: none; letter-spacing: -0.02em;
  color: var(--pp-blue-dark); display: inline-flex; align-items: center; gap: 8px;
}
.brand .logo-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pp-cyan), var(--pp-blue));
  display: inline-block; box-shadow: var(--shadow-sm);
}
.brand span { color: var(--pp-cyan); }
.topbar nav a {
  color: var(--ink); text-decoration: none; margin-left: 22px; font-size: 14px; font-weight: 600;
  transition: color .15s;
}
.topbar nav a:hover { color: var(--pp-cyan); text-decoration: none; }
.btn-outline {
  border: 1.5px solid var(--pp-blue); padding: 8px 18px; border-radius: 999px;
  color: var(--pp-blue) !important;
}
.btn-outline:hover { background: var(--pp-blue); color: #fff !important; }

main.container { padding-top: 28px; padding-bottom: 50px; min-height: 72vh; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 500px at 80% -10%, #2879fe33, transparent 60%),
              linear-gradient(135deg, var(--pp-blue-dark), var(--pp-blue) 55%, var(--pp-cyan));
  color: #fff;
  padding: 70px 50px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: "";
  position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,196,57,.35), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  color: #fff; font-size: 48px; line-height: 1.1; margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.02em; max-width: 720px;
}
.hero p { font-size: 19px; opacity: .92; margin: 0 0 28px; max-width: 600px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero a.btn {
  background: var(--pp-gold); color: var(--pp-blue-dark); padding: 14px 32px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.hero a.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); background: var(--pp-gold-dark); }
.hero a.btn.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.hero a.btn.ghost:hover { background: rgba(255,255,255,.22); }

/* ===== Features ===== */
.section-head { text-align: center; margin: 40px 0 24px; }
.section-head h2 { font-size: 30px; margin: 0 0 8px; }
.section-head p { color: var(--ink-soft); margin: 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-bottom: 40px; }
.feature {
  background: var(--card); padding: 28px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--pp-cyan), var(--pp-blue));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { color: var(--ink-soft); margin: 0; font-size: 14.5px; }

/* ===== Cards ===== */
.card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-bottom: 22px;
}
.card h2 { margin-top: 0; font-size: 22px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ===== Forms ===== */
form label {
  display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); text-transform: none;
}
form input, form select, form textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--pp-cyan); box-shadow: 0 0 0 3px rgba(0,156,222,.15);
}

.btn {
  background: var(--pp-blue); color: #fff; border: none; padding: 12px 28px;
  border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 700;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--pp-blue-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,48,135,.25); color: #fff; text-decoration: none; }
.btn-gold { background: var(--pp-gold); color: var(--pp-blue-dark); }
.btn-gold:hover { background: var(--pp-gold-dark); color: var(--pp-blue-dark); }
.btn-secondary { background: #eef1f6; color: var(--pp-blue-dark); }
.btn-secondary:hover { background: #dfe5ee; color: var(--pp-blue-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a30115; }

/* ===== Flash ===== */
.flash {
  padding: 13px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
  border: 1px solid transparent; display: flex; align-items: flex-start; gap: 10px;
}
.flash-info { background: #e7f3fa; color: #0b4f74; border-color: #bee3f4; }
.flash-success { background: #e6f6ec; color: #0f5a2e; border-color: #b9e2c7; }
.flash-error { background: #fdecec; color: #7d0a16; border-color: #f5b7bd; }
.flash-warning { background: #fff7e0; color: #6b4d00; border-color: #fce4a0; }

/* ===== Balance Card ===== */
.balance-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--pp-blue-dark), var(--pp-blue) 55%, var(--pp-cyan));
  color: #fff; padding: 34px; border-radius: var(--radius-lg); margin-bottom: 26px;
  box-shadow: var(--shadow-lg);
}
.balance-card::before {
  content: ""; position: absolute; right: -60px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,196,57,.25), transparent 70%);
}
.balance-card .label { font-size: 13px; opacity: .9; text-transform: uppercase; letter-spacing: .08em; }
.balance-card .amount { font-size: 48px; font-weight: 800; margin: 8px 0 6px; letter-spacing: -0.02em; }
.balance-card .user-info { font-size: 13.5px; opacity: .92; }
.balance-card .actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.balance-card .actions a {
  background: rgba(255,255,255,.18); color: #fff; padding: 10px 18px;
  border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(255,255,255,.3);
}
.balance-card .actions a:hover { background: rgba(255,255,255,.28); }

/* ===== Layout helpers ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* ===== Stats ===== */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.stat .val { font-size: 22px; font-weight: 700; color: var(--pp-blue-dark); margin-top: 4px; }
.stat .val.up { color: var(--success); }
.stat .val.down { color: var(--danger); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
table th { background: #f5f8fc; color: var(--pp-blue-dark); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table tbody tr:hover { background: #fafbfd; }
.amount-in { color: var(--success); font-weight: 700; }
.amount-out { color: var(--danger); font-weight: 700; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge-in { background: #e6f6ec; color: var(--success); }
.badge-out { background: #fdecec; color: var(--danger); }
.badge-deposit { background: #fff7e0; color: #6b4d00; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pp-cyan), var(--pp-blue));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; margin-right: 8px; vertical-align: middle;
}

/* ===== Auth ===== */
.auth-wrap {
  max-width: 440px; margin: 30px auto;
  background: var(--card); border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.auth-wrap h2 { margin: 0 0 8px; font-size: 24px; }
.auth-wrap .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }

/* ===== Footer ===== */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 26px 0; text-align: center; color: var(--ink-soft); font-size: 13px; }
.footer .links { margin-top: 6px; }
.footer .links a { color: var(--ink-soft); margin: 0 8px; text-decoration: none; }
.footer .links a:hover { color: var(--pp-cyan); }

/* ===== Misc ===== */
.code-box {
  font-size: 32px; letter-spacing: 12px; text-align: center;
  background: linear-gradient(135deg, #f5f8fc, #eaf2fb);
  padding: 20px; border-radius: 10px; font-weight: 800; color: var(--pp-blue-dark);
  margin: 16px 0; border: 1px dashed var(--pp-cyan);
}
.muted { color: var(--ink-soft); font-size: 13.5px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kbd {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  background: #eef1f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 50px 28px; }
  .hero h1 { font-size: 34px; }
  .topbar nav a { margin-left: 12px; font-size: 13px; }
  .balance-card .amount { font-size: 36px; }
}
@media (max-width: 480px) {
  .topbar .nav { height: auto; padding: 12px 0; }
  .topbar nav { width: 100%; margin-top: 8px; overflow-x: auto; white-space: nowrap; }
  .topbar nav a { margin: 0 8px 0 0; }
}
