/* Variables CSS */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --white: #ffffff;
  --black: #000000;
  
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --transition: all 0.2s ease-in-out;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo i {
  font-size: 1.5rem;
  color: var(--primary);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.api-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
}

.status-indicator.online {
  background-color: #dcfce7;
  color: #166534;
}

.status-indicator.offline {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-indicator.checking {
  background-color: #fef3c7;
  color: #92400e;
}

.status-indicator i {
  font-size: 0.75rem;
}

/* Navigation */
.nav-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
}

.tab-list {
  display: flex;
  gap: 0;
  min-width: max-content;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background-color: var(--gray-50);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: var(--gray-50);
}

.tab-btn i {
  font-size: 1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.section-header h2 i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.section-header p {
  color: var(--gray-600);
  font-size: 1.125rem;
}

/* Calculator Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-group input[type="range"] {
  padding: 0;
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: 0.25rem;
  appearance: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: var(--shadow);
}

.form-group input[type="range"]::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: var(--shadow);
}

.error-message {
  display: block;
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  min-height: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 2.75rem;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  min-height: 2rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Quick Tests */
.quick-tests {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.quick-tests h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.quick-tests .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Results */
.results-container {
  min-height: 200px;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.results-grid {
  display: grid;
  gap: 1rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  background-color: var(--gray-50);
}

.result-item.total {
  background-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  font-size: 1.125rem;
}

.result-item .label {
  font-weight: 500;
}

.result-item .value {
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.result-item .value.positive {
  color: var(--success);
}

.result-item .value.negative {
  color: var(--danger);
}

/* Coming Soon */
.coming-soon {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}

.coming-soon i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section a {
  display: block;
  color: var(--gray-400);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--white);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-spinner i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .logo h1 {
    font-size: 1.25rem;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1rem;
  }
}

/* ===== STYLES GESTION DU TEMPS ===== */

/* Navigation des sous-sections */
.timesheet-nav {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0;
}

.timesheet-nav-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.timesheet-nav-btn {
  background: none;
  border: none;
  padding: 15px 20px;
  color: #6c757d;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timesheet-nav-btn:hover {
  color: #007bff;
  background: rgba(0, 123, 255, 0.1);
}

.timesheet-nav-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: white;
}

/* Contenu des sections */
.timesheet-content {
  padding: 20px 0;
}

.timesheet-section {
  display: none;
}

.timesheet-section.active {
  display: block;
}

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

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.kpi-card:nth-child(1) .kpi-icon { background: #007bff; }
.kpi-card:nth-child(2) .kpi-icon { background: #28a745; }
.kpi-card:nth-child(3) .kpi-icon { background: #ffc107; }
.kpi-card:nth-child(4) .kpi-icon { background: #17a2b8; }

.kpi-content h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.kpi-content p {
  margin: 5px 0 0 0;
  color: #666;
  font-weight: 500;
}

.kpi-count {
  color: #999;
  font-size: 12px;
}

/* Section Horloge et Pointage */
.clock-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  margin-bottom: 30px;
}

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

.digital-clock {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.clock-display span {
  font-size: 48px;
  font-weight: 300;
  font-family: 'Courier New', monospace;
  display: block;
  margin-bottom: 10px;
}

.clock-display small {
  font-size: 16px;
  opacity: 0.8;
}

.clock-status {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.status-indicator i {
  color: #28a745;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.today-timesheet {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.today-timesheet h4 {
  margin-bottom: 20px;
  color: #333;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

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

.timesheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .timesheet-actions {
    flex-direction: column;
  }
}

/* Résumé des heures */
.hours-summary {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.hours-summary h5 {
  margin-bottom: 15px;
  color: #333;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.summary-item.total {
  border-left-color: #28a745;
  font-weight: 600;
}

.summary-label {
  color: #666;
  font-size: 14px;
}

.summary-value {
  color: #333;
  font-weight: 600;
}

/* Graphiques temps */
.timesheet-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

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

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-card h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.chart-container {
  position: relative;
  height: 200px;
}

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

/* Activité récente */
.recent-activity {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h4 {
  margin-bottom: 20px;
  color: #333;
  font-weight: 600;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.activity-item:hover {
  background: #e9ecef;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.activity-content {
  flex: 1;
}

.activity-content h5 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.activity-content p {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.activity-time {
  color: #999;
  font-size: 12px;
}

/* Calendrier des absences */
.absence-calendar {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h4 {
  margin: 0;
  color: #333;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day {
  background: white;
  padding: 10px;
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.calendar-day:hover {
  background: #f8f9fa;
}

.calendar-day.today {
  background: #007bff;
  color: white;
}

.calendar-day.absence {
  background: #dc3545;
  color: white;
}

.calendar-day.weekend {
  background: #f8f9fa;
  color: #6c757d;
}

/* Filtres et tableaux */
.absence-filters,
.overtime-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

@media (max-width: 768px) {
  .absence-filters,
  .overtime-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

.table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.data-table th {
  background: #f8f9fa;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #dee2e6;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid #f1f3f4;
}

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

.no-data-message {
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

.no-data-message i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Badges de statut */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.en_attente {
  background: #fff3cd;
  color: #856404;
}

.status-badge.approuve {
  background: #d4edda;
  color: #155724;
}

.status-badge.refuse {
  background: #f8d7da;
  color: #721c24;
}

.status-badge.demande {
  background: #fff3cd;
  color: #856404;
}

.status-badge.paye {
  background: #d1ecf1;
  color: #0c5460;
}

/* Types d'absence et heures sup */
.absence-type,
.overtime-type {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.absence-type.conge_paye { background: #d4edda; color: #155724; }
.absence-type.conge_sans_solde { background: #f8d7da; color: #721c24; }
.absence-type.maladie { background: #fff3cd; color: #856404; }
.absence-type.formation { background: #d1ecf1; color: #0c5460; }

.overtime-type.normale { background: #d4edda; color: #155724; }
.overtime-type.nuit { background: #d1ecf1; color: #0c5460; }
.overtime-type.weekend { background: #fff3cd; color: #856404; }
.overtime-type.ferie { background: #f8d7da; color: #721c24; }

/* Boutons d'action */
.action-buttons {
  display: flex;
  gap: 5px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #dee2e6;
  color: #6c757d;
}

.btn-outline:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

/* Résumé des heures supplémentaires */
.overtime-summary {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary-card h5 {
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  color: #666;
  font-size: 14px;
}

.stat-value {
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

/* Calcul des heures supplémentaires dans la modal */
.overtime-calculation {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
}

.overtime-calculation h5 {
  margin-bottom: 15px;
  color: #333;
}

.calculation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.calc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: white;
  border-radius: 6px;
}

.calc-item.total {
  background: #28a745;
  color: white;
}

.calc-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.calc-item.total .calc-label {
  color: rgba(255, 255, 255, 0.8);
}

.calc-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.calc-item.total .calc-value {
  color: white;
}

/* Modales spécifiques */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #f8f9fa;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #dee2e6;
}

/* Checkbox personnalisé */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Statistiques de temps */
.time-statistics {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.stat-card h5 {
  margin-bottom: 10px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.stat-card small {
  color: #999;
  font-size: 12px;
}

/* Options de rapport */
.report-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.option-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

/* Responsive pour les modales */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .calculation-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== STYLES CALCULATEUR AVANCÉ ===== */

/* Navigation calculateur */
.calculator-nav {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0;
  margin-bottom: 20px;
}

.calculator-nav-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.calculator-nav-btn {
  background: none;
  border: none;
  padding: 15px 25px;
  color: #6c757d;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.calculator-nav-btn:hover {
  color: #007bff;
  background: rgba(0, 123, 255, 0.1);
}

.calculator-nav-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: white;
}

/* Contenu calculateur */
.calculator-content {
  min-height: 600px;
}

.calculator-section {
  display: none;
}

.calculator-section.active {
  display: block;
}

/* Panneau d'entrée amélioré */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.panel-header h3 {
  margin: 0;
  color: #333;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Sections de formulaire */
.form-section {
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.form-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Actions de formulaire */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
  }
}

/* Tests rapides améliorés */
.quick-tests {
  margin-top: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.quick-tests h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
}

.test-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Résumé rapide */
.quick-summary {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  margin-bottom: 20px;
}

.summary-item {
  text-align: center;
  flex: 1;
}

.summary-item.highlight {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px;
}

.summary-label {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 5px;
}

.summary-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

/* Grille calculateur avancé */
.advanced-calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.integration-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #28a745;
}

.integration-panel h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.integration-content {
  margin-top: 15px;
}

/* Résumé financier */
.financial-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
}

.financial-summary .summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

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

/* Résultats avancés */
.advanced-results {
  grid-column: 1 / -1;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #007bff;
}

.advanced-results-content {
  margin-bottom: 20px;
}

.advanced-actions {
  display: flex;
  gap: 10px;
}

.advanced-calculation-result {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}

.result-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.result-section {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result-section.highlight {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.result-section h4 {
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.final-amount {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 10px;
}

/* Grille de simulation */
.simulation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.simulation-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #ffc107;
}

.simulation-results {
  grid-column: 1 / -1;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #17a2b8;
}

/* Onglets de scénarios */
.scenario-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
}

.scenario-tab {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.scenario-tab:hover {
  background: #e9ecef;
}

.scenario-tab.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.scenario-content {
  position: relative;
}

.scenario-form {
  display: none;
}

.scenario-form.active {
  display: block;
}

/* Résultats d'optimisation */
.optimization-results {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.recommendation-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.recommendation-header h5 {
  margin: 0;
  color: #333;
  font-size: 14px;
}

.recommendation-value {
  color: #007bff;
  font-weight: 600;
}

.recommendation-description {
  margin: 0;
  color: #666;
  font-size: 13px;
}

/* Comparaison de scénarios */
.scenario-comparison {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}

.comparison-table {
  display: grid;
  grid-template-columns: 150px repeat(auto-fit, minmax(100px, 1fr));
  gap: 1px;
  background: #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

.comparison-header {
  display: contents;
}

.header-cell {
  background: #343a40;
  color: white;
  padding: 12px;
  font-weight: 600;
  text-align: center;
  font-size: 14px;
}

.comparison-row {
  display: contents;
}

.row-label {
  background: #f8f9fa;
  padding: 12px;
  font-weight: 500;
  border-right: 1px solid #dee2e6;
}

.row-value {
  background: white;
  padding: 12px;
  text-align: center;
  font-weight: 500;
}

.comparison-row.highlight .row-label,
.comparison-row.highlight .row-value {
  background: #d4edda;
  font-weight: 600;
}

/* Grille bulletin */
.bulletin-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

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

.bulletin-preview {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #6f42c1;
}

.bulletin-actions-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Document bulletin */
.bulletin-document {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.bulletin-header-doc {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #333;
}

.bulletin-header-doc h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: bold;
}

.bulletin-info p {
  margin: 5px 0;
}

.bulletin-body {
  margin-top: 20px;
}

.bulletin-section {
  margin-bottom: 20px;
}

.bulletin-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.bulletin-line {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dotted #ccc;
}

.bulletin-section.total {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid #333;
}

.bulletin-section.total .bulletin-line {
  font-size: 14px;
  border-bottom: none;
}

/* Actions bulletin */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.bulletin-history h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
}

.recent-bulletins-list {
  max-height: 300px;
  overflow-y: auto;
}

.no-history {
  text-align: center;
  color: #6c757d;
  padding: 20px;
}

/* Messages d'état */
.no-results,
.no-bulletin {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.no-results i,
.no-bulletin i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Responsive pour calculateur avancé */
@media (max-width: 768px) {
  .calculator-nav-list {
    flex-wrap: wrap;
  }

  .calculator-nav-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .panel-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .panel-actions {
    justify-content: center;
  }

  .quick-summary {
    flex-direction: column;
    gap: 10px;
  }

  .comparison-table {
    grid-template-columns: 100px repeat(auto-fit, minmax(80px, 1fr));
    font-size: 12px;
  }

  .header-cell,
  .row-label,
  .row-value {
    padding: 8px 4px;
  }
}
