
:root{
  --ink:#20213b;
  --sub:#8b8da3;
  --line:#eef0f5;
  --bg:#f6f7fb;
  --violet:#221e42;
  --violet-2:#382f7d;
  --violet-soft:#efecff;
  --green:#1fb17d;
  --green-soft:#e6f8f1;
  --red:#f0506e;
  --red-soft:#fdeaee;
  --amber:#f2a93b;
  --amber-soft:#fdf1e0;
  --blue:#4c7cf0;
  --blue-soft:#eaf1ff;
  --gold:#e9ad2b;
  --gold-soft:#fdf3df;
  --radius:16px;
}

*{box-sizing:border-box;}

body{
  background:var(--bg);
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  color:var(--ink);
  font-size:.9rem;
}

.page{
  max-width:1440px;
  margin:0 auto;
  padding:24px 20px 48px;
}

/* ---------- Header ---------- */
.dash-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:22px;
}
.dash-title{
  font-size:1.35rem;
  font-weight:800;
  margin:0 0 2px;
  letter-spacing:-.01em;
}
.dash-subtitle{
  color:var(--sub);
  font-size:.83rem;
  margin:0;
}
.dash-updated{
  color:var(--sub);
  font-size:.8rem;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.refresh-btn{
  width:30px;height:30px;
  border-radius:50%;
  border:1px solid var(--line);
  background:#fff;
  display:inline-flex;
  align-items:center;justify-content:center;
  color:var(--sub);
  flex-shrink:0;
}

/* ---------- Cards base ---------- */
.card-soft{
  background:#fff;
  border-radius:var(--radius);
  border:1px solid var(--line);
  padding:18px 20px;
  height:100%;
}
.card-title{
  font-weight:700;
  font-size:.95rem;
  margin-bottom:2px;
}
.card-label{
  font-size:.78rem;
  color:var(--sub);
  font-weight:500;
}

/* ---------- Stat cards (top row) ---------- */
.stats-row{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:stretch;
}
.stat-icon{
  width:46px;
  height:46px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;justify-content:center;
  font-size:2.05rem;
  flex-shrink:0;
}
.stat-card{
  flex:1 1 180px;
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.stat-text{flex:1;min-width:0;}
.stat-value{
  font-size:1.4rem;
  font-weight:800;
  line-height:1.1;
  margin:6px 0 2px;
}
.stat-foot{
  font-size:.76rem;
  color:var(--sub);
}

/* Available coins hero card */
.coins-hero{
  flex:1 1 260px;
  max-width:300px;
  background:linear-gradient(135deg,var(--violet) 0%, var(--violet-2) 100%);
  border-radius:var(--radius);
  padding:20px 20px;
  color:#fff;
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.coins-hero::after{
  content:"";
  position:absolute;
  width:180px;height:180px;
  background:rgba(255,255,255,.06);
  border-radius:50%;
  right:-60px;top:-70px;
}
.coins-hero .stat-icon{
  background:rgba(255,255,255);
  color:#e77c28;
}
.coins-hero .hero-text{
  flex:1;
  min-width:0;
  position:relative;
  z-index:1;
}
.coins-hero .stat-value{
  font-size:1.7rem;
  color: #e77c28;
}
.coins-hero .stat-label{
  font-size:.82rem;
  opacity:.92;
  font-weight:500;
}
.coins-hero .stat-foot{
  color:rgba(255,255,255,.85);
}
.btn-hero{
  background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.35);
  color:#fff;
  font-size:.8rem;
  font-weight:600;
  border-radius:9px;
  padding:8px 14px;
  margin-top:14px;
  white-space:nowrap;
}
.btn-hero:hover{
  background:rgba(255,255,255,.28);
  color:#fff;
}

@media (max-width:991.98px){
  .coins-hero{max-width:none; flex-basis:100%;}
}
@media (max-width:575.98px){
  .stat-card{flex-basis:100%;}
}

.tier-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-weight:700;
  font-size:1.05rem;
  color:var(--gold);
}

/* ---------- Section card headers ---------- */
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}
.section-head h6{
  font-weight:700;
  font-size:.95rem;
  margin:0;
}
.link-view-all{
  font-size:.78rem;
  font-weight:600;
  color:var(--violet);
  text-decoration:none;
}
.link-view-all:hover{color:var(--violet-2);}

.dropdown-pill{
  background:#fff;
  border:1px solid var(--line);
  font-size:.75rem;
  color:var(--ink);
  border-radius:8px;
  padding:5px 10px;
  font-weight:500;
}

