/* ============================================================
   HOUYOUX.CSS — Socle commun planning.houyoux.eu
   ============================================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@2.44.0/tabler-icons.min.css');

/* ============================================================
   VARIABLES — Light mode
   ============================================================ */
:root {
  /* Couleurs Houyoux */
  --primary:        #1B4F8A;
  --primary-dark:   #0F2F52;
  --primary-light:  #EBF2FA;
  --primary-mid:    #2E75B6;
  --accent:         #E8A838;
  --accent-light:   #FFF3D6;

  /* Sémantique */
  --success:        #1E6B3A;
  --success-light:  #D5F0E0;
  --danger:         #B91C1C;
  --danger-light:   #FEE2E2;
  --warning:        #D97706;
  --warning-light:  #FEF3C7;
  --info:           #1B4F8A;
  --info-light:     #EBF2FA;

  /* Surfaces */
  --bg:             #F4F6F9;
  --surface:        #FFFFFF;
  --surface-2:      #F8FAFC;
  --surface-hover:  #F1F5F9;

  /* Texte */
  --text:           #1A1A2E;
  --text-secondary: #64748B;
  --text-muted:     #94A3B8;
  --text-inverse:   #FFFFFF;

  /* Bordures */
  --border:         #E2E8F0;
  --border-strong:  #CBD5E1;

  /* Sidebar */
  --sidebar-bg:     #0F2F52;
  --sidebar-text:   rgba(255,255,255,0.75);
  --sidebar-active: #FFFFFF;
  --sidebar-hover:  rgba(255,255,255,0.1);
  --sidebar-width:  220px;

  /* Layout */
  --topbar-h:       52px;
  --radius:         6px;
  --radius-lg:      10px;
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);

  /* Typo */
  --font:           'DM Sans', system-ui, sans-serif;
  --font-mono:      'DM Mono', monospace;
  --font-size:      14px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --primary:        #3A8FD4;
  --primary-dark:   #2E75B6;
  --primary-light:  #1B3A5C;
  --accent:         #F0BC4A;
  --accent-light:   #3D2E0A;

  --success:        #34D399;
  --success-light:  #064E3B;
  --danger:         #F87171;
  --danger-light:   #450A0A;
  --warning:        #FBBF24;
  --warning-light:  #451A03;

  --bg:             #0F172A;
  --surface:        #1E293B;
  --surface-2:      #162032;
  --surface-hover:  #253450;

  --text:           #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --text-inverse:   #0F172A;

  --border:         #334155;
  --border-strong:  #475569;

  --sidebar-bg:     #0A1929;
  --sidebar-text:   rgba(255,255,255,0.6);
  --sidebar-active: #FFFFFF;
  --sidebar-hover:  rgba(255,255,255,0.08);

  --shadow:         0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 6px rgba(0,0,0,0.3);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--font-size); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.2s;
  z-index: 100;
}
.sidebar-logo {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}
.sidebar-logo-text {
  color: white;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.sidebar-logo-text small {
  display: block;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 400;
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-section { padding: 16px 12px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.3); }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.sidebar-item.active { background: rgba(255,255,255,0.12); color: var(--sidebar-active); }
.sidebar-item i { font-size: 16px; width: 18px; }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 500; color: white; truncate: true; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,0.4); }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-subtitle { font-size: 12px; color: var(--text-secondary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* PAGE CONTENT */
.page { flex: 1; overflow-y: auto; padding: 20px; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-title { font-size: 18px; font-weight: 600; }

/* ============================================================
   COMPOSANTS — Boutons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn i { font-size: 15px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   COMPOSANTS — Formulaires
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,79,138,0.1); }
.form-control::placeholder { color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }

/* ============================================================
   COMPOSANTS — Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 600; flex: 1; }

/* ============================================================
   COMPOSANTS — Badges / Tags
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 500;
  border-radius: 20px;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-muted   { background: var(--surface-2); color: var(--text-secondary); }

/* Statut projet */
.statut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.statut-ok      .statut-dot { background: var(--success); }
.statut-risque  .statut-dot { background: var(--warning); }
.statut-retard  .statut-dot { background: var(--danger); }

/* ============================================================
   COMPOSANTS — Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); background: var(--surface-2); border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   COMPOSANTS — Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; flex: 1; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

/* ============================================================
   COMPOSANTS — Panel latéral (fiche tâche)
   ============================================================ */
.panel-overlay {
  position: fixed; inset: 0; z-index: 900;
  pointer-events: none;
}
.panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 400px; background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  pointer-events: all;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.panel.open { transform: translateX(0); }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.panel-title { font-size: 14px; font-weight: 600; flex: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.panel-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* ============================================================
   COMPOSANTS — Toasts / Notifications
   ============================================================ */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 500;
  min-width: 260px; max-width: 360px;
  animation: slideInRight 0.3s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--primary); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   COMPOSANTS — Loader
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.8);
  z-index: 50;
}
[data-theme="dark"] .loading-overlay { background: rgba(15,23,42,0.8); }

/* ============================================================
   COMPOSANTS — Progress bar
   ============================================================ */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ============================================================
   COMPOSANTS — Tabs
   ============================================================ */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 2px; }
