:root {
  --primary: linear-gradient(135deg, #6c63ff, #5a54d1);
  --primary-solid: #6c63ff;
  --danger: #ff4d6d;
  --success: #16c784;
  --white: #ffffff;
  --dark: #2d2d2d;
  --bg: #f5f6fa;
}

.dark-theme {
  --bg: #1e1e2f;
  --white: #2a2a40;
  --dark: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: var(--bg);
  color: var(--dark);
}

/* ===== LAYOUT ===== */
.container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
aside {
  background: var(--white);
  padding: 1.5rem 1rem;
  border-right: 1px solid #eee;
}

aside h2 {
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

aside h2 span {
  color: var(--primary-solid);
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 500;
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--primary);
  color: #fff;
}

/* ===== MAIN ===== */
main {
  padding: 2rem;
}

.welcome {
  margin-top: 5px;
  margin-bottom: 15px;
  font-weight: 500;
  color: gray;
}

.date input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

/* ===== CARDS ===== */
.insights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  transition: 0.3s;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-6px);
}

.card span {
  font-size: 32px;
}

.card h1 {
  margin-top: 10px;
}

.card.danger span {
  color: var(--danger);
}

.card.success span {
  color: var(--success);
}

/* ===== TABLE ===== */
.recent {
  margin-top: 2.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}

th {
  background: var(--primary);
  color: white;
  padding: 14px;
  font-weight: 600;
}

td {
  padding: 12px;
  text-align: center;
}

tr:nth-child(even) {
  background: #f2f2f2;
}

/* STATUS */
.success {
  color: var(--success);
  font-weight: 600;
}

.warning {
  color: orange;
  font-weight: 600;
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 20px;
  right: 30px;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-toggler {
  display: flex;
  background: var(--white);
  border-radius: 25px;
  overflow: hidden;
  cursor: pointer;
}

.theme-toggler span {
  padding: 6px 12px;
}

.theme-toggler .active {
  background: var(--primary-solid);
  color: white;
}

.profile {
  text-align: right;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .insights {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  aside {
    position: fixed;
    left: -100%;
    top: 0;
    width: 240px;
    height: 100%;
    transition: 0.3s;
    z-index: 100;
  }

  aside.active {
    left: 0;
  }

  .insights {
    grid-template-columns: 1fr;
  }

  .topbar {
    right: 15px;
  }
}