:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent: #e2e2e2;
  --border: #e0e0e0;
  --card-bg: #ffffff;
  --sidebar-bg: #f8f8f8;
  --positive: #4caf50;
  --negative: #f44336;
  --status-online: #4caf50;
  --status-away: #ff9800;
  --status-offline: #9e9e9e;
  --status-inactive: #f44336;
  --overlay-bg: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent: #333333;
  --border: #333333;
  --card-bg: #1e1e1e;
  --sidebar-bg: #1a1a1a;
  --positive: #66bb6a;
  --negative: #ef5350;
  --status-online: #66bb6a;
  --status-away: #ffb74d;
  --status-offline: #9e9e9e;
  --status-inactive: #ef5350;
  --overlay-bg: rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: "Quicksand", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, background-color 0.3s;
  position: fixed;
  min-height: 100vh;
  z-index: 20;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  margin-right: 1rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  border-radius: 0.25rem;
  margin: 0 0.5rem;
}

.sidebar-nav a:hover {
  background-color: var(--accent);
  color: var(--text-primary);
}

.sidebar-nav li.active a {
  background-color: var(--accent);
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-nav a svg {
  margin-right: 0.75rem;
}

.theme-toggle-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.theme-toggle {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--accent);
  border: none;
  border-radius: 0.25rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--border);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--overlay-bg);
  z-index: 15;
  display: none;
}

.overlay.active {
  display: block;
}

/* Content Styles */
.content {
  flex: 1;
  padding: 2rem;
  margin-left: 250px;
  transition: margin-left 0.3s ease;
}

.content-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.content-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.date {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-icon {
  background-color: var(--accent);
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

.card-content {
  flex: 1;
}

.card-content h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-change {
  font-size: 0.75rem;
  font-weight: 500;
}

.card-change.positive {
  color: var(--positive);
}

.card-change.negative {
  color: var(--negative);
}

/* Table Styles */
.table-container {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.table-container h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.table-responsive {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.user-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

.user-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.user-table tbody tr:hover {
  background-color: var(--bg-secondary);
}

.user-cell {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  margin-right: 0.75rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
}

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

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.online {
  background-color: var(--status-online);
  color: white;
}

.status-badge.away {
  background-color: var(--status-away);
  color: white;
}

.status-badge.offline {
  background-color: var(--status-offline);
  color: white;
}

.status-badge.inactive {
  background-color: var(--status-inactive);
  color: white;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-left {
    width: 100%;
  }

  .user-table th:nth-child(2),
  .user-table td:nth-child(2),
  .user-table th:nth-child(4),
  .user-table td:nth-child(4) {
    display: none;
  }
}
