/* Variables globales — identité clinique étiopathie */
:root {
  --primary-color: #0f766e;
  --primary-light: #ecfdf8;
  --primary-dark: #115e59;
  --secondary-color: #64748b;
  --success-color: #15803d;
  --danger-color: #b91c1c;
  --warning-color: #b45309;
  --info-color: #0369a1;
  --light-color: #f1f5f9;
  --dark-color: #0f172a;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  --font-family-sans-serif: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --font-family-display: 'Fraunces', Georgia, serif;
  --font-family-monospace: 'IBM Plex Mono', ui-monospace, monospace;
  
  --sidebar-width: 260px;
  --header-height: 64px;
  --footer-height: 40px;
  --border-radius: 10px;
  --box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: var(--font-family-sans-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: var(--gray-100);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Layout principal */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--dark-color);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-header h1 {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: white;
  margin-bottom: 5px;
}

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-menu {
  list-style: none;
  padding: 20px 0;
  flex-grow: 1;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-left: 3px solid var(--primary-color);
}

.sidebar-menu a i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-info-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-small {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

#user-name-sidebar {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
}

.sidebar-footer a {
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  padding: 8px 0;
  transition: all 0.3s;
}

.sidebar-footer a:hover {
  color: white;
}

.sidebar-footer a i {
  margin-right: 10px;
}

/* Contenu principal */
.content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.content-header {
  height: var(--header-height);
  background-color: white;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 99;
}

.content-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
}

.user-info {
  display: flex;
  align-items: center;
}

.user-info span {
  margin-right: 10px;
  font-weight: 500;
  color: var(--gray-700);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

.content-body {
  padding: 20px;
  flex-grow: 1;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.content-footer {
  height: var(--footer-height);
  background-color: white;
  border-top: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gray-600);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  background-color: var(--gray-200);
  color: var(--gray-800);
}

.btn:hover {
  background-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn i {
  margin-right: 8px;
}

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

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

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

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

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

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

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

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

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

.btn-info:hover {
  background-color: #138496;
}

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

.btn-icon {
  padding: 8px;
  border-radius: 50%;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 111, 220, 0.2);
}

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

.checkbox-group {
  display: flex;
  align-items: center;
}

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

.checkbox-group label {
  margin-bottom: 0;
}

.form-error {
  color: var(--danger-color);
  font-size: 14px;
  margin-top: 8px;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--primary-light);
  border-radius: 8px 8px 0 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-600);
  transition: color 0.3s;
}

.close-btn:hover {
  color: var(--gray-800);
}

.modal-body {
  padding: 20px;
}

/* Tableaux */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-300);
}

.data-table th {
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.data-table tbody tr:hover {
  background-color: var(--gray-100);
}

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

/* Messages */
.empty-message {
  text-align: center;
  padding: 30px;
  color: var(--gray-500);
  font-style: italic;
  background-color: var(--gray-100);
  border-radius: 8px;
  margin: 20px 0;
}

/* Cartes */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body {
  color: var(--gray-700);
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 4px;
  background-color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: slideIn 0.3s, fadeOut 0.3s 3s forwards;
  max-width: 300px;
}

.notification.success {
  border-left: 4px solid var(--success-color);
}

.notification.error {
  border-left: 4px solid var(--danger-color);
}

.notification.info {
  border-left: 4px solid var(--info-color);
}

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

@keyframes fadeOut {
  to { opacity: 0; }
}

/* Utilitaires */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-danger {
  color: var(--danger-color);
}

.text-success {
  color: var(--success-color);
}

.text-warning {
  color: var(--warning-color);
}

.text-info {
  color: var(--info-color);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  
  .sidebar-header h1, .sidebar-header h3 {
    display: none;
  }
  
  .sidebar-menu a span {
    display: none;
  }
  
  .sidebar-menu a i {
    margin-right: 0;
  }
  
  .user-info-sidebar {
    justify-content: center;
  }
  
  #user-name-sidebar {
    display: none;
  }
  
  .sidebar-footer a span {
    display: none;
  }
  
  .content {
    margin-left: 60px;
  }
}

