/* ==================================================================
   KAZ CRM — Feuille de style
   Charte : Noir #262626 · Or #B18D49 · Blanc · Police Cairo
   4 affichages : iPhone (< 700) · iPad (700–1279) · MacBook (1280–1679) · PC (≥ 1680)
   ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 2px; border-radius: 4px; }

:root {
  --noir: #262626;
  --fond: #1a1a1a;
  --fond-2: #1f1f1f;
  --surface: #262626;
  --surface-2: #2e2e2e;
  --ligne: #353535;
  --or: #B18D49;
  --or-clair: #d4b06e;
  --or-pale: #e8d3a8;
  --or-sombre: #3a3226;
  --bleu: #6fa8dc;
  --bleu-sombre: #26303a;
  --vert: #7cc29a;
  --rouge: #e5484d;
  --texte: #f1eee9;
  --texte-2: #c9c4bb;
  --texte-3: #a39d93;
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --r-lg: 20px;
  --side: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; color: #fff; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--or); color: #1a1a1a; padding: 8px 12px; border-radius: 8px; }
.ic { flex-shrink: 0; }
.muted { color: var(--texte-3); }
.small { font-size: 13px; }
.gold { color: var(--or-clair); }

/* ------------------------------------------------ Structure ------ */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.main {
  padding: calc(var(--safe-t) + 20px) 18px calc(96px + var(--safe-b));
  max-width: 1720px;
  margin: 0 auto;
}
.main.flush { padding-top: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--safe-b));
  background: rgba(30, 30, 30, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ligne);
}
.tabbar a {
  min-width: 64px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--texte-3);
}
.tabbar a.on { color: var(--or); }

/* iPad : barre latérale compacte (icônes + libellés courts) */
@media (min-width: 700px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; width: 92px; z-index: 30;
    background: #202020; border-right: 1px solid var(--ligne);
    padding: calc(var(--safe-t) + 18px) 8px 18px;
  }
  .brand { display: flex; justify-content: center; margin-bottom: 18px; }
  .brand span { display: none; }
  .sidebar ul { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; flex: 0 1 auto; scrollbar-width: none; }
  .sidebar ul a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 4px; border-radius: 12px; font-size: 11px; color: var(--texte-2);
  }
  .sidebar ul a:hover { background: var(--surface); }
  .sidebar ul a.on { background: var(--or-sombre); color: #fff; }
  .sidebar ul a.on .ic { color: var(--or-clair); }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; }
  .side-foot .who { display: none; }
  .side-foot .link span { display: none; }
  .main { margin-left: 92px; padding: 32px 28px 48px; }
}

/* MacBook : barre latérale complète */
@media (min-width: 1280px) {
  .sidebar { width: 248px; padding: 28px 16px 20px; }
  .brand { justify-content: flex-start; align-items: center; gap: 12px; padding: 0 10px; margin-bottom: 26px; }
  .brand span { display: block; font-size: 19px; letter-spacing: .5px; line-height: 1.1; }
  .brand span strong { font-weight: 900; }
  .brand small { display: block; font-size: 10px; letter-spacing: 3px; color: var(--or); font-weight: 600; margin-top: 2px; }
  .sidebar ul a { flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 15px; }
  .side-foot { align-items: stretch; padding: 0 10px; font-size: 13px; }
  .side-foot .who { display: block; color: var(--texte-3); }
  .side-foot .link span { display: inline; }
  .main { margin-left: 248px; padding: 36px 44px 56px; }
}

/* PC : grand écran */
@media (min-width: 1680px) {
  .main { padding: 40px 56px 64px; }
  h1 { font-size: 34px; }
}

