/* ─── DASHBOARD LAYOUT ─── */
/* ─── DASHBOARD LAYOUT ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.dashboard-body {
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
  background: var(--brand-dark);
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--brand-mid);
  border-right: 1px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--brand-border);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--brand-surface);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(255, 204, 0, 0.1);
  color: var(--mtn-yellow);
  font-weight: 600;
  border-left-color: var(--mtn-yellow);
}
.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--brand-border);
  flex-shrink: 0;
}
.logout-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: "DM Sans", sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.18s ease;
  background: none;
  border: none;
  cursor: pointer;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ─── SIDEBAR OVERLAY (mobile) ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 499;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show {
  display: block;
}

/* ─── MAIN CONTENT ─── */
.dash-main {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOP BAR ─── */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brand-border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.sidebar-toggle {
  display: none;
  font-size: 1.3rem;
  color: var(--text-primary);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.sidebar-toggle:hover {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.3);
}

.dash-header-title {
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.dash-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.2);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mtn-yellow);
  white-space: nowrap;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.15);
  border: 2px solid rgba(255, 204, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mtn-yellow);
  flex-shrink: 0;
}

/* ─── TAB PANELS ─── */
.dash-tab {
  display: none;
  padding: 28px 24px 48px;
  flex: 1;
  min-width: 0;
  animation: tabFadeIn 0.2s ease;
}
.dash-tab.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-header {
  margin-bottom: 24px;
}
.tab-header h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin-bottom: 4px;
}
.tab-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ─── NETWORK TABS ─── */
.network-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.net-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.18s ease;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
}
.net-tab img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}
.net-tab:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}
.net-tab.active[data-net="mtn"] {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.5);
  color: var(--mtn-yellow);
}
.net-tab.active[data-net="telecel"] {
  background: rgba(226, 0, 26, 0.1);
  border-color: rgba(226, 0, 26, 0.5);
  color: #ff3347;
}
.net-tab.active[data-net="at"] {
  background: rgba(0, 61, 165, 0.12);
  border-color: rgba(0, 61, 165, 0.5);
  color: #5b8ff9;
}

/* ─── BUNDLE GRID inside dashboard ─── */
.dash-bundles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

/* ─── BUY FORM ─── */
.buy-form-card {
  margin-top: 24px;
  background: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  border-radius: 16px;
  padding: 24px;
  max-width: 540px;
}
.buy-form-card h3 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.buy-form-summary {
  background: var(--brand-mid);
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.buy-form-summary .sum-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.buy-form-summary .sum-item span {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.buy-form-summary .sum-item strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.buy-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.buy-form-actions .btn-outline {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--brand-border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  background: none;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: "DM Sans", sans-serif;
}
.buy-form-actions .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}

.buy-form-actions .auth-btn {
  flex: 1;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--mtn-yellow);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  font-family: "DM Sans", sans-serif;
}
.buy-form-actions .auth-btn:hover:not(:disabled) {
  background: #e6b800;
}
.buy-form-actions .auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ─── SELECTED BUNDLE CARD ─── */
.bundle-card.selected {
  outline: 2.5px solid currentColor;
  transform: translateY(-4px) !important;
}

/* ─── ORDERS TABLE ─── */
.orders-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.orders-filters .form-input {
  max-width: 280px;
}
.orders-filters select.form-input {
  max-width: 160px;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  background: var(--brand-surface);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 640px;
}
.orders-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 13px 16px;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-bottom: 1px solid var(--brand-border);
  font-weight: 700;
}
.orders-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}
.orders-table tr:last-child td {
  border-bottom: none;
}
.orders-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.table-empty {
  text-align: center !important;
  padding: 48px 20px !important;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ─── WALLET TAB ─── */
.wallet-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.wallet-balance-card {
  background: linear-gradient(
    135deg,
    rgba(255, 204, 0, 0.09) 0%,
    rgba(255, 204, 0, 0.02) 100%
  );
  border: 1.5px solid rgba(255, 204, 0, 0.2);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}
.wallet-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.wallet-amount {
  font-family: "Syne", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--mtn-yellow);
  margin-bottom: 4px;
  line-height: 1;
}
.wallet-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.wallet-topup-btn {
  width: 100%;
  padding: 12px;
  background: var(--mtn-yellow);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: "DM Sans", sans-serif;
}
.wallet-topup-btn:hover {
  background: #e6b800;
  transform: translateY(-1px);
}

.wallet-transactions {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 20px;
}
.wallet-transactions h4 {
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

#topupBtnText {
  color: #ffffff;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  gap: 12px;
}
.tx-item:last-child {
  border-bottom: none;
}
.tx-desc {
  color: var(--text-secondary);
}
.tx-date {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 2px;
}
.tx-amount.credit {
  color: #22c55e;
  font-weight: 700;
  white-space: nowrap;
}
.tx-amount.debit {
  color: #ef4444;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── TOPUP MODAL ─── */
.topup-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.preset-btn {
  flex: 1;
  min-width: 56px;
  padding: 10px 8px;
  border: 1.5px solid var(--brand-border);
  border-radius: 10px;
  background: var(--brand-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: "DM Sans", sans-serif;
}
.preset-btn:hover {
  border-color: var(--mtn-yellow);
  color: var(--mtn-yellow);
  background: rgba(255, 204, 0, 0.06);
}

.secure-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── REFERRAL TAB ─── */
.referral-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 28px;
  max-width: 660px;
}

.referral-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.ref-stat {
  background: var(--brand-mid);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.ref-stat span {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--mtn-yellow);
  margin-bottom: 4px;
}
.ref-stat label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ref-link-row {
  display: flex;
  gap: 8px;
}
.ref-link-row .form-input {
  flex: 1;
  font-size: 0.82rem;
}
.copy-btn {
  padding: 12px 16px;
  background: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: "DM Sans", sans-serif;
}
.copy-btn:hover {
  border-color: var(--mtn-yellow);
  color: var(--mtn-yellow);
}

.referral-list {
  margin-top: 24px;
}
.referral-list h4 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

/* ─── PROFILE TAB ─── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 860px;
}

.profile-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 24px;
}
.profile-card h4 {
  font-size: 1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--brand-border);
  color: var(--text-primary);
}

.profile-save-btn {
  margin-top: 4px;
  padding: 12px 24px;
  background: var(--mtn-yellow);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: "DM Sans", sans-serif;
}
.profile-save-btn:hover {
  background: #e6b800;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }
  .dash-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dash-tab {
    padding: 16px 14px 40px;
  }
  .tab-header h2 {
    font-size: 1.3rem;
  }
  .referral-stat-grid {
    grid-template-columns: 1fr;
  }
  .wallet-grid {
    grid-template-columns: 1fr;
  }
  .dash-header {
    padding: 0 14px;
  }
  .network-tabs {
    gap: 8px;
  }
  .net-tab {
    padding: 9px 12px;
    font-size: 0.82rem;
  }
  .net-tab img {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 420px) {
  .wallet-chip span:first-child {
    display: none;
  }
  .dash-bundles {
    grid-template-columns: repeat(2, 1fr);
  }
}
