* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f0f2f5;
  color: #333;
}

/* ===================================
           DASHBOARD GRID (Page Structure)
           =================================== */
.dashboard {
  display: grid;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ===================================
           SIDEBAR (Grid Area)
           =================================== */
.sidebar {
  grid-area: sidebar;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 25px 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: #ccc;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(74, 144, 226, 0.2);
  color: white;
}

.nav-link.active {
  background-color: #4a90e2;
  color: white;
}

/* ===================================
           HEADER (Grid Area)
           =================================== */
.header {
  grid-area: header;
  background-color: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  padding: 8px 15px;
  border-radius: 25px;
  width: 300px;
}

.search-bar input {
  border: none;
  background: none;
  padding: 8px;
  width: 100%;
  outline: none;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 40px;
  height: 40px;
  background-color: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* ===================================
           MAIN CONTENT (Grid Area)
           =================================== */
.main-content {
  grid-area: main;
  padding: 25px;
  overflow-y: auto;
}

/* Stats Cards (Flexbox) */
.stats-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.stat-card {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  flex: 1;
  min-width: 180px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-title {
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #1a1a2e;
}

.stat-change {
  font-size: 12px;
  margin-top: 10px;
}

.stat-change.up {
  color: #2ecc71;
}

.stat-change.down {
  color: #e94560;
}

/* Charts Grid (CSS Grid) */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.chart-card {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4a90e2;
  display: inline-block;
}

.chart-placeholder {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  height: 200px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Recent Activity (Flexbox) */
.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.activity-list {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  background-color: #f0f2f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-details {
  flex: 1;
}

.activity-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard {
    grid-template-areas:
      "header"
      "main";
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .stats-grid {
    flex-direction: column;
  }

  .search-bar {
    width: 200px;
  }
}

footer {
  text-align: center;
  padding: 20px;
  color: #999;
  border-top: 1px solid #eee;
  margin-top: 20px;
}