/* ---------- Chart legend chips ---------- */
.legend-chip{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.78rem;
  color:var(--sub);
  margin-bottom:8px;
}
.legend-dot{
  width:9px;height:9px;
  border-radius:50%;
  flex-shrink:0;
}

/* ---------- Donut center label ---------- */
.donut-wrap{position:relative;}
.donut-center{
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  text-align:center;
}
.donut-center .num{
  font-weight:800;
  font-size:1.15rem;
  display:block;
}
.donut-center .lbl{
  font-size:.68rem;
  color:var(--sub);
}

.legend-row{
  display:flex;
  justify-content:space-between;
  font-size:.78rem;
  color:var(--sub);
  padding:3px 0;
}
.legend-row .val{color:var(--ink);font-weight:600;}

/* ---------- Recent redemptions ---------- */
.redeem-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.redeem-item:last-child{border-bottom:none;padding-bottom:0;}
.redeem-icon{
  width:36px;height:36px;
  border-radius:9px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  font-size:.95rem;
}
.redeem-title{font-weight:600;font-size:.82rem;}
.redeem-sub{font-size:.74rem;color:var(--sub);}
.redeem-amt{font-weight:700;font-size:.82rem;color:var(--red);text-align:right;}
.status-pill{
  font-size:.68rem;
  font-weight:600;
  background:var(--green-soft);
  color:var(--green);
  padding:2px 9px;
  border-radius:20px;
  display:inline-block;
  margin-top:3px;
}

/* ---------- Table ---------- */
.tx-table{font-size:.8rem;margin-bottom:0;}
.tx-table thead th{
  color:var(--sub);
  font-weight:600;
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  border-bottom:1px solid var(--line);
  padding-bottom:10px;
}
.tx-table tbody td{
  padding:11px 8px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
  color:var(--ink);
}
.tx-table tbody tr:last-child td{border-bottom:none;}
.badge-type{
  font-size:.7rem;
  font-weight:600;
  padding:3px 10px;
  border-radius:20px;
}
.badge-earned{background:var(--green-soft);color:var(--green);}
.badge-redeemed{background:var(--red-soft);color:var(--red);}
.badge-status{
  font-size:.7rem;
  font-weight:600;
  padding:3px 10px;
  border-radius:20px;
}
.badge-credited{background:var(--green-soft);color:var(--green);}
.badge-completed{background:var(--blue-soft);color:var(--blue);}
.coins-pos{color:var(--green);font-weight:700;}
.coins-neg{color:var(--red);font-weight:700;}
.table-foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:.78rem;
  color:var(--sub);
  margin-top:12px;
}

/* ---------- Progress card ---------- */
.progress-track{
  height:8px;
  border-radius:20px;
  background:var(--line);
  overflow:hidden;
  margin:14px 0 18px;
}
.progress-fill{
  height:100%;
  border-radius:20px;
  background:linear-gradient(90deg,var(--violet),var(--violet-2));
}
.tier-icons{
  display:flex;
  justify-content:space-between;
  text-align:center;
}
.tier-icon-item{flex:1;font-size:.68rem;color:var(--sub);}
.tier-icon-circle{
  width:42px;height:42px;
  border-radius:50%;
  background:var(--bg);
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 6px;
  font-size:1.1rem;
  color:#c9cadb;
}
.tier-icon-item.active .tier-icon-circle{
  background:var(--gold-soft);
  border-color:var(--gold);
  color:var(--gold);
}
.tier-icon-item .tname{font-weight:600;color:var(--ink);display:block;font-size:.72rem;}
.tier-badge-pill{
  font-size:.7rem;
  font-weight:600;
  background:var(--gold-soft);
  color:var(--gold);
  padding:3px 10px;
  border-radius:20px;
}

/* ---------- Quick actions ---------- */
.qa-btn{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px 10px;
  text-align:center;
  width:100%;
  height:100%;
  color:var(--ink);
}
.qa-btn:hover{border-color:var(--violet-2); box-shadow:0 4px 14px rgba(91,61,240,.08);}
.qa-icon{
  width:38px;height:38px;
  border-radius:10px;
  background:var(--violet-soft);
  color:var(--violet);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 8px;
  font-size:1rem;
}
.qa-title{font-weight:700;font-size:.8rem;}
.qa-sub{font-size:.72rem;color:var(--sub);}

@media (max-width:767.98px){
  .dash-header{flex-direction:column;}
  .stat-value{font-size:1.25rem;}
  .tx-table{font-size:.74rem;}
  .table-responsive-inner{overflow-x:auto;}
}
