/* Flow CRM — design minimaliste */
:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --ink: #16161a;
    --muted: #71717a;
    --faint: #a1a1aa;
    --line: #e7e7e4;
    --accent: #16161a;
    --blue: #2563eb; --blue-bg: #eff4ff;
    --green: #15803d; --green-bg: #edfaf1;
    --amber: #b45309; --amber-bg: #fdf6e7;
    --red: #b91c1c; --red-bg: #fdefef;
    --violet: #6d28d9; --violet-bg: #f4f0fd;
    --gray: #52525b; --gray-bg: #f1f1f0;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0,0,0,.04);
    font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg); color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: .85em; }

/* ---- Layout ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; flex-shrink: 0; background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 10.5px; color: var(--faint); letter-spacing: .02em; }
.sidebar nav { flex: 1; padding: 6px 10px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 7.5px 10px; margin: 1px 0; border-radius: 7px;
    font-size: 13.5px; font-weight: 500; color: var(--muted);
    transition: background .12s, color .12s;
}
.sidebar nav a:hover { background: var(--bg); color: var(--ink); }
.sidebar nav a.active { background: var(--ink); color: #fff; }
.nav-ic { width: 18px; text-align: center; font-size: 13px; opacity: .75; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.user-chip { display: flex; gap: 9px; align-items: center; margin-bottom: 8px; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--gray-bg);
    display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--gray);
}
.user-name { font-size: 12.5px; font-weight: 600; }
.user-role { font-size: 10.5px; color: var(--faint); }
.logout { font-size: 11.5px; color: var(--faint); }
.logout:hover { color: var(--red); }

.main { flex: 1; padding: 28px 34px 60px; max-width: 1340px; min-width: 0; }

/* ---- Page header ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- Boutons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #333; border-color: #333; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: transparent; background: var(--gray-bg); }

/* ---- Cartes / stats ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat .label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .delta { font-size: 12px; margin-top: 3px; color: var(--muted); }
.stat .delta .up { color: var(--green); } .stat .delta .down { color: var(--red); }
.progress { height: 4px; background: var(--gray-bg); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.progress > i.ok { background: var(--green); }
.progress > i.warn { background: var(--amber); }

/* ---- Badges ---- */
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.b-gray { background: var(--gray-bg); color: var(--gray); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-violet { background: var(--violet-bg); color: var(--violet); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover { background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t-muted { color: var(--muted); font-size: 12.5px; }
.t-strong { font-weight: 600; }

/* ---- Formulaires ---- */
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input.f, select.f, textarea.f {
    width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink);
    transition: border .12s;
}
input.f:focus, select.f:focus, textarea.f:focus { outline: none; border-color: var(--ink); }
textarea.f { resize: vertical; min-height: 70px; }
.frow { display: grid; gap: 12px; margin-bottom: 14px; }
.fr2 { grid-template-columns: 1fr 1fr; } .fr3 { grid-template-columns: 1fr 1fr 1fr; } .fr4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .fr2, .fr3, .fr4 { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { width: auto; }

/* ---- Flash ---- */
.flash { padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.f-ok { background: var(--green-bg); color: var(--green); }
.f-err { background: var(--red-bg); color: var(--red); }

/* ---- Kanban ---- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { min-width: 240px; width: 240px; flex-shrink: 0; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; }
.kcol-head .t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kcol-head .n { font-size: 11px; color: var(--faint); font-weight: 600; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; padding: 2px; }
.kcol-body.dragover { background: var(--gray-bg); }
.kcard {
    background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
    padding: 11px 13px; cursor: grab; box-shadow: var(--shadow); font-size: 13px;
}
.kcard:active { cursor: grabbing; }
.kcard .t { font-weight: 600; margin-bottom: 2px; }
.kcard .m { font-size: 11.5px; color: var(--muted); display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:5px; }
.kcard.dragging { opacity: .4; }

/* ---- Timeline ---- */
.timeline { list-style: none; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.tl-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-bg); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.tl-body { flex: 1; font-size: 13px; }
.tl-meta { font-size: 11.5px; color: var(--faint); }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); font-family: 'Inter', sans-serif; }
.login-card { width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: 0 4px 24px rgba(0,0,0,.05); }
.login-card .brand { padding: 0 0 20px; }

/* ---- Items editor (devis / factures) ---- */
.items-editor table { width: 100%; border-collapse: collapse; }
.items-editor th { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 8px; }
.items-editor td { padding: 4px; }
.items-editor input, .items-editor select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-family: inherit; font-size: 13px; }
.totals-box { margin-left: auto; width: 300px; font-size: 13.5px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 5px 0; }
.totals-box .row.total { border-top: 1px solid var(--ink); font-weight: 700; font-size: 15px; margin-top: 6px; padding-top: 9px; }

/* ---- Calendrier ---- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--faint); padding: 4px 6px; }
.cal .day { min-height: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; font-size: 12px; }
.cal .day.off { background: transparent; border-color: transparent; }
.cal .day.today { border-color: var(--ink); }
.cal .dnum { font-size: 11px; font-weight: 600; color: var(--faint); margin-bottom: 4px; }
.cal .ev { display: block; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; font-size: 11px; font-weight: 500; background: var(--gray-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.wecreate { background: var(--blue-bg); color: var(--blue); }
.cal .ev.snapfiche { background: var(--violet-bg); color: var(--violet); }
.cal .ev.client { background: var(--amber-bg); color: var(--amber); }

/* ---- Messagerie ---- */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.chat-list { padding: 6px; height: 78vh; overflow-y: auto; }
.chat-card { display: flex; flex-direction: column; height: 78vh; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.chat-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: min(72%, 520px); }
.chat-msg .bubble { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.chat-msg.me { align-self: flex-end; }
.chat-msg.me .bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.them { align-self: flex-start; }
.chat-msg.them .bubble { background: var(--gray-bg); border-bottom-left-radius: 4px; }
.chat-msg .when { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.chat-msg.me .when { text-align: right; }
.chat-foot { padding: 12px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
@media (max-width: 950px) {
    .chat-layout { grid-template-columns: 1fr; }
    .chat-list { height: auto; max-height: 32vh; }
    .chat-card { height: 70vh; }
}

/* ---- Divers ---- */
.empty { text-align: center; color: var(--faint); padding: 40px 20px; font-size: 13.5px; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; letter-spacing: -.01em; }
.pill-tabs { display: inline-flex; background: var(--gray-bg); border-radius: 9px; padding: 3px; gap: 2px; }
.pill-tabs a { padding: 5px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pill-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.alert-line { display:flex; gap:10px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); font-size:13px; }
.alert-line:last-child { border-bottom:none; }
.dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); }
.spark { display:flex; align-items:flex-end; gap:3px; height:36px; }
.spark i { flex:1; background: var(--gray-bg); border-radius:2px 2px 0 0; min-height:2px; }
.spark i.on { background: var(--ink); }
/* ---- Navigation mobile (topbar + tabbar + panneau Plus) ---- */
.m-topbar, .m-tabbar { display: none; }
.m-sheet { position: fixed; inset: 0; z-index: 60; }
.m-sheet[hidden] { display: none; }
.m-sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.38); }
.m-sheet-panel {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-radius: 18px 18px 0 0;
    padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0,0,0,.12);
    animation: sheetUp .18s ease-out;
}
@keyframes sheetUp { from { transform: translateY(30%); opacity: .5; } to { transform: none; opacity: 1; } }
.m-sheet-handle { width: 38px; height: 4px; background: var(--line); border-radius: 3px; margin: 0 auto 14px; }
.m-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-sheet-grid a, .m-sheet-grid button {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 13px 4px 11px; border-radius: 12px; border: none;
    font-size: 10.5px; font-weight: 600; color: var(--muted);
    background: var(--bg); font-family: inherit; cursor: pointer; text-align: center;
}
.m-sheet-grid .ic { font-size: 18px; }
.m-sheet-grid a.on { background: var(--ink); color: #fff; }
.m-sheet-foot { display: flex; gap: 8px; margin-top: 14px; }
.m-sheet-foot > * { flex: 1; justify-content: center; }

@media (max-width: 800px) {
    .sidebar { display: none; }
    .m-topbar {
        display: flex; position: sticky; top: 0; z-index: 40;
        background: var(--surface); border-bottom: 1px solid var(--line);
        padding: 10px 14px; align-items: center; gap: 10px;
    }
    .m-topbar .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
    .m-topbar .m-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .m-topbar .avatar { width: 28px; height: 28px; font-size: 11.5px; }
    .m-tabbar {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
        background: var(--surface); border-top: 1px solid var(--line);
        padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
    }
    .m-tabbar a, .m-tabbar button {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
        font-size: 9.5px; font-weight: 600; color: var(--faint);
        background: none; border: none; padding: 4px 0 2px; font-family: inherit; cursor: pointer;
    }
    .m-tabbar .ic { font-size: 17px; line-height: 1.2; }
    .m-tabbar .on { color: var(--ink); }
    .main { padding: 14px 13px calc(84px + env(safe-area-inset-bottom)); }
    .page-head { margin-bottom: 14px; }
    .page-head h1 { font-size: 17.5px; }
    .page-head .sub { font-size: 12px; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1 1 auto; justify-content: center; }
    .grid { gap: 10px; }
    .g4, .g3, .g2 { grid-template-columns: repeat(2, 1fr); }
    .stat { padding: 12px 13px; }
    .stat .value { font-size: 19px; }
    .card-pad { padding: 14px; }
    table.data { font-size: 12.5px; }
    table.data th, table.data td { padding: 8px 9px; }
    .kanban .kcol, .kanban .kcol[style] { width: 230px !important; min-width: 230px !important; }
    .filters .f, .filters select, .filters input { flex: 1 1 45%; }
    .section-title { margin: 18px 0 10px; }
    /* Messagerie plein écran mobile */
    .chat-layout { grid-template-columns: 1fr; gap: 10px; }
    .chat-list { height: auto; max-height: 24vh; }
    .chat-card { height: calc(100dvh - 320px); min-height: 380px; }
    .chat-msg { max-width: 86%; }
    /* Formulaires en ligne → empilés */
    form.frow[style] { grid-template-columns: 1fr 1fr !important; }
    form.frow[style] > div:first-child, form.frow[style] > div:last-child { grid-column: 1 / -1; }
    .totals-box { width: 100%; }
}
@media (max-width: 480px) {
    .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
    .cal { gap: 3px; }
    .cal .day { min-height: 64px; padding: 3px 4px; }
}

/* ---- Prospection : workflow (étapes, modèles par catégorie, sélection, envoi) ---- */
.wf { display: grid; gap: 14px; margin-bottom: 18px; }
.wf-steps { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.wf-step { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 10px; position: relative; color: inherit; text-decoration: none; }
.wf-step + .wf-step::before { content: ''; position: absolute; left: 0; top: 24%; height: 52%; width: 1px; background: var(--line); }
.wf-step b { display: block; font-size: 13px; letter-spacing: -.01em; }
.wf-step small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.wf-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); flex-shrink: 0; background: var(--surface); }
.wf-step.is-done .wf-num { background: var(--green-bg); color: var(--green); border-color: transparent; }
.wf-step.is-on { background: linear-gradient(135deg, #f4f0fd, #eff4ff); }
.wf-step.is-on .wf-num { background: var(--ink); color: #fff; border-color: var(--ink); }
.wf-step.is-live .wf-num { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.wf-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; }
.wf-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.wf-head h4 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.wf-head p { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; max-width: 760px; line-height: 1.5; }
.wf-head code { font-family: 'JetBrains Mono', monospace; font-size: 11px; background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }
.wf-right { margin-left: auto; }
.wf-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); background: var(--violet-bg); padding: 4px 9px; border-radius: 999px; margin-top: 2px; white-space: nowrap; }
.wf-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wf-mode { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, #fff, #fafaf9); display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.wf-mode:hover { border-color: var(--faint); }
.wf-mode b { font-size: 13.5px; letter-spacing: -.01em; }
.wf-mode p { color: var(--muted); font-size: 12.5px; margin: 0; flex: 1; line-height: 1.5; }
.wf-mode-k { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.wf-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wf-send { margin-top: 14px; padding: 14px 18px; border-radius: 12px; background: var(--ink); color: #fff; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.wf-send p { color: #a1a1aa; font-size: 12.5px; margin: 2px 0 0; line-height: 1.5; }
.wf-send label { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: #d4d4d8; }
.wf-send input.f { width: 76px; background: #26262b; border-color: #3a3a40; color: #fff; }
.wf-send .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.wf-send .btn-primary:hover { background: #e4e4e7; border-color: #e4e4e7; }
.wf-live { border-radius: 14px; padding: 14px 18px; background: linear-gradient(135deg, #edfaf1, #eff4ff); border: 1px solid var(--line); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.wf-bar { height: 6px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; flex: 1 1 140px; }
.wf-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s; }
.cat-list { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.cat-row[open] { grid-column: 1 / -1; }
.cat-row { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cat-row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 9px 12px; }
.cat-row summary .cat-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cat-row summary .cat-prev { grid-column: 1 / -1; padding-left: 18px; }
.cat-row summary::-webkit-details-marker { display: none; }
.cat-row summary:hover { background: var(--bg); }
.cat-row[open] summary { background: var(--bg); border-bottom: 1px solid var(--line); }
.cat-row summary b { font-size: 13.5px; }
.cat-row .cat-prev { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row form { padding: 12px 14px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.cat-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.pill-check { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; background: var(--surface); }
.pill-check:hover { border-color: var(--faint); color: var(--ink); }
input.f.f-inline { width: 64px; display: inline-block; padding: 2px 6px; height: auto; font-size: 12.5px; margin: 0 2px; }
@media (max-width: 1100px) { .wf-steps, .wf-modes, .cat-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .wf-steps, .wf-modes, .cat-list { grid-template-columns: 1fr; } }
/* ---- Prospection : statut d'envoi permanent (toujours visible, quel que soit l'onglet) ---- */
.wf-status { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.wf-status.live { background: linear-gradient(135deg, #edfaf1, #eff4ff); }
.wf-status.idle { background: var(--surface); }
.wf-status-txt { flex: 1 1 auto; font-size: 13px; color: var(--muted); }
.wf-status-txt b { color: var(--ink); }
.wf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.wf-dot.pulse { background: var(--green); box-shadow: 0 0 0 0 rgba(21,128,61,.5); animation: wf-pulse 1.8s infinite; }
@keyframes wf-pulse { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.45); } 70% { box-shadow: 0 0 0 7px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }
