/* ===========================
   Admin Dashboard Styles
   =========================== */

/* Variables CSS */
/*
 * Les valeurs vivent dans `core/css/tokens.css`, les noms hérités dans
 * `core/css/heritage.css`. Le bloc `:root` qui se trouvait ici les
 * redéfinissait, et le dernier fichier chargé l'emportait.
 */

/* Map legacy token aliases to AURA dark theme tokens */

/* Reset et styles de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Dashboard Wrapper */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed);
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.logo i {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.theme-toggle button:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
  transition: margin-left var(--transition-speed);
}

/* Header */
.main-header {
  background: var(--bg-secondary);
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Breadcrumb */
.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-secondary);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-primary);
}

/* Search Box */
.search-box {
  position: relative;
  width: 300px;
}

.search-box input {
  padding-left: 2.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Buttons */
.btn-icon {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger-color);
  color: #fff;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu {
  padding: 0;
}

/* Content Wrapper */
.content-wrapper {
  padding: 1.5rem;
  flex: 1;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-speed);
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-tools {
  display: flex;
  gap: 0.5rem;
}

/* Metric Cards */
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-speed);
}

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

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

.metric-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

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

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Soft Colors */
.bg-primary-soft {
  background-color: rgba(99, 102, 241, 0.1);
}

.bg-success-soft {
  background-color: rgba(16, 185, 129, 0.1);
}

.bg-warning-soft {
  background-color: rgba(245, 158, 11, 0.1);
}

.bg-danger-soft {
  background-color: rgba(239, 68, 68, 0.1);
}

.bg-info-soft {
  background-color: rgba(59, 130, 246, 0.1);
}

/* Charts */
.chart-container {
  position: relative;
  width: 100%;
}

/* Tables */
.table {
  color: var(--text-primary);
}

.table thead th {
  border-bottom: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table tbody td {
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Project Icon */
.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Progress */
.progress {
  background-color: var(--border-color);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

.timeline-content h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Team List */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-info {
  flex: 1;
}

.member-info h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.member-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 0.375rem;
  transition: background-color var(--transition-speed);
}

.task-item:hover {
  background: rgba(99, 102, 241, 0.05);
}

.form-check-label {
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Responsive */
@media (width <= 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .search-box {
    width: 200px;
  }

  .header-left,
  .header-right {
    gap: 0.5rem;
  }

  .metric-card {
    flex-direction: column;
    text-align: center;
  }

  .metric-icon {
    margin-top: 1rem;
  }
}

@media (width <= 576px) {
  .content-wrapper {
    padding: 1rem;
  }

  .card-header {
    padding: 1rem;
  }

  .search-box {
    display: none;
  }
}
