/* Dossilia — style minimaliste « Apple » : beaucoup d'air, grands titres, cartes douces, boutons en pilule, gris ardoise discrets. */
:root { --sl-900:#14202e; --sl-700:#26374a; --sl-600:#3d5068; --sl-500:#51647a; --sl-300:#d8e0ea; --sl-200:#e3e9f1; --sl-100:#e9eff7; --sl-50:#f4f7fb; --ap-bg:#f4f7fb; --mint:#1f8a63; --mint-soft:#e1f3ec; --blue:#1d4f91; --blue-soft:#e4edf8; }
body, body:has(.ap) { background: var(--ap-bg) !important; --bs-body-bg: var(--ap-bg); }
main.container { max-width: 1120px; padding-top: 2rem; padding-bottom: 3rem; }
/* barre de navigation : verre dépoli clair */
.navbar-portal { background: rgba(255,255,255,.9) !important; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--sl-300) !important; box-shadow: none; position: sticky; top: 0; z-index: 1030; }
.navbar-portal .navbar-brand, .navbar-portal .navbar-brand.text-primary { color: var(--sl-900) !important; letter-spacing: -.02em; }
.navbar-portal .nav-link { color: var(--sl-700) !important; font-weight: 500; opacity: 1; }
.navbar-portal .nav-link:hover, .navbar-portal .nav-link:focus { background: var(--sl-100); color: var(--blue) !important; }
.navbar-portal .nav-link.active, .navbar-portal .nav-link.show { background: var(--blue-soft); color: var(--blue) !important; font-weight: 700; }
.navbar-portal .navbar-toggler { border-color: rgba(0,0,0,.15); }
.navbar-portal .navbar-toggler-icon { filter: none; }
/* cartes */
.card, .ap .card { border: 0 !important; border-radius: 22px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 30px rgba(0,0,0,.04) !important; }
.card-header { background: transparent !important; color: inherit !important; border-bottom: 1px solid var(--sl-200); font-weight: 600; }
.card-footer { background: transparent !important; border-top: 1px solid var(--sl-200); }
.card-body { padding: 1.5rem; }
/* titres */
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; color: var(--sl-900); }
h2 { font-size: 1.4rem; font-weight: 650; letter-spacing: -.02em; color: var(--sl-900); }
h3 { color: var(--sl-900); }
.text-body-secondary { color: var(--sl-500) !important; }
/* tables : aérées, sans cadre */
.table thead th, .table > thead > tr > th { background: transparent !important; color: var(--sl-500); border-bottom: 1px solid var(--sl-200); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.table > :not(caption) > * > * { padding: .95rem .6rem; border-color: var(--sl-100); }
.table-hover > tbody > tr:hover > * { background: var(--sl-50); }
hr { border-color: var(--sl-200); opacity: 1; }
.form-control, .form-select { border-color: var(--sl-300); border-radius: 12px; }
.form-label { font-weight: 500; color: var(--sl-700); }
.btn-primary { border-radius: 980px; }
.bg-light, .bg-body-tertiary { background: var(--sl-50) !important; }
/* ===== Tableau de bord ===== */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.dash-head h1 { margin: 0; }
.dash-sub { margin: .4rem 0 0; font-size: 1.1rem; color: var(--sl-500); }
.dash-head .btn-lg { padding: .75rem 1.6rem; font-size: 1rem; box-shadow: 0 6px 18px rgba(29,79,145,.22); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.kpi { background: #fff; border-radius: 20px; padding: 1.25rem 1.4rem; display: grid; gap: .3rem; box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 30px rgba(0,0,0,.04); }
.kpi b { font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--sl-900); }
.kpi span { font-size: .85rem; color: var(--sl-500); line-height: 1.3; }
.kpi.warn b { color: #8a5a00; }
.kpi:first-child b { color: var(--blue); }
.kpi { border-top: 3px solid var(--sl-100); } .kpi:first-child { border-top-color: var(--blue); } .kpi.warn { border-top-color: #e8b04a; }
.list-card .card-body { padding: 1.25rem 1.5rem 1.5rem; }
.seg { display: inline-flex; background: var(--sl-100); border-radius: 980px; padding: 3px; }
.seg a { padding: .3rem 1rem; border-radius: 980px; font-size: .88rem; font-weight: 500; color: var(--sl-600); text-decoration: none; }
.seg a.on { background: #fff; color: var(--sl-900); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.filt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.filt-bar .form-control { flex: 1 1 220px; max-width: 320px; background: var(--sl-50); border-color: transparent; }
.filt-bar .form-select { flex: 0 1 190px; background-color: var(--sl-50); border-color: transparent; }
.filt-bar .btn-outline-primary { background: var(--sl-100); border-color: transparent; color: var(--sl-700); }
.filt-bar .btn-outline-primary:hover { background: var(--sl-200); color: var(--sl-900); }
.filt-bar a { color: var(--sl-500); }
/* ===== Création de dossier (feuille modale) ===== */
.nd-dialog { max-width: 560px; }
#nd .modal-content { border-radius: 26px; padding: 0; overflow: hidden; }
.nd { padding: 1.4rem 1.75rem 1.75rem; }
.nd-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.nd-dots { display: flex; gap: .4rem; }
.nd-dots i { width: 26px; height: 4px; border-radius: 4px; background: var(--sl-200); transition: background .2s; }
.nd-dots i.on { background: var(--bs-primary, #1d4f91); }
.nd h2 { font-size: 1.65rem; letter-spacing: -.03em; margin: 0 0 .35rem; }
.nd-sub { color: var(--sl-500); margin: 0 0 1.1rem; }
.nd-find { margin-bottom: .75rem; background: var(--sl-50); border-color: transparent; }
.nd-list { display: grid; gap: .55rem; max-height: min(52vh, 420px); overflow: auto; padding: 2px; }
.nd-opt { position: relative; display: flex; align-items: center; gap: .75rem; padding: .95rem 1.1rem; border-radius: 16px; background: var(--sl-50); cursor: pointer; transition: background .12s, box-shadow .12s, transform .12s; margin: 0; font-weight: 400; }
.nd-opt:hover { background: var(--sl-100); }
.nd-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.nd-opt span { display: grid; gap: .1rem; }
.nd-opt b { font-weight: 600; color: var(--sl-900); }
.nd-opt small { color: var(--sl-500); font-size: .82rem; }
.nd-opt::after { content: "›"; margin-left: auto; font-size: 1.4rem; color: var(--sl-300); line-height: 1; }
.nd-opt:has(input:checked) { background: #fff; box-shadow: 0 0 0 2px var(--bs-primary, #1d4f91); }
.nd-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(29,79,145,.35); }
.nd-opt.is-off { opacity: .5; cursor: not-allowed; } .nd-opt.is-off input { cursor: not-allowed; }
.nd-fields { display: grid; gap: .9rem; }
.nd-opt-tag { font-weight: 400; color: var(--sl-500); font-size: .82rem; margin-left: .25rem; }
.nd-more { margin-top: 1rem; } .nd-more > summary { cursor: pointer; color: var(--bs-primary, #1d4f91); font-weight: 500; list-style: none; } .nd-more > summary::-webkit-details-marker { display: none; }
.nd-more > summary::after { content: " ›"; }
.nd-more[open] > summary::after { content: " ⌄"; }
.nd-err { color: #b3261e; margin: .9rem 0 0; font-size: .92rem; }
.nd-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.nd-foot .nd-go { margin-left: auto; }
.nd-foot .nd-back { padding-left: 0; color: var(--sl-600); text-decoration: none; }
@media (max-width: 575px) { .nd { padding: 1.1rem 1.1rem 1.4rem; } .dash-head .btn-lg { width: 100%; } }
@media print { body { background: #fff !important; } }

/* Palette de la page d'accueil : bleu #1d4f91, menthe #1f8a63, ardoise #26374a */
.badge.text-bg-success, .pill-ok, .ap-pill.ap-on { background: var(--mint-soft) !important; color: #136048 !important; }
.btn-primary { --bs-btn-bg: #1d4f91; --bs-btn-border-color: #1d4f91; --bs-btn-hover-bg: #173f74; --bs-btn-hover-border-color: #173f74; }
.dash-head h1 .ic { color: var(--mint); }
.seg { background: var(--sl-100); } .seg a.on { color: var(--blue); }
.nd-opt:has(input:checked) { box-shadow: 0 0 0 2px var(--mint); } .nd-dots i.on { background: var(--mint); }
.nd-opt:has(input:checked)::after { content: "✓"; color: var(--mint); font-weight: 700; }
.card, .kpi { box-shadow: 0 1px 2px rgba(38,55,74,.05), 0 8px 28px rgba(38,55,74,.06) !important; }
.table-hover > tbody > tr:hover > * { background: var(--sl-50); }
a { color: var(--blue); }
.navbar-portal .navbar-brand { color: var(--sl-700) !important; }

/* ===== Kanban : colonnes colorées, étiquettes, progression ===== */
.kanban { gap: 1rem; padding: .25rem .1rem 1rem; }
.kcol { flex: 0 0 290px; background: color-mix(in srgb, var(--kc) 7%, #f4f7fb); border: 1px solid color-mix(in srgb, var(--kc) 16%, #e3e9f1); border-top: 4px solid var(--kc); border-radius: 16px; padding: .7rem; }
.kcol.kover { outline: 2px dashed var(--kc); outline-offset: 2px; background: color-mix(in srgb, var(--kc) 13%, #fff); }
.kh { font-size: .8rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: color-mix(in srgb, var(--kc) 70%, #14202e); margin: .15rem .2rem .75rem; }
.kh-l { display: inline-flex; align-items: center; gap: .5rem; }
.kdot { width: 9px; height: 9px; border-radius: 50%; background: var(--kc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc) 22%, transparent); }
.kn { min-width: 1.6rem; text-align: center; padding: .12rem .5rem; border-radius: 999px; background: var(--kc); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: 0; }
.kbody { gap: .65rem; }
.kcard { position: relative; background: #fff; border: 1px solid #e3e9f1; border-radius: 12px; padding: .75rem .85rem .7rem; box-shadow: 0 1px 2px rgba(20,32,46,.05), 0 6px 16px rgba(20,32,46,.05); transition: transform .12s ease, box-shadow .12s ease; }
.kcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,32,46,.06), 0 12px 26px rgba(20,32,46,.1); }
.kc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.kc-top a { color: #14202e; text-decoration: none; line-height: 1.25; } .kc-top a:hover { color: var(--blue); }
.kav { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--kc); color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.kcol .kav { background: color-mix(in srgb, var(--kc) 85%, #14202e); }
.kc-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .55rem 0 .6rem; }
.ktag { font-size: .7rem; font-weight: 600; line-height: 1; padding: .3rem .55rem; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ktag-prog { background: #e6eefa; color: #1d4f91; } .ktag-date { background: #eef2f6; color: #3d5068; } .ktag-late { background: #fde8e8; color: #b42318; } .ktag-q { background: #e1f3ec; color: #17694b; }
.kprog { height: 6px; background: #e9eff7; border-radius: 99px; overflow: hidden; } .kprog span { display: block; height: 100%; background: linear-gradient(90deg, var(--kc), color-mix(in srgb, var(--kc) 60%, #fff)); border-radius: 99px; }
.kprog-l { font-size: .68rem; color: #51647a; margin: .25rem 0 .1rem; }
.kcard .form-select-sm { font-size: .78rem; padding: .35rem 2rem .35rem .6rem; border-radius: 9px; background-color: #f4f7fb; border-color: transparent; }
.st-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 650; color: color-mix(in srgb, var(--kc) 78%, #14202e); background: color-mix(in srgb, var(--kc) 12%, #fff); border: 1px solid color-mix(in srgb, var(--kc) 22%, #fff); white-space: nowrap; }
.st-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--kc); }

/* ===== Champs de formulaire plus raffinés ===== */
.form-label { font-size: .8rem; font-weight: 600; color: var(--sl-600); letter-spacing: .01em; margin-bottom: .35rem; }
.form-control, .form-select, textarea.form-control { min-height: 46px; padding: .65rem .95rem; border: 1.5px solid #d8e0ea; border-radius: 12px; background-color: #fbfcfe; color: #14202e; font-size: .95rem; box-shadow: inset 0 1px 0 rgba(20,32,46,.02); transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.form-control::placeholder { color: #98a6b8; }
.form-control:hover, .form-select:hover { border-color: #b9c6d6; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,79,145,.14); outline: 0; }
.form-select { padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2351647a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m3 6 5 5 5-5'/%3e%3c/svg%3e"); background-size: 14px; background-position: right .95rem center; }
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 10px; font-size: .85rem; }
.form-control:disabled, .form-select:disabled { background-color: #eef2f6; color: #7b8aa0; }
.form-check-input { width: 1.2em; height: 1.2em; border: 1.5px solid #b9c6d6; }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(29,79,145,.14); border-color: var(--blue); }
.input-group > .form-control, .input-group > .form-select { border-radius: 12px; } .input-group-text { background: #eef2f6; border: 1.5px solid #d8e0ea; color: #51647a; border-radius: 12px; }
.btn { border-radius: 12px; font-weight: 600; }

/* ---------- Discussions d'équipe ---------- */
.chat-main { max-width: 1240px; }
.chat { display: grid; grid-template-columns: 290px 1fr; height: min(720px, calc(100vh - 230px)); min-height: 460px; overflow: hidden; margin-top: 1.25rem; }
.chat-side { border-right: 1px solid var(--sl-200); background: var(--sl-50); display: flex; flex-direction: column; overflow-y: auto; padding: .75rem .5rem 1rem; min-height: 0; }
.chat-side-top { padding: 0 .35rem .6rem; }
.chat-sec { display: flex; align-items: center; justify-content: space-between; padding: .6rem .6rem .2rem; }
.chat-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--sl-500); font-weight: 700; margin: 0; }
.chat-plus { border: 0; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--blue); font-size: 1.2rem; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.chat-plus:hover { background: var(--blue-soft); }
.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-item { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .45rem .6rem; border-radius: 10px; color: var(--sl-700); font-size: .93rem; }
.chat-item:hover { background: var(--sl-100); }
.chat-item.is-on { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.chat-item.is-unread .chat-nm { font-weight: 700; color: var(--sl-900); }
.chat-hash { width: 20px; text-align: center; color: var(--sl-500); font-weight: 700; flex: none; }
.chat-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-role { font-size: .68rem; color: var(--sl-500); border: 1px solid var(--sl-300); border-radius: 99px; padding: 0 .4rem; }
.chat-n { background: var(--blue); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700; min-width: 20px; padding: 1px 6px; text-align: center; }
.chat-n.is-ment { background: #c0392b; }
.chat-none { padding: .3rem .8rem; color: var(--sl-500); font-size: .85rem; }
.chat-arch { margin: .8rem .6rem 0; font-size: .85rem; color: var(--sl-500); }
.chat-arch-row { display: flex; align-items: center; justify-content: space-between; }
.chat-av { --h: 210; width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: #fff; background: hsl(var(--h) 45% 42%); }
.chat-av.sm { width: 24px; height: 24px; font-size: .62rem; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.chat-empty { margin: auto; text-align: center; color: var(--sl-500); display: grid; gap: .3rem; padding: 2rem; }
.chat-empty b { color: var(--sl-900); font-size: 1.1rem; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-thread[hidden], .chat-empty[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--sl-200); }
.chat-title { flex: 1; min-width: 0; }
.chat-title h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; outline: none; }
.chat-title p { margin: 0; font-size: .82rem; color: var(--sl-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }
.chat-body { display: flex; flex: 1; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.chat-first { margin: auto; color: var(--sl-500); }
.chat-day { text-align: center; margin: .9rem 0 .5rem; position: relative; }
.chat-day span { background: #fff; position: relative; padding: 0 .7rem; font-size: .75rem; color: var(--sl-500); font-weight: 600; text-transform: capitalize; }
.chat-day::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--sl-200); }
.chat-msg { display: flex; gap: .65rem; padding: .25rem .4rem; border-radius: 12px; align-items: flex-start; }
.chat-msg.is-cont { padding-left: calc(.4rem + 34px + .65rem); padding-top: 0; }
.chat-msg:hover { background: var(--sl-50); }
.chat-msg.is-ment { background: #fff7e0; }
.chat-bub { min-width: 0; flex: 1; }
.chat-meta { display: flex; align-items: baseline; gap: .5rem; }
.chat-meta b { font-size: .92rem; color: var(--sl-900); }
.chat-meta time { font-size: .72rem; color: var(--sl-500); }
.chat-txt { white-space: normal; overflow-wrap: anywhere; color: var(--sl-900); font-size: .95rem; line-height: 1.45; }
.chat-txt a { color: var(--blue); }
.chat-msg.is-del .chat-txt { color: var(--sl-500); font-style: italic; }
.chat-mention { background: var(--blue-soft); color: var(--blue); border-radius: 6px; padding: 0 .25rem; font-weight: 600; }
.chat-ed { font-size: .72rem; color: var(--sl-500); }
.chat-tools { display: none; margin-top: -.1rem; }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools { display: block; }
.chat-tools .btn { padding: 0 .4rem; font-size: .78rem; }
.chat-editbox { display: grid; gap: .4rem; grid-template-columns: 1fr auto auto; align-items: start; }
.chat-editbox textarea { grid-column: 1 / -1; width: 100%; border: 1px solid var(--sl-300); border-radius: 12px; padding: .5rem .7rem; resize: vertical; }
.chat-members { width: 270px; flex: none; border-left: 1px solid var(--sl-200); padding: 1rem; overflow-y: auto; background: var(--sl-50); }
.chat-members[hidden] { display: none; }
.chat-members h3 { font-size: .9rem; margin: 0 0 .5rem; }
.chat-mem { list-style: none; padding: 0; margin: 0 0 .8rem; font-size: .9rem; }
.chat-mem li { display: flex; justify-content: space-between; align-items: center; padding: .15rem 0; gap: .4rem; }
.chat-mem-foot { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.chat-note { margin: 0; padding: .45rem 1.1rem; background: var(--sl-100); color: var(--sl-700); font-size: .85rem; }
.chat-note.is-err { background: #fdecea; color: #922b21; }
.chat-compose { display: flex; gap: .6rem; padding: .8rem 1.1rem; border-top: 1px solid var(--sl-200); align-items: flex-end; }
.chat-compose[hidden] { display: none; }
.chat-ta-wrap { position: relative; flex: 1; }
.chat-compose textarea { width: 100%; border: 1px solid var(--sl-300); border-radius: 18px; padding: .6rem 1rem; resize: none; max-height: 160px; background: var(--sl-50); line-height: 1.4; }
.chat-compose textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; background: #fff; }
.chat-compose .btn { border-radius: 99px; padding: .5rem 1.2rem; }
.chat-mlist { position: absolute; bottom: calc(100% + 6px); left: 0; list-style: none; margin: 0; padding: .3rem; background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18); min-width: 220px; z-index: 5; }
.chat-mlist li { padding: .4rem .7rem; border-radius: 9px; cursor: pointer; }
.chat-mlist li.is-on { background: var(--blue-soft); color: var(--blue); }
.chat-dlg { border: 0; border-radius: 22px; padding: 1.5rem; width: min(480px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.chat-dlg::backdrop { background: rgba(20,32,46,.4); }
.chat-dlg h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.chat-dlg fieldset { border: 0; padding: 0; }
.chat-dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.chat-pick { max-height: 180px; overflow-y: auto; margin-top: .6rem; display: grid; gap: .2rem; }
.chat-pick[hidden] { display: none; }
.chat-pick-row { display: flex; align-items: center; gap: .55rem; padding: .25rem .4rem; border-radius: 9px; }
.chat-pick-row:hover { background: var(--sl-50); }
.chat-badge { font-size: .65rem; margin-left: .25rem; vertical-align: middle; }
@media (max-width: 767.98px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 190px); border-radius: 18px; }
  .chat-pane { display: none; }
  .chat.is-thread .chat-side { display: none; }
  .chat.is-thread .chat-pane { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-members { position: absolute; right: 0; top: 0; bottom: 0; width: min(300px, 88%); z-index: 4; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
  .chat-body { position: relative; }
  .chat-tools { display: block; }
  .chat-msg.is-cont { padding-left: calc(.4rem + 34px + .65rem); }
}
@media (prefers-reduced-motion: no-preference) { .chat-msg.is-ment { transition: background .3s; } }

/* ---------- Partage d'écran (Discussions) ---------- */
.chat-live { display: grid; gap: .4rem; margin-top: 1rem; }
.chat-live:empty { display: none; }
.chat-live-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--blue-soft); color: var(--blue); border-radius: 14px; padding: .6rem 1rem; font-weight: 600; }
.chat-share-card { display: flex; align-items: center; gap: .8rem; background: var(--sl-50); border: 1px solid var(--sl-200); border-radius: 14px; padding: .6rem .9rem; max-width: 460px; }
.chat-share-card.is-live { background: var(--blue-soft); border-color: transparent; }
.chat-share-ic { font-size: 1.4rem; }
.chat-share-tx { flex: 1; display: grid; font-size: .9rem; }
.chat-share-tx span { color: var(--sl-500); font-size: .8rem; }
.share-status { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 2100; background: var(--sl-900); color: #fff; padding: .7rem 1.2rem; border-radius: 99px; max-width: min(640px, 92vw); font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.3); text-align: center; }
.share-status[hidden] { display: none; }
.share-status.is-err { background: #922b21; border-radius: 16px; }
.share-bar { position: fixed; left: 50%; bottom: 4.5rem; transform: translateX(-50%); z-index: 2050; display: flex; align-items: center; gap: .9rem; background: #fff; border-radius: 99px; padding: .55rem .6rem .55rem 1.1rem; box-shadow: 0 8px 40px rgba(0,0,0,.28); }
.share-bar[hidden] { display: none; }
.share-dot { width: 10px; height: 10px; border-radius: 50%; background: #d63031; animation: sharepulse 1.4s infinite; }
@keyframes sharepulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .share-dot { animation: none; } }
.share-bar-main { display: grid; font-size: .9rem; line-height: 1.25; }
.share-bar-main span { color: var(--sl-500); font-size: .78rem; }
.share-hands { position: fixed; right: 1rem; top: 5rem; z-index: 2060; display: grid; gap: .5rem; max-width: 340px; }
.share-hand { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: #fff; border-radius: 16px; padding: .8rem 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: .9rem; }
.share-hand span { flex-basis: 100%; }
.share-ptrs { position: fixed; inset: 0; pointer-events: none; z-index: 2080; }
.share-ptr { --h: 210; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: hsl(var(--h) 70% 45%); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); transform: translate(-50%, -50%); transition: left .06s linear, top .06s linear; }
.share-ptr span { position: absolute; left: 16px; top: 8px; background: hsl(var(--h) 70% 38%); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 8px; white-space: nowrap; }
.share-view { position: fixed; inset: 0; z-index: 2000; background: #0d141c; display: flex; flex-direction: column; }
.share-view[hidden] { display: none; }
.share-view-bar { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: #14202e; color: #fff; flex-wrap: wrap; }
.share-view-sp { flex: 1; }
.share-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.share-stage video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; cursor: crosshair; }
.share-wait { position: absolute; color: #c9d4e0; }
.share-wait[hidden], .share-grant[hidden] { display: none; }
.share-grant { position: absolute; background: #fff; border-radius: 20px; padding: 1.5rem 2rem; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.share-note { margin: 0; padding: .4rem 1rem; font-size: .78rem; color: #9fb0c2; background: #14202e; }
body.share-open { overflow: hidden; }
@media (max-width: 767.98px) { #chat-share { display: none; } .share-bar { width: calc(100vw - 1.5rem); border-radius: 18px; } }
.chat-rename { display: flex; gap: .3rem; width: 100%; }
.chat .chat-h { font-size: .72rem !important; letter-spacing: .07em !important; margin: 0 !important; font-weight: 700; }
.chat .chat-title h2 { font-size: 1.05rem !important; }

/* ---------- Tableau de tâches (lignes = dossiers, colonnes = À faire / En cours / Terminé) ---------- */
.tboard { display: grid; gap: .75rem; }
.tb-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.tb-f { display: grid; gap: .2rem; font-size: .72rem; font-weight: 600; color: #51647a; text-transform: uppercase; letter-spacing: .03em; }
.tb-f.tb-grow { flex: 1 1 200px; } .tb-f .form-select, .tb-f .form-control { text-transform: none; font-weight: 400; letter-spacing: 0; }
.tb-head, .tb-row { display: grid; grid-template-columns: 250px repeat(3, minmax(230px, 1fr)); gap: .75rem; }
.tb-head { font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #3d506a; padding: 0 .25rem; }
.tb-h .kn { margin-left: .3rem; }
.tboard { overflow-x: auto; padding-bottom: .5rem; }
.tb-bar, #tb-live { position: sticky; left: 0; }
.tb-head, .tb-row { min-width: 1010px; }
.tb-row { align-items: start; padding-bottom: .75rem; border-bottom: 1px solid #e3e9f1; }
.tb-dos { background: #fff; border: 1px solid #dbe3ee; border-left: 4px solid #1d4f91; border-radius: 12px; padding: .75rem .85rem; display: grid; gap: .5rem; box-shadow: 0 1px 2px rgba(20,32,46,.05); position: sticky; left: 0; }
.tb-dos-top { display: flex; align-items: center; gap: .4rem; }
.tb-tog { border: 0; background: #eef2f6; width: 26px; height: 26px; border-radius: 8px; line-height: 1; color: #3d506a; flex: none; }
.tb-tog:focus-visible, .tb-plus:focus-visible, .tc-edit:focus-visible { outline: 2px solid #1d4f91; outline-offset: 2px; }
.tb-name { font-weight: 650; color: #14202e; text-decoration: none; overflow-wrap: anywhere; } .tb-name:hover { text-decoration: underline; }
.tb-dos-body { display: grid; gap: .5rem; }
.tb-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tb-resp { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: #3d506a; }
.tb-alldone { font-size: .78rem; font-weight: 600; color: #15803d; background: #e7f6ec; border-radius: 8px; padding: .3rem .55rem; }
.tb-dos-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .15rem; padding-top: .5rem; border-top: 1px dashed #dbe3ee; }
.tb-plus { width: 30px; height: 30px; border-radius: 9px; border: 1px solid #1d4f91; background: #1d4f91; color: #fff; font-size: 1.2rem; line-height: 1; font-weight: 600; display: inline-grid; place-items: center; }
.tb-plus:hover { background: #163f75; }
.tb-add { display: grid; gap: .4rem; } .tb-add[hidden] { display: none; }
.tb-col { min-height: 80px; background: #f4f7fb; border: 1px solid #e3e9f1; border-radius: 12px; padding: .5rem; display: grid; gap: .5rem; align-content: start; }
.tb-col[data-state="doing"] { background: #eef4fd; } .tb-col[data-state="done"] { background: #eef8f1; }
.tb-col.kover { outline: 2px dashed #1d4f91; outline-offset: 2px; }
.tb-empty { margin: 0; font-size: .8rem; color: #667a91; padding: .4rem; }
.tb-row.is-collapsed .tb-col, .tb-row.is-collapsed .tb-dos-body { display: none; }
.tb-row.is-collapsed .tb-col { display: none; }
.tcard { background: #fff; border: 1px solid #e3e9f1; border-left: 3px solid #1d4f91; border-radius: 10px; padding: .55rem .65rem; display: grid; gap: .4rem; box-shadow: 0 1px 2px rgba(20,32,46,.05); }
.tcard[data-can] { cursor: grab; } .tcard.kdrag { opacity: .45; }
.tcard.is-done { border-left-color: #15803d; } .tcard.is-done .tc-title { color: #51647a; text-decoration: line-through; text-decoration-color: #9aa9bb; }
.tc-top { display: flex; justify-content: space-between; align-items: center; }
.tc-no { font-size: .72rem; font-weight: 700; color: #667a91; }
.tc-edit { border: 0; background: transparent; color: #1d4f91; font-size: .75rem; padding: .1rem .3rem; border-radius: 6px; }
.tc-title { font-size: .88rem; font-weight: 600; color: #14202e; overflow-wrap: anywhere; }
.tc-notes { font-size: .75rem; color: #51647a; }
.tc-sub, .tc-state { font-size: .76rem; padding: .25rem 1.6rem .25rem .5rem; border-radius: 8px; border: 1px solid #dbe3ee; background-color: #fff; max-width: 100%; }
.tc-sub { border-left: 4px solid var(--kc, #8a97a8); background-color: color-mix(in srgb, var(--kc, #8a97a8) 9%, #fff); font-weight: 600; color: #14202e; }
.tc-state { color: #3d506a; width: 100%; }
.tc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem; }
.tc-who { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; color: #3d506a; }
.tc-none { color: #8a97a8; font-style: italic; }
.tboard .kav { background: #1d4f91; }
.cap td, .cap th { vertical-align: middle; }
.capbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #e9eff7; }
.capbar .c-todo { background: #8a97a8; } .capbar .c-doing { background: #1d4f91; } .capbar .c-done { background: #15803d; }
@media (max-width: 900px) {
  .tb-head { display: none; }
  .tboard { overflow-x: visible; } .tb-row { min-width: 0; grid-template-columns: 1fr; gap: .5rem; }
  .tb-dos { position: static; }
  .tb-row:not(.is-collapsed) { grid-template-columns: 1fr; }
  .tb-row > .tb-col { display: grid; }
  .tb-col::before { content: attr(aria-label); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #3d506a; }
  .tb-bar, #tb-live { position: static; }
}
.tb-head, .tb-row { grid-template-columns: 220px repeat(3, minmax(190px, 1fr)); }
.tb-dos { min-width: 0; overflow: hidden; } .tb-dos .ktag, .tb-dos .st-chip { white-space: normal; max-width: 100%; }
.tb-dos-body, .tb-dos-foot, .tb-chips, .kc-tags { min-width: 0; }
.tb-col, .tcard { min-width: 0; } .tc-sub, .tc-state { width: 100%; box-sizing: border-box; }
.bl-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.bl-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 980px; background: #eef2f6; color: #3d506a; font-size: .84rem; font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.bl-pill b { font-weight: 700; color: #14202e; } .bl-pill:hover { background: #e3e9f1; }
.bl-pill.on { background: #fff; border-color: #1d4f91; color: #1d4f91; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.bl-pill.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); } .bl-pill.st.on { border-color: var(--kc); color: #14202e; }
.bl-count { margin: .5rem 0; font-size: .9rem; color: #3d506a; } .bl-sort { color: inherit; text-decoration: none; white-space: nowrap; } .bl-sort:hover { text-decoration: underline; }
.bl-pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: .75rem; }
.bl-table .form-select { min-width: 170px; }

/* ---- Largeur de page : conteneur fluide, plus généreux sur grand écran ---- */
body { --pw: 1840px; --pg: clamp(16px, 2.5vw, 40px); }
body:has(.tboard, .chat-main, .table-responsive, .bk-table, .cap) { --pw: 1920px; }
/* pages de lecture / formulaires étroits : largeur confortable, centrée */
.container.container-narrow { max-width: min(var(--pw), 1760px) !important; }
.container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl { max-width: var(--pw) !important; padding-left: var(--pg); padding-right: var(--pg); }
main.container { max-width: var(--pw) !important; }
.chat-main { max-width: var(--pw) !important; }
/* pages de texte et formulaires : largeur de lecture raisonnable */
main.container > form:not([class*="row"]), main.container > .card:only-child:not(:has(table)), main.container > .alert { max-width: 1100px; }
.ap .ap-sub { max-width: 52rem; }
/* ---- Tableau compact ---- */
@media (min-width: 901px) { .tb-head, .tb-row { min-width: 880px; } }
.tb-head, .tb-row { gap: .55rem; }
.tb-row { padding-bottom: .5rem; }
.tb-dos { padding: .5rem .6rem; gap: .3rem; border-radius: 10px; }
.tb-dos-body { gap: .3rem; } .tb-dos-foot { margin-top: 0; padding-top: .3rem; }
.tb-name { font-size: .88rem; line-height: 1.25; }
.tb-resp { font-size: .76rem; gap: .35rem; } .tb-chips { gap: .25rem; }
.tb-tog { width: 24px; height: 24px; } .tb-plus { width: 28px; height: 28px; font-size: 1.05rem; }
.tb-col { padding: .35rem; gap: .35rem; min-height: 56px; border-radius: 10px; }
.tcard { padding: .35rem .5rem; gap: .25rem; border-radius: 8px; }
.tc-title { font-size: .82rem; line-height: 1.25; } .tc-notes { font-size: .72rem; }
.tc-no { font-size: .68rem; } .tc-who { font-size: .72rem; gap: .3rem; } .tc-foot { gap: .25rem; }
.tc-sub, .tc-state { font-size: .72rem; min-height: 32px; padding-top: .15rem; padding-bottom: .15rem; }
.tboard .kav, .tb-dos .kav { width: 20px; height: 20px; font-size: .62rem; }
.tc-edit { min-height: 32px; min-width: 32px; }

/* Réassignation sur la carte, étape du dossier, avancement */
.tc-asgw { position: relative; cursor: pointer; max-width: 100%; }
.tc-asg { font-size: .76rem; padding: .2rem 1.4rem .2rem .45rem; border-radius: 8px; border: 1px solid #dbe3ee; background-color: #fff; color: #14202e; max-width: 150px; min-height: 30px; cursor: pointer; }
.tc-asg:hover { border-color: #1d4f91; } .tc-asg:focus-visible { outline: 2px solid #1d4f91; outline-offset: 2px; }
.tc-step { font-size: .72rem; color: #3d506a; background: #eef3f9; border-radius: 6px; padding: .12rem .4rem; overflow-wrap: anywhere; }
.tb-prog { display: block; text-decoration: none; color: #14202e; font-size: .78rem; font-weight: 600; margin: .15rem 0; } a.tb-prog:hover .tb-prog-t { text-decoration: underline; }
.tb-prog-t { display: block; overflow-wrap: anywhere; line-height: 1.25; margin-bottom: .25rem; }
.tb-prog-bar { display: block; height: 6px; background: #e3e9f1; border-radius: 4px; overflow: hidden; } .tb-prog-bar i { display: block; height: 100%; background: #15803d; border-radius: 4px; transition: width .25s; }
.bl-prog { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .82rem; } .bl-prog .tb-prog-bar { width: 64px; }
.tb-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 1080; background: #14202e; color: #fff; padding: .6rem 1rem; border-radius: 12px; font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .2s, transform .2s; max-width: 92vw; }
.tb-toast.on { opacity: 1; transform: translate(-50%, 0); } .tb-toast.is-bad { background: #9b1c1c; }
.etp-here { background: #eaf2ff; border-radius: 10px; }
