/* KeepTrack — feuille de style alignée sur la maquette Figma « Projet — Vue d’ensemble ».
   Aucune dépendance externe (police Inter hébergée localement), compatible CSP stricte. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Couleurs de la maquette */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f3f6;
  --border: #e5e9f0;
  --text: #17202e;
  --text-2: #5b6576;
  --text-3: #687285;
  --primary: #5253d8;
  --primary-hover: #4546c4;
  --primary-soft: #eeeeff;
  --primary-light: #b9b9ff;
  --success: #1d7a55;
  --success-soft: #e9f7f1;
  --warning: #a2600f;
  --warning-soft: #fff5e5;
  --danger: #c0393f;
  --danger-soft: #fdecec;
  --info: #2d64bd;
  --info-soft: #ecf3ff;
  --side-bg: #20293a;
  --side-surface: #2b364a;
  --side-border: #344055;
  --side-text: #aeb7c6;
  --purple: #7e3fc4;
  --purple-soft: #f3e8ff;
  --teal: #00796b;
  --teal-soft: #e0f2f1;
  --on-accent: #ffffff; /* texte sur fond coloré (boutons, élément actif) */
  /* Formes */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 6px 20px rgba(23, 32, 46, .05);
  --shadow-lg: 0 12px 32px rgba(23, 32, 46, .12);
  --sidebar-w: 236px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Thème sombre : automatique (réglage du système) sauf choix « Clair », ou forcé par « Sombre ». */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b;
    --surface: #161d28;
    --surface-2: #1b2330;
    --surface-3: #232d3c;
    --border: #2b3647;
    --text: #e5eaf1;
    --text-2: #a7b1c1;
    --text-3: #8d98aa;
    --primary: #8081f2;
    --primary-hover: #9394f6;
    --primary-soft: #212446;
    --primary-light: #4b4cb2;
    --success: #45c290;
    --success-soft: #12311f;
    --warning: #e8a652;
    --warning-soft: #372812;
    --danger: #f07a7f;
    --danger-soft: #3a1d20;
    --info: #72a6f2;
    --info-soft: #162944;
    --purple: #c49af0;
    --purple-soft: #2f2145;
    --teal: #6fd6c8;
    --teal-soft: #0b3b36;
    --side-bg: #0a0e15;
    --side-surface: #192130;
    --side-border: #202a3a;
    --side-text: #9ba6b8;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --on-accent: #0b0f16;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b;
  --surface: #161d28;
  --surface-2: #1b2330;
  --surface-3: #232d3c;
  --border: #2b3647;
  --text: #e5eaf1;
  --text-2: #a7b1c1;
  --text-3: #8d98aa;
  --primary: #8081f2;
  --primary-hover: #9394f6;
  --primary-soft: #212446;
  --primary-light: #4b4cb2;
  --success: #45c290;
  --success-soft: #12311f;
  --warning: #e8a652;
  --warning-soft: #372812;
  --danger: #f07a7f;
  --danger-soft: #3a1d20;
  --info: #72a6f2;
  --info-soft: #162944;
  --purple: #c49af0;
  --purple-soft: #2f2145;
  --teal: #6fd6c8;
  --teal-soft: #0b3b36;
  --side-bg: #0a0e15;
  --side-surface: #192130;
  --side-border: #202a3a;
  --side-text: #9ba6b8;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  --on-accent: #0b0f16;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
code, kbd { font-family: var(--mono); font-size: .9em; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .75rem; }
img { display: block; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side-bg) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--side-bg); color: #fff;
  display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; padding: 24px 20px 20px; z-index: 40; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius-sm); background: #fff; color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 20px; color: #fff; }
