/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  background-image: url(../../COPIA1/ng.jpg);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  color: #334155;
  line-height: 1.6;
  padding-top: 140px; /* Space for fixed header and tabs */
}

/* App container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fixed Header */
.header.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgb(3, 100, 245);
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  left: 50px;
}

.header-icon {
  position: fixed;
  width: 5rem;
  height: 5rem
}

.header-title h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #ffffff;
  margin-left: 100px;
}

/* Main content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Fixed Tabs */
.tabs-nav.fixed-tabs {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  z-index: 999;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tab-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  border-radius: 0.375rem 0.375rem 0 0;
}

.tab-trigger:hover:not(:disabled) {
  color: #3b82f6;
  background-color: #f8fafc;
}

.tab-trigger.active {
  color: #3b82f6;
  background: #f8fafc;
  border-bottom-color: #3b82f6;
}

.tab-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-icon {
  width: 1rem;
  height: 1rem;
}

/* Tab content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.card-description {
  color: #64748b;
  font-size: 0.875rem;
}

.card-content {
  padding: 1.5rem;
}

.header-with-back {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Forms */
.form-inline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-inline .form-group:first-child {
  flex-direction: row;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-submit {
  grid-column: 1 / -1;
}

label {
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
}

input,
select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #2563eb;
}

.btn-outline {
  border-color: #d1d5db;
  color: #374151;
  background-color: white;
}

.btn-outline:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Site buttons */
.site-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.site-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.site-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.site-btn.active {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Controls bar */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 1rem 0;
}

.control-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Import form styles */
.import-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.import-header {
  margin-bottom: 1rem;
}

.import-header h4 {
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.import-header p {
  color: #64748b;
  margin-bottom: 0.5rem;
}

.format-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #1e40af;
}

.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 1rem 0;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background-color: #f8fafc;
}

.upload-icon {
  width: 2rem;
  height: 2rem;
  color: #9ca3af;
  margin: 0 auto 1rem;
}

.file-upload-area h4 {
  color: #374151;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.file-upload-area p {
  color: #6b7280;
  font-size: 0.875rem;
}

.file-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin: 1rem 0;
}

.import-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.import-progress {
  margin: 1rem 0;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: #f1f5f9;
  border-radius: 0.25rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background-color: #3b82f6;
  transition: width 0.3s ease;
  width: 0%;
}

.import-results {
  margin: 1rem 0;
}

.result-success {
  background-color: #d1fae5;
  color: #166534;
  border: 1px solid #a7f3d0;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.result-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.result-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

/* Tables */
.table-container {
  margin-top: 1rem;
}

.table-container h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  color: #64748b;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #f1f5f9;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  color: #64748b;
}

.empty-icon {
  width: 3rem;
  height: 3rem;
  color: #cbd5e1;
}

.empty-state h3 {
  color: #374151;
  font-size: 1.125rem;
  font-weight: 600;
}

.error-message {
  padding: 0.75rem;
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Statistics */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 0.5rem;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
}

.stat-icon.blue {
  background-color: #dbeafe;
  color: #3b82f6;
}

.stat-icon.green {
  background-color: #d1fae5;
  color: #10b981;
}

.stat-icon.purple {
  background-color: #e9d5ff;
  color: #8b5cf6;
}

.stat-title {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
}

/* Performance badges */
.performance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: help;
}

.performance-badge.noir {
  background-color: #ffffff;
  color: #000000;
}

.performance-badge.blanc {
  background-color: #fef3c7;
  color: #e4e4e4;
}

.performance-badge.vert {
  background-color: #fed7aa;
  color: #1fdb3f;
}

.performance-badge.violet {
  background-color: #ffffff;
  color: #3e0077;
}

.performance-badge.bleu {
  background-color: #ffffff;
  color: #0483cc;
}

.performance-badge.gris {
  background-color: #ffffff;
  color: #666666;
}

.performance-badge.jaune {
  background-color: #ffffff;
  color: #ffee01;
}

.performance-badge.orange {
  background-color: #ffffff;
  color: #ff6600;
}
.performance-badge.rouge {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.gratifie {
  background-color: #d1fae5;
  color: #166534;
}

.status-badge.non-gratifie {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* Utils */
.font-medium {
  font-weight: 500;
}

.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Performance explanation */
.performance-explanation {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.performance-explanation h4 {
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.performance-explanation p {
  color: #64748b;
  margin-bottom: 1rem;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.performance-mode {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 1rem;
}

.performance-mode h5 {
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.performance-mode ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.performance-mode li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.performance-mode li:last-child {
  border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-top: 160px;
  }

  .main-content {
    padding: 1rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .tabs-nav.fixed-tabs {
    padding: 0 1rem;
  }

  .tabs-nav {
    flex-direction: column;
  }

  .tab-trigger {
    justify-content: center;
  }

  .form-inline .form-group:first-child {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-with-back {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .performance-grid {
    grid-template-columns: 1fr;
  }

  .performance-explanation {
    padding: 1rem;
  }

  .site-buttons {
    justify-content: center;
  }

  .import-form {
    padding: 1rem;
  }

  .file-upload-area {
    padding: 1.5rem;
  }

  .import-actions {
    flex-direction: column;
  }
}
