:root {
  --bg-light: #f4f6fc;
  --sidebar-bg: #ffffff;
  --main-bg: #f4f6fc;
  --text-color: #333;
  --card-bg: #ffffff;
  --primary: #5b6ef5;
}

body.dark {
  --bg-light: #1e1f26;
  --sidebar-bg: #2a2c36;
  --main-bg: #1e1f26;
  --text-color: #eee;
  --card-bg: #2a2c36;
  --primary: #778cff;
}

body {
  margin: 0;
  display: flex;
  background: var(--bg-light);
  color: var(--text-color);
  font-family: sans-serif;
  transition: background .3s, color .3s;
}

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  height: 100vh;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  position: relative;
  transition: width 0.3s;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.brand-name {
  font-size: 20px;
  font-weight: bold;
}

.nav {
  list-style: none;
  padding: 0;
}

.nav-item {
  padding: 12px 8px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s;
}

.nav-item.active, .nav-item:hover {
  background: var(--primary);
  color: white;
}

.btn-collapse {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px;
  cursor: pointer;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 4px;
}

.main {
  flex: 1;
  padding: 30px;
  background: var(--main-bg);
  transition: background .3s;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widgets {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform .2s;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 18px;
  opacity: 0.8;
}

.card p {
  font-size: 24px;
  font-weight: bold;
}

