:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #8b5cf6;
  --secondary: #f0f4ff;
  --accent: #a78bfa;
  --surface: #ffffff;
  --background: #f8faff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #a5b4fc;
  --secondary: rgba(99, 102, 241, 0.1);
  --accent: #c4b5fd;
  --surface: #1e293b;
  --background: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--background);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
}

.card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .btn-secondary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
  background: #e0e7ff;
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}

.nav-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  gap: 0;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-item.active {
  background: var(--secondary);
  color: var(--primary);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.nav-item:hover:not(.active) {
  background: rgba(99, 102, 241, 0.05);
  color: var(--primary);
}

[data-theme="dark"] .nav-item:hover:not(.active) {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-light);
}

.kanban-column {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  min-width: 250px;
  min-height: 600px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
}

/* === CARTES KANBAN EN ACCORDÉON === */
.kanban-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
  cursor: grab;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .kanban-card {
  background: #1a2435;
  color: var(--text-primary);
}

.kanban-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
/* === BULLETS KANBAN === */
.kanban-card .card-header .flex.items-center.gap-2 {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.kanban-card .card-title {
  margin: 0 !important;
}

/* En-tête de carte (toujours visible) */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  cursor: pointer;
}

.card-title-section {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 4px 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-client {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.card-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  margin-left: 8px;
  flex-shrink: 0;
}

.card-toggle:hover {
  background: var(--background);
  color: var(--primary);
}

/* Contenu dépliable */
.card-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
}

.card-content.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 12px;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

/* Footer (toujours visible) */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* États des cartes */
.kanban-card.validated {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left-color: #10b981;
}

[data-theme="dark"] .kanban-card.validated {
  background: linear-gradient(135deg, #1a3a2a 0%, #1e4530 100%);
}

.kanban-card.validated::after {
  content: "✓ Validé";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.kanban-card.urgent {
  border-left-color: #ef4444;
}

.kanban-card.normal {
  border-left-color: #f59e0b;
}

.kanban-card.low {
  border-left-color: #10b981;
}

/* === CORRECTIONS FULLCALENDAR === */
.fc {
  font-family: "Poppins", sans-serif !important;
}

.fc-toolbar-title {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  font-size: 1.5rem !important;
}

.fc-button {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  padding: 8px 16px !important;
}

.fc-button:hover {
  background: var(--secondary) !important;
  transform: translateY(-2px) !important;
}

[data-theme="dark"] .fc-button:hover {
  background: var(--secondary) !important;
}

.fc-button-active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.fc-day-today {
  background: rgba(99, 102, 241, 0.05) !important;
}

[data-theme="dark"] .fc-day-today {
  background: rgba(99, 102, 241, 0.1) !important;
}

/* STYLE ULTIME DES ÉVÉNEMENTS AVEC CURSEUR MAIN */
.fc-event {
  position: relative;
  border: none !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  margin: 1px 2px !important;
  cursor: grab !important;
}

/* === TOOLTIP STYLISÉ POUR ÉVÉNEMENTS === */
.fc-event:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 1000;
  pointer-events: none;
  font-weight: 500;
  backdrop-filter: blur(10px);
  margin-bottom: 5px;
}

/* Flèche du tooltip */
.fc-event:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
  z-index: 1001;
  margin-bottom: -5px;
}

/* Empêcher le débordement du texte */
.fc-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.fc-event:hover {
  cursor: grab !important;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* Événements journée complète */
.fc-event.allday-event {
  border-radius: 8px !important;
  padding: 6px 8px !important;
}

/* Événements avec heures (bullet points) */
.fc-event.timed-event {
  background: transparent !important;
  border-left: 4px solid !important;
  border-radius: 0 8px 8px 0 !important;
  padding: 2px 8px !important;
  margin-left: 4px !important;
}

.fc-event.rdv.allday-event {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%) !important;
  color: white !important;
}

.fc-event.rdv.timed-event {
  border-left-color: #a78bfa !important;
  color: #7c3aed !important;
  background: rgba(167, 139, 250, 0.1) !important;
}

[data-theme="dark"] .fc-event.rdv.timed-event {
  color: #c4b5fd !important;
  background: rgba(167, 139, 250, 0.15) !important;
}

.fc-event.task.allday-event {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  color: white !important;
}

.fc-event.task.timed-event {
  border-left-color: #10b981 !important;
  color: #059669 !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] .fc-event.task.timed-event {
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}
[data-theme="dark"] .fc-event.timed-event .text-gray-600 {
  color: #f1f5f9 !important; /* ← Blanc cassé pour meilleure lisibilité */
}

