/* =====================================================
   DASHBOARD MODERNE - VERSION PREMIUM
   Design System Ultra-Responsive & Vendable
===================================================== */

/* ==================== CONTAINER PRINCIPAL ==================== */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ==================== HERO SECTION PREMIUM ==================== */
.hero-dashboard {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.95) 0%,
    rgba(139, 92, 246, 0.92) 50%,
    rgba(59, 130, 246, 0.95) 100%);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 20px 40px rgba(59, 130, 246, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
  animation: heroEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hero-dashboard::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
  }
}

/* Contenu Hero */
.hero-content {
  color: white;
}

.badge-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
  animation: badgeFloat 2s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.7;
  max-width: 600px;
}

/* Quick Stats Card dans Hero */
.hero-quick-stats {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-quick-stats:hover {
  transform: translateY(-5px);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.quick-stats-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quick-stats-date {
  color: white;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 576px) {
  .quick-stats-grid {
    grid-template-columns: 1fr;
  }
}

.quick-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.quick-stat-item:hover .quick-stat-icon {
  transform: scale(1.1) rotate(5deg);
}

.quick-stat-icon.primary {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.quick-stat-icon.warning {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.quick-stat-icon.success {
  background: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.quick-stat-content {
  flex: 1;
  min-width: 0;
}

.quick-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.quick-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

/* ==================== STATS GRID PRINCIPALE ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.stat-card-modern {
  background: white;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 1.25rem;
}

.stat-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-start), var(--color-end));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card-modern:hover::before {
  opacity: 1;
}

.stat-card-modern.primary {
  --color-start: #3b82f6;
  --color-end: #60a5fa;
}

.stat-card-modern.success {
  --color-start: #10b981;
  --color-end: #34d399;
}

.stat-card-modern.info {
  --color-start: #06b6d4;
  --color-end: #22d3ee;
}

.stat-card-modern.warning {
  --color-start: #f59e0b;
  --color-end: #fbbf24;
}

.stat-card-modern:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.03);
}

.stat-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card-modern:hover .stat-card-icon {
  transform: scale(1.1) rotate(-5deg);
}

.stat-card-modern.primary .stat-card-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  color: #3b82f6;
}

.stat-card-modern.success .stat-card-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  color: #10b981;
}

.stat-card-modern.info .stat-card-icon {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
  color: #06b6d4;
}

.stat-card-modern.warning .stat-card-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  color: #f59e0b;
}

.stat-card-content {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
  line-height: 1.1;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.stat-badge.primary {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-badge.info {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.stat-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.stat-badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-time {
  font-size: 0.8125rem;
  color: #94a3b8;
  font-weight: 500;
}

.stat-progress {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.stat-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmerProgress 2s infinite;
}

@keyframes shimmerProgress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ==================== STATS SECONDAIRES ==================== */
.secondary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .secondary-stats {
    grid-template-columns: 1fr;
  }
}

.secondary-stat-card {
  background: white;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  gap: 1rem;
  border: 1px solid #f1f5f9;
}

.secondary-stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: #e2e8f0;
}

.secondary-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.secondary-stat-icon.info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
  color: #06b6d4;
}

.secondary-stat-icon.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  color: #ef4444;
}

.secondary-stat-content {
  flex: 1;
}

.secondary-stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.secondary-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.secondary-stat-value.danger {
  color: #ef4444;
}

.secondary-stat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.secondary-stat-amount {
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
}

/* ==================== ACTIONS RAPIDES ==================== */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
  width: 300px;
  height: 300px;
}

.action-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
  color: white;
}

.action-btn.secondary {
  background: white;
  color: #3b82f6;
  border: 2px solid #e2e8f0;
}

.action-btn.secondary:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.action-btn svg {
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.action-btn:hover svg {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .action-btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .action-btn {
    flex: 1 1 100%;
  }
}

/* ==================== TABLE MODERNE ==================== */
.priority-deposits {
  background: white;
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.section-title svg {
  color: #3b82f6;
}

.section-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #3b82f6;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.section-action:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  transform: translateX(3px);
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.modern-table thead {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.modern-table thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.modern-table thead th.text-center {
  text-align: center;
}

.modern-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(59, 130, 246, 0.01));
  transform: scale(1.005);
}

.modern-table tbody tr.overdue {
  background: rgba(239, 68, 68, 0.02);
}

.modern-table tbody tr.overdue:hover {
  background: rgba(239, 68, 68, 0.05);
}

.modern-table tbody td {
  padding: 1rem 1.25rem;
  color: #334155;
  vertical-align: middle;
}

.modern-table tbody td.text-center {
  text-align: center;
}

.code-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  color: #2563eb;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.code-badge.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

.font-semibold {
  font-weight: 600;
  color: #0f172a;
}

.amount-cell {
  font-weight: 700;
  color: #10b981;
}

.date-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.date-badge.today {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.date-badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  color: #3b82f6;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.table-action-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ==================== GRAPHIQUES ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.chart-card {
  background: white;
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f5f9;
}

.chart-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: #e2e8f0;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}

.chart-title svg {
  color: #3b82f6;
}

.chart-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.chart-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.chart-body {
  position: relative;
  height: 300px;
}

.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1200px) {
  .dashboard-container {
    padding: 1.5rem 1rem;
  }

  .hero-dashboard {
    padding: 2rem;
  }
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem 0.75rem;
  }

  .hero-dashboard {
    padding: 1.5rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

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

  .stat-card-modern {
    padding: 1.25rem;
  }

  .stat-card-value {
    font-size: 1.75rem;
  }

  .quick-actions {
    padding: 1rem;
  }

  .chart-body {
    height: 250px;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .hero-description {
    font-size: 0.9375rem;
  }

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

  .stat-card-icon {
    margin: 0 auto;
  }

  .stat-card-footer {
    justify-content: center;
  }

  .modern-table {
    font-size: 0.875rem;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.75rem 0.875rem;
  }
}

/* ==================== ANIMATIONS ADDITIONNELLES ==================== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
  .dashboard-container {
    color: #e2e8f0;
  }

  .stat-card-modern,
  .secondary-stat-card,
  .quick-actions,
  .priority-deposits,
  .chart-card {
    background: #1e293b;
    color: #e2e8f0;
  }

  .stat-card-label,
  .secondary-stat-label {
    color: #94a3b8;
  }

  .stat-card-value,
  .secondary-stat-value,
  .section-title {
    color: #f1f5f9;
  }
}
