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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: #14213d;
  line-height: 1.5;
}
.dashboard-body {
  padding: 20px;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
  color: #14213d;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 8px;
}

.header-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

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

.header p {
  color: #6c757d;
  font-size: 16px;
}

.config-section {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-section h2 {
  color: #14213d;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #3b82f6;
  padding-bottom: 8px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #495057;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(63, 185, 189, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  margin-right: 8px;
}

.btn:hover {
  background: #3b82f6;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

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

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

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

.stats-section {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-header {
  padding: 16px 24px;
  border-bottom: 1px solid #3b82f6;
  background: #f8f9fa;
}

.stats-header h2 {
  color: #14213d;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  border-bottom: 1px solid #dee2e6;
}

.stat-item {
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid #dee2e6;
  min-width: 120px;
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 20px;
  font-weight: 600;
  color: #14213d;
  margin-bottom: 4px;
}

.stat-label {
  color: #6c757d;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Styles pour les icônes des statistiques */
.stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  margin: 0 auto 12px auto;

  transition: all 0.3s ease;
}

.stat-item:hover .stat-icon {
  transform: scale(1.1);
}

/* Couleurs spécifiques pour chaque icône */
.stat-item:nth-child(1) .stat-icon {
  color: white;
}

.stat-item:nth-child(2) .stat-icon {
  color: white;
}

.stat-item:nth-child(3) .stat-icon {
  color: #212529;
}

.stat-item:nth-child(4) .stat-icon {
  color: white;
}

.stat-item:nth-child(5) .stat-icon {
  color: white;
}

/* Dashboard overview: smaller icons, number inline with icon */
.dashboard-overview .stat-item {
  padding: 8px 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dashboard-overview .stat-icon {
  font-size: 12px;
  height: 20px;
  width: 20px;
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-overview .stat-number {
  font-size: 16px;
  margin: 0;
}

.dashboard-overview .stat-label {
  font-size: 10px;
  flex-basis: 100%;
  text-align: center;
  margin-top: 2px;
}

.calls-section {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calls-header {
  padding: 16px 24px;
  border-bottom: 1px solid #3b82f6;
  background: #f8f9fa;
}

.calls-header h2 {
  color: #14213d;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.filters {
  display: flex;
  gap: 12px;
  margin: auto;
  margin: 16px 24px;
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.filter-group label {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 13px;
}

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

.calls-table th {
  background: #f8f9fa;
  color: #14213d;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid #3b82f6;
}

.calls-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
  vertical-align: top;
}

.calls-table tr:hover {
  background: rgba(63, 185, 189, 0.05);
}

.call-id {
  font-family: "Courier New", monospace;
  background: #e9ecef;
  color: #495057;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.badge-resolved {
  background: rgba(63, 185, 189, 0.1);
  color: #14213d;
  border: 1px solid #3b82f6;
}

.badge-escalated {
  background: rgba(220, 53, 69, 0.1);
  color: #721c24;
  border: 1px solid #dc3545;
}

.badge-callback_needed {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
  border: 1px solid #ffc107;
}

.badge-information_only {
  background: rgba(63, 185, 189, 0.1);
  color: #14213d;
  border: 1px solid #3b82f6;
}

/* New badge for appointment request */
.badge-appointment_scheduled {
  background: rgba(0, 123, 255, 0.1);
  color: #0d6efd;
  border: 1px solid #0d6efd;
}

.badge-emergency {
  background: rgba(220, 53, 69, 0.1);
  color: #721c24;
  border: 1px solid #dc3545;
}

.badge-high {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
  border: 1px solid #ffc107;
}

.badge-medium {
  background: rgba(63, 185, 189, 0.1);
  color: #14213d;
  border: 1px solid #3b82f6;
}

.badge-low {
  background: rgba(63, 185, 189, 0.05);
  color: #14213d;
  border: 1px solid #3b82f6;
}

.badge-positive {
  background: rgba(63, 185, 189, 0.1);
  color: #14213d;
  border: 1px solid #3b82f6;
}

.badge-negative {
  background: rgba(220, 53, 69, 0.1);
  color: #721c24;
  border: 1px solid #dc3545;
}

.badge-neutral {
  background: rgba(63, 185, 189, 0.05);
  color: #14213d;
  border: 1px solid #3b82f6;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-style: italic;
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  border: 1px solid #f5c6cb;
}

.success {
  background: #d4edda;
  color: #155724;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  border: 1px solid #c3e6cb;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: white;
  margin: 3% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid #3b82f6;
}

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

.modal-header h2 {
  margin: 0;
  color: #14213d;
  font-size: 20px;
  font-weight: 600;
}

.close {
  color: #6c757d;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px;
}

.close:hover {
  color: #212529;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.detail-value {
  color: #14213d;
  font-weight: 500;
  font-size: 14px;
}

.transcript {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 16px;
  margin-top: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.transcript-entry {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #dee2e6;
}

.transcript-agent {
  background: white;
  border-left-color: #495057;
}

.transcript-user {
  background: #f1f3f4;
  border-left-color: #6c757d;
}

.transcript-speaker {
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
}

.ai-insights {
  background: #f1f3f4;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 16px;
  margin: 16px 0;
}

.ai-insights h4 {
  color: #495057;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.phone-number {
  color: #6c757d;
  font-size: 13px;
  font-family: "Courier New", monospace;
}

.summary-text {
  font-style: italic;
  color: #6c757d;
  font-size: 13px;
  margin: 8px 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 3px;
  border-left: 3px solid #dee2e6;
}

/* Styles pour les formulaires de notes */
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(63, 185, 189, 0.1);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.form-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.info-box {
  background-color: rgba(63, 185, 189, 0.1);
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 12px;
  margin: 16px 0;
}

.info-box p {
  margin: 0;
  color: #14213d;
  font-size: 14px;
  line-height: 1.4;
}

/* Styles pour les badges de notes */
.notes-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notes-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.notes-indicator.has-notes {
  background: #28a745;
}

.notes-indicator.no-notes {
  background: #6c757d;
}

.notes-indicator.processed {
  background: #28a745;
}

.notes-indicator.pending {
  background: #ffc107;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .filters {
    flex-direction: column;
  }
  .calls-table {
    font-size: 12px;
  }
  .calls-table th,
  .calls-table td {
    padding: 8px;
  }
}

/* Footer Styles */
.footer {
  background: white;
  border-top: 1px solid #3b82f6;
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content p {
  margin: 5px 0;
  color: #6c757d;
  font-size: 14px;
}

.footer-content a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.footer-content a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* Navigation Styles */
.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: #6c757d;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #14213d;
  background: rgba(63, 185, 189, 0.1);
}

.nav-link.active {
  color: #3b82f6;
  background: rgba(63, 185, 189, 0.1);
}

/* Styles pour les tabulations de statut */
.status-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 20px;
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
}

.tab-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.tab-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 2px 4px rgba(63, 185, 189, 0.3);
}

.tab-btn.active:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Badges pour les statuts de conversation */
.badge-new {
  background: #17a2b8;
  color: white;
}

.badge-in_progress {
  background: #ffc107;
  color: #212529;
}

.badge-completed {
  background: #28a745;
  color: white;
}

/* Boutons d'action pour changer le statut */
.status-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.status-btn {
  padding: 4px 8px;
  font-size: 11px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-btn-new {
  background: #17a2b8;
  color: white;
}

.status-btn-new:hover {
  background: #138496;
}

.status-btn-in_progress {
  background: #ffc107;
  color: #212529;
}

.status-btn-in_progress:hover {
  background: #e0a800;
}

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

.status-btn-completed:hover {
  background: #218838;
}

/* Styles pour le dropdown de statut */
.status-dropdown {
  background: white;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  width: 100%;
  font-weight: 500;
}

.status-dropdown:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(63, 185, 189, 0.1);
}

.status-dropdown option {
  padding: 4px;
}

/* Styles pour les options du dropdown selon le statut */
.status-dropdown option[value="new"] {
  color: #17a2b8;
}

.status-dropdown option[value="in_progress"] {
  color: #ffc107;
}

.status-dropdown option[value="completed"] {
  color: #28a745;
}

/* Styles pour les checkboxes de statut */
.status-checkboxes {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.status-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  font-size: 14px;
}

.status-checkbox:hover {
  border-color: #3b82f6;
  background: rgba(63, 185, 189, 0.1);
}

.status-checkbox.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 4px rgba(63, 185, 189, 0.3);
}

.status-checkbox.active:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Styles spécifiques pour chaque statut */
.status-checkbox[onclick*="new"]:hover {
  border-color: #17a2b8;
  background: rgba(23, 162, 184, 0.1);
}

.status-checkbox[onclick*="new"].active {
  border-color: #17a2b8;
  background: #17a2b8;
}

.status-checkbox[onclick*="in_progress"]:hover {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

.status-checkbox[onclick*="in_progress"].active {
  border-color: #ffc107;
  background: #ffc107;
  color: #212529;
}

.status-checkbox[onclick*="completed"]:hover {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.status-checkbox[onclick*="completed"].active {
  border-color: #28a745;
  background: #28a745;
}

/* Agrandir la colonne Actions & Statut */
.calls-table th:last-child,
.calls-table td:last-child {
  min-width: 200px;
  width: 1%;
  /* force la colonne à ne pas se compresser */
  padding-right: 16px;
}

/* Styles pour mobile - Transformer le tableau en cartes */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .filters {
    flex-direction: column;
  }

  /* Cacher le tableau sur mobile et afficher les cartes */
  .calls-table {
    display: none;
  }

  /* Styles pour les cartes d'appels sur mobile */
  .calls-cards {
    display: block;
  }

  .call-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .call-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .call-id-mobile {
    font-family: "Courier New", monospace;
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
  }

  .call-date-mobile {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
  }

  .call-patient-mobile {
    font-weight: 600;
    color: #14213d;
    margin-bottom: 8px;
  }

  .call-phone-mobile {
    color: #6c757d;
    font-size: 13px;
    font-family: "Courier New", monospace;
    margin-bottom: 8px;
  }

  .call-stats-mobile {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .call-badge-mobile {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .call-notes-mobile {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
  }

  .call-notes-status-mobile {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .call-summary-mobile {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-top: 4px;
  }

  .call-actions-mobile {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .call-btn-mobile {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
  }

  .call-btn-mobile.primary {
    background: #3b82f6;
    color: white;
  }

  .call-btn-mobile.secondary {
    background: #6c757d;
    color: white;
  }

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

  .call-btn-mobile:hover {
    opacity: 0.8;
  }

  .call-status-mobile {
    margin-bottom: 8px;
  }

  .status-dropdown-mobile {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    background: white;
  }
}

/* Cacher les éléments desktop-only sur mobile */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  /* Optimiser l'affichage du patient sur mobile */
  .patient-name {
    font-weight: 600;
    color: #14213d;
    margin-bottom: 2px;
  }

  .phone-number {
    color: #6c757d;
    font-size: 11px;
    font-family: "Courier New", monospace;
  }
}

/* Styles pour mobile - Header responsive et tableau simplifié */
@media (max-width: 768px) {
  /* Header responsive */
  .header {
    padding: 16px;
  }

  .header h1 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .header p {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-logo {
    height: 40px;
  }

  /* Réorganiser la navigation mobile */
  .header > div {
    flex-direction: column;
    gap: 16px;
  }

  .nav-menu {
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    width: 100%;
  }

  .nav-link {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Cacher les filtres sur mobile */
  .filters {
    display: none !important;
  }

  /* Cacher le choix d'interface sur mobile */
  .status-tabs .btn[onclick*="toggleStatusInterface"] {
    display: none !important;
  }

  .status-tabs span {
    display: none !important;
  }

  /* Cacher les cartes sur mobile */
  .calls-cards {
    display: none !important;
  }

  /* Garder le tableau mais simplifié */
  .calls-table {
    display: table !important;
    font-size: 12px;
  }

  .calls-table th,
  .calls-table td {
    padding: 6px 4px;
  }

  /* Cacher l'ID de l'appel sur mobile */
  .calls-table th:first-child,
  .calls-table td:first-child {
    display: none;
  }

  /* Colonnes: 1=ID, 2=Patient, 3=Date, 4=Notes & Résumé, 5=Actions */
  .calls-table th:nth-child(4),
  .calls-table td:nth-child(4) {
    display: table-cell;
  }

  /* Ajuster la largeur des colonnes sur mobile */
  .calls-table th:nth-child(2),
  .calls-table td:nth-child(2) {
    width: 28%;
  }

  .calls-table th:nth-child(3),
  .calls-table td:nth-child(3) {
    width: 22%;
  }

  .calls-table th:nth-child(4),
  .calls-table td:nth-child(4) {
    width: 35%;
  }

  .calls-table th:nth-child(5),
  .calls-table td:nth-child(5) {
    width: 15%;
  }

  /* Simplifier l'affichage des notes/résumé */
  .calls-table td:nth-child(4) {
    font-size: 11px;
    line-height: 1.3;
  }

  /* Ajuster les autres éléments */
  .form-row {
    grid-template-columns: 1fr;
  }

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

  .filter-group {
    min-width: auto;
  }
}

/* Cacher les cartes sur desktop */
.calls-cards {
  display: none;
}

/* Styles pour le bouton audio */
.audio-btn {
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.audio-btn:hover {
  background: #138496;
  transform: scale(1.02);
}

.audio-btn:active {
  transform: scale(0.98);
}

/* Cacher le bouton audio sur desktop */
@media (min-width: 769px) {
  .audio-btn {
    display: none;
  }
}

/* Styles pour le bouton d'appel du patient */
.call-patient-btn {
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.call-patient-btn:hover {
  background: #218838;
  transform: scale(1.02);
}

.call-patient-btn:active {
  transform: scale(0.98);
}

/* Cacher le bouton sur desktop */
@media (min-width: 769px) {
  .call-patient-btn {
    display: none;
  }
}

/* Animation de disparition pour les lignes effacées */
.calls-table tr.fade-out {
  animation: fadeOutRow 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes fadeOutRow {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
  50% {
    opacity: 0.5;
    transform: translateX(-20px);
    max-height: 80px;
  }
  100% {
    opacity: 0;
    transform: translateX(-100%);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

/* Animation pour les cartes mobiles */
.call-card.fade-out {
  animation: fadeOutCard 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes fadeOutCard {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 200px;
  }
  50% {
    opacity: 0.5;
    transform: scale(0.95);
    max-height: 150px;
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

/* Styles pour les statistiques avancées */
.advanced-stats-section {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-controls select {
  padding: 6px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

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

.chart-container {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-container h3 {
  color: #14213d;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
  flex-shrink: 0;
}

.chart-container canvas {
  flex: 1;
  max-height: 250px;
  width: 100% !important;
  height: 100% !important;
}

/* Responsive pour les graphiques */
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .chart-container {
    padding: 16px;
  }

  .chart-container h3 {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .stats-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Styles pour les tabulations des statistiques */
.stats-tabs-section {
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-tabs-header {
  display: flex;
  border-bottom: 1px solid #3b82f6;
  background: #f8f9fa;
}

.stats-tab-btn {
  background: transparent;
  border: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 500;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  flex: 1;
  text-align: center;
}

.stats-tab-btn:hover {
  background: rgba(63, 185, 189, 0.1);
  color: #14213d;
}

.stats-tab-btn.active {
  background: white;
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

.stats-content {
  padding: 0;
}

.stats-content:not(:first-child) {
  display: none;
}

/* Responsive pour les tabulations */
@media (max-width: 768px) {
  .stats-tabs-header {
    flex-direction: column;
  }

  .stats-tab-btn {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #dee2e6;
  }

  .stats-tab-btn.active {
    border-bottom-color: #3b82f6;
  }
}

/* Styles pour les liens désactivés */
.nav-link-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.nav-link-disabled:hover {
  opacity: 0.5;
}