/* STYLE POUR ÉVÉNEMENTS VALIDÉS DANS LE CALENDRIER */
.fc-event.validated {
  opacity: 0.7;
  filter: grayscale(0.3);
}

.fc-event.validated::after {
  content: " ✓";
  font-weight: bold;
}

/* === CORRECTIONS FULLCALENDAR PLEINE LARGEUR === */
.calendar-container {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  width: 100% !important;
  box-sizing: border-box;
  min-height: 750px;
}
.fc-timegrid-slots table {
  height: auto !important;
}

.fc-timegrid-slot {
  height: 45px !important;
  min-height: 45px !important;
}

/* === CORRECTIONS SPÉCIFIQUES VUE MOIS === */
.fc-daygrid-day-frame {
  min-height: 120px !important; /* Force une hauteur minimale */
  height: 100% !important;
}

.fc-daygrid-day-events {
  min-height: 80px !important; /* Plus d'espace pour les événements */
}

.fc-daygrid-day {
  height: 100% !important;
}

.fc-daygrid-body-balanced .fc-daygrid-day-frame {
  height: 100% !important;
}

/* Ajuste la hauteur des cellules selon l'espace disponible */
.fc .fc-daygrid-day.fc-day-today {
  min-height: 120px !important;
}

.sidebar.collapsed ~ .main-content .calendar-container {
  width: 100% !important;
}

/* Forcer FullCalendar à prendre toute la largeur */
.fc-view-harness {
  width: 100% !important;
}

.fc-scrollgrid {
  width: 100% !important;
}

.fc-daygrid-body {
  width: 100% !important;
}

.fc-col-header {
  width: 100% !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* MODALES ÉLARGIES - PLUS DE SCROLL HORIZONTAL */
.modal-content {
  background: var(--surface);
  border-radius: 20px;
  padding: 30px;
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: all 0.3s ease;
  color: var(--text-primary);
}

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

.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}

.floating-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.6);
}

.create-menu {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
  min-width: 200px;
  border: 1px solid var(--border);
}

.create-menu.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification {
  position: fixed;
  top: 30px;
  right: 30px;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateX(400px);
  transition: all 0.5s ease;
  border-left: 4px solid var(--primary);
  color: var(--text-primary);
}

.notification.show {
  transform: translateX(0);
}

.notification.error {
  border-left-color: #ef4444;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.urgent {
  background: #fef2f2;
  color: #dc2626;
}

[data-theme="dark"] .badge.urgent {
  background: #431c1c;
  color: #fca5a5;
}

.badge.normal {
  background: #fffbeb;
  color: #d97706;
}

[data-theme="dark"] .badge.normal {
  background: #43381c;
  color: #fde68a;
}

.badge.low {
  background: #f0fdf4;
  color: #059669;
}

[data-theme="dark"] .badge.low {
  background: #1c3a2c;
  color: #86efac;
}

.badge.done {
  background: #f0f9ff;
  color: #0369a1;
}

[data-theme="dark"] .badge.done {
  background: #1e3a52;
  color: #7dd3fc;
}

/* PADDING ULTRA RENFORCÉ SUR TOUS LES CHAMPS */
input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px !important;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 15px;
  color: var(--text-primary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1a2435;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
}

.sidebar {
  width: 260px;
  background: var(--surface);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: var(--shadow);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  border-right: 1px solid var(--border);
  transition: all 0.3s ease;
  overflow-x: hidden;
}

.main-content {
  margin-left: 260px;
  padding: 30px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  width: calc(100% - 260px);
}

.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
  width: calc(100% - 70px);
}

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

.date-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-toggle {
  display: flex;
  background: var(--secondary);
  border-radius: 12px;
  padding: 8px;
}

[data-theme="dark"] .view-toggle {
  background: #1a2435;
  border: 1px solid var(--border);
}

