:root {
  --bg-color: #f0f2f5;
  --bg-secondary: #ffffff;
  --sidebar-bg: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.7);
  --text-main: #1a1a1a;
  --text-muted: #a8a3a3;
  --border-color: rgba(224, 224, 224, 0.5);
  --primary-color: #1e16f3;
  --primary-hover-color: #3f38ff;
  --accent-teal: var(--primary-color);
  --accent-red: #514bfb;
  --accent-orange: var(--primary-hover-color);
  --accent-purple: #6a64ff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 16px;
  --glass-blur: blur(10px);
}

/* Dark Mode Variables */
body.dark-mode {
  --bg-color: #0a0e27;
  --bg-secondary: #141829;
  --sidebar-bg: #1a1f3a;
  --card-bg: rgba(30, 40, 70, 0.4);
  --text-main: #ffffff;
  --text-muted: #b0abb0;
  --border-color: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

body {
  transition:
    background 0.3s,
    color 0.3s;
  min-height: 100vh;
}

.dashboard-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition:
    width 0.3s,
    transform 0.3s;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .brand,
.sidebar.collapsed .nav-link span {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px 0;
}

.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 15px;
}

.hamburger {
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.sidebar-nav {
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: black;
  text-decoration: none;
  font-weight: 500;
  gap: 15px;
  transition:
    background 0.2s,
    color 0.2s,
    border 0.2s;
  white-space: nowrap;
  border-right: 3px solid transparent;
}

.nav-link i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(30, 22, 243, 0.1);
  color: var(--accent-teal);
  border-right: 3px solid var(--accent-teal);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Top Navbar */
.top-navbar {
  height: 70px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

body.dark-mode .top-navbar {
  background: rgba(30, 40, 70, 0.5);
}

.logo-dashboard img{
  width: 90%;
}

.search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: var(--glass-blur);
  padding: 10px 15px;
  border-radius: 12px;
  width: 350px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.search-container:focus-within {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
}

body.dark-mode .search-container {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .search-container:focus-within {
  background: rgba(255, 255, 255, 0.15);
}

.search-container i {
  color: var(--text-muted);
  margin-right: 10px;
}

.search-container input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
}

.lang-toggle img {
  width: 32px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.icon-btn:hover {
  color: var(--accent-teal);
}

.notification-wrapper {
  position: relative;
}

.notification-wrapper .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background-color: var(--accent-red);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.btn-primary {
  background-color: var(--accent-teal);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.2s,
    transform 0.1s;
}

.btn-primary:hover {
  background-color: var(--primary-hover-color);
  transform: translateY(-1px);
}

/* Hero Welcome */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 30px 20px;
  border-bottom: 1px solid var(--border-color);
}

.header-content h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-main);
}

.welcome-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: 6px;
}

.header-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 30px;
  background-color: #f8fafc;
  flex: 1;
}

body.dark-mode .dashboard-grid {
  background-color: #1a1a1a;
}

/* ===== DASHBOARD CARD ===== */
.dashboard-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  height: 280px;
  padding: 35px 25px;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}

.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background-color: rgba(30, 22, 243, 0.1);
  color: var(--accent-teal);
  flex-shrink: 0;
}

.card-metric {
  margin-bottom: 12px;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.metric-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.metric-trend {
  font-size: 0.85rem;
  color: var(--accent-teal);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-trend i {
  font-size: 0.75rem;
}

.metric-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ===== CHART CARD ===== */
.chart-card {
  grid-column: span 1;
}

.doughnut-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.doughnut-chart {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#514bfb 0% 25%, #3f38ff 25% 60%, #1e16f3 60% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doughnut-hole {
  width: 100px;
  height: 100px;
  background-color: var(--card-bg);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.chart-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background-color: #514bfb;
}

.dot.orange {
  background-color: #3f38ff;
}

.dot.teal {
  background-color: #1e16f3;
}

/* ===== TREND CARD ===== */
.trend-card {
  grid-column: span 1;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
  padding-top: 10px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 5px;
}

.bar {
  width: 100%;
  max-width: 18px;
  border-radius: 4px;
}

.bar-teal {
  background-color: #1e16f3;
  opacity: 0.8;
}

.bar-purple {
  background-color: #6a64ff;
  opacity: 0.6;
}

.bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ===== ACTIVITY CARD ===== */
.activity-card {
  grid-column: span 1;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.bg-red {
  background-color: #514bfb;
}

.bg-orange {
  background-color: #3f38ff;
}

.bg-teal {
  background-color: #1e16f3;
}

.bg-purple {
  background-color: #6a64ff;
}

.activity-info {
  flex: 1;
}

.activity-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.activity-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 1000px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .top-navbar {
    padding: 0 20px;
  }

  .search-container {
    width: 250px;
  }

  .page-header {
    padding: 25px 20px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    height: 100vh;
  }
  .sidebar.mobile-active {
    left: 0;
  }
  .top-navbar {
    padding: 0 15px;
  }
  .search-container {
    width: 180px;
  }
  .btn-primary span {
    display: none;
  }
  .btn-primary {
    padding: 10px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px;
  }
  .page-header {
    padding: 20px 15px;
    flex-direction: column;
    align-items: stretch;
  }
  .doughnut-container {
    flex-direction: column;
  }
  .chart-card {
    grid-column: span 1 !important;
  }
}

.sidebar-nav .nav-link small {
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.bar-group {
  position: relative;
}

.bar-count {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

.profile-avatar {
  cursor: pointer;
}

.empty-activity h4 {
  color: #6b7280;
  font-weight: 500;
}
