/* ==========================================================================
   SaniProjet — planification et diagramme de Gantt · Lalema inc.
   Mêmes jetons de design que SaniPoly : les deux outils doivent se
   reconnaître au premier coup d'œil. Le bleu n'est plus une couleur
   d'interface ici, seulement une couleur de tâche choisie par l'usager.
   ========================================================================== */

:root {
  /* L'interface n'a qu'un thème clair. Sans cette ligne, un poste réglé en
     mode sombre rend les contrôles natifs — curseur d'avancement, listes,
     sélecteurs de date — en sombre au milieu d'une page claire. */
  color-scheme: light;

  --orange: #ff701f;
  --orange-2: #ff8a3d;
  --orange-600: #ec5a12;
  --orange-700: #c9490a;
  --cyan: #4addff;
  --cyan-600: #17aecb;

  --ink: #14152a;
  --ink-2: #1c1e3a;
  --ink-3: #262a4d;
  --text: #4a4f63;
  --muted: #838a9e;
  --line: #e9ebf3;
  --bg: #ffffff;
  --bg-soft: #f6f7fc;

  --green: #2f9e5e;
  --danger: #d8442f;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 100px;
  --shadow-sm: 0 6px 18px rgba(20, 21, 42, .06);
  --shadow-md: 0 18px 40px rgba(20, 21, 42, .10);
  --shadow-lg: 0 30px 70px rgba(20, 21, 42, .16);

  --grad-orange: linear-gradient(120deg, #ff8a3d 0%, #ff5e1f 55%, #ff701f 100%);
  --grad-ink: linear-gradient(100deg, #1b1d3a 0%, #14152a 60%, #101126 100%);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bar-h: 52px;
  --toolbar-h: 50px;
  --status-h: 30px;
  --footer-h: 38px;
  --panel-w: 320px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.55;
  overflow: hidden;                       /* l'espace de travail gère son propre défilement */
  -webkit-font-smoothing: antialiased;

  display: grid;
  grid-template-rows: var(--bar-h) var(--toolbar-h) 1fr var(--status-h) var(--footer-h);
  grid-template-columns: 100%;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; font-weight: 700; }
a { color: var(--orange-600); text-decoration: none; }
a:hover { color: var(--orange-700); text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Toutes les icônes de l'interface : tracé plutôt qu'aplat. */
.tool svg, .menu-pop svg, .btn-ico, .icon-button svg {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Boutons génériques ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  border-radius: var(--radius-pill); padding: .8rem 1.7rem;
  border: 1.5px solid transparent; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn-sm { padding: .55rem 1.15rem; font-size: .88rem; }
.btn-ico { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--grad-orange); color: #fff; box-shadow: 0 12px 28px -10px rgba(255,112,31,.65); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -10px rgba(255,112,31,.7); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 12px 28px -12px rgba(216,68,47,.7); }
.btn-danger:hover { transform: translateY(-1px); background: #c23a27; }

/* ==========================================================================
   Barre d'application + menus
   ========================================================================== */
.app-bar {
  grid-row: 1;
  display: flex; align-items: center; gap: 1.1rem;
  padding: 0 1rem 0 .85rem;
  background: var(--grad-ink);
  color: rgba(255,255,255,.92);
  position: relative; z-index: 60;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; flex: none; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-accent { color: var(--orange-2); }

.menubar { display: flex; align-items: center; gap: .1rem; }
.menu { position: relative; }
.menu-btn {
  padding: .42rem .8rem; border-radius: 8px; font-size: .93rem; font-weight: 500;
  color: rgba(255,255,255,.86); transition: background .18s var(--ease), color .18s var(--ease);
}
.menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.menu.is-open .menu-btn { background: rgba(255,255,255,.16); color: #fff; }

.menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 290px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: .4rem; z-index: 70;
  display: none;
}
.menu.is-open .menu-pop { display: block; }
.menu-pop button {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .5rem .6rem; border-radius: 8px; font-size: .91rem; color: var(--ink);
  text-align: left; white-space: nowrap;
}
.menu-pop button:hover:not([disabled]) { background: var(--bg-soft); color: var(--orange-700); }
.menu-pop button[disabled] { color: #b9becd; cursor: default; }
.menu-pop button svg { width: 17px; height: 17px; flex: none; opacity: .75; }
/* Aligne les libellés des entrées sans icône sur celles qui en ont une. */
.menu-pop button:not(:has(svg))::before { content: ''; width: 17px; flex: none; }
.menu-pop kbd { margin-left: auto; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: .35rem .2rem; }
.menu-pop button.is-current { color: var(--orange-700); font-weight: 600; }

kbd {
  font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: .05rem .34rem; white-space: nowrap;
}

.app-bar-link {
  margin-left: auto; font-size: .87rem; color: rgba(255,255,255,.62);
  padding: .35rem .7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.16);
}
.app-bar-link:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.1); }

/* ==========================================================================
   Barre d'outils
   ========================================================================== */
.toolbar {
  grid-row: 2;
  display: flex; align-items: center; gap: .5rem;
  padding: 0 .85rem; background: #fff; border-bottom: 1px solid var(--line);
  position: relative; z-index: 50; overflow-x: auto; scrollbar-width: thin;
}
.tool-group { display: flex; align-items: center; gap: .2rem; flex: none; }
.tb-sep { width: 1px; height: 24px; background: var(--line); flex: none; margin: 0 .25rem; }
.tb-spacer { flex: 1 1 auto; min-width: .5rem; }

.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 34px; min-width: 34px; padding: 0 .5rem;
  border-radius: 9px; color: var(--ink);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tool svg { width: 19px; height: 19px; }
.tool:hover:not([disabled]) { background: var(--bg-soft); }
.tool[disabled] { color: #c3c7d4; cursor: default; }
.tool-sm { height: 28px; min-width: 28px; font-size: .82rem; color: var(--muted); }
.tool-sm svg { width: 16px; height: 16px; }
.tool-label { padding: 0 .75rem; font-size: .88rem; font-weight: 500; }
.tool-primary { background: var(--grad-orange); color: #fff; box-shadow: 0 8px 18px -8px rgba(255,112,31,.7); }
.tool-primary:hover:not([disabled]) { background: var(--grad-orange); filter: brightness(1.06); }

/* Le nom du projet se saisit sur place, comme l'échelle de SaniPoly. */
.project-box {
  display: flex; align-items: center; gap: .4rem; flex: none;
  padding: .18rem .3rem .18rem .6rem; border: 1px solid var(--line); border-radius: 9px;
}
.project-box label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.project-box input {
  width: 240px; border: none; background: none; color: var(--ink);
  font-size: .92rem; font-weight: 600; padding: .15rem .1rem;
}
.project-box input:focus { outline: none; }
.project-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,112,31,.12); }

.segmented {
  display: flex; align-items: center; gap: .15rem; flex: none;
  padding: .15rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
}
.segment {
  height: 28px; padding: 0 .7rem; border-radius: 8px; font-size: .86rem; color: var(--text);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.segment:hover { color: var(--ink); }
.segment.is-active { background: #fff; color: var(--orange-700); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Espace de travail
   ========================================================================== */
.workspace {
  grid-row: 3;
  display: flex; min-height: 0; background: var(--bg-soft);
}

.side-panel {
  flex: none; width: var(--panel-w); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}
.side-panel[hidden] { display: none; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .7rem .5rem .95rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.side-head h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }

.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

/* ---------- Formulaire de tâche ---------- */
.task-form { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; padding: .95rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.span-2 { grid-column: span 2; }

.task-form label, .field-label { color: var(--ink); font-size: .82rem; font-weight: 600; }

.task-form input[type="text"],
.task-form input[type="date"],
.task-form select {
  width: 100%; padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); background: var(--bg-soft); font-size: .92rem;
}
.task-form input::placeholder { color: #b9becd; }
.task-form input:focus, .task-form select:focus {
  outline: none; border-color: var(--orange); background: #fff;
  box-shadow: 0 0 0 3px rgba(255,112,31,.12);
}
/* Le curseur est dessiné plutôt que laissé au navigateur : le rendu natif
   varie d'une plateforme à l'autre, et il doit ressembler à la jauge
   d'avancement de la liste, qui est le même geste. */
.task-form input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; margin: .3rem 0;
  border-radius: var(--radius-pill); background: var(--line); cursor: pointer;
}
.task-form input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: var(--orange-600); border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(20,21,42,.25);
}
.task-form input[type="range"]::-moz-range-track {
  height: 10px; border-radius: var(--radius-pill); background: var(--line);
}
.task-form input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: var(--orange-600); border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(20,21,42,.25);
}
.task-form input[type="range"]:focus-visible { outline-offset: 4px; }

.range-label { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.range-label output { color: var(--orange-700); font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }

.swatches { display: flex; align-items: center; gap: .4rem; }
.color-swatch {
  width: 30px; height: 30px; border: 2px solid transparent; border-radius: 9px; background: var(--swatch);
  transition: transform .16s var(--ease);
}
.color-swatch:hover { transform: translateY(-1px); }
.color-swatch.is-selected { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,112,31,.16); }

.form-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }

/* ==========================================================================
   Diagramme de Gantt
   ========================================================================== */
.timeline-section { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chart-window { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--bg-soft); }

.empty-state {
  display: grid; place-items: center; height: 100%; min-height: 220px;
  color: var(--muted); font-size: .92rem; text-align: center; padding: 2rem;
}

.gantt { min-width: max-content; background: #fff; }
.gantt-header, .gantt-row { display: grid; grid-template-columns: 210px 1fr; }

.gantt-header {
  position: sticky; top: 0; z-index: 3; min-height: 46px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.corner, .task-cell {
  position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--line);
}
.corner {
  display: flex; align-items: center; padding: 0 .95rem;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600;
}

.timeline-head, .row-track {
  position: relative; width: var(--timeline-width);
  background-image: linear-gradient(to right, rgba(233,235,243,.9) 1px, transparent 1px);
  background-size: var(--day-width) 100%;
}
.timeline-head { min-height: 46px; overflow: hidden; background-color: var(--bg-soft); }

.timeline-marker {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; padding-left: .5rem;
  border-left: 1px solid var(--line); color: var(--ink);
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}

.gantt-row { min-height: 54px; border-bottom: 1px solid var(--line); }
.gantt-row:hover .task-cell { background: var(--bg-soft); }

.task-cell { display: flex; flex-direction: column; justify-content: center; gap: .1rem; padding: .5rem .95rem; }
.task-title { overflow: hidden; font-weight: 600; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.task-owner { overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }

.row-track { min-height: 54px; background-color: #fff; }

.task-bar {
  position: absolute; top: 11px; height: 32px; min-width: 14px;
  overflow: hidden; border-radius: 9px; color: #fff;
  box-shadow: 0 8px 18px -8px rgba(20,21,42,.5);
  cursor: grab; touch-action: none; user-select: none;
  transition: box-shadow .12s var(--ease), transform .12s var(--ease);
}
.task-bar:hover { box-shadow: 0 10px 22px -8px rgba(20,21,42,.6); }
.task-bar.is-dragging { z-index: 4; cursor: grabbing; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.bar-progress { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.3); }
.bar-label {
  position: relative; z-index: 1; display: block; overflow: hidden;
  padding: .4rem .6rem; font-size: .82rem; font-weight: 600; line-height: 18px;
  text-overflow: ellipsis; white-space: nowrap;
}

/* Le repère du jour : la seule ligne rouge de l'interface, elle doit se voir. */
.today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--danger); box-shadow: 0 0 0 2px rgba(216,68,47,.12);
}

/* ==========================================================================
   Liste des tâches
   ========================================================================== */
.task-list { flex: none; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .45rem .7rem .45rem .95rem; flex: none;
}
.list-head h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
#taskListToggle svg { transition: transform .18s var(--ease); }
.task-list.is-collapsed #taskListToggle svg { transform: rotate(-90deg); }

.task-list-panel { max-height: 34vh; overflow: auto; border-top: 1px solid var(--line); }
.task-list.is-collapsed .task-list-panel { max-height: 0; overflow: hidden; border-top-color: transparent; }

table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: .55rem .95rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
  position: sticky; top: 0; z-index: 1;
  color: var(--muted); background: var(--bg-soft);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
td { font-size: .89rem; color: var(--ink); }
tbody tr:hover { background: var(--bg-soft); }
.empty-table { color: var(--muted); text-align: center; padding: 1.6rem; }

.progress-cell { display: flex; align-items: center; gap: .6rem; min-width: 175px; }
.progress-track {
  position: relative; width: 112px; height: 10px; border-radius: var(--radius-pill);
  background: var(--line); cursor: ew-resize; touch-action: none; user-select: none; outline: none;
}
.progress-track:focus-visible { box-shadow: 0 0 0 3px rgba(255,112,31,.18); }
.progress-track.is-dragging { background: rgba(255,112,31,.2); }
.progress-value { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: inherit; background: var(--grad-orange); }
.progress-thumb {
  position: absolute; top: 50%; width: 16px; height: 16px;
  border: 2px solid #fff; border-radius: var(--radius-pill); background: var(--orange-600);
  box-shadow: 0 3px 8px rgba(20,21,42,.25); transform: translate(-50%, -50%);
}
.progress-label { min-width: 42px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .85rem; }

.status-pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 .6rem;
  border-radius: var(--radius-pill); font-size: .78rem; font-weight: 600;
}
.status-todo { color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); }
.status-active { color: var(--orange-700); background: rgba(255,112,31,.12); }
.status-blocked { color: #8a5a00; background: #fdf0d5; }
.status-done { color: #1e7344; background: rgba(47,158,94,.14); }

.actions-col { width: 108px; }
.row-actions { display: flex; align-items: center; gap: .3rem; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; color: var(--muted);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { background: var(--bg-soft); color: var(--ink); }
.icon-button.danger:hover { background: rgba(216,68,47,.1); color: var(--danger); }

/* ==========================================================================
   Barre d'état
   ========================================================================== */
.statusbar {
  grid-row: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 .9rem; background: #fff; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted); overflow: hidden; white-space: nowrap;
}
.status-hint { overflow: hidden; text-overflow: ellipsis; }
.status-info { flex: none; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ==========================================================================
   Pied de page — une seule ligne, toujours visible
   ========================================================================== */
.site-footer {
  grid-row: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1rem; background: var(--ink); color: rgba(255,255,255,.6);
  font-size: .8rem; white-space: nowrap; overflow: hidden;
}
.footer-copy { overflow: hidden; text-overflow: ellipsis; }
.footer-links { display: inline-flex; align-items: center; gap: .5rem; flex: none; }
.footer-links button { color: rgba(255,255,255,.7); font-size: .8rem; padding: .15rem .1rem; }
.footer-links button:hover { color: var(--orange-2); text-decoration: underline; }
.footer-links span { color: rgba(255,255,255,.3); }

/* ==========================================================================
   Modales
   ========================================================================== */
.modal-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; }
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,21,42,.55); backdrop-filter: blur(3px); }

.modal {
  position: relative; width: min(660px, 100%); max-height: min(78vh, 720px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal[hidden] { display: none; }
.modal-sm { width: min(440px, 100%); }
.modal header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); flex: none;
}
.modal header h2 { font-size: 1.12rem; }
.modal-x { font-size: 1.5rem; line-height: 1; color: var(--muted); padding: 0 .3rem; border-radius: 6px; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 1.2rem 1.4rem 1.5rem; overflow-y: auto; }
.modal-body > * + * { margin-top: .8rem; }
.modal-body h3 { font-size: .95rem; margin-top: 1.3rem; }
.modal-body p, .modal-body li { font-size: .92rem; }
.modal-body ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .35rem; }
.modal-body ol li { list-style: decimal; }
.modal-body code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .84rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: .1rem .32rem;
  overflow-wrap: anywhere;
}
.modal-foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: .8rem; }

