/* =====================================================================
   DETEC Flow — feuille de styles (charte graphique DETEC, mars 2026)
   Bleu principal #013950 · Rouge #ED1C24 · Police Montserrat
   ===================================================================== */
:root {
  --navy: #013950; --navy-2: #0b4a66; --navy-3: #1f5c80; --navy-50: #e8eff3; --navy-25: #f3f7f9;
  --red: #ed1c24; --red-50: #fde8e9; --red-600: #c9141b;
  --ink: #12222c; --ink-2: #3d4d57; --muted: #6b7a85; --line: #dde4e9; --line-2: #eef2f5;
  --bg: #f4f6f8; --card: #ffffff; --ok: #1f8a4c; --ok-50: #e5f4ec; --warn: #b7791f; --warn-50: #fdf3e1;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(1,57,80,.06), 0 4px 16px rgba(1,57,80,.06);
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --side: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-weight: 700; color: var(--navy); margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Structure ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy); color: #cfdde5; display: flex; flex-direction: column; z-index: 40;
  background-image: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.08)); }
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { height: 40px; width: auto; }
.brand span { color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: var(--red); padding: 1px 6px; border-radius: 4px; margin-bottom: 4px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7fa2b6; padding: 14px 10px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #dbe7ee; font-weight: 500; font-size: 13.5px; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: #fff; color: var(--navy); font-weight: 700; }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--red); }
.nav-link .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; min-width: 20px; text-align: center; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.ai-mode { display: inline-flex; align-items: center; gap: 6px; color: #9fb8c6; }
.ai-mode.on { color: #fff; } .ai-mode .ico { width: 14px; height: 14px; color: var(--red); }
.ver { color: #6f93a7; }

.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 62px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--navy-25); border: 1px solid var(--line); border-radius: 22px; padding: 0 14px; height: 38px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: 0; flex: 1; font: inherit; color: var(--ink); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--navy); width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--navy-50); }
.bell b { position: absolute; top: 3px; right: 2px; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; line-height: 16px; }
.menu-btn { display: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 22px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--navy-50); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; border: 2px solid var(--red); }
.who { display: flex; flex-direction: column; line-height: 1.15; } .who b { font-size: 13px; } .who small { font-size: 11px; }
.user-menu .menu { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; }
.user-menu .menu a, .user-menu .menu button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 7px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--navy-25); }
.content { padding: 24px; flex: 1; max-width: 1480px; width: 100%; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--red); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--navy-3); color: var(--navy); background: var(--navy-25); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.btn-red, .btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover, .btn-danger:hover { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn-ok:hover { background: #18703d; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; } .btn-ghost:hover { background: var(--navy-50); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-ai { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); color: #fff; border: 0; }
.btn-ai .ico { color: #ff8a8f; } .btn-ai:hover { color: #fff; filter: brightness(1.08); }
.btn[disabled] { opacity: .5; pointer-events: none; }
form.inline { display: inline; }

/* ---------- Cartes, grilles ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2, .card > h3, .card-head h2, .card-head h3 { font-size: 14.5px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flat { box-shadow: none; }
.card.accent { border-top: 3px solid var(--red); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy); }
.kpi.red::after { background: var(--red); } .kpi.ok::after { background: var(--ok); } .kpi.warn::after { background: var(--warn); }
.kpi span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 4px; letter-spacing: -.01em; }
.kpi.red b { color: var(--red); }
.kpi small { font-size: 12px; display:block; margin-top:2px; }
.kpi small b, .kpi small span { display: inline; font-size: inherit; color: inherit; margin: 0; font-weight: 700; }
.kpi small .down { color: var(--red); } .kpi small .up { color: var(--ok); }
.up { color: var(--ok); font-weight: 600; } .down { color: var(--red); font-weight: 600; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--navy-25); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: #fafcfd; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table a.row-link { font-weight: 600; color: var(--navy); }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--navy-25); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-gray { background: #eef1f3; color: #55636c; } .badge-blue { background: #e4eef6; color: #1f5c80; }
.badge-navy { background: var(--navy); color: #fff; } .badge-green { background: var(--ok-50); color: var(--ok); }
.badge-amber { background: var(--warn-50); color: var(--warn); } .badge-red { background: var(--red-50); color: var(--red-600); }
.tag { display: inline-block; background: var(--navy-50); color: var(--navy); border-radius: 5px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; }
.score { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 12px; color: #fff; background: var(--navy); }
.score.hot { background: var(--red); } .score.warm { background: var(--warn); }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.field > span { font-weight: 600; color: var(--ink-2); }
.field.full { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=file], input[type=tel], input[type=url], select, textarea {
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; border: 1px solid #cfd8de; border-radius: 8px; padding: 8px 10px; width: 100%; min-height: 38px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(1,57,80,.18); border-color: var(--navy-3); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- Messages ---------- */
.flash { padding: 11px 16px; border-radius: 9px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash-success { background: var(--ok-50); border-color: #bfe3cd; color: #17643a; }
.flash-error { background: var(--red-50); border-color: #f6c3c5; color: #a3151b; }
.flash-info { background: var(--navy-50); border-color: #c5d6e0; color: var(--navy); }
.flash-warning { background: var(--warn-50); border-color: #f0d7a6; color: #8a5a12; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; color: #b7c5ce; }
.callout { border-left: 4px solid var(--red); background: var(--red-50); padding: 12px 14px; border-radius: 0 8px 8px 0; margin-bottom: 14px; }
.callout.navy { border-color: var(--navy); background: var(--navy-50); }

/* ---------- IA ---------- */
.ai-box { background: linear-gradient(135deg, #013950 0%, #0b4a66 60%, #1f5c80 100%); color: #e9f1f5; border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; }
.ai-box::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 22px solid rgba(237,28,36,.18); }
.ai-box h2, .ai-box h3 { color: #fff; }
.ai-box .ico { color: #ff8a8f; }
.ai-box .btn { position: relative; z-index: 1; }
.ai-text { white-space: pre-line; font-size: 13.5px; position: relative; z-index: 1; }
.suggestion { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.suggestion:last-child { border-bottom: 0; }
.suggestion .body { flex: 1; min-width: 0; } .suggestion .body b { color: var(--navy); }
.suggestion .body p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }

.ai-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 420px; max-width: 100%; background: #fff; z-index: 60; box-shadow: -10px 0 30px rgba(1,57,80,.18); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.ai-drawer.open { transform: none; }
.ai-head { background: var(--navy); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--red); }
.ai-head > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; } .ai-head small { width: 100%; color: #a9c2d0; font-size: 11.5px; }
.ai-head .icon-btn { color: #fff; } .ai-head .icon-btn:hover { background: rgba(255,255,255,.12); }
.ai-head .ico { color: #ff8a8f; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--navy-25); }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; white-space: pre-line; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg.loading { color: var(--muted); font-style: italic; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; }
.ai-chips button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 4px 10px; font: 500 12px var(--font); color: var(--navy); cursor: pointer; }
.ai-chips button:hover { border-color: var(--red); color: var(--red); }
.ai-input { display: flex; gap: 8px; padding: 12px 14px 16px; }
.ai-input textarea { min-height: 40px; height: 40px; }
.backdrop { position: fixed; inset: 0; background: rgba(1,30,45,.35); z-index: 35; display: none; }
.backdrop.show { display: block; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #eaf0f3; border-radius: var(--radius); padding: 10px; min-height: 240px; }
.kcol h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; margin: 2px 4px 10px; color: var(--navy); }
.kcol h3 small { font-weight: 600; }
.kcol.drag-over { outline: 2px dashed var(--navy-3); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); border-left: 3px solid var(--navy); }
.kcard.hot { border-left-color: var(--red); }
.kcard b { display: block; font-size: 13px; color: var(--navy); }
.kcard small { display: block; }
.kcard .meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: #e6ecf0; stroke-width: 1; }
.chart .axis { font-size: 10.5px; fill: #6b7a85; }
.chart .lbl { fill: #3d4d57; font-size: 12px; } .chart .val { fill: #13222c; font-weight: 600; font-size: 11.5px; }
.chart.donut { max-width: 190px; margin: 0 auto; }
.donut-center { font-size: 16px; font-weight: 800; fill: var(--navy); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.gauge { height: 8px; background: #e8eef2; border-radius: 4px; overflow: hidden; }
.gauge-bar { height: 100%; border-radius: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(80px,1fr) 150px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }

/* ---------- Divers ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--navy); border-color: var(--red); }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; } .dl dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); }
.timeline li.mail::before { border-color: var(--red); }
.timeline small { display: block; }
.steps { display: flex; gap: 0; margin: 4px 0 16px; overflow-x: auto; }
.steps span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 6px; background: #eef2f5; position: relative; white-space: nowrap; }
.steps span:first-child { border-radius: 8px 0 0 8px; } .steps span:last-child { border-radius: 0 8px 8px 0; }
.steps span.done { background: var(--navy-50); color: var(--navy); }
.steps span.current { background: var(--navy); color: #fff; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.task-row .t { flex: 1; min-width: 0; } .task-row .t b { display: block; font-size: 13.5px; color: var(--ink); }
.late { color: var(--red); font-weight: 600; }
.folder-tree a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px; color: var(--ink); font-weight: 500; }
.folder-tree a.active, .folder-tree a:hover { background: var(--navy-50); color: var(--navy); }
.folder-tree .sub { padding-left: 18px; font-size: 12.5px; }
.dropzone { border: 2px dashed #b9c7d0; border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); background: var(--navy-25); }
.dropzone.over { border-color: var(--red); background: var(--red-50); }
.diff { background: #0f1e27; color: #d6e2e9; padding: 12px; border-radius: 8px; overflow: auto; max-height: 460px; font-size: 12px; line-height: 1.5; }
.diff .add { color: #7ee2a4; } .diff .del { color: #ff9ea2; } .diff .hunk { color: #7fa2b6; }
.hours-grid input { width: 64px; text-align: center; padding: 6px; min-height: 32px; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-nav a { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pill-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.qr { font-family: monospace; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- Connexion ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--navy) url('../img/gears.png') no-repeat center 18% / 140% auto; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(1,57,80,.55) 0%, rgba(1,57,80,.96) 55%); }
.auth-hero > * { position: relative; }
.auth-hero img { width: 220px; }
.auth-hero h1 { color: #fff; font-size: 34px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; }
.auth-hero h1 em { color: var(--red); font-style: normal; }
.auth-hero p { color: #c4d6e0; max-width: 460px; }
.auth-hero ul { padding: 0; list-style: none; margin: 18px 0 0; display: grid; gap: 8px; color: #dce8ee; font-size: 13.5px; }
.auth-hero li::before { content: "■"; color: var(--red); margin-right: 8px; font-size: 10px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card .btn { width: 100%; justify-content: center; height: 44px; font-size: 14px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Responsive (mobile / APK) ---------- */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .g2, .g3, .g4, .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .who, .btn-ai span { display: none; }
  .content { padding: 16px 14px 90px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-hero { padding: 28px; min-height: 260px; } .auth-hero h1 { font-size: 24px; } .auth-hero ul { display: none; }
  .dl { grid-template-columns: 1fr; }
  .table .hide-sm { display: none; }
}
@media print {
  .sidebar, .topbar, .ai-drawer, .btn, .actions { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Administration ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 22px; margin: 10px 0; }
.perm-grid > div { display: flex; flex-direction: column; gap: 5px; }
.perm-grid b { color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-pop { position: absolute; right: 0; top: 34px; z-index: 30; width: 360px; max-height: 70vh; overflow: auto; box-shadow: 0 14px 40px rgba(1,57,80,.22); }
.row-pop.wide { width: min(820px, 92vw); }
.link-card { display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.link-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(1,57,80,.14); }
.link-card p { color: var(--muted, #5b6b75); margin: 0; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters .field { margin: 0; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 14px; }
.pager a { padding: 5px 11px; border-radius: 6px; border: 1px solid #d5dee4; text-decoration: none; color: var(--navy); }
.pager a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid #dde5ea; box-shadow: 0 -6px 18px rgba(1,57,80,.08); padding: 12px 16px; border-radius: 10px; justify-content: flex-end; }
details > summary { cursor: pointer; }
@media (max-width: 720px) { .row-pop { position: fixed; left: 8px; right: 8px; top: 70px; width: auto; } }

/* ---------- V2 : CRM IA, finance, tableaux de bord ---------- */
.subnav { flex-wrap: wrap; align-items: center; gap: 4px; }
.subnav form.inline { margin-left: auto; }
.g-3-1 { grid-template-columns: 3fr 1fr; }
.g-1-1-1 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .g-3-1, .g-1-1-1 { grid-template-columns: 1fr; } }
.ai-panel { border-left: 4px solid var(--red, #ED1C24); background: linear-gradient(90deg, #f7fbfd, #fff 40%); }
.ai-rings { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ai-rings .ai-facts { flex: 1; min-width: 260px; }
.ai-rings .ai-facts h2 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-rings .ai-facts ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; font-size: 13px; }
.ai-rings .ai-btns { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.ai-rings .ai-btns form.inline, .ai-rings .ai-btns form { margin: 0; }
.ai-rings .ai-btns .btn { width: 100%; justify-content: center; }
.factors { columns: 1 !important; list-style: none; padding-left: 0 !important; }
.factors li { padding: 2px 0; } .factors li b { display: inline-block; min-width: 34px; }
.factors li.up b { color: #1E8E5A; } .factors li.down b { color: #C4161D; }
.next-action { margin: 10px 0 0; padding: 8px 10px; background: #fff4e5; border-radius: 8px; font-size: 13px; }
.ai-summary { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #d5dee4; }
.ai-summary pre, pre.mailbody { white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 6px 0; background: #f6f9fb; padding: 10px; border-radius: 8px; }
.kcard-ai { font-size: 11.5px; color: #7a4b00; background: #fff4e5; border-radius: 6px; padding: 4px 6px; margin: 4px 0; display: flex; gap: 4px; align-items: flex-start; }
.kcard-ai svg { width: 12px; height: 12px; flex: none; margin-top: 1px; }
.hscore { display: inline-block; min-width: 30px; text-align: center; padding: 1px 6px; border-radius: 10px; font-weight: 700; font-size: 12px; }
.hscore.hg { background: #e3f4ea; color: #17643a; } .hscore.ha { background: #fff1d6; color: #8a5a12; } .hscore.hr { background: #fde3e4; color: #a3151b; }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seg-card { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid #dde5ea; text-decoration: none; color: inherit; }
.seg-card b { font-size: 24px; color: var(--navy, #013950); } .seg-card span { font-weight: 600; font-size: 13px; } .seg-card small { color: #5b6b75; }
.seg-card.active { border-color: var(--red, #ED1C24); box-shadow: 0 0 0 2px rgba(237,28,36,.15); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #5b6b75; text-align: center; padding: 4px; }
.cal-d { min-height: 96px; border: 1px solid #e3eaee; border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 2px; background: #fff; overflow: hidden; }
.cal-d.empty { background: transparent; border: 0; } .cal-d.today { border-color: var(--red, #ED1C24); background: #fff8f8; }
.cal-d .n { font-size: 11px; font-weight: 700; color: #5b6b75; }
.cal-e { font-size: 10.5px; padding: 1px 4px; border-radius: 4px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cal-e.late { outline: 1px solid #ED1C24; }
.ring { display: block; }
.dash-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.dash-filters .field { margin: 0; min-width: 150px; }
.obj { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: 13px; margin-bottom: 10px; }
.obj .gauge { grid-column: 1 / -1; }
.alert-list .al { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef2f4; font-size: 13px; }
.alert-list .al .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; background: #E8A33D; }
.alert-list .al.danger .dot { background: #ED1C24; }
.fin-table td.num, .fin-table th.num { text-align: right; } .fin-table tr.total td { font-weight: 700; border-top: 2px solid #013950; }
.fin-table tr.sub td { font-weight: 600; background: #f6f9fb; }
.pos { color: #17643a; } .neg { color: #a3151b; }
.flowmap { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flowmap .fstep { border: 1px solid #d5dee4; border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 190px; flex: 1; font-size: 12.5px; }
.flowmap .fstep b { display: block; color: var(--navy, #013950); }
.flowmap .fstep .who { color: #a3151b; font-weight: 600; }
.chat-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.score.good { background: #1E8E5A; color: #fff; }

/* =========================== V3 — portails employé / client =========================== */
body.portal { background: var(--bg); padding-bottom: 0; }
.p-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; background: var(--navy); color: #fff; padding: 0 20px; height: 62px; box-shadow: 0 2px 10px rgba(1,57,80,.25); }
.p-brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-weight: 700; white-space: nowrap; }
.p-brand img { height: 30px; } .p-brand span { font-size: 13px; color: #ff9aa0; letter-spacing: .04em; text-transform: uppercase; }
.p-nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.p-nav a { display: flex; align-items: center; gap: 6px; color: #cfe0ea; padding: 8px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.p-nav a:hover { background: rgba(255,255,255,.08); color: #fff; } .p-nav a.active { background: #fff; color: var(--navy); }
.p-nav .ico { width: 16px; height: 16px; }
.p-user { display: flex; align-items: center; gap: 10px; margin-left: auto; } .p-user .bell, .p-user .who b { color: #fff; } .p-user .who small { color: #9fc0d2; }
.p-user .menu { color: var(--ink); }
.p-preview { background: #fff4d6; color: #7a5300; font-size: 12.5px; padding: 6px 20px; border-bottom: 1px solid #f0d58a; }
.p-content { max-width: 1280px; margin: 0 auto; padding: 22px 20px 40px; }
.p-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 12px 90px; }
.p-hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.p-hello h1 { font-size: 26px; margin: 0; } .p-hello p { margin: 2px 0 0; color: var(--muted); }
.p-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.p-banner { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; color: var(--ink); box-shadow: var(--shadow); }
.p-banner.warn { border-left-color: var(--red); background: #fff8f8; } .p-banner > div { flex: 1; display: flex; flex-direction: column; } .p-banner span { color: var(--muted); font-size: 13px; }
.p-banner .ico { width: 24px; height: 24px; color: var(--red); }
.p-today { border-top: 4px solid var(--navy); }
.p-mission { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .p-mission > b { font-size: 17px; color: var(--navy); }
.p-mission span { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; } .p-mission .ico { width: 15px; height: 15px; color: var(--muted); }
.p-geo { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--navy-25); border: 1px solid var(--line); font-size: 13px; margin: 6px 0 12px; }
.p-geo.ok { background: var(--ok-50); border-color: #b9e0c8; color: #14532d; } .p-geo.bad { background: var(--red-50); border-color: #f5b7ba; color: #8a1016; }
.p-punch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.p-pbtn { height: 64px; font-size: 15px; justify-content: center; flex-direction: column; gap: 2px; }
.p-pbtn[disabled] { opacity: .35; }
.p-timeline { list-style: none; padding: 0; margin: 12px 0 0; border-left: 3px solid var(--line); }
.p-timeline li { padding: 4px 0 4px 14px; position: relative; font-size: 13px; } .p-timeline li::before { content: ''; position: absolute; left: -7px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); }
.p-timeline li.warn::before { background: var(--red); } .p-timeline small { display: block; color: var(--muted); }
.p-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.p-tip { padding: 8px 10px; border-radius: 8px; margin: 6px 0; font-size: 13.5px; background: var(--navy-25); }
.p-tip.warn { background: var(--warn-50); } .p-tip.bad { background: var(--red-50); } .p-tip.ok { background: var(--ok-50); }
.p-bottom { display: none; }
.p-contract h3 { margin-top: 16px; } .p-contract p { white-space: normal; }
.p-approve { border-left: 5px solid var(--warn); }
.p-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .p-inline input, .p-inline select { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font: inherit; }
.sig-wrap { position: relative; border: 2px dashed #b9c7d0; border-radius: 12px; background: #fff; margin: 8px 0 12px; }
.sig-wrap canvas { width: 100%; height: auto; display: block; touch-action: none; cursor: crosshair; border-radius: 10px; }
.sig-wrap [data-sig-clear] { position: absolute; right: 8px; top: 8px; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: #1e8e3e; box-shadow: 0 0 0 4px rgba(30,142,62,.18); flex: none; animation: pulse 1.8s infinite; }
.dot-off { width: 10px; height: 10px; border-radius: 50%; background: #c3ccd2; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(30,142,62,.05); } }
.tag-red { background: var(--red-50); color: var(--red-600); }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; font-size: 30px; margin-bottom: 8px; }
.stars input { display: none; } .stars label { color: #d0d7dc; cursor: pointer; } .stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f5b301; }
.req-preview { background: var(--navy-25); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin: 6px 0; font-size: 13.5px; }
.req-preview ul { margin: 6px 0 0 18px; padding: 0; }
.geo-sketch { width: 100%; max-width: 320px; height: auto; display: block; margin: 6px auto; }
[data-dictate].rec { color: var(--red); animation: pulse 1s infinite; }
.chat-chart { margin-top: 8px; background: #fff; border-radius: 8px; padding: 6px; } .chat-chart svg { width: 100%; height: auto; }
.price-ai { margin-top: 3px; } .chip-ai { border: 0; background: linear-gradient(135deg, #013950, #1f5c80); color: #fff; font: inherit; font-size: 11px; padding: 3px 8px; border-radius: 12px; cursor: pointer; }
.price-ai small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.punch-row, .plan-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .punch-row .t, .plan-row .t { flex: 1; display: flex; flex-direction: column; }
.punch-row .actions { display: flex; gap: 6px; }
.plan-row.picked { background: #f3fbf6; } .factors-inline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.factors-inline span { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef4f7; } .factors-inline span.neg { background: var(--red-50); color: var(--red-600); } .factors-inline span.pos { background: var(--ok-50); color: #14532d; }
.site-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.site-col { background: var(--navy-25); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; } .site-col h3 { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.score.hot { background: var(--red); color: #fff; }
tr.hl td { background: #fff8e6 !important; }
.table.heat td.h-red { background: #fde3e4; color: #8a1016; font-weight: 700; } .table.heat td.h-amber { background: #fdf0d9; } .table.heat td.h-green { background: #e8f6ee; }
ul.brief { margin: 4px 0 8px 18px; padding: 0; } ul.brief li { margin: 3px 0; }
.mailbody { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--navy-25); padding: 10px; border-radius: 8px; }
.factor { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 7px; background: var(--navy-25); margin: 4px 0; font-size: 13px; } .factor.neg { background: var(--red-50); }

@media (max-width: 900px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-nav { display: none; }
  .p-top { height: 56px; padding: 0 12px; } .p-brand span { display: none; } .p-user .who { display: none; }
  .p-content { padding: 14px 12px 30px; }
  .p-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(1,57,80,.08); }
  .p-bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 6px 0; }
  .p-bottom a.active { color: var(--navy); } .p-bottom .ico { width: 22px; height: 22px; }
  .p-punch { grid-template-columns: repeat(2, 1fr); } .p-pbtn { height: 70px; font-size: 16px; }
  .portal-client .p-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; top: auto; background: var(--navy); padding: 6px; z-index: 50; }
  .p-hello h1 { font-size: 21px; }
}
.p-mission > b { font-size: 17px; } .p-mission span b { font-size: inherit; color: var(--ink); }
@media (max-width: 1500px) { .p-brand span { display: none; } .p-nav a { padding: 8px 9px; font-size: 12.5px; } }

/* ======================= V4 ======================= */
.p-net { background: #fff4e0; border: 1px solid #f0d7a6; color: #7a4d0b; border-radius: 9px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.p-net[hidden], .p-offline[hidden] { display: none; }
.p-offline { border: 1px dashed #d9a441; background: #fffaf0; border-radius: 9px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.p-offline b { color: #7a4d0b; } .p-offline small { color: var(--muted); }
.sst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 6px 0 12px; }
.sst-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.sst-grid label:has(input:checked) { border-color: #9cc9b0; background: var(--ok-50); }
.sst-ai { margin: 10px 0; }
.sst-ai .p-tip { margin: 4px 0; }
.risk { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.risk-faible { background: var(--ok-50); color: #14532d; } .risk-moyen { background: #fff4e0; color: #7a4d0b; } .risk-eleve { background: var(--red-50); color: #8a1016; }
.ppe-shot { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 18px; align-items: start; }
.ppe-shot img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.ppe-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; font-size: 13.5px; }
.ppe-item.ok { border-color: #b9e0c8; background: var(--ok-50); } .ppe-item.bad { border-color: #f5b7ba; background: var(--red-50); } .ppe-item.unk { border-color: #f0d7a6; background: #fffaf0; }
.pay-box { max-width: 460px; margin: 30px auto; }
.pay-card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: #fff; box-shadow: 0 8px 30px rgba(1, 57, 80, .10); }
.pay-demo { background: #fff4e0; border: 1px solid #f0d7a6; color: #7a4d0b; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.pay-amount { font-size: 30px; font-weight: 800; color: var(--navy); margin: 4px 0 14px; }
.repl-cand { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; font-size: 13px; }
.repl-cand.current { border-color: #9cc9b0; background: var(--ok-50); }
@media (max-width: 760px) { .ppe-shot { grid-template-columns: 1fr; } }
.pub-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.pub-head { background: var(--navy); padding: 14px 18px; border-bottom: 4px solid var(--red); } .pub-head img { height: 34px; }
.pub-main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 30px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 6px 24px rgba(1, 57, 80, .08); }
.pub-card h1 { font-size: 21px; margin: 0 0 6px; color: var(--navy); }
.pub-facts { display: grid; gap: 8px; margin: 14px 0; } .pub-facts div { display: flex; gap: 10px; font-size: 14px; } .pub-facts b { min-width: 92px; color: var(--ink-2); font-weight: 600; }
.pub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; } .pub-actions .btn { justify-content: center; min-height: 48px; font-size: 15px; }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } @media (max-width: 1100px) { .g2-1 { grid-template-columns: 1fr; } }
.card > label.check { display: flex; margin: 6px 0; }
.lbl { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
.p-tip.info { background: #e4eef6; border-color: #b9d3e6; color: #1f4a66; }
.p-banner.ok { border-left-color: var(--ok); background: #f4fbf7; } .p-banner.ok .ico { color: var(--ok); }

/* ---------------------------------------------------------------- V5 : agents IA, carte, sécurité */
.geo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.geo-map { height: 620px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #e9eef2; }
.geo-map-sm { height: 300px; }
.geo-map.geo-offline::after { content: "Fond de carte indisponible (hors ligne) : les points restent affichés."; position: absolute; z-index: 500; left: 50%; top: 8px; transform: translateX(-50%); background: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); }
.geo-map { position: relative; }
.geo-toolbar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; margin-bottom: 10px; }
.geo-toolbar label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.geo-min { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.lg-client { background: #1f8a4c; } .lg-zone { background: rgba(31,92,128,.35); border: 1px solid #013950; } .lg-prospect { background: #ed1c24; }
.lg-crm { background: #cfd8de; border: 1px solid #55636c; } .lg-terr { border: 2px dashed #013950; border-radius: 3px; } .lg-site { background: #2e7d32; border-radius: 2px; }
.lg-crew { background: #ce93d8; } .lg-dens { background: #013950; width: 5px; height: 5px; }
.gap-row { padding: 7px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; cursor: default; }
.gap-row[data-lat] { cursor: pointer; } .gap-row[data-lat]:hover b { color: var(--red); }
.gap-row .tag, .gap-row form { margin-left: auto; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.agent-card.off { opacity: .65; }
.agent-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-trace { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.agent-trace li { position: relative; padding: 10px 12px 10px 40px; border-left: 2px solid var(--line); margin-left: 14px; }
.agent-trace li::before { counter-increment: st; content: counter(st); position: absolute; left: -14px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.agent-trace li.k-pensee::before { background: var(--warn); } .agent-trace li.k-decision::before { background: var(--ok); } .agent-trace li.k-alerte::before { background: var(--red); }
.agent-trace li.k-resultat::before { background: var(--ok); }
.agent-trace .t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .agent-trace p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.agent-trace details { margin-top: 6px; } .agent-data { max-height: 260px; overflow: auto; background: var(--navy-25); padding: 8px; border-radius: 6px; font-size: 11.5px; }
.qr-box { display: flex; gap: 16px; align-items: center; } .qr-box svg { flex: none; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.steps-list { padding-left: 20px; } .steps-list li { margin-bottom: 8px; }
.kpi.bad b { color: var(--red-600); }
@media (max-width: 980px) { .geo-layout { grid-template-columns: 1fr; } .geo-map { height: 460px; } .geo-min { margin-left: 0; } }
@media print { .geo-toolbar, .geo-side form { display: none; } }
.prop-card { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.prop-card:last-child { border-bottom: 0; }
.prop-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prop-card small { display: block; margin-top: 4px; color: var(--ink-2); }
.prop-card .form-actions { justify-content: flex-start; margin-top: 8px; }
/* Finance DETEC23 */
.margin-table td, .margin-table th { white-space: nowrap; font-size: 12.5px; }
.margin-table td:first-child { position: sticky; left: 0; background: var(--card, #fff); z-index: 1; min-width: 230px; white-space: normal; }
.margin-table tr.hl td { background: var(--navy-25, #eef3f6); }
.margin-table tr.total td { border-top: 2px solid var(--navy); }
.margin-table tr.fam td { background: #f7f9fa; }
.margin-table tr.sub td:first-child { padding-left: 26px; }
.margin-table tr.sep td { background: var(--navy); color: #fff; }
.margin-table tr.warn td, table.journal tr.warn td { background: #fff7e6; }
.inline-edit { position: relative; }
.inline-edit[open] .mini-form { position: absolute; right: 0; z-index: 30; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 10px; display: grid; gap: 6px; width: 280px; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; } .pager a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; } .pager a.active { background: var(--navy); color: #fff; }