.view-option {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.view-option.active {
  background: var(--primary);
  color: white;
}

.kanban-container {
  display: flex;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px !important;
  padding: 16px;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 8px;
  position: relative;
}

.day-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.date-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.task-count {
  background: var(--primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

[data-theme="dark"] .empty-state i {
  opacity: 0.3;
}

.empty-state p {
  margin: 0;
}

.validation-btn {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.validation-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.validation-btn.reopen {
  background: #f59e0b;
}

.validation-btn.reopen:hover {
  background: #d97706;
}

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

.card-action {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

[data-theme="dark"] .card-action {
  background: #1a2435;
  border: 1px solid var(--border);
}

.card-action:hover {
  background: var(--secondary);
  color: var(--primary);
}

[data-theme="dark"] .card-action:hover {
  background: var(--secondary);
  color: var(--primary-light);
  border-color: var(--primary);
}

.property-badge {
  display: inline-flex;
  align-items: center;
  background: var(--background);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-right: 8px;
  margin-bottom: 8px;
}

[data-theme="dark"] .property-badge {
  background: #1a2435;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.property-badges {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

/* PADDING RENFORCÉ POUR LES MODALES */
.modal-field {
  margin-bottom: 20px;
}

.modal-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

/* GRID AMÉLIORÉ POUR LES MODALES ÉLARGIES */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

  .modal-content {
    width: 90%;
    padding: 20px;
  }
}

/* NOUVEAU : MASQUER LE VIEW TOGGLE EN MODE KANBAN */
.view-toggle.kanban-hidden {
  display: none !important;
}

/* === CORRECTIONS SPÉCIFIQUES === */

/* Bouton + BIEN ALIGNÉ */
.add-task-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  margin-left: 8px;
}

.add-task-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* Styles pour les avatars et collaborateurs */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: var(--primary);
  background-size: cover;
  background-position: center;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}

.assigned-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--background);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

[data-theme="dark"] .assigned-badge {
  background: #1a2435;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* Upload d'avatar FONCTIONNEL */
.user-avatar-upload {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.user-avatar-upload input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  color: white;
}

.user-avatar-upload:hover .upload-overlay {
  opacity: 1;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.user-item:hover {
  background: var(--background);
}

[data-theme="dark"] .user-item:hover {
  background: #1a2435;
}

/* CALENDRIER DARK SPECIFIQUE */
[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
  border: 1px solid var(--border) !important;
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th {
  border: 1px solid var(--border) !important;
}

[data-theme="dark"] .fc-col-header-cell {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .fc-daygrid-day {
  background: var(--surface) !important;
}

/* THEME SWITCH */
.theme-switch-wrapper {
  position: fixed;
  bottom: 35px;
  right: 100px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  background: white;
  bottom: 3px;
  content: "";
  height: 18px;
  left: 3px;
  position: absolute;
  transition: 0.4s;
  width: 18px;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.theme-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* CORRECTION TEXTES GRIS */
.text-gray-500 {
  color: var(--text-secondary) !important;
}

.text-gray-700 {
  color: var(--text-primary) !important;
}

/* CORRECTION ICÔNES MATERIAL */
.material-icons-round {
  color: inherit;
}

/* USER CARD DARK */
[data-theme="dark"] .user-card {
  background: #1a2435;
}

/* === SIDEBAR REDUITE === */

.sidebar.collapsed {
  width: 70px;
  padding: 30px 12px;
}

.sidebar.collapsed .logo h1 {
  display: none;
}

.sidebar.collapsed .logo-collapsed {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-collapsed {
  display: none;
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* CORRECTION CENTRAGE ICÔNES */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
  gap: 0;
  margin: 4px 0;
}

.sidebar.collapsed .nav-item i {
  margin: 0 !important;
  font-size: 20px;
}

/* CORRECTION BACKGROUND ACTIVE/HOVER */
.sidebar.collapsed .nav-item.active {
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .sidebar.collapsed .nav-item.active {
  background: rgba(99, 102, 241, 0.15);
}

.sidebar.collapsed .nav-item:hover:not(.active) {
  background: rgba(99, 102, 241, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .sidebar.collapsed .nav-item:hover:not(.active) {
  background: rgba(99, 102, 241, 0.08);
}

/* CORRECTION ESPACEMENT SECTIONS */
.sidebar.collapsed .nav-section {
  margin-bottom: 24px;
}

/* Bouton toggle sidebar */
.sidebar-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 11;
  box-shadow: var(--shadow);
}

.sidebar-toggle:hover {
  transform: scale(1.1);
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

/* Tooltips pour sidebar réduite */
.nav-item {
  position: relative;
}

.nav-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  z-index: 100;
  margin-left: 10px;
}

.sidebar.collapsed .nav-item:hover .nav-tooltip {
  opacity: 1;
  visibility: visible;
}

/* CORRECTION BOUTONS FLOTTANTS */
.floating-btn {
  transition: all 0.3s ease;
  right: 30px;
}

.sidebar.collapsed ~ .floating-btn {
  right: 30px;
  transform: none;
}

.create-menu {
  transition: all 0.3s ease;
  right: 30px;
}

.sidebar.collapsed ~ .create-menu {
  right: 30px;
  transform: none;
}

/* CORRECTION LOGO CACHÉ */
.sidebar.collapsed .logo {
  display: none;
}
.card-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.client-badge,
.assigned-badge,
.importance-badge {
  padding: 4px 8px !important; /* ← Même padding pour tous */
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle !important;
  margin-bottom: 0 !important;
}

/* STYLES POUR CARTES COMPACTES */
.kanban-card.compact {
  padding: 12px;
  min-height: auto;
}

.kanban-card.compact .card-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.kanban-card.compact .client-badge {
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 6px;
  color: #4a5568;
  font-size: 0.75rem;
  font-weight: 500;
}

[data-theme="dark"] .kanban-card.compact .client-badge {
  background: #374151;
  color: #d1d5db;
}

.kanban-card.compact .card-footer.compact {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card.compact .card-actions.compact {
  display: flex;
  gap: 4px;
}

/* FORCER LA LARGEUR DES COLONNES */
.kanban-column {
  flex: 1;
  min-width: 280px !important;
  width: 280px !important;
  flex-shrink: 0 !important;
}
.kanban-column > div:first-child {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 32px;
  margin-bottom: 32px;
}
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .modal-grid-2 {
    grid-template-columns: 1fr;
  }
}
/* CORRECTION EASYMDE DARK THEME */
[data-theme="dark"] .EasyMDEContainer .CodeMirror {
  background: #1a2435 !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .EasyMDEContainer .CodeMirror-cursor {
  border-color: #f1f5f9 !important;
}

[data-theme="dark"] .EasyMDEContainer .editor-toolbar {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .EasyMDEContainer .editor-toolbar button {
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .EasyMDEContainer .editor-toolbar button:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .EasyMDEContainer .cm-s-easymde .CodeMirror-selected {
  background: #334155 !important;
}

.color-picker {
  display: flex;
  gap: 4px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.color-option.selected {
  border-color: #000;
  transform: scale(1.1);
}

.color-option:hover {
  transform: scale(1.05);
}
.card-accordion {
  margin: 12px 0;
}

.accordion-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.accordion-toggle:hover {
  background: var(--background);
  color: var(--primary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.property-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}
.additional-props {
  display: block !important;
  margin-top: 8px;
}

.property-item {
  display: block !important;
  padding: 12px 0 !important;
}

.property-item.has-border {
  border-bottom: 1px solid transparent !important;
  background: linear-gradient(90deg, transparent 0%, #c4b5fd 20%, #c4b5fd 80%, transparent 100%) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 1px !important;
  background-position: bottom !important;
  padding-top: 8px !important;
  margin-top: 8px !important;
}

.property-name {
  font-size: 0.7rem !important;
  color: #6b7280 !important;
  margin-bottom: 4px !important;
  font-weight: 500 !important;
  display: block !important;
}

.property-value {
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  display: inline-block !important; /* ← ÇA C'EST LA CLÉ ! */
  width: auto !important; /* ← Pour être sûr */
}
.card-footer-with-assigned {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.assigned-avatar-left {
  display: flex;
  align-items: center;
}

.footer-actions {
  display: flex;
  gap: 4px;
}
.assigned-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 6px;
}
.importance-badge {
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: #e5e7eb !important; /* Couleur par défaut */
  color: #374151 !important;
}
/* Styles pour l'authentification */
#authModal .modal-content {
  text-align: center;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#userProfileSection {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: auto;
}

/* === HEADER MOBILE SIMPLIFIÉ === */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 60px;
  flex-shrink: 0;
}

/* BOUTON MENU HAMBURGER */
.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* SWITCH VUE KANBAN/AGENDA */
.view-switch {
  display: flex;
  background: var(--secondary);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.view-switch-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* DATE COURANTE CENTRÉE */
.mobile-date-display {
  text-align: center;
  flex: 1;
  margin: 0 15px;
}

.mobile-date-main {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-date-secondary {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === VERSION MOBILE ULTRA SIMPLIFIÉE === */
@media (max-width: 768px) {
  /* SIDEBAR CACHÉE */
  .sidebar {
    display: none !important;
  }

  /* MAIN CONTENT PLEIN ÉCRAN */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* CALENDRIER PLEINE HAUTEUR */
  #agenda-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 60px);
  }

  .calendar-container {
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* FORCER FULLCALENDAR EN PLEIN ÉCRAN */
  .fc {
    height: 100% !important;
  }

  .fc-view-harness {
    height: 100% !important;
  }

  .fc-daygrid-body {
    height: 100% !important;
  }

  /* KANBAN MOBILE SIMPLIFIÉ */
  .kanban-container {
    flex-direction: column;
    gap: 10px !important;
    padding: 10px;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .kanban-column {
    min-width: 100% !important;
    width: 100% !important;
    min-height: 200px;
  }

  /* MASQUER TOUT LE HEADER DESKTOP */
  .desktop-header {
    display: none !important;
  }
}
/* AJOUTER DANS styles.css */
.view-switch {
  display: flex;
  background: var(--secondary);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.view-switch-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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