.kbd-table { width: 100%; border-collapse: collapse; }
.kbd-table th {
  text-align: left; font-family: var(--font-head); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--orange-600); padding: 1rem .2rem .3rem;
  position: static; background: none;
}
.kbd-table tr:first-child th { padding-top: 0; }
.kbd-table td { padding: .3rem .2rem; font-size: .89rem; border-top: 1px solid var(--line); }
.kbd-table td:first-child { width: 40%; color: var(--ink); }

/* Confirmation : la liste dit ce qui disparaît, l'action destructrice à droite. */
.confirm-list {
  list-style: none; padding: .7rem .9rem; margin-top: .85rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: .3rem;
}
.confirm-list[hidden] { display: none; }
.confirm-list li { font-size: .88rem; color: var(--text); padding-left: 1rem; position: relative; }
.confirm-list li::before {
  content: '×'; position: absolute; left: 0; top: -.05rem; color: var(--danger); font-weight: 700;
}
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--footer-h) + var(--status-h) + 18px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .8rem;
  background: var(--ink-2); color: #fff; font-size: .88rem;
  padding: .65rem 1.1rem; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  z-index: 300; max-width: min(560px, calc(100vw - 2rem));
}
.toast[hidden] { display: none; }
.toast.is-error { background: #6d1e14; }

/* ==========================================================================
   Écrans étroits — l'outil reste utilisable sur un portable, une tablette,
   et jusqu'au téléphone : un échéancier se consulte partout.
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --panel-w: 280px; }
  .app-bar-link { display: none; }
  .tool-label span { display: none; }
  .tool-label { padding: 0 .5rem; }
  .project-box input { width: 150px; }
}

@media (max-width: 820px) {
  :root { --bar-h: 48px; }
  html, body { height: auto; min-height: 100%; }
  body { display: block; overflow: auto; }

  .app-bar { position: sticky; top: 0; }
  .brand-name { display: none; }
  .menu-btn { padding: .4rem .55rem; font-size: .88rem; }
  .project-box label { display: none; }
  .project-box input { width: 120px; }

  .workspace { display: block; }
  .side-panel { width: auto; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side-head { position: static; }
  .chart-window { max-height: 60vh; }
  .task-list-panel { max-height: none; }
  .gantt-header, .gantt-row { grid-template-columns: 150px 1fr; }
  .statusbar { white-space: normal; height: auto; padding: .4rem .9rem; }
  .toast { bottom: 18px; }
}

@media (max-width: 520px) {
  .toolbar { gap: .35rem; }
  .task-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .segment { padding: 0 .5rem; }
}
