:root {
  --primary: #4361ee;
  --secondary: #3a0ca3;
  --success: #4cc9f0;
  --warning: #f72585;
  --info: #7209b7;
  --light: #f8f9fa;
  --dark: #212529;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --header-height: 70px;
  --transition-speed: 0.3s;
}

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

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

/* Auth Page Styles */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
  padding: 40px;
  transition: transform 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-5px);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h3 {
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 5px;
}

.auth-logo p {
  color: #6c757d;
  font-size: 14px;
}

.form-control {
  border-radius: 8px;
  padding: 12px 15px;
  border: 1px solid #e1e5eb;
  transition: all 0.3s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.15);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  transition: all 0.3s;
}

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

/* App Layout Styles */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
  color: white;
  transition: all var(--transition-speed);
  position: fixed;
  height: 100vh;
  z-index: 1000;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand img {
  width: 35px;
  height: 35px;
}

.sidebar-brand h5 {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 12px 20px;
  border-radius: 8px;
  margin: 0 10px;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  text-decoration: none;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-link i {
  width: 24px;
  margin-right: 12px;
  font-size: 18px;
}

.nav-text {
  transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute;
  bottom: 0;
  width: 100%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-details {
  transition: opacity var(--transition-speed);
}

.sidebar.collapsed .user-details {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed);
}

.main-content.expanded {
  margin-left: var(--sidebar-collapsed-width);
}

.header {
  height: var(--header-height);
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  transition: all 0.3s;
  cursor: pointer;
}

.header-action-btn:hover {
  background: var(--primary);
  color: white;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Page Content Styles */
.page-content {
  padding: 25px;
  min-height: calc(100vh - var(--header-height));
}

/* Dashboard Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 24px;
  color: white;
}

.stat-icon.primary { background: var(--primary); }
.stat-icon.success { background: var(--success); }
.stat-icon.warning { background: var(--warning); }
.stat-icon.info { background: var(--info); }

.stat-content h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--dark);
}

.stat-content p {
  color: #6c757d;
  margin: 0;
  font-size: 14px;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.chart-header {
  color: var(--dark);
  margin-bottom: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Card Styles */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.card-header {
  background: white;
  border-bottom: 1px solid #eee;
  padding: 15px 20px;
  font-weight: 600;
  color: var(--dark);
  border-radius: 12px 12px 0 0 !important;
}

.card-body {
  padding: 20px;
}

/* Table Styles */
.table-container {
  max-height: 500px;
  overflow-y: auto;
  border-radius: 8px;
}

.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table th {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: 12px 15px;
  border-top: 1px solid #dee2e6;
}

.table td {
  padding: 12px 15px;
  vertical-align: middle;
  border-top: 1px solid #eee;
}

.table tr:hover {
  background-color: #f8f9fa;
}

/* Form Styles */
.form-label {
  font-weight: 500;
  margin-bottom: 8px;
  color: #495057;
}

.form-select {
  border-radius: 8px;
  padding: 10px 15px;
  border: 1px solid #e1e5eb;
  transition: all 0.3s;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.15);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  
  .sidebar .nav-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
  }
  
  .sidebar .user-details {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
  }
  
  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
  
  .charts-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    width: 0;
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    width: var(--sidebar-width);
    transform: translateX(0);
  }
  
  .sidebar.mobile-open .nav-text {
    opacity: 1;
    width: auto;
    height: auto;
  }
  
  .sidebar.mobile-open .user-details {
    opacity: 1;
    width: auto;
    height: auto;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .auth-card {
    padding: 25px;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badge Styles */
.badge {
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
}

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

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

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

/* Modal Styles */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding: 20px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 20px;
}