/* Dashboard */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

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

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 15px;
}

.stat-info h3 {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 5px;
  font-weight: 500;
}

.stat-info p {
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

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

.dashboard-section {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--primary-light);
  border-bottom: 1px solid var(--gray-200);
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.section-content {
  padding: 15px 20px;
  max-height: 350px;
  overflow-y: auto;
}

.appointment-item, .note-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid var(--gray-200);
  transition: background-color 0.3s;
}

.appointment-item:hover, .note-item:hover {
  background-color: var(--gray-100);
}

.appointment-time {
  font-weight: 600;
  margin-right: 15px;
  min-width: 60px;
}

.appointment-info {
  flex-grow: 1;
}

.appointment-patient {
  font-weight: 500;
}

.appointment-status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 5px;
}

.appointment-status.scheduled {
  background-color: var(--info-color);
  color: white;
}

.appointment-status.completed {
  background-color: var(--success-color);
  color: white;
}

.appointment-status.cancelled {
  background-color: var(--danger-color);
  color: white;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  flex-grow: 1;
}

.note-patient {
  font-weight: 500;
}

.note-date {
  font-size: 12px;
  color: var(--gray-600);
}

.note-content {
  color: var(--gray-700);
  margin-bottom: 10px;
  white-space: pre-line;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

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

/* Notes de frais */
.expenses-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.search-container {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 4px;
  padding: 5px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 300px;
}

.search-container input {
  border: none;
  outline: none;
  background: transparent;
  flex-grow: 1;
  font-size: 14px;
  margin-right: 10px;
}

.filter-container {
  display: flex;
  gap: 10px;
}

.filter-container select {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  background-color: white;
  font-size: 14px;
  min-width: 150px;
}

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

.expenses-list-container {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

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

.info-label {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.info-value {
  font-size: 16px;
  font-weight: 500;
}

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

.expense-title {
  font-size: 18px;
  font-weight: 600;
}

.expense-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  font-weight: 500;
}

.expense-status.draft {
  background-color: var(--warning-color);
  color: #212529;
}

.expense-status.sent {
  background-color: var(--info-color);
  color: white;
}

.expense-status.paid {
  background-color: var(--success-color);
  color: white;
}

.expense-status.cancelled {
  background-color: var(--danger-color);
  color: white;
}

.expense-description, .expense-appointment {
  margin-bottom: 20px;
}

.expense-description h4, .expense-appointment h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--gray-700);
}

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

.form-section {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}

.form-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--gray-700);
}

/* Cartes de notes de frais (onglet "Notes de frais" de la fiche patient) */
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.expense-item {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.expense-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.expense-item .expense-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  margin-bottom: 0;
  background-color: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.expense-item .expense-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expense-item .expense-title {
  flex-grow: 1;
  font-size: 15px;
  font-weight: 600;
}

.expense-item .expense-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
}

.expense-number {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.expense-date {
  font-size: 12px;
  color: var(--gray-500);
}

.expense-amount {
  text-align: right;
}

.expense-amount .amount {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
  display: block;
}

.expense-amount .amount-details {
  font-size: 11px;
  color: var(--gray-500);
}

.expense-item .expense-header.status-draft {
  background-color: #ffecb5;
}

.expense-item .expense-header.status-sent {
  background-color: #b8daff;
}

.expense-item .expense-header.status-paid {
  background-color: #c3e6cb;
}

.expense-item .expense-header.status-cancelled {
  background-color: #f8d7da;
}

.expenses-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.expense-tab-btn {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  background-color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.2s;
}

.expense-tab-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Avatars en initiales (remplace les images placeholder distantes) */
.avatar,
.avatar-small {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
}

.avatar {
  font-size: 16px;
}

.avatar-small {
  font-size: 12px;
}

@media (max-width: 768px) {
  .expenses-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .search-container {
    max-width: 100%;
  }
  
  .filter-container {
    width: 100%;
  }
  
  .filter-container select {
    flex: 1;
  }
  
  #add-expense-btn {
    width: 100%;
    margin-top: 10px;
  }
} 