.tab {
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================
   PAGE LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 40px; }
.login-title { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: #64748B; text-align: center; margin-bottom: 28px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.project-list { display: flex; flex-direction: column; gap: 8px; }
.project-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 28px 1fr 140px 100px 80px 100px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.project-row:hover { border-color: var(--primary); background: var(--primary-light); }
.project-row.retard  { border-left: 3px solid var(--danger); }
.project-row.risque  { border-left: 3px solid var(--warning); }
.project-row.ok      { border-left: 3px solid var(--success); }
.project-name { font-weight: 500; }
.project-ref  { font-size: 11px; color: var(--text-secondary); }

/* ============================================================
   GANTT — wrapper DHTMLX
   ============================================================ */
#gantt-container { flex: 1; overflow: hidden; position: relative; }
.gantt_container { height: 100% !important; }

/* Overrides DHTMLX pour intégration visuelle */
.gantt_grid_head_cell,
.gantt_scale_cell { font-family: var(--font) !important; font-size: 11px !important; }
.gantt_task_line { border-radius: 3px !important; }
.gantt_milestone { border-radius: 0 !important; }
.gantt_grid_data .gantt_cell { font-family: var(--font) !important; font-size: 12px !important; }
.gantt_task_content { font-size: 11px !important; font-weight: 500 !important; }

/* Ligne aujourd'hui */
.gantt_today { background: rgba(27,79,138,0.08) !important; }
.gantt_marker { background: var(--primary) !important; }
.gantt_marker .gantt_marker_content { background: var(--primary) !important; }

/* Weekend grisé */
.gantt_weekend { background: var(--surface-2) !important; }
.gantt_holiday  { background: var(--accent-light) !important; }

/* ============================================================
   BARRE MÉTÉO GANTT
   ============================================================ */
.meteo-bar { display: flex; align-items: center; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 4px 0; overflow: hidden; }
.meteo-day { display: flex; flex-direction: column; align-items: center; font-size: 10px; flex-shrink: 0; padding: 2px; }
.meteo-day.intemperie { background: var(--danger-light); border-radius: var(--radius); }
.meteo-icon { font-size: 14px; }
.meteo-temp { color: var(--text-secondary); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.admin-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.admin-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* Tableau des accès avec cases à cocher */
.acces-table { width: 100%; font-size: 12px; }
.acces-table th { padding: 6px 8px; font-weight: 600; font-size: 11px; color: var(--text-secondary); text-align: center; }
.acces-table td { padding: 6px 8px; vertical-align: middle; }
.acces-table input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

/* ============================================================
   COULEUR GANTT PAR GROUPE RESSOURCE
   ============================================================ */
.gr-MAC { --task-color: #1B4F8A; }
.gr-COF { --task-color: #2E75B6; }
.gr-MON { --task-color: #3A8FD4; }
.gr-TMF { --task-color: #4AA8F0; }
.gr-LOG { --task-color: #5BBCFF; }
.gr-TTS { --task-color: #6CCFFF; }
.gr-COT { --task-color: #7DDEFF; }
.gr-TER { --task-color: #E8A838; }
.gr-BAT { --task-color: #F0BC4A; }
.gr-PAR { --task-color: #F8D060; }
.gr-CRE { --task-color: #FFE47A; }
.gr-ST  { --task-color: #CCCCCC; }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ============================================================
   RESPONSIVE TABLETTE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; inset: 0; width: 240px; z-index: 200; }
  .project-row { grid-template-columns: 20px 1fr 80px; }
  .project-row > :nth-child(n+4) { display: none; }
  .panel { width: 100%; }
}

/* ============================================================
   PRINT — toujours en mode clair
   ============================================================ */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --border: #ddd;
    --primary: #1B4F8A; --sidebar-bg: #1B4F8A;
  }
  .sidebar, .topbar-actions, .btn { display: none !important; }
  .app-layout { display: block; }
  #gantt-container { height: auto !important; }
}

/* ============================================================
   STATUTS TÂCHES
   ============================================================ */
.statut-tache {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.statut-a_faire   { background: var(--surface-2); color: var(--text-secondary); }
.statut-en_cours  { background: #EBF5FF; color: #1B4F8A; }
.statut-bloque    { background: var(--danger-light); color: var(--danger); }
.statut-termine   { background: var(--success-light); color: var(--success); }
[data-theme="dark"] .statut-en_cours { background: #0F2F52; color: #5BBCFF; }

/* ============================================================
   PRIORITÉ TÂCHES
   ============================================================ */
.priorite-haute   { color: var(--danger); font-weight: 600; }
.priorite-normale { color: var(--text-secondary); }
.priorite-basse   { color: var(--text-muted); }

/* ============================================================
   TÂCHES EN RETARD — coloration Gantt
   ============================================================ */
.gantt_task_line.task-retard { background: var(--danger) !important; }
.gantt_task_line.task-retard .gantt_task_progress { background: rgba(0,0,0,0.25) !important; }
.gantt_task_line.task-bloque { background: var(--warning) !important; }
.gantt_task_line.task-bloque .gantt_task_progress { background: rgba(0,0,0,0.2) !important; }
.gantt_task_line.task-termine { background: var(--success) !important; }
.gantt_task_line.task-termine .gantt_task_progress { background: rgba(0,0,0,0.15) !important; }
.gantt_task_line.task-en-cours { background: var(--primary) !important; }
.gantt_task_line.task-en-cours .gantt_task_progress { background: rgba(0,0,0,0.2) !important; }

/* ============================================================
   PAGE "MON PLANNING"
   ============================================================ */
.mon-planning-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
  flex-shrink: 0;
}
.mon-planning-section { margin-bottom: 20px; }
.mon-planning-section-titre {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary);
  padding: 8px 16px; background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.tache-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.tache-card:hover { background: var(--surface-hover); }
.tache-card.retard { border-left: 3px solid var(--danger); }
.tache-card.bloque { border-left: 3px solid var(--warning); }
.tache-card-info { flex: 1; min-width: 0; }
.tache-card-nom { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tache-card-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.tache-card-avancement { width: 60px; text-align: right; font-size: 12px; font-weight: 500; }

/* ============================================================
   DASHBOARD — badges tâches en retard/bloquées
   ============================================================ */
.badge-retard { background: var(--danger-light); color: var(--danger); font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.badge-bloque { background: var(--warning-light); color: var(--warning); font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }

/* ============================================================
   COMMENTAIRES — @mentions
   ============================================================ */
.mention { color: var(--primary); font-weight: 500; background: var(--primary-light); padding: 0 3px; border-radius: 3px; }
.commentaire-input-wrap { position: relative; }
.mentions-dropdown {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 100; max-height: 160px; overflow-y: auto;
}
.mentions-dropdown-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.mentions-dropdown-item:hover { background: var(--surface-hover); }

/* ============================================================
   PANEL TÂCHE — champs supplémentaires
   ============================================================ */
.statut-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.statut-btn {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); cursor: pointer; background: var(--surface);
  transition: all 0.15s;
}
.statut-btn.active { border-width: 2px; }
.statut-btn[data-statut="a_faire"].active    { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.statut-btn[data-statut="en_cours"].active   { background: #EBF5FF; border-color: var(--primary); color: var(--primary); }
.statut-btn[data-statut="bloque"].active     { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.statut-btn[data-statut="termine"].active    { background: var(--success-light); border-color: var(--success); color: var(--success); }

/* ============================================================
   ÉDITEUR DE TEMPLATES
   ============================================================ */
.tpl-phase-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.tpl-phase-row:last-child { border-bottom: none; }
.tpl-phase-row:hover { background: var(--surface-hover); }
.tpl-phase-row-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 0;
  min-height: 38px;
}
.tpl-phase-nom:hover {
  background: var(--surface-hover);
  outline: 1px dashed var(--border-strong);
}
.tpl-phase-actions {
  display: flex; gap: 2px; opacity: 0;
  transition: opacity 0.15s;
}
.tpl-phase-row:hover .tpl-phase-actions { opacity: 1; }
