:root{
  --bg:#F5F3F1; --surface:#FFFFFF; --surface-2:#ECE8EA; --surface-3:#E1DBDF;
  --text:#201C22; --text-muted:#69636C;
  --accent:#5B3A8E; --accent-soft:#E7DFF3;
  --accent-2:#B8842E; --accent-2-soft:#F2E5CD;
  --good:#3A7D44; --warn:#B4791F; --bad:#A13D2E;
  --border:#E1DCDE;
  --sidebar-bg:#211D26; --sidebar-text:#EDE9EE; --sidebar-muted:#A79EAE;
}
*{box-sizing:border-box;}
body{ margin:0; background:var(--bg); color:var(--text); font-family:'IBM Plex Sans',sans-serif; }
h1,h2,h3,h4{ font-family:'Fraunces',serif; font-weight:600; margin:0; }
button{ font-family:inherit; cursor:pointer; }
input, textarea, select{ font-family:inherit; }
a{ color:var(--accent); }
.mono{ font-family:'IBM Plex Mono',monospace; }

/* ---- Auth screen ---- */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-card{ background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:36px 32px; width:100%; max-width:380px; }
.auth-card h1{ font-size:2.1rem; margin-bottom:4px; }
.auth-card .tag{ color:var(--text-muted); font-size:.9rem; margin-bottom:24px; }
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:.78rem; font-weight:600; margin-bottom:5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em; }
.field input, .field select, .field textarea{
  width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font-size:.92rem;
}
.btn{ border:none; border-radius:8px; padding:10px 16px; font-weight:600; font-size:.9rem; }
.btn-primary{ background:var(--accent); color:#fff; width:100%; }
.btn-ghost{ background:transparent; color:var(--accent); }
.auth-switch{ margin-top:16px; text-align:center; font-size:.85rem; color:var(--text-muted); }
.auth-error{ background:#F1DCD5; color:var(--bad); border-radius:8px; padding:9px 12px; font-size:.85rem; margin-bottom:14px; }

/* ---- Shell ---- */
.shell{ display:flex; min-height:100vh; }
.sidebar{ width:250px; flex:none; background:var(--sidebar-bg); color:var(--sidebar-text); padding:20px 16px; display:flex; flex-direction:column; gap:22px; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand .mark{ width:34px; height:34px; border-radius:9px; background:var(--accent-2); display:flex; align-items:center; justify-content:center; font-family:'Fraunces',serif; font-weight:700; color:#221a08; }
.brand b{ font-size:1.1rem; }
.channel-pill{ display:flex; gap:6px; font-size:.68rem; font-family:'IBM Plex Mono',monospace; }
.channel-pill span{ padding:2px 7px; border-radius:100px; background:rgba(255,255,255,.08); color:var(--sidebar-muted); }
.channel-pill span.on{ background:rgba(58,125,68,.25); color:#8FD79A; }
.side-section{ font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; color:var(--sidebar-muted); margin-bottom:8px; }
.project-item{ display:block; width:100%; text-align:left; background:transparent; border:none; color:var(--sidebar-text); padding:9px 10px; border-radius:8px; font-size:.88rem; margin-bottom:3px; }
.project-item.active{ background:rgba(255,255,255,.09); }
.project-item:hover{ background:rgba(255,255,255,.06); }
.new-project{ display:flex; gap:6px; margin-top:8px; }
.new-project input{ flex:1; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); border-radius:7px; color:#fff; padding:6px 8px; font-size:.82rem; }
.new-project button{ background:var(--accent-2); border:none; border-radius:7px; color:#221a08; width:30px; font-weight:700; }
.whoami{ margin-top:auto; font-size:.78rem; color:var(--sidebar-muted); display:flex; justify-content:space-between; align-items:center; }
.whoami button{ background:none; border:none; color:var(--sidebar-muted); text-decoration:underline; font-size:.75rem; }

.main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar{ display:flex; align-items:center; justify-content:space-between; padding:20px 28px; border-bottom:1px solid var(--border); }
.topbar h2{ font-size:1.5rem; }
.topbar .desc{ color:var(--text-muted); font-size:.85rem; margin-top:3px; }

.board-scroll{ flex:1; overflow-x:auto; padding:22px 28px; }
.board{ display:flex; gap:16px; min-width:min-content; height:100%; }
.column{ width:280px; flex:none; background:var(--surface-2); border:1px solid var(--border); border-radius:12px; padding:12px; display:flex; flex-direction:column; }
.column-head{ display:flex; align-items:center; gap:8px; margin-bottom:10px; padding:0 2px; }
.dot{ width:8px; height:8px; border-radius:50%; flex:none; }
.column-head b{ font-size:.88rem; flex:1; }
.column-head .count{ font-family:'IBM Plex Mono',monospace; font-size:.7rem; background:var(--surface-3); border-radius:100px; padding:1px 8px; }
.cards{ display:flex; flex-direction:column; gap:8px; min-height:40px; }
.card{ background:var(--surface); border:1px solid var(--border); border-radius:9px; padding:11px 12px; cursor:grab; }
.card.dragging{ opacity:.4; }
.card h4{ font-size:.9rem; font-weight:600; margin-bottom:6px; }
.card-meta{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.pill{ font-size:.68rem; padding:2px 8px; border-radius:100px; font-family:'IBM Plex Mono',monospace; }
.pill.prio-haute{ background:#F1DCD5; color:var(--bad); }
.pill.prio-normale{ background:var(--surface-3); color:var(--text-muted); }
.pill.prio-basse{ background:var(--surface-3); color:var(--text-muted); }
.pill.assignee{ background:var(--accent-soft); color:var(--accent); }
.pill.due{ background:var(--accent-2-soft); color:var(--accent-2); }
.add-task{ background:none; border:none; color:var(--text-muted); text-align:left; padding:8px 2px; font-size:.85rem; }
.add-task:hover{ color:var(--accent); }

/* ---- Modal ---- */
.overlay{ position:fixed; inset:0; background:rgba(20,18,22,.5); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50; }
.modal{ background:var(--surface); border-radius:14px; width:100%; max-width:760px; max-height:88vh; overflow-y:auto; padding:28px 30px; }
.modal-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:18px; }
.modal-close{ background:none; border:none; font-size:1.3rem; color:var(--text-muted); }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); margin:20px 0 14px; }
.tab{ background:none; border:none; padding:8px 14px; font-size:.85rem; color:var(--text-muted); border-bottom:2px solid transparent; }
.tab.active{ color:var(--accent); border-color:var(--accent); font-weight:600; }
.checklist-row{ display:flex; align-items:center; gap:8px; padding:5px 0; font-size:.88rem; }
.checklist-row.done label{ text-decoration:line-through; color:var(--text-muted); }
.comment{ background:var(--surface-2); border-radius:8px; padding:8px 11px; margin-bottom:8px; font-size:.85rem; }
.comment b{ font-size:.78rem; color:var(--accent); }
.inline-form{ display:flex; gap:8px; margin-top:10px; }
.inline-form input, .inline-form select{ flex:1; }
.reminder-row{ display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px solid var(--border); font-size:.84rem; }
.reminder-status{ font-family:'IBM Plex Mono',monospace; font-size:.68rem; padding:2px 7px; border-radius:100px; }
.reminder-status.planifie{ background:var(--accent-soft); color:var(--accent); }
.reminder-status.envoye{ background:#DCEEDD; color:var(--good); }
.reminder-status.echec{ background:#F1DCD5; color:var(--bad); }
.channel-note{ font-size:.78rem; color:var(--text-muted); margin-top:4px; }
.danger-link{ background:none; border:none; color:var(--bad); font-size:.8rem; text-decoration:underline; margin-top:16px; }

@media (max-width:760px){
  .shell{ flex-direction:column; }
  .sidebar{ width:100%; flex-direction:row; flex-wrap:wrap; }
  .grid2{ grid-template-columns:1fr; }
}