/* ------------------------------------------------ Éléments ------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--or); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.section-head a { color: var(--or-clair); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid #444; background: var(--surface); color: #fff;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--or); }
.btn.primary { background: var(--or); border-color: var(--or); color: #1a1a1a; font-weight: 700; }
.btn.primary:hover { background: var(--or-clair); }
.btn.danger { border-color: #6b2b2d; color: #ffb3b5; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.link { color: var(--or-clair); display: inline-flex; align-items: center; gap: 6px; }

.card { background: var(--surface); border-radius: var(--r); padding: 16px; }
.card.line { border: 1px solid var(--ligne); background: #222; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #233026; color: #bfe3cc; border: 1px solid #2f5a3c; }
.flash.err { background: #3a2223; color: #ffc2c4; border: 1px solid #6b2b2d; }
.hint { font-size: 13px; color: var(--texte-3); }
.empty { padding: 28px; text-align: center; color: var(--texte-3); border: 1px dashed #444; border-radius: var(--r); }

.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 10px; }
.badge.gold { background: var(--or); color: #1a1a1a; }
.badge.ok { background: #2f5a3c; color: #d7f0df; }
.badge.neutral { background: #3a3a3a; color: #fff; }
.badge.blue { background: var(--bleu); color: #1a1a1a; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #444; color: var(--texte-2); font-size: 14px; }
.chip.on { background: #fff; border-color: #fff; color: #1a1a1a; font-weight: 700; }
.chip.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.small-chips { margin-top: -8px; }
.pcard.closed img { filter: grayscale(.7) brightness(.8); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* Grilles adaptatives */
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px)  { .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid.g3, .grid.g4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1680px) { .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Tableau de bord : colonne latérale sur grand écran */
.dash { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .dash { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (min-width: 1680px) { .dash { grid-template-columns: minmax(0, 1fr) 420px; } }

/* Lignes (agenda, listes) */
.rows { background: var(--surface); border-radius: var(--r); padding: 2px 16px; }
.row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ligne); min-height: 52px; }
.row:last-child { border-bottom: 0; }
.row .time { width: 52px; font-weight: 700; color: var(--or); font-size: 14px; flex-shrink: 0; }
.row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .body b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .body span { font-size: 13px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { font-size: 12px; color: var(--texte-3); flex-shrink: 0; }
a.row:hover b { color: var(--or-clair); }

/* Cartes projet (couverture photo) */
.pcard { position: relative; display: block; height: 220px; border-radius: var(--r-lg); overflow: hidden; background: #24221f; }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.pcard:hover img { transform: scale(1.03); }
.pcard .over { position: absolute; inset: auto 0 0 0; padding: 16px; background: linear-gradient(transparent, rgba(0,0,0,.88)); display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pcard .code { font-size: 12px; color: var(--or-pale); font-weight: 600; letter-spacing: .5px; }
.pcard .name { font-size: 22px; font-weight: 900; color: #fff; line-height: 1.15; }
.pcard .sub { font-size: 13px; color: #d6d2cb; }
.pcard .tag { position: absolute; top: 12px; left: 12px; font-size: 11px; color: var(--or-pale); background: rgba(0,0,0,.55); border: 1px solid var(--or); border-radius: 10px; padding: 1px 10px; }
@media (min-width: 1280px) { .pcard { height: 250px; } }
.scroller { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.scroller .pcard { flex: 0 0 240px; height: 160px; scroll-snap-align: start; }
.scroller .pcard .name { font-size: 17px; }

/* Fiche projet */
.hero { position: relative; height: 330px; margin: 0 -18px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,0) 35%, var(--fond)); }
.hero .back { position: absolute; z-index: 2; top: calc(var(--safe-t) + 14px); left: 14px; width: 44px; height: 44px; border-radius: 22px; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.hero .tag { position: absolute; z-index: 2; top: calc(var(--safe-t) + 24px); right: 14px; font-size: 11px; background: rgba(0,0,0,.55); border: 1px solid var(--or); color: var(--or-pale); border-radius: 12px; padding: 2px 10px; }
.hero .txt { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 16px; }
.hero .txt .code { font-size: 12px; color: var(--or-pale); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.hero .txt h1 { font-size: 32px; font-weight: 900; }
.hero .txt p { color: #d6d2cb; font-size: 14px; }
@media (min-width: 700px) { .hero { margin: 0 -28px; height: 380px; } }
@media (min-width: 1280px) { .hero { margin: 0 -44px; height: 420px; border-radius: 0 0 24px 24px; } .hero .txt { left: 44px; bottom: 28px; } .hero .txt h1 { font-size: 44px; } }
@media (min-width: 1680px) { .hero { margin: 0 -56px; } }
.quick { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.quick .btn { flex: 1 1 auto; white-space: nowrap; }
@media (max-width: 699px) { .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -18px; margin-right: -18px; padding: 0 18px; } .quick .btn { flex: 0 0 auto; } }
@media (min-width: 700px) { .quick .btn { flex: 0 0 auto; } }
.two { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .two { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }

.phase { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ligne); min-height: 48px; }
.phase:last-child { border-bottom: 0; }
.phase .dot { width: 24px; height: 24px; border-radius: 12px; border: 2px solid #555; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #1a1a1a; }
.phase .dot.full { background: var(--or); border-color: var(--or); }
.phase .lbl { flex: 1; font-size: 14px; min-width: 0; }
.phase .n { font-size: 12px; color: var(--texte-3); }

.photos { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 700px) { .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.photos a { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #2a2a2a; display: block; position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .ext { position: absolute; bottom: 4px; right: 4px; font-size: 10px; background: rgba(0,0,0,.6); border-radius: 6px; padding: 0 6px; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--texte-2); }
.form input:not([type]), .form input[type=text], .form input[type=password], .form input[type=date], .form input[type=time],
.form input[type=datetime-local], .form input[type=number], .form input[type=search], .form input[type=tel], .form input[type=email], .form select, .form textarea {
  background: #1d1d1d; border: 1px solid #444; border-radius: 12px; padding: 10px 14px; min-height: 46px; color: #fff; font-size: 16px; width: 100%;
}
.form textarea { min-height: 110px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--or); outline: none; }
.form .check { flex-direction: row; align-items: center; gap: 12px; min-height: 44px; }
.form .check input { width: 22px; height: 22px; accent-color: var(--or); }
.form .cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .form .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 6px; }
.panel { max-width: 760px; }

/* Statistiques (pipeline commercial) */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px 16px; border-top: 3px solid var(--or); display: flex; flex-direction: column; }
.stat .k { font-size: 13px; color: var(--texte-3); }
.stat .v { font-size: 28px; font-weight: 900; line-height: 1.2; }

/* Organisation */
.org { display: flex; flex-direction: column; gap: 6px; background: #222; border: 1px solid var(--ligne); border-radius: var(--r); padding: 16px; min-height: 150px; }
.org:hover { border-color: var(--or); }
.org .num { font-size: 12px; color: var(--or); font-weight: 700; letter-spacing: 1px; }
.org h3 { font-size: 18px; }
.org p { font-size: 14px; color: var(--texte-2); }
.org .meta { margin-top: auto; font-size: 12px; color: var(--texte-3); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--texte-3); margin-bottom: 14px; align-items: center; }
.crumbs a { color: var(--or-clair); }
.files { background: var(--surface); border-radius: var(--r); padding: 2px 16px; }
.files .row .ic { color: var(--or); }
.search, .form.search { display: flex; flex-direction: row; gap: 8px; margin-bottom: 16px; }
.search .btn { flex-shrink: 0; width: 52px; padding: 0; }
.search input { flex: 1; }

/* Planning */
.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { white-space: nowrap; flex: none; }
.seg a { padding: 0 14px; height: 36px; display: flex; align-items: center; border-radius: 8px; font-size: 14px; color: var(--texte-2); }
.seg a.on { background: var(--or); color: #1a1a1a; font-weight: 700; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; margin-bottom: 14px; }
.week a { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-radius: 12px; }
.week a span { font-size: 11px; color: var(--texte-3); }
.week a b { font-size: 17px; font-weight: 600; }
.week a.on { background: var(--or); color: #1a1a1a; }
.week a.on span { color: #1a1a1a; font-weight: 700; }
.week a.today b { color: var(--or-clair); }
.week a.on.today b { color: #1a1a1a; }
.week a .has { width: 5px; height: 5px; border-radius: 3px; background: var(--or); margin: 2px auto 0; }
.week a.on .has { background: #1a1a1a; }
.nav-dates { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.nav-dates .arrows { display: flex; gap: 6px; }
.ev { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--or); background: var(--or-sombre); }
.ev.k-tache { background: #262626; border: 1px dashed #666; border-left: 4px solid #888; }
.ev.k-rdv, .ev.k-periode { background: var(--bleu-sombre); border-left-color: var(--bleu); }
.ev.k-echeance { background: #3a2223; border-left-color: var(--rouge); }
.ev.done { opacity: .55; }
.ev b { font-size: 15px; }
.ev span { font-size: 13px; color: var(--texte-2); }
.ev small { font-size: 12px; color: var(--or-pale); }
.agenda { display: flex; flex-direction: column; gap: 10px; margin-bottom: 72px; }
.agenda .slot { display: flex; gap: 12px; }
.agenda .slot .h { width: 48px; font-size: 13px; color: var(--texte-3); padding-top: 12px; flex-shrink: 0; }
.agenda .slot .ev { flex: 1; }
.weekcols { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .weekcols { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.weekcols .day { background: #212121; border-radius: var(--r); padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.weekcols .day h3 { font-size: 13px; color: var(--texte-2); font-weight: 600; }
.weekcols .day.today h3 { color: var(--or-clair); }
.weekcols .ev { padding: 8px 10px; }
.weekcols .ev b { font-size: 13px; }
.fab { position: fixed; right: 18px; bottom: calc(92px + var(--safe-b)); z-index: 35; box-shadow: 0 10px 24px rgba(0,0,0,.5); border-radius: 26px; min-height: 52px; }
@media (min-width: 700px) { .fab { bottom: 28px; right: 28px; } }
.sync { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--texte-2); margin-top: 18px; }
.sync .ic { color: var(--or); }

/* Gantt */
.gantt-wrap { overflow-x: auto; background: #222; border-radius: 18px; padding: 14px 16px; }
.gantt { min-width: 900px; }
.g-row { display: grid; grid-template-columns: 200px repeat(var(--cols), minmax(0, 1fr)); align-items: center; column-gap: 4px; min-height: 64px; border-bottom: 1px solid #2f2f2f; }
.g-row:last-child { border-bottom: 0; }
.g-head { min-height: 40px; font-size: 12px; color: var(--texte-3); border-bottom: 1px solid #383838; }
.g-head .now { color: var(--or); font-weight: 700; }
.g-label { grid-column: 1; display: flex; flex-direction: column; }
.g-label b { font-size: 15px; }
.g-label span { font-size: 12px; color: var(--texte-3); }
.g-bar { grid-row: 1; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 600; display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: #3a3a3a; color: #fff; }
.g-bar.k-intervention { background: var(--or); color: #1a1a1a; }
.g-bar.k-periode { background: #6b5a3a; }
.g-bar.k-rdv { background: var(--bleu); color: #1a1a1a; }
.g-bar.k-echeance { background: #6b2b2d; }
.g-bar.done { opacity: .5; }
.g-lanes { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 4px; row-gap: 4px; padding: 6px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--texte-2); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }

/* Plus (menu iPhone) */
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ligne); font-size: 16px; min-height: 52px; }
.menu-list a .ic { color: var(--or); }
.menu-list a:last-child { border-bottom: 0; }

/* Connexion */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #2c2a26, var(--fond) 60%); }
.login-card { width: 100%; max-width: 400px; background: #222; border: 1px solid #333; border-radius: 22px; padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; }
.login-logo { width: 170px; height: auto; margin: 0 auto 8px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-foot { font-size: 12px; color: var(--texte-3); text-align: center; margin-top: 8px; }
.login-foot strong { font-weight: 900; }

/* Tableaux simples */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--texte-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
.table td { padding: 10px; border-bottom: 1px solid #2c2c2c; }
.table-box { overflow-x: auto; background: var(--surface); border-radius: var(--r); padding: 6px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #1d1d1d; padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* Import par glisser-déposer */
.drop-hint { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; }
.dropzone { transition: outline-color .15s; outline: 2px dashed transparent; outline-offset: 4px; }
.drop-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(26, 26, 26, .82); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-overlay > div { border: 2px dashed var(--or); border-radius: 24px; padding: 48px 64px; text-align: center; color: var(--or-pale); display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 18px; }
.drop-overlay b { color: #fff; }
.upload-dialog { margin: auto; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 48px); background: #222; color: var(--texte); border: 1px solid #3a3a3a; border-radius: 20px; padding: 22px; }
.upload-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.upload-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.upload-list li { background: #1d1d1d; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.upload-list .orig { font-size: 12px; color: var(--texte-3); display: flex; justify-content: space-between; gap: 10px; }
.upload-list input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px !important; }
.upload-list progress { width: 100%; height: 6px; accent-color: var(--or); }
.upload-list .st { font-size: 12px; }
.upload-list .st.ok { color: #9fd6b3; }
.upload-list .st.err { color: #ffb3b5; }

/* Journal du projet / correspondance */
.journal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.journal-bar .chips { margin: 0; }
.journal { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.j-item { display: flex; gap: 12px; background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.j-ic { width: 34px; height: 34px; border-radius: 17px; background: #2f2f2f; color: var(--or); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.j-mail.out .j-ic { background: var(--or-sombre); }
.j-wa .j-ic { color: #7cc29a; }
.j-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.j-meta { font-size: 12px; color: var(--texte-3); }
.j-title { font-size: 15px; color: #fff; }
.j-body details summary { cursor: pointer; font-size: 14px; color: var(--texte-2); list-style: none; }
.j-body details summary::-webkit-details-marker { display: none; }
.j-body details[open] summary { color: var(--texte-3); margin-bottom: 8px; }
.mail-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: #1d1d1d; border-radius: 10px; padding: 12px 14px; max-height: 520px; overflow: auto; overflow-wrap: anywhere; }
.j-atts { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.j-atts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form select { background: #1d1d1d; border: 1px solid #444; border-radius: 10px; min-height: 36px; padding: 0 10px; color: #fff; font-size: 13px; max-width: 100%; }
.inline-form .check { display: inline-flex; gap: 6px; align-items: center; color: var(--texte-2); }
.classify { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.j-body audio { width: 100%; max-width: 420px; height: 40px; }
.bubbles { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.bubble { max-width: min(560px, 88%); align-self: flex-start; background: #2c2c2c; border-radius: 14px 14px 14px 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble.out { align-self: flex-end; background: var(--or-sombre); border-radius: 14px 14px 4px 14px; }
.bubble .b-meta { font-size: 11px; color: var(--texte-3); }
.bubble .b-text { white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.bubble img { max-width: 260px; max-height: 260px; border-radius: 10px; object-fit: cover; }
.bubble audio { max-width: 280px; }
#rec-btn.recording { background: var(--rouge); border-color: var(--rouge); color: #fff; }
p .ic, .small .ic, .hint .ic, .j-meta .ic { display: inline-block; vertical-align: -2px; margin-right: 4px; }

/* ---------------------------------------------------------------- Questionnaire de cadrage */
.steps { position: sticky; top: calc(var(--safe-t) + 0px); z-index: 5; background: var(--fond); padding: 8px 0; margin: 0 0 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps .chip { flex: none; }
.cadrage { gap: 16px; }
.cad-sec { scroll-margin-top: 64px; display: flex; flex-direction: column; gap: 12px; }
.cad-sec h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 18px; margin: 0; }
.cad-sec h2 > span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--or); color: #1a1a1a; font-size: 14px; font-weight: 800; flex: none; }
.cad-sec h2 small { font-size: 13px; font-weight: 400; }
.cad-grid { display: grid; gap: 12px 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px)  { .cad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cad-grid h3 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--or); border-top: 1px solid var(--ligne); padding-top: 12px; }
.cad-grid h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.cad-grid [hidden] { display: none !important; }
.cad-grid label:has(textarea), .cad-grid fieldset.pills { grid-column: 1 / -1; }
fieldset.pills { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.pills legend { font-size: 14px; color: var(--texte-2); padding: 0; margin-bottom: 8px; }
fieldset.pills > div { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.pills label { display: inline-flex; cursor: pointer; }
fieldset.pills input { position: absolute; opacity: 0; pointer-events: none; }
fieldset.pills span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid #444; color: var(--texte-2); font-size: 14px; }
fieldset.pills input:checked + span { background: var(--or); border-color: var(--or); color: #1a1a1a; font-weight: 700; }
fieldset.pills input:focus-visible + span { outline: 2px solid var(--or-clair); outline-offset: 2px; }
.team { display: flex; flex-direction: column; gap: 10px; }
.team-row { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px solid var(--ligne); }
.team-row:last-child { border-bottom: 0; }
.team-row b { font-size: 14px; color: var(--texte-2); font-weight: 600; align-self: center; }
.team-row input { background: #1d1d1d; border: 1px solid #444; border-radius: 12px; padding: 10px 14px; min-height: 44px; color: #fff; font-size: 16px; width: 100%; }
@media (min-width: 700px)  { .team-row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .team-row { grid-template-columns: 1.1fr 1.3fr 1fr 1.3fr; } }
.sticky-actions { position: sticky; bottom: calc(var(--safe-b) + 70px); z-index: 5; background: rgba(26,26,26,.92); backdrop-filter: blur(8px); padding: 10px 0; }
@media (min-width: 700px) { .sticky-actions { bottom: 0; } }

/* Évaluation du chiffrage */
.estim { display: flex; flex-direction: column; gap: 12px; }
.estim-total { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 700px) { .estim-total { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); } }
.estim-total .big { font-size: 30px; font-weight: 800; color: var(--or-clair); margin: 2px 0; line-height: 1.15; }
.estim-total .big span { font-size: 18px; font-weight: 400; color: var(--texte-3); }
.estim-budget { border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; border: 1px solid; }
.estim-budget b { font-size: 15px; }
.estim-budget.ok   { border-color: #2f5a3c; background: #1f3026; color: #d7f0df; }
.estim-budget.info { border-color: #2c4a63; background: #1f2a33; color: #d6e7f5; }
.estim-budget.warn { border-color: var(--or); background: var(--or-sombre); color: var(--or-pale); }
.estim-budget.err  { border-color: #7a2a2d; background: #3a1f20; color: #f5d0d1; }
.estim-dev { margin: 0; font-size: 14px; color: var(--texte-2); }
.estim-lot { background: #1f1f1f; border-radius: 12px; border: 1px solid var(--ligne); }
.estim-lot summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 15px; }
.estim-lot summary::-webkit-details-marker { display: none; }
.estim-lot summary b { white-space: nowrap; color: var(--texte); }
.estim-lot summary em { display: inline-block; white-space: nowrap; font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-left: 6px; vertical-align: 2px; }
.estim-lot summary em.t-grille { background: var(--or); color: #1a1a1a; }
.estim-lot summary em.t-estim { background: #3a3a3a; color: #ddd; }
.estim-lot table { width: 100%; border-collapse: collapse; font-size: 14px; }
.estim-lot td { padding: 8px 14px; border-top: 1px solid var(--ligne); vertical-align: top; }
.estim-lot td small { display: block; color: var(--texte-3); font-size: 12px; }
.estim-lot td.num { text-align: right; white-space: nowrap; }
.estim-alerts { border-left: 3px solid var(--or); padding: 4px 0 4px 14px; }
.estim-alerts ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--texte-2); }
.estim-alerts li { margin-bottom: 4px; }
.btn.gold { border-color: var(--or); color: var(--or-clair); }

/* ---------------------------------------------------------------- Recherche globale et annuaire */
.search-box { display: flex; align-items: center; gap: 10px; background: #1d1d1d; border: 1px solid #444; border-radius: 14px; padding: 0 14px; min-height: 52px; margin: 0 0 16px; }
.search-box:focus-within { border-color: var(--or); box-shadow: 0 0 0 3px rgba(177,141,73,.25); }
.search-box .ic { color: var(--texte-3); flex: none; }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font-size: 17px; font-family: inherit; padding: 12px 0; outline: none; }
.search-box input::-webkit-search-cancel-button { filter: invert(1); }
.search-empty { color: var(--texte-2); padding: 12px 2px; }
.search-group { margin-bottom: 22px; }
.search-group h2 { font-size: 17px; margin: 0; }
.search-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); }
.search-list > li { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--ligne); padding-right: 10px; }
.search-list > li:first-child { border-top: 0; }
.sr-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 6px 12px 14px; color: inherit; }
.sr-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #2a2a2a; color: var(--or-clair); flex: none; }
.sr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-txt small { color: var(--texte-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-txt small.sr-meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-main .badge { flex: none; }
.sr-act { display: flex; gap: 4px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: none; border: 1px solid #444; color: var(--texte-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--or); color: var(--or-clair); }
mark { background: rgba(177,141,73,.35); color: #fff; border-radius: 3px; padding: 0 1px; }
.contact-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .contact-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-split > span { display: inline-flex; align-items: center; gap: 6px; }
.link-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-form select, .link-form input { flex: 1 1 180px; min-height: 44px; background: #1d1d1d; border: 1px solid #444; border-radius: 12px; color: #fff; padding: 0 12px; font-size: 15px; }
.empty-state { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link.danger { color: #e8a0a2; background: none; border: 0; cursor: pointer; font-size: 14px; }
.chips .chip span { opacity: .65; font-weight: 400; }
.page-head .search-btn { display: none; }
@media (max-width: 699px) { .page-head .search-btn { display: inline-grid; } }
.project-contacts { margin: 22px 0; }
body:has(#search-form) .page-head .search-btn { display: none; }
@media (max-width: 699px) { .sr-main .badge { display: none; } .search-list > li { padding-right: 8px; } }

/* ---------------------------------------------------------------- Commandes Siri (Compte) */
.siri { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.siri h2 { display: flex; align-items: center; gap: 10px; }
.siri h3 { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--or); margin: 14px 0 0; }
.siri-keys { display: flex; flex-direction: column; gap: 8px; }
.siri-keys > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.siri-keys .small { width: 110px; flex: none; }
.siri-keys code { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; background: #1d1d1d; border: 1px solid #333; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.siri-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--texte-2); font-size: 15px; }
.siri-steps ul { margin: 6px 0 0; padding-left: 18px; }
.siri-help { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .siri-help { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.siri-help > div { background: #1f1f1f; border: 1px solid var(--ligne); border-radius: 12px; padding: 12px 14px; }
.siri-help h4 { margin: 0 0 6px; font-size: 14px; color: var(--or-clair); }
.siri-help dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 14px; }
.siri-help dt { font-weight: 700; color: #fff; }
.siri-help dd { margin: 0; color: var(--texte-2); }
@media (max-width: 520px) { .siri-help dl { grid-template-columns: 1fr; } .siri-help dd { margin-bottom: 6px; } }
.siri-test { display: flex; flex-wrap: wrap; gap: 8px; }
.siri-test input, .siri-test select { flex: 1 1 220px; min-height: 44px; background: #1d1d1d; border: 1px solid #444; border-radius: 12px; color: #fff; padding: 0 12px; font-size: 15px; }
.siri-test input { flex-basis: 100%; }
.siri-out { margin: 4px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.siri-out:empty { display: none; }
.siri-out.ok { background: #1f3026; color: #d7f0df; border: 1px solid #2f5a3c; }
.siri-out.err { background: #3a1f20; color: #f5d0d1; border: 1px solid #7a2a2d; }

/* ---------------------------------------------------------------- Planning : mois, 3 mois, liste */
.page-head .seg { flex-wrap: wrap; }
.nav-dates .arrows { flex-wrap: wrap; align-items: center; }
.jump input[type=month] { min-height: 36px; background: #1d1d1d; border: 1px solid #444; border-radius: 10px; color: #fff; padding: 0 10px; font: inherit; font-size: 14px; color-scheme: dark; }
.mgrid { background: #212121; border-radius: var(--r); overflow: hidden; border: 1px solid var(--ligne); }
.mgrid-head, .mgrid-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mgrid-head span { padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--texte-3); border-bottom: 1px solid var(--ligne); }
.mday { min-height: 118px; padding: 6px; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mday:nth-child(7n) { border-right: 0; }
.mday.we { background: #1e1e1e; }
.mday.out { background: #1a1a1a; }
.mday.out .mnum { color: #555; }
.mnum { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--texte-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mnum:hover { background: #333; }
.mday.today .mnum { background: var(--or); color: #1a1a1a; }
.chip-ev { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--or-sombre); border-left: 3px solid var(--or); color: #fff; }
.chip-ev i { font-style: normal; color: var(--or-pale); margin-right: 2px; }
.chip-ev.k-rdv, .chip-ev.k-periode { background: var(--bleu-sombre); border-left-color: var(--bleu); }
.chip-ev.k-tache { background: #2a2a2a; border-left-color: #888; }
.chip-ev.k-echeance { background: #3a2223; border-left-color: var(--rouge); }
.chip-ev.multi { border-radius: 3px; }
.chip-ev.done { opacity: .5; text-decoration: line-through; }
.chip-ev:hover { filter: brightness(1.25); }
.mday .more { font-size: 12px; color: var(--or-clair); padding-left: 4px; }
.mgrid.compact .mday { min-height: 78px; padding: 4px; }
.mgrid.compact .mgrid-head span { padding: 6px 4px; text-align: center; }
.mgrid.compact .chip-ev { font-size: 11px; padding: 2px 4px; }
.mgrid.compact .chip-ev i { display: none; }
.mgrid.compact .mnum { width: 22px; height: 22px; font-size: 12px; }
.months3 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .months3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.months3 h2 { font-size: 17px; margin: 0 0 8px; }
.list-month { margin-bottom: 22px; }
.list-ev { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-ev li { display: flex; gap: 12px; align-items: stretch; }
.list-date { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #212121; }
.list-date span { font-size: 11px; color: var(--texte-3); text-transform: uppercase; }
.list-date b { font-size: 19px; }
.list-date.today { background: var(--or); color: #1a1a1a; }
.list-date.today span { color: #1a1a1a; }
.list-ev .ev { flex: 1; min-width: 0; }
/* iPhone : la grille mensuelle passe en points */
@media (max-width: 699px) {
  .mday { min-height: 58px; padding: 3px; }
  .mgrid-head span { padding: 6px 2px; text-align: center; font-size: 11px; }
  .chip-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; background: var(--or); }
  .chip-ev.k-rdv, .chip-ev.k-periode { background: var(--bleu); }
  .chip-ev.k-echeance { background: var(--rouge); }
  .chip-ev.k-tache { background: #888; }
  .mday .more { font-size: 10px; }
}

/* ---------------------------------------------------------------- Journal des traitements (mails) */
.badge.err { background: #7a2a2d; color: #f5d0d1; }
.tlog { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); }
.tlog-day { padding: 10px 14px 6px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--or); border-top: 1px solid var(--ligne); }
.tlog-day:first-child { border-top: 0; }
.tlog-item { display: grid; grid-template-columns: 46px 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--ligne); }
.tlog-time { font-size: 13px; color: var(--texte-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.tlog-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #2a2a2a; color: var(--texte-2); }
.r-classe .tlog-ic { background: #1f3026; color: #9fd9b0; }
.r-a_classer .tlog-ic { background: var(--or-sombre); color: var(--or-clair); }
.r-erreur .tlog-ic { background: #3a1f20; color: #f0a0a3; }
.tlog-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tlog-body b { font-weight: 600; overflow-wrap: anywhere; }
.tlog-body small { font-size: 13px; color: var(--texte-3); }
.tlog-detail { color: var(--texte-2) !important; }
.runs { margin-top: 12px; }
.runs summary { cursor: pointer; color: var(--or-clair); font-size: 14px; padding: 6px 0; }
.runs td small { display: block; color: var(--texte-3); white-space: pre-wrap; }

/* ---------------------------------------------------------------- Dossier de dépôt */
.drop-depot { border: 2px dashed #555; border-radius: var(--r); padding: 22px; text-align: center; color: var(--texte-2); margin-bottom: 18px; transition: .15s; }
.drop-depot .ic { color: var(--or); }
.drop-depot p { margin: 6px 0; }
.drop-depot.over { border-color: var(--or); background: var(--or-sombre); }
.drop-depot.busy { opacity: .7; }
.depot-progress { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.depot-progress li { padding: 6px 10px; border-radius: 8px; background: #222; }
.depot-progress li.ok { background: #1f3026; color: #d7f0df; }
.depot-progress li.wait { background: var(--or-sombre); color: var(--or-pale); }
.depot-progress li.err { background: #3a1f20; color: #f5d0d1; }
.depot-classify { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.depot-classify select { flex: 1 1 220px; min-height: 40px; background: #1d1d1d; border: 1px solid #444; border-radius: 10px; color: #fff; padding: 0 10px; font-size: 14px; }
.help-rules { margin-top: 18px; }
.help-rules summary { cursor: pointer; }
.help-rules ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--texte-2); }

/* ------------------------------------------------------------------ Avancement du projet */
.or { color: var(--or-clair); }
.ptabs { display: flex; gap: 6px; margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ligne); }
.ptabs a { position: relative; display: flex; align-items: center; gap: 7px; padding: 10px 11px 12px; font-size: 14px; color: var(--texte-3); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptabs a.on { color: var(--texte); border-color: var(--or); font-weight: 700; }
.ptabs-bar { display: block; width: 46px; height: 4px; border-radius: 2px; background: #3a3a3a; overflow: hidden; }
.ptabs-bar b { display: block; height: 100%; background: var(--or); }
.hero + .ptabs, .quick + .ptabs { margin-top: 14px; }

.avc-top { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .avc-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; } }
.avc-main { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 20px; }
.avc-main .ring { flex-shrink: 0; width: 150px; height: 150px; }
@media (min-width: 700px) { .avc-main .ring { width: 190px; height: 190px; } }
.avc-main-txt { flex: 1; min-width: 220px; }
.avc-main-txt h2 { font-size: 34px; font-weight: 900; line-height: 1.1; margin: 2px 0 6px; }
.delta { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 10px; vertical-align: middle; }
.delta.up { background: #23362b; color: var(--vert); } .delta.down { background: #3a2424; color: #f08b8e; }
.avc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.avc-split div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; color: var(--texte-2); }
.avc-split b { font-size: 16px; color: var(--texte); }
.avc-split i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #3a3a3a; overflow: hidden; }
.avc-split i b { display: block; height: 100%; background: var(--or); }
.avc-split small { grid-column: 1 / -1; color: var(--texte-3); font-size: 11px; }
.avc-kpi { align-content: stretch; }
@media (min-width: 1280px) { .avc-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.avc-kpi .v small { font-size: 16px; color: var(--texte-3); font-weight: 600; }
.avc-kpi .v.sm { font-size: 20px; }
.ring-pct { fill: var(--texte); font-weight: 900; font-family: var(--font); }
.ring-unit { fill: var(--texte-3); }
.ring-lbl { fill: var(--texte-3); font-size: 13px; font-family: var(--font); }

.life { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 4px; counter-reset: st; }
.life li { flex: 1 0 110px; position: relative; background: var(--surface); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); }
.life li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.life li::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; width: var(--p); background: var(--or); }
.life a { display: flex; flex-direction: column; padding: 10px 18px 12px 24px; font-size: 13px; color: var(--texte-3); position: relative; }
.life b { color: var(--texte-2); font-size: 14px; }
.life li.ok { background: #24352b; } .life li.ok::before { background: var(--vert); } .life li.ok b { color: var(--vert); }
.life li.now { background: var(--or-sombre); } .life li.now b { color: var(--or-pale); }

.bars { padding: 10px 16px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 44px 22px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--ligne); }
.bar-row:last-child { border-bottom: 0; }
.bar-row .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte-2); }
.bar-row .bl em { font-style: normal; color: var(--or-clair); font-weight: 700; }
.bar-row .bt { height: 10px; border-radius: 5px; background: #3a3a3a; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 5px; transition: width .6s; }
.bar-row .bv { text-align: right; font-weight: 700; }
.bar-row .bw { text-align: right; color: var(--texte-3); font-size: 11px; }
@media (max-width: 699px) { .bar-row { grid-template-columns: minmax(0, 1fr) 70px 40px; } .bar-row .bw { display: none; } }

.seg button { padding: 0 14px; height: 32px; border-radius: 8px; font-size: 13px; color: var(--texte-2); }
.seg button.on { background: var(--or); color: #1a1a1a; font-weight: 700; }
.radar-box { display: flex; justify-content: center; padding: 6px; }
.radar { width: 100%; max-width: 440px; height: auto; overflow: visible; }
.radar-lbl { fill: var(--texte-2); font-size: 13px; font-family: var(--font); }
.radar-v { fill: var(--or-clair); font-weight: 700; }

.matrix-wrap { padding: 4px 8px; overflow-x: auto; position: relative; }
.life, .ptabs { position: relative; }
.radar-box { overflow: hidden; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.matrix th, .matrix td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--ligne); }
.matrix thead th { color: var(--texte-3); font-weight: 600; font-size: 12px; }
.matrix tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix tr.off th, .matrix tr.off .pc { color: var(--texte-3); text-decoration: line-through; }
.matrix tr.off .cell { opacity: .25; }
.matrix .pc { font-weight: 700; color: var(--or-clair); }
.cell { width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid #4a4a4a; display: inline-grid; place-items: center; color: #1a1a1a; position: relative; transition: background .15s; }
.cell:hover:not(:disabled) { border-color: var(--or); }
.cell.done { background: var(--or); border-color: var(--or); }
.cell.auto::after { content: "◆"; position: absolute; top: -7px; right: -5px; font-size: 9px; color: var(--or-pale); }

.legend { font-size: 12px; color: var(--texte-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; border: 1.5px solid #555; }
.lg.auto { background: var(--vert); border-color: var(--vert); } .lg.done { background: var(--or); border-color: var(--or); } .lg.na { background: repeating-linear-gradient(45deg, #444 0 2px, transparent 2px 5px); }
.checklists { align-items: start; }
.cl { padding: 0; }
.cl summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.cl summary::-webkit-details-marker { display: none; }
.cl summary .ring { width: 52px; height: 52px; flex-shrink: 0; }
.cl-t { flex: 1; min-width: 0; font-weight: 700; display: flex; flex-direction: column; }
.cl-t em { font-style: normal; color: var(--or-clair); }
.cl-t small { font-weight: 400; color: var(--texte-3); font-size: 12px; }
.cl ul { padding: 0 14px 10px; }
.it { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--ligne); }
.ck { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid #555; flex-shrink: 0; display: grid; place-items: center; color: #1a1a1a; }
.it.auto .ck { background: var(--vert); border-color: var(--vert); }
.it.done .ck { background: var(--or); border-color: var(--or); }
.it.na .ck { background: repeating-linear-gradient(45deg, #444 0 2px, transparent 2px 5px); }
.it.na .it-t { color: var(--texte-3); text-decoration: line-through; }
.it-t { flex: 1; min-width: 0; font-size: 14px; display: flex; flex-direction: column; }
.it-t small { font-size: 12px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-t small a { color: var(--or-clair); }
.mini { font-size: 11px; color: var(--texte-3); border: 1px solid #444; border-radius: 8px; padding: 3px 8px; }
.mini:hover { color: var(--texte); border-color: var(--or); }
.next-row .icon-btn { width: 36px; height: 36px; }
.hist { width: 100%; height: 180px; }
.hist .axis { fill: var(--texte-3); font-size: 11px; font-family: var(--font); }
#avc.busy { opacity: .6; pointer-events: none; transition: opacity .2s; }

.avc-mini { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--texte-2); }
.avc-mini i { width: 70px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.avc-mini b { display: block; height: 100%; }
.avc-mini em { font-style: normal; font-weight: 700; }
.over-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.avc-teaser { display: flex; align-items: center; gap: 16px; margin: 4px 0 6px; padding: 12px 16px; }
.avc-teaser .ring { width: 70px; height: 70px; flex-shrink: 0; }
.avc-teaser-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--texte-3); }
.avc-teaser-t b { color: var(--texte); font-size: 16px; }
.avc-teaser-life { display: flex; gap: 3px; margin-top: 4px; max-width: 520px; }
.avc-teaser-life i { flex: 1; height: 6px; background: #3a3a3a; border-radius: 3px; overflow: hidden; }
.avc-teaser-life b { display: block; height: 100%; background: var(--or); }

/* ------------------------------------------------------------------ Planning (Gantt) d'un projet, au jour près */
.pg-kpi { margin-bottom: 4px; }
@media (min-width: 1280px) { .pg-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pg-kpi .v small { font-size: 14px; color: var(--or-clair); font-weight: 700; }
.pg-kpi .v.sm { font-size: 20px; }
.pg-kpi .v.red { color: #f08b8e; }
.pg-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r); position: relative; -webkit-overflow-scrolling: touch; }
.pg { --w: 34px; --lab: 300px; position: relative; width: calc(var(--lab) + var(--w) * var(--d)); min-width: 100%; }
@media (max-width: 699px) { .pg { --w: 28px; --lab: 160px; } }
.pg-grid { position: absolute; top: 0; bottom: 0; left: var(--lab); display: flex; pointer-events: none; }
.pg-grid i { width: var(--w); border-left: 1px solid #2f2f2f; }
.pg-grid i.mon { border-left-color: #444; }
.pg-grid i.we { background: rgba(255,255,255,.035); }
.pg-grid i.now { background: rgba(177,141,73,.16); border-left: 2px solid var(--or); }
.pg-head, .pg-row, .pg-sec { display: flex; position: relative; }
.pg-lab { position: sticky; left: 0; z-index: 2; width: var(--lab); flex-shrink: 0; background: var(--surface); padding: 6px 12px; border-right: 1px solid var(--ligne); display: flex; align-items: center; gap: 8px; min-width: 0; }
.pg-track { position: relative; width: calc(var(--w) * var(--d)); flex-shrink: 0; }
.pg-head { border-bottom: 1px solid var(--ligne); position: sticky; top: 0; z-index: 3; }
.pg-head .pg-lab { align-items: flex-end; color: var(--texte-3); font-size: 12px; }
.pg-head .pg-track { background: var(--surface); }
.pg-months { display: flex; font-size: 12px; font-weight: 700; color: var(--or-clair); }
.pg-months span { padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; border-left: 1px solid #444; }
.pg-days { display: flex; }
.pg-days span { width: var(--w); text-align: center; font-size: 12px; line-height: 1.15; padding: 2px 0 6px; color: var(--texte-2); }
.pg-days span small { display: block; font-size: 10px; color: var(--texte-3); }
.pg-days span.we { color: var(--texte-3); }
.pg-days span.now { color: #1a1a1a; background: var(--or); border-radius: 6px 6px 0 0; font-weight: 700; }
.pg-days span.now small { color: #1a1a1a; }
.pg-sec .pg-lab { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3); padding-top: 14px; background: var(--fond-2); width: calc(var(--lab)); }
.pg-sec .pg-lab em { font-style: normal; color: var(--or-clair); }
.pg-sec { background: var(--fond-2); }
.pg-row { min-height: 44px; border-top: 1px solid #2c2c2c; }
.pg-row:hover .pg-lab, .pg-row:hover { background-color: #2b2b2b; }
.pg-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.25; }
.pg-t, .pg-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-t small { font-weight: 400; font-size: 11px; color: var(--texte-3); }
.pg-k { width: 8px; height: 26px; border-radius: 4px; flex-shrink: 0; background: #6b5a3a; }
.pg-k.k-intervention { background: var(--or); } .pg-k.k-rdv { background: var(--bleu); } .pg-k.k-echeance { background: var(--rouge); } .pg-k.k-tache { background: #777; }
.pg-row.done .pg-k { background: var(--vert); }
.pg-row.done .pg-t { color: var(--texte-3); text-decoration: line-through; }
.pg-bar { position: absolute; top: 9px; height: 26px; border-radius: 7px; display: flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 11px; font-weight: 700; overflow: hidden; white-space: nowrap; background: #6b5a3a; color: #fff; z-index: 1; }
.pg-bar span { overflow: hidden; text-overflow: ellipsis; }
.pg-bar.k-intervention { background: var(--or); color: #1a1a1a; }
.pg-bar.k-rdv { background: var(--bleu); color: #1a1a1a; }
.pg-bar.k-tache { background: #4a4a4a; border: 1px dashed #888; }
.pg-bar.done { background: var(--vert); color: #1a1a1a; }
.pg-ms { position: absolute; top: 13px; width: 18px; height: 18px; margin-left: -9px; background: var(--rouge); transform: rotate(45deg); border-radius: 3px; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.pg-ms.done { background: var(--vert); }
.lg.ms { background: var(--rouge); border-color: var(--rouge); transform: rotate(45deg) scale(.85); }
.pg-after { position: absolute; top: 12px; font-size: 12px; color: var(--texte-2); white-space: nowrap; z-index: 1; pointer-events: none; }
.pg-row.done .pg-after { color: var(--texte-3); text-decoration: line-through; }
@media (max-width: 699px) { .pg-after { font-size: 11px; } }

/* ------------------------------------------------------------------ Bouton Retour + visionneuse de documents */
.page-head.has-back { flex-wrap: nowrap; align-items: center; }
.page-head.has-back .ph-txt { flex: 1; min-width: 0; }
.page-head.has-back h1 { overflow-wrap: anywhere; }
.page-head .back-btn { flex-shrink: 0; width: 44px; height: 44px; align-self: center; }
@media (max-width: 699px) {
  .page-head.has-back { flex-wrap: wrap; }
  .page-head.has-back .ph-txt { flex: 1 1 calc(100% - 60px); }
  .page-head.has-back .actions { width: 100%; }
  .hide-s { display: none; }
}
.viewer-meta { margin: -12px 0 12px; }
.pdfv { background: #111; border-radius: var(--r); overflow: hidden; }
.pdfv-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: rgba(38,38,38,.96); border-bottom: 1px solid var(--ligne); }
.pdfv-n { font-size: 13px; color: var(--texte-2); }
.pdfv-z { display: flex; gap: 6px; align-items: center; }
.pdfv-z .icon-btn { width: 36px; height: 36px; font-size: 20px; }
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px; overflow-x: auto; min-height: 60vh; }
.pdfv-pages .pg-c { background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.5); position: relative; flex-shrink: 0; }
.pdfv-pages canvas { display: block; width: 100%; height: 100%; }
.pdfv-pages .pg-no { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #888; }
.imgv { background: #111; border-radius: var(--r); padding: 10px; display: flex; justify-content: center; }
.imgv img { max-height: 78vh; object-fit: contain; border-radius: 6px; }
.mediav { width: 100%; max-height: 78vh; border-radius: var(--r); background: #000; }
.textv { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; max-height: 78vh; overflow: auto; }
.viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.viewer-meta .sibs { margin-left: auto; display: flex; gap: 6px; }
body:has(.pdfv, .imgv, .textv, .mediav) .page-head h1 { font-size: clamp(20px, 2.4vw, 30px); overflow-wrap: anywhere; }
@media (max-width: 699px) { body:has(.pdfv, .imgv, .textv, .mediav) .page-head .eyebrow { font-size: 10px; letter-spacing: .08em; } }

/* Couverture du projet : étiquette = sélecteur d'image */
.hero .cover-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 5px 12px; font-size: 12px; transition: background .15s; }
.hero .cover-pick:hover, .hero .cover-pick:focus-within { background: var(--or); color: #1a1a1a; }
.hero .cover-pick .cover-chg { opacity: .75; }
.hero .cover-pick.busy { pointer-events: none; opacity: .7; }
.hero img.cover-new { animation: coverIn .5s ease; }
@keyframes coverIn { from { opacity: .2; } to { opacity: 1; } }

/* ------------------------------------------------------------------ Sauvegardes */
.bk-state { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
.bk-dot { width: 14px; height: 14px; border-radius: 7px; margin-top: 5px; flex-shrink: 0; background: var(--vert); box-shadow: 0 0 0 4px rgba(124,194,154,.2); }
.bk-state.warn .bk-dot { background: var(--or); box-shadow: 0 0 0 4px rgba(177,141,73,.25); }
.bk-state.err .bk-dot { background: var(--rouge); box-shadow: 0 0 0 4px rgba(229,72,77,.25); }
.red { color: #f08b8e; }
.prose p, .prose ul { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--texte-2); }
.prose ul { padding-left: 18px; list-style: disc; }
.prose pre { background: #1b1b1b; border-radius: 8px; padding: 10px 12px; font-size: 12px; overflow-x: auto; margin-bottom: 10px; }
.prose code { font-size: 12px; color: var(--or-pale); }
.bk-link { display: block; }
.bk-link h2 { display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ Hors connexion */
.offline-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--or-sombre); background: rgba(177,141,73,.08); border-radius: var(--r); font-size: 13px; color: var(--texte-2); }
.offline-panel b { color: var(--or-clair); }
.offline-panel .op { display: flex; gap: 6px; }
.offline-banner { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b, 0px) + 84px); max-width: min(92vw, 640px); background: #3a2f1c; color: var(--or-pale); border: 1px solid var(--or); border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
@media (min-width: 1024px) { .offline-banner { bottom: 20px; } }
body.is-offline form[method="post"] button[type="submit"], body.is-offline .btn.primary[type="submit"] { opacity: .4; pointer-events: none; }

/* ------------------------------------------------------------------ Boîte de dialogue générique */
.dlg { margin: auto; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); background: #222; color: var(--texte); border: 1px solid #3a3a3a; border-radius: 20px; padding: 22px; }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg h3 { font-size: 18px; font-weight: 800; }
.dlg-act { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chk-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* ------------------------------------------------------------------ Mise en service */
.mes-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; justify-content: space-between; }
.mes-sum { display: flex; gap: 18px; align-items: center; flex: 1; min-width: 280px; padding: 14px 18px; }
.mes-sum .ring { width: 96px; height: 96px; flex-shrink: 0; }
.mes-counts { font-size: 15px; margin: 2px 0 8px; }
.c-ok { color: var(--vert); } .c-def { color: #f08b8e; font-style: normal; }
.mes-lots { display: flex; flex-wrap: wrap; gap: 6px; }
.mes-lots span { font-size: 12px; background: #2f2f2f; border-radius: 10px; padding: 2px 9px; color: var(--texte-2); }
.mes-filter { align-self: center; }
.mes { margin-top: 14px; display: grid; gap: 12px; }
@media (min-width: 1280px) { .mes { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.mes-g { padding: 0; }
.mes-g summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; font-size: 15px; position: sticky; top: 0; background: var(--surface); border-radius: var(--r); z-index: 1; }
.mes-g summary::-webkit-details-marker { display: none; }
.mes-i { display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px 16px; border-top: 1px solid var(--ligne); border-left: 4px solid transparent; }
.mes-i.st-ok { border-left-color: var(--vert); }
.mes-i.st-defaut { border-left-color: var(--rouge); background: rgba(229,72,77,.06); }
.mes-i.st-na { opacity: .5; }
.mes-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mes-t b { font-size: 14px; }
.mes-t small { font-size: 12px; color: var(--texte-3); }
.mes-note { font-size: 13px; color: var(--or-pale); white-space: pre-wrap; margin-top: 4px; }
.mes-ph img { width: 90px; height: 64px; object-fit: cover; border-radius: 6px; margin-top: 6px; }
.mes-b { display: flex; gap: 6px; flex-shrink: 0; }
.mb { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid #4a4a4a; display: grid; place-items: center; color: var(--texte-2); font-size: 12px; font-weight: 700; }
.mb.ok:hover, .st-ok .mb.ok { background: var(--vert); border-color: var(--vert); color: #1a1a1a; }
.mb.def:hover, .st-defaut .mb.def { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.st-na .mb.na { background: #555; border-color: #555; color: #fff; }
.mb.more { border-style: dashed; }
@media (max-width: 699px) { .mes-i { flex-wrap: wrap; } .mes-b { width: 100%; justify-content: flex-end; } .mb { width: 52px; } }
.mes.busy { opacity: .85; }

/* ------------------------------------------------------------------ Rapports (CR / PV) */
.flash-inline { display: flex; align-items: center; gap: 8px; background: rgba(177,141,73,.12); border: 1px solid var(--or-sombre); color: var(--or-pale); padding: 10px 14px; border-radius: var(--r); font-size: 14px; margin-bottom: 10px; }
.rapport .card { display: flex; flex-direction: column; gap: 12px; }
.rapport h2 { font-size: 17px; font-weight: 800; }
.rapport .card .section-head { margin: 0; }
.dyn { display: flex; flex-direction: column; gap: 8px; }
.dyn-r { display: grid; gap: 8px; align-items: center; }
.dyn-r input:not([type=checkbox]) { width: 100%; }
.g-part { grid-template-columns: 1fr 1.4fr; }
.g-res { grid-template-columns: 1fr 2.4fr 1.1fr 150px auto; }
@media (max-width: 899px) { .g-res { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--ligne); } .g-res input:nth-child(2) { grid-column: 1 / -1; order: -1; } }
.seg-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-radio label { flex-direction: row !important; }
.seg-radio input { position: absolute; opacity: 0; }
.seg-radio span { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid #4a4a4a; color: var(--texte-2); font-weight: 600; cursor: pointer; }
.seg-radio input:checked + span { background: var(--or); border-color: var(--or); color: #1a1a1a; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--or-pale); }
.ph-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ph-pick label { position: relative; display: block; border-radius: 10px; overflow: hidden; cursor: pointer; }
.ph-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; opacity: .55; transition: opacity .15s; }
.ph-pick input { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; accent-color: var(--or); z-index: 1; }
.ph-pick input:checked + img { opacity: 1; outline: 3px solid var(--or); outline-offset: -3px; }
.sig { display: flex; flex-direction: column; gap: 8px; }
.sig-pad { position: relative; height: 180px; background: #f7f4ee; border-radius: 12px; overflow: hidden; touch-action: none; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sig-pad .sig-old { position: absolute; inset: 0; margin: auto; max-height: 90%; max-width: 90%; pointer-events: none; }
.sig-pad .sig-hint { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: #9a9489; pointer-events: none; }
.sig-pad.inked .sig-hint, .sig-pad.inked .sig-old { display: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ Matériel */
.mat-kpi { margin-bottom: 4px; }
@media (min-width: 1280px) { .mat-kpi { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.mat-kpi .st-a_commander .v { color: var(--texte); } .mat-kpi .st-commande .v { color: var(--bleu); } .mat-kpi .st-livre .v { color: var(--or-clair); } .mat-kpi .st-pose .v { color: var(--vert); }
.mat-list { padding: 0; }
.mat-r { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--ligne); }
.mat-r:first-child { border-top: 0; }
.mat-r input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--or); }
.mat-q { font-weight: 800; color: var(--or-clair); text-align: right; }
.mat-t { min-width: 0; display: flex; flex-direction: column; }
.mat-t b { font-size: 14px; }
.mat-t small { font-size: 12px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-t .mat-u { color: var(--texte-2); white-space: normal; }
.mat-d { font-size: 12px; color: var(--texte-3); white-space: nowrap; }
.mat-st { min-width: 104px; height: 36px; border-radius: 18px; padding: 0 12px; font-size: 12px; font-weight: 700; border: 1.5px solid #555; color: var(--texte-2); }
.st-commande .mat-st { border-color: var(--bleu); color: var(--bleu); }
.st-livre .mat-st { border-color: var(--or); color: var(--or-clair); }
.st-pose .mat-st { background: var(--vert); border-color: var(--vert); color: #1a1a1a; }
.st-fourni_client .mat-st { border-style: dashed; }
.st-pose .mat-t b { color: var(--texte-2); }
@media (max-width: 699px) { .mat-r { grid-template-columns: 22px 36px minmax(0, 1fr) auto; } .mat-d { grid-column: 3; grid-row: 2; } .mat-st { grid-column: 4; grid-row: 1 / 3; min-width: 92px; } }
.bulk-bar { position: sticky; bottom: calc(var(--safe-b, 0px) + 74px); z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; border: 1px solid var(--or); }
@media (min-width: 1024px) { .bulk-bar { bottom: 12px; } }
.bulk-bar input, .bulk-bar select { background: #1d1d1d; border: 1px solid #444; border-radius: 10px; padding: 8px 10px; color: #fff; font-size: 14px; min-height: 38px; }
.bulk-bar label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texte-3); }

/* ------------------------------------------------------------------ Finances */
@media (min-width: 1280px) { .fin-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fin-kpi .v.sm, .stats .v.sm { font-size: 22px; }
.fin-bar { display: grid; gap: 10px; margin-top: 12px; }
.fin-bar div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: center; font-size: 13px; color: var(--texte-2); }
.fin-bar i { height: 8px; border-radius: 4px; background: #3a3a3a; overflow: hidden; }
.fin-bar i b { display: block; height: 100%; background: var(--or); }
.fin-bar i b.g { background: var(--vert); }
@media (max-width: 699px) { .fin-bar div { grid-template-columns: 1fr; gap: 4px; } }
.fin-r { flex-wrap: wrap; }
.fin-r .time { font-size: 11px; letter-spacing: .05em; }
.fin-r.k-devis .time { color: var(--bleu); } .fin-r.k-achat .time { color: var(--texte-3); } .fin-r.k-avoir .time { color: #f08b8e; }
.fin-r.late { background: rgba(229,72,77,.07); }
.badge.red-b { background: #5a2a2c; color: #ffc9cb; }
.fin-pay { display: flex; align-items: center; gap: 4px; }
.fin-pay .pct { width: 48px; background: #1d1d1d; border: 1px solid #444; border-radius: 8px; color: #fff; padding: 6px; text-align: right; }

/* ------------------------------------------------------------------ Temps passé */
.tm-top { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .tm-top { grid-template-columns: 1fr 1fr; } }
.tm-chrono, .tm-sum { padding: 18px; }
.tm-chrono.on { border: 1px solid var(--or); background: linear-gradient(135deg, rgba(177,141,73,.16), transparent 60%), var(--surface); }
.tm-clock { font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 1px; margin: 4px 0 10px; }
.tm-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tm-in { flex: 1; min-width: 180px; background: #1d1d1d; border: 1px solid #444; border-radius: 12px; padding: 10px 14px; min-height: 46px; color: #fff; font-size: 16px; }
.tm-sum { display: flex; gap: 18px; align-items: center; }
.tm-sum .ring { width: 110px; height: 110px; flex-shrink: 0; }
.tm-total { font-size: 34px; font-weight: 900; }
.tm-rate { font-size: 18px; font-weight: 800; margin-top: 6px; }
.tm-week { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); margin: 14px 0 6px; }
.tm-rateform { flex-direction: row; align-items: flex-end; }
.tm-rateform label { flex: 1; }
.tm-pill { position: fixed; z-index: 95; top: calc(var(--safe-t, 0px) + 4px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; background: var(--or); color: #1a1a1a; font-size: 13px; font-weight: 700; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.tm-pill .tm-clock { font-size: 13px; margin: 0; letter-spacing: 0; }
@media (min-width: 1280px) { .tm-pill { top: auto; transform: none; left: 18px; bottom: 112px; } }

/* Gantt projet : glisser-déposer, poignée de durée, flèches de dépendance, livraisons */
.pg-drag { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-drag.dragging { cursor: grabbing; box-shadow: 0 0 0 2px var(--or-pale), 0 6px 18px rgba(0,0,0,.5); z-index: 4; opacity: .92; }
.pg-row.done .pg-drag { cursor: pointer; }
.pg-h { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; cursor: ew-resize; background: linear-gradient(90deg, transparent, rgba(0,0,0,.25)); border-radius: 0 7px 7px 0; }
.pg-h::after { content: ""; position: absolute; right: 4px; top: 7px; bottom: 7px; width: 2px; background: rgba(255,255,255,.55); border-radius: 1px; }
.pg-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.pg-links path { fill: none; stroke: var(--or-pale); stroke-width: 1.5; opacity: .7; }
.pg-links path.bad { stroke: #f08b8e; stroke-dasharray: 4 3; opacity: 1; }
.pg-tip { position: absolute; top: -26px; left: 0; background: #111; color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.pg-ms.mat { background: var(--bleu); }
.pg-ms.mat.late { background: var(--rouge); }
.pg-k.k-mat { background: var(--bleu); }
.rapport .section-head { flex-wrap: wrap; gap: 8px; }
.rapport .section-head .btn { white-space: normal; height: auto; min-height: 36px; text-align: left; }
@media (max-width: 1279px) { .tm-pill span { display: none; } .tm-pill { padding: 4px 11px; font-size: 12px; } }

/* ------------------------------------------------------------------ Comptabilité / INGENEO */
.cpt-r { flex-wrap: wrap; }
.cpt-r input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--or); }
.cpt-r .body { min-width: 220px; }
.cpt-st { font-size: 12px; }
.cpt-r.st-envoye .time { color: var(--vert); } .cpt-r.st-erreur .time { color: #f08b8e; } .cpt-r.st-ancien, .cpt-r.st-ignore { opacity: .7; }
.cpt-proj select { margin-top: 6px; background: #1d1d1d; border: 1px solid var(--or-sombre); border-radius: 10px; color: #fff; padding: 6px 10px; max-width: 100%; }
.seg a { padding: 0 14px; height: 32px; display: inline-flex; align-items: center; border-radius: 8px; font-size: 13px; color: var(--texte-2); white-space: nowrap; }
.seg a.on { background: var(--or); color: #1a1a1a; font-weight: 700; }
.mat-inv { color: var(--or-clair); }
.mat-inv.over { color: #f08b8e; }

/* ---------------------------------------------------------------- Simulateur de rémunération */
.simu-lede { margin: -4px 0 16px; max-width: 70ch; font-size: 14px; }
.simu { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .simu { grid-template-columns: minmax(0, 1fr); } }
.simu-side, .simu-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.simu-panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--or-clair); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.simu-panel h2::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }
.simu-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.simu-tab { flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--fond-2); color: var(--texte-2); font-weight: 700; font-size: 14px; }
.simu-tab.on { background: var(--or); border-color: var(--or); color: #1a1a1a; }
.simu-f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.simu-f[hidden] { display: none; }
.simu-f b { color: var(--or-clair); font-weight: 700; float: right; }
.simu-f small, .simu-panel > small { font-weight: 400; font-size: 12px; color: var(--texte-3); line-height: 1.4; }
.simu-f input[type=number] { height: 42px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--fond-2); color: var(--texte); padding: 0 12px; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; }
.simu-f input[type=range] { accent-color: var(--or); width: 100%; }
.simu-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.simu-save { justify-content: center; }
.simu-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.simu-kpi { display: flex; flex-direction: column; gap: 2px; }
.simu-kpi span { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-3); font-weight: 700; }
.simu-kpi b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.simu-kpi small { font-size: 12px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.simu-kpi.simu-hero { background: var(--or-sombre); border: 1px solid var(--or); }
.simu-kpi.simu-hero b { color: var(--or-pale); }
.simu-reel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.simu-reel-grid div { display: flex; flex-direction: column; gap: 2px; }
.simu-reel-grid span { font-size: 12px; color: var(--texte-3); }
.simu-reel-grid b { font-size: 18px; font-variant-numeric: tabular-nums; }
.simu-reel-grid small { font-size: 12px; color: var(--texte-2); }
.simu-reel-grid .green { color: var(--vert); }
.simu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.simu-wf { display: flex; flex-direction: column; gap: 8px; }
.simu-wf .wf { display: grid; grid-template-columns: 200px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 13px; }
.simu-wf .wf span { color: var(--texte-3); }
.simu-wf .wf:not(.deduct) span { color: var(--texte); font-weight: 700; }
.simu-wf .wf i { height: 18px; background: var(--fond-2); border-radius: 4px; overflow: hidden; }
.simu-wf .wf em { display: block; height: 100%; background: var(--or); border-radius: 4px; transition: width .25s; }
.simu-wf .wf.deduct em { background: #c8734a; opacity: .8; }
.simu-wf .wf.final em { background: var(--vert); }
.simu-wf .wf.final b { color: var(--vert); }
.simu-wf .wf.sub i { background: none; }
.simu-wf .wf b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .simu-wf .wf { grid-template-columns: minmax(0, 1fr) 96px; } .simu-wf .wf i { grid-column: 1 / -1; grid-row: 2; height: 10px; } }
.simu-scroll { overflow-x: auto; }
.simu-rates { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.simu-rates th, .simu-rates td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.simu-rates th:first-child, .simu-rates td:first-child { text-align: left; }
.simu-rates th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); border-bottom-color: var(--or); }
.simu-rates tr.on { background: var(--or-sombre); }
.simu-rates tr.on td:first-child { color: var(--or-clair); font-weight: 800; }
.simu-note { font-size: 13px; color: var(--texte-3); line-height: 1.55; border-left: 3px solid var(--or); padding: 10px 14px; background: var(--surface); border-radius: 0 10px 10px 0; }
.simu-note b { color: var(--texte); }

/* ---------------------------------------------------------------- Chantiers courants */
.gamme-seg { margin-bottom: 12px; }
.pcard.compact { height: 200px; }
.pcard.compact .name { font-size: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard.compact .over { flex-direction: column; align-items: stretch; gap: 8px; }
.pcard.compact .over-r { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; }
.ch-mini { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--texte-2); white-space: nowrap; }
.ch-mini i { display: flex; gap: 3px; }
.ch-mini b { width: 10px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.ch-mini b.on { background: var(--or); }
.ch-mini b.on:last-of-type { background: var(--vert); }
.ch-mini.lost b.on { background: #8a5a52; }
.ch-mini em { font-style: normal; font-weight: 700; }

.ch-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ch-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--texte-3); text-align: center; position: relative; }
.ch-steps li i { width: 100%; height: 6px; border-radius: 3px; background: var(--fond-2); border: 1px solid var(--ligne); }
.ch-steps li.done i { background: var(--or); border-color: var(--or); }
.ch-steps li.cur i { background: var(--or-clair); border-color: var(--or-clair); box-shadow: 0 0 0 3px rgba(177,141,73,.25); }
.ch-steps li.done span { color: var(--texte-2); }
.ch-steps li.cur span { color: var(--or-pale); font-weight: 700; }
.ch-steps.lost li.cur i { background: #8a5a52; border-color: #8a5a52; box-shadow: none; }
@media (max-width: 600px) { .ch-steps li span { font-size: 10px; line-height: 1.15; } .ch-steps li:not(.cur) span { opacity: .75; } }
.ch-summary { margin-top: 14px; }
.ch-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ch-kpis div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-kpis span { font-size: 12px; color: var(--texte-3); }
.ch-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ch-kpis small { font-size: 12px; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .ch-kpis { grid-template-columns: 1fr 1fr; } .ch-kpis div:last-child { grid-column: 1 / -1; } }
.ch-next { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--or-sombre); color: var(--or-pale); font-weight: 700; font-size: 14px; }

.ch-form { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.ch-form .card { display: flex; flex-direction: column; gap: 12px; }
.ch-h { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--or-clair); margin: 0; }
.ch-natures { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.ch-natures legend { font-size: 14px; color: var(--texte-2); margin-bottom: 6px; }
.ch-nat { cursor: pointer; }
.form .ch-nat { flex-direction: row; }
.ch-nat input { position: absolute; opacity: 0; pointer-events: none; }
.ch-nat span { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid #444; color: var(--texte-2); font-size: 15px; font-weight: 600; }
.ch-natures.sm .ch-nat span { height: 34px; font-size: 13px; padding: 0 12px; }
.ch-nat input:checked + span { background: var(--or); border-color: var(--or); color: #1a1a1a; }
.ch-nat input:focus-visible + span { outline: 2px solid var(--or-clair); outline-offset: 2px; }
.ch-photos { flex-direction: row !important; align-items: center; justify-content: center; gap: 10px !important; height: 52px; border: 1.5px dashed #555; border-radius: 12px; color: var(--texte-2); font-weight: 600; cursor: pointer; }
.ch-photos.on { border-color: var(--vert); color: var(--vert); }
.ch-foot { margin: 0; }
.ch-switch { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; border: 1px solid var(--or-sombre); }
.ch-switch > span { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ch-switch svg:first-child { color: var(--or); flex: none; }
.ch-convert { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; align-items: flex-start; }
.ch-pipe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ch-pipe a { background: var(--surface); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.ch-pipe a b { font-size: 22px; color: var(--or-pale); }
.ch-pipe a span { font-size: 12px; color: var(--texte-3); line-height: 1.2; }
.ch-pipe a.zero b { color: var(--texte-3); }
@media (max-width: 700px) { .ch-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ch-ic { color: var(--or); display: flex; align-items: center; justify-content: center; }
.ch-foot code { word-break: break-all; }
@media (max-width: 600px) { .rows .ch-mini i { display: none; } }
.st-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #1a1a1a; background: var(--or-pale); border-radius: 6px; padding: 0 6px; line-height: 18px; vertical-align: 1px; }
.nav-split { display: inline-flex; flex: 1 1 auto; }
.nav-split .btn:first-child { flex: 1 1 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.nav-split .nav-alt { flex: none; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.12); padding: 0 12px; font-size: 13px; color: var(--texte-2); }
@media (max-width: 699px) { .quick .nav-split { flex: 0 0 auto; } }
/* Import Esabora */
.esa-up { max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
.esa-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.esa-kpis .kpi { display: flex; flex-direction: column; gap: 4px; }
.esa-kpis .kpi span { font-size: 12px; color: var(--texte-3); }
.esa-kpis .kpi b { font-size: 26px; color: var(--or-pale); }
@media (max-width: 700px) { .esa-kpis { grid-template-columns: 1fr 1fr; } }
.esa-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.esa-go p { margin: 0; flex: 1 1 100%; }
.totp-qr { background: #fff; border-radius: 10px; padding: 8px; width: 220px; margin-top: 8px; } .totp-qr svg { width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------- Réseaux sociaux */
:root { --fb: #4f7fe0; --ig: #d4588f; --li: #3d93c9; --tt: #7fd6d0; --nl: #B18D49; }
.rs-pf { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #fff; flex: none; vertical-align: 1px; }
.rs-pf.rs-fb { background: var(--fb); } .rs-pf.rs-ig { background: var(--ig); } .rs-pf.rs-li { background: var(--li); } .rs-pf.rs-tt { background: #333; color: var(--tt); } .rs-pf.rs-nl { background: var(--or); color: #1a1a1a; }
.rs-pil { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 800; background: var(--or-sombre); color: var(--or-pale); border: 1px solid #5a4a30; }
.rs-pil i { font-style: normal; font-weight: 600; opacity: .75; font-size: 10px; }
.rs-auto { color: var(--or-clair); }
.rs-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--rouge); color: #fff; font-size: 11px; margin-left: 4px; }
.seg a.on .rs-count { background: #1a1a1a; color: var(--or); }
.rs-tabs { margin-bottom: 16px; }
.rs-month { margin: 0 0 0 10px; font-size: 20px; }
.rs-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--texte-2); }
.rs-grid .mgrid-head, .rs-grid .mgrid-body { grid-template-columns: repeat(7, minmax(0, 1fr)) 150px; }
.rs-grid .mday:nth-child(7n) { border-right: 1px solid var(--ligne); }
.rs-grid .mday.rs-wk { background: #1d1b17; border-right: 0; gap: 6px; }
.rs-grid .mgrid-head .rs-wk { color: var(--or); }
.rs-topic { font-size: 12px; line-height: 1.35; color: var(--texte-2); display: flex; gap: 6px; align-items: flex-start; }
.chip-ev.rs-c { background: #24282f; }
.chip-ev.rs-fb { border-left-color: var(--fb); } .chip-ev.rs-ig { border-left-color: var(--ig); } .chip-ev.rs-li { border-left-color: var(--li); } .chip-ev.rs-nl { border-left-color: var(--or); } .chip-ev.rs-tt { border-left-color: var(--tt); }
.chip-ev.rs-fb.st-publie { background: #26324a; } .chip-ev.rs-ig.st-publie { background: #44263a; } .chip-ev.rs-li.st-publie { background: #20384a; }
.chip-ev.rs-c.st-planifie, .chip-ev.rs-c.st-idee { background: transparent; outline: 1px dashed #555; outline-offset: -1px; }
.chip-ev.rs-c.st-planifie.late { outline-color: var(--rouge); }
.ev.k-publication { background: #24282f; border-left-color: var(--li); }
.chip-ev.k-publication { background: #24282f; border-left-color: var(--li); }
.g-bar.k-publication, .pg-bar.k-publication { background: var(--li); color: #fff; }
@media (max-width: 999px) {
  .rs-grid .mgrid-head, .rs-grid .mgrid-body { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .rs-grid .rs-wk { display: none; }
  .rs-grid .mday:nth-child(7n) { border-right: 1px solid var(--ligne); }
}
@media (max-width: 699px) {
  .rs-legend { display: none; }
  .rs-month { flex-basis: 100%; margin: 6px 0 0; }
  .chip-ev.rs-c { height: 6px; outline: 0 !important; }
  .chip-ev.rs-c.rs-fb { background: var(--fb) !important; } .chip-ev.rs-c.rs-ig { background: var(--ig) !important; } .chip-ev.rs-c.rs-li { background: var(--li) !important; }
  .chip-ev.rs-c.st-planifie, .chip-ev.rs-c.st-idee { opacity: .45; }
  .chip-ev.k-publication { background: var(--li); }
}
.rs-lines { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.rs-lines .check { min-height: 36px; gap: 10px; }
.rs-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.rs-filters select, .rs-filters input[type=search] { height: 40px; background: var(--surface); color: var(--texte); border: 1px solid var(--ligne); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; max-width: 100%; }
.rs-filters .check { display: flex; align-items: center; gap: 8px; }
.rs-filters .check input { width: 18px; height: 18px; accent-color: var(--or); }
.rs-table td { vertical-align: top; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.rs-inters { display: flex; flex-direction: column; gap: 10px; }
.rs-inter { border-left: 3px solid #444; }
.rs-inter.q-a_traiter { border-left-color: var(--or); }
.rs-inter.q-question { border-left-color: var(--bleu); }
.rs-inter.q-prospect, .rs-inter.q-partenaire { border-left-color: var(--vert); }
.rs-inter.q-negatif { border-left-color: var(--rouge); }
.rs-inter.me { background: #22262a; }
.rs-inter.reply { margin-left: 28px; }
.rs-inter header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rs-inter header .badge { margin-left: auto; }
.rs-body { margin: 8px 0; color: var(--texte); font-size: 15px; overflow-wrap: anywhere; }
.rs-qform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rs-qform select, .rs-qform input[type=text] { height: 36px; background: #1d1d1d; color: var(--texte); border: 1px solid var(--ligne); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; }
.rs-qform input[type=text] { flex: 1 1 220px; min-width: 0; }
.rs-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.rs-mgrid label { justify-content: flex-end; }
.rs-metrics label { font-size: 12px !important; }
.rs-media { width: 100%; border-radius: var(--r); display: block; }
.rs-bar { display: block; height: 6px; border-radius: 3px; margin-bottom: 4px; background: var(--or); }
.rs-bar.rs-fb { background: var(--fb); } .rs-bar.rs-ig { background: var(--ig); } .rs-bar.rs-li { background: var(--li); }
.stat.rs-st.rs-fb { border-top-color: var(--fb); } .stat.rs-st.rs-ig { border-top-color: var(--ig); } .stat.rs-st.rs-li { border-top-color: var(--li); }
.rs-steps { margin: 10px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--texte-2); }
.rs-steps code, .card code { overflow-wrap: anywhere; }
.rs-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.rs-types { margin: 4px 0; }
.small-seg a { height: 32px; font-size: 13px; }

/* ------------------------------------------------ Fiche d'entretien */
.ent .card h2 { margin-bottom: 10px; }
.ent-bar { position: sticky; top: calc(var(--safe-t) + 6px); z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--ligne); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.ent-bar.run { border-color: var(--or); }
.ent-bar.over { border-color: var(--rouge); }
.ent-clock { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ent-clock b { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; }
.ent-bar.over .ent-clock b { color: #ffb3b5; }
.ent-save.ok { color: var(--vert); }
.ent-save.warn { color: var(--or-clair); }
.ent-goal { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--or); background: var(--or-sombre); border-radius: 0 10px 10px 0; color: var(--texte-2); font-size: 14px; }
.ent-goal .ic { color: var(--or); margin-top: 3px; }
.ent-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ent-main, .ent-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1000px) {
  .ent-cols { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; }
  .ent-side { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
}
.ent-ck { flex-direction: row !important; align-items: flex-start !important; gap: 12px !important; cursor: pointer; color: var(--texte) !important; }
.ent-ck input[type=checkbox] { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; accent-color: var(--or); }
.ent-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ent-tt b { font-weight: 600; font-size: 15px; color: #fff; }
.ent-tt em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--or); }
.ent-tt small { font-size: 13px; color: var(--texte-3); }
.ent .ent-note, .ent .ent-qin { min-height: 38px; padding: 6px 10px; font-size: 14px; background: #1f1f1f; border: 1px solid var(--ligne); border-radius: 10px; width: 100%; }
.ent .ent-qin { font-weight: 600; }
.ent-seq { list-style: none; padding: 0; display: flex; flex-direction: column; }
.ent-seq li { display: flex; flex-direction: column; gap: 8px; padding: 12px 10px; border-top: 1px solid var(--ligne); border-radius: 10px; }
.ent-seq li:first-child { border-top: 0; }
.ent-seq li.now { background: var(--or-sombre); box-shadow: inset 3px 0 0 var(--or); }
.ent-seq li.past .ent-tt b { color: var(--texte-3); }
.ent-qs { display: flex; flex-direction: column; gap: 10px; }
.ent-q { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--ligne); border-radius: 12px; }
.ent-q.ok { border-color: var(--or); background: #2b2822; }
.ent-q textarea { min-height: 64px !important; }
.ent-q.extra { border-style: dashed; }
.ent-obj details { border-top: 1px solid var(--ligne); padding: 10px 0; }
.ent-obj summary { list-style: none; cursor: pointer; }
.ent-obj summary::-webkit-details-marker { display: none; }
.ent-rep { margin: 8px 0 8px 36px; padding: 8px 12px; border-left: 3px solid var(--or); color: var(--texte-2); font-size: 14px; }
.ent-obj .ent-note { margin-left: 36px; width: calc(100% - 36px); }
.ent-memo { display: flex; flex-direction: column; gap: 8px; }
.ent-memo > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: start; }
.ent .ent-k { min-height: 38px; padding: 6px 8px; font-size: 13px; font-weight: 700; color: var(--or-clair); background: transparent; border: 1px solid transparent; border-radius: 8px; }
.ent .ent-v { min-height: 38px !important; padding: 6px 10px; font-size: 14px; background: #1f1f1f; border: 1px solid var(--ligne); border-radius: 10px; resize: vertical; }
.ent .ent-k:focus, .ent .ent-v:focus, .ent .ent-note:focus, .ent .ent-qin:focus { border-color: var(--or); outline: none; }
.ent-msg { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--ligne); }
.ent-msg:first-of-type { border-top: 0; }
.ent-issue blockquote { margin: 0 0 8px; padding: 10px 12px; border-left: 3px solid var(--or); background: #222; border-radius: 0 10px 10px 0; font-style: italic; color: var(--texte-2); font-size: 14px; }
.ent-issue .lbl { font-size: 14px; color: var(--texte-2); margin: 12px 0 6px; }
.ent-issue .seg-radio span { height: 40px; padding: 0 12px; font-size: 14px; }
.ent-issue label { margin-top: 10px; }
.ent-res { margin: 8px 0 0; padding-left: 18px; list-style: disc; font-size: 13px; color: var(--texte-3); }
.ent-steps { width: 100%; border-collapse: collapse; font-size: 14px; }
.ent-steps th { text-align: left; vertical-align: top; color: var(--or-clair); font-weight: 700; padding: 6px 10px 6px 0; white-space: nowrap; }
.ent-steps td { padding: 6px 0; border-bottom: 1px solid var(--ligne); color: var(--texte-2); }
.ent-steps small { display: block; color: var(--texte-3); font-size: 12px; }
.ent-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media print {
  .sidebar, .tabbar, .ptabs, .ent-bar, .ent-actions, .page-head .actions { display: none !important; }
}

/* Brouillons de saisie terrain (formulaires data-draft) */
.draft-note, .draft-pending { flex-wrap: wrap; justify-content: space-between; }
.draft-pending { justify-content: flex-start; }
.draft-state { align-self: center; flex: 1 1 auto; text-align: right; padding: 0 6px; }
.draft-state.warn { color: #f0c27a; }
@media (max-width: 699px) { .draft-state { flex-basis: 100%; order: -1; text-align: left; padding: 0; } }

/* Recette : composition de l'installation, mesures */
.rec-sec h2 { margin: 0 0 10px; font-size: 16px; }
.rec-fams { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rec-fam { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 12px; cursor: pointer; }
.rec-fam:has(input:checked) { border-color: var(--or); background: rgba(177,141,73,.08); }
.rec-fam input { margin-top: 3px; accent-color: var(--or); width: 18px; height: 18px; flex-shrink: 0; }
.rec-fam small { display: block; color: var(--texte-2); font-size: 12px; margin-top: 2px; }
.rec-mes { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--texte-2); }
.rec-mes input { width: 96px; min-height: 36px; padding: 4px 8px; text-align: right; }
.rec-mes input.saved { border-color: var(--vert); }
.rec-mes em { font-style: normal; }
.rec-res { font-weight: 700; font-size: 13px; padding: 4px 10px; }
.st-ok .rec-res { color: var(--vert); } .st-defaut .rec-res { color: var(--rouge); }
.rec-lock { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-left: 4px solid var(--vert); }
.rec-hist { margin-top: 10px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }

/* ---------- Impôts ---------- */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--texte-3); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
details.reveal summary { cursor: pointer; list-style: none; color: var(--texte-2); }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal[open] summary { display: none; }
.fx-steps .row, .fx-list .row { align-items: flex-start; }
.fx-steps .body span, .fx-list .body span, .cab-t .body span { white-space: normal; }
.fx-check { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid #555; background: transparent; color: #1a1a1a; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; margin-top: 2px; }
.fx-check.on { background: var(--or); border-color: var(--or); }
.fx-check:disabled { cursor: default; opacity: .85; }
.fx-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.fx-date b { font-size: 20px; }
.fx-date small { font-size: 11px; color: var(--texte-3); font-weight: 600; text-transform: uppercase; }
.fx-r.done { opacity: .6; }
.fx-r.late .fx-date b { color: #f08b8e; }
.fx-act { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.fx-done summary { list-style: none; }
.fx-done summary::-webkit-details-marker { display: none; }
.fx-done[open] { flex-basis: 100%; }
.fx-done form { margin-top: 8px; background: var(--surface-2); border-radius: 12px; padding: 12px; min-width: 240px; }

/* ---------- Échanges avec le cabinet ---------- */
.cab-t.unread .body b { color: var(--or-clair); }
.cab-thread { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.cab-msg { max-width: 760px; background: var(--surface); border-radius: var(--r); padding: 12px 16px; border-left: 3px solid var(--bleu); }
.cab-msg.me { align-self: flex-end; border-left-color: var(--or); background: var(--or-sombre); }
.cab-msg header { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--texte-3); margin-bottom: 6px; }
.cab-msg header b { color: var(--texte); }
.cab-body { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.cab-file { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--or-clair); }
.cab-pick summary { cursor: pointer; font-size: 14px; }
.cab-pick-list { max-height: 260px; overflow: auto; margin-top: 8px; padding: 8px; background: var(--surface-2); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.cab-pick-list label { font-size: 13px; }
code.sel { user-select: all; overflow-wrap: anywhere; }
.cab-portal { display: block; }
.cab-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(12px + var(--safe-t)) 20px 12px; border-bottom: 1px solid var(--ligne); background: var(--fond-2); }
.cab-top .brand { display: flex; align-items: center; gap: 10px; color: var(--texte); }
.cab-top .brand small { display: block; font-size: 11px; color: var(--or); }
.cab-top nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.cab-top nav form { margin: 0; }
.cab-main { max-width: 980px; margin: 0 auto; padding: 20px 16px 40px; }
.cab-auth { max-width: 420px; margin: 40px auto; }
.cab-foot { text-align: center; padding: 20px 16px calc(20px + var(--safe-b)); }
@media (max-width: 699px) {
  .fx-list .fx-r { flex-wrap: wrap; }
  .fx-list .fx-r .body { flex-basis: calc(100% - 70px); }
  .fx-list .fx-act { max-width: none; flex-basis: 100%; justify-content: flex-start; padding-left: 66px; }
  .fx-list .body b { white-space: normal; }
  .cab-top { flex-wrap: wrap; padding-left: 16px; padding-right: 16px; }
  .cab-top nav { gap: 14px; width: 100%; justify-content: flex-end; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}
