/* ==========================================================================
   DASHBOARD CORE & LAYOUT
   ========================================================================== */

.dashboard-body {
  background-color: #06090D;
  color: var(--text-light);
  min-height: 100vh;
}

.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.dash-sidebar {
  width: 260px;
  background: var(--bg-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.sidebar-brand {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 4px;
  transition: var(--transition);
}

.dash-nav-link:hover, 
.dash-nav-link.active {
  background: rgba(197, 160, 89, 0.1);
  color: var(--accent-gold);
}

.dash-nav-link.active {
  border-left: 3px solid var(--accent-gold);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-gold);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info { 
  display: flex; 
  flex-direction: column; 
  flex-grow: 1; 
}

.user-name { 
  font-size: 0.85rem; 
  font-weight: 600; 
  color: var(--text-light); 
}

.user-role { 
  font-size: 0.72rem; 
  color: var(--text-dim); 
}

.logout-btn {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.logout-btn:hover { 
  color: #EF4444; 
}

/* ==========================================================================
   MAIN CONTENT AREA & HEADER
   ========================================================================== */

.dash-main {
  margin-left: 260px;
  flex-grow: 1;
  padding: 32px 40px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-header h1 { 
  font-size: 1.8rem; 
  color: var(--text-light); 
}

.section-desc-sm { 
  font-size: 0.8rem; 
  color: var(--text-dim); 
  margin-top: 4px; 
}

.header-actions { 
  display: flex; 
  align-items: center; 
  gap: 20px; 
}

.status-indicator { 
  font-size: 0.78rem; 
  color: var(--text-dim); 
  display: flex; 
  align-items: center; 
  gap: 6px; 
}

.dot-online { 
  width: 8px; 
  height: 8px; 
  background: #10B981; 
  border-radius: 50%; 
  display: inline-block; 
}

/* ==========================================================================
   CARDS, METRICS & GRIDS
   ========================================================================== */

.dash-section { 
  margin-bottom: 32px; 
}

.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.dash-metric-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.dash-metric-card.highlight {
  border-top: 3px solid var(--accent-gold);
  background: rgba(18, 26, 34, 0.95);
}

.dash-metric-card .metric-label { 
  font-size: 0.78rem; 
  color: var(--text-dim); 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.dash-metric-card .metric-val { 
  font-family: var(--font-serif); 
  font-size: 1.7rem; 
  color: var(--text-light); 
  margin: 8px 0 4px; 
}

.metric-trend.positive { 
  color: #10B981; 
  font-size: 0.8rem; 
  font-weight: 600; 
}

.metric-sub { 
  color: var(--text-dim); 
  font-size: 0.78rem; 
}

.dash-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px;
}

.card-header-flex { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 24px; 
}

.card-header-flex h3 { 
  font-size: 1.15rem; 
  color: var(--text-light); 
}

.gold-tag { 
  font-size: 0.72rem; 
  color: var(--accent-gold); 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  font-weight: 600; 
}

.text-sm { 
  font-size: 0.8rem; 
}

.dash-chart-container { 
  display: flex; 
  align-items: center; 
  gap: 32px; 
}

/* ==========================================================================
   ACTIVITY STREAM & COMPONENT UI
   ========================================================================== */

.activity-list { 
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
}

.activity-list-scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbar */
.activity-list-scroll::-webkit-scrollbar {
  width: 4px;
}
.activity-list-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.activity-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.3);
  border-radius: 2px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:last-child { 
  border-bottom: none; 
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.activity-icon.green { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.activity-icon.blue  { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.activity-icon.gold  { background: rgba(197, 160, 89, 0.1); color: var(--accent-gold); }

.activity-details { 
  display: flex; 
  flex-direction: column; 
  flex-grow: 1; 
}

.activity-details strong { 
  font-size: 0.88rem; 
  color: var(--text-light); 
}

.activity-details span { 
  font-size: 0.78rem; 
  color: var(--text-dim); 
}

.activity-amount { 
  font-family: var(--font-serif); 
  font-size: 0.95rem; 
  font-weight: 600; 
}

.activity-amount.positive { color: #10B981; }
.activity-amount.negative { color: #EF4444; }

.price-change-sub {
  font-size: 0.72rem;
  display: block;
  text-align: right;
  margin-top: 2px;
}
.price-change-sub.positive { color: #10B981; }
.price-change-sub.negative { color: #EF4444; }

/* Stock & Asset Logos */
.stock-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  background: #121A22;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.stock-fallback-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 160, 89, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.stock-symbol {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   MOBILE & NAVIGATION UI CONTROLS
   ========================================================================== */

.dash-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-nav-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--accent-gold);
  border-radius: 2px;
}

.mobile-nav-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-nav-close:hover { 
  color: var(--text-light); 
}

.dash-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dash-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Skeleton Loading Animation */
.loading-skeleton {
  opacity: 0.5;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet (1024px and down) */
@media (max-width: 1024px) {
  .dash-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Mobile Drawer (768px and down) */
@media (max-width: 768px) {
  .dash-layout {
    flex-direction: column;
  }

  .dash-mobile-topbar {
    display: flex;
  }

  .dash-sidebar {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .dash-sidebar.active {
    transform: translateX(0);
  }

  .mobile-nav-close {
    display: block;
  }

  .dash-main {
    margin-left: 0;
    padding: 20px 16px;
  }

  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dash-metrics-grid {
    grid-template-columns: 1fr;
  }

  .dash-chart-container {
    flex-direction: column;
    align-items: center;
  }
}