/* ============================================================
   PAGE: Dashboard (dashboard.html)
   Sections: sidebar, topbar, balance cards,
             chart, quick-panel, transactions table
   ============================================================ */

body.dashboard-body {
  background: #f0f2f8;
  overflow-x: hidden;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo .logo-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-logo .logo-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-logo .logo-name span { color: var(--gold); }

/* User profile card */
.sidebar-profile {
  padding: 14px;
  margin: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.sidebar-username {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.sidebar-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  padding: 3px 8px;
  border-radius: 100px;
}

/* Navigation */
.sidebar-nav {
  padding: 8px 12px;
  flex: 1;
}

.sidebar-nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.22);
  padding: 16px 12px 8px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.58);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
  border: 1px solid transparent;
}

.sidebar-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}

.sidebar-nav-link.active {
  background: rgba(201,168,76,0.09);
  color: var(--gold);
  border-color: rgba(201,168,76,0.15);
}

.sidebar-nav-link svg { flex-shrink: 0; }

.sidebar-nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 100px;
}

/* Bottom links */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.4);
  font-size: 0.875rem;
  transition: var(--transition);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.04);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.dashboard-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); }
.topbar-sub   { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-notif {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--body-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  border: none;
}

.topbar-notif:hover { background: var(--border); color: var(--text-dark); }

.topbar-notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
}

/* Sidebar hamburger button (mobile) */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--body-bg);
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--border); color: var(--text-dark); }

/* ============================================================
   CONTENT
   ============================================================ */
.dashboard-content { padding: 32px; flex: 1; }

/* ============================================================
   BALANCE CARDS
   ============================================================ */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.balance-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201,168,76,0.2);
}

.balance-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.balance-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* icon color variants */
.icon-gold  { background: rgba(201,168,76,0.1);  color: var(--gold); }
.icon-green { background: rgba(34,197,94,0.1);   color: var(--success); }
.icon-blue  { background: rgba(59,130,246,0.1);  color: var(--info); }
.icon-navy  { background: rgba(11,20,55,0.07);   color: var(--navy); }

.balance-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.balance-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}

.balance-value.v-gold  { color: var(--gold); }
.balance-value.v-green { color: var(--success); }

.balance-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--success);
}

.balance-trend.down { color: var(--danger); }

/* ============================================================
   MAIN GRID (chart + quick actions)
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 24px;
}

/* Chart card */
.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); margin-bottom: 3px; }
.chart-sub   { font-size: 0.75rem; color: var(--text-muted); }

.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--body-bg);
  padding: 4px;
  border-radius: 8px;
}

.chart-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  font-family: var(--font-base);
}

.chart-tab.active {
  background: var(--white);
  color: var(--text-dark);
  box-shadow: 0 1px 4px rgba(11,20,55,0.08);
}

.chart-wrapper { height: 250px; position: relative; }

/* Quick-actions panel */
.quick-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--text-dark);
  font-family: var(--font-base);
}

.quick-btn:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.025);
}

.quick-btn-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-btn-label { font-size: 0.875rem; font-weight: 600; display: block; }
.quick-btn-sub   { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; display: block; }

/* Active plan mini card inside quick-panel */
.active-plan-mini {
  margin-top: auto;
  background: var(--navy);
  border-radius: 12px;
  padding: 18px;
}

.apm-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.3); margin-bottom: 4px; }
.apm-name  { font-size: 0.9rem; font-weight: 700; color: var(--gold); margin-bottom: 14px; }

.apm-track { height: 4px; background: rgba(255,255,255,0.09); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.apm-bar   { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 2px; }

.apm-days  { font-size: 0.7rem; color: rgba(255,255,255,0.3); display: flex; justify-content: space-between; }

/* ============================================================
   TRANSACTIONS TABLE
   ============================================================ */
.transactions-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.transactions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
}

.transactions-title { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }

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

.tx-table {
  width: 100%;
  border-collapse: collapse;
}

.tx-table thead tr { background: var(--body-bg); }

.tx-table th {
  padding: 11px 20px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.tx-table td {
  padding: 15px 20px;
  font-size: 0.875rem;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(226,232,240,0.5);
  white-space: nowrap;
  vertical-align: middle;
}

.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-table tbody tr:hover { background: rgba(244,246,251,0.7); }

/* ── Transaction empty state ──────────────────────────────── */
.tx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
}

.tx-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(201,168,76,0.07);
  border: 1.5px solid rgba(201,168,76,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tx-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.tx-empty-sub {
  font-size: 0.845rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 320px;
}

.tx-type-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tx-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon.deposit    { background: rgba(59,130,246,0.1); color: var(--info); }
.tx-icon.profit     { background: rgba(34,197,94,0.1);  color: var(--success); }
.tx-icon.withdrawal { background: rgba(201,168,76,0.1); color: var(--gold); }

.tx-name { font-weight: 600; font-size: 0.875rem; display: block; }
.tx-sub  { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 1px; }

.tx-amount        { font-weight: 700; }
.tx-amount.pos    { color: var(--success); }
.tx-amount.neg    { color: var(--danger); }
.tx-amount.neu    { color: var(--text-dark); }

.tx-hash {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--body-bg);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ============================================================
   WITHDRAWAL MODAL (dashboard-specific)
   ============================================================ */
.modal-balance-info {
  background: var(--body-bg);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.mbi-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.mbi-value { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,20,55,0.5);
  z-index: 199;
  cursor: pointer;
}

.sidebar-overlay.open { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .balance-cards    { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid   { grid-template-columns: 1fr; }
  .quick-panel      { display: none; }
}

@media (max-width: 900px) {
  .sidebar          { transform: translateX(-100%); }
  .sidebar.open     { transform: translateX(0); }
  .dashboard-main   { margin-left: 0; }
  .sidebar-toggle   { display: flex; }
  .topbar           { padding: 0 20px; }
  .dashboard-content{ padding: 20px; }
}

@media (max-width: 600px) {
  .balance-cards { grid-template-columns: 1fr; }
  .topbar-sub    { display: none; }
}
