:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --border: #e3e6ec;
  --text: #1f2430;
  --text-soft: #6b7280;
  --text-faint: #9aa1ae;
  --accent: #4c4fe0;
  --accent-soft: #eceafc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 4px 14px rgba(20, 24, 40, 0.06);
  --danger: #d9505e;

  --status-a_faire: #8f9aae;
  --status-en_cours: #dd9a2f;
  --status-bloque: #d9505e;
  --status-fait: #33a06f;
  --status-en_attente: #6b8acf;

  --status-a_faire-bg: #eef0f4;
  --status-en_cours-bg: #fbf1de;
  --status-bloque-bg: #fbe8ea;
  --status-fait-bg: #e6f4ed;
  --status-en_attente-bg: #e8eef8;

  --p-marina: #d6558c;
  --p-noemie: #3b82c4;
  --p-julia: #c2884d;
  --p-laurent: #8b6fd6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout shell ---------- */

.app { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
@media (max-width: 600px) { .app { padding: 16px 10px 50px; } }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}

.brand h1 { font-size: 21px; font-weight: 700; margin: 0 0 2px; letter-spacing: -0.01em; }
.brand p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 15px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: #3c3fc9; }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 13px; font-size: 13.5px; font-weight: 500;
}
.btn-ghost:hover { background: var(--surface); border-color: #d2d6de; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

.btn-danger {
  background: var(--danger); color: #fff; border: none; border-radius: 8px;
  padding: 9px 15px; font-weight: 600; font-size: 14px;
}
.btn-danger:hover { background: #c44552; }

/* ---------- Welcome bar ---------- */

.welcome-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 16px; font-size: 13.5px; color: var(--text-soft);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
@media (max-width: 600px) {
  .welcome-bar { padding: 8px 12px; font-size: 12.5px; gap: 6px; }
  .welcome-meta { margin-left: 0; width: 100%; }
}
.welcome-bar strong { color: var(--text); font-size: 14px; }
.welcome-alert {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 12px;
  font-size: 12px; font-weight: 600; gap: 4px;
}
.welcome-alert.overdue { background: #fbe8ea; color: #b33241; }
.welcome-alert.due-today { background: #fbf1de; color: #9a5b12; }
.welcome-alert.unread { background: var(--accent-soft); color: var(--accent); }
.welcome-alert.unassigned { background: #fbe8ea; color: #b33241; font-weight: 700; }
.welcome-alert.waiting { background: #e8eef8; color: #3a5a9e; }
.welcome-meta { font-size: 12px; color: var(--text-faint); margin-left: auto; }

/* ---------- User switcher ---------- */

.user-switcher { position: relative; }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px 5px 5px; box-shadow: var(--shadow);
}
.user-pill .caret { color: var(--text-faint); font-size: 11px; margin-left: 2px; }
.user-pill-label { font-size: 13.5px; font-weight: 600; }
.user-pill-label span { display: block; font-weight: 400; font-size: 11px; color: var(--text-faint); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; color: #fff; flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }

.person-marina { background: var(--p-marina); }
.person-noemie { background: var(--p-noemie); }
.person-julia { background: var(--p-julia); }
.person-laurent { background: var(--p-laurent); }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; width: 190px; z-index: 40;
}
.user-menu button {
  width: 100%; background: none; border: none;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 8px; border-radius: 7px; font-size: 13.5px; font-weight: 500; text-align: left;
}
.user-menu button:hover { background: var(--bg); }
.user-menu .hint { padding: 6px 8px 2px; font-size: 11px; color: var(--text-faint); }

/* ---------- Sous-tâches ---------- */

.modal-subtasks { padding: 10px 18px; border-bottom: 1px solid var(--border); }
.subtasks-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.subtasks-head h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-soft); }
.subtasks-progress {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 10px;
}
.subtasks-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 200px; overflow-y: auto; }
.subtasks-empty { font-size: 12px; color: var(--text-faint); padding: 6px 0; font-style: italic; }

.subtask-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px; background: var(--bg);
  transition: background 0.12s ease; flex-wrap: wrap;
}
.subtask-item:hover { background: #e8eaf0; }
.subtask-done .subtask-text { text-decoration: line-through; color: var(--text-faint); }

.subtask-check { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.subtask-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.subtask-checkmark {
  width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; background: var(--surface);
}
.subtask-check input:checked + .subtask-checkmark {
  background: var(--accent); border-color: var(--accent);
}
.subtask-check input:checked + .subtask-checkmark::after {
  content: '✓'; color: #fff; font-size: 12px; font-weight: 700;
}

.subtask-text { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask-assignee { flex-shrink: 0; }
.subtask-assignee.unassigned { color: var(--text-faint); font-size: 13px; }

.subtask-assign-select {
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px;
  font-size: 11.5px; background: var(--surface); flex-shrink: 0; width: auto;
}
.subtask-del { font-size: 11px; padding: 2px 4px; }

.subtask-add-form { display: flex; gap: 6px; }
.subtask-add-form input[type="text"] {
  flex: 1; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 13px; min-width: 0;
}
.subtask-add-form select {
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 6px; font-size: 12px; flex-shrink: 0;
}
.subtask-add-form button { flex-shrink: 0; }
@media (max-width: 520px) {
  .subtask-add-form { flex-wrap: wrap; }
  .subtask-add-form input[type="text"] { flex: 1 100%; }
}

/* ---------- Import Outlook ---------- */

.outlook-list { display: flex; flex-direction: column; gap: 0; }
.outlook-loading { text-align: center; padding: 30px; color: var(--text-faint); font-size: 13.5px; }

.outlook-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.outlook-item:last-child { border-bottom: none; }
.outlook-item.outlight-done { opacity: 0.5; }
.outlook-item-main { flex: 1; min-width: 0; }
.outlook-subject { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.outlook-from { font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; }
.outlook-preview { font-size: 12px; color: var(--text-soft); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.outlook-create { flex-shrink: 0; margin-top: 2px; }

/* ---------- Coller un mail ---------- */

.paste-mail-input {
  width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical;
  line-height: 1.5;
}
.paste-mail-input:focus { border-color: var(--accent); }

.paste-preview {
  margin-top: 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.paste-field { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.paste-field:last-child { margin-bottom: 0; }
.paste-label {
  font-weight: 700; color: var(--text-soft); flex-shrink: 0; min-width: 90px;
}
.paste-val { color: var(--text); word-break: break-word; }

/* ---------- Bookmarklet ---------- */

.bookmarklet-btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 700;
  text-decoration: none; cursor: grab; user-select: none;
  box-shadow: 0 4px 12px rgba(76,79,224,0.3);
  transition: transform 0.15s ease;
}
.bookmarklet-btn:hover { transform: scale(1.05); }
.bookmarklet-btn:active { cursor: grabbing; transform: scale(0.98); }

/* ---------- Mes tâches ---------- */

.mytasks-header { margin-bottom: 16px; }
.mytasks-summary {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.mytasks-summary h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.mytasks-summary p { margin: 0; font-size: 12.5px; color: var(--text-soft); }
.mytasks-summary > button { margin-left: auto; flex-shrink: 0; }
@media (max-width: 600px) {
  .mytasks-summary { flex-wrap: wrap; gap: 10px; }
  .mytasks-summary > button { margin-left: 0; }
}

.mytasks-section { margin-bottom: 20px; }
.mytasks-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-soft);
  margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.03em;
}
.mytasks-empty { font-size: 13px; color: var(--text-faint); padding: 10px 0; font-style: italic; }

.mytask-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.mytask-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.mytask-main { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mytask-title { font-size: 13.5px; font-weight: 600; }
.mytask-fourn { font-size: 12px; color: var(--text-soft); }
.mytask-badge {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
  background: var(--bg); color: var(--text-faint);
}
.mytask-due { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.mytask-subs { font-size: 11px; color: var(--accent); font-weight: 600; }
.mytask-status {
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  padding: 3px 10px; border-radius: 6px; white-space: nowrap;
}
.mytask-status:empty { display: none; }

/* ---------- Export dropdown ---------- */

.export-dropdown { position: relative; }
.export-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: var(--shadow); padding: 6px; min-width: 180px;
}
.export-menu button {
  width: 100%; background: none; border: none; text-align: left;
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 6px; font-size: 13px; font-weight: 500;
}
.export-menu button:hover { background: var(--bg); }
.export-divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ---------- Toast ---------- */

/* ---------- Tabs ---------- */

.tabs {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; margin-bottom: 14px; gap: 2px;
}
.tab {
  background: none; border: none; padding: 7px 14px; border-radius: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
}
.tab.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Board filters ---------- */

.board-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
@media (max-width: 600px) {
  .board-filters { gap: 6px; padding: 8px; }
  .board-filters .filter-select { font-size: 12px; }
  .board-filters .filter-input { min-width: 100%; order: 10; }
}

#filter-board-people { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 4px 10px 4px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-soft);
}
.chip-toggle.active { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

select.filter-select, input.filter-input {
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px;
  font-size: 13px; background: var(--surface);
}
input.filter-input { flex: 1; min-width: 140px; }

/* ---------- Board ---------- */

.board {
  display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; align-items: start;
}
@media (max-width: 1100px) { .board { grid-template-columns: repeat(3, minmax(160px, 1fr)); } }
@media (max-width: 800px) { .board { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }
@media (max-width: 520px) {
  .board {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 8px;
  }
}
@media (max-width: 380px) {
  .board { grid-template-columns: 1fr; }
}

.column { background: #eef0f4; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.column.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }

.column-head { display: flex; align-items: center; gap: 7px; padding: 6px 6px 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.column-head h2 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  margin: 0; color: var(--text-soft);
}
.column-head .count {
  margin-left: auto; font-size: 11px; color: var(--text-faint);
  background: #fff; border-radius: 10px; padding: 1px 7px;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease; position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(20,24,40,0.1); }
.card:active { cursor: grabbing; }

.card-unread { border-left: 3px solid var(--accent); }
.unread-dot {
  position: absolute; top: 8px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}

.card-title { font-size: 13.5px; font-weight: 600; margin: 0 0 3px; line-height: 1.35; }
.card-fournisseur { font-size: 11.5px; color: var(--text-soft); margin: 0 0 6px; }

/* Due date badges on cards */
.card-due {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  margin-bottom: 6px;
}
.card-due .due-icon { font-size: 10px; }
.due-overdue { background: #fbe8ea; color: #b33241; }
.due-today { background: #fbf1de; color: #9a5b12; }
.due-soon { background: #fff4e0; color: #a07020; }
.due-ok { background: #e6f4ed; color: #217a4c; }
.waiting-long { background: #fbe8ea; color: #b33241; }
.waiting-mid { background: #fbf1de; color: #9a5b12; }
.waiting-short { background: #e8eef8; color: #3a5a9e; }

/* ---------- Participants ---------- */

.modal-participants { padding: 10px 18px; border-bottom: 1px solid var(--border); }
.participants-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.participants-label { font-size: 12.5px; font-weight: 700; color: var(--text-soft); flex-shrink: 0; }
.participants-avatars { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.participant-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg); border-radius: 20px; padding: 2px 10px 2px 3px;
  font-size: 12.5px; font-weight: 600;
}
.participants-none { font-size: 12.5px; color: var(--text-faint); font-style: italic; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-left { flex: 1; min-width: 0; }
.card-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.card-participants { display: flex; align-items: center; }
.card-participants .avatar { margin-left: -4px; border: 2px solid var(--surface); }
.card-participants .avatar:first-child { margin-left: 0; }
.card-more { font-size: 10px; font-weight: 700; color: var(--text-faint); margin-left: 2px; }

/* Barre de progression des sous-tâches sur les cartes */
.card-subtasks-progress { margin-bottom: 6px; }
.progress-bar {
  height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 3px;
}
.progress-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 10.5px; color: var(--text-faint); font-weight: 600;
}
.card-last-action { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card-last-action .snippet {
  font-size: 11px; color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.card-count { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

.empty-column { font-size: 12px; color: var(--text-faint); padding: 10px 6px; text-align: center; }

/* ---------- Journal ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
#filter-people { display: flex; flex-wrap: wrap; gap: 8px; }

.journal-list { display: flex; flex-direction: column; gap: 0; }
.journal-item { display: flex; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.journal-item:last-child { border-bottom: none; }
.journal-auto { opacity: 0.7; }

.journal-body { flex: 1; min-width: 0; }
.journal-meta { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.journal-author { font-weight: 700; font-size: 13.5px; }
.journal-date { font-size: 11.5px; color: var(--text-faint); }
.journal-task-link { font-size: 12px; color: var(--accent); font-weight: 600; text-decoration: none; }
.journal-comment { font-size: 13.5px; color: var(--text); line-height: 1.45; margin-top: 2px; }

.mention { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 0 3px; border-radius: 3px; }
.auto-tag { font-size: 10px; color: var(--text-faint); font-style: italic; margin-left: 4px; }

.type-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 2px 7px; border-radius: 5px; display: inline-block; margin-right: 6px; vertical-align: middle;
}
.type-relance { background: #fdecd2; color: #9a5b12; }
.type-document { background: #dcebfc; color: #1c5ea8; }
.type-correction { background: #f3e4fb; color: #7a30a8; }
.type-validation { background: #dff3e6; color: #217a4c; }
.type-blocage { background: #fbe3e5; color: #b33241; }
.type-note { background: #eef0f4; color: #565f6f; }

.empty-state { text-align: center; color: var(--text-faint); font-size: 13.5px; padding: 40px 10px; }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 34, 0.42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
@media (max-width: 520px) {
  .modal-overlay { padding: 10px 6px; }
  .modal { border-radius: 10px; }
}

.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(15, 18, 30, 0.25); animation: modal-in 0.16s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 18px 18px 12px; border-bottom: 1px solid var(--border);
}
.modal-title-input {
  border: none; font-size: 17px; font-weight: 700; width: 100%; padding: 3px 0;
  background: transparent; border-bottom: 1px solid transparent;
}
.modal-title-input:hover, .modal-title-input:focus { border-bottom-color: var(--border); }

.icon-btn {
  background: none; border: none; color: var(--text-faint); font-size: 15px;
  padding: 4px 6px; border-radius: 6px; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

.modal-sub {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  flex-wrap: wrap; border-bottom: 1px solid var(--border);
}
.modal-sub input.fournisseur-input {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px;
  font-size: 13px; flex: 1; min-width: 140px;
}
select.status-select {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px;
  font-size: 12.5px; font-weight: 600;
}
input.date-input {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px;
  font-size: 12.5px; font-weight: 500;
}

/* Modal dates info */
.modal-dates {
  padding: 8px 18px; display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--border); background: #fafbfc;
}
.date-info { font-size: 11.5px; color: var(--text-faint); padding: 2px 0; }
.date-info.due-overdue { color: #b33241; font-weight: 600; }
.date-info.due-today { color: #9a5b12; font-weight: 600; }
.date-info.waiting-long { color: #b33241; font-weight: 600; }
.date-info.waiting-mid { color: #9a5b12; font-weight: 600; }
.date-info.waiting-short { color: #3a5a9e; font-weight: 600; }

.modal-journal { max-height: 320px; overflow-y: auto; padding: 6px 18px; }

.modal-footer { padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.add-action-form { display: flex; flex-direction: column; gap: 8px; }
.add-action-row { display: flex; gap: 8px; }
@media (max-width: 520px) {
  .add-action-row { flex-direction: column; }
  .add-action-row select { width: 100%; }
}
.add-action-row select {
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 8px; font-size: 13px; flex-shrink: 0;
}
.add-action-form textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13.5px;
  resize: vertical; min-height: 56px; flex: 1;
}
.add-action-form .as-who { font-size: 11.5px; color: var(--text-faint); }
.add-action-form .as-who b { color: var(--text-soft); }

/* ---------- New task modal ---------- */

.form-row { display: flex; gap: 12px; }
@media (max-width: 520px) { .form-row { flex-direction: column; gap: 0; } }
.form-field { margin-bottom: 12px; }
.form-field label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 5px;
}
.form-field input, .form-field select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 14px;
}

/* Toggle type de tâche */
.task-type-toggle { display: flex; gap: 10px; }
@media (max-width: 520px) { .task-type-toggle { flex-direction: column; } }
.task-type-option { flex: 1; cursor: pointer; }
.task-type-option input { position: absolute; opacity: 0; }
.task-type-card {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--border); border-radius: 10px; padding: 10px 12px;
  transition: all 0.15s ease;
}
.task-type-option input:checked + .task-type-card {
  border-color: var(--accent); background: var(--accent-soft);
}
.task-type-icon { font-size: 22px; flex-shrink: 0; }
.task-type-text { display: flex; flex-direction: column; }
.task-type-text strong { font-size: 13.5px; font-weight: 700; }
.task-type-text em { font-size: 11.5px; color: var(--text-soft); font-style: normal; }

/* Grille d'assignation */
.assign-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--border); border-radius: 20px; padding: 5px 12px 5px 5px;
  cursor: pointer; transition: all 0.15s ease; user-select: none;
}
.assign-chip input { position: absolute; opacity: 0; }
.assign-chip.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.assign-chip span { font-size: 13px; font-weight: 600; }
.assign-hint { font-size: 11.5px; color: var(--text-faint); margin: 6px 0 0; }

/* Badge tâche commune sur les cartes */
.card-common-badge {
  display: inline-block; font-size: 10px; font-weight: 700; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 7px; border-radius: 8px; margin-left: 4px;
}

/* Tâche non attribuée */
.card-unassigned {
  border: 2px solid var(--danger); animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: var(--danger); box-shadow: 0 0 0 0 rgba(217,80,94,0); }
  50% { border-color: #e85a68; box-shadow: 0 0 0 4px rgba(217,80,94,0.08); }
}
.unassigned-banner {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 7px 7px 0 0; margin: -10px -12px 8px;
  text-align: center; letter-spacing: 0.02em;
}
.assign-none-btn {
  margin-top: 8px; background: transparent; border: 1px dashed var(--danger);
  color: var(--danger); border-radius: 8px; padding: 7px 12px; font-size: 12.5px;
  font-weight: 600; width: 100%; transition: all 0.15s ease;
}
.assign-none-btn:hover { background: #fbe8ea; }

.hidden { display: none !important; }

/* ---------- Bouton aide flottant ---------- */

.help-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 20px; font-weight: 700; box-shadow: 0 4px 16px rgba(76,79,224,0.35);
  z-index: 50; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.help-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(76,79,224,0.45); }
.help-fab:active { transform: scale(1.02); }

/* ---------- Centre d'aide ---------- */

.help-modal { max-width: 580px; display: flex; flex-direction: column; max-height: 80vh; }

.help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.help-head h2 { margin: 0; font-size: 17px; font-weight: 700; }

.help-search { padding: 10px 18px 6px; }
.help-search input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px; background: var(--bg);
}
.help-search input:focus { border-color: var(--accent); background: var(--surface); }

.help-tabs {
  display: flex; gap: 4px; padding: 4px 18px; border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.help-tab {
  background: none; border: none; padding: 8px 12px;
  font-size: 13px; font-weight: 600; color: var(--text-soft);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.help-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.help-body {
  flex: 1; overflow-y: auto; padding: 14px 18px;
}

.help-item {
  display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start;
}
.help-item:last-child { margin-bottom: 0; }
.help-icon { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
.help-item h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.help-item p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.5; }

.faq-item {
  margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.faq-item summary {
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 18px; color: var(--text-faint); transition: transform 0.15s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--bg); }
.faq-item p { margin: 0; padding: 0 14px 12px; font-size: 13px; color: var(--text-soft); line-height: 1.5; }

.shortcuts-grid { display: flex; flex-direction: column; gap: 8px; }
.shortcut-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shortcut-row:last-child { border-bottom: none; }
kbd.key {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 12.5px; font-weight: 700; color: var(--text);
  font-family: 'Inter', monospace; min-width: 80px; text-align: center; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.shortcut-row span { font-size: 13.5px; color: var(--text-soft); }

.help-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ---------- Visite guidée ---------- */

.tour-overlay {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
}
.tour-overlay.hidden { display: none !important; }

.tour-spotlight {
  position: fixed; border-radius: 10px; z-index: 201;
  pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 9999px rgba(15,18,30,0.55), 0 0 0 2px var(--accent);
  transition: opacity 0.2s ease, top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tour-spotlight.visible { opacity: 1; }

.tour-tooltip {
  position: fixed; width: 320px; background: var(--surface); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15,18,30,0.25); z-index: 202;
  pointer-events: auto; overflow: hidden;
  animation: tour-in 0.2s ease;
}
@keyframes tour-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.tour-content { padding: 16px 18px 12px; }
.tour-step-num { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.tour-content h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.tour-content p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.5; }

.tour-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-top: 1px solid var(--border); background: #fafbfc;
}
.tour-progress { font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.tour-buttons { display: flex; gap: 8px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1f2430; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13.5px; box-shadow: var(--shadow); z-index: 200; animation: toast-in 0.15s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }