/* Listeyo — feuille de style */

:root {
  --accent: #5b5bd6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --side-w: 280px;
  --p1: #d1453b; --p2: #eb8909; --p3: #246fe0; --p4: #999999;
  --green: #058527; --orange: #ad6200; --purple: #692ec2; --red: #d1453b;
  --bg: #ffffff; --side: #fcfaf8; --panel: #ffffff; --text: #202020; --text-2: #444; --muted: #808080;
  --line: #ececec; --line-2: #f3f3f3; --hover: #f2efed; --hover-2: #f7f7f7; --shadow: 0 6px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
  --overlay: rgba(0,0,0,.42);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 88%, black);
  color-scheme: light;
}
[data-theme="tomate"] { --accent: #dc4c3e; }
[data-theme="mandarine"] { --accent: #e8730c; }
[data-theme="menthe"] { --accent: #12a594; }
[data-theme="foret"] { --accent: #2f8a4b; }
[data-theme="ocean"] { --accent: #0b7bc1; }
[data-theme="lavande"] { --accent: #8e4ec6; }
[data-theme="framboise"] { --accent: #c4337a; }
[data-theme="graphite"] { --accent: #4a4f57; }

[data-mode="dark"] {
  --bg: #1f1f1f; --side: #282828; --panel: #262626; --text: #ececec; --text-2: #cfcfcf; --muted: #9a9a9a;
  --line: #363636; --line-2: #2d2d2d; --hover: #333333; --hover-2: #2b2b2b; --shadow: 0 8px 30px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.4);
  --overlay: rgba(0,0,0,.6);
  --p1: #ff7066; --p2: #ff9a14; --p3: #5297ff; --p4: #8a8a8a;
  --green: #25b84c; --orange: #ff9a14; --purple: #a970ff; --red: #ff7066;
  --accent-text: color-mix(in srgb, var(--accent) 70%, white);
  color-scheme: dark;
}
[data-mode="dark"][data-theme="graphite"] { --accent: #9aa0a8; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
input, textarea, select { font: inherit; color: inherit; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--hover-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
kbd { display: inline-block; min-width: 20px; text-align: center; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); font-size: 12px; }
h1, h2, h3, h4 { margin: 0; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic svg { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.push { margin-left: auto; }
.accent { color: var(--accent); }
.ok { color: var(--green); }
.error { color: var(--red); }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0; }
.hint.ok { color: var(--green); }
.pad { padding: 8px 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.strike { text-decoration: line-through; color: var(--muted); }
.hide-sm { }
.boot { display: grid; place-items: center; height: 100vh; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- boutons et champs */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; background: var(--hover-2); border: 1px solid var(--line); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-danger, .btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 85%, black) !important; }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover) !important; color: var(--text); }
.btn.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.btn.full { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); position: relative; flex-shrink: 0; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 4px; }
.icon-btn.on { background: var(--accent-soft); }
.link-btn { color: var(--muted); font-size: 13px; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn.accent { color: var(--accent); font-weight: 500; }
.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { height: 28px; font-size: 13px; width: auto; }
.input.narrow { width: 80px; }
.input.mono, .mono { font-family: var(--mono); font-size: 13px; }
select.input { padding-right: 26px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.sm { width: 6px; height: 6px; background: var(--muted); }
.hash { font-weight: 700; font-size: 16px; width: 18px; text-align: center; display: inline-block; flex-shrink: 0; line-height: 1; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex-shrink: 0; line-height: 1; user-select: none; }
.avatar.ghost { width: 30px; height: 30px; background: var(--hover); color: var(--muted); }
.badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.progress.wide { width: 100%; height: 6px; margin: 8px 0 4px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 12.5px; background: var(--panel); white-space: nowrap; max-width: 100%; }
a.chip:hover, button.chip:hover { background: var(--hover); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip-x { display: inline-flex; color: var(--muted); border-radius: 3px; }
.chip-x:hover { color: var(--text); background: var(--hover); }

/* ---------------------------------------------------------------- mise en page */

.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--side-w); flex-shrink: 0; background: var(--side); display: flex; flex-direction: column; border-right: 1px solid var(--line-2); transition: margin .2s ease; z-index: 20; }
body.sidebar-hidden .sidebar { margin-left: calc(-1 * var(--side-w)); }
.main-wrap { flex: 1; overflow-y: auto; position: relative; min-width: 0; }
.main { max-width: 860px; margin: 0 auto; padding: 36px 44px 120px; }
.main.view-upcoming, .main.view-project, .main.view-today, .main.view-label, .main.view-filter { max-width: none; }
.main > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.main > .board, .main > .calendar, .main > .week-strip.wide { max-width: none; }
.show-sidebar { position: fixed; top: 12px; left: 12px; display: none !important; z-index: 5; }
body.sidebar-hidden .show-sidebar { display: inline-flex !important; }
.mobile-bar { display: none; }
.sidebar-backdrop { display: none; }

/* ---------------------------------------------------------------- barre latérale */

.side-top { display: flex; align-items: center; gap: 2px; padding: 10px 10px 6px 12px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-weight: 600; min-width: 0; }
.user-btn:hover { background: var(--hover); }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.side-scroll { overflow-y: auto; padding: 4px 10px 24px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border-radius: 6px; color: var(--text-2); position: relative; text-align: left; user-select: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.nav-item.drop-into { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--muted); }
.nav-count.alert { color: var(--red); font-weight: 600; }
.nav-kbd { font-size: 11px; opacity: 0; }
.nav-item:hover .nav-kbd { opacity: .7; }
.nav-tail { display: inline-flex; align-items: center; gap: 2px; }
.nav-more { display: none; }
.nav-item:hover .nav-more { display: inline-flex; }
.nav-item:hover .nav-count { display: none; }
.nav-item .collapse-btn.xs { margin-left: -4px; margin-right: -6px; }
.add-btn { color: var(--accent-text); font-weight: 600; margin-bottom: 2px; }
.c-inbox { color: #246fe0; } .c-today { color: #058527; } .c-upcoming { color: #692ec2; } .c-filters { color: #eb8909; } .c-done { color: #808080; }
[data-mode="dark"] .c-inbox { color: #5297ff; } [data-mode="dark"] .c-today { color: #25b84c; } [data-mode="dark"] .c-upcoming { color: #a970ff; }
.side-group { margin-top: 14px; }
.side-group-head { display: flex; align-items: center; padding: 0 4px 0 8px; height: 30px; border-radius: 6px; }
.side-group-head:hover { background: var(--hover); }
.side-group-title { flex: 1; text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 2px; }
.side-group-actions { display: flex; opacity: 0; }
.side-group-head:hover .side-group-actions { opacity: 1; }
.side-group.collapsed .side-group-actions .ic:last-child svg { transform: rotate(-90deg); }
.side-group.collapsed .side-group-actions { opacity: 1; }
.side-empty { color: var(--muted); font-size: 12.5px; padding: 4px 10px; margin: 0; }
.side-links { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.drop-line { height: 2px; background: var(--accent); border-radius: 2px; margin: 0 0 0 calc(var(--depth, 0) * 28px + 26px); position: relative; pointer-events: none; }
.drop-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.drop-line.sidebar { margin-left: 10px; }

/* ---------------------------------------------------------------- en-tête de vue */

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 18px; margin-bottom: 4px; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .ic { margin-right: 4px; }
.view-head { margin-bottom: 18px; }
.view-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.view-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.view-title h1.editable { cursor: text; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.view-title h1.editable:hover { background: var(--hover-2); }
.title-input { font-size: 24px; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; outline: none; background: var(--panel); width: min(480px, 100%); }
.view-sub { color: var(--muted); font-size: 13px; }
.view-sub code.query { font-size: 12px; }
.view-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.view-desc { color: var(--text-2); margin-top: 6px; font-size: 13.5px; }
.view-desc p { margin: 2px 0; }
.avatars { display: flex; cursor: pointer; margin-right: 4px; }
.avatars .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.view-options { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vo-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
.vo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.vo-row select { max-width: 160px; }
.seg { display: flex; gap: 6px; }
.seg-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.seg-btn:hover { background: var(--hover-2); }
.seg-btn.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.seg.small .seg-btn { flex-direction: row; padding: 4px 10px; }

/* ---------------------------------------------------------------- tâche */

.task-list { position: relative; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 9px 4px 9px calc(var(--depth, 0) * 28px + 4px); border-bottom: 1px solid var(--line-2); position: relative; cursor: pointer; border-radius: 0; transition: background .1s; }
.task:hover { background: none; }
.task.selected { background: var(--accent-soft); border-radius: 6px; }
.task.kb-focus { box-shadow: inset 2px 0 0 var(--accent); background: var(--hover-2); }
.task.dragging { opacity: .35; }
.task.completing { animation: completing .26s ease forwards; }
@keyframes completing { 60% { opacity: .6; } to { opacity: 0; transform: translateX(8px); } }
.drag-handle { position: absolute; left: calc(var(--depth, 0) * 28px - 22px); top: 9px; color: var(--muted); opacity: 0; cursor: grab; padding: 2px; }
.task:hover .drag-handle { opacity: .8; }
.collapse-btn { position: absolute; left: calc(var(--depth, 0) * 28px - 24px); top: 10px; color: var(--muted); display: inline-flex; border-radius: 4px; }
.task:hover .collapse-btn ~ .check { }
.task .collapse-btn { z-index: 1; }
.task:hover .drag-handle + .collapse-btn { left: calc(var(--depth, 0) * 28px - 42px); }
.collapse-btn.collapsed svg { transform: rotate(-90deg); }
.collapse-btn:hover { background: var(--hover); color: var(--text); }
.group-head .collapse-btn, .section-head .collapse-btn { position: static; }
.check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--p4); margin-top: 1px; flex-shrink: 0; display: grid; place-items: center; color: transparent; transition: background .12s; background: var(--bg); }
.check .ic { opacity: 0; transition: opacity .12s; }
.check:hover .ic { opacity: 1; color: var(--p4); }
.check.mini { width: 13px; height: 13px; border-width: 1.3px; margin-top: 0; }
.prio-1 > .check, .check.prio-1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, var(--bg)); border-width: 2px; }
.prio-2 > .check, .check.prio-2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 12%, var(--bg)); border-width: 2px; }
.prio-3 > .check, .check.prio-3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 12%, var(--bg)); border-width: 2px; }
.prio-1 > .check:hover .ic, .check.prio-1:hover .ic { color: var(--p1); }
.prio-2 > .check:hover .ic, .check.prio-2:hover .ic { color: var(--p2); }
.prio-3 > .check:hover .ic, .check.prio-3:hover .ic { color: var(--p3); }
.task.completing > .check, .task.done > .check { background: var(--p4); border-color: var(--p4); }
.task.done > .check .ic { opacity: 1; color: #fff; }
.task.prio-1.completing > .check { background: var(--p1); } .task.prio-2.completing > .check { background: var(--p2); } .task.prio-3.completing > .check { background: var(--p3); }
.task.completing > .check .ic { opacity: 1; color: #fff; }
.task.done .task-content { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; }
.task-content { word-wrap: break-word; line-height: 1.4; }
.task-content a, .task-desc a, .comment-body a, .td-desc-view a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.task-content code { font-size: 12.5px; }
.task-desc { color: var(--muted); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.meta { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.meta.label:hover { text-decoration: underline; }
.meta.parent { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.due-overdue { color: var(--red) !important; }
.due-today { color: var(--green) !important; }
.due-tomorrow { color: var(--orange) !important; }
.due-week { color: var(--purple) !important; }
.due-later { color: var(--muted); }
.task-right { display: flex; align-items: center; gap: 8px; margin-left: 6px; align-self: center; }
.task-project { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; max-width: 220px; overflow: hidden; }
.task-project span:first-child { overflow: hidden; text-overflow: ellipsis; }
.task-project .hash { font-size: 13px; width: 12px; }
.task-project:hover { color: var(--text); }
.task-actions { position: absolute; right: 2px; top: 5px; display: none; gap: 0; background: var(--bg); padding-left: 6px; box-shadow: -10px 0 10px var(--bg); }
.task:hover .task-actions { display: flex; }
.task.selected .task-actions { background: transparent; box-shadow: none; }
.add-task-btn { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 8px 4px; width: 100%; text-align: left; border-radius: 6px; }
.add-task-btn .plus { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.add-task-btn:hover { color: var(--accent-text); }
.add-task-btn:hover .plus { background: var(--accent); color: #fff; }
.done-subs .task { padding-left: 4px; }

/* ---------------------------------------------------------------- formulaire de tâche */

.task-editor { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin: 8px 0; transition: border-color .12s, box-shadow .12s; }
.task-editor:focus-within { border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.task-editor.inline { margin-left: calc(var(--depth, 0) * 28px); }
.te-body { padding: 10px 12px 4px; }
.te-wrap { position: relative; }
.te-content, .te-hl { font: inherit; font-size: 15px; font-weight: 500; line-height: 1.45; padding: 0; margin: 0; border: 0; width: 100%; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; letter-spacing: normal; }
.te-hl { position: absolute; inset: 0; color: var(--text); pointer-events: none; overflow: hidden; }
.te-content { position: relative; resize: none; outline: none; background: transparent; color: transparent; caret-color: var(--text); display: block; overflow: hidden; min-height: 22px; }
.te-content::placeholder { color: var(--muted); font-weight: 400; }
.te-hl mark { border-radius: 3px; color: inherit; background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft); }
.te-hl mark.tk-date { background: color-mix(in srgb, var(--green) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 16%, transparent); }
.te-hl mark.tk-priority { background: color-mix(in srgb, var(--p1) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--p1) 16%, transparent); }
.te-hl mark.tk-label { background: color-mix(in srgb, var(--p2) 18%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--p2) 18%, transparent); }
.te-hl mark.tk-reminder, .te-hl mark.tk-deadline { background: color-mix(in srgb, var(--purple) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--purple) 16%, transparent); }
.te-desc { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: 13px; color: var(--text-2); padding: 2px 0 0; min-height: 20px; overflow: hidden; }
.te-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 6px; align-items: center; }
.te-chips .chip { padding: 0; overflow: hidden; }
.chip-main { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 8px; }
.chip-main:hover { background: var(--hover); }
.te-chips .chip .chip-x { padding: 0 6px 0 2px; height: 100%; align-items: center; }
.chip.chip-empty { color: var(--muted); }
.chip.prio-chip.prio-1 { color: var(--p1); } .chip.prio-chip.prio-2 { color: var(--p2); } .chip.prio-chip.prio-3 { color: var(--p3); }
.chip.label-chip { color: var(--text-2); }
.te-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.te-btns { display: flex; gap: 6px; }
.te-project { background: none; border-color: transparent; max-width: 60%; overflow: hidden; }
.te-project span { overflow: hidden; text-overflow: ellipsis; }
.quick-add .modal-body { padding: 0; }
.quick-add .task-editor { margin: 0; border: 0; }
.menu-help { padding: 8px 12px; font-size: 12px; color: var(--muted); line-height: 1.9; max-width: 280px; }
.ac-list { max-height: 260px; overflow-y: auto; }

/* ---------------------------------------------------------------- groupes et sections */

.group { margin-bottom: 22px; }
.group.drop-target, .section.drop-target { background: var(--accent-soft); border-radius: 8px; }
.group-head, .section-head, .fl-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); margin-bottom: 2px; min-height: 36px; }
.group-head h3, .section-head h3 { font-size: 14px; font-weight: 700; }
.group.overdue .group-head h3 { color: var(--red); }
.group-head .count, .section-head .count, .board-col-head .count { color: var(--muted); font-size: 12.5px; }
.group.collapsed .group-head { opacity: .8; }
.section { margin-top: 6px; }
.section-head { cursor: grab; }
.section-head .collapse-btn { margin-left: -24px; }
.section-name { cursor: text; }
.section.dragging { opacity: .4; }
.section-divider { height: 24px; position: relative; display: flex; align-items: center; }
.add-section { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--accent-text); font-weight: 600; font-size: 13px; opacity: 0; transition: opacity .12s; }
.add-section::before, .add-section::after { content: ""; flex: 1; height: 1px; background: var(--accent); }
.add-section:hover, .board .add-section { opacity: 1; }
.section-form { width: 100%; padding: 8px 0; }
.section-form .row-actions { margin-top: 8px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.load-more { display: flex; margin: 16px auto; }
.completed-block { margin-top: 24px; opacity: .9; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-ic { width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0; }
.empty.small { padding: 20px; }
.error-box { padding: 12px; border-radius: 8px; background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- tableau */

.board { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 20px; min-height: 60vh; }
.board-col { width: 280px; flex-shrink: 0; border-radius: 10px; padding: 4px 6px 8px; transition: background .12s; }
.board-col.drop-target { background: var(--accent-soft); }
.board-col.dragging { opacity: .4; }
.board-col-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; cursor: grab; }
.board-col-head h3 { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 10px; }
.task.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 10px 10px; background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.04); flex-wrap: wrap; }
.task.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: color-mix(in srgb, var(--muted) 35%, var(--line)); }
.task.card .drag-handle { display: none; }
.task.card .task-right { width: 100%; justify-content: flex-end; margin: 0; }
.task.card .task-right:empty { display: none; }
.task.card .task-actions { top: 6px; right: 6px; background: var(--panel); box-shadow: -8px 0 8px var(--panel); border-radius: 6px; }
.task.card .task-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.add-col { padding-top: 8px; }
.card-editor { margin: 8px 0 0; }
.board .drop-line { margin: 0; }

/* ---------------------------------------------------------------- calendrier */

.calendar { margin-bottom: 30px; }
.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-label { font-size: 16px; min-width: 180px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-split { display: flex; gap: 14px; align-items: flex-start; }
.cal-split .cal-body { flex: 1; min-width: 0; }
.cal-drawer { width: 260px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 75vh; overflow-y: auto; position: sticky; top: 10px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.month-dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-transform: capitalize; }
.month-cell { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .1s; }
.month-cell.other { background: var(--hover-2); }
.month-cell.other .month-num { color: var(--muted); }
.month-cell.drop-target { background: var(--accent-soft); }
.month-cell-head { display: flex; align-items: center; justify-content: space-between; }
.month-num { font-size: 12.5px; font-weight: 600; padding: 2px 6px; border-radius: 10px; }
.month-cell.today .month-num { background: var(--accent); color: #fff; }
.month-cell-head .icon-btn { opacity: 0; }
.month-cell:hover .month-cell-head .icon-btn { opacity: 1; }
.month-tasks { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-task { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 6px; border-radius: 5px; background: color-mix(in srgb, var(--pc) 13%, var(--bg)); border-left: 3px solid var(--pc); cursor: pointer; min-width: 0; overflow: hidden; }
.cal-task:hover { background: color-mix(in srgb, var(--pc) 22%, var(--bg)); }
.cal-task .check.mini { margin: 0; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.week-head, .week-allday { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.week-day-head { text-align: center; padding: 6px; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.week-day-head strong { font-size: 18px; color: var(--text); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.week-day-head.today strong { background: var(--accent); color: #fff; }
.week-allday { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.week-allday-cell { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 3px; min-height: 34px; min-width: 0; }
.week-allday-cell.drop-target { background: var(--accent-soft); }
.week-gutter { font-size: 11px; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.week-scroll { height: 62vh; overflow-y: auto; border-bottom: 1px solid var(--line); }
.week-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.week-gutter.hours { flex-direction: column; justify-content: flex-start; align-items: stretch; padding: 0; }
.hour-label { height: var(--hour); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.week-col { position: relative; border-left: 1px solid var(--line); }
.week-col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.week-col.drop-target { background: var(--accent-soft); }
.hour-slot { height: var(--hour); border-top: 1px solid var(--line-2); }
.week-event { position: absolute; left: 2px; right: 2px; align-items: flex-start; flex-direction: row; white-space: normal; z-index: 1; }
.week-event .cal-text { white-space: normal; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ---------------------------------------------------------------- à venir */

.week-strip { position: sticky; top: 0; background: var(--bg); z-index: 4; padding: 4px 0 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.week-strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.week-strip-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.strip-day { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 8px; font-size: 12px; color: var(--muted); position: relative; text-transform: capitalize; }
.strip-day strong { font-size: 15px; color: var(--text); }
.strip-day:hover:not(:disabled) { background: var(--hover-2); }
.strip-day.today { color: var(--accent-text); }
.strip-day.today strong { color: var(--accent-text); }
.strip-day.past strong { color: var(--muted); }
.strip-dot { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; position: absolute; bottom: 2px; }

/* ---------------------------------------------------------------- fenêtres et menus */

.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 100; animation: fade .12s ease; overflow-y: auto; }
.modal-backdrop.closing { animation: fade .12s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); width: 100%; animation: pop .14s ease; max-height: 84vh; display: flex; flex-direction: column; }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0 20px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-text { margin: 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.row { flex-direction: row; align-items: center; gap: 10px; }
.field-label { font-weight: 600; font-size: 13px; }
.color-field { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.color-field .ic:last-child { margin-left: auto; color: var(--muted); }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 6px; gap: 2px; max-height: 320px; overflow-y: auto; }
.color-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; text-align: left; }
.color-opt:hover, .color-opt.on { background: var(--hover); }

.popover { position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; max-width: calc(100vw - 16px); animation: pop .1s ease; max-height: calc(100vh - 16px); overflow-y: auto; }
.menu { padding: 5px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; text-align: left; width: 100%; font-size: 13.5px; color: var(--text-2); }
.menu-item .ic { color: var(--muted); }
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item.danger, .menu-item.danger .ic { color: var(--red); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-hint { font-size: 11.5px; color: var(--muted); }
.menu-check { color: var(--accent) !important; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu-title { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 8px 2px; display: flex; align-items: center; gap: 4px; }
.menu-row { padding: 0 2px 4px; }
.icon-row { display: flex; gap: 2px; padding: 0 4px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px; }
.prio-1 { color: var(--p1); } .prio-2 { color: var(--p2); } .prio-3 { color: var(--p3); } .prio-4 { color: var(--p4); }
.task.prio-1, .task.prio-2, .task.prio-3, .task.prio-4, .cal-task.prio-1, .cal-task.prio-2, .cal-task.prio-3, .cal-task.prio-4 { color: inherit; }
.ic.prio-1 { color: var(--p1); } .ic.prio-2 { color: var(--p2); } .ic.prio-3 { color: var(--p3); } .ic.prio-4 { color: var(--p4); }

.toasts { position: fixed; left: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { display: flex; align-items: center; gap: 12px; background: #2b2b2b; color: #fff; padding: 10px 10px 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 440px; animation: pop .15s ease; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
.toast.error { background: #a5281f; }
.toast.success { background: #1f6f3a; }
.toast-action { color: #ffb4a8; font-weight: 600; }
[data-theme] .toast-action { color: color-mix(in srgb, var(--accent) 40%, white); }
.toast-close { color: #aaa; display: inline-flex; }
.toast-close:hover { color: #fff; }

/* sélecteurs */
.picker { display: flex; flex-direction: column; }
.pop-search, .dp-input { border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; outline: none; background: transparent; width: 100%; font-size: 13.5px; }
.pick-list { max-height: 280px; overflow-y: auto; padding: 4px; }
.pick-list.tall { max-height: 360px; }
.pick-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-radius: 6px; text-align: left; font-size: 13.5px; }
.pick-item:hover { background: var(--hover); }
.pick-item.section { color: var(--text-2); font-size: 13px; }
.pick-item.section .ic { color: var(--muted); }
.pick-item.create { color: var(--accent-text); }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkbox-sq { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; }
.checkbox-sq.on { background: var(--accent); border-color: var(--accent); }
.reminder-pick .row { padding: 4px 12px 10px; }
.time-pop { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.time-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }

/* sélecteur de date */
.datepicker { display: flex; flex-direction: column; }
.dp-title { padding: 10px 12px 0; font-weight: 600; font-size: 13px; }
.dp-preview { padding: 0 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; min-height: 0; }
.dp-preview:not(:empty) { padding: 6px 12px; }
.dp-current { padding: 8px 12px; font-size: 12.5px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); color: var(--accent-text); }
.dp-quick { padding: 4px; border-bottom: 1px solid var(--line); }
.dp-quick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; }
.dp-quick-item:hover { background: var(--hover); }
.dp-quick-item span:nth-child(2) { flex: 1; text-align: left; }
.dp-quick-day { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.c-tomorrow { color: var(--orange); } .c-week { color: var(--purple); } .c-next { color: var(--p3); } .c-none { color: var(--muted); }
.dp-cal { padding: 8px 10px; }
.dp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 13.5px; }
.dp-cal-head > div { display: flex; align-items: center; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-week span { font-size: 11px; color: var(--muted); padding: 4px 0; }
.dp-day { height: 32px; border-radius: 50%; font-size: 13px; display: grid; place-items: center; width: 32px; margin: 1px auto; }
.dp-day:hover:not(.dp-blank) { background: var(--hover); }
.dp-day.today { color: var(--accent-text); font-weight: 700; }
.dp-day.selected { background: var(--accent) !important; color: #fff; font-weight: 600; }
.dp-day.past { color: var(--muted); opacity: .6; }
.dp-foot { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dp-foot .btn { flex: 1; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }

/* ---------------------------------------------------------------- fenêtre de tâche */

.task-modal .modal-body { padding: 0; }
.task-modal { max-height: 88vh; }
.td { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.td-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.td-crumb { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.td-crumb a { display: inline-flex; align-items: center; gap: 4px; }
.td-crumb a:hover { color: var(--text); text-decoration: underline; }
.td-head-actions { display: flex; }
.td-cols { display: flex; min-height: 0; flex: 1; }
.td-left { flex: 1; padding: 18px 22px 26px; min-width: 0; overflow-y: auto; }
.td-right { width: 260px; flex-shrink: 0; background: var(--side); padding: 14px; border-radius: 0 0 12px 0; overflow-y: auto; }
.td-title-row { display: flex; gap: 10px; align-items: flex-start; }
.td-title-row .check { margin-top: 5px; }
.td-title { font-size: 19px; font-weight: 700; border: 1px solid transparent; border-radius: 6px; width: 100%; resize: none; outline: none; background: transparent; padding: 1px 6px; line-height: 1.35; overflow: hidden; }
.td-title:hover { border-color: var(--line); }
.td-title:focus { border-color: var(--line); background: var(--panel); }
.td-desc-view { margin: 6px 0 0 28px; padding: 4px 6px; border-radius: 6px; cursor: text; font-size: 13.5px; color: var(--text-2); min-height: 26px; }
.td-desc-view:hover { background: var(--hover-2); }
.td-desc-view p { margin: 2px 0; }
.td-desc-view ul { margin: 4px 0; padding-left: 20px; }
.td-desc-view .placeholder { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.td-desc-edit { margin: 6px 0 0 28px; width: calc(100% - 28px); border: 1px solid var(--line); border-radius: 6px; padding: 6px; outline: none; resize: none; background: var(--panel); font-size: 13.5px; line-height: 1.5; min-height: 70px; }
.td-subtasks { margin: 18px 0 0 28px; }
.td-section-head { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.td-subtasks .task { padding-left: calc(var(--depth, 0) * 28px + 4px); }
.td-subtasks .task-actions { box-shadow: -10px 0 10px var(--panel); background: var(--panel); }
.td-subtasks .check { background: var(--panel); }
.td-assist { margin: 14px 0 0 28px; }
.assist-box { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.assist-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.assist-items { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.assist-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.assist-item span { flex: 1; }
.assist-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 0; }
.assist-loading .spinner { width: 16px; height: 16px; }
.td-tabs-wrap { margin: 22px 0 0 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { padding: 8px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.comment-body { font-size: 13.5px; color: var(--text-2); word-wrap: break-word; }
.comment-body p { margin: 2px 0; }
.comment-body ul { margin: 4px 0; padding-left: 20px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; max-width: 100%; }
.attachment:hover { background: var(--hover-2); }
.attachment.img { padding: 4px; }
.attachment img { max-width: 320px; max-height: 220px; border-radius: 6px; display: block; }
.composer { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--panel); transition: border-color .12s; }
.composer.drop { border-color: var(--accent); background: var(--accent-soft); }
.composer textarea { border: 0; box-shadow: none !important; resize: vertical; min-height: 44px; }
.composer-foot { display: flex; align-items: center; gap: 6px; padding: 2px 2px 0; }
.file-tag .chip { height: 24px; }
.activity-list { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.quote { border-left: 2px solid var(--line); padding-left: 8px; margin: 3px 0; color: var(--muted); font-size: 12.5px; white-space: pre-wrap; }
.side-row { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.side-label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.side-value { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 6px; text-align: left; font-size: 13.5px; width: 100%; margin-left: -6px; }
.side-value:hover { background: var(--hover); }
.side-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; padding: 0 0 4px; }
.side-sep { height: 1px; background: var(--line); margin: 4px 0; }
.side-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.side-labels .chip { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.side-reminder { display: flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 0; }
.side-meta { margin-top: 14px; line-height: 1.7; }
.side-meta a { text-decoration: underline; }
.td-right .btn.full { margin-top: 10px; }
.td-done .task { border: 0; }

/* ---------------------------------------------------------------- recherche, notifications, sélection */

.search-modal .modal-body { padding: 0; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); }
.search-list { padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; }
.search-item.active { background: var(--hover); }
.si-ic { width: 20px; display: inline-flex; justify-content: center; color: var(--muted); }
.si-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-hint { color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-big { height: 42px; font-size: 15px; margin-bottom: 18px; }
.search-comment { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.notifs { display: flex; flex-direction: column; max-height: 70vh; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; padding: 4px; }
.notif { display: flex; gap: 10px; padding: 8px; border-radius: 8px; text-align: left; width: 100%; font-size: 13px; position: relative; }
.notif:hover { background: var(--hover); }
.notif.unread::after { content: ""; position: absolute; right: 10px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.bulk-bar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px 8px 16px; z-index: 50; flex-wrap: wrap; max-width: calc(100vw - 24px); }
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { margin-right: 6px; font-size: 13.5px; }

/* ---------------------------------------------------------------- pages */

.fl-section { margin-bottom: 30px; }
.fl-head h2 { font-size: 16px; flex: 1; }
.fl-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.fl-row:hover { background: var(--hover-2); }
.fl-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.fl-name { font-weight: 500; }
.fl-row code.query { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-row .count { color: var(--muted); font-size: 12.5px; min-width: 20px; text-align: right; }
.fav { color: #eb8909; }
.fl-help { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.fl-help summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.help-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.help-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.help-table td:last-child { color: var(--text-2); }
.day-head { font-size: 13.5px; font-weight: 700; padding: 18px 0 8px; border-bottom: 1px solid var(--line); text-transform: none; }
.completed-item, .activity-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.act-avatar { position: relative; }
.act-ic { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); color: #fff; border: 2px solid var(--bg); }
.act-ic.ev-completed { background: var(--green); } .act-ic.ev-added { background: var(--p3); } .act-ic.ev-deleted { background: var(--red); } .act-ic.ev-commented { background: var(--purple); } .act-ic.ev-updated { background: var(--p2); }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; background: var(--panel); }
.panel h3 { font-size: 14px; margin-bottom: 10px; }
.prod-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.karma-card, .goal-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 14px; align-items: center; background: var(--panel); }
.goal-card { flex-direction: column; text-align: center; gap: 6px; }
.karma-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.karma-card > div:last-child { flex: 1; min-width: 0; }
.karma-level { font-size: 18px; font-weight: 700; }
.karma-points { color: var(--text-2); }
.trend.up { color: var(--green); } .trend.down { color: var(--red); } .trend.flat { color: var(--muted); }
.prod-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart .bars { display: block; }
.bar-labels { display: flex; justify-content: space-around; font-size: 11px; color: var(--muted); margin-top: -14px; text-transform: capitalize; }
.settings-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.days-off { display: flex; gap: 4px; }
.day-pill { width: 32px; height: 28px; border-radius: 6px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.day-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ring svg { display: block; }

.settings-modal .modal-body { padding: 0; }
.settings { display: flex; min-height: 480px; }
.settings-nav { width: 200px; flex-shrink: 0; padding: 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.settings-tab { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-align: left; color: var(--text-2); font-size: 13.5px; }
.settings-tab:hover { background: var(--hover); }
.settings-tab.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.settings-body { flex: 1; padding: 6px 24px 24px; overflow-y: auto; max-height: 72vh; min-width: 0; }
.set-pane h2 { font-size: 18px; margin: 12px 0 14px; }
.set-pane h3 { font-size: 14px; margin: 20px 0 6px; display: flex; align-items: center; gap: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.set-row > div:first-child { flex: 1; min-width: 0; }
.set-row .row .input { width: 240px; }
.set-row .stack { width: 280px; }
.set-label { font-weight: 600; font-size: 13.5px; margin: 6px 0; }
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.avatar-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; }
.avatar-color.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--panel); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.theme-card { border: 2px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; text-align: left; font-weight: 500; }
.theme-card.on { border-color: var(--ta); }
.theme-swatch { display: flex; height: 36px; border-radius: 6px; overflow: hidden; }
.theme-swatch span:nth-child(1) { flex: 1; background: var(--side); }
.theme-swatch span:nth-child(2) { flex: 2; background: var(--bg); border-left: 1px solid var(--line); position: relative; }
.theme-swatch span:nth-child(2)::after { content: ""; position: absolute; left: 10px; top: 10px; width: 50%; height: 6px; border-radius: 3px; background: var(--ta); }
.theme-swatch span:nth-child(3) { width: 10px; background: var(--ta); }
.backup-list { margin-top: 14px; }
.backup-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }

.share .row { margin-bottom: 14px; }
.member-list { display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.member.pending { opacity: .75; }
.team-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.team-head h2 { font-size: 17px; }
.team-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.team h3 { margin-top: 16px; }
.invite { margin-top: 12px; }
.invite .input:first-child { flex: 1; }

.tpl-cat { font-size: 15px; margin: 22px 0 10px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); border-top: 4px solid var(--tc); transition: box-shadow .12s; }
.tpl-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.tpl-top { display: flex; align-items: center; gap: 6px; }
.tpl-top .hash { color: var(--tc); }
.tpl-top h3 { font-size: 15px; }
.tpl-card p { margin: 0; color: var(--text-2); font-size: 13px; flex: 1; }
.tpl-sections { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-sections .chip { height: 22px; font-size: 11.5px; }
.tpl-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 22px; }
.auth h1 { font-size: 22px; margin-bottom: 4px; }
.auth .form { margin-top: 18px; }
.auth .input { height: 42px; }
.auth .btn { height: 42px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
.auth-switch a { color: var(--accent-text); font-weight: 600; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 800px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; margin-left: calc(-1 * var(--side-w)); box-shadow: var(--shadow); width: min(var(--side-w), 86vw); }
  body.sidebar-open .sidebar { margin-left: 0; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 15; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 10; }
  body.sidebar-hidden .show-sidebar { display: none !important; }
  .main { padding: 18px 16px 120px; }
  .task-actions { display: none !important; }
  .drag-handle { display: none; }
  .hide-sm { display: none; }
  .view-title h1 { font-size: 20px; }
  .task-project { max-width: 110px; }
  .td-cols { flex-direction: column; }
  .td-right { width: auto; border-radius: 0 0 12px 12px; }
  .td-left { padding: 14px; }
  .td-desc-view, .td-desc-edit, .td-subtasks, .td-tabs-wrap, .td-assist { margin-left: 0; }
  .td-desc-edit { width: 100%; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-height: none; border-radius: 0; min-height: 100%; }
  .quick-add, .search-modal { min-height: auto; border-radius: 0 0 12px 12px; }
  .prod-top, .prod-charts { grid-template-columns: 1fr; }
  .settings { flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-tab { white-space: nowrap; }
  .set-row { flex-direction: column; align-items: stretch; }
  .set-row .row .input, .set-row .stack { width: 100%; }
  .month-cell { min-height: 76px; }
  .cal-task .cal-time { display: none; }
  .cal-drawer { display: none; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .bulk-bar { bottom: 10px; }
}

/* ---------------------------------------------------------------- impression */

@media print {
  .sidebar, .view-actions, .add-task-btn, .task-actions, .drag-handle, .mobile-bar, .show-sidebar, .add-section, .bulk-bar, .toasts { display: none !important; }
  .layout { display: block; height: auto; }
  .main-wrap { overflow: visible; }
  .main { padding: 0; max-width: none; }
  .task { break-inside: avoid; }
}
