:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --sidebar-width: 250px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0; /* RTL support */
  background-color: #212529;
  color: #fff;
  transition: all 0.3s;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  background-color: #1a1e21;
  text-align: center;
}

.sidebar-menu {
  padding: 20px 0;
  list-style: none;
  margin: 0;
}

.sidebar-menu li a {
  display: block;
  padding: 15px 25px;
  color: #adb5bd;
  text-decoration: none;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
  color: #fff;
  background-color: rgba(255,255,255,0.1);
  border-right: 4px solid var(--primary-color);
}

.main-content {
  margin-right: var(--sidebar-width); /* RTL support */
  padding: 20px;
  transition: all 0.3s;
}

.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 20px;
}

.stat-card {
  border-radius: 10px;
  overflow: hidden;
}

.stat-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e9ecef;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

/* RTL Adjustments */
[dir="rtl"] .sidebar {
  right: 0;
  left: auto;
}

[dir="rtl"] .main-content {
  margin-right: var(--sidebar-width);
  margin-left: 0;
}

[dir="rtl"] .sidebar-menu li a {
  border-right: 4px solid transparent;
  border-left: none;
}

[dir="rtl"] .sidebar-menu li a:hover, [dir="rtl"] .sidebar-menu li a.active {
  border-right: 4px solid var(--primary-color);
  border-left: none;
}

@media (max-width: 768px) {
  .sidebar {
    margin-right: calc(var(--sidebar-width) * -1);
  }
  .sidebar.active {
    margin-right: 0;
  }
  .main-content {
    margin-right: 0;
  }
}
