/* ===============================================
   ADMIN DASHBOARD - MAYOMBÉ
   Design moderne professionnel avec couleurs du site
   =============================================== */

/* Variables de couleurs du site MAYOMBÉ */
:root {
  --primary-color: #4F7942;
  --secondary-color: #C3D64B;
  --tertiary-color: #8FBC8F;
  --accent-color: #CFE2CF;
  --white: #FFFBFA;
  --black: #0B0C0D;
  --gray-dark: #282525;
  --gray-medium: #817F7E;
  --gray-light: #A4A3A2;
  --gray-lightest: #F6F4F4;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --shadow: 0 2px 10px rgba(79, 121, 66, 0.1);
  --shadow-lg: 0 4px 20px rgba(79, 121, 66, 0.15);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-lightest);
  color: var(--black);
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
}

/* Layout principal */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
  color: var(--white);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-title {
  display: none;
}

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

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
  border-radius: 0 25px 25px 0;
  margin-right: 8px;
  position: relative;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--secondary-color);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav i {
  width: 20px;
  margin-right: 12px;
  font-size: 16px;
  text-align: center;
}

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

.sidebar.collapsed .sidebar-nav i {
  margin-right: 0;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 280px;
  transition: var(--transition);
}

.main-content.expanded {
  margin-left: 70px;
}

/* Header */
.admin-header {
  background: var(--white);
  padding: 20px 30px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 121, 66, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 121, 66, 0.4);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: var(--white);
}

/* Dashboard content */
.dashboard-content {
  padding: 30px;
}

/* Page header */
.page-header {
  margin-bottom: 30px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--gray-medium);
  font-size: 16px;
  margin: 0;
}

/* Statistics cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-color);
  border-radius: 0 4px 4px 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card.primary::before {
  background: var(--primary-color);
}

.stat-card.success::before {
  background: var(--success);
}

.stat-card.info::before {
  background: var(--info);
}

.stat-card.warning::before {
  background: var(--warning);
}

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

.stat-info h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 4px 0;
}

.stat-info p {
  font-size: 14px;
  color: var(--gray-medium);
  margin: 0;
  font-weight: 500;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
}

.stat-card.primary .stat-icon {
  background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
}

.stat-card.success .stat-icon {
  background: linear-gradient(135deg, var(--success), #20c997);
}

.stat-card.info .stat-icon {
  background: linear-gradient(135deg, var(--info), #138496);
}

.stat-card.warning .stat-icon {
  background: linear-gradient(135deg, var(--warning), #e0a800);
}

/* Charts and content sections */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card,
.messages-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.card-header {
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
}

.card-header h6 {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  margin: 0 0 8px 0;
}

.card-header p {
  font-size: 14px;
  color: var(--gray-medium);
  margin: 0;
}

.card-body {
  padding: 24px;
}

/* Messages list */
.messages-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.message-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.message-item:last-child {
  border-bottom: none;
}

.message-item:hover {
  background: rgba(79, 121, 66, 0.02);
  padding-left: 8px;
  border-radius: 8px;
  margin: 0 -8px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.message-name {
  font-weight: 600;
  color: var(--black);
  margin: 0;
  font-size: 14px;
}

.message-date {
  font-size: 12px;
  color: var(--gray-medium);
}

.message-preview {
  font-size: 13px;
  color: var(--gray-medium);
  line-height: 1.4;
  margin: 0;
}

/* Table card */
.table-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

.table th {
  background: rgba(79, 121, 66, 0.02);
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
}

.table tbody tr:hover {
  background: rgba(79, 121, 66, 0.02);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning);
}

.badge-secondary {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

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

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

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

  .admin-header {
    padding: 16px 20px;
  }

  .header-left h1 {
    font-size: 24px;
  }

  .dashboard-content {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-info h3 {
    font-size: 24px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card-header,
  .card-body {
    padding: 20px;
  }
}

@media (max-width: 576px) {
  .sidebar {
    width: 100%;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card,
.chart-card,
.messages-card,
.table-card {
  animation: fadeInUp 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Focus states */
.btn:focus,
.sidebar-nav a:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .sidebar,
  .admin-header .header-actions {
    display: none !important;
  }

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

  .stat-card,
  .chart-card,
  .table-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
