/* ── Variables ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #11111a;
  --bg-card: #181825;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --primary: #6366f1;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
  --font: 'Inter', -apple-system, sans-serif;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: #fff;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.sidebar-header .logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  width: 100%;
}
.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.nav-link.active {
  background: rgba(99,102,241,0.15);
  color: #6366f1;
}
.nav-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}
.nav-label { flex: 1; font-size: 14px; font-weight: 500; }
.nav-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.user-info { flex: 1; }
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-secondary); }
.user-chevron { font-size: 10px; color: var(--text-muted); }

/* ── Main Content ── */
.main-content {
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-date { font-size: 13px; color: var(--text-secondary); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.search-box input {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  outline: none;
  width: 200px;
}
.search-icon { font-size: 16px; }
.notif-box {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.notif-count {
  position: absolute;
  top: -6px; right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* ── Stats Cards ── */
.stats-section {
  margin-bottom: 24px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.stat-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.stat-icon.g-blue { background: rgba(99,102,241,0.15); color: #6366f1; }
.stat-icon.g-green { background: rgba(34,211,238,0.15); color: #22d3ee; }
.stat-icon.g-orange { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stat-icon.g-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.stat-info { flex: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; display: block; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: #fff; }
.stat-trend {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
}
.stat-trend.up { background: rgba(34,211,238,0.15); color: #22d3ee; }
.stat-trend.down { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ── Metrics ── */
.metrics-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.metric-item {
  text-align: center;
  padding: 20px;
}
.metric-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.metric-value { font-size: 32px; font-weight: 700; color: #fff; }

/* ── Charts ── */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.chart-container {
  height: 200px;
  position: relative;
}
.chart-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 5px 5px 0 0;
}
.chart-line:nth-child(1) { width: 8%; background: rgba(99,102,241,0.3); margin-left: 2%; }
.chart-line:nth-child(2) { width: 8%; background: rgba(99,102,241,0.5); margin-left: 2%; }
.chart-line:nth-child(3) { width: 8%; background: rgba(99,102,241,0.7); margin-left: 2%; }
.chart-line:nth-child(4) { width: 8%; background: rgba(99,102,241,0.9); margin-left: 2%; }
.chart-line:nth-child(5) { width: 8%; background: rgba(99,102,241,1); margin-left: 2%; }
.chart-line:nth-child(6) { width: 8%; background: rgba(99,102,241,0.9); margin-left: 2%; }
.chart-line:nth-child(7) { width: 8%; background: rgba(99,102,241,0.8); margin-left: 2%; }
.chart-line:nth-child(8) { width: 8%; background: rgba(99,102,241,0.7); margin-left: 2%; }
.chart-line:nth-child(9) { width: 8%; background: rgba(99,102,241,0.6); margin-left: 2%; }
.chart-line:nth-child(10) { width: 8%; background: rgba(99,102,241,0.5); margin-left: 2%; }
.chart-line:nth-child(11) { width: 8%; background: rgba(99,102,241,0.4); margin-left: 2%; }
.chart-line:nth-child(12) { width: 8%; background: rgba(99,102,241,0.3); margin-left: 2%; }
.chart-legend {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.plan-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
}
.plan-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.plan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.plan-item:last-child { border-bottom: none; }
.plan-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.plan-icon.p-enterprise { background: rgba(99,102,241,0.15); color: #6366f1; }
.plan-icon.p-professional { background: rgba(34,211,238,0.15); color: #22d3ee; }
.plan-icon.p-starter { background: rgba(245,158,11,0.15); color: #f59e0b; }
.plan-info { flex: 1; }
.plan-name { font-size: 15px; font-weight: 500; }
.plan-bar {
  height: 8px;
  border-radius: 5px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.plan-fill {
  height: 100%;
  border-radius: 5px;
}
.plan-value {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  min-width: 80px;
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  .main-content { margin-left: 200px; }
  .stats-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .charts-section { grid-template-columns: 1fr; }
  .topbar-right .search-box input { width: 120px; }
}
