/* =========================================================
   Pilotage Dotit – thème « verre dépoli » rouge et noir
   ========================================================= */

/* ---------- Thème sombre (par défaut) ---------- */
:root, :root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-grad:
    radial-gradient(1200px 700px at 8% -10%, rgba(220, 38, 38, .35), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(127, 29, 29, .22), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(185, 28, 28, .25), transparent 60%),
    linear-gradient(160deg, #140808 0%, #050505 100%);
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .10);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .18);
  --panel: rgba(22, 14, 14, .97);
  --fg: #fff5f5;
  --muted: #c4b0b0;
  --line: rgba(255, 255, 255, .09);
  --track: rgba(255, 255, 255, .08);
  --input: rgba(255, 255, 255, .06);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --c0: #ef4444;
  --c1: #d4d4d8;
  --ok: #4ade80; --warn: #fbbf24; --bad: #ff7a7a;
  --accent-grad: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
  --radius: 16px;
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

/* ---------- Thème clair ---------- */
:root[data-theme="light"] {
  --bg: #fff5f5;
  --bg-grad:
    radial-gradient(1100px 650px at 5% -10%, rgba(239, 68, 68, .35), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(252, 165, 165, .35), transparent 60%),
    linear-gradient(160deg, #fffafa 0%, #fee9e9 100%);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .85);
  --glass-border: rgba(185, 28, 28, .14);
  --glass-hi: rgba(255, 255, 255, .95);
  --panel: rgba(255, 255, 255, .98);
  --fg: #1a0a0a;
  --muted: #7a5f5f;
  --line: rgba(127, 29, 29, .10);
  --track: rgba(127, 29, 29, .08);
  --input: rgba(255, 255, 255, .9);
  --shadow: 0 10px 30px rgba(127, 29, 29, .10);
  --c0: #dc2626; --c1: #404040;
  --ok: #16a34a; --warn: #b45309; --bad: #e11d48;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5;
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(239, 68, 68, .35); }
a { color: inherit; }

/* ---------- Mise en page : menu latéral + contenu ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: 0 0 248px;
  display: flex; flex-direction: column; gap: 24px; padding: 22px 16px;
  background: var(--glass); border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-logo {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 6px 18px rgba(220, 38, 38, .45);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt strong { font-size: .98rem; }
.brand-txt small { color: var(--muted); font-size: .75rem; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: .72rem; color: var(--muted); }
.side-note { padding: 0 8px; }
.user-box { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-border); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--accent-grad); color: #fff; font-weight: 700; font-size: .9rem; }
.user-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-txt strong { color: var(--fg); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.small { width: 32px; height: 32px; margin-left: auto; flex: 0 0 32px; }

.tabs { display: flex; flex-direction: column; gap: 4px; }
.tabs a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.tabs a svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:hover { color: var(--fg); background: var(--glass-strong); }
.tabs a.active {
  color: var(--fg); background: linear-gradient(135deg, rgba(220, 38, 38, .32), rgba(127, 29, 29, .18));
  border-color: var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.tabs a.active svg { stroke: var(--c0); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--glass-border);
}
.search {
  flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--c0); box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.search svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: .9rem; }
.search input::placeholder { color: var(--muted); }
.search kbd { font: inherit; font-size: .7rem; color: var(--muted); border: 1px solid var(--glass-border); border-radius: 6px; padding: 1px 6px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; margin-left: auto; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 28px 56px; display: flex; flex-direction: column; gap: 22px; }
.vue:not([hidden]) { display: flex; flex-direction: column; gap: 22px; animation: apparition .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes apparition { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Titres et en-têtes ---------- */
h1 { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--fg) 30%, var(--c0) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 4px; }
h3 { font-size: .92rem; font-weight: 650; margin: 16px 0 6px; color: var(--muted); }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; }
.lead { color: var(--muted); margin: 8px 0 0; max-width: 780px; }
.lead b { color: var(--fg); font-weight: 650; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .84rem; color: var(--muted); }
.controls label { display: flex; align-items: center; gap: 6px; }
.meta { font-size: .78rem; }
.note { font-size: .8rem; color: var(--muted); margin: 0 0 14px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- Contrôles ---------- */
select, button { font: inherit;
  color: var(--fg); background: var(--glass); border: 1px solid var(--glass-border); border-radius: 10px;
  padding: 7px 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
}
select option { background: var(--panel); color: var(--fg); }
button { cursor: pointer; font-weight: 550; }
button:hover, select:hover { background: var(--glass-strong); border-color: var(--glass-hi); }
button:active { transform: scale(.97); }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(220, 38, 38, .35); }
button.primary:hover { box-shadow: 0 8px 24px rgba(220, 38, 38, .5); filter: brightness(1.06); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
button.mini { padding: 3px 10px; font-size: .76rem; border-radius: 999px; }
input[type="checkbox"] { accent-color: var(--c0); }
.check { display: flex; align-items: center; gap: 6px; }

/* ---------- Bandeaux ---------- */
.banner {
  background: color-mix(in srgb, var(--warn) 12%, var(--glass)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--fg); border-radius: 12px; padding: 10px 14px; font-size: .88rem; backdrop-filter: blur(12px); margin: 0;
}
.banner.err { background: color-mix(in srgb, var(--bad) 12%, var(--glass)); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

/* ---------- Cartes en verre ---------- */
.card {
  position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
}
.card:hover { border-color: var(--glass-hi); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpis .card { padding: 18px 18px 16px; overflow: hidden; }
.kpis .card::after {
  content: ""; position: absolute; right: -50px; bottom: -70px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, .22), transparent 70%); pointer-events: none;
}
.kpis .card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(127, 29, 29, .35), inset 0 1px 0 var(--glass-hi); }
.kpi-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; margin-bottom: 12px; color: #fff; }
.kpi-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-ico.g1 { background: linear-gradient(135deg, #dc2626, #991b1b); box-shadow: 0 6px 16px rgba(185, 28, 28, .4); }
.kpi-ico.g2 { background: linear-gradient(135deg, #ef4444, #7f1d1d); box-shadow: 0 6px 16px rgba(127, 29, 29, .4); }
.kpi-ico.g3 { background: linear-gradient(135deg, #f87171, #b91c1c); box-shadow: 0 6px 16px rgba(248, 113, 113, .4); }
.kpi-ico.g4 { background: linear-gradient(135deg, #f59e0b, #b91c1c); box-shadow: 0 6px 16px rgba(251, 113, 133, .4); }
.kpi-ico.g5 { background: linear-gradient(135deg, #737373, #262626); box-shadow: 0 6px 16px rgba(163, 163, 163, .35); }
.lbl { display: block; font-size: .78rem; color: var(--muted); font-weight: 550; }
.val { display: block; font-size: 2rem; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.val.small { font-size: 1.55rem; }

/* ---------- Graphiques ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.sw0 { background: var(--c0); } .sw1 { background: var(--c1); } .sw.swbad { background: var(--bad); } .sw.swmuted { background: var(--muted); }
.chart svg { display: block; width: 100%; }
.chart text { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart text.name { fill: var(--fg); }
.chart text.name.active { font-weight: 700; fill: var(--c0); }
.chart .hit { cursor: pointer; }
.chart .hit:hover { fill: rgba(239, 68, 68, .10) !important; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr minmax(110px, auto); align-items: center; gap: 12px; font-size: .85rem; }
.hbar-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.hbar-seg { height: 100%; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.c0-bg { background: linear-gradient(90deg, #991b1b, var(--c0)); }
.c1-bg { background: linear-gradient(90deg, #737373, var(--c1)); }
.ok-bg { background: linear-gradient(90deg, #22c55e, var(--ok)); }
.bad-bg { background: linear-gradient(90deg, #f43f5e, var(--bad)); }
.muted-bg { background: var(--muted); }

.bar { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.bar .track { flex: 1; height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent-grad); border-radius: 999px; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.bar .pct { width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; font-size: .84rem; }

/* ---------- Tableaux ---------- */
.scroll { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; }
table.wide { min-width: 980px; }
.grid2 table { min-width: 460px; }
th {
  text-align: left; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background .15s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(239, 68, 68, .08); }
tbody tr:hover td:first-child { border-radius: 10px 0 0 10px; }
tbody tr:hover td:last-child { border-radius: 0 10px 10px 0; }
tr.clickable { cursor: pointer; }
tr.clickable td:first-child { color: var(--c0); font-weight: 650; }
tr.clickable:focus-visible { outline: 2px solid var(--c0); outline-offset: -2px; }
tr.filtre-off, .kb-card.filtre-off { display: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.empty td { color: var(--muted); }
.keys { font-size: .78rem; color: var(--muted); }
.sub { display: block; font-size: .76rem; }
td a { color: var(--c0); text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }

.bad { color: var(--bad); } .warn { color: var(--warn); } .ok { color: var(--ok); }
.pill {
  display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent);
}

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 22px; }
.defs { font-size: .8rem; color: var(--muted); }
.defs summary { cursor: pointer; }
.defs li { margin: 4px 0; }

/* Infobulle */
.tip {
  position: fixed; pointer-events: none; z-index: 20; max-width: 260px; padding: 9px 12px; font-size: .8rem;
  background: var(--panel); border: 1px solid var(--glass-border); border-radius: 12px; box-shadow: var(--shadow);
}
.tip strong { display: block; } .tip span { display: block; color: var(--muted); }
.loading .val, .loading tbody { opacity: .55; transition: opacity .2s; }

/* ---------- Fenêtre de saisie ---------- */
dialog {
  border: 1px solid var(--glass-border); border-radius: 20px; background: var(--panel); color: var(--fg);
  padding: 0; width: min(740px, 94vw); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
dialog[open] { animation: zoom .25s cubic-bezier(.2, .7, .2, 1); }
@keyframes zoom { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(12, 6, 30, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--muted); font-weight: 550; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  font: inherit; font-size: .94rem; color: var(--fg); background: var(--input); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 8px 10px; transition: border-color .2s, box-shadow .2s;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 0; border-color: var(--c0); box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dlg-actions .spacer { flex: 1; }

/* ---------- Écrans étroits : menu en haut ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 6; height: auto; width: 100%; flex: none; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--glass-border); }
  .brand-txt, .side-note, .user-txt { display: none; }
  .side-foot { margin: 0 0 0 auto; }
  .user-box { padding: 4px; background: transparent; border: 0; }
  .brand-logo { width: 34px; height: 34px; }
  .tabs { flex-direction: row; overflow-x: auto; }
  .tabs a { padding: 8px 10px; font-size: .85rem; white-space: nowrap; }
  .topbar { position: static; padding: 10px 14px; }
  .search kbd { display: none; }
  .wrap { padding: 18px 14px 40px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  h1 { font-size: 1.4rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .val { font-size: 1.5rem; } .val.small { font-size: 1.15rem; }
  .card { padding: 14px; }
  .hbar { grid-template-columns: 80px 1fr auto; }
}

/* Moins d'animations si Windows le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Fenêtre ticket ---------- */
#dlg-ticket .form-grid > div.champ-groupe { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 550; }
#dlg-ticket.creation #tk-temps-box { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--input); color: var(--fg); font-size: .82rem; cursor: pointer; transition: background .2s, border-color .2s; }
.chip:has(input:checked) { background: color-mix(in srgb, var(--c0) 22%, transparent); border-color: var(--c0); }
.chip input { accent-color: var(--c0); margin: 0; }
fieldset.temps { border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
fieldset.temps legend { padding: 0 6px; font-size: .82rem; font-weight: 650; color: var(--fg); }
fieldset.temps button { align-self: flex-start; }
.lien-jira { color: var(--c0); text-decoration: none; font-size: .85rem; font-weight: 600; }
.banner.ok-msg { background: color-mix(in srgb, var(--c0) 12%, var(--glass)); border-color: color-mix(in srgb, var(--c0) 40%, transparent); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--accent-grad); color: #fff; font-weight: 600; box-shadow: 0 12px 30px rgba(220, 38, 38, .45); animation: zoom .25s; transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label.chip { flex-direction: row; gap: 6px; font-size: .82rem; color: var(--fg); font-weight: 500; }
dialog { max-height: 92vh; overflow: hidden; } /* un seul défilement : celui du formulaire */
dialog form { max-height: 92vh; overflow-y: auto; }

.pill.c0 { color: var(--c0); }

/* ---------- Tableau façon Jira ---------- */
/* Hauteur fixe : défilement horizontal pour tout le tableau, vertical pour chaque colonne */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 14px; overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; height: calc(100vh - 250px); min-height: 380px; }
.kb-col { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; transition: border-color .2s, background .2s; }
.kb-col.over { border-color: #ef4444; background: var(--glass-strong); }
.kb-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .86rem; text-transform: uppercase; letter-spacing: .03em; }
.kb-col.cat-done .kb-head { color: var(--ok); }
.kb-n { background: var(--track); border-radius: 999px; padding: 1px 9px; font-size: .78rem; color: var(--muted); }
.kb-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.kb-head { flex: 0 0 auto; }
.kb-body, .kb { scrollbar-width: thin; scrollbar-color: var(--c0) transparent; }
.kb-vide { color: var(--muted); font-size: .82rem; text-align: center; margin: 14px 0; }
.kb-card { background: var(--panel); border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.kb-card:hover, .kb-card:focus-visible { transform: translateY(-2px); border-color: var(--glass-hi); outline: none; }
.kb-card.drag { opacity: .4; cursor: grabbing; }
.kb-top { display: flex; justify-content: space-between; gap: 8px; font-size: .74rem; color: var(--muted); }
.kb-key { font-weight: 700; }
.kb-client { background: rgba(220, 38, 38, .22); border-radius: 999px; padding: 0 8px; }
.kb-titre { margin: 6px 0 8px; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.kb-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .74rem; color: var(--muted); }
.kb-qui { flex: 1 1 100%; }
.kb-ech.bad { color: var(--bad); font-weight: 600; }
.toast-err { background: var(--bad); color: #fff; }

/* ---------- Parcours d'un dossier commercial ---------- */
.parcours { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.parcours li { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.parcours li + li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--track); z-index: 0; }
.parcours li.p-passee + li::before, .parcours li.p-courante::before { background: var(--ok); }
.parcours li.p-echec::before { background: var(--bad); }
.p-pt { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .78rem; font-weight: 700; border: 2px dashed var(--muted); color: var(--muted); background: var(--panel); }
.p-passee .p-pt { border: 2px solid var(--ok); background: var(--ok); color: #052e16; }
.p-courante .p-pt { border: 2px solid var(--c0); background: var(--accent-grad); color: #fff; box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); }
.p-echec .p-pt { border: 2px solid var(--bad); background: var(--panel); color: var(--bad); box-shadow: 0 0 0 4px rgba(255, 122, 122, .2); }
.p-nom { font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; }
.p-a-venir .p-nom, .p-a-venir .p-date { color: var(--muted); font-weight: 400; }
.p-echec .p-nom, .p-echec .p-date { color: var(--bad); }
.p-courante .p-nom { color: var(--c0); }
.p-date { font-size: .72rem; color: var(--muted); }
.parcours.compact { min-width: 150px; }
.parcours.compact li + li::before { top: 9px; }
.parcours.compact .p-pt { width: 20px; height: 20px; font-size: .66rem; border-width: 1.5px; }
.p-cell { display: flex; flex-direction: column; gap: 4px; }
.p-motif { color: var(--bad); font-size: .74rem; max-width: 260px; }
.parcours-box { display: flex; flex-direction: column; gap: 14px; padding: 14px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass); }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Gestion des accès ---------- */
.a-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a[hidden] { display: none; }
.form-grid > label.chip { align-self: end; justify-self: start; }
