* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
  opacity: 0.9;
  font-size: 1.1em;
}

.settings-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.logout-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.content {
  padding: 30px;
}

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

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
  border-left: 5px solid;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card.pending {
  border-left-color: #ff6b6b;
}
.stat-card.first-followup {
  border-left-color: #ffa726;
}
.stat-card.second-followup {
  border-left-color: #ff5722;
}
.stat-card.interested {
  border-left-color: #4caf50;
}
.stat-card.refused {
  border-left-color: #9e9e9e;
}
.stat-card.future {
  border-left-color: #2196f3;
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #333;
}

.stat-label {
  color: #666;
  margin-top: 5px;
  font-size: 0.9em;
}

.form-section {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.form-section h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  color: #555;
  font-weight: 600;
  margin-bottom: 5px;
}

.form-group input,
.form-group select {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.search-section {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: #667eea;
  color: white;
}

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

.pagination .current {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.status-select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  min-width: 150px;
}

.status-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Liste mobile simplifiée */
.mobile-client-list {
  display: none;
}

.mobile-client-item {
  background: white;
  margin-bottom: 10px;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid #667eea;
}

.mobile-client-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-client-item.urgent {
  border-left-color: #ff5722;
}

.mobile-client-item.warning {
  border-left-color: #ff9800;
}

.mobile-client-item.success {
  border-left-color: #4caf50;
}

.mobile-client-name {
  font-weight: bold;
  font-size: 1.1em;
  color: #333;
  margin-bottom: 5px;
}

.mobile-client-info {
  font-size: 0.9em;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-client-days {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
}

.mobile-client-days.urgent {
  background: #ffebee;
  color: #d32f2f;
}

.mobile-client-days.warning {
  background: #fff3e0;
  color: #f57c00;
}

.mobile-client-days.normal {
  background: #e3f2fd;
  color: #1976d2;
}

.mobile-client-status {
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  color: #fff;
}

/* Utiliser les mêmes couleurs que la version PC */
.mobile-client-status.pending {
  background: #2196f3;
}

.mobile-client-status.warning,
.mobile-client-status.first-followup {
  background: #ff9800;
}

.mobile-client-status.urgent,
.mobile-client-status.second-followup {
  background: #f44336;
}

.mobile-client-status.success,
.mobile-client-status.interested {
  background: #4caf50;
}

.mobile-client-status.refused {
  background: #9e9e9e;
}

.mobile-client-status.future {
  background: #673ab7;
}

.mobile-client-status.first-followup-sent {
  background: #8bc34a;
}

.mobile-client-days {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
}

.mobile-client-days.urgent {
  background: #ffebee;
  color: #d32f2f;
}

.mobile-client-days.warning {
  background: #fff3e0;
  color: #f57c00;
}

.mobile-client-days.normal {
  background: #e3f2fd;
  color: #1976d2;
}

.mobile-client-days.success {
  background: #e8f5e8;
  color: #2e7d32;
}

.mobile-client-days.refused {
  background: #f5f5f5;
  color: #666;
}

.mobile-client-days.future {
  background: #f3e5f5;
  color: #7b1fa2;
}

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

.section {
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.section-header {
  padding: 20px;
  font-weight: bold;
  color: white;
  text-align: center;
}

.section-header.urgent {
  background: linear-gradient(135deg, #ff6b6b, #ff5722);
}

.section-header.warning {
  background: linear-gradient(135deg, #ffa726, #ff9800);
}

.section-header.success {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.section-header.neutral {
  background: linear-gradient(135deg, #9e9e9e, #757575);
}

.section-header.info {
  background: linear-gradient(135deg, #2196f3, #1976d2);
}

.client-card {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.3s ease;
}

.client-card:hover {
  background-color: #f8f9fa;
}

.client-card:last-child {
  border-bottom: none;
}

.client-name {
  font-weight: bold;
  color: #333;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.client-info {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.client-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.date-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

.date-badge.initial {
  background: #e3f2fd;
  color: #1976d2;
}

.date-badge.first {
  background: #fff3e0;
  color: #f57c00;
}

.date-badge.second {
  background: #ffebee;
  color: #d32f2f;
}

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

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn.refuse {
  background: #ffcdd2;
  color: #d32f2f;
}

.action-btn.interest {
  background: #c8e6c9;
  color: #388e3c;
}

.action-btn.future {
  background: #bbdefb;
  color: #1976d2;
}

.action-btn.call {
  background: #f8bbd9;
  color: #c2185b;
}

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

.urgency-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.urgency-high {
  background: #ff5722;
}

.urgency-medium {
  background: #ff9800;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Styles pour le système de connexion */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-box h2 {
  color: #333;
  margin-bottom: 30px;
  font-size: 2em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-input {
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.login-input:focus {
  outline: none;
  border-color: #667eea;
}

.login-btn {
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
}

.error-message {
  color: #f44336;
  margin-top: 10px;
  font-size: 14px;
}

/* Styles pour le modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-x: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 25px 30px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.5em;
  font-weight: bold;
}

.modal-header.pending-header {
  background: linear-gradient(135deg, #2196f3, #1976d2);
}

.modal-header.first-followup-header {
  background: linear-gradient(135deg, #ffa726, #ff9800);
}

.modal-header.second-followup-header {
  background: linear-gradient(135deg, #ff6b6b, #ff5722);
}

.modal-header.interested-header {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.modal-header.refused-header {
  background: linear-gradient(135deg, #9e9e9e, #757575);
}

.modal-header.future-header {
  background: linear-gradient(135deg, #673ab7, #512da8);
}

.modal-header.settings-header {
  background: linear-gradient(135deg, #607d8b, #455a64);
}

.modal-header.client-detail-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.close {
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.close:hover {
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
}

.modal-clients {
  display: grid;
  gap: 15px;
}

.modal-client-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  border-left: 5px solid;
  transition: transform 0.2s ease;
}

.modal-client-card:hover {
  transform: translateX(5px);
}

.modal-client-card.pending-card {
  border-left-color: #2196f3;
}
.modal-client-card.first-followup-card {
  border-left-color: #ff9800;
}
.modal-client-card.second-followup-card {
  border-left-color: #f44336;
}
.modal-client-card.interested-card {
  border-left-color: #4caf50;
}
.modal-client-card.refused-card {
  border-left-color: #9e9e9e;
}
.modal-client-card.future-card {
  border-left-color: #673ab7;
}

.import-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  border: 2px dashed #dee2e6;
}

.file-input {
  display: none;
}

.file-label {
  display: inline-block;
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.file-label:hover {
  background: #5a6268;
}

.settings-form {
  display: grid;
  gap: 20px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group label {
  font-weight: 600;
  color: #333;
}

.settings-group input {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
}

.settings-group input:focus {
  outline: none;
  border-color: #667eea;
}

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Modal détail client */
.client-detail-content {
  padding: 20px;
}

.client-detail-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.client-detail-name {
  font-size: 1.4em;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.client-detail-type {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 10px;
}

.client-detail-email {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.client-detail-info {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.client-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.client-detail-label {
  font-weight: 600;
  color: #555;
}

.client-detail-value {
  color: #333;
}

.client-detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.client-detail-actions select {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
}

.client-detail-actions button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-detail-actions .notes-btn {
  background: #2196f3;
  color: white;
}

.client-detail-actions .delete-btn {
  background: #ff5722;
  color: white;
}

/* RESPONSIVENESS MOBILE */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    border-radius: 15px;
  }

  .header {
    padding: 20px 15px;
    position: relative;
  }

  .header h1 {
    font-size: 1.8em;
    margin-bottom: 8px;
  }

  .header p {
    font-size: 0.95em;
  }

  .settings-btn,
  .logout-btn {
    position: static;
    margin: 10px 5px 0 5px;
    padding: 8px 12px;
    font-size: 0.8em;
    display: inline-block;
  }

  .content {
    padding: 20px 15px;
  }

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

  .stat-card {
    padding: 15px 10px;
  }

  .stat-number {
    font-size: 2em;
  }

  .stat-label {
    font-size: 0.8em;
  }

  .form-section {
    padding: 20px 15px;
    margin-bottom: 20px;
  }

  .form-section h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .search-section {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .search-input {
    min-width: auto;
    width: 100%;
  }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
  }
  .import-section .btn {
    margin-left: 0 !important;
  }

  .modal-content {
    width: 95%;
    margin: 5vh auto;
    max-height: 85vh;
    border-radius: 15px;
  }

  .modal-header {
    padding: 20px 15px;
    font-size: 1.2em;
  }

  .modal-body {
    padding: 20px 15px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: calc(85vh - 80px);
  }

  .table-container {
    display: none;
  }

  .mobile-client-list {
    display: block;
  }

  .status-select {
    min-width: 120px;
    font-size: 12px;
    padding: 6px 8px;
  }

  .pagination {
    gap: 5px;
    justify-content: center;
  }

  .pagination button {
    padding: 6px 10px;
    font-size: 0.9em;
  }

  .import-section {
    padding: 15px;
  }

  .file-label {
    padding: 8px 15px;
    font-size: 0.9em;
    display: block;
    text-align: center;
    margin-bottom: 10px;
  }

  .login-box {
    padding: 30px 20px;
    margin: 20px;
  }

  .login-box h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
  }

  .modal-client-card {
    padding: 15px;
  }

  .settings-actions {
    flex-direction: column;
    gap: 10px;
  }

  .settings-actions button {
    width: 100%;
  }

  .client-detail-actions {
    gap: 15px;
  }
}

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

  .stat-card {
    padding: 12px 8px;
  }

  .stat-number {
    font-size: 1.6em;
  }

  .stat-label {
    font-size: 0.75em;
  }

  .header h1 {
    font-size: 1.5em;
  }

  .form-section h2 {
    font-size: 1.2em;
  }

  .modal-header {
    font-size: 1.1em;
    padding: 15px 10px;
  }

  .close {
    font-size: 28px;
  }

  .mobile-client-item {
    padding: 12px;
  }

  .mobile-client-name {
    font-size: 1em;
  }

  .mobile-client-info {
    font-size: 0.85em;
  }
  .form-group input,
  .form-group select {
    width: 100%;
  }
}

/* Version desktop - afficher le tableau */
@media (min-width: 769px) {
  .table-container {
    overflow-x: auto;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  th,
  td {
    padding: 12px 15px;
    font-size: 0.9em;
  }

  th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: left;
    font-weight: 600;
  }
}

/* Transition douce pour l'apparition/disparition des cartes */
.stat-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Animation d'apparition */
.stat-card:not([style*="display: none"]) {
  animation: slideInCard 0.4s ease-out;
}

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

/* Grille adaptative améliorée */
.stats {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
  transition: grid-template-columns 0.3s ease;
  align-items: start;
}

/* Responsive amélioré pour l'affichage conditionnel */
@media (max-width: 1200px) {
  .stats {
    gap: 15px;
  }
}

@media (max-width: 900px) {
  .stats {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
    min-height: 120px;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
}

/* Style pour quand il y a peu de cartes */
.stats.few-cards {
  justify-content: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* Amélioration visuelle pour les cartes importantes */
.stat-card.urgent-attention {
  position: relative;
  overflow: hidden;
}

.stat-card.urgent-attention::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f44336, transparent);
  animation: urgentPulse 2s infinite;
}

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