@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #edf4fb;
  --surface: #fbfdff;
  --surface-2: #e5eef8;
  --ink: #17324d;
  --muted: #6c8096;
  --line: #d3e0ed;
  --coral: #3978d4;
  --coral-soft: #dceafe;
  --yellow: #62a1df;
  --yellow-soft: #e2f1ff;
  --green: #2868bd;
  --green-soft: #d7e9fb;
  --blue: #1d5ca8;
  --shadow: 0 18px 55px rgba(30, 72, 112, .11);
  font-family: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(145deg, #f5f9fd 0%, #edf5fc 48%, #e8f0f9 100%); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 15%, #d5e8fb 0, transparent 32%), radial-gradient(circle at 88% 82%, #c8dcf4 0, transparent 34%), var(--paper); }
.auth-card { width: min(440px, 100%); padding: 48px; border: 1px solid rgba(255,255,255,.8); border-radius: 32px; background: rgba(255,253,248,.88); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.auth-card h1 { font: 800 3.1rem/1 'Manrope', sans-serif; letter-spacing: -.07em; margin: 12px 0; }
.auth-intro { color: var(--muted); margin: 0 0 32px; }
.auth-form { display: grid; gap: 12px; }
.auth-form > label, .field { font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.code-field { display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.code-field:focus-within { outline: 3px solid rgba(239,118,95,.18); border-color: var(--coral); }
.code-field input { flex: 1; border: 0; padding: 14px 16px; outline: 0; background: transparent; }
.icon-button { width: 48px; background: transparent; color: var(--muted); }
.form-error { min-height: 1.2em; color: #b64037; margin: 0; font-size: .84rem; }

.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--ink); display: grid; align-content: center; gap: 3px; padding: 8px; box-shadow: 0 8px 18px rgba(35,42,41,.18); }
.brand-mark span { height: 3px; border-radius: 4px; background: var(--paper); transform-origin: left; }
.brand-mark span:nth-child(2) { width: 70%; background: var(--coral); }
.brand-mark span:nth-child(3) { width: 45%; }
.brand-mark--large { width: 52px; height: 52px; border-radius: 16px; padding: 12px; }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .13em; font-size: .68rem; font-weight: 800; color: var(--coral); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 27px 18px 20px; border-right: 0; display: flex; flex-direction: column; background: #173c63; box-shadow: 12px 0 36px rgba(19,54,89,.16); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; color: #fffaf1; text-decoration: none; font: 800 1.25rem 'Manrope', sans-serif; letter-spacing: -.04em; }
.sidebar .brand-mark{background:#f4f9ff;box-shadow:0 8px 22px rgba(0,0,0,.2)}.sidebar .brand-mark span{background:#173c63}.sidebar .brand-mark span:nth-child(2){background:#6da8eb}
.main-nav, .sidebar-section { display: grid; gap: 5px; }
.sidebar-section { margin-top: 28px; }
.sidebar-section > p { margin: 0 12px 8px; text-transform: uppercase; letter-spacing: .11em; color: rgba(255,255,255,.46); font-size: .65rem; font-weight: 800; }
.nav-item, .sidebar-action { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; background: transparent; color: rgba(255,255,255,.72); text-align: left; transition: .18s ease; }
.nav-item:hover, .sidebar-action:hover { background: rgba(255,255,255,.1); color: white; }
.nav-item.is-active { background: #f4f9ff; color: #173c63; box-shadow: 0 10px 25px rgba(8,29,50,.24); }
.nav-item > span { width: 18px; text-align: center; font-size: 1.05rem; }
.nav-item b { margin-left: auto; font-size: .68rem; padding: 2px 7px; border-radius: 20px; background: rgba(0,0,0,.07); }
.nav-item.is-active b { background: rgba(255,255,255,.14); }
.nav-item--small { font-size: .86rem; padding-block: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }.dot--coral{background:var(--coral)}.dot--yellow{background:var(--yellow)}.dot--green{background:var(--green)}.dot--gray{background:#aaa}
.sidebar-bottom { margin-top: auto; display: grid; gap: 2px; }
.sidebar-action { font-size: .8rem; padding-block: 8px; }
.file-action input { display: none; }
.sync-status { margin: 14px 10px 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.62); font-size: .73rem; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sync-dot.is-busy { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }.sync-dot.is-error{background:var(--coral);box-shadow:0 0 0 3px var(--coral-soft)}

.workspace { min-width: 0; padding: 34px clamp(22px,4vw,62px) 60px; }
.topbar { min-height:48px; display:grid;grid-template-columns:minmax(260px,1fr) auto;align-items:center;gap:28px }
.topbar>div:first-of-type{position:static;transform:none;width:100%;max-width:none;text-align:center}
.topbar h1 { margin: 0; font: 800 clamp(1.7rem,3vw,2.55rem)/1.15 'Manrope', sans-serif; letter-spacing: .02em; text-transform:uppercase; }
.topbar-actions { margin-left:0;display: flex; gap: 12px; align-items: center;justify-self:end }
.search-box { width: min(280px, 28vw); display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.66); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: .84rem; }
.primary-button, .secondary-button, .danger-button { padding: 13px 20px; border-radius: 12px; font-weight: 700; transition: transform .15s, box-shadow .15s; }
.primary-button { background: var(--coral); color: white; box-shadow: 0 8px 18px rgba(239,118,95,.22); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(239,118,95,.28); }
.primary-button--compact { white-space: nowrap; padding: 11px 16px; font-size: .84rem; }
.secondary-button { background: var(--surface-2); }.danger-button{background:#f8dfdc;color:#a13a32}.mobile-menu{display:none;background:transparent;font-size:1.3rem}

.dashboard { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 30px 0 24px; }
.dashboard article { display: flex; align-items: center; gap: 13px; padding: 19px; border: 1px solid rgba(255,255,255,.6); border-radius: 17px; box-shadow:0 8px 22px rgba(61,66,55,.05) }
.dashboard article:nth-child(1){background:#dceafe}.dashboard article:nth-child(2){background:#d6e8fa}.dashboard article:nth-child(3){background:#cfe2f6}.dashboard article:nth-child(4){background:#dce4f8}
.metric-icon { flex: 0 0 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; }.metric-icon--coral{background:#c8def6;color:#2868ad}.metric-icon--yellow{background:#c3dcf4;color:#245e98}.metric-icon--green{background:#b9d5ef;color:#1e568e}.metric-icon--ink{background:#c8d7ed;color:#1b4775}
.dashboard strong { display: block; font: 800 1.45rem 'Manrope'; line-height: 1; }.dashboard p{margin:5px 0 0;color:var(--muted);font-size:.75rem}
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.segmented { padding: 4px; background: #e9e5dc; border-radius: 12px; display: flex; }.segmented button{padding:8px 14px;border-radius:9px;background:transparent;color:var(--muted);font-size:.8rem;font-weight:600}.segmented button.is-active{background:var(--surface);color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.06)}
.filters { display:grid;grid-template-columns:repeat(3,minmax(145px,1fr));gap:8px;min-width:min(100%,500px) }.filters select{width:100%;min-width:0;padding:10px 34px 10px 12px;border:1px solid #cbdbea;border-radius:11px;background-color:rgba(251,253,255,.94);background-image:linear-gradient(45deg,transparent 50%,#4c6f92 50%),linear-gradient(135deg,#4c6f92 50%,transparent 50%);background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat;appearance:none;font-size:.77rem;outline:0}.filters select:focus{border-color:#4382ca;box-shadow:0 0 0 3px rgba(67,130,202,.13)}

.content-panel { border: 1px solid var(--line); border-radius: 19px; background: rgba(255,253,248,.82); overflow: hidden; box-shadow: 0 10px 36px rgba(49,45,36,.045); }
.list-head, .task-row { display: grid; grid-template-columns: minmax(260px,1.8fr) minmax(105px,.65fr) 120px 110px 110px 40px; gap: 12px; align-items: center; }
.list-head { padding: 12px 19px; border-bottom: 1px solid var(--line); color: #93968f; text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; font-weight: 800; }
.task-row { position: relative; padding: 16px 19px; border-bottom: 1px solid #e1eaf3; border-left:4px solid transparent; transition: .16s; cursor: pointer; }.task-row.status-todo{border-left-color:#8da7c1}.task-row.status-doing{border-left-color:#5994d0}.task-row.status-waiting{border-left-color:#3679bd}.task-row.status-blocked{border-left-color:#245b9a}.task-row.status-done{border-left-color:#193f6b}.task-row:last-child{border-bottom:0}.task-row:hover{background:#fff}.task-row.is-done{opacity:.65}.task-row.is-done .task-name{text-decoration:line-through}
.task-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.complete-btn { flex: 0 0 20px; height: 20px; margin-top: 2px; border: 1.5px solid #b9b9b1; border-radius: 7px; background: transparent; display:grid;place-items:center;color:white;font-size:.7rem }.is-done .complete-btn{background:var(--green);border-color:var(--green)}
.task-copy { min-width:0 }.task-name{display:block;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.9rem}.task-meta{margin-top:5px;display:flex;gap:7px;align-items:center;color:var(--muted);font-size:.69rem}.task-meta .urgent{color:var(--coral);font-weight:700}
.person { display:flex;align-items:center;gap:7px;font-size:.76rem }.avatar{width:27px;height:27px;border-radius:9px;background:var(--green-soft);color:var(--green);display:grid;place-items:center;font-size:.65rem;font-weight:800}.due{font-size:.76rem;color:var(--muted)}.due.is-late{color:var(--coral);font-weight:700}
.pill { width:max-content;padding:5px 8px;border-radius:20px;font-size:.66rem;font-weight:700}.pill--todo{background:#e7eef6;color:#54708b}.pill--doing{background:#dcecff;color:#3571ad}.pill--waiting{background:#cfe3f8;color:#245f9b}.pill--blocked{background:#c4daf1;color:#174f89}.pill--done{background:#bcd4eb;color:#153f69}
.priority { font-size:.72rem;font-weight:700 }.priority--critical,.priority--high{color:#1d5fa7}.priority--medium{color:#3c78b5}.priority--low{color:var(--muted)}
.more-btn{width:34px;height:34px;border-radius:9px;background:transparent;color:var(--muted)}.more-btn:hover{background:var(--surface-2);color:var(--ink)}
.progress-mini{width:72px;height:4px;background:#e2e0d9;border-radius:4px;overflow:hidden}.progress-mini span{display:block;height:100%;background:var(--green)}
.mobile-task-details{display:none}
.empty-state{padding:80px 24px;text-align:center}.empty-state .empty-icon{width:56px;height:56px;margin:auto;display:grid;place-items:center;border-radius:18px;background:var(--green-soft);color:var(--green);font-size:1.6rem}.empty-state h2{font:800 1.2rem 'Manrope';margin:18px 0 6px}.empty-state p{color:var(--muted);margin:0 0 20px}

.board { display:grid;grid-template-columns:repeat(4,minmax(230px,1fr));gap:13px;align-items:start;overflow-x:auto;padding-bottom:12px }.board-column{border-radius:17px;background:rgba(235,231,222,.7);padding:12px;min-height:260px}.board-head{display:flex;align-items:center;justify-content:space-between;padding:3px 3px 12px;font-size:.75rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.board-head b{font-size:.65rem;background:rgba(0,0,0,.06);padding:3px 7px;border-radius:12px}.board-card{padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:13px;margin-bottom:9px;box-shadow:0 5px 16px rgba(49,45,36,.04);cursor:pointer}.board-card:hover{transform:translateY(-1px)}.board-card h3{font-size:.84rem;margin:0 0 12px}.board-card-foot{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:.68rem}

.calendar-wrap{display:grid;grid-template-columns:repeat(7,1fr);border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--surface)}.calendar-title{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line)}.calendar-title h2{font:800 1rem 'Manrope';margin:0}.calendar-title button{width:32px;height:32px;border-radius:9px;background:var(--surface-2)}.weekday{padding:10px;border-bottom:1px solid var(--line);font-size:.64rem;text-align:center;text-transform:uppercase;color:var(--muted);font-weight:800}.day{min-height:112px;padding:9px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.day:nth-child(7n+1){border-right:0}.day.is-muted{background:#f4f2ed;color:#aaa}.day.is-today .day-number{background:var(--coral);color:white}.day-number{display:grid;place-items:center;width:25px;height:25px;border-radius:9px;font-size:.7rem;font-weight:700}.calendar-task{display:block;width:100%;margin-top:5px;padding:5px 6px;border-radius:7px;background:var(--yellow-soft);text-align:left;font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-task.is-done{background:var(--green-soft);text-decoration:line-through}

.task-dialog { width:min(650px,calc(100% - 24px)); max-height:calc(100vh - 30px); padding:0;border:0;border-radius:24px;background:var(--surface);box-shadow:0 30px 100px rgba(35,42,41,.28); }.task-dialog::backdrop{background:rgba(35,42,41,.4);backdrop-filter:blur(5px)}.task-dialog form{padding:25px;overflow:auto;max-height:calc(100vh - 30px)}.dialog-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:22px}.dialog-head h2{margin:0;font:800 1.55rem 'Manrope';letter-spacing:-.04em}.close-button{width:36px;height:36px;border-radius:11px;background:var(--surface-2);font-size:1.35rem}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.field{display:grid;gap:6px;color:#666}.field input,.field select,.field textarea{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:white;outline:0}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--coral);box-shadow:0 0 0 3px rgba(239,118,95,.12)}.field--full{margin-top:14px}.section-title{display:flex;align-items:center;justify-content:space-between;margin-top:20px}.section-title h3{font-size:.85rem}.section-title button{background:transparent;color:var(--coral);font-size:.75rem;font-weight:700}.subtask-edit{display:flex;gap:7px;margin-top:7px}.subtask-edit input{flex:1;padding:9px 10px;border:1px solid var(--line);border-radius:9px}.subtask-edit button{background:transparent;color:var(--muted)}.dialog-actions{display:flex;align-items:center;gap:9px;margin-top:24px}.dialog-actions div{flex:1}.toast{position:fixed;right:24px;bottom:24px;z-index:100;padding:12px 16px;border-radius:12px;background:var(--ink);color:white;font-size:.78rem;box-shadow:var(--shadow);opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s}.toast.is-visible{opacity:1;transform:none}
.field--progress{grid-template-columns:1fr auto;align-content:start}.field--progress span{color:var(--ink);font-size:.75rem}.field--progress input{grid-column:1/-1;padding:0;border:0;box-shadow:none!important;accent-color:var(--coral)}
.attachment-add{color:var(--coral);font-size:.75rem;font-weight:700;cursor:pointer}.attachment-add input{display:none}.attachment-list{display:grid;gap:6px}.attachment-item{display:flex;align-items:center;gap:9px;padding:9px 11px;border-radius:10px;background:var(--surface-2);font-size:.75rem}.attachment-item a{color:var(--ink);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment-item small{margin-left:auto;color:var(--muted)}.attachment-item button{background:transparent;color:var(--muted)}.history-panel{margin-top:20px;border-top:1px solid var(--line);padding-top:14px}.history-panel summary{cursor:pointer;font-size:.8rem;font-weight:700}.history-item{display:flex;gap:10px;padding:9px 2px;border-bottom:1px solid #ebe8df;font-size:.72rem}.history-item time{color:var(--muted);white-space:nowrap}.history-item p{margin:0}
.detail-dialog{width:min(620px,calc(100% - 24px));max-height:calc(100vh - 24px);padding:0;border:0;border-radius:24px;background:var(--surface);box-shadow:0 30px 100px rgba(35,42,41,.28)}.detail-dialog::backdrop{background:rgba(35,42,41,.42);backdrop-filter:blur(5px)}.detail-dialog>article{padding:27px;overflow:auto;max-height:calc(100vh - 24px)}.detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.detail-head h2{margin:0;font:800 1.65rem/1.2 'Manrope';letter-spacing:-.04em}.detail-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:17px}.detail-facts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0 0}.detail-facts>div{padding:12px;border-radius:12px;background:var(--paper)}.detail-facts dt{font-size:.62rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:800}.detail-facts dd{margin:5px 0 0;font-size:.8rem;font-weight:700}.detail-section{margin-top:22px}.detail-section h3{margin:0 0 10px;font-size:.78rem;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.detail-section>p{margin:0;line-height:1.55;font-size:.88rem;white-space:pre-wrap}.detail-section-title{display:flex;align-items:center;justify-content:space-between}.detail-section-title span{font-size:.72rem;color:var(--muted)}.detail-subtasks{display:grid;gap:7px}.detail-subtask{display:flex;align-items:center;gap:10px;width:100%;padding:10px 11px;border-radius:11px;background:var(--paper);text-align:left;font-size:.8rem}.detail-subtask i{display:grid;place-items:center;width:19px;height:19px;border:1.5px solid #aaa;border-radius:6px;font-style:normal;color:white}.detail-subtask.is-done{color:var(--muted);text-decoration:line-through}.detail-subtask.is-done i{background:var(--green);border-color:var(--green)}.detail-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:25px;padding-top:18px;border-top:1px solid var(--line)}

@media (max-width: 1050px){.dashboard{grid-template-columns:repeat(2,1fr)}}
@media (min-width: 761px) and (max-width: 1050px){.content-panel{overflow-x:auto}.list-head,.task-row{min-width:780px}}
/* ===================== Mobile v2 ===================== */
/* Éléments propres au mobile : masqués par défaut (bureau inchangé) */
.tabbar, .sidebar-backdrop, .search-toggle, .calendar-agenda, .day-dots, .fold > summary { display: none; }
html { -webkit-text-size-adjust: 100%; }
button, label, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  body { min-height: 100dvh; }
  body:has(dialog[open]), body.menu-open { overflow: hidden; }

  /* --- Menu latéral --- */
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { position: fixed; inset: 0 auto 0 0; height: 100dvh; width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden; box-shadow: none; overflow-y: auto; z-index: 40; padding-top: max(27px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); transition: transform .24s ease, visibility 0s linear .24s; }
  .sidebar.is-open { transform: none; visibility: visible; box-shadow: 20px 0 60px rgba(0,0,0,.28); transition: transform .24s ease; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(14,32,52,.45); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .nav-item, .sidebar-action { min-height: 46px; }

  /* --- Barre du haut collante --- */
  .workspace { padding: 0 12px calc(150px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; top: 0; z-index: 15; isolation: isolate; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 0 8px; min-height: 0; margin: 0 -12px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .topbar::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(237,244,251,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .topbar>div:first-of-type { grid-column: 2; min-width: 0; width: 100%; text-align: center; }
  .topbar h1 { font-size: 1.05rem; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-menu, .search-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 13px; background: rgba(255,255,255,.85); color: var(--ink); font-size: 1.25rem; box-shadow: 0 1px 0 rgba(23,50,77,.06); }
  .search-toggle { grid-column: 3; }
  .topbar.search-open .search-toggle { background: var(--ink); color: #fff; }
  .topbar-actions { display: contents; }
  .search-box { grid-column: 1 / -1; grid-row: 2; display: none; width: 100%; max-width: none; min-height: 46px; margin-top: 10px; background: #fff; }
  .topbar.search-open .search-box { display: flex; }
  .search-box input { font-size: 16px; padding: 12px 0; }

  /* --- Bouton « Nouvelle tâche » (flottant) --- */
  .topbar-actions .primary-button--compact { position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 20; width: 56px; height: 56px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 0; box-shadow: 0 12px 28px rgba(29,92,168,.34); }
  .topbar-actions .primary-button--compact span { display: none; }
  .topbar-actions .primary-button--compact::before,
  .topbar-actions .primary-button--compact::after { content: ''; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 2px; transform: translate(-50%,-50%); }
  .topbar-actions .primary-button--compact::before { width: 18px; height: 4px; }
  .topbar-actions .primary-button--compact::after { width: 4px; height: 18px; }

  /* --- Barre d'onglets en bas --- */
  .tabbar { display: grid; grid-template-columns: repeat(3,1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); background: rgba(251,253,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; padding: 6px 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 700; }
  .tabbar button.is-active { background: var(--coral-soft); color: var(--green); }

  /* --- Statistiques compactes --- */
  .dashboard { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin: 12px 0 10px; padding: 0; }
  .dashboard article { min-width: 0; min-height: 0; padding: 9px 4px; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2px; border-radius: 14px; }
  .metric-icon { display: none; }
  .dashboard article > div { width: 100%; text-align: center; }
  .dashboard strong { font-size: 1.1rem; }
  .dashboard p { margin: 3px 0 0; font-size: .62rem; white-space: nowrap; }

  /* --- Filtres : une seule ligne défilante --- */
  .controls { display: block; margin-bottom: 10px; }
  .segmented { display: none; }
  .filters { display: flex; gap: 8px; min-width: 0; width: auto; margin: 0 -12px; padding: 0 12px 4px; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters select, .filters select:nth-child(3) { flex: 0 0 auto; display: block; width: auto; min-width: 150px; max-width: 70vw; height: 44px; font-size: 16px; }
  .filters select.is-filtered { border-color: #4382ca; background-color: #e8f1fc; font-weight: 600; }

  /* --- Cartes de tâches --- */
  .content-panel { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .list-head { display: none; }
  .task-row { display: block; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 16px; background: rgba(251,253,255,.96); box-shadow: 0 6px 20px rgba(29,70,110,.07); }
  .task-row:last-child { border-bottom: 1px solid var(--line); }
  .task-row:hover { background: var(--surface); }
  .task-row > .person, .task-row > .due, .task-row > .pill, .task-row > .priority { display: none; }
  .task-row > .more-btn { display: grid; place-items: center; position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; }
  .task-main { gap: 12px; padding-right: 38px; align-items: flex-start; }
  .complete-btn { position: relative; flex: 0 0 28px; height: 28px; margin-top: 0; border-radius: 9px; font-size: .85rem; }
  .complete-btn::after { content: ''; position: absolute; inset: -8px; }
  .task-name { white-space: normal; font-size: .96rem; line-height: 1.35; }
  .task-meta { flex-wrap: wrap; margin-top: 6px; }
  .task-meta .urgent { display: none; }
  .mobile-task-details { display: block; margin: 10px 0 0 40px; padding-top: 10px; border-top: 1px solid #e1eaf3; }
  .mobile-task-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .mobile-task-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 9px; color: var(--muted); font-size: .74rem; }
  .mobile-task-notes { margin: 8px 0 0; color: #526b84; font-size: .76rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .mobile-progress { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: .68rem; }
  .mobile-progress .progress-mini { flex: 1; width: auto; }
  .empty-state { padding: 56px 20px; }

  /* --- Tableau : colonnes qui se « calent » au doigt --- */
  .board { grid-template-columns: repeat(4,84vw); gap: 10px; margin: 0 -12px; padding: 0 12px 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 12px; scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .board-column { scroll-snap-align: start; min-height: 220px; background: rgba(205,222,240,.5); }

  /* --- Calendrier : grille qui tient dans l'écran + agenda du jour --- */
  .content { overflow: visible; }
  .calendar-wrap { min-width: 0; border-radius: 16px; }
  .calendar-title { padding: 6px 8px; }
  .calendar-title button { width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; }
  .weekday { padding: 8px 0; font-size: .6rem; }
  .day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; padding: 5px 0 4px; min-width: 0; cursor: pointer; }
  .day.is-muted { background: #f0f5fa; }
  .day-number { width: 28px; height: 28px; border-radius: 10px; font-size: .8rem; }
  .day.is-selected .day-number { box-shadow: inset 0 0 0 2px var(--coral); }
  .day.is-today.is-selected .day-number { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--coral); }
  .calendar-task { display: none; }
  .day-dots { display: flex; gap: 3px; height: 6px; }
  .day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
  .day-dots i.is-late { background: #d4572f; }
  .day-dots i.is-done { background: #9db4cc; }
  .calendar-agenda { display: block; margin-top: 16px; }
  .calendar-agenda h3 { margin: 0 0 10px; font: 800 .8rem 'Manrope', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .agenda-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-bottom: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(251,253,255,.96); text-align: left; font-size: .9rem; font-weight: 600; }
  .agenda-item span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agenda-item small { color: var(--muted); font-weight: 600; font-size: .7rem; }
  .agenda-item.is-done span:nth-child(2) { text-decoration: line-through; color: var(--muted); }
  .agenda-dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--coral); }
  .agenda-item.is-late .agenda-dot { background: #d4572f; }
  .agenda-item.is-done .agenda-dot { background: #9db4cc; }

  /* --- Fenêtres « feuille » (détail / édition) : basses, opaques, au-dessus du clavier --- */
  .task-dialog, .detail-dialog { position: fixed; inset: auto 0 var(--kb, 0px) 0; width: 100%; max-width: none; height: auto; max-height: var(--sheet-max, 80dvh); margin: 0; border-radius: 22px 22px 0 0; overflow: hidden; background: #fbfdff; }
  .task-dialog form, .detail-dialog > article { max-height: var(--sheet-max, 80dvh); padding: 8px 16px 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .task-dialog form::before, .detail-dialog > article::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto 8px; border-radius: 4px; background: #c9d6e4; }
  .close-button { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; }
  .task-dialog .close-button { margin-top: -4px; }
  .dialog-head { align-items: center; margin-bottom: 4px; }
  .dialog-head .eyebrow { display: none; }
  .dialog-head h2 { font-size: 1.1rem; }
  .detail-head { align-items: center; gap: 10px; }
  .detail-head .eyebrow { margin-bottom: 2px; }
  .detail-head h2 { font-size: 1.2rem; line-height: 1.25; }
  .detail-badges { margin-top: 10px; gap: 6px; }

  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 8px; }
  .field--full { margin-top: 8px; }
  #dueField { grid-column: 1 / -1; }
  .field { grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; font-size: .7rem; }
  .field input, .field select, .field textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 42px; padding: 8px 12px; font-size: 16px; border-radius: 11px; }
  .field textarea { min-height: 76px; }
  .field select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-color: #fff; background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234c6f92' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .field input[type="date"], .field input[type="datetime-local"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden; }
  .field input::-webkit-date-and-time-value { text-align: left; min-width: 0; margin: 0; }
  .field--progress { grid-template-columns: minmax(0, 1fr) auto; align-content: start; }
  .field--progress input { grid-column: 1 / -1; min-height: 0; height: 28px; margin: 0; width: 100%; }

  /* sections repliables (rappel/notes, pièces jointes, sous-tâches, historique) */
  .fold { margin-top: 0; border-top: 1px solid var(--line); }
  .form-grid + .fold { margin-top: 8px; }
  .fold > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; font-weight: 700; list-style: none; cursor: pointer; }
  .fold > summary::-webkit-details-marker { display: none; }
  .fold > summary em { margin-left: auto; font-style: normal; font-weight: 600; font-size: .74rem; color: var(--muted); }
  .fold > summary::after { content: '+'; width: 22px; text-align: center; color: var(--coral); font-size: 1.3rem; font-weight: 600; line-height: 1; }
  .fold[open] > summary::after { content: '−'; }
  .fold[open] { padding-bottom: 8px; }
  .fold > .field { margin: 0 0 10px; }
  .fold .section-title { margin-top: 0; justify-content: flex-end; }
  .fold .section-title h3 { display: none; }
  .task-dialog .history-panel { display: none; }
  .detail-dialog .history-panel { margin-top: 12px; padding-top: 0; }
  .detail-dialog .history-panel summary { display: flex; align-items: center; min-height: 44px; }

  .subtask-edit { margin-top: 6px; }
  .subtask-edit input { min-height: 44px; font-size: 16px; }
  .subtask-edit button { width: 44px; font-size: 1.2rem; }
  .section-title button, .attachment-add { min-height: 40px; display: inline-flex; align-items: center; }
  .attachment-item { min-height: 44px; min-width: 0; }
  .attachment-item a { flex: 1 1 auto; min-width: 0; }
  .attachment-item small { flex: none; }
  .attachment-item button { flex: none; }
  .attachment-item button { width: 36px; height: 36px; }

  .dialog-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 8px -16px 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: #fbfdff; border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -12px rgba(23,50,77,.22); }
  .dialog-actions > div { flex: 1 1 0; min-width: 0; }
  .dialog-actions button { flex: 0 1 auto; min-width: 0; padding: 12px 12px; font-size: .9rem; white-space: nowrap; }
  .dialog-actions .danger-button { order: 0; width: auto; }

  .detail-facts { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .detail-facts > div { padding: 9px 11px; }
  .detail-section { margin-top: 14px; }
  .detail-subtask { min-height: 44px; padding-block: 8px; }
  .detail-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; margin: 16px -16px 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: #fbfdff; border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -12px rgba(23,50,77,.22); }
  .detail-actions button { padding: 13px 8px; min-width: 0; }

  .toast { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); text-align: center; }
  .auth-screen { min-height: 100dvh; }
  .auth-card { padding: 34px 25px; }
}
@media (max-width: 340px) {
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions > div { display: none; }
  .dialog-actions .danger-button { order: 3; flex: 1 1 100%; }
  .dialog-actions .secondary-button, .dialog-actions .primary-button { flex: 1 1 0; }
}
@keyframes sheet-in{from{transform:translateY(40px)}to{transform:none}}
@media (prefers-reduced-motion: reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* ===== Couleurs v3 : statut / urgence / avancement ===== */
:root {
  --st-todo: #5b6b7d; --st-todo-bg: #e8edf2;
  --st-doing: #b45309; --st-doing-bg: #fde8c8;
  --st-waiting: #6d3fc0; --st-waiting-bg: #ebe2fb;
  --st-blocked: #b42318; --st-blocked-bg: #fddcd8;
  --st-done: #15803d; --st-done-bg: #d5f1de;
  --urgent: #c81e1e; --urgent-bg: #fee2e2;
}
.pill--todo { background: var(--st-todo-bg); color: var(--st-todo); }
.pill--doing { background: var(--st-doing-bg); color: var(--st-doing); }
.pill--waiting { background: var(--st-waiting-bg); color: var(--st-waiting); }
.pill--blocked { background: var(--st-blocked-bg); color: var(--st-blocked); }
.pill--done { background: var(--st-done-bg); color: var(--st-done); }
.pill--progress { background: #e3ecf7; color: #1f4f86; }
.pill--late { background: var(--urgent); color: #fff; }
.priority--critical { color: #fff; background: var(--urgent); padding: 3px 8px; border-radius: 20px; }
.priority--high { color: var(--st-doing); background: var(--st-doing-bg); padding: 3px 8px; border-radius: 20px; }
.priority--medium { color: var(--st-todo); }
.priority--low { color: var(--muted); }
.task-meta .urgent { color: #fff; background: var(--urgent); padding: 1px 7px; border-radius: 10px; }
.late-chip { color: var(--urgent); background: var(--urgent-bg); font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.due.is-late { color: var(--urgent); font-weight: 800; }

.task-row { border-left: 5px solid var(--st-todo); }
.task-row.status-doing { border-left-color: #f59e0b; }
.task-row.status-waiting { border-left-color: #8b5cf6; }
.task-row.status-blocked { border-left-color: #dc2626; }
.task-row.status-done { border-left-color: #22a35a; }
.task-row.prio-critical:not(.is-done), .task-row.is-late { border-left-color: var(--urgent); }
.task-row.is-late:not(.is-done) { background: #fff5f5; }
.task-row.is-done { opacity: .72; }

.progress-mini { background: #e3e8ee; }
.status-todo .progress-mini span { background: var(--st-todo); }
.status-doing .progress-mini span { background: #f59e0b; }
.status-waiting .progress-mini span { background: #8b5cf6; }
.status-blocked .progress-mini span { background: #dc2626; }
.status-done .progress-mini span { background: #22a35a; }

.board-card { border-left: 5px solid var(--st-todo); }
.board-card.status-doing { border-left-color: #f59e0b; }
.board-card.status-waiting { border-left-color: #8b5cf6; }
.board-card.status-blocked { border-left-color: #dc2626; }
.board-card.status-done { border-left-color: #22a35a; }
.board-card.is-late:not(.status-done), .board-card.prio-critical:not(.status-done) { border-left-color: var(--urgent); }

.day-dots i.is-doing { background: #f59e0b; }
.day-dots i.is-late, .agenda-item.is-late .agenda-dot { background: var(--urgent); }
.agenda-item.status-doing .agenda-dot { background: #f59e0b; }
.agenda-item.status-done .agenda-dot { background: #22a35a; }
.calendar-task.status-doing { border-left: 3px solid #f59e0b; }
.calendar-task.is-late { border-left: 3px solid var(--urgent); color: var(--urgent); }

.detail-bar { height: 10px; border-radius: 6px; background: #e3e8ee; overflow: hidden; margin: 2px 0 12px; }
.detail-bar[hidden] { display: none; }
.detail-bar span { display: block; height: 100%; background: #f59e0b; border-radius: 6px; transition: width .2s; }
#taskDetailDialog[data-status="todo"] .detail-bar span { background: var(--st-todo); }
#taskDetailDialog[data-status="waiting"] .detail-bar span { background: #8b5cf6; }
#taskDetailDialog[data-status="blocked"] .detail-bar span { background: #dc2626; }
#taskDetailDialog[data-status="done"] .detail-bar span { background: #22a35a; }

#taskStatus[data-v="todo"] { border-color: var(--st-todo); background-color: var(--st-todo-bg); }
#taskStatus[data-v="doing"] { border-color: #f59e0b; background-color: var(--st-doing-bg); }
#taskStatus[data-v="waiting"] { border-color: #8b5cf6; background-color: var(--st-waiting-bg); }
#taskStatus[data-v="blocked"] { border-color: #dc2626; background-color: var(--st-blocked-bg); }
#taskStatus[data-v="done"] { border-color: #22a35a; background-color: var(--st-done-bg); }
#taskPriority[data-v="critical"] { border-color: var(--urgent); background-color: var(--urgent-bg); color: var(--urgent); font-weight: 700; }
#taskPriority[data-v="high"] { border-color: #f59e0b; background-color: var(--st-doing-bg); }
#taskProgress { accent-color: #f59e0b; }

/* ===== v1.6 : colonnes, cartes colorées, centrage, version ===== */
.list-head, .task-row { grid-template-columns: var(--list-cols, minmax(260px,1.8fr) minmax(105px,.65fr) 120px 110px 120px 40px); }
.list-head > .col-due, .list-head > .col-status, .list-head > .col-priority,
.task-row > .col-due, .task-row > .col-status, .task-row > .col-priority { justify-self: center; text-align: center; }
.task-row > .col-person, .list-head > .col-person { justify-self: start; }
.pill, .priority { text-align: center; }

.dashboard article { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.dashboard article > div { width: 100%; text-align: center; }
.dashboard article:nth-child(1) { background: #e6ebf1; } .dashboard article:nth-child(1) .metric-icon { background: #d3dbe5; color: var(--st-todo); } .dashboard article:nth-child(1) strong { color: var(--st-todo); }
.dashboard article:nth-child(2) { background: #fdebd0; } .dashboard article:nth-child(2) .metric-icon { background: #fbd9a5; color: var(--st-doing); } .dashboard article:nth-child(2) strong { color: var(--st-doing); }
.dashboard article:nth-child(3) { background: #d8f2e0; } .dashboard article:nth-child(3) .metric-icon { background: #b6e5c6; color: var(--st-done); } .dashboard article:nth-child(3) strong { color: var(--st-done); }
.dashboard article:nth-child(4) { background: #e6e1fa; } .dashboard article:nth-child(4) .metric-icon { background: #d2c9f5; color: var(--st-waiting); } .dashboard article:nth-child(4) strong { color: var(--st-waiting); }

.board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); }
.board-head { justify-content: center; gap: 8px; }
.board-card { text-align: center; }
.board-card .priority { display: block; width: max-content; margin: 0 auto 8px; }
.board-card .mobile-progress { display: flex; justify-content: center; align-items: center; gap: 8px; }
.board-card-foot { justify-content: center; gap: 10px; flex-wrap: wrap; }
.board-column .task-meta { justify-content: center; }

.cols-wrap { position: relative; }
.cols-btn { padding: 10px 14px; border: 1px solid #cbdbea; border-radius: 11px; background: #fbfdff; font-size: .77rem; font-weight: 700; color: #234a73; cursor: pointer; white-space: nowrap; }
.cols-btn[hidden], .cols-panel[hidden] { display: none; }
.cols-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(23,50,77,.22); }
.cols-title { margin: 0 0 8px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cols-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.cols-row label { flex: 1; display: flex; align-items: center; gap: 9px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.cols-row input { width: 18px; height: 18px; accent-color: #3571ad; }
.cols-row button { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2, #eef3f9); font-size: .7rem; color: #234a73; }
.cols-row button:disabled { opacity: .3; }
.cols-reset { margin-top: 8px; width: 100%; padding: 9px; border-radius: 10px; background: #eef3f9; font-size: .76rem; font-weight: 700; color: #234a73; }

.app-version { margin-top: 28px; padding: 14px 0 4px; text-align: center; font-size: .7rem; color: var(--muted); letter-spacing: .04em; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .dashboard article { gap: 2px; }
  .board { grid-template-columns: none; grid-auto-columns: 84vw; }
  .cols-wrap { margin-top: 8px; }
  .cols-btn { width: 100%; min-height: 44px; }
  .cols-panel { left: 0; right: 0; width: auto; }
  .cols-row button { width: 44px; height: 44px; }
  .cols-row label { min-height: 44px; font-size: .95rem; }
  .app-version { margin-top: 18px; }
}
.dashboard article .metric-icon { flex: none; width: 37px; height: 37px; }

/* ===== v1.7 : pop-ups, tablette, colonnes mobile ===== */
.task-dialog, .detail-dialog { border-top: 7px solid #8da7c1; }
.task-dialog[data-status="doing"], .detail-dialog[data-status="doing"] { border-top-color: #f59e0b; }
.task-dialog[data-status="waiting"], .detail-dialog[data-status="waiting"] { border-top-color: #8b5cf6; }
.task-dialog[data-status="blocked"], .detail-dialog[data-status="blocked"] { border-top-color: #dc2626; }
.task-dialog[data-status="done"], .detail-dialog[data-status="done"] { border-top-color: #22a35a; }
.task-dialog[data-priority="critical"]:not([data-status="done"]), .detail-dialog[data-priority="critical"]:not([data-status="done"]) { border-top-color: var(--urgent); }
.dialog-head .eyebrow, .detail-head .eyebrow { color: #3571ad; }
.field { color: #35506b; font-size: .78rem; font-weight: 700; }
.field input, .field select, .field textarea { border-color: #cfdcea; background: #fbfdff; font-weight: 500; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #3571ad; box-shadow: 0 0 0 3px rgba(53,113,173,.16); }
.detail-facts > div { background: #eef3f9; border-left: 4px solid #8da7c1; }
.detail-facts > div.fact-late { background: var(--urgent-bg); border-left-color: var(--urgent); }
.detail-facts > div.fact-late dd { color: var(--urgent); }
.detail-subtask { background: #eef3f9; }
.detail-subtask.is-done i { background: #22a35a; border-color: #22a35a; }
.detail-subtask:not(.is-done) i { border-color: #8da7c1; background: #fff; }
.detail-section h3 { color: #35506b; }
.dialog-actions .primary-button, .detail-actions .primary-button { box-shadow: 0 6px 16px rgba(53,113,173,.28); }

@media (min-width: 761px) {
  .task-dialog form { display: flex; flex-direction: column; }
  .task-dialog .fold { margin-top: 14px; padding: 4px 14px 14px; border: 1px solid #dde8f3; border-radius: 14px; background: #f4f8fc; }
  .task-dialog .fold .field--full { margin-top: 8px; }
  .task-dialog .history-panel { margin-top: 14px; }
  .task-dialog form { padding-bottom: 0; }
  .dialog-actions { position: sticky; bottom: 0; z-index: 2; margin: 18px -25px 0; padding: 14px 25px; background: #fbfdff; border-top: 1px solid var(--line); }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .workspace { padding: 22px 18px 40px; }
  .topbar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .topbar h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
  .topbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .topbar-actions .search-box { flex: 1 1 200px; min-width: 0; }
  .controls { flex-wrap: wrap; }
  .filters { min-width: 0; flex: 1 1 340px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-wrap { margin-left: auto; }
  .board { grid-auto-columns: minmax(210px, 1fr); }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-left: 8px; padding-right: 8px; overflow: hidden; }
  .sidebar .brand span, .sidebar-section p, .sync-status span:last-child, .nav-item b { display: none; }
  .nav-item, .nav-item--small, .sidebar-action { font-size: 0; justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  .nav-item > span, .nav-item > i { font-size: 1.15rem; }
  .sidebar-action span { display: none; }
}
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .cols-panel { max-height: min(60vh, 420px); overflow-y: auto; }
}

/* ===== v1.8 : mise en page des pop-ups ===== */
.close-button:focus { outline: none; }
.close-button:focus-visible { outline: 2px solid #3571ad; outline-offset: 2px; }
.list-head [draggable="true"], .board-head[draggable="true"] { cursor: grab; }

.detail-dialog { --tint: #e8edf3; }
.detail-dialog[data-status="doing"] { --tint: #fff1d9; }
.detail-dialog[data-status="waiting"] { --tint: #efe8fd; }
.detail-dialog[data-status="blocked"] { --tint: #fee4e0; }
.detail-dialog[data-status="done"] { --tint: #dcf3e4; }
.detail-dialog[data-priority="critical"]:not([data-status="done"]) { --tint: #fee2e2; }
.detail-band { margin: -27px -27px 0; padding: 22px 27px 18px; background: var(--tint); border-bottom: 1px solid rgba(23,50,77,.08); }
.detail-band .detail-badges { margin-top: 12px; }
.detail-band .detail-bar { margin: 14px 0 0; background: rgba(23,50,77,.12); }
.detail-band .detail-head h2 { font-size: 1.5rem; }
.detail-facts { margin-top: 18px; }
.detail-section { padding: 14px; border-radius: 14px; background: #f6f9fc; border: 1px solid #e2ebf4; }
.detail-section h3 { margin-bottom: 8px; }

.task-dialog { --tint: #e8edf3; }
.task-dialog[data-status="doing"] { --tint: #fff1d9; }
.task-dialog[data-status="waiting"] { --tint: #efe8fd; }
.task-dialog[data-status="blocked"] { --tint: #fee4e0; }
.task-dialog[data-status="done"] { --tint: #dcf3e4; }
.task-dialog[data-priority="critical"]:not([data-status="done"]) { --tint: #fee2e2; }

@media (min-width: 761px) {
  .task-dialog .dialog-head { margin: -25px -25px 18px; padding: 22px 25px 16px; background: var(--tint); border-bottom: 1px solid rgba(23,50,77,.08); }
  .task-dialog .form-grid { padding: 14px; border: 1px solid #dde8f3; border-radius: 14px; background: #f9fbfe; gap: 14px 16px; }
  .task-dialog .field--progress { grid-column: 1 / -1; }
  .task-dialog .field--progress input { width: 100%; }
}
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .detail-band { margin: 0 -16px; padding: 10px 16px 12px; }
  .detail-band .detail-head h2 { font-size: 1.25rem; }
  .detail-section { padding: 10px 12px; }
  .task-dialog .dialog-head { background: var(--tint); margin-left: -16px; margin-right: -16px; padding: 8px 16px; border-radius: 0; align-items: center; }
}

/* ===== v1.9 : redimensionner les colonnes, version fixe ===== */
.list-head > span { position: relative; }
.list-head > .col-due, .list-head > .col-status, .list-head > .col-priority { justify-self: stretch; text-align: center; }
.col-resize { position: absolute; top: -6px; bottom: -6px; right: -8px; width: 16px; cursor: col-resize; touch-action: none; z-index: 3; }
.col-resize::after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 7px; width: 2px; border-radius: 2px; background: rgba(110,140,170,.28); transition: background .15s; }
.col-resize:hover::after, .is-resizing .col-resize::after { background: #3571ad; width: 3px; left: 6px; }
.board-column { position: relative; }
.col-resize--board { top: 10px; bottom: 10px; right: -9px; }
.col-resize--board::after { top: 0; bottom: 0; }
body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.app-version { position: fixed; right: 12px; bottom: 8px; z-index: 12; margin: 0; padding: 4px 10px; border-radius: 12px; background: rgba(251,253,255,.9); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(23,50,77,.08); pointer-events: none; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .col-resize { display: none; }
  .app-version { right: 50%; transform: translateX(50%); bottom: calc(68px + env(safe-area-inset-bottom)); white-space: nowrap; font-size: .62rem; }
}

/* ===================== V2.0 ===================== */
/* toast (au-dessus des fenêtres) */
.toast { inset: auto 24px 24px auto; margin: 0; border: 0; overflow: visible; max-width: min(420px, calc(100vw - 24px)); }
.toast button { margin-left: 8px; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff; font-weight: 800; font-size: .76rem; }
.toast.has-action { pointer-events: auto; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .toast { inset: auto 12px calc(82px + env(safe-area-inset-bottom)) 12px; width: auto; max-width: none; } }

/* menu latéral */
.sidebar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar-section { margin-top: 20px; }
.sidebar-bottom { margin-top: 10px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); }
.brand { padding-bottom: 20px; }
.dot--red { background: #ff7b72; }
.nav-item b { background: rgba(255,255,255,.12); color: inherit; }
.nav-item.is-active b { background: rgba(23,60,99,.12); }
#lateCount:not(:empty) { background: rgba(255,123,114,.22); color: #ffb3ad; }
.nav-item--ghost { border: 1px dashed rgba(255,255,255,.25); color: rgba(255,255,255,.62); margin-top: 4px; }
.saved-filters { display: grid; gap: 2px; }
.saved-filter { display: flex; align-items: center; }
.saved-filter .nav-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-del { width: 28px; height: 28px; border-radius: 8px; background: transparent; color: rgba(255,255,255,.45); font-size: 1rem; }
.saved-del:hover { background: rgba(255,255,255,.12); color: #fff; }
.people-load { display: grid; gap: 4px; }
.load-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; background: transparent; color: rgba(255,255,255,.75); font-size: .8rem; text-align: left; }
.load-row:hover { background: rgba(255,255,255,.1); color: #fff; }
.load-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 4px; background: #6da8eb; }
.load-row b { font-size: .7rem; font-weight: 800; }
@media (min-width: 761px) and (max-width: 1000px) { #savedFiltersSection, #loadSection { display: none; } .sidebar-section { margin-top: 12px; } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .sidebar { display: flex; } .saved-del { width: 44px; height: 44px; } .load-row { min-height: 44px; } }

/* filtres : 4 listes */
.filters { grid-template-columns: repeat(4, minmax(120px, 1fr)); min-width: min(100%, 640px); }
@media (min-width: 761px) and (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 340px; } }

/* tri */
.is-sortable { cursor: pointer; user-select: none; -webkit-user-select: none; }
.is-sortable:hover { color: #3571ad; }
.sort-mark { font-style: normal; margin-left: 4px; font-size: .6rem; color: #3571ad; }

/* étiquettes, répétition */
.tag-chip { padding: 1px 7px; border-radius: 10px; font-size: .66rem; font-weight: 700; white-space: nowrap; }
.tag-0 { background: #dbeafe; color: #1e4f94; } .tag-1 { background: #fce7f3; color: #9d2461; } .tag-2 { background: #dcfce7; color: #166534; }
.tag-3 { background: #fef3c7; color: #8a5a00; } .tag-4 { background: #ede9fe; color: #5b32b0; } .tag-5 { background: #e0f2f1; color: #0f6b63; }
.rec-chip { padding: 0 6px; border-radius: 10px; background: #e3ecf7; color: #1f4f86; font-weight: 800; font-size: .72rem; }
.pill--rec { background: #e3ecf7; color: #1f4f86; }
.card-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: -4px 0 10px; }
.task-meta { flex-wrap: wrap; }

/* vue Aujourd’hui */
.today-summary { margin: 4px 2px 16px; font-size: 1rem; font-weight: 700; color: #35506b; }
.today-section { margin-bottom: 22px; }
.today-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 4px 9px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #35506b; }
.today-section h3 b { padding: 2px 8px; border-radius: 10px; background: #dbe6f3; font-size: .68rem; }
.today-section--late h3 { color: var(--urgent); } .today-section--late h3 b { background: var(--urgent-bg); color: var(--urgent); }
.today-section--today h3 b { background: var(--st-doing-bg); color: var(--st-doing); }
.today-section--done h3 b { background: var(--st-done-bg); color: var(--st-done); }
.today .empty-state { margin-top: 8px; }

/* journal, corbeille */
body[data-view="activity"] .dashboard, body[data-view="activity"] .controls, body[data-view="trash"] .dashboard, body[data-view="trash"] .controls { display: none; }
body[data-view="activity"] .workspace .topbar, body[data-view="trash"] .workspace .topbar { margin-bottom: 14px; }
.activity-day { margin-bottom: 18px; }
.activity-day h3 { margin: 0 4px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #35506b; }
.activity-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; width: 100%; padding: 11px 14px; margin-bottom: 6px; border: 1px solid var(--line); border-left: 4px solid #8da7c1; border-radius: 12px; background: var(--surface); text-align: left; font-size: .84rem; }
.activity-item time { color: var(--muted); font-weight: 700; font-size: .76rem; }
.activity-item.is-deleted { opacity: .6; }
.trash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: .84rem; }
.trash-head p { margin: 0; }
.trash-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.trash-item > div { flex: 1; min-width: 0; }
.trash-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-item small { color: var(--muted); }
.trash-item button { padding: 9px 14px; font-size: .78rem; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .trash-item { flex-wrap: wrap; } .trash-item > div { flex-basis: 100%; } .trash-item button, .trash-head button { min-height: 44px; } .trash-head { flex-direction: column; align-items: stretch; } }

/* tableau : glisser-déposer */
.board-card { cursor: grab; }
.board-card.is-dragging { opacity: .45; transform: rotate(1.5deg); }
.board-column { transition: background .15s, box-shadow .15s; }
.board-column.is-drop { background: #dbe9fa; box-shadow: inset 0 0 0 2px #3571ad; }

/* gestes mobile */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .task-row { touch-action: pan-y; will-change: transform; }
  .task-row[data-swipe="done"] { background: #e3f6ea; }
  .task-row[data-swipe="menu"] { background: #e3edf8; }
  .task-row.swipe-armed[data-swipe="done"] { box-shadow: inset 6px 0 0 #22a35a; }
  .task-row.swipe-armed[data-swipe="menu"] { box-shadow: inset -6px 0 0 #3571ad; }
  .tabbar { grid-template-columns: repeat(3, 1fr); }
  .tabbar button span { font-size: .64rem; white-space: nowrap; }
  .detail-actions { grid-template-columns: auto 1.35fr 1fr; }
}
.secondary-button--icon { padding-left: 16px; padding-right: 16px; font-weight: 800; letter-spacing: .1em; }

/* fenêtres rapides / réglages */
.panel-dialog { width: min(480px, calc(100% - 24px)); }
.panel-dialog > article { padding: 22px 24px 24px; }
.quick-body h3, .settings-block h3 { margin: 16px 0 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: #35506b; }
.quick-row { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-btn, .seg button { padding: 10px 14px; border-radius: 11px; background: #eef3f9; color: #234a73; font-size: .82rem; font-weight: 700; border: 1px solid transparent; }
.quick-btn.is-on, .seg button.is-on { background: #234a73; color: #fff; }
.quick-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.quick-actions button { flex: 1; padding: 12px 10px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; }
.settings-block { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.settings-block:last-child { border-bottom: 0; }
.settings-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: #eef3f9; color: #234a73; font-size: .86rem; font-weight: 700; text-align: left; cursor: pointer; }
.settings-btn.file-action input { display: none; }
.settings-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .88rem; font-weight: 600; }
.settings-row span { flex: 1; }
.settings-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: #3571ad; }
.settings-row input[type="time"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.settings-note { margin: 8px 2px 4px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.snapshot-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: .8rem; }
.snapshot-row span { flex: 1; }
.snapshot-row button { padding: 8px 12px; font-size: .74rem; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .panel-dialog > article { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .quick-btn, .seg button, .settings-btn { min-height: 44px; }
  .quick-actions button, .snapshot-row button { min-height: 44px; }
}

/* compacité du menu + filtres */
.sidebar { padding-top: 20px; padding-bottom: 14px; }
.brand { padding-bottom: 12px; }
.main-nav { gap: 2px; }
.nav-item { padding: 9px 12px; font-size: .92rem; }
.nav-item--small { padding-block: 6px; font-size: .84rem; }
.sidebar-section { margin-top: 14px; }
.sidebar-section > p { margin-bottom: 4px; }
.sidebar-action { padding-block: 6px; }
.sync-status { margin-top: 8px; padding-top: 10px; }
.controls { flex-wrap: wrap; row-gap: 10px; }
.filters { min-width: 0; flex: 1 1 600px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filters select { text-overflow: ellipsis; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .nav-item, .sidebar-action { min-height: 44px; }
  .nav-item--small { min-height: 40px; }
  .sidebar-section { margin-top: 10px; }
}

@media (min-width: 761px) and (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Mode sombre ===== */
@media (prefers-color-scheme: dark) {

:root:not([data-theme="light"]) { color-scheme: dark; --paper:#0e1824; --surface:#152233; --surface-2:#1d2d42; --ink:#e7eef7; --muted:#93a8be; --line:#2a3e55;
  --coral-soft:#1b3350; --yellow-soft:#1b3350; --green-soft:#1b3350;
  --st-todo:#b4c3d4; --st-todo-bg:#27384c; --st-doing:#ffc072; --st-doing-bg:#4a3516; --st-waiting:#c9b4ff; --st-waiting-bg:#38295e;
  --st-blocked:#ffb1a8; --st-blocked-bg:#4d2420; --st-done:#7be0a1; --st-done-bg:#17402a; --urgent:#ff6b6b; --urgent-bg:#4a2024; }
:root:not([data-theme="light"]) body { background: linear-gradient(145deg,#0b1520 0%,#0e1824 55%,#101d2c 100%); }
:root:not([data-theme="light"]) .content-panel, :root:not([data-theme="light"]) .task-row, :root:not([data-theme="light"]) .board-card, :root:not([data-theme="light"]) .activity-item, :root:not([data-theme="light"]) .trash-item, :root:not([data-theme="light"]) .agenda-item, :root:not([data-theme="light"]) .calendar-wrap { background: var(--surface); color: var(--ink); }
:root:not([data-theme="light"]) .task-row:hover { background: #1a2b40; }
:root:not([data-theme="light"]) .task-row.is-late:not(.is-done) { background: #2b1b24; }
:root:not([data-theme="light"]) .list-head { background: transparent; color: #8aa0b6; }
:root:not([data-theme="light"]) .board-column { background: rgba(21,34,51,.7); }
:root:not([data-theme="light"]) .board-column.is-drop { background: #1b3350; box-shadow: inset 0 0 0 2px #5b9be0; }
:root:not([data-theme="light"]) .search-box, :root:not([data-theme="light"]) .filters select, :root:not([data-theme="light"]) .cols-btn, :root:not([data-theme="light"]) .cols-panel, :root:not([data-theme="light"]) .field input, :root:not([data-theme="light"]) .field select, :root:not([data-theme="light"]) .field textarea, :root:not([data-theme="light"]) .subtask-edit input, :root:not([data-theme="light"]) .settings-row input[type="time"] { background-color: var(--surface); color: var(--ink); border-color: var(--line); }
:root:not([data-theme="light"]) .search-box input { color: var(--ink); }
:root:not([data-theme="light"]) .segmented { background: #1a2a3d; }
:root:not([data-theme="light"]) .segmented button.is-active { background: #2a4260; color: #fff; }
:root:not([data-theme="light"]) .primary-button { color: #fff; }
:root:not([data-theme="light"]) .secondary-button, :root:not([data-theme="light"]) .close-button, :root:not([data-theme="light"]) .quick-btn, :root:not([data-theme="light"]) .seg button, :root:not([data-theme="light"]) .settings-btn, :root:not([data-theme="light"]) .cols-row button, :root:not([data-theme="light"]) .cols-reset { background: var(--surface-2); color: var(--ink); }
:root:not([data-theme="light"]) .quick-btn.is-on, :root:not([data-theme="light"]) .seg button.is-on { background: #5b9be0; color: #08121d; }
:root:not([data-theme="light"]) .danger-button { background: #4d2420; color: #ffb1a8; }
:root:not([data-theme="light"]) .dashboard article:nth-child(1) { background: #1d2c3d; } :root:not([data-theme="light"]) .dashboard article:nth-child(2) { background: #3a2c14; }
:root:not([data-theme="light"]) .dashboard article:nth-child(3) { background: #14352a; } :root:not([data-theme="light"]) .dashboard article:nth-child(4) { background: #2a2548; }
:root:not([data-theme="light"]) .dashboard article:nth-child(1) .metric-icon { background: #2a3c52; } :root:not([data-theme="light"]) .dashboard article:nth-child(2) .metric-icon { background: #5a421a; }
:root:not([data-theme="light"]) .dashboard article:nth-child(3) .metric-icon { background: #1d5039; } :root:not([data-theme="light"]) .dashboard article:nth-child(4) .metric-icon { background: #3d3670; }
:root:not([data-theme="light"]) .task-dialog, :root:not([data-theme="light"]) .detail-dialog { background: var(--surface); color: var(--ink); }
:root:not([data-theme="light"]) .task-dialog { --tint: #1d2c3d; } :root:not([data-theme="light"]) .detail-dialog { --tint: #1d2c3d; }
:root:not([data-theme="light"]) .task-dialog[data-status="doing"], :root:not([data-theme="light"]) .detail-dialog[data-status="doing"] { --tint: #3a2c14; }
:root:not([data-theme="light"]) .task-dialog[data-status="waiting"], :root:not([data-theme="light"]) .detail-dialog[data-status="waiting"] { --tint: #2a2548; }
:root:not([data-theme="light"]) .task-dialog[data-status="blocked"], :root:not([data-theme="light"]) .detail-dialog[data-status="blocked"] { --tint: #3d1f1d; }
:root:not([data-theme="light"]) .task-dialog[data-status="done"], :root:not([data-theme="light"]) .detail-dialog[data-status="done"] { --tint: #14352a; }
:root:not([data-theme="light"]) .task-dialog[data-priority="critical"]:not([data-status="done"]), :root:not([data-theme="light"]) .detail-dialog[data-priority="critical"]:not([data-status="done"]) { --tint: #3d1f24; }
:root:not([data-theme="light"]) .detail-facts > div, :root:not([data-theme="light"]) .detail-subtask, :root:not([data-theme="light"]) .detail-section, :root:not([data-theme="light"]) .task-dialog .fold, :root:not([data-theme="light"]) .task-dialog .form-grid { background: #1a2a3d; border-color: var(--line); }
:root:not([data-theme="light"]) .detail-subtask:not(.is-done) i { background: var(--surface); }
:root:not([data-theme="light"]) .field, :root:not([data-theme="light"]) .field--progress span, :root:not([data-theme="light"]) .detail-section h3, :root:not([data-theme="light"]) .quick-body h3, :root:not([data-theme="light"]) .settings-block h3, :root:not([data-theme="light"]) .today-summary, :root:not([data-theme="light"]) .today-section h3, :root:not([data-theme="light"]) .activity-day h3 { color: #b6c8dc; }
:root:not([data-theme="light"]) .field input::placeholder, :root:not([data-theme="light"]) .field textarea::placeholder { color: #6b8199; }
:root:not([data-theme="light"]) .dialog-actions, :root:not([data-theme="light"]) .detail-actions { background: var(--surface); border-color: var(--line); }
:root:not([data-theme="light"]) .topbar::before { background: rgba(14,24,36,.9); }
:root:not([data-theme="light"]) .mobile-menu, :root:not([data-theme="light"]) .search-toggle { background: #1a2a3d; color: var(--ink); }
:root:not([data-theme="light"]) .tabbar { background: rgba(14,24,36,.94); } :root:not([data-theme="light"]) .tabbar button.is-active { background: #1d3552; color: #9cc8ff; }
:root:not([data-theme="light"]) .app-version { background: rgba(21,34,51,.92); }
:root:not([data-theme="light"]) .day.is-muted { background: #101c2a; color: #5d7189; } :root:not([data-theme="light"]) .calendar-task { background: #1b3350; color: #cfe3f8; }
:root:not([data-theme="light"]) .cols-row label, :root:not([data-theme="light"]) .settings-row { color: var(--ink); }
:root:not([data-theme="light"]) .pill--progress, :root:not([data-theme="light"]) .pill--rec, :root:not([data-theme="light"]) .rec-chip { background: #1b3350; color: #9cc8ff; }
:root:not([data-theme="light"]) .tag-0 { background:#1b3350; color:#9cc8ff; } :root:not([data-theme="light"]) .tag-1 { background:#4a1f3a; color:#ffb3d9; } :root:not([data-theme="light"]) .tag-2 { background:#143a27; color:#8ae6ac; }
:root:not([data-theme="light"]) .tag-3 { background:#4a3a10; color:#ffd77a; } :root:not([data-theme="light"]) .tag-4 { background:#33265a; color:#cdb9ff; } :root:not([data-theme="light"]) .tag-5 { background:#0f3b39; color:#7ee0d6; }
:root:not([data-theme="light"]) .today-section h3 b { background: #27384c; }
:root:not([data-theme="light"]) .empty-state h2, :root:not([data-theme="light"]) .empty-state p { color: var(--ink); }
:root:not([data-theme="light"]) .progress-mini, :root:not([data-theme="light"]) .detail-bar { background: #2a3e55; }
:root:not([data-theme="light"]) .task-row[data-swipe="done"] { background: #14352a; } :root:not([data-theme="light"]) .task-row[data-swipe="menu"] { background: #1b3350; }
:root:not([data-theme="light"]) .history-item, :root:not([data-theme="light"]) .attachment-item { color: var(--ink); }
:root:not([data-theme="light"]) .toast { background: #e7eef7; color: #0e1824; } :root:not([data-theme="light"]) .toast button { background: rgba(14,24,36,.14); color: #0e1824; }

}

:root[data-theme="dark"] { color-scheme: dark; --paper:#0e1824; --surface:#152233; --surface-2:#1d2d42; --ink:#e7eef7; --muted:#93a8be; --line:#2a3e55;
  --coral-soft:#1b3350; --yellow-soft:#1b3350; --green-soft:#1b3350;
  --st-todo:#b4c3d4; --st-todo-bg:#27384c; --st-doing:#ffc072; --st-doing-bg:#4a3516; --st-waiting:#c9b4ff; --st-waiting-bg:#38295e;
  --st-blocked:#ffb1a8; --st-blocked-bg:#4d2420; --st-done:#7be0a1; --st-done-bg:#17402a; --urgent:#ff6b6b; --urgent-bg:#4a2024; }
:root[data-theme="dark"] body { background: linear-gradient(145deg,#0b1520 0%,#0e1824 55%,#101d2c 100%); }
:root[data-theme="dark"] .content-panel, :root[data-theme="dark"] .task-row, :root[data-theme="dark"] .board-card, :root[data-theme="dark"] .activity-item, :root[data-theme="dark"] .trash-item, :root[data-theme="dark"] .agenda-item, :root[data-theme="dark"] .calendar-wrap { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .task-row:hover { background: #1a2b40; }
:root[data-theme="dark"] .task-row.is-late:not(.is-done) { background: #2b1b24; }
:root[data-theme="dark"] .list-head { background: transparent; color: #8aa0b6; }
:root[data-theme="dark"] .board-column { background: rgba(21,34,51,.7); }
:root[data-theme="dark"] .board-column.is-drop { background: #1b3350; box-shadow: inset 0 0 0 2px #5b9be0; }
:root[data-theme="dark"] .search-box, :root[data-theme="dark"] .filters select, :root[data-theme="dark"] .cols-btn, :root[data-theme="dark"] .cols-panel, :root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .subtask-edit input, :root[data-theme="dark"] .settings-row input[type="time"] { background-color: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .search-box input { color: var(--ink); }
:root[data-theme="dark"] .segmented { background: #1a2a3d; }
:root[data-theme="dark"] .segmented button.is-active { background: #2a4260; color: #fff; }
:root[data-theme="dark"] .primary-button { color: #fff; }
:root[data-theme="dark"] .secondary-button, :root[data-theme="dark"] .close-button, :root[data-theme="dark"] .quick-btn, :root[data-theme="dark"] .seg button, :root[data-theme="dark"] .settings-btn, :root[data-theme="dark"] .cols-row button, :root[data-theme="dark"] .cols-reset { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .quick-btn.is-on, :root[data-theme="dark"] .seg button.is-on { background: #5b9be0; color: #08121d; }
:root[data-theme="dark"] .danger-button { background: #4d2420; color: #ffb1a8; }
:root[data-theme="dark"] .dashboard article:nth-child(1) { background: #1d2c3d; } :root[data-theme="dark"] .dashboard article:nth-child(2) { background: #3a2c14; }
:root[data-theme="dark"] .dashboard article:nth-child(3) { background: #14352a; } :root[data-theme="dark"] .dashboard article:nth-child(4) { background: #2a2548; }
:root[data-theme="dark"] .dashboard article:nth-child(1) .metric-icon { background: #2a3c52; } :root[data-theme="dark"] .dashboard article:nth-child(2) .metric-icon { background: #5a421a; }
:root[data-theme="dark"] .dashboard article:nth-child(3) .metric-icon { background: #1d5039; } :root[data-theme="dark"] .dashboard article:nth-child(4) .metric-icon { background: #3d3670; }
:root[data-theme="dark"] .task-dialog, :root[data-theme="dark"] .detail-dialog { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .task-dialog { --tint: #1d2c3d; } :root[data-theme="dark"] .detail-dialog { --tint: #1d2c3d; }
:root[data-theme="dark"] .task-dialog[data-status="doing"], :root[data-theme="dark"] .detail-dialog[data-status="doing"] { --tint: #3a2c14; }
:root[data-theme="dark"] .task-dialog[data-status="waiting"], :root[data-theme="dark"] .detail-dialog[data-status="waiting"] { --tint: #2a2548; }
:root[data-theme="dark"] .task-dialog[data-status="blocked"], :root[data-theme="dark"] .detail-dialog[data-status="blocked"] { --tint: #3d1f1d; }
:root[data-theme="dark"] .task-dialog[data-status="done"], :root[data-theme="dark"] .detail-dialog[data-status="done"] { --tint: #14352a; }
:root[data-theme="dark"] .task-dialog[data-priority="critical"]:not([data-status="done"]), :root[data-theme="dark"] .detail-dialog[data-priority="critical"]:not([data-status="done"]) { --tint: #3d1f24; }
:root[data-theme="dark"] .detail-facts > div, :root[data-theme="dark"] .detail-subtask, :root[data-theme="dark"] .detail-section, :root[data-theme="dark"] .task-dialog .fold, :root[data-theme="dark"] .task-dialog .form-grid { background: #1a2a3d; border-color: var(--line); }
:root[data-theme="dark"] .detail-subtask:not(.is-done) i { background: var(--surface); }
:root[data-theme="dark"] .field, :root[data-theme="dark"] .field--progress span, :root[data-theme="dark"] .detail-section h3, :root[data-theme="dark"] .quick-body h3, :root[data-theme="dark"] .settings-block h3, :root[data-theme="dark"] .today-summary, :root[data-theme="dark"] .today-section h3, :root[data-theme="dark"] .activity-day h3 { color: #b6c8dc; }
:root[data-theme="dark"] .field input::placeholder, :root[data-theme="dark"] .field textarea::placeholder { color: #6b8199; }
:root[data-theme="dark"] .dialog-actions, :root[data-theme="dark"] .detail-actions { background: var(--surface); border-color: var(--line); }
:root[data-theme="dark"] .topbar::before { background: rgba(14,24,36,.9); }
:root[data-theme="dark"] .mobile-menu, :root[data-theme="dark"] .search-toggle { background: #1a2a3d; color: var(--ink); }
:root[data-theme="dark"] .tabbar { background: rgba(14,24,36,.94); } :root[data-theme="dark"] .tabbar button.is-active { background: #1d3552; color: #9cc8ff; }
:root[data-theme="dark"] .app-version { background: rgba(21,34,51,.92); }
:root[data-theme="dark"] .day.is-muted { background: #101c2a; color: #5d7189; } :root[data-theme="dark"] .calendar-task { background: #1b3350; color: #cfe3f8; }
:root[data-theme="dark"] .cols-row label, :root[data-theme="dark"] .settings-row { color: var(--ink); }
:root[data-theme="dark"] .pill--progress, :root[data-theme="dark"] .pill--rec, :root[data-theme="dark"] .rec-chip { background: #1b3350; color: #9cc8ff; }
:root[data-theme="dark"] .tag-0 { background:#1b3350; color:#9cc8ff; } :root[data-theme="dark"] .tag-1 { background:#4a1f3a; color:#ffb3d9; } :root[data-theme="dark"] .tag-2 { background:#143a27; color:#8ae6ac; }
:root[data-theme="dark"] .tag-3 { background:#4a3a10; color:#ffd77a; } :root[data-theme="dark"] .tag-4 { background:#33265a; color:#cdb9ff; } :root[data-theme="dark"] .tag-5 { background:#0f3b39; color:#7ee0d6; }
:root[data-theme="dark"] .today-section h3 b { background: #27384c; }
:root[data-theme="dark"] .empty-state h2, :root[data-theme="dark"] .empty-state p { color: var(--ink); }
:root[data-theme="dark"] .progress-mini, :root[data-theme="dark"] .detail-bar { background: #2a3e55; }
:root[data-theme="dark"] .task-row[data-swipe="done"] { background: #14352a; } :root[data-theme="dark"] .task-row[data-swipe="menu"] { background: #1b3350; }
:root[data-theme="dark"] .history-item, :root[data-theme="dark"] .attachment-item { color: var(--ink); }
:root[data-theme="dark"] .toast { background: #e7eef7; color: #0e1824; } :root[data-theme="dark"] .toast button { background: rgba(14,24,36,.14); color: #0e1824; }

.toast { bottom: 52px; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .toast { bottom: calc(82px + env(safe-area-inset-bottom)); } }

@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .panel-dialog { width: 100%; } }

@media (min-width: 761px) and (max-width: 1000px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 16px 8px; }
  .sidebar .brand { justify-content: center; padding: 0 0 12px; }
  .sidebar .brand > span:not(.brand-mark) { display: none; }
  .sidebar .nav-item, .sidebar .nav-item--small { font-size: 0; justify-content: center; gap: 0; padding: 11px 0; }
  .sidebar .nav-item > span:first-child { font-size: 1.15rem; width: auto; }
  .sidebar .nav-item b, .sidebar-section > p { display: none; }
  .sidebar .sidebar-action { font-size: 1.15rem; justify-content: center; padding: 10px 0; }
  .sidebar .sidebar-action span { display: none; }
  .sync-status { justify-content: center; margin-left: 0; margin-right: 0; }
  .sync-status span:last-child { display: none; }
  .sidebar-section { margin-top: 8px; }
}

/* ===== V2.1 — logo Marildia + menu réductible / masquable ===== */
.sidebar .brand { display: flex; justify-content: center; align-items: center; padding: 2px 0 12px; margin: 0 0 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand-logo { display: block; width: 100%; max-width: 150px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.sidebar .brand-mark-img { display: none; width: 44px; height: auto; }
@media (min-height: 860px) { .sidebar .brand-logo { max-width: 172px; } }
@media (max-height: 640px) { .sidebar .brand-logo { max-width: 104px; } }
.nc-ico::before { content: '«'; font-style: normal; font-size: 1.2rem; line-height: 1; }
.sidebar-action .nc-ico { display: inline-grid; place-items: center; width: 1.2em; }

/* login */
.auth-logo { display: block; width: 180px; max-width: 70%; height: auto; margin: 0 auto 10px; }
.auth-logo.logo-on-dark { display: none; }
.auth-card h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.auth-card .eyebrow, .auth-card .auth-intro { text-align: center; }
:root[data-theme="dark"] .auth-logo.logo-on-light { display: none; } :root[data-theme="dark"] .auth-logo.logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo.logo-on-light { display: none; } :root:not([data-theme="light"]) .auth-logo.logo-on-dark { display: block; } }

/* desktop / tablette */
@media (min-width: 761px) {
  .mobile-menu { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2, #eef4fb); color: var(--ink); cursor: pointer; margin-right: 10px; }
  .topbar { grid-template-columns: auto minmax(260px,1fr) auto; }
  .app-shell { transition: grid-template-columns .22s ease; }
  /* menu réduit : icônes seules */
  :root[data-nav="rail"] .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  :root[data-nav="rail"] .sidebar { padding: 16px 8px; overflow: hidden; }
  :root[data-nav="rail"] .sidebar .brand-logo { display: none; }
  :root[data-nav="rail"] .sidebar .brand-mark-img { display: block; }
  :root[data-nav="rail"] .sidebar .nav-item, :root[data-nav="rail"] .sidebar .nav-item--small { font-size: 0; justify-content: center; gap: 0; padding: 11px 0; }
  :root[data-nav="rail"] .sidebar .nav-item > span:first-child { font-size: 1.15rem; width: auto; }
  :root[data-nav="rail"] .sidebar .nav-item b, :root[data-nav="rail"] .sidebar-section > p { display: none; }
  :root[data-nav="rail"] .sidebar .sidebar-action { font-size: 1.15rem; justify-content: center; padding: 10px 0; }
  :root[data-nav="rail"] .sidebar .sidebar-action span { display: none; }
  :root[data-nav="rail"] .nc-ico::before { content: '»'; }
  :root[data-nav="rail"] .sync-status { justify-content: center; margin-left: 0; margin-right: 0; }
  :root[data-nav="rail"] .sync-status span:last-child { display: none; }
  :root[data-nav="rail"] .sidebar-section { margin-top: 8px; }
  :root[data-nav="rail"] #savedFiltersSection, :root[data-nav="rail"] #loadSection { display: none; }
  /* menu masqué */
  :root[data-nav="hidden"] .app-shell { grid-template-columns: 0 minmax(0,1fr); }
  :root[data-nav="hidden"] .sidebar { visibility: hidden; overflow: hidden; padding: 0; box-shadow: none; }
}
/* entre 761 et 860 px le menu est déjà réduit d'office : le bouton « agrandir » n'a pas de sens */
@media (min-width: 761px) and (max-width: 1000px) {
  #navCollapseBtn { display: none; }
  .sidebar .brand-logo { display: none; } .sidebar .brand-mark-img { display: block; }
}
@media (prefers-reduced-motion: reduce) { .app-shell { transition: none !important; } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { #navCollapseBtn { display: none; } }

/* ===== Palettes (maquettes) ===== */
:root[data-palette="ocean"] { --paper:#eef6f8; --surface:#fff; --surface-2:#e0eef2; --ink:#0f2a4a; --muted:#5f7a8c; --line:#d3e4ea; --coral:#16a6a3; --coral-soft:#d8f3f2; --blue:#0b6f7a; --green:#0b6f7a; }
:root[data-palette="ocean"] body { background: linear-gradient(145deg,#f4fafb 0%,#e8f3f6 100%); }
:root[data-palette="ocean"] .sidebar { background: linear-gradient(180deg,#0b2f6b 0%,#0a2757 100%); box-shadow: 12px 0 36px rgba(0,0,0,.14); }
:root[data-palette="ocean"] .nav-item.is-active { background:#ffffff; color:#0b2f6b; }
:root[data-palette="ocean"] .primary-button { background:#16a6a3; box-shadow:0 8px 18px #16a6a344; }
:root[data-palette="ocean"] .quick-btn.is-on, :root[data-palette="ocean"] .seg button.is-on { background:#0b2f6b; }
:root[data-palette="ocean"] .quick-btn, :root[data-palette="ocean"] .seg button { background:#e0eef2; color:#0b2f6b; }
:root[data-palette="ocean"] .viewtitle, :root[data-palette="ocean"] #viewTitle { color:#0b2f6b; }
:root[data-palette="ocean"] .segmented { background:#e0eef2; }
:root[data-palette="ocean"] .tabbar { background: rgba(255,255,255,.94); }

:root[data-palette="foret"] { --paper:#f2f6f1; --surface:#fff; --surface-2:#e6eee4; --ink:#1b3a2f; --muted:#68806f; --line:#d8e3d6; --coral:#2f9266; --coral-soft:#d9efe3; --blue:#1f7050; --green:#1f7050; }
:root[data-palette="foret"] body { background: linear-gradient(145deg,#f6f9f3 0%,#ebf2e8 100%); }
:root[data-palette="foret"] .sidebar { background: linear-gradient(180deg,#1d4a3b 0%,#143629 100%); box-shadow: 12px 0 36px rgba(0,0,0,.14); }
:root[data-palette="foret"] .nav-item.is-active { background:#f3faf5; color:#1d4a3b; }
:root[data-palette="foret"] .primary-button { background:#2f9266; box-shadow:0 8px 18px #2f926644; }
:root[data-palette="foret"] .quick-btn.is-on, :root[data-palette="foret"] .seg button.is-on { background:#1d4a3b; }
:root[data-palette="foret"] .quick-btn, :root[data-palette="foret"] .seg button { background:#e6eee4; color:#1d4a3b; }
:root[data-palette="foret"] .viewtitle, :root[data-palette="foret"] #viewTitle { color:#1d4a3b; }
:root[data-palette="foret"] .segmented { background:#e6eee4; }
:root[data-palette="foret"] .tabbar { background: rgba(255,255,255,.94); }

:root[data-palette="ardoise"] { --paper:#faf5f2; --surface:#fff; --surface-2:#f1e9e4; --ink:#2a2d38; --muted:#82787a; --line:#eadfd9; --coral:#ee6a57; --coral-soft:#fde3de; --blue:#c9503f; --green:#c9503f; }
:root[data-palette="ardoise"] body { background: linear-gradient(145deg,#fcf8f5 0%,#f5ece7 100%); }
:root[data-palette="ardoise"] .sidebar { background: linear-gradient(180deg,#2c303c 0%,#1f222b 100%); box-shadow: 12px 0 36px rgba(0,0,0,.14); }
:root[data-palette="ardoise"] .nav-item.is-active { background:#fff7f4; color:#2c303c; }
:root[data-palette="ardoise"] .primary-button { background:#ee6a57; box-shadow:0 8px 18px #ee6a5744; }
:root[data-palette="ardoise"] .quick-btn.is-on, :root[data-palette="ardoise"] .seg button.is-on { background:#2c303c; }
:root[data-palette="ardoise"] .quick-btn, :root[data-palette="ardoise"] .seg button { background:#f1e9e4; color:#2c303c; }
:root[data-palette="ardoise"] .viewtitle, :root[data-palette="ardoise"] #viewTitle { color:#2c303c; }
:root[data-palette="ardoise"] .segmented { background:#f1e9e4; }
:root[data-palette="ardoise"] .tabbar { background: rgba(255,255,255,.94); }

/* ===== V2.2 — Océan par défaut + fonds au choix (data-bg) ===== */
:root[data-palette="ocean"][data-bg="blanc"] body { background: #ffffff; }
:root[data-palette="ocean"][data-bg="blanc"] { --paper: #f3f7fa; --surface-2: #e8f0f4; }
:root[data-palette="ocean"][data-bg="brume"] body { background: radial-gradient(900px 520px at 85% -10%, rgba(22,166,163,.20), transparent 60%), radial-gradient(800px 600px at -10% 105%, rgba(11,47,107,.14), transparent 60%), linear-gradient(160deg, #f6fbfb 0%, #eaf3f8 100%); background-attachment: fixed; }
:root[data-palette="ocean"][data-bg="sable"] body { background: linear-gradient(160deg, #faf6ef 0%, #f3ede2 100%); }
:root[data-palette="ocean"][data-bg="sable"] { --paper: #f6f0e5; --surface-2: #ece4d6; --line: #e3d9c8; }
:root[data-palette="ocean"][data-bg="mer"] body { background: linear-gradient(180deg, #d9f0f1 0%, #c6e3ea 45%, #b5d3e6 100%); background-attachment: fixed; }
:root[data-palette="ocean"][data-bg="mer"] { --paper: #e2f1f4; --surface-2: #cfe6ec; --line: #bcd8e0; }

/* ===== V2.2 — menu réorganisé ===== */
.sidebar-new { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 6px 0 4px; padding: 11px 12px; border-radius: 12px; background: #16a6a3; color: #fff; font-weight: 800; font-size: .88rem; box-shadow: 0 8px 18px rgba(0,0,0,.22); transition: transform .15s, filter .15s; }
.sidebar-new:hover { transform: translateY(-1px); filter: brightness(1.07); }
.sidebar-new span { font-size: 1.15rem; line-height: 1; }
.sidebar-scroll { margin-top: 6px; }
.sidebar-section { margin-top: 12px; }
.sidebar-section > p { margin: 0 12px 4px; }
.sidebar .nav-item > span:first-child { display: inline-grid; place-items: center; width: 1.3em; }
.ic-late { color: #ff8a80; font-weight: 900; }
.nav-item[data-focus="late"] b { background: rgba(255,138,128,.22); color: #ffb4ac; }
.sidebar-bottom .nav-item--small { font-size: .8rem; padding-block: 7px; }
@media (min-width: 761px) {
  :root[data-nav="rail"] .sidebar-new { font-size: 0; gap: 0; padding: 10px 0; }
  :root[data-nav="rail"] .sidebar-new span { font-size: 1.3rem; }
  :root[data-nav="rail"] .sidebar-section > p { display: none; }
  :root[data-nav="rail"] .sidebar-section + .sidebar-section { padding-top: 6px; border-top: 1px solid rgba(255,255,255,.1); }
}
@media (min-width: 761px) and (max-width: 1000px) { .sidebar-new { font-size: 0; gap: 0; padding: 10px 0; } .sidebar-new span { font-size: 1.3rem; } }
@media (max-height: 700px) and (min-width: 761px) { .sidebar-section > p { display: none; } .sidebar-section { margin-top: 6px; } .sidebar-new { padding: 8px 12px; } }
.sidebar-section { gap: 2px; }
.sidebar-section--views { grid-template-columns: 1fr 1fr; }
.sidebar-section--views > p { grid-column: 1 / -1; }
.sidebar-section--views .nav-item { flex-direction: column; justify-content: center; gap: 2px; padding: 8px 4px; font-size: .74rem; text-align: center; }
.sidebar .sidebar-section--views .nav-item > span:first-child { font-size: 1.05rem; }
.sidebar-bottom { gap: 0; }
@media (min-width: 761px) {
  :root[data-nav="rail"] .sidebar-section--views { grid-template-columns: 1fr; }
  :root[data-nav="rail"] .sidebar-section--views .nav-item { flex-direction: row; font-size: 0; padding: 11px 0; }
}
@media (min-width: 761px) and (max-width: 1000px) { .sidebar-section--views { grid-template-columns: 1fr; } .sidebar-section--views .nav-item { flex-direction: row; font-size: 0; padding: 11px 0; } }
.tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.tools-row .nav-item { padding: 7px 8px; gap: 6px; justify-content: center; font-size: .76rem; }
.sidebar .brand-logo { max-width: 128px; }
@media (min-height: 900px) { .sidebar .brand-logo { max-width: 160px; } }
@media (min-width: 761px) {
:root[data-nav="rail"] .tools-row { grid-template-columns: 1fr; }
:root[data-nav="rail"] .tools-row .nav-item { font-size: 0; gap: 0; padding: 10px 0; }
}
@media (min-width: 761px) and (max-width: 1000px) { .tools-row { grid-template-columns: 1fr; } .tools-row .nav-item { font-size: 0; gap: 0; padding: 10px 0; } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .sidebar-section--views { display: none; } .tools-row .nav-item { min-height: 44px; } }

.sa-ic { display: inline-grid; place-items: center; width: 1.2em; font-style: normal; }
/* mobile : filtres en grille 2 colonnes, sans défilement latéral ; le menu ignore le mode « réduit » */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; overflow: visible; width: 100%; min-width: 0; flex: none; }
  .filters select, .filters select:nth-child(3) { width: 100%; min-width: 0; max-width: none; text-overflow: ellipsis; padding-right: 30px; }
}

/* ===== V3.0 — PWA + adaptabilité ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
button, .nav-item, .sidebar-action, select { touch-action: manipulation; }
@media (display-mode: standalone) { body { overscroll-behavior-y: contain; user-select: none; -webkit-user-select: none; } input, textarea, [contenteditable], .task-row *, .detail-section *, .board-card * { user-select: text; -webkit-user-select: text; } }
.offline-bar { position: fixed; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; max-width: min(92vw, 560px); padding: 8px 14px; border-radius: 999px; background: #8a5a00; color: #fff; font-size: .74rem; font-weight: 700; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.offline-bar[hidden] { display: none !important; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .offline-bar { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: 14px; } }
/* tablettes : liste sans la colonne Personne, plus de défilement latéral */
@media (min-width: 761px) and (max-width: 1050px) { .list-head, .task-row { min-width: 600px; } .content-panel { overflow-x: auto; } }
/* encoches / coins arrondis (iPhone en paysage, appli installée) */
@supports (padding: max(0px)) {
  @media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
    .workspace { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    .sidebar { padding-left: max(18px, env(safe-area-inset-left)); }
  }
}
/* très petits écrans (≤ 340 px) */
@media (max-width: 340px) {
  .dashboard article { padding: 8px 4px; }
  .dashboard article strong { font-size: 1.1rem; }
  .tabbar button { font-size: .6rem; }
  .filters { grid-template-columns: minmax(0, 1fr); }
}
/* téléphone en paysage : bandeau compact, feuilles basses */
@media (pointer: coarse) and (max-height: 520px) {
  .tabbar { padding-top: 3px; padding-bottom: max(3px, env(safe-area-inset-bottom)); }
  .tabbar button { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 6px; min-height: 40px; }
  .dashboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toast { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
/* grands écrans : contenu centré, lisible */
@media (min-width: 1700px) { .workspace { max-width: 1600px; margin-inline: auto; width: 100%; } }
/* préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
:root[data-palette] .seg button.is-on, :root[data-palette] .quick-btn.is-on { color: #fff; }
@media (pointer: coarse) and (max-height: 520px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters select { height: 40px; }
  .dashboard article { padding: 5px 4px; }
  .topbar { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
  #viewTitle { font-size: 1rem; }
}
@media (pointer: coarse) and (max-height: 520px) { .dashboard { display: none; } .workspace { padding-bottom: calc(70px + env(safe-area-inset-bottom)); } .fab, .fab-new { bottom: calc(62px + env(safe-area-inset-bottom)); } }

/* ===== V3.0.1 — coin bas du menu ===== */
.sidebar-bottom { display: grid; gap: 6px; margin-top: 8px; padding-top: 8px; }
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.bottom-row .sidebar-action { justify-content: center; gap: 6px; padding: 8px 6px; font-size: .78rem; border-radius: 10px; background: rgba(255,255,255,.06); }
.bottom-row .sidebar-action:hover { background: rgba(255,255,255,.14); }
.sidebar-bottom .sync-status { justify-content: center; margin: 0; padding: 2px 0; font-size: .72rem; }
.collapse-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.09); color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer; transition: background .15s, border-color .15s; }
.collapse-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }
.collapse-btn:focus-visible { outline: 2px solid #16a6a3; outline-offset: 2px; }
.collapse-btn .nc-ico::before { font-size: 1.15rem; }
@media (min-width: 761px) {
  :root[data-nav="rail"] .bottom-row { grid-template-columns: 1fr; }
  :root[data-nav="rail"] .bottom-row .sidebar-action { font-size: 1.15rem; padding: 10px 0; background: transparent; }
  :root[data-nav="rail"] .collapse-btn span { display: none; }
  :root[data-nav="rail"] .collapse-btn { padding: 10px 0; }
  :root[data-nav="rail"] .sidebar-bottom .sync-status span:last-child { display: none; }
}
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .bottom-row .sidebar-action { min-height: 44px; } }
@media (max-height: 640px) and (min-width: 761px) { .sidebar-bottom { gap: 3px; } .collapse-btn { padding: 7px 10px; } }

/* V3.0.2 — étiquettes retirées : 3 filtres */
.filters { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: min(100%, 520px); }
@media (min-width: 761px) and (max-width: 1100px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; } .filters select:nth-child(3) { grid-column: 1 / -1; } }
@media (pointer: coarse) and (max-height: 520px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .filters select:nth-child(3) { grid-column: auto; } }
@media (max-width: 340px) { .filters { grid-template-columns: minmax(0, 1fr); } }

/* ===== V3.1 — variantes de menu (html[data-menu]) ===== */

/* ---------- B · FLOTTANT (bureau) ---------- */
@media (min-width: 761px) {
  :root[data-palette] .app-shell { grid-template-columns: 268px minmax(0,1fr); }
  :root[data-palette][data-nav="rail"] .app-shell { grid-template-columns: 96px minmax(0,1fr); }
  :root[data-palette][data-nav="hidden"] .app-shell { grid-template-columns: 0 minmax(0,1fr); }
  :root[data-palette] .sidebar { top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; border-radius: 26px; background: linear-gradient(170deg, #0d3a7a 0%, #0b2f6b 45%, #0a4658 100%); box-shadow: 0 24px 60px rgba(11,47,107,.35); }
  :root[data-palette] .sidebar .brand { border-bottom: 0; }
  :root[data-palette] .sidebar .nav-item > span:first-child { width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.09); font-size: .9rem; }
  :root[data-palette] .sidebar .nav-item { border-radius: 14px; gap: 10px; }
  :root[data-palette] .sidebar .nav-item.is-active { background: linear-gradient(135deg, #1fc2bd, #16a6a3); color: #fff; box-shadow: 0 10px 24px rgba(22,166,163,.45); }
  :root[data-palette] .sidebar .nav-item.is-active > span:first-child { background: rgba(255,255,255,.25); }
  :root[data-palette] .sidebar .nav-item.is-active b { background: rgba(255,255,255,.28); color: #fff; }
  :root[data-palette] .sidebar-new { border-radius: 16px; background: linear-gradient(135deg, #f7b267, #ee6a57); box-shadow: 0 10px 22px rgba(238,106,87,.4); color: #fff; }
  :root[data-palette] .sidebar-bottom { border-top: 0; background: rgba(255,255,255,.07); border-radius: 18px; padding: 8px; margin-top: 8px; }
  :root[data-palette] .collapse-btn { border-radius: 14px; }
  :root[data-palette][data-nav="rail"] .sidebar .nav-item > span:first-child { background: transparent; }
  :root[data-palette][data-nav="rail"] .sidebar { padding: 14px 8px; }
}

/* menu flottant : tablette étroite = rail d'icônes d'office */
@media (min-width: 761px) and (max-width: 1000px) {
  :root[data-palette] .app-shell { grid-template-columns: 96px minmax(0, 1fr); }
  :root[data-palette][data-nav="hidden"] .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
  :root[data-palette] .sidebar { padding: 14px 8px; }
  :root[data-palette] .sidebar .nav-item > span:first-child { background: transparent; }
  :root[data-palette] .sidebar-bottom .nav-item--small { font-size: 0; gap: 0; justify-content: center; }
  :root[data-palette] .sidebar-bottom .nav-item--small > span:first-child { font-size: 1.15rem; }
  .bottom-row { grid-template-columns: 1fr; }
  .bottom-row .sidebar-action { font-size: 1.15rem; padding: 10px 0; background: transparent; }
  .bottom-row .sidebar-action span, .sidebar-bottom .sync-status span:last-child { display: none; }
}

/* ===== V3.2 — colonne Catégorie, sous-tâches réordonnables ===== */
.task-row > .col-category, .list-head > .col-category { justify-self: start; min-width: 0; max-width: 100%; }
.task-row > .cat > span { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: .72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (min-width: 761px) { .task-meta .meta-cat { display: none; } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .task-row > .cat { display: none; } }
.subtask-edit { display: flex; align-items: center; gap: 6px; }
.subtask-edit .st-up, .subtask-edit .st-down { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: .7rem; line-height: 1; }
.subtask-edit .st-up:hover:not(:disabled), .subtask-edit .st-down:hover:not(:disabled) { background: var(--coral-soft); color: var(--coral); }
.subtask-edit .st-up:disabled, .subtask-edit .st-down:disabled { opacity: .3; cursor: default; }
.subtask-edit .st-del { flex: none; width: 34px; height: 34px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.1rem; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) { .subtask-edit .st-up, .subtask-edit .st-down, .subtask-edit .st-del { width: 44px; height: 44px; font-size: .85rem; } .subtask-edit .st-del { font-size: 1.3rem; } .subtask-edit { gap: 4px; } }
@media (min-width: 761px) and (max-width: 1050px) { .list-head, .task-row { min-width: 520px; } }
@media (min-width: 761px) { .topbar h1 { font-size: clamp(1.3rem, 2.3vw, 2.1rem); white-space: nowrap; } }

/* ===== V3.3 — fenêtre de tâche réorganisée + poignées ☰ ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dlg-sec { margin-top: 12px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.task-dialog .dlg-sec .form-grid { margin-top: 0; padding: 0; border: 0; background: none; gap: 10px 12px; }
.dlg-h { margin: 0 0 9px; display: flex; align-items: center; gap: 7px; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.dlg-h::before { content: ''; width: 4px; height: 12px; border-radius: 3px; background: var(--coral); flex: none; }
.dlg-h small { margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .68rem; opacity: .85; }
.dlg-sec--notes .field--notes { margin-top: 0; }
.dlg-sec--notes textarea { min-height: 84px; }
.task-dialog .fold { margin-top: 12px; }
.subtasks-editor .section-title { margin-top: 0; }
.subtasks-editor .section-title h3.dlg-h { margin: 0; }
.subtask-edit { display: flex; align-items: center; gap: 6px; margin-top: 6px; border-radius: 12px; transition: box-shadow .15s, background .15s; }
.subtask-edit input { flex: 1; min-width: 0; }
.st-grip { flex: none; display: grid; place-items: center; width: 30px; height: 36px; border-radius: 9px; background: transparent; color: var(--muted); cursor: grab; touch-action: none; }
.st-grip:hover, .st-grip:focus-visible { background: var(--surface-2); color: var(--ink); }
.st-grip:active { cursor: grabbing; }
.subtask-edit .st-del { flex: none; width: 34px; height: 34px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.1rem; }
.subtask-edit.is-dragging { position: relative; z-index: 2; background: var(--coral-soft); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
@media (min-width: 761px) {
  .dlg-sec--when .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); }
  .dlg-sec--track .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .dlg-sec { margin-top: 10px; padding: 10px 12px 12px; border-radius: 14px; }
  .dlg-sec--when #dueField { grid-column: auto; order: 1; }
  .dlg-sec--when #recurField { order: 2; }
  .dlg-sec--when #reminderField { order: 3; grid-column: 1 / -1; }
  .st-grip { width: 40px; height: 44px; }
  .subtask-edit .st-del { width: 44px; height: 44px; font-size: 1.3rem; }
  .subtask-edit { gap: 2px; }
  .dlg-h small { display: none; }
}

/* ===== V3.3.1 — redimensionnement des colonnes plus facile ===== */
.col-resize { width: 22px; z-index: 5; }
.col-resize::after { top: 18%; bottom: 18%; left: 10px; width: 3px; background: rgba(90,125,160,.5); }
.col-resize:hover::after, .is-resizing .col-resize::after { left: 9px; width: 5px; background: #16a6a3; box-shadow: 0 0 0 4px rgba(22,166,163,.18); }
.list-head .col-resize { right: auto; left: -11px; }
.list-head .col-title .col-resize { display: none; }
.list-head [data-colkey] { position: relative; }
.col-resize--board { right: -11px; }
body.is-resizing .list-head, body.is-resizing .board { cursor: col-resize; }
.list-head > .col-category { justify-self: stretch; }
