:root{
  --bg:#f6f1ea;
  --ink:#292522;
  --muted:#746d66;
  --card:#fffdf9;
  --shadow:0 16px 40px rgba(57,45,35,.08);
  --radius:24px;
}

*{box-sizing:border-box}
html{color-scheme:light}
body{
  margin:0;
  min-height:100vh;
  color:var(--ink);
  background:var(--bg);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input,select{font:inherit}
button{cursor:pointer}

.topbar{
  max-width:1280px;
  margin:auto;
  padding:48px 32px 26px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
}
.intro{max-width:820px}
.eyebrow{margin:0 0 8px;font-size:.72rem;font-weight:800;letter-spacing:.14em;color:#8a6757}
.today-date{margin:0 0 10px;color:var(--muted);font-size:.92rem;font-weight:700;text-transform:capitalize}
h1{font-size:clamp(2.2rem,5vw,4.5rem);letter-spacing:-.055em;line-height:.95;margin:0}
.subtitle{color:var(--muted);margin:16px 0 0;font-size:1.02rem;line-height:1.55}
.page{max-width:1280px;margin:auto;padding:18px 32px 56px}
.day-navigation{
  margin:0 0 18px;
  display:grid;
  grid-template-columns:auto minmax(180px,1fr) auto auto;
  align-items:center;
  gap:10px;
  background:rgba(255,253,249,.76);
  border:1px solid rgba(41,37,34,.07);
  border-radius:18px;
  padding:10px;
  box-shadow:0 8px 24px rgba(57,45,35,.05);
}
.selected-day{
  min-width:0;
  text-align:center;
  display:flex;
  flex-direction:column;
  gap:2px;
  color:var(--ink);
}
.selected-day-label{font-size:.68rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
#selectedDateLabel{font-size:.98rem;text-transform:capitalize}
.date-picker-label{font-size:.72rem;font-weight:750;color:var(--muted);margin:7px 0 3px}
.date-picker{max-width:210px;align-self:center;padding:8px 10px;border-radius:10px;background:#fffdf9}
.day-nav-button,.today-button{
  border:0;
  border-radius:999px;
  padding:10px 14px;
  font-weight:750;
  transition:.16s ease;
}
.day-nav-button{background:#eee7df;color:#4e4641}
.day-nav-button:hover{background:#e5ddd4}
.today-button{background:#2f2926;color:#fff}
.today-button:hover{background:#1f1b19}
.matrix{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}

.quadrant{
  min-height:300px;
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.72);
}
.q1{background:#f6d6d0}.q2{background:#f6e4bd}.q3{background:#dce9d5}.q4{background:#dce5ee}
.quadrant-head{display:flex;justify-content:space-between;gap:16px;margin-bottom:18px}
.quadrant h2{font-size:1.18rem;margin:7px 0 3px}
.quadrant p{margin:0;color:rgba(41,37,34,.65);font-size:.88rem}
.badge{font-size:.7rem;font-weight:800;letter-spacing:.12em;opacity:.55}
.count{min-width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.58);display:grid;place-items:center;font-weight:800;font-size:.85rem}
.task-list{min-height:195px;display:flex;flex-direction:column;gap:10px;border-radius:16px}
.task-list.drag-over{outline:2px dashed rgba(41,37,34,.28);outline-offset:6px}
.task{
  background:rgba(255,253,249,.94);
  border:1px solid rgba(41,37,34,.06);
  border-radius:14px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow:0 6px 16px rgba(41,37,34,.055);
  transition:.16s ease;
}
.task[hidden]{display:none}
.task:hover{transform:translateY(-1px);box-shadow:0 9px 20px rgba(41,37,34,.08)}
.task.dragging{opacity:.4}
.task-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.task-title{line-height:1.35;min-width:0;overflow-wrap:anywhere}
.task-meta{font-size:.78rem;color:var(--muted);font-weight:650;line-height:1.25}
.task-actions{display:flex;align-items:center;gap:4px}
.actions-toggle,.icon-btn{border:0;background:transparent;color:#766b64;border-radius:9px;font-size:1.35rem;width:32px;height:32px;display:grid;place-items:center;line-height:1}
.actions-toggle:hover,.icon-btn:hover{background:rgba(41,37,34,.07);color:#2d2825}
.actions-toggle:focus-visible{outline:2px solid #8a6757;outline-offset:2px}
.primary,.secondary{border:0;border-radius:999px;padding:12px 18px;font-weight:750;transition:.16s ease}
.primary{background:#2f2926;color:white;box-shadow:0 7px 18px rgba(47,41,38,.16)}
.primary:hover{transform:translateY(-1px);background:#1f1b19}
.secondary{background:#eee7df;color:#4e4641}
.hint{margin:18px 4px 0;color:var(--muted);font-size:.88rem;line-height:1.5}

dialog{width:min(92vw,480px);border:0;border-radius:24px;padding:0;background:var(--card);box-shadow:0 30px 90px rgba(32,24,20,.25)}
dialog::backdrop{background:rgba(36,29,25,.38);backdrop-filter:blur(4px)}
form{padding:26px}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:22px}
.modal-head h2{margin:0;font-size:1.55rem}
label{display:block;font-size:.82rem;font-weight:750;margin:16px 0 7px}
input,select{width:100%;border:1px solid #ddd3ca;border-radius:13px;background:#fff;padding:13px 14px;outline:none;color:var(--ink)}
.schedule-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
input:focus,select:focus{border-color:#8a6757;box-shadow:0 0 0 3px rgba(138,103,87,.12)}
.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:24px}
.move-task-name{margin:0 0 10px;color:var(--muted);line-height:1.45}

@media(max-width:760px){
  .topbar{padding:30px 18px 18px;align-items:stretch;flex-direction:column}
  .topbar .primary{align-self:flex-start}
  .page{padding:10px 18px 38px}
  .day-navigation{grid-template-columns:1fr 1fr}
  .selected-day{grid-column:1 / -1;grid-row:1}
  .today-button{grid-column:1 / -1;grid-row:3}
  .day-nav-button,.today-button{width:100%}
  .matrix{grid-template-columns:1fr}
  .quadrant{min-height:250px}
}

@media(max-width:430px){
  .schedule-fields{grid-template-columns:1fr}
  .task{align-items:flex-start}
  .task-actions{align-items:flex-end}
}

/* V2.2 — bouton désactivé uniquement pendant une requête d’écriture */
.primary:disabled{
  cursor:not-allowed;
  opacity:.48;
  transform:none;
  box-shadow:none;
}
.primary:disabled:hover{background:#2f2926;transform:none}
.load-status{
  min-height:1.4em;
  margin:0 4px 14px;
  color:var(--muted);
  font-size:.86rem;
  font-weight:650;
}
.load-status.error{color:#9b3f36}
.task-actions[hidden]{display:none}

.form-status{
  min-height:1.3em;
  margin:10px 2px 0;
  color:var(--muted);
  font-size:.82rem;
  font-weight:650;
  text-align:right;
}
.form-status.error{color:#9b3f36}


/* V2.6.2 — état terminée / réactivée */
.task-complete{
  width:18px;
  height:18px;
  min-width:18px;
  margin:0;
  padding:0;
  flex:0 0 auto;
  cursor:pointer;
  accent-color:#5c514a;
}
.task-complete:focus-visible{
  outline:2px solid #8a6757;
  outline-offset:3px;
}
.task-complete:disabled{cursor:wait;opacity:.65}
.task.completed{
  background:rgba(239,236,232,.92);
  border-color:rgba(41,37,34,.08);
}
.task.completed .task-title{
  color:#766f69;
  text-decoration:line-through;
  text-decoration-thickness:1px;
  text-decoration-color:rgba(118,111,105,.75);
}
.task.completed .task-meta{color:#8a837d}


/* V2.6.3 — menu Actions unique */
.task-action-menu{
  position:fixed;
  z-index:1000;
  min-width:168px;
  padding:6px;
  background:#fffdf9;
  border:1px solid rgba(41,37,34,.10);
  border-radius:13px;
  box-shadow:0 16px 42px rgba(41,37,34,.18);
}
.task-action-menu[hidden]{display:none}
.task-action-menu button{
  width:100%;
  border:0;
  background:transparent;
  color:#403934;
  border-radius:9px;
  padding:9px 11px;
  text-align:left;
  font-size:.86rem;
  font-weight:700;
}
.task-action-menu button:hover,
.task-action-menu button:focus-visible{
  background:#eee7df;
  outline:none;
}
.task-action-menu button.danger{color:#9b3f36}
.task-action-menu button.danger:hover,
.task-action-menu button.danger:focus-visible{background:#f6e3df}
.task-action-separator{
  height:1px;
  margin:5px 4px;
  background:rgba(41,37,34,.10);
}
