:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #68758a;
  --line: #e5ebf3;
  --navy: #061b31;
  --blue: #1b65d8;
  --gold: #d9a640;
  --green: #15935c;
  --red: #d94a4a;
  --shadow: 0 16px 38px rgba(14, 29, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body.dash-body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.dash-brand {
  font-weight: 800;
  text-transform: uppercase;
}

.dash-brand span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
}

.dash-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dash-nav a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.dash-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 22px;
}

.dash-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.page-head {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  display: grid;
  gap: 7px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  font-size: 28px;
}

.btn,
button.btn {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.btn.secondary {
  color: var(--ink);
  background: #eef3fa;
}

.btn.success {
  background: var(--green);
}

.btn.danger {
  background: var(--red);
}

.btn.gold {
  background: var(--gold);
}

.btn.compact {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.active,
.badge.approved {
  background: #e6f8ef;
  color: var(--green);
}

.badge.pending {
  background: #fff7df;
  color: #9b6b13;
}

.badge.banned,
.badge.rejected {
  background: #ffe9e9;
  color: var(--red);
}

.flash {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #eef3fa;
  font-weight: 700;
}

.flash.success {
  background: #e6f8ef;
  color: #09683e;
}

.flash.error {
  background: #ffe9e9;
  color: #a92828;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.password-form,
.deposit-form,
.profile-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.deposit-form {
  grid-template-columns: minmax(105px, 0.8fr) minmax(135px, 1fr) auto;
}

.profile-form {
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 1.2fr) minmax(125px, 0.9fr) auto;
}

.referral-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.level-card {
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--gold);
}

.approval-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.approval-pill.approved {
  color: #09683e;
  background: #dff8eb;
}

.approval-pill.pending {
  color: #a92828;
  background: #ffe4e4;
}

.notice-marquee {
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: #b52525;
  box-shadow: var(--shadow);
}

.notice-marquee div {
  width: max-content;
  padding: 12px 0;
  display: flex;
  gap: 34px;
  font-weight: 900;
  animation: notice-scroll 24s linear infinite;
}

.notice-marquee span {
  white-space: nowrap;
}

@keyframes notice-scroll {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.dashboard-slider {
  position: relative;
  min-height: 280px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.dashboard-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.dashboard-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.dashboard-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 20, 38, 0.82), rgba(3, 20, 38, 0.25));
}

.dashboard-slide-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 30px;
  color: #fff;
}

.dashboard-slide-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 42px);
}

.dashboard-slide-copy p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.level-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.level-photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.level-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eef3fa;
}

.level-photo-card div {
  padding: 14px;
}

.level-photo-card p {
  margin: 6px 0;
  color: var(--ink);
  font-weight: 800;
}

.level-photo-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.congrats-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 27, 49, 0.72);
}

.congrats-card {
  width: min(460px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.congrats-card span {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #8a5a08;
  background: #fff2ca;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.congrats-card h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 8vw, 48px);
}

.congrats-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 700;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.reward-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reward-card-head {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.reward-card-head strong {
  font-size: 20px;
}

.reward-options {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.pb-progress {
  margin: 14px 0 8px;
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 7px;
}

.pb-progress span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef3fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pb-progress span.paid {
  color: #fff;
  background: var(--green);
}

.pb-progress span.cancelled {
  color: #fff;
  background: var(--red);
}

.pb-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.reward-claim-form {
  margin-top: 12px;
}

.tree-level {
  margin-bottom: 18px;
}

.tree-users {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tree-user {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tree-actions {
  margin-top: 10px;
}

.thumb {
  width: 86px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.payment-qr {
  width: min(260px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}

.auth-card {
  width: min(440px, 100%);
}

.floating-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  color: #fff;
  background: #19a75b;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(10, 87, 47, 0.34);
}

.floating-whatsapp svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .dash-menu-btn {
    display: block;
  }

  .dash-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
    background: var(--navy);
    border-radius: 8px;
  }

  .dash-nav.open {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-head,
  .referral-box {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 560px) {
  .dash-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 16px;
  }

  .card {
    padding: 16px;
  }

  .dash-topbar {
    padding: 0 14px;
  }
}
