/* TICLAB CRM — interface */
:root {
  /* Couleurs du logo TICLAB */
  --tic-blue: #2E3E95; --tic-green: #41AE4F; --tic-yellow: #E7E111;
  --bg: #f4f5fa; --surface: #fff; --ink: #141a33; --ink-2: #474f6e; --muted: #7a82a0;
  --line: #e2e5f0; --line-2: #eef0f6; --brand: #2E3E95; --brand-2: #23307a; --brand-soft: #e9ecf8; --brand-line: #c8cfee;
  --side: #1d2766; --side-ink: #c3c9e6; --side-hover: #28337a;
  --green: #2e8f3b; --green-soft: #e6f5e8; --red: #d93a3a; --red-soft: #fdeaea; --amber: #9a7b00; --amber-soft: #fbf8d2;
  --violet: #6b4fc4; --violet-soft: #efebfb; --blue-soft: #e9ecf8; --grey-soft: #eef0f6;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,26,51,.04), 0 1px 3px rgba(20,26,51,.06);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 12px; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.late { color: var(--red) !important; font-weight: 600; }
.hidden { display: none !important; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex-shrink: 0; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; color: #fff; position: relative; }
.brand::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--tic-blue) 0 45%, var(--tic-green) 45% 85%, var(--tic-yellow) 85%); }
.brand-logo { background: #fff; border-radius: 10px; padding: 8px 10px; width: 100%; display: flex; align-items: center; justify-content: center; }
.brand-logo img { width: 100%; max-width: 170px; height: auto; background: none !important; padding: 0 !important; border-radius: 0 !important; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { color: var(--side-ink); font-size: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: inline-flex !important; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.sidebar nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--tic-green); }
.sidebar nav a.active svg { color: var(--tic-green); }
.sidebar nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar nav a span { flex: 1; }
.count { font-style: normal; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7593; padding: 16px 10px 6px; }
.sidebar-foot { display: flex; align-items: center; border-top: 1px solid #2b3680; padding: 12px; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; color: #fff; min-width: 0; }
.me:hover { text-decoration: none; }
.me span:last-child { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me small { color: var(--side-ink); }
.logout { color: var(--side-ink); font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.logout:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; vertical-align: middle; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.sidebar .avatar { background: #3a4799; color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.burger { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }
.search { flex: 1; max-width: 520px; }
.search input { width: 100%; background: var(--bg); border-color: transparent; }
.quick { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 24px 28px 40px; flex: 1; }
.foot { padding: 14px 28px; color: var(--muted); font-size: 12px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.client-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover, .btn-ghost.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.danger { color: var(--red) !important; }

input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox] { width: auto; margin: 0; }
input[type=color] { padding: 2px; height: 38px; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.check-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline-label { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.inline-label input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid h3 { margin: 6px 0 0; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.align-end { align-self: end; }
.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
form.inline { display: inline; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--brand); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-grey { background: var(--grey-soft); color: var(--ink-2); }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash-success { background: var(--green-soft); color: #23702e; }
.flash-error { background: var(--red-soft); color: #a52727; }
.flash-info { background: var(--blue-soft); color: var(--brand-2); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.hover tbody tr[data-href] { cursor: pointer; }
.table.hover tbody tr:hover td { background: #f6f7fd; }
.table.compact td { padding: 7px 4px; }
.card .table:not(.lines-editor) th:first-child, .card .table td:first-child { padding-left: 0; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 20px; }
.card .table th:last-child, .card .table td:last-child { padding-right: 0; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 20px; }
.table tfoot td { border: 0; padding-top: 6px; padding-bottom: 6px; }
.table tfoot tr.grand td { font-weight: 700; font-size: 15px; border-top: 1px solid var(--line); }
tr.dim td { opacity: .55; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 500; }
.tabs a:hover { text-decoration: none; background: var(--bg); }
.tabs a.active { background: var(--brand); color: #fff; }
.tabs em { font-style: normal; opacity: .7; margin-left: 3px; font-size: 12px; }
.filters { display: flex; gap: 8px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 180px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--tic-blue); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); box-shadow: var(--shadow); }
a.kpi:hover { text-decoration: none; border-color: var(--brand-line); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.kpi small { color: var(--muted); }
.kpi-alert { border-top-color: var(--red); }
.kpi-alert strong { color: var(--red); }
.kpis .kpi:nth-child(3n+2) { border-top-color: var(--tic-green); }
.kpis .kpi:nth-child(3n) { border-top-color: var(--tic-yellow); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--tic-green), #36963f); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-val { font-size: 11px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.bar-lbl { font-size: 12px; color: var(--muted); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feed li:last-child { border-bottom: 0; }
.feed li > div { flex: 1; min-width: 0; word-wrap: break-word; }
.feed li > small { text-align: right; white-space: nowrap; }
.feed li.todo { background: #fffbf0; margin: 0 -10px; padding: 10px; border-radius: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 5px; flex-shrink: 0; }
.dot-appel { background: var(--green); } .dot-email { background: var(--brand); } .dot-reunion { background: var(--violet); } .dot-whatsapp { background: #25d366; } .dot-relance { background: var(--amber); } .dot-note { background: #9aa4bf; }
.check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c3cbe0; background: #fff; cursor: pointer; flex-shrink: 0; padding: 0; margin-top: 1px; }
.check:hover { border-color: var(--green); }
.check.checked { background: var(--green); border-color: var(--green); }
.check.checked::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; display: block; line-height: 16px; }

/* ---------- Fiche client ---------- */
.activity-form { background: var(--bg); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.activity-form textarea { background: #fff; }
.activity-form .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.activity-form .row select { width: auto; }
.activity-form .row .btn { margin-left: auto; }
.info { display: grid; grid-template-columns: 100px 1fr; gap: 6px 10px; margin: 0; }
.info dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.info dd { margin: 0; word-break: break-word; }
.note { background: #fffbf0; border-radius: 8px; padding: 10px; margin-top: 12px; font-size: 13px; }
.contact { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.contact > div { flex: 1; min-width: 0; }
.contact-links { display: flex; flex-direction: column; font-size: 13px; margin: 4px 0; }
.contact-form { background: var(--bg); padding: 12px; border-radius: 8px; margin: 8px 0; }
.contact-form .form-actions { margin-top: 10px; justify-content: space-between; }
.danger-zone { text-align: right; }

/* ---------- Pipeline ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: #eceef6; border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; border-top: 3px solid #9aa4bf; }
.kcol-qualifie { border-top-color: var(--brand); } .kcol-proposition { border-top-color: var(--violet); } .kcol-negociation { border-top-color: var(--amber); } .kcol-gagne { border-top-color: var(--green); } .kcol-perdu { border-top-color: var(--red); }
.kcol header { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; font-weight: 700; }
.kcol header em { font-style: normal; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kcol header small { color: var(--ink-2); font-weight: 600; }
.kcards { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kcol.drop { background: #dfe4f6; }
.kcard { background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: grab; }
.kcard.dragging { opacity: .5; }
.ktitle { font-weight: 600; color: var(--ink); display: block; }
.kclient { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.kmeta { display: flex; justify-content: space-between; align-items: center; }
.prob { font-size: 11px; background: var(--grey-soft); padding: 1px 6px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.kfoot { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.kfoot .avatar { margin-left: auto; }
.kadd { display: block; text-align: center; padding: 8px; color: var(--muted); font-weight: 600; border-radius: 6px; margin-top: 8px; }
.kadd:hover { background: rgba(255,255,255,.6); text-decoration: none; color: var(--brand); }

/* ---------- Documents ---------- */
.lines-editor td { vertical-align: top; padding: 8px 6px !important; }
.lines-editor th { padding: 10px 6px !important; }
.lines-editor th:first-child, .lines-editor td:first-child { padding-left: 20px !important; }
.lines-editor textarea { margin-top: 6px; font-size: 12px; color: var(--ink-2); min-height: 32px; }
.lines-editor .qty { width: 70px; } .lines-editor .unit { width: 100px; } .lines-editor .price { width: 130px; text-align: right; }
.lines-editor .line-total { padding-top: 16px !important; font-weight: 600; }
.lines-actions { display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.lines-actions select { width: auto; }
.doc-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.totals-card { position: sticky; top: 80px; }
.trow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); gap: 8px; }
.trow span, .trow label { display: flex; align-items: center; gap: 6px; flex-direction: row; }
.trow.grand { font-size: 18px; border-bottom: 0; margin-bottom: 12px; }
.trow.grand strong { color: var(--brand); }
.page-head h1 { position: relative; padding-bottom: 6px; }
.page-head h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--tic-green) 0 70%, var(--tic-yellow) 70%); }
.tiny { width: 58px !important; padding: 4px 6px; text-align: right; }
.totals-card .btn { margin-top: 8px; }
.doc-summary { display: flex; gap: 28px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.doc-summary div { display: flex; flex-direction: column; }
.doc-summary strong { font-size: 17px; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-accent { background: var(--tic-green); border-color: var(--tic-green); }
.btn-accent:hover { background: #369340; }
.pay-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: 4px 0; }

/* ---------- Paramètres ---------- */
.upload { display: flex; flex-direction: column; gap: 6px; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.upload img { max-height: 70px; max-width: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }

/* ---------- Connexion / installation ---------- */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #1d2766 0%, #2E3E95 100%); position: relative; overflow: hidden; }
body.auth::before, body.auth::after { content: ""; position: absolute; width: 0; height: 0; border-style: solid; opacity: .9; }
body.auth::before { right: 8%; top: 10%; border-width: 0 0 70px 110px; border-color: transparent transparent var(--tic-yellow) transparent; transform: rotate(-18deg); }
body.auth::after { right: 4%; bottom: 12%; border-width: 60px 100px 60px 0; border-color: transparent var(--tic-green) transparent transparent; }
.auth-card { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 24px; text-align: center; }
.auth-brand img { max-height: 90px; max-width: 240px; }
.auth-card { border-top: 5px solid var(--tic-green); position: relative; z-index: 1; }
.auth-brand .brand-mark { width: 48px; height: 48px; font-size: 22px; }
.auth-brand strong { font-size: 18px; }
.auth-brand small { color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13px; }
.checklist .ok { color: var(--green); } .checklist .ko { color: var(--red); font-weight: 600; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .client-layout, .doc-bottom { grid-template-columns: 1fr; }
  .totals-card { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -240px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .burger { display: block; }
  .quick .btn-ghost { display: none; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid-2, .form-grid, .form-grid.cols-4, .kpis-3 { grid-template-columns: 1fr; }
  .span2, .span3, .span4 { grid-column: auto; }
  .filters { flex-wrap: wrap; } .filters input, .filters select { min-width: 0; width: 100%; }
  .kanban { grid-template-columns: repeat(6, 260px); }
  .lines-editor thead { display: none; }
  .lines-editor tr { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .lines-editor td { border: 0 !important; padding: 4px !important; }
  .lines-editor td:first-child { grid-column: 1 / -1; padding-left: 4px !important; }
  .lines-editor .qty, .lines-editor .unit, .lines-editor .price { width: 100%; }
}

/* Ajustements */
.table td:first-child a strong { white-space: nowrap; }
.filters input[type=checkbox] { min-width: 0; width: auto; }
.kanban { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.lines-actions { flex-wrap: wrap; }
@media (max-width: 860px) { .kanban { grid-template-columns: repeat(6, 250px); } }

/* ---------- v2 : prospection, projets, domaines ---------- */
.btn-sm { padding: 5px 10px; font-size: 12px; }
.kpi-warn strong { color: var(--amber); }
.kpis .kpi.kpi-alert { border-top-color: var(--red); }
.progress { display: inline-block; width: 90px; height: 7px; background: var(--grey-soft); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.progress span { display: block; height: 100%; background: var(--tic-green); border-radius: 6px; }
.progress.big { display: block; width: 100%; height: 9px; margin: 8px 0 6px; }
.kpi .progress { width: 100%; margin: 4px 0 2px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.asset-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.asset-line:last-child { border-bottom: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.wide-img { max-width: 100% !important; max-height: 90px !important; }
.copy-row { display: flex; gap: 6px; margin-bottom: 8px; }
.copy-row input { font-size: 12px; }
.info.wide { grid-template-columns: 140px 1fr; }
.secret-box code { background: #fff7e0; padding: 2px 6px; }
.secret-box pre { margin: 0; white-space: pre-wrap; font-size: 12px; }
.feed.compact li { padding: 6px 0; font-size: 13px; }
.small-tabs a { font-size: 12.5px; padding: 5px 10px; }
.bulk { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; }
.bulk select { width: auto; }

/* Prospection */
.lead-card { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 14px; align-items: center; background: #fffdf6; border-color: #f3e3b5; }
.lead-table td { vertical-align: middle; }
.lead-table tr.focus td, .log-row td { background: #f6f7fd; }
.quick-links { font-size: 12.5px; margin-top: 2px; }
.quick-links a { margin-right: 8px; white-space: nowrap; }
.log-form { padding: 6px 0; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.pill:hover { border-color: var(--brand); }
.pill input { width: auto; margin: 0; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.perf { display: flex; flex-direction: column; gap: 10px; }
.perf-head { display: flex; align-items: center; gap: 10px; }
.perf-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.perf-target { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.perf-target strong { font-size: 18px; }
.perf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perf-stats div { background: var(--bg); border-radius: 8px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.perf-stats strong { font-size: 17px; }
.perf-stats span { font-size: 11px; color: var(--muted); }

/* Projets & tâches */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); margin: 0; }
.project-card:hover { text-decoration: none; border-color: var(--brand-line); }
.project-card h3 { margin: 8px 0 0; }
.project-card p { margin: 0; }
.project-summary { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.project-summary .status-buttons { margin-left: auto; }
.quick-task { display: flex; gap: 8px; padding: 12px; }
.quick-task input[name=title] { flex: 1; }
.quick-task select, .quick-task input[type=date] { width: auto; }
.kanban-4 { grid-template-columns: repeat(4, minmax(220px, 1fr)) !important; margin-bottom: 18px; }
.kcol-t-a_faire { border-top-color: #9aa4bf; } .kcol-t-en_cours { border-top-color: var(--brand); } .kcol-t-en_revue { border-top-color: var(--violet); } .kcol-t-termine { border-top-color: var(--green); }
.task-card .badge { margin-top: 6px; }
.task-card.is-done .ktitle { text-decoration: line-through; color: var(--muted); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.task-list li:last-child { border-bottom: 0; }
.task-list li > div { flex: 1; min-width: 0; }
.task-list li.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { color: var(--ink); font-weight: 500; margin-right: 6px; }
.perms-table td, .perms-table th { padding: 8px 10px !important; }

@media (max-width: 860px) {
  .lead-card { grid-template-columns: 1fr 1fr; }
  .kanban-4 { grid-template-columns: repeat(4, 240px) !important; }
  .quick-task { flex-wrap: wrap; }
  .project-summary .status-buttons { margin-left: 0; }
  .lead-table thead { display: none; }
  .lead-table tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .lead-table td { display: block; border: 0 !important; padding: 3px 0 !important; text-align: left !important; }
}
.brand .brand-logo img { width: 100%; height: auto; max-width: 180px; max-height: 64px; object-fit: contain; }
.brand .brand-logo { flex-direction: row; }

.lookup-report summary { cursor: pointer; font-weight: 600; }
.lookup-report ul { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
button:disabled { opacity: .7; cursor: wait; }