.overline { display: block; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--side-text); }
.workspace { display: flex; flex-direction: column; gap: 8px; }
.workspace-box { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--side-surface); }
.workspace-initial { width: 24px; height: 24px; border-radius: var(--radius-xs); background: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.workspace-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 500; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--side-surface); color: #fff; }
.nav-link.active { background: var(--primary); color: var(--on-accent); font-weight: 600; }
.nav-link span:first-of-type { flex: 1; }
.nav-count { font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .12); color: #fff; padding: 1px 7px; border-radius: 999px; }
.shortcut { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--side-surface); }
.shortcut strong { font-size: 14px; font-weight: 600; }
.shortcut span { font-size: 12px; line-height: 1.45; color: var(--side-text); }
.shortcut em { font-style: normal; font-size: 12px; font-weight: 600; color: #b3b4ff; }
.shortcut:hover em { text-decoration: underline; }
.shortcut-icon { color: var(--primary-light); }
.sidebar-spacer { flex: 1; min-height: 8px; }
.account { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--side-border); padding-top: 20px; }
.account-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-id strong, .account-id small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-id strong { font-size: 12px; font-weight: 600; }
.account-id small { font-size: 11px; color: var(--side-text); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 190px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13px; color: inherit; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 76px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-toggle { display: none; }
.crumbs { flex: 1; min-width: 0; display: flex; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.crumb-muted { color: var(--text-3); }
.crumb-current { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.gsearch { display: flex; align-items: center; gap: 8px; width: 240px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-3); border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.gsearch:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.gsearch input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 0 !important; min-height: 0 !important; box-shadow: none !important; font-size: 12px; }
.gsearch kbd { font-family: var(--font); font-size: 11px; color: var(--text-3); }
.content { flex: 1; }
.main-center { min-height: 100vh; }
.sidebar-backdrop { display: none; }

.page { max-width: 1204px; margin: 0 auto; padding: 24px 32px 40px; }
.page-wide { max-width: 1480px; }
.page-narrow { max-width: 780px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -.8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { color: var(--text-2); margin: 6px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; margin-bottom: 12px; }
.back-link:hover { color: var(--primary); }
.section { margin: 24px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.top-gap { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Cartes ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.stack > .panel, .ov-grid .panel, .grid-2 > .panel { margin-bottom: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.panel-action { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; }
.panel-action:hover { text-decoration: underline; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .panel-title { color: var(--danger); }

/* ---------- Indicateurs (KPI) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); }
.kpi-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.7px; line-height: 1.2; }
.kpi-value small { font-size: 16px; color: var(--text-3); font-weight: 600; letter-spacing: 0; }
.kpi-detail { font-size: 12px; color: var(--text-3); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-indigo { background: var(--primary-soft); color: var(--primary); }
.tone-blue { background: var(--info-soft); color: var(--info); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-red { background: var(--danger-soft); color: var(--danger); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-lg { height: 44px; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: var(--on-accent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-success { background: var(--success); color: var(--on-accent); }
.btn-success:hover { filter: brightness(1.07); }
.btn-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.btn-warning:hover { background: color-mix(in srgb, var(--warning) 18%, var(--surface)); }
.btn-danger { background: var(--danger); color: var(--on-accent); }
.btn-danger:hover { filter: brightness(1.07); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: color-mix(in srgb, var(--danger) 20%, var(--surface)); }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; border-radius: 8px; }
.btn-xs .icon { width: 13px; height: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-dark { color: var(--side-text); width: 28px; height: 28px; }
.icon-btn-dark:hover { background: var(--side-surface); color: #fff; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; color: var(--text-2); cursor: pointer; font: inherit; text-decoration: underline; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .grow { flex: 1 1 180px; }
.w-140 { width: 140px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 13px; color: var(--text); padding: 0; margin-bottom: 6px; }
.field > span { margin-bottom: 0; }
.field em, legend em { font-style: normal; color: var(--text-3); font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:disabled { background: var(--surface-2); color: var(--text-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.upper { text-transform: uppercase; }
.hint { color: var(--text-3); font-size: 12px; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.inline-form { display: flex; align-items: center; gap: 10px; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form select, .inline-form input[type=text] { width: auto; flex: 1 1 200px; }
.inline-form input[type=date] { width: auto; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); transition: transform .12s; }
.swatch input:checked + span { outline: 3px solid var(--pc); outline-offset: 2px; transform: scale(1.05); }
.swatch input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }

/* ---------- Alertes / flash ---------- */
.alert { border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warn { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: slide-in .25s ease-out; }
.flash-success .icon { color: var(--success); }
.flash-error .icon { color: var(--danger); }
.flash span { flex: 1; }
.flash-close { background: none; border: 0; color: var(--text-3); font-size: 18px; cursor: pointer; line-height: 1; }
.flash.hide { opacity: 0; transform: translateX(20px); transition: opacity .3s, transform .3s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Pastilles de statut (style maquette) ---------- */
.status, .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.status::before, .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-todo, .pill-neutral, .pill-new { background: var(--surface-3); color: var(--text-2); }
.status-in_progress, .pill-current { background: var(--primary-soft); color: var(--primary); }
.status-review, .pill-watch { background: var(--warning-soft); color: var(--warning); }
.status-done, .pill-ok { background: var(--success-soft); color: var(--success); }
.pill-late { background: var(--danger-soft); color: var(--danger); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.prio .icon { width: 13px; height: 13px; }
.prio-low { color: var(--text-3); }
.prio-medium { color: var(--info); }
.prio-high { color: var(--warning); }
.prio-critical { color: var(--danger); }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); letter-spacing: 0; }
.tag-ok { background: var(--success-soft); color: var(--success); }
.tag-warn { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--warning-soft); color: var(--warning); }
.role-pill { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-right: 4px; }
.role-po { background: var(--purple-soft); color: var(--purple); }
.role-dev { background: var(--info-soft); color: var(--info); }
.role-obs { background: var(--surface-3); color: var(--text-2); }
.role-admin { background: var(--primary-soft); color: var(--primary); }
.task-key { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); font-weight: 600; }

/* ---------- Avatars ---------- */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #5253d8; color: #fff; font-weight: 700; font-size: 11px; flex-shrink: 0; vertical-align: middle; }
.avatar-sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar-md { width: 34px; height: 34px; }
.avatar-empty { background: var(--surface-3); color: var(--text-3); border: 1px dashed var(--border); }
.av-0 { background: #5253d8; } .av-1 { background: #2f68c4; } .av-2 { background: #1f7f59; }
.av-3 { background: #a8651a; } .av-4 { background: #8e4ec6; } .av-5 { background: #c2414a; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 10px; margin-right: -8px; box-shadow: 0 0 0 2px var(--bg); }
.avatar-stack .avatar:last-child { margin-right: 0; }
.avatar-more { background: var(--surface-3); color: var(--text-2); }

/* Couleurs projet (classes, pas de style inline à cause de la CSP) */
.pc-0 { --pc: #5b5ce2; } .pc-1 { --pc: #0d9488; } .pc-2 { --pc: #e5484d; } .pc-3 { --pc: #f76b15; }
.pc-4 { --pc: #d6409f; } .pc-5 { --pc: #0090ff; } .pc-6 { --pc: #30a46c; } .pc-7 { --pc: #8e4ec6; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--primary)); flex-shrink: 0; }
.project-badge { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--pc); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.project-badge.sm { min-width: 0; height: 22px; font-size: 10.5px; border-radius: 6px; padding: 0 6px; vertical-align: middle; }

/* ---------- Cartes projet ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.project-card.is-archived { opacity: .65; }
.project-card-head { display: flex; align-items: center; gap: 12px; }
.project-card-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.project-card-name strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-name small { color: var(--text-3); font-size: 12px; }
.project-card-desc { color: var(--text-2); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

/* ---------- Listes de tâches ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.task-list li:first-child .task-row { border-top: 0; }
.task-row:hover .task-row-title { color: var(--primary); }
.task-row-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main strong { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkbox-box { width: 16px; height: 16px; border: 1px solid var(--border); border-radius: 4px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.checkbox-box.checked { background: var(--success); border-color: var(--success); }
.due { font-size: 11px; font-weight: 600; white-space: nowrap; }
.due-late { color: var(--danger); }
.due-soon { color: var(--warning); }
.due-muted { color: var(--text-2); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--text-3); padding: 24px 12px; }
.empty-state .icon { width: 28px; height: 28px; }
.empty-state p { margin: 0; }
.empty-state.big { padding: 56px 16px; }
.empty-state h1 { color: var(--text); font-size: 22px; }
.error-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--primary); line-height: 1; }

/* ---------- En-tête projet + onglets ---------- */
.project-head { display: flex; flex-direction: column; gap: 24px; margin-bottom: 24px; }
.project-head-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.project-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.project-info .back-link { margin-bottom: 0; }
.meta-line { display: flex; align-items: center; gap: 16px; color: var(--text-2); flex-wrap: wrap; min-height: 28px; }
.meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 12px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count { background: var(--surface-2); color: var(--text-3); font-size: 11px; padding: 2px 6px; border-radius: 999px; font-weight: 400; }
.project-desc { color: var(--text-2); margin: 0 0 20px; white-space: pre-wrap; max-width: 900px; }

/* ---------- Vue d'ensemble ---------- */
.ov-grid { display: grid; gap: 16px; margin-bottom: 24px; align-items: start; }
.ov-summary { grid-template-columns: minmax(0, 1fr) 330px; }
.ov-charts, .ov-org { grid-template-columns: minmax(0, 1fr) 360px; }
.progress-card { display: flex; align-items: center; gap: 24px; }
.ring { position: relative; width: 110px; height: 110px; flex-shrink: 0; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-track { stroke: var(--primary-soft); }
.ring-value { stroke: var(--primary); transition: stroke-dashoffset .6s ease; }
.ring-label { position: relative; font-size: 26px; font-weight: 700; }
.progress-detail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.progress-detail .overline { color: var(--text-3); letter-spacing: .6px; font-size: 12px; }
.progress-title { font-size: 22px; font-weight: 600; }
.progress-desc { font-size: 12px; color: var(--text-2); }
.trend { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.trend-up { color: var(--success); }
.trend-flat { color: var(--text-3); }
.health { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.health .panel-title { margin: 0; }
.health .pill { align-self: flex-start; }
.criteria { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.criteria li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.criteria-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.criteria-value { font-weight: 600; }
.cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.cdot-ok { background: var(--success); } .cdot-watch { background: var(--warning); } .cdot-late { background: var(--danger); } .cdot-neutral { background: var(--text-3); }
.bars { display: block; width: 100%; height: 150px; overflow: visible; }
.bar-created { fill: var(--primary-soft); }
.bar-done { fill: var(--primary); }
.bar-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-top: 6px; font-size: 10px; color: var(--text-3); text-align: center; }
.legend { display: flex; gap: 20px; font-size: 11px; margin-top: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend .l-created { background: #c9c9f6; }
.legend .l-done { background: var(--primary); }
.legend .l-done-text { color: var(--primary); }
.traj-values { display: flex; justify-content: space-between; margin-bottom: 16px; }
.traj-values span { display: block; font-size: 10px; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.traj-values strong { font-size: 24px; font-weight: 700; }
.traj-values .traj-target { font-size: 20px; font-weight: 600; color: var(--text-2); }
.traj-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.traj-bar { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 10px; font-size: 11px; color: var(--text-3); }
.note { border-radius: var(--radius-sm); padding: 12px; font-size: 12px; }
.note-ok { background: var(--success-soft); color: var(--success); }
.note-watch { background: var(--warning-soft); color: var(--warning); }
.note-late { background: var(--danger-soft); color: var(--danger); }
.note-neutral { background: var(--surface-2); color: var(--text-2); }
.milestones { list-style: none; margin: 0; padding: 0; }
.milestone { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.ms-marker { width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid transparent; color: #fff; padding: 0; cursor: default; }
.ms-marker .icon { width: 11px; height: 11px; }
.ms-ok { background: var(--success); }
.ms-current { background: var(--primary); }
.ms-late { background: var(--danger); }
.ms-neutral { background: var(--surface); border-color: var(--border); }
button.ms-marker { cursor: pointer; }
button.ms-marker:hover { box-shadow: 0 0 0 3px var(--primary-soft); }
.ms-actions { display: flex; align-items: center; gap: 2px; }
.ms-actions .icon-btn { width: 26px; height: 26px; }
.ms-actions form { margin: 0; }
.ms-delete { opacity: 0; transition: opacity .15s; }
.milestone:hover .ms-delete, .ms-delete:focus-visible { opacity: 1; }
.manage { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.manage summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--primary); list-style: none; }
.manage summary::-webkit-details-marker { display: none; }
.manage form { margin-top: 12px; }
.team-list, .feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.team-list li, .feed li { display: flex; align-items: center; gap: 10px; }
.feed li { align-items: flex-start; }
.feed-text { font-size: 11px; line-height: 1.35; }
.feed-text a { font-weight: 600; }
.feed-text a:hover { color: var(--primary); }
.feed-date { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.feed .avatar { width: 30px; height: 30px; }

/* ---------- Tableau Kanban ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--text-3); width: 16px; height: 16px; }
.search input { padding-left: 36px; width: 240px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--surface-3); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.column-head h2 { font-size: 13px; font-weight: 600; flex: 1; }
.column-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-todo .column-dot { background: var(--text-3); }
.col-in_progress .column-dot { background: var(--primary); }
.col-review .column-dot { background: var(--warning); }
.col-done .column-dot { background: var(--success); }
.count { font-size: 11px; font-weight: 600; background: var(--surface); color: var(--text-2); padding: 2px 8px; border-radius: 999px; }
.column-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; flex: 1; }
.column-empty { text-align: center; color: var(--text-2); font-size: 12px; padding: 18px 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.column.drop-allowed { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 6%, var(--surface-3)); }
.column.drop-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface-3)); }
.column.drop-denied { opacity: .55; }
.task-card { position: relative; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; border-left: 3px solid transparent; border-radius: 12px; transition: box-shadow .15s, transform .15s; }
.task-card:hover { box-shadow: var(--shadow-lg); }
.task-card[draggable=true] { cursor: grab; }
.task-card.dragging { opacity: .5; transform: rotate(1.5deg); }
.task-card.task-prio-critical { border-left-color: var(--danger); }
.task-card.task-prio-high { border-left-color: var(--warning); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.task-card-title:hover { color: var(--primary); }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.task-card-meta { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.task-card-meta .spacer { flex: 1; }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.meta .icon { width: 13px; height: 13px; }
.meta.pts { background: var(--surface-2); padding: 0 6px; border-radius: 4px; font-weight: 600; }
.overdue { color: var(--danger) !important; font-weight: 600; }
.task-card-actions { position: relative; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.center { text-align: center; }
p.hint.center { margin-top: 14px; }

/* ---------- Détail d'une tâche ---------- */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.task-header { margin-bottom: 20px; }
.task-header-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.task-title { font-size: 26px; font-weight: 700; letter-spacing: -.6px; word-break: break-word; }
.prose { white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.workflow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.workflow .panel-title { width: 100%; margin-bottom: 0; }
.workflow-form { display: flex; flex-direction: column; gap: 8px; flex: 1 1 220px; }
.workflow-form .btn { align-self: flex-start; }
.props { display: grid; grid-template-columns: 100px 1fr; gap: 14px 10px; margin: 0; }
.props dt { color: var(--text-3); font-size: 12px; padding-top: 3px; }
.props dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.props dd .muted.small { width: 100%; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; }
.timeline.compact { gap: 12px; }
.timeline.compact a { font-weight: 600; }
.timeline.compact a:hover { color: var(--primary); }
.tl-body { flex: 1; min-width: 0; }
.tl-head { line-height: 1.8; }
.comment { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---------- Membres / rôles ---------- */
.roles-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.role-card p { margin: 10px 0 0; color: var(--text-2); font-size: 13px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 9px 12px; }
.table .right { text-align: right; }
.table .right form { display: inline-block; }
.table tr.is-disabled td { opacity: .55; }
.table a.row-link:hover { color: var(--primary); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.nowrap { white-space: nowrap; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; }
.text-danger { color: var(--danger); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 32, 46, .08); }

/* ---------- Authentification ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.auth-brand { text-align: center; margin-bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--side-bg); color: #fff; }
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.auth-brand p { color: var(--text-2); margin: 0; }
.auth-foot { text-align: center; color: var(--text-3); font-size: 12px; margin: 18px 0 0; }
.secret-box { display: grid; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius-sm); margin: 16px 0; }
.secret-box div { display: flex; flex-direction: column; gap: 4px; }
.secret-box code { font-size: 16px; font-weight: 600; user-select: all; word-break: break-all; }

.muted { color: var(--text-2); }
.small { font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-summary, .ov-charts, .ov-org { grid-template-columns: minmax(0, 1fr); }
  .task-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(23, 32, 46, .45); z-index: 30; }
  .topbar .menu-toggle { display: inline-grid; margin-left: -8px; }
  .shell { background: var(--bg); }
  .topbar { height: 60px; padding: 0 16px; gap: 10px; }
  .gsearch { width: 42px; padding: 0 12px; }
  .gsearch:focus-within { width: 200px; }
  .gsearch kbd { display: none; }
  .page { padding: 20px 16px 48px; }
  .page-title { font-size: 24px; }
  .grid-2, .roles-legend { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, minmax(260px, 85vw)); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .search input { width: 100%; }
  .filters, .search { width: 100%; }
  .filters select { flex: 1; }
  .inline-form { flex-wrap: wrap; }
  .progress-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .crumb-muted { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- v3 : jalons, tickets, dépendances, import ---------- */
.menu-down .menu-pop { top: calc(100% + 6px); bottom: auto; min-width: 240px; }
.menu-down summary.btn { list-style: none; }
.tab-count-hot { background: var(--warning-soft); color: var(--warning); font-weight: 600; }
.blocked { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--danger); background: var(--danger-soft); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.blocked .icon { width: 12px; height: 12px; }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-chip .icon { width: 11px; height: 11px; flex-shrink: 0; }
.kind { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.kind .icon { width: 12px; height: 12px; }
.kind-iteration { background: var(--primary-soft); color: var(--primary); }
.kind-pi { background: var(--purple-soft); color: var(--purple); }
.kind-release { background: var(--info-soft); color: var(--info); }
.ms-list { list-style: none; margin: 0; padding: 0; }
.ms-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 120px 110px; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); }
.ms-row:first-child { border-top: 0; }
.ms-row:hover { background: var(--surface-2); }
.ms-row.child { padding-left: 48px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ms-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ms-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ms-title-line strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-title small { color: var(--text-3); font-size: 12px; }
.ms-progress { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-3); }
.ms-row .right { text-align: right; }
.backlog-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.goal { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; white-space: pre-wrap; }
.goal-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.stat-line { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-line div { display: flex; flex-direction: column; gap: 2px; }
.stat-line span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
.stat-line strong { font-size: 20px; font-weight: 700; }
.picker { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.picker label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.picker label:first-child { border-top: 0; }
.picker label:hover { background: var(--surface-2); }
.picker .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dep-list li { display: flex; align-items: center; gap: 10px; }
.dep-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dep-list li a:hover { color: var(--primary); }
.dep-list form { margin: 0; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-block { display: flex; gap: 10px; align-items: flex-start; }
.ticket-type { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.ticket-type-bug { background: var(--danger-soft); color: var(--danger); }
.ticket-type-request { background: var(--primary-soft); color: var(--primary); }
.ticket-type-question { background: var(--info-soft); color: var(--info); }
.tstatus-open { background: var(--warning-soft); color: var(--warning); }
.tstatus-accepted { background: var(--success-soft); color: var(--success); }
.tstatus-rejected { background: var(--danger-soft); color: var(--danger); }
.tstatus-closed { background: var(--surface-3); color: var(--text-2); }
.code-area { font-family: var(--mono); font-size: 12px; min-height: 320px; white-space: pre; }
.report ul { margin: 6px 0 0; padding-left: 18px; max-height: 240px; overflow-y: auto; }
.report-ok { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.file-drop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .ms-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .ms-row .hide-sm { display: none; }
  .ms-row.child { padding-left: 32px; }
}
.w-160 { width: 160px; }
.ms-progress .progress, .panel > .progress { display: block; width: 100%; flex: none; }
.task-card-meta { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
.task-card-meta .ms-chip { min-width: 0; }
.flash-stack { top: 88px; }
/* Bouton « Tout cocher / décocher » d'une catégorie d'événements */
.events-grid legend { display: flex; align-items: center; gap: 8px; }
.link-toggle { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; font-weight: 600; color: var(--primary); cursor: pointer; }
.link-toggle:hover { text-decoration: underline; }

/* ---------- v4 : colonnes personnalisées, tickets kanban, configuration ---------- */
.board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); }
.cdot-c-gray { background: #98a2b3; } .cdot-c-indigo { background: #5b5ce2; } .cdot-c-blue { background: #3c7ad9; }
.cdot-c-green { background: #26966a; } .cdot-c-amber { background: #d98b2b; } .cdot-c-red { background: #d95c61; }
.cdot-c-purple { background: #8e4ec6; } .cdot-c-teal { background: #0d9488; }
.ticket-card .ticket-card-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.resolution { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.resolution-done { background: var(--success-soft); color: var(--success); }
.resolution-rejected { background: var(--danger-soft); color: var(--danger); }
.confirm-box { border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-soft); }
.config-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.col-table td { vertical-align: middle; }
.col-table input[type=text] { min-width: 140px; }
.col-table select { width: auto; }
.inline-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-cell form { margin: 0; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.events-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
.events-grid legend { font-weight: 600; font-size: 12px; padding: 0 4px; }
.events-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin: 6px 0; cursor: pointer; }
.hook { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.hook-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hook-head strong { font-size: 15px; }
.hook-status { font-size: 12px; color: var(--text-3); }
.iter-list { list-style: none; margin: 0; padding: 0; }
.iter-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 170px 90px 110px; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.iter-row:hover { background: var(--surface-2); }
.iter-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.jalon-card { margin-bottom: 18px; }
.jalon-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; flex-wrap: wrap; }
.jalon-head a.jalon-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jalon-head a.jalon-title strong { font-size: 17px; }
.jalon-head a.jalon-title:hover strong { color: var(--primary); }
.jalon-meta { display: flex; align-items: center; gap: 14px; }
.jalon-meta .ms-progress { width: 180px; }
@media (max-width: 900px) {
  .iter-row { grid-template-columns: 26px minmax(0, 1fr) 100px; }
  .iter-row .hide-sm { display: none; }
}
@media (max-width: 900px) { .board { grid-template-columns: none; grid-auto-columns: minmax(260px, 85vw); } }
.tstatus-in_progress { background: var(--primary-soft); color: var(--primary); }
.tstatus-resolved { background: var(--info-soft); color: var(--info); }
.board { grid-auto-columns: minmax(215px, 1fr); }

/* Agents IA */
.role-agent { background: var(--teal-soft); color: var(--teal); }
.avatar-agent { background: #00796b; color: #fff; }
.avatar-agent .icon { width: 60%; height: 60%; }
.agent-mark { display: inline-flex; vertical-align: -3px; color: #00897b; }
.agent-mark .icon { width: 14px; height: 14px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.plain-list > li:last-child { border-bottom: 0; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.code-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; overflow-x: auto; white-space: pre; user-select: all; margin: 8px 0; }
.agent-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.agent-queue h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; }
.agent-queue .queue-counts { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.bulk-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 5; }
.panel.flush .panel-pad { padding: 18px 20px 12px; }
.bulk-bar select { width: auto; min-width: 240px; flex: 0 1 auto; }
.workflow-form.workflow-move { flex-direction: row; flex-wrap: wrap; align-items: center; flex: 1 1 100%; border-top: 1px solid var(--border); padding-top: 12px; }
.workflow-move select { flex: 1 1 220px; width: auto; height: auto; }
.workflow-move .btn { align-self: center; }
.panel-pad .inline-form select { min-width: 0; max-width: 100%; }
/* DoR / DoD */
.dor-dod { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dor-dod .panel { margin-bottom: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { position: relative; padding-left: 26px; line-height: 1.5; word-break: break-word; }
.checklist li::before { content: ''; position: absolute; left: 0; top: 3px; width: 15px; height: 15px; border: 1.5px solid var(--border); border-radius: 4px; background: var(--surface); }
.checklist-panel.is-focus { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
/* Double authentification */
.otp-input { font-family: var(--mono, ui-monospace, monospace); font-size: 20px; letter-spacing: 4px; max-width: 220px; }
.totp-setup { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; margin-top: 12px; }
.qr-box { width: 200px; height: 200px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.secret-key { display: inline-block; font-size: 16px; font-weight: 600; letter-spacing: 1px; background: var(--surface-2); border: 1px solid var(--border); padding: 8px 12px; border-radius: var(--radius-sm); user-select: all; word-break: break-all; }
.recovery-codes { list-style: none; padding: 16px; margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.recovery-codes code { font-size: 17px; font-weight: 600; letter-spacing: 1px; user-select: all; }
@media (max-width: 560px) { .totp-setup { grid-template-columns: 1fr; justify-items: center; } }
/* Sauvegardes */
.inline-menu { display: inline-block; text-align: left; }
form.inline { display: inline-block; margin: 0; vertical-align: middle; }
.backup-confirm { display: grid; gap: 8px; padding: 12px; min-width: 260px; }
.backup-confirm .btn { justify-content: center; background: var(--primary); color: var(--on-accent); }
.inline-menu[open] { display: block; }
.inline-menu .menu-pop.backup-confirm { position: static; margin: 8px 0 0 auto; max-width: 280px; box-shadow: none; }
/* Markdown */
.md { line-height: 1.65; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md h3, .md h4, .md h5 { margin: 16px 0 8px; line-height: 1.3; }
.md h3 { font-size: 17px; } .md h4 { font-size: 15px; } .md h5 { font-size: 14px; color: var(--text-2); }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md li.md-task { list-style: none; margin-left: -20px; }
.md li.md-task.is-done { color: var(--text-3); }
.md .md-box { display: inline-block; width: 18px; }
.md code { font-family: var(--mono, ui-monospace, monospace); font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; margin: 0 0 10px; }
.md pre code { background: none; padding: 0; font-size: 12.5px; }
.md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--border); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.md a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.md-hint { font-size: 12px; color: var(--text-3); }
/* DoD cochable */
.checklist.dod-list li.is-checked::before { background: var(--success); border-color: var(--success); }
.checklist.dod-list li.is-checked::after { content: '✓'; position: absolute; left: 3px; top: 0; color: var(--on-accent); font-size: 12px; font-weight: 700; }
.checklist.dod-list li:has(.dod-form) { padding-left: 0; }
.checklist.dod-list li:has(.dod-form)::before, .checklist.dod-list li:has(.dod-form)::after { display: none; }
.dod-form { margin: 0; }
.dod-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.dod-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--success); flex-shrink: 0; }
.dod-list li.is-checked .dod-check span { color: var(--text-3); text-decoration: line-through; }
.panel-title .tag { margin-left: 8px; vertical-align: middle; }
/* Pièces jointes */
.attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.att-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-2); }
.att-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--text-3); flex-shrink: 0; }
.att-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.att-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.att-name:hover { color: var(--primary); }
.attach-form input[type=file] { max-width: 100%; font-size: 13px; }
/* Notifications */
.topbar .bell { position: relative; margin-left: 8px; flex-shrink: 0; }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif-link { display: flex; flex-direction: column; gap: 3px; padding: 12px 18px; color: var(--text); }
.notif-link:hover { background: var(--surface-2); }
.notif.is-unread .notif-link { background: color-mix(in srgb, var(--primary) 6%, transparent); box-shadow: inset 3px 0 0 var(--primary); }
.notif-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.notif-kind.kind-mention, .notif-kind.kind-rejected { color: var(--danger); }
.notif-kind.kind-validated { color: var(--success); }
.notif-kind.kind-review { color: var(--warning); }
.notif-body { color: var(--text-2); font-size: 13px; }
.small-tabs { margin-bottom: 12px; }
.mention { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mention.is-me { background: var(--primary); color: var(--on-accent); }
a.task-ref { font-family: var(--mono, ui-monospace, monospace); font-size: .92em; font-weight: 600; text-decoration: none; }
.md ul { list-style: disc; } .md ol { list-style: decimal; } .md ul ul { list-style: circle; }
.md ul > li, .md ol > li { list-style: inherit; }
.md ul > li, .md ol > li { display: list-item; }
/* Liens de développement */
.dev-links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.dev-links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-links a { font-weight: 600; color: var(--primary); word-break: break-all; }
.tag.dev-pr { background: var(--purple-soft); color: var(--purple); }
.tag.dev-commit { background: var(--surface-3); color: var(--text-2); }
.tag.dev-branch { background: var(--success-soft); color: var(--success); }
.branch-name { background: var(--surface-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; user-select: all; }
#dev .inline-form input[type=url] { flex: 2 1 260px; }
#dev .inline-form input[type=text] { flex: 1 1 160px; }
/* Exécutions des agents */
.run-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.run-kpi { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.run-kpi-value { font-size: 20px; font-weight: 700; }
.run-kpi-label { font-size: 12px; color: var(--text-3); }
.agent-usage { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); }
/* Découpage proposé */
.is-focus-panel { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.proposals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proposal { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.proposal > input { margin-top: 4px; width: 16px; height: 16px; flex-shrink: 0; }
.proposal-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.proposal .checklist { margin: 4px 0; }
.proposal-body > .tag { align-self: flex-start; }
.notif-prefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
/* Accessibilité */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-accent); font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 12px; outline: 2px solid var(--text); outline-offset: 2px; }
main:focus { outline: none; }
.agent-queue-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; }
.nav-link:focus-visible, .tab:focus-visible, .task-card a:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar .nav-link:focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Jetons d'API personnels */
.table tr.is-muted td { color: var(--text-3); }
.t-right { text-align: right; }
/* Colonnes longues : cartes limitées, lien pour tout afficher */
.column-more { display: block; text-align: center; padding: 8px; margin-top: 4px; border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.column-more:hover, .column-more:focus-visible { color: var(--text); }
.column-more:hover { background: var(--surface); }
/* Types et étiquettes de tâches */
.ttype { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--text-3); }
.ttype-bug { color: var(--danger); } .ttype-feature { color: var(--primary); } .ttype-improvement { color: var(--success); }
.label-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.label { --lc: #98a2b3; display: inline-flex; align-items: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.6;
  background: color-mix(in srgb, var(--lc) 16%, var(--surface)); color: color-mix(in srgb, var(--lc) 55%, var(--text)); border: 1px solid color-mix(in srgb, var(--lc) 35%, transparent); }
.label-c-gray { --lc: #98a2b3; } .label-c-indigo { --lc: #5b5ce2; } .label-c-blue { --lc: #3c7ad9; } .label-c-green { --lc: #26966a; }
.label-c-amber { --lc: #d98b2b; } .label-c-red { --lc: #d95c61; } .label-c-purple { --lc: #8e4ec6; } .label-c-teal { --lc: #0d9488; }
.label-more { --lc: #98a2b3; }
.label-picker { border: 0; padding: 0; margin: 0; }
.label-picker legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.label-picker legend em { font-weight: 400; color: var(--text-3); font-style: normal; }
.label-picker .checks { flex-direction: row; flex-wrap: wrap; gap: 8px 14px; }
.label-admin { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid var(--border); }
.label-row-flush { margin-top: 0; }
/* Sous-tâches */
.parent-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.parent-link:hover { color: var(--text); }
.subtask-list { list-style: none; margin: 10px 0 0; padding: 0; }
.subtask-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.subtask-list li:last-child { border-bottom: 0; }
.subtask-list .spacer { flex: 1; }
.sub-chip { display: inline-flex; align-items: center; gap: 3px; }
.parent-chip { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
/* Graphiques (burndown, vélocité) — SVG sans style en ligne (CSP) */
.chart { margin: 0; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-tick { fill: var(--text-3); font-size: 9px; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-ideal { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-today { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-bar { fill: var(--primary); }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: color-mix(in srgb, var(--primary) 10%, transparent); }
.legend .l-line { background: var(--primary); height: 2px; width: 14px; border-radius: 1px; }
.legend .l-bar { background: var(--primary); }
.legend .l-ideal { background: none; border-top: 2px dashed var(--text-3); height: 0; width: 14px; border-radius: 0; }
.chart-table { margin-top: 10px; font-size: 12px; }
.chart-table summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.table-compact td, .table-compact th { padding: 6px 10px; }
/* Recherche plein texte */
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li + li { border-top: 1px solid var(--border); }
.search-hit { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; color: inherit; }
.search-hit:hover, .search-hit:focus-visible { background: var(--surface-2); }
.search-hit-head { display: flex; align-items: baseline; gap: 6px; }
.search-hit-title { font-weight: 600; }
.search-hit-snippet { font-size: 12.5px; color: var(--text-2); }
.search-hit-meta { display: flex; gap: 10px; align-items: center; }
.search-hit mark { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--text); font-weight: 600; border-radius: 2px; padding: 0 1px; }
.direct-hit { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.toolbar.filters { margin-bottom: 16px; }
/* Temps réel */
.live-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13px; max-width: calc(100vw - 32px); }
