:root {
  --primary: #10b981; /* Emerald Green */
  --primary-hover: #059669;
  --bg-main: #f0fdf4; /* Nhấn nhẹ sắc xanh cho nền tổng thể */
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --border: #e2e8f0;
  
  --font-family: 'Inter', 'Roboto', sans-serif;
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === Layout cơ bản === */
.login-container {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--bg-main));
}

.login-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 20px; /* Bo góc mềm mại hơn */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease-in-out;
  font-size: 1rem;
  color: var(--text-main);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.25rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4);
}

.lang-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

.lang-switch a:hover {
  color: var(--primary);
}

/* === Bố cục Dashboard === */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Fixes */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.sidebar nav {
  display: flex;          /* Fix lỗi vỡ menu ngang */
  flex-direction: column; /* Ép hiển thị thành cột dọc */
  gap: 0.25rem;           /* Khoảng cách giữa các menu */
}

.sidebar .logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.5rem;
}

.sidebar .logo svg {
  color: var(--primary);
}

.sidebar .nav-item {
  display: flex; /* Dùng flex để dễ căn lề icon nếu thêm về sau */
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  white-space: nowrap; /* Tránh rớt dòng chữ dài */
}

.sidebar .nav-item:hover {
  background-color: var(--bg-main);
  color: var(--primary);
}

.sidebar .nav-item.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem 3rem;
  margin-left: var(--sidebar-width); /* Fix trườn sidebar */
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  background: transparent;
}

/* Các Card thống kê */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.75rem;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.02), 0 4px 6px -2px rgba(0, 0, 0, 0.01);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.stat-card .value.text-success { color: var(--success); }
.stat-card .value.text-danger { color: var(--danger); }
