:root {
  /* Colors - Deep Slate & Electric Indigo Theme */
  --bg-dark: #0a0b10;
  --bg-card: #14161f;
  --bg-card-hover: #1c1f2e;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #ec4899;
  --accent: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 64px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--primary);
}

.nav-list {
  list-style: none;
  padding: var(--space-md);
  margin: 0;
  flex: 1;
}

.nav-item {
  margin-bottom: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  box-shadow: inset 2px 0 0 var(--primary);
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  height: 70px;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 300px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Dashboard Grid */
.content-container {
  padding: var(--space-lg);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* Stats Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  border-radius: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-trend {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* Main Chart/Section Area */
.main-section {
  grid-column: span 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--space-lg);
}

.side-section {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.section-title h1 {
  margin: 0;
  font-size: 1.75rem;
}

.section-title h2 {
  font-size: 1.125rem;
  margin: 0;
}

.section-title p {
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.section-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Data Table */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

.table-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-amount {
  font-weight: 600;
}

.table-action-btn {
  padding: 4px 8px;
}

th {
  text-align: left;
  padding: var(--space-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-cell-meta {
  overflow: hidden;
}

.user-cell-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-widget {
  padding: var(--space-md);
  background: var(--bg-card-hover);
  border-radius: 12px;
}

.sidebar-footer {
  padding: var(--space-lg);
  margin-top: auto;
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Placeholder Elements */
.placeholder-image {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.placeholder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.75rem;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

/* Activities List */
.activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-content p {
  margin: 0;
  font-size: 0.875rem;
}

.activity-content strong {
  color: var(--primary);
  font-weight: 600;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.icon-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.icon-accent { background: rgba(6, 182, 212, 0.1); color: var(--accent); }
.icon-secondary { background: rgba(236, 72, 153, 0.1); color: var(--secondary); }
.icon-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.avatar-accent { background: var(--accent); }
.avatar-secondary { background: var(--secondary); }
.avatar-warning { background: var(--warning); }

.h-40 { height: 40%; }
.h-45 { height: 45%; }
.h-55 { height: 55%; }
.h-60 { height: 60%; }
.h-70 { height: 70%; }
.h-75 { height: 75%; }
.h-80 { height: 80%; }
.h-85 { height: 85%; }
.h-90 { height: 90%; }
.h-95 { height: 95%; }
.h-100 { height: 100%; }

/* Chart Placeholder Visual */
.chart-visual {
  height: 300px;
  width: 100%;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0) 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-md);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.chart-select {
  appearance: none;
  padding-right: 30px;
}

.chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: var(--transition);
  opacity: 0.6;
}

.chart-bar:hover {
  opacity: 1;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Utilities */
.mb-lg { margin-bottom: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.nav-divider {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}

/* Footer Styling */
footer {
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary);
}

/* Mobile Navigation Components */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

.menu-open-btn, .menu-close-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-close-btn {
  display: none; /* Only show in mobile */
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
}

.sidebar-logo-group {
  display: flex; 
  align-items: center; 
  gap: var(--space-sm);
}

/* Responsive Queries */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .main-section {
    grid-column: span 2;
  }
  
  .side-section {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: -100%;
    transition: var(--transition);
    height: 100vh;
  }

  /* Note: In a real wireframe we'd use a class to open/close */
  /* For this static version, we'll assume sidebar is hidden on mobile by default */

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  header {
    padding: 0 var(--space-md);
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .search-bar {
    display: none; /* Hide search on small tablets/mobile to save space */
  }

  .header-actions {
    gap: var(--space-md);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .main-section, .side-section {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 16px;
    --space-xl: 32px;
  }

  .content-container {
    padding: var(--space-md);
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .section-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
  }

  .btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .chart-visual {
    height: 200px;
    gap: 4px;
    padding: 10px;
  }

  .chart-bar:nth-child(even) {
    display: none; /* Reduce bars on mobile to avoid crowding */
  }

  .chart-labels span:nth-child(even) {
    display: none;
  }

  footer {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .menu-close-btn {
    display: flex;
  }

  .sidebar-header {
    justify-content: space-between;
  }
}
