/*
 * La carte « Activité » de la fiche prospect — valeurs recopiées de la
 * maquette approuvée (tasks/nbt-crm/mockups/fiche-prospect-v1.html :
 * .card, .tabs, .pane, .out, textarea, .tl/.it/.ic). Ne pas « arrondir » :
 * Karim compare au pixel.
 */
.nbt-act { background: #fff; border: 1px solid #E7E5EA; border-radius: 14px; color: #14121A; font-size: 14px; }
.nbt-act-titre { margin: 0; padding: 14px 18px; border-bottom: 1px solid #E7E5EA; font-size: 15px; font-weight: 700; }

.nbt-act-tabs { display: flex; gap: 4px; border-bottom: 1px solid #E7E5EA; padding: 0 12px; }
.nbt-act-tabs button { border: 0; background: none; padding: 11px 12px; font: inherit; color: #6B6875; cursor: pointer; border-bottom: 2px solid transparent; }
.nbt-act-tabs button[aria-selected="true"] { color: #C8102E; border-bottom-color: #C8102E; font-weight: 600; }

.nbt-act-pane { padding: 14px 18px; }
.nbt-act-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.nbt-act-hint { color: #6B6875; font-size: 12.5px; }

.nbt-act-btn { border: 1px solid #C8102E; background: #C8102E; color: #fff; border-radius: 9px; padding: 8px 12px; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.nbt-act-btn:hover { background: #A50D26; border-color: #A50D26; }
.nbt-act-btn[disabled] { opacity: .6; cursor: default; }

.nbt-act-out { border: 1px solid #E7E5EA; border-radius: 999px; padding: 6px 11px; background: #fff; font: inherit; cursor: pointer; }
.nbt-act-out[aria-pressed="true"] { border-color: #C8102E; background: #FDEEF1; color: #A50D26; font-weight: 600; }

.nbt-act-textarea { display: block; width: 100%; min-height: 74px; border: 1px solid #E7E5EA; border-radius: 10px; padding: 10px; font: inherit; resize: vertical; background: #fff; color: inherit; }
.nbt-act-input { border: 1px solid #E7E5EA; border-radius: 8px; padding: 7px 9px; font: inherit; background: #fff; color: inherit; }

/* Le composeur de notes (éditeur riche de Filament) habillé comme le textarea de la maquette. */
.nbt-act .fi-input-wrp { border-radius: 10px; box-shadow: none; outline: 1px solid #E7E5EA; outline-offset: -1px; }
.nbt-act .fi-input-wrp:focus-within { outline-color: #C8102E; }
.nbt-act .fi-fo-rich-editor-content { padding: 0 !important; }
.nbt-act .fi-fo-rich-editor .tiptap { min-height: 74px !important; padding: 10px !important; font-size: 14px; }
.nbt-act .fi-fo-rich-editor .tiptap p.is-editor-empty:first-child::before { color: #9CA3AF; }

/* Le fil. */
.nbt-act-tl { padding: 6px 18px 14px; }
.nbt-act-it { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #E7E5EA; }
.nbt-act-it:last-of-type { border-bottom: 0; }
.nbt-act-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: #F7F7F8; }
.nbt-act-ic.call { background: #E0F2FE; }
.nbt-act-ic.wa { background: #DCFCE7; }
.nbt-act-ic.note { background: #FEF3C7; }
.nbt-act-ic.sys { background: #F2F4F7; }
.nbt-act-meta { color: #6B6875; font-size: 12.5px; }
.nbt-act-corps { display: inline; overflow-wrap: anywhere; }
.nbt-act-corps p { display: inline; margin: 0; }
.nbt-act-corps p + p::before { content: "\A"; white-space: pre; }
.nbt-act-corps [data-type="mention"] { color: #1D4ED8; font-weight: 600; background: none; padding: 0; }
.nbt-act-plus { display: inline-block; margin-top: 8px; color: #C8102E; font-size: 12.5px; font-weight: 600; }
/* 1440 px : la barre latérale du CRM est plus large que celle de la maquette ; ces réglages gardent les cinq résultats sur une ligne, comme sur la maquette. */
.nbt-act-row .nbt-act-out { padding: 6px 9px; font-size: 13.5px; }
.nbt-act-row:has(.nbt-act-out) { gap: 6px; }

/*
 * Le fil par source (option A, tasks/nbt-crm/plans/fil-par-source/maquette-fil-artifact.html : .chips/.chip).
 * La carte reste claire en mode sombre (fond #fff ci-dessus) : les puces portent leurs propres couleurs, lisibles dans les deux.
 * Les puces renvoient à la ligne (390 px). La couleur d'une puce pressée est sa `--nbt-fil`. Une puce choisie écrit sa source dans `data-voit` ; seules les lignes de ces sources restent.
 */
.nbt-fil-puces { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 4px; }
.nbt-fil-puces button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #E7E4EA; background: #fff; color: #14121A; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.nbt-fil-puces button b { font-size: 11px; font-weight: 700; background: #F0EEF2; color: #5F5B66; border-radius: 999px; padding: 1px 6px; }
.nbt-fil-puces button:focus-visible { outline: 2px solid #C8102E; outline-offset: 2px; }
.nbt-fil-puces button[aria-pressed="true"] { border-color: transparent; background: var(--nbt-fil, #6B6672); color: #fff; }
.nbt-fil-puces button[aria-pressed="true"] b { background: rgb(255 255 255 / .3); color: #fff; }
.nbt-fil-tout { --nbt-fil: #14121A; }
.nbt-fil-wa { --nbt-fil: #1F8F57; }
.nbt-fil-appel { --nbt-fil: #0369A1; }
.nbt-fil-note { --nbt-fil: #9A6200; }
.nbt-fil-rdv { --nbt-fil: #2D5BA8; }
.nbt-fil-pay { --nbt-fil: #5B3FA6; }
.nbt-fil-mail { --nbt-fil: #3A6B8C; }
.nbt-fil-relance { --nbt-fil: #A50D26; }
.nbt-fil-sys { --nbt-fil: #6B6672; }
.nbt-act-tl:has(> .nbt-fil-puces[data-voit]:not([data-voit=""])) > .nbt-act-it { display: none; }
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="wa"]) > .nbt-act-it[data-categorie="wa"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="appel"]) > .nbt-act-it[data-categorie="appel"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="note"]) > .nbt-act-it[data-categorie="note"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="rdv"]) > .nbt-act-it[data-categorie="rdv"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="pay"]) > .nbt-act-it[data-categorie="pay"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="mail"]) > .nbt-act-it[data-categorie="mail"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="relance"]) > .nbt-act-it[data-categorie="relance"],
.nbt-act-tl:has(> .nbt-fil-puces[data-voit~="sys"]) > .nbt-act-it[data-categorie="sys"] { display: grid; }

/* Le fil WhatsApp de la carte Activité du contact : l'onglet 💬 (D-WA139). */
.nbt-act-wa { padding: 14px 0; }
.nbt-act-wa-th { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #E7F8EE; border: 1px solid #E7E5EA; border-bottom: 0; border-radius: 12px 12px 0 0; font-weight: 500; }
.nbt-act-wa-th span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbt-act .nbt-act-wa .nbt-waw-fil.nbt-waw-inl { height: 560px; border-radius: 0 0 12px 12px; }
.nbt-act-canal { font-size: 11.5px; border-radius: 999px; padding: 1px 8px; background: #E8EFFF; color: #1D4ED8; white-space: nowrap; }
.nbt-act-canal-sim { background: #FFF3CD; color: #7A5A00; }

/* D-WA129 N2 — fil d'équipe (maquette notes-equipe-v1 §3) : composeur Info / Demande, badge, vu, réactions, réponses. */
.nbt-note-kind { display: inline-flex; border: 1px solid #E7E5EA; border-radius: 999px; padding: 2px; background: #fff; }
.nbt-note-kind button { border: 0; background: none; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; color: #5F5B66; white-space: nowrap; }
.nbt-note-kind button[aria-checked="true"][data-sorte="info"] { background: #F0EEF2; color: #14121A; font-weight: 600; }
.nbt-note-kind button[aria-checked="true"][data-sorte="demande"] { background: #FEF3C7; color: #92400E; font-weight: 600; }
.nbt-note-rule { font-size: 12px; color: #6B6875; margin: 4px 0 2px; }
.nbt-note { min-width: 0; }
.nbt-note-msg { position: relative; padding-right: 40px; border-radius: 8px; }
.nbt-note-bdl { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-bottom: 4px; }
.nbt-note-bd { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.nbt-note-bd-open { background: #FEF3C7; color: #92400E; }
.nbt-note-bd-late { background: #FBE5E6; color: #B4232F; }
.nbt-note-bd-rep { background: #E8EFFF; color: #1D4ED8; }
.nbt-note-bd-ok { background: #E7F7EE; color: #11733F; }
.nbt-note-bd-info { background: #F0EEF2; color: #5F5B66; }
.nbt-note-bdx { font-size: 12px; color: #5F5B66; }
.nbt-note-seen { font-size: 12px; color: #5F5B66; margin-top: 3px; }
.nbt-note-seen-no { color: #9A97A3; }
.nbt-note-rxs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nbt-note-rx { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #E7E5EA; background: #fff; border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 13px; line-height: 20px; cursor: pointer; }
.nbt-note-rx b { font-size: 12px; font-weight: 600; color: #5F5B66; }
.nbt-note-rx-moi { background: #E8EFFF; border-color: #A9C1F5; }
.nbt-note-rx-moi b { color: #1D4ED8; }
.nbt-note-rx[disabled] { cursor: default; }
.nbt-note-rx-add { position: absolute; top: -2px; right: 0; height: 26px; padding: 0 7px; border-radius: 999px; border: 1px solid #E7E5EA; background: #fff; font: inherit; font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .15s; display: inline-flex; align-items: center; gap: 1px; }
.nbt-note-rx-add small { font-size: 12px; font-weight: 700; color: #6B6875; }
.nbt-note-msg:hover > .nbt-note-rx-add, .nbt-note-msg:focus-within > .nbt-note-rx-add, .nbt-note-rx-add[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .nbt-note-rx-add { opacity: .8; } }
.nbt-note-picker { position: absolute; top: 28px; right: 0; z-index: 100; background: #fff; border-radius: 999px; box-shadow: 0 6px 24px rgba(20, 18, 26, .2); padding: 5px; display: flex; gap: 2px; }
.nbt-note-picker button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; font-size: 21px; cursor: pointer; transition: transform .12s; }
.nbt-note-picker button:hover { background: #F2F1EF; transform: scale(1.12); }
.nbt-note-acts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.nbt-note-lk { border: 0; background: none; padding: 0; color: #6B6875; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nbt-note-lk:hover { color: #14121A; }
.nbt-note-fait { border: 1px solid #BFE3CC; background: #E7F7EE; color: #11733F; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nbt-note-thr { margin-top: 8px; padding-left: 12px; border-left: 2px solid #EFE6CF; }
.nbt-note-rep { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 6px 0; }
.nbt-note-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 600; color: #fff; background: var(--nbt-av, #6B6672); }
.nbt-note-more { border: 0; background: none; padding: 4px 0; color: #1D4ED8; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.nbt-note-rcmp { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .nbt-note-rx-add, .nbt-note-picker button { transition: none; } }
/* Téléphone (390 px) : rien ne déborde, chaque bouton fait au moins 40 px de haut. */
@media (max-width: 600px) {
    .nbt-act-btn, .nbt-note-kind button, .nbt-note-lk, .nbt-note-fait, .nbt-note-more, .nbt-note-rx, .nbt-note-rx-add, .nbt-note-picker button { min-height: 40px; }
    .nbt-note-kind { flex-wrap: wrap; }
    .nbt-note-rx-add { position: static; opacity: 1; height: auto; margin-top: 6px; }
    .nbt-note-msg { padding-right: 0; }
    .nbt-note-picker { top: auto; right: auto; left: 0; flex-wrap: wrap; max-width: calc(100vw - 48px); border-radius: 16px; }
    .nbt-note-picker button { width: 40px; height: 40px; }
    .nbt-note-bd { white-space: normal; }
}
