/* =========================================================================
   Artolys Développement — feuille de style
   Charte : vert sauge #769586, vert forêt #384740, menthe #BBDECD,
   fond #F1F8F4, beige #EFEFEC, texte #1D1D1B, police Outfit.
   ========================================================================= */

:root {
  --sauge: #769586;
  --sauge-fonce: #5f7d6f;
  --foret: #384740;
  --foret-2: #43554c;
  --menthe: #BBDECD;
  --menthe-pale: #e1f0e8;
  --menthe-voile: #eef7f2;
  --fond: #F1F8F4;
  --beige: #EFEFEC;
  --encre: #1D1D1B;
  --blanc: #FFFFFF;
  --gris: #5d6b64;
  --gris-clair: #8c9993;
  --ligne: #dce8e1;
  --ligne-forte: #c9dbd1;
  --alerte: #b85c47;
  --alerte-pale: #f8e7e2;
  --ambre: #b07a2a;
  --ambre-pale: #f6ecd8;
  --colonne: #e6f0ea;

  --police: 'Outfit', 'Neulis Neue', 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --police-2: 'Open Sans', 'Outfit', system-ui, sans-serif;

  --r-carte: 20px;
  --r-moyen: 14px;
  --r-petit: 10px;
  --ombre: 0 1px 2px rgba(56, 71, 64, .05), 0 8px 24px -8px rgba(56, 71, 64, .12);
  --ombre-forte: 0 18px 40px -12px rgba(29, 29, 27, .28), 0 2px 6px rgba(29, 29, 27, .08);
  --barre: 264px;
  --transition: 160ms cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.45;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.capture *, body.capture *::before, body.capture *::after { transition: none !important; animation: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--foret); }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.s16 { width: 16px; height: 16px; }
svg.ic.s18 { width: 18px; height: 18px; }
svg.ic.s24 { width: 24px; height: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--gris); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ cadre */
.app {
  display: grid;
  grid-template-columns: var(--barre) minmax(0, 1fr);
  min-height: 100vh;
}

/* Barre latérale */
.side {
  position: sticky; top: 0; height: 100vh;
  background: var(--foret);
  color: #e9f3ee;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  overflow: hidden;
  z-index: 20;
}
.side::after {
  /* motif au trait : collines et rayons, très discret */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 220px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 264 220' fill='none' stroke='%23BBDECD' stroke-width='1.2' stroke-linecap='round'%3E%3Ccircle cx='196' cy='118' r='30'/%3E%3Cpath d='M196 70v-14M232 82l10-10M160 82l-10-10M244 118h14M134 118h14'/%3E%3Cpath d='M-10 170c40-26 80-30 120-12s86 20 160-10'/%3E%3Cpath d='M-10 190c46-20 90-22 134-6s80 14 150-8'/%3E%3Cpath d='M-10 210c50-14 96-14 140-2s82 8 144-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: bottom center; background-size: 100% auto;
  opacity: .14;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { font-weight: 700; font-size: 17px; letter-spacing: .16em; color: #fff; }
.brand-name span { font-weight: 500; font-size: 12.5px; letter-spacing: .34em; color: var(--menthe); margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; color: #d7e6de;
  padding: 11px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-align: left; text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.on { background: var(--menthe); color: var(--foret); font-weight: 600; }
.nav-item .lbl { flex: 1; }
.nav-item .count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: rgba(187, 222, 205, .18); color: #e9f3ee; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-item.on .count { background: var(--foret); color: #fff; }
.side-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 8px 8px; font-size: 11.5px; letter-spacing: .2em; font-weight: 600; color: var(--menthe);
  text-transform: uppercase;
}
.side-title button { border: 0; background: transparent; color: var(--menthe); padding: 4px; border-radius: 8px; display: inline-flex; }
.side-title button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side-projects { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; position: relative; z-index: 1; }
.side-project {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #d7e6de;
  padding: 8px 12px; border-radius: 12px; font-size: 14px; text-align: left;
}
.side-project:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-project.on { background: rgba(187, 222, 205, .16); color: #fff; }
.side-project .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.side-project .pct { margin-left: auto; font-size: 12px; color: var(--menthe); opacity: .8; white-space: nowrap; flex: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; padding-top: 14px; }
.sync-btn {
  display: flex; align-items: center; gap: 10px; border: 1px solid rgba(187, 222, 205, .28); background: rgba(29, 29, 27, .12);
  color: #e9f3ee; padding: 9px 12px; border-radius: 14px; font-size: 13px; text-align: left;
}
.sync-btn:hover { border-color: var(--menthe); }
.sync-btn .state { display: block; font-size: 11.5px; color: var(--menthe); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gris-clair); flex: none; }
.sync-dot.ok { background: #8fe0b5; box-shadow: 0 0 0 3px rgba(143, 224, 181, .2); }
.sync-dot.warn { background: #f0c27a; }
.me-card {
  display: flex; align-items: center; gap: 10px; border: 0; width: 100%;
  background: rgba(255, 255, 255, .06); color: #fff; padding: 10px; border-radius: 16px; text-align: left;
}
.me-card:hover { background: rgba(255, 255, 255, .12); }
.me-card .who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-card .who b { font-weight: 600; font-size: 14px; }
.me-card .who span { font-size: 12px; color: var(--menthe); }

/* Zone principale */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 18px;
  padding: 26px 36px 18px;
}
.top-title { min-width: 0; flex: 1; }
.top-title h1 {
  margin: 0; font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--foret);
}
.top-title p { margin: 6px 0 0; color: var(--gris); font-size: 14.5px; }
.top-mobile-brand { display: none; }
.search {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--blanc); border: 1px solid var(--ligne); border-radius: 999px;
  padding: 0 14px; height: 42px; width: 300px; color: var(--gris);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search:focus-within { border-color: var(--sauge); box-shadow: 0 0 0 4px rgba(187, 222, 205, .45); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; color: var(--encre); }
.search input::placeholder { color: var(--gris-clair); }
.search kbd {
  font-family: var(--police); font-size: 11px; color: var(--gris-clair); border: 1px solid var(--ligne); border-radius: 6px; padding: 1px 6px;
}
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(440px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; box-shadow: var(--ombre-forte);
  padding: 8px; z-index: 60; color: var(--encre);
}
.search-results h6 { margin: 10px 10px 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.search-hit { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 12px; text-align: left; }
.search-hit:hover, .search-hit.focus { background: var(--menthe-voile); }
.search-hit .t { font-weight: 500; }
.search-hit .s { font-size: 12.5px; color: var(--gris); }
.search-empty { padding: 18px; text-align: center; color: var(--gris); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ligne); background: var(--blanc);
  display: inline-flex; align-items: center; justify-content: center; color: var(--foret); flex: none;
}
.icon-btn:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--menthe-voile); }
.view { padding: 4px 36px 40px; flex: 1; min-width: 0; }

/* -------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--sauge);
  background: var(--sauge); color: #fff; font-weight: 600; font-size: 14.5px; letter-spacing: .01em;
  white-space: nowrap; transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn:hover { background: var(--foret); border-color: var(--foret); }
.btn:active { transform: translateY(1px); }
.btn.outline { background: transparent; color: var(--foret); }
.btn.outline:hover { background: var(--menthe-voile); border-color: var(--foret); }
.btn.light { background: var(--blanc); border-color: var(--ligne); color: var(--foret); }
.btn.light:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.btn.danger { background: transparent; border-color: transparent; color: var(--alerte); padding: 0 14px; }
.btn.danger:hover { background: var(--alerte-pale); }
.btn.sm { height: 34px; padding: 0 16px; font-size: 13.5px; }
.btn.xs { height: 28px; padding: 0 12px; font-size: 12.5px; border-width: 1px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: transparent; color: var(--sauge-fonce); font-weight: 600; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.link-btn:hover { color: var(--foret); text-decoration: underline; }

.seg { display: inline-flex; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--gris); }
.seg button:hover { color: var(--foret); }
.seg button.on { background: var(--foret); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--foret);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.chip:hover { border-color: var(--sauge); }
.chip.on { background: var(--foret); border-color: var(--foret); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------- cartes */
.card {
  background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte);
  box-shadow: var(--ombre); padding: 22px; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title {
  margin: 0; display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--foret);
}
.card-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sauge); box-shadow: 0 0 0 4px var(--menthe-pale); }
.card-title.alert::before { background: var(--alerte); box-shadow: 0 0 0 4px var(--alerte-pale); }
.card-head .count { font-size: 12px; font-weight: 600; color: var(--gris); background: var(--fond); border-radius: 999px; padding: 2px 9px; }
.card-head .spacer { flex: 1; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 26px 12px; color: var(--gris); font-size: 14px;
}
.empty svg.ic { width: 34px; height: 34px; color: var(--sauge); stroke-width: 1.2; }

/* Avatars */
.av {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 12px; letter-spacing: .02em;
  box-shadow: 0 0 0 2px var(--blanc);
}
.av.s22 { width: 22px; height: 22px; font-size: 9.5px; }
.av.s26 { width: 26px; height: 26px; font-size: 10.5px; }
.av.s36 { width: 36px; height: 36px; font-size: 13.5px; }
.av.s40 { width: 40px; height: 40px; font-size: 14.5px; }
.avs { display: inline-flex; align-items: center; }
.avs .av + .av { margin-left: -7px; }
.avs .more { margin-left: 4px; font-size: 12px; color: var(--gris); }

/* Étiquettes */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--fond); color: var(--foret); white-space: nowrap; max-width: 100%;
}
.tag .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tag.ellipsis { display: inline-block; line-height: 24px; }
.prio { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.prio::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prio.p0 { background: var(--beige); color: #6f7a74; }
.prio.p1 { background: var(--menthe-pale); color: var(--sauge-fonce); }
.prio.p2 { background: var(--ambre-pale); color: var(--ambre); }
.prio.p3 { background: var(--alerte-pale); color: var(--alerte); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--gris); white-space: nowrap; }
.due.late { color: var(--alerte); font-weight: 600; }
.due.today { color: var(--ambre); font-weight: 600; }
.due.done { color: var(--sauge-fonce); }
.pill-late { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--alerte-pale); color: var(--alerte); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status.s-afaire { background: var(--beige); color: var(--gris); }
.status.s-encours { background: var(--ambre-pale); color: var(--ambre); }
.status.s-fait { background: var(--menthe-pale); color: var(--sauge-fonce); }

/* ------------------------------------------------------- tableau de bord */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(120deg, var(--foret) 0%, #46594f 55%, var(--sauge) 130%);
  color: #fff; border-radius: 26px; padding: 30px 34px; margin-bottom: 22px; min-height: 168px;
}
.hero h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero p { margin: 8px 0 0; color: #d8eae1; font-size: 15.5px; max-width: 560px; }
.hero p b { color: #fff; font-weight: 600; }
.hero .hero-date { font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--menthe); font-weight: 500; margin-bottom: 10px; }
.hero .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero .btn { background: var(--menthe); border-color: var(--menthe); color: var(--foret); }
.hero .btn:hover { background: #fff; border-color: #fff; }
.hero .btn.outline { background: transparent; border-color: rgba(187, 222, 205, .6); color: #fff; }
.hero .btn.outline:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.hero-art { position: absolute; right: -10px; bottom: -14px; width: 360px; height: 200px; opacity: .9; pointer-events: none; }
.hero-text { position: relative; z-index: 1; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; cursor: pointer; transition: border-color var(--transition), transform var(--transition); }
.kpi:hover { border-color: var(--menthe); transform: translateY(-2px); }
.kpi .ico { width: 48px; height: 48px; border-radius: 16px; background: var(--menthe-pale); color: var(--foret); display: flex; align-items: center; justify-content: center; flex: none; }
.kpi .ico svg.ic { width: 24px; height: 24px; }
.kpi.alert .ico { background: var(--alerte-pale); color: var(--alerte); }
.kpi.amber .ico { background: var(--ambre-pale); color: var(--ambre); }
.kpi .num { font-size: 30px; font-weight: 700; line-height: 1; color: var(--encre); }
.kpi .lbl { font-size: 13px; color: var(--gris); margin-top: 5px; }

.dash { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dash .col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.late-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid transparent;
}
.late-row + .late-row { margin-top: 4px; }
.late-row:hover { background: var(--menthe-voile); border-color: var(--ligne); }
.late-row .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--alerte); }
.late-row .body { flex: 1; min-width: 0; }
.late-row .t { font-weight: 600; font-size: 15px; }
.late-row .meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }

.proj-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 64px; gap: 16px; align-items: center; padding: 11px 6px; border-radius: 12px; cursor: pointer; }
.proj-row:hover { background: var(--menthe-voile); }
.proj-row + .proj-row { border-top: 1px dashed var(--ligne); }
.proj-row .name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.proj-row .name .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.proj-row .sub { font-size: 12.5px; color: var(--gris); font-weight: 400; }
.progress { height: 8px; background: var(--fond); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--sauge); }
.proj-row .pct { text-align: right; font-weight: 600; font-size: 14px; color: var(--foret); }

.feed { position: relative; display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.feed-item:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 42px; bottom: -6px; width: 1px; background: var(--ligne); }
.feed-item .txt { font-size: 14px; line-height: 1.4; min-width: 0; }
.feed-item .txt b { font-weight: 600; }
.feed-item .txt q { quotes: "« " " »"; color: var(--foret); font-weight: 500; }
.feed-item .when { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gris-clair); margin-top: 3px; }
.feed-item .when svg.ic { width: 14px; height: 14px; }

.event-mini { display: flex; gap: 14px; align-items: center; padding: 10px 6px; border-radius: 12px; cursor: pointer; }
.event-mini:hover { background: var(--menthe-voile); }
.event-mini + .event-mini { border-top: 1px dashed var(--ligne); }
.datebox { width: 52px; height: 56px; border-radius: 14px; background: var(--fond); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; border: 1px solid var(--ligne); }
.datebox b { font-size: 20px; line-height: 1; color: var(--foret); }
.datebox span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin-top: 4px; font-weight: 600; }
.datebox.today { background: var(--sauge); border-color: var(--sauge); }
.datebox.today b, .datebox.today span { color: #fff; }
.event-mini .t { font-weight: 600; }
.event-mini .s { font-size: 13px; color: var(--gris); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- kanban */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .sep { width: 1px; height: 26px; background: var(--ligne); }
.member-filter { display: inline-flex; align-items: center; gap: 4px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 999px; padding: 3px 6px 3px 12px; }
.member-filter .lbl { font-size: 13px; color: var(--gris); margin-right: 4px; }
.member-filter button { border: 0; padding: 0; background: transparent; border-radius: 50%; opacity: .45; transition: opacity var(--transition), transform var(--transition); }
.member-filter button:hover { opacity: .85; }
.member-filter button.on { opacity: 1; transform: scale(1.06); }
.member-filter button.on .av { box-shadow: 0 0 0 2px var(--blanc), 0 0 0 4px var(--sauge); }
select.sel, input.inp, textarea.inp {
  height: 40px; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 12px; padding: 0 12px; color: var(--encre);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition); min-width: 0;
}
select.sel { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23384740' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select.sel.pill { border-radius: 999px; height: 34px; font-size: 13.5px; padding-left: 14px; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.sel:focus, input.inp:focus, textarea.inp:focus { border-color: var(--sauge); box-shadow: 0 0 0 4px rgba(187, 222, 205, .45); }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.column {
  background: var(--colonne); border-radius: 24px; padding: 14px 12px 12px; min-width: 0;
  display: flex; flex-direction: column; min-height: 420px;
  transition: box-shadow var(--transition), background var(--transition);
}
.column.drop-on { box-shadow: inset 0 0 0 2px var(--sauge); background: #deebe3; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; }
.col-head .st-ic { width: 22px; height: 22px; color: var(--foret); }
.col-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--foret); }
.col-head .count { background: var(--blanc); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 600; color: var(--foret); }
.col-head .spacer { flex: 1; }
.col-list { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 80px; }
.col-empty { border: 1.5px dashed var(--ligne-forte); border-radius: 16px; padding: 22px 12px; text-align: center; color: var(--gris); font-size: 13.5px; }
.quick-add { display: flex; gap: 8px; margin-bottom: 10px; }
.quick-add input { flex: 1; }
.add-row { margin-top: 10px; border: 0; background: transparent; color: var(--sauge-fonce); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 12px; width: 100%; }
.add-row:hover { background: rgba(255, 255, 255, .6); color: var(--foret); }

.tcard {
  position: relative; background: var(--blanc); border-radius: 16px; padding: 14px 14px 12px;
  border: 1px solid var(--ligne); box-shadow: 0 1px 2px rgba(56, 71, 64, .05);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-touch-callout: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.tcard:hover { border-color: var(--menthe); box-shadow: 0 10px 22px -14px rgba(56, 71, 64, .5); transform: translateY(-1px); }
.tcard .top-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tcard .top-row .tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tcard .top-row .prio { margin-left: auto; }
.tcard .title { font-weight: 600; font-size: 15px; line-height: 1.32; color: var(--encre); word-wrap: break-word; }
.tcard .desc { font-size: 13px; color: var(--gris); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.tcard .foot .meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--gris); }
.tcard .foot .avs { margin-left: auto; }
.tcard.is-done .title { color: var(--gris); }
.tcard.is-done .title::before { content: "✓ "; color: var(--sauge); }
.tcard .menu-btn { position: absolute; top: 8px; right: 8px; display: none; }
.tcard.placeholder {
  background: rgba(187, 222, 205, .35); border: 2px dashed var(--sauge); box-shadow: none; transform: none;
}
.tcard.placeholder > * { visibility: hidden; }
.tcard.ghost {
  position: fixed; z-index: 1000; pointer-events: none; margin: 0;
  box-shadow: var(--ombre-forte); transform: rotate(2.2deg) scale(1.02); cursor: grabbing; border-color: var(--sauge);
}
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .tcard:not(.ghost):hover { transform: none; box-shadow: none; }

/* ---------------------------------------------------------------- tiroir */
.drawer-back { position: fixed; inset: 0; background: rgba(29, 29, 27, .28); z-index: 80; animation: fade 160ms ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); background: var(--blanc); z-index: 81;
  box-shadow: -20px 0 50px -20px rgba(29, 29, 27, .35); display: flex; flex-direction: column;
  animation: slide 200ms cubic-bezier(.2, .7, .3, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--ligne); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 26px; }
.drawer-title {
  width: 100%; border: 1px solid transparent; border-radius: 12px; padding: 6px 8px; margin: 0 -8px 12px;
  font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--encre); background: transparent; resize: none; outline: none;
}
.drawer-title:hover { border-color: var(--ligne); }
.drawer-title:focus { border-color: var(--sauge); box-shadow: 0 0 0 4px rgba(187, 222, 205, .45); }
.field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; }
.field > label, .field > .lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.field .seg button { padding: 5px 12px; font-size: 13px; }
.assign { display: flex; flex-wrap: wrap; gap: 6px; }
.assign button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 13px; color: var(--gris); }
.assign button:hover { border-color: var(--sauge); }
.assign button.on { background: var(--menthe-pale); border-color: var(--sauge); color: var(--foret); font-weight: 500; }
.assign button .av { box-shadow: none; }
.section-label { margin: 22px 0 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--foret); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .bubble { background: var(--fond); border-radius: 4px 16px 16px 16px; padding: 9px 13px; font-size: 14px; flex: 1; min-width: 0; }
.comment .bubble .who { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.comment .bubble .who span { font-weight: 400; color: var(--gris-clair); font-size: 12px; }
.comment .bubble p { margin: 3px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.composer textarea { flex: 1; min-height: 42px; max-height: 160px; border-radius: 16px; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--ligne); font-size: 12.5px; color: var(--gris); }

/* --------------------------------------------------------------- modales */
.modal-back { position: fixed; inset: 0; background: rgba(29, 29, 27, .34); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 160ms ease; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--blanc); border-radius: 24px;
  box-shadow: var(--ombre-forte); animation: pop 180ms cubic-bezier(.2, .7, .3, 1);
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .3; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 22px 24px 6px; }
.modal-head h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--foret); }
.modal-body { padding: 12px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 24px 22px; }
.modal-foot .left { margin-right: auto; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row > label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.three { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--sauge); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.colors button.on { box-shadow: 0 0 0 2px var(--blanc), 0 0 0 4px var(--foret); }
.note { background: var(--menthe-voile); border: 1px solid var(--ligne); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--foret); }
.note.warn { background: var(--ambre-pale); border-color: #ecd9b3; color: #6d4c17; }

.menu {
  position: fixed; z-index: 95; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; box-shadow: var(--ombre-forte);
  padding: 6px; min-width: 220px; animation: pop 140ms ease;
}
.menu h6 { margin: 8px 10px 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--menthe-voile); }
.menu button.on { font-weight: 600; color: var(--foret); }
.menu button.danger { color: var(--alerte); }
.menu hr { border: 0; border-top: 1px solid var(--ligne); margin: 6px 4px; }

.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--foret); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--ombre-forte); display: flex; align-items: center; gap: 10px; animation: pop 180ms ease; }
.toast svg.ic { color: var(--menthe); }

/* -------------------------------------------------------------- documents */
.docs { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; align-items: start; }
.tree { padding: 16px 12px; position: sticky; top: 16px; }
.tree-proj { margin-bottom: 6px; }
.tree-proj > button {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 12px; font-weight: 600; font-size: 14.5px; text-align: left;
}
.tree-proj > button:hover { background: var(--menthe-voile); }
.tree-proj > button .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tree-proj > button .chev { margin-left: auto; color: var(--gris); transition: transform var(--transition); }
.tree-proj.open > button .chev { transform: rotate(90deg); }
.tree-folders { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px 18px; }
.tree-folder { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 7px 10px; border-radius: 10px; font-size: 14px; color: var(--encre); text-align: left; }
.tree-folder:hover { background: var(--menthe-voile); }
.tree-folder.on { background: var(--menthe-pale); color: var(--foret); font-weight: 600; }
.tree-folder svg.ic { color: var(--sauge-fonce); }
.tree-folder .n { margin-left: auto; font-size: 12px; color: var(--gris); }
.tree-folder.drop-on { background: var(--menthe); }
.tree-add { border: 0; background: transparent; color: var(--sauge-fonce); font-size: 13px; font-weight: 600; padding: 6px 10px; display: flex; align-items: center; gap: 6px; border-radius: 10px; }
.tree-add:hover { color: var(--foret); background: var(--menthe-voile); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--gris); margin-bottom: 4px; flex-wrap: wrap; }
.crumbs b { color: var(--foret); font-weight: 600; }
.files-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.files-head h2 { margin: 0; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; color: var(--foret); font-weight: 700; }
.dropzone {
  border: 1.5px dashed var(--ligne-forte); border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 14px; color: var(--gris);
  background: var(--menthe-voile); margin-bottom: 14px; transition: background var(--transition), border-color var(--transition);
}
.dropzone .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--blanc); display: flex; align-items: center; justify-content: center; color: var(--sauge-fonce); flex: none; }
.dropzone b { color: var(--foret); }
.dropzone.over { background: var(--menthe-pale); border-color: var(--sauge); }
.ftable { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ftable .c-size { width: 92px; }
.ftable .c-who { width: 200px; }
.ftable .c-date { width: 96px; }
.ftable .c-act { width: 88px; }
.ftable td:first-child { overflow: hidden; }
.fname .n { min-width: 0; }
.ftable th { text-align: left; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
.ftable td { padding: 10px 10px; border-bottom: 1px solid #edf3ef; font-size: 14px; vertical-align: middle; }
.ftable tr.frow { cursor: pointer; }
.ftable tr.frow:hover td { background: var(--menthe-voile); }
.ftable tr.frow td:first-child { border-radius: 12px 0 0 12px; }
.ftable tr.frow td:last-child { border-radius: 0 12px 12px 0; }
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname .n small { display: block; font-size: 12px; color: var(--gris); font-weight: 400; }
.ficon { position: relative; width: 34px; height: 40px; flex: none; }
.ficon svg { width: 34px; height: 40px; }
.ficon span { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 8.5px; font-weight: 700; color: #fff; letter-spacing: .04em; }
.who-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.fcard { border: 1px solid var(--ligne); border-radius: 18px; padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; background: var(--blanc); }
.fcard:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.fcard .ficon { width: 46px; height: 54px; }
.fcard .ficon svg { width: 46px; height: 54px; }
.fcard .ficon span { font-size: 10px; bottom: 8px; }
.fcard .n { font-weight: 500; font-size: 14px; line-height: 1.3; word-break: break-word; }
.fcard .s { font-size: 12px; color: var(--gris); }
.local-badge { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ambre); background: var(--ambre-pale); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.folder-select-mobile { display: none; }

/* ----------------------------------------------------------------- agenda */
.agenda { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0 8px; font-size: 20px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--foret); min-width: 190px; }
.cal { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte); box-shadow: var(--ombre); overflow: hidden; }
.cal-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--fond); border-bottom: 1px solid var(--ligne); }
.cal-dows div { padding: 10px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; color: var(--gris); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  min-height: 116px; padding: 8px 8px 6px; border-right: 1px solid #edf3ef; border-bottom: 1px solid #edf3ef; cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; gap: 3px; transition: background var(--transition);
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--menthe-voile); }
.cal-cell.out { background: #fafcfb; }
.cal-cell.out .d { color: #b5c0ba; }
.cal-cell.we { background: #f8fbf9; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--sauge); }
.cal-cell .d { font-size: 13.5px; font-weight: 600; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--foret); margin-bottom: 2px; }
.cal-cell.today .d { background: var(--sauge); color: #fff; }
.ev {
  display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.2; padding: 3px 7px; border-radius: 7px; min-width: 0;
  background: var(--menthe-pale); color: var(--foret); border-left: 3px solid var(--sauge); overflow: hidden; white-space: nowrap;
}
.ev .tm { font-weight: 600; flex: none; }
.ev .tt { overflow: hidden; text-overflow: ellipsis; }
.ev.task { background: transparent; border: 1px dashed var(--ligne-forte); border-left: 3px solid var(--ambre); color: var(--encre); }
.ev.task.late { border-left-color: var(--alerte); }
.ev.task.done { opacity: .55; text-decoration: line-through; }
.ev:hover { filter: brightness(.97); }
.cal-more { font-size: 11.5px; color: var(--gris); padding-left: 6px; font-weight: 600; }
.day-panel { position: sticky; top: 16px; }
.day-panel h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.day-panel .big { font-size: 24px; font-weight: 700; color: var(--foret); margin-bottom: 14px; }
.slot { display: flex; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--ligne); margin-bottom: 10px; cursor: pointer; background: var(--blanc); }
.slot:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.slot .bar { width: 4px; border-radius: 4px; background: var(--sauge); flex: none; }
.slot .t { font-weight: 600; }
.slot .s { font-size: 13px; color: var(--gris); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.slot .avs { margin-top: 8px; }
.slot.task .bar { background: var(--ambre); }
.slot.task.late .bar { background: var(--alerte); }
.list-day { margin-bottom: 18px; }
.list-day h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--foret); font-weight: 700; display: flex; gap: 10px; align-items: center; }
.list-day h4 .today-pill { background: var(--sauge); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 11px; letter-spacing: .08em; }

/* ------------------------------------------------------------ discussions */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; height: calc(100vh - 150px); min-height: 520px; }
.channels { padding: 12px; overflow-y: auto; }
.channel { display: flex; gap: 12px; align-items: flex-start; width: 100%; border: 0; background: transparent; padding: 12px; border-radius: 16px; text-align: left; }
.channel:hover { background: var(--menthe-voile); }
.channel.on { background: var(--menthe-pale); }
.badge { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; letter-spacing: .02em; }
.channel .body { flex: 1; min-width: 0; display: block; overflow: hidden; }
.channel .n { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.channel .n time { margin-left: auto; font-size: 11.5px; color: var(--gris-clair); font-weight: 400; flex: none; }
.channel .p { display: block; font-size: 13px; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.convo { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.convo-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.convo-head h2 { margin: 0; font-size: 17px; letter-spacing: .1em; text-transform: uppercase; color: var(--foret); font-weight: 700; }
.convo-head p { margin: 2px 0 0; font-size: 13px; color: var(--gris); }
.convo-back { display: none; }
.stream { flex: 1; overflow-y: auto; padding: 16px 22px 8px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--ligne); }
.msg { display: flex; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 16px; }
.msg:hover { background: #f7fbf9; }
.msg .content { flex: 1; min-width: 0; }
.msg .who { display: flex; gap: 8px; align-items: baseline; }
.msg .who b { font-weight: 600; }
.msg .who span { font-size: 12px; color: var(--gris-clair); }
.msg .who .role { color: var(--gris); }
.msg .text { margin: 2px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg .text .mention { color: var(--sauge-fonce); font-weight: 600; background: var(--menthe-voile); border-radius: 6px; padding: 0 3px; }
.msg .acts { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.msg .acts button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--gris); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.msg .acts button:hover { border-color: var(--sauge); color: var(--foret); }
.msg .acts button.on { background: var(--menthe-pale); border-color: var(--sauge); color: var(--foret); }
.replies { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--menthe); display: flex; flex-direction: column; gap: 2px; }
.reply { display: flex; gap: 10px; padding: 6px 0; }
.reply .text { font-size: 14px; }
.reply-box { display: flex; gap: 8px; margin-top: 6px; align-items: flex-end; }
.reply-box textarea { flex: 1; min-height: 38px; border-radius: 14px; }
.chat-composer { border-top: 1px solid var(--ligne); padding: 14px 18px; display: flex; gap: 10px; align-items: flex-end; background: #fbfdfc; }
.chat-composer textarea { flex: 1; min-height: 44px; max-height: 180px; border-radius: 18px; }
.task-comments { padding: 16px 22px; overflow-y: auto; flex: 1; }
.tc-block { border: 1px solid var(--ligne); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.tc-block .tc-head { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
.tc-block .tc-head b { font-weight: 600; }
.tc-block .tc-head:hover b { text-decoration: underline; }

/* ---------------------------------------------------------- barre mobile */
.tabbar { display: none; }

/* ============================================================ responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda { grid-template-columns: minmax(0, 1fr); }
  .day-panel { position: static; }
  .search { width: 240px; }
}
@media (max-width: 1100px) {
  :root { --barre: 84px; }
  .side { padding: 20px 12px; align-items: center; }
  .brand { padding: 4px 0 20px; }
  .brand-name, .nav-item .lbl, .nav-item .count, .side-title, .side-projects, .sync-btn .txt, .me-card .who { display: none; }
  .nav-item { justify-content: center; padding: 12px; width: 52px; height: 48px; }
  .sync-btn { justify-content: center; padding: 10px; }
  .me-card { justify-content: center; padding: 8px; background: transparent; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: 240px minmax(0, 1fr); }
  .chat { grid-template-columns: 250px minmax(0, 1fr); }
  .top, .view { padding-left: 26px; padding-right: 26px; }
}
@media (max-width: 900px) {
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding-bottom: 10px; margin: 0 -26px; padding-left: 26px; padding-right: 26px; scroll-padding: 26px; }
  .column { flex: 0 0 300px; scroll-snap-align: start; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .tree { display: none; }
  .folder-select-mobile { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .proj-row { grid-template-columns: minmax(0, 1fr) 110px 48px; }
  .search { width: 200px; }
  .top-title p { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding-bottom: 76px; }
  .top { padding: 14px 16px 10px; gap: 10px; position: sticky; top: 0; z-index: 30; background: rgba(241, 248, 244, .94); backdrop-filter: blur(8px); }
  .top-mobile-brand { display: block; width: 36px; height: 36px; flex: none; }
  .top-title h1 { font-size: 19px; }
  .search { width: 42px; padding: 0; justify-content: center; border-radius: 50%; }
  .search input, .search kbd { display: none; }
  .search.open { position: absolute; left: 12px; right: 12px; width: auto; border-radius: 999px; padding: 0 14px; justify-content: flex-start; z-index: 40; }
  .search.open input { display: block; }
  .top .act-label { display: none; }
  .top .btn { padding: 0 14px; }
  .view { padding: 4px 16px 24px; }
  .hero { padding: 24px 22px; border-radius: 22px; }
  .hero h2 { font-size: 22px; }
  .hero-art { opacity: .35; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; gap: 12px; }
  .kpi .ico { width: 40px; height: 40px; border-radius: 13px; }
  .kpi .num { font-size: 24px; }
  .card { padding: 16px; border-radius: 18px; }
  .board { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 16px; }
  .column { flex: 0 0 86vw; }
  .proj-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .proj-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .ftable .c-size, .ftable .c-who, .ftable .c-date { display: none; }
  .ftable .c-act { width: 44px; }
  .ftable .row-actions [data-act="doc-open"] { display: none; }
  .fname .n { white-space: normal; word-break: break-word; }
  .late-row { flex-wrap: wrap; gap: 8px 12px; }
  .late-row .body { flex: 1 1 calc(100% - 20px); }
  .late-row .pill-late { margin-left: 16px; }
  .late-row .avs { margin-left: auto; }
  .card-head .link-btn { white-space: nowrap; }
  .card-title { line-height: 1.2; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-cell .ev { display: none; }
  .cal-cell .cal-more { display: none; }
  .cal-cell .dots { display: flex; }
  .cal-dows div { padding: 8px 4px; text-align: center; letter-spacing: .06em; }
  .cal-head h2 { min-width: 0; font-size: 17px; }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 150px); }
  .chat .channels { display: block; }
  .chat .convo { display: none; }
  .chat.open .channels { display: none; }
  .chat.open .convo { display: flex; }
  .convo-back { display: inline-flex; }
  .field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 68px;
    background: var(--foret); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; box-shadow: 0 -8px 24px -12px rgba(29, 29, 27, .4);
  }
  .tabbar button { flex: 1; border: 0; background: transparent; color: #cfe1d7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; border-radius: 14px; }
  .tabbar button.on { color: var(--foret); background: var(--menthe); font-weight: 600; }
  .toasts { bottom: 86px; }
}
.cal-cell .dots { display: none; gap: 3px; flex-wrap: wrap; padding: 0 2px; }
.cal-cell .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sauge); }
.cal-cell .dots i.task { background: var(--ambre); }

/* ------------------------------------------------------ comptes (admin) */
.acct-list { display: flex; flex-direction: column; border: 1px solid var(--ligne); border-radius: var(--r-moyen); overflow: hidden; }
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--blanc); }
.acct + .acct { border-top: 1px solid var(--ligne); }
.acct.off { background: var(--fond); }
.acct.off .av { filter: grayscale(1); opacity: .6; }
.acct-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.acct-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--beige); color: var(--gris); white-space: nowrap; }
.acct-badge.admin { background: var(--menthe-pale); color: var(--foret); }
.acct-badge.admin svg.ic { width: 13px; height: 13px; }
.acct-badge.off { background: var(--alerte-pale); color: var(--alerte); }
.acct-badge.warn { background: var(--ambre-pale); color: var(--ambre); }
input.inp.temp-pass { font-size: 20px; font-weight: 600; letter-spacing: .08em; text-align: center; height: 52px; color: var(--foret); background: var(--menthe-voile); }

/* ------------------------------------------------------ page de connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--fond); }
.login-art { position: relative; overflow: hidden; background: var(--foret); color: #e9f3ee; padding: 44px 48px; display: flex; flex-direction: column; }
.login-art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 70%; pointer-events: none; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 264 220' fill='none' stroke='%23BBDECD' stroke-width='1' stroke-linecap='round'%3E%3Ccircle cx='196' cy='118' r='30'/%3E%3Cpath d='M196 70v-14M232 82l10-10M160 82l-10-10M244 118h14M134 118h14'/%3E%3Cpath d='M-10 170c40-26 80-30 120-12s86 20 160-10'/%3E%3Cpath d='M-10 190c46-20 90-22 134-6s80 14 150-8'/%3E%3Cpath d='M-10 210c50-14 96-14 140-2s82 8 144-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: bottom center; background-size: 100% auto;
}
.login-art .brand { padding: 0; position: relative; z-index: 1; }
.login-art .brand-mark { width: 48px; height: 48px; }
.login-pitch { margin: auto 0; position: relative; z-index: 1; max-width: 460px; padding: 40px 0; }
.login-pitch .kicker { font-size: 12.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--menthe); font-weight: 500; margin-bottom: 14px; }
.login-pitch h1 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.login-pitch p { margin: 16px 0 0; font-size: 16px; color: #d8eae1; }
.login-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 10px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #e9f3ee; }
.login-points svg.ic { color: var(--menthe); }
.login-foot { position: relative; z-index: 1; font-size: 12.5px; color: var(--menthe); opacity: .8; letter-spacing: .04em; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: min(420px, 100%); background: var(--blanc); border: 1px solid var(--ligne); border-radius: 28px; box-shadow: var(--ombre); padding: 36px 34px 30px; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--foret); }
.login-card .lead { margin: -8px 0 4px; color: var(--gris); font-size: 14.5px; }
.login-card input.inp { height: 46px; font-size: 15.5px; }
.login-card .btn { height: 48px; font-size: 15.5px; width: 100%; margin-top: 4px; }
.login-card .note { margin: 0; }
.login-card .note code { font-size: 12.5px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 6px; padding: 1px 5px; word-break: break-all; }
.login-help { margin: 4px 0 0; font-size: 13px; color: var(--gris); text-align: center; }
.login-mobile-brand { display: none; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-main { align-items: flex-start; padding: 28px 16px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
  .login-mobile-brand .brand-mark { width: 40px; height: 40px; }
  .login-brand-name { display: flex; flex-direction: column; line-height: 1.05; }
  .login-brand-name b { font-weight: 700; font-size: 15px; letter-spacing: .16em; color: var(--foret); }
  .login-brand-name span { font-weight: 500; font-size: 11.5px; letter-spacing: .32em; color: var(--sauge); margin-top: 4px; }
  .login-card { padding: 28px 22px 24px; border-radius: 24px; }
}

/* =========================================================================
   Développement photovoltaïque, gestion commerciale, planning
   ========================================================================= */
.status.s-retard { background: var(--alerte-pale); color: var(--alerte); }
.status.s-bleu { background: #e3edf5; color: #4a6f8c; }
.page-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-bar .spacer { flex: 1; }
.page-bar .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.page-bar .seg button { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.k-hint { font-size: 12px; color: var(--gris-clair); }
.pill-mini { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--fond); color: var(--foret); white-space: nowrap; }
.pill-mini.alerte { background: var(--alerte-pale); color: var(--alerte); }
.pill-mini.ambre { background: var(--ambre-pale); color: var(--ambre); }
.pill-mini.menthe { background: var(--menthe-pale); color: var(--sauge-fonce); }
.pill-mini svg.ic { width: 13px; height: 13px; }
.etape-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* Pipeline par étape */
.pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.pipe-col { background: var(--colonne); border-radius: var(--r-carte); padding: 12px 10px 10px; min-height: 160px; scroll-snap-align: start; transition: background var(--transition); }
.pipe-col.drop-on { background: var(--menthe); }
.pipe-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.pipe-head h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--foret); flex: 1; min-width: 0; }
.pipe-head .count { background: var(--blanc); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; color: var(--foret); }
.pipe-mw { font-size: 12px; color: var(--gris); padding: 0 4px 10px; margin-top: -6px; }
.pcard { position: relative; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; padding: 12px 13px; cursor: pointer; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.pcard + .pcard { margin-top: 9px; }
.pcard:hover { border-color: var(--menthe); transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(56, 71, 64, .5); }
.pcard.bloque { border-left: 4px solid var(--alerte); }
.pcard.dragging { opacity: .45; }
.pcard .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.pcard .t .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pcard .s { font-size: 12.5px; color: var(--gris); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pcard .f { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.pcard .f .av { margin-left: auto; }

/* Carte des projets */
.carte { position: relative; height: 560px; border-radius: var(--r-carte); overflow: hidden; background: #e8f1ec; border: 1px solid var(--ligne); touch-action: none; user-select: none; cursor: grab; }
.carte.saisie { cursor: grabbing; }
.carte-fond, .carte-tuiles, .carte-marques { position: absolute; inset: 0; }
.carte-fond svg { width: 100%; height: 100%; display: block; }
.carte-tuiles img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.carte-tuiles.fond-plan img { filter: saturate(.55) contrast(.95); }
.carte-cadastre img { opacity: .85; }
/* Le point est exactement sur les coordonnées ; l'étiquette à droite (ou à gauche si la place manque). */
.carte-marq { position: absolute; transform: translate(-9px, -50%); border: 0; padding: 0; background: transparent; display: flex; align-items: center; gap: 6px; pointer-events: auto; }
.carte-marq.gauche { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), -50%); }
.carte-marq.sans-lb .lb { display: none; }
.carte-marq.sans-lb:hover .lb, .carte-marq.sans-lb.on .lb { display: inline; position: absolute; left: 24px; z-index: 3; }
.carte-fonds { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .95); border-radius: 999px; padding: 4px; box-shadow: var(--ombre); font-size: 12.5px; }
.carte-fonds button { border: 0; background: transparent; color: var(--foret); font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.carte-fonds button.on { background: var(--foret); color: #fff; }
.carte-cad { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 6px; color: var(--foret); font-weight: 600; cursor: pointer; }
.carte-marq .pt { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(29, 29, 27, .35); flex: none; }
.carte-marq.bloque .pt { box-shadow: 0 0 0 3px var(--alerte), 0 2px 8px rgba(29, 29, 27, .35); }
.carte-marq .lb { background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; color: var(--foret); white-space: nowrap; box-shadow: 0 1px 4px rgba(29, 29, 27, .15); }
.carte-marq:hover .lb, .carte-marq.on .lb { background: var(--foret); color: #fff; }
.carte-ctrl { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.carte-ctrl button { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--foret); font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.carte-legende { position: absolute; left: 12px; bottom: 12px; background: rgba(255, 255, 255, .95); border-radius: 14px; padding: 10px 12px; font-size: 12px; display: grid; grid-template-columns: repeat(3, auto); gap: 4px 14px; z-index: 2; box-shadow: var(--ombre); }
.carte-legende span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.carte-attrib { position: absolute; right: 8px; bottom: 6px; font-size: 10.5px; color: var(--gris); background: rgba(255, 255, 255, .8); padding: 1px 6px; border-radius: 6px; z-index: 2; }
.carte-attrib a { color: inherit; }
.carte-info { position: absolute; top: 12px; left: 12px; z-index: 2; width: min(300px, calc(100% - 70px)); }

/* Échéances */
.ech { display: flex; gap: 14px; align-items: center; padding: 10px 6px; border-radius: 12px; cursor: pointer; }
.ech:hover { background: var(--menthe-voile); }
.ech + .ech { border-top: 1px dashed var(--ligne); }
.ech .t { font-weight: 600; font-size: 14.5px; }
.ech .s { font-size: 12.5px; color: var(--gris); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.datebox.retard { background: var(--alerte-pale); border-color: #efc9bf; }
.datebox.retard b, .datebox.retard span { color: var(--alerte); }
.datebox.proche { background: var(--ambre-pale); border-color: #ecd9b3; }
.datebox.proche b, .datebox.proche span { color: var(--ambre); }

/* Barres (MWc par étape, CA) */
.barres { display: flex; flex-direction: column; gap: 9px; }
.barre { display: grid; grid-template-columns: 150px minmax(0, 1fr) 84px; gap: 12px; align-items: center; font-size: 13.5px; }
.barre .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barre .lbl span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre .jauge { height: 10px; border-radius: 999px; background: var(--fond); overflow: hidden; }
.barre .jauge i { display: block; height: 100%; border-radius: 999px; }
.barre .val { text-align: right; font-weight: 600; color: var(--foret); font-variant-numeric: tabular-nums; }

/* Fiche projet PV */
.fiche-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.fiche-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--foret); }
.etapes { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin-bottom: 18px; }
.etapes button { border: 0; background: var(--blanc); border-radius: 12px; padding: 10px 6px 9px; font-size: 11.5px; color: var(--gris); display: flex; flex-direction: column; align-items: center; gap: 7px; border-top: 4px solid var(--ligne); line-height: 1.2; text-align: center; }
.etapes button.passe { border-top-color: var(--sauge); color: var(--foret); }
.etapes button.on { background: var(--foret); color: #fff; border-top-color: var(--menthe); font-weight: 600; }
.etapes button:hover:not(.on) { background: var(--menthe-voile); }
.fiche { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.fiche .col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fgrid.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgrid .large { grid-column: 1 / -1; }
.fgrid .inp, .fgrid .sel { width: 100%; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--gris); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; padding-top: 2px; }
.kv dd { margin: 0; font-weight: 500; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gris); }
.bloc-alerte { display: flex; gap: 10px; align-items: flex-start; background: var(--alerte-pale); color: #7b3b2c; border-radius: 14px; padding: 11px 14px; font-size: 13.5px; }
.bloc-alerte svg.ic { color: var(--alerte); }
.item { border: 1px solid var(--ligne); border-radius: 16px; padding: 14px 16px; background: var(--blanc); }
.item + .item { margin-top: 10px; }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-head .t { font-weight: 600; font-size: 15px; }
.item-head .spacer { flex: 1; }
.item .s { font-size: 13px; color: var(--gris); margin-top: 6px; display: flex; gap: 8px 14px; flex-wrap: wrap; }
.jalon { display: flex; gap: 12px; align-items: center; padding: 9px 4px; }
.jalon + .jalon { border-top: 1px dashed var(--ligne); }
.jalon input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--sauge); }
.jalon.fait .t { color: var(--gris); text-decoration: line-through; }
.etape-groupe + .etape-groupe { margin-top: 18px; }

/* Tableaux */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px dashed var(--ligne); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clic { cursor: pointer; }
.tbl tr.clic:hover td { background: var(--menthe-voile); }
.tbl tr.on td { background: var(--menthe-pale); }
.tbl .num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl .t { font-weight: 600; }
.tbl .s { font-size: 12.5px; color: var(--gris); }
.meilleur { color: var(--sauge-fonce); font-weight: 700; }
.meilleur::after { content: " ✓"; }

/* Devis et factures */
.doc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-head h2 { margin: 0; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; color: var(--foret); }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.lignes { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.lignes th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--foret); font-weight: 600; padding: 9px 8px; white-space: nowrap; }
.lignes th:first-child { border-radius: 10px 0 0 10px; }
.lignes th:last-child { border-radius: 0 10px 10px 0; }
.lignes td { padding: 6px 6px; border-bottom: 1px dashed var(--ligne); vertical-align: top; }
.lignes tr.lot td { background: var(--menthe-voile); }
.lignes tr.lot input { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sauge-fonce); }
.lignes .inp { width: 100%; height: 34px; padding: 0 8px; border-radius: 9px; font-size: 13.5px; }
.lignes textarea.inp { height: auto; min-height: 34px; padding: 6px 8px; resize: vertical; line-height: 1.35; }
.lignes .sel { height: 34px; padding: 0 6px; border-radius: 9px; font-size: 13px; }
.lignes .num { text-align: right; }
.lignes .mt { text-align: right; font-weight: 600; padding-top: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lignes .ro td { padding: 10px 8px; }
.lignes-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.totaux-box { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: 18px; box-shadow: var(--ombre); position: sticky; top: 16px; }
.totaux-box .r { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 4px 0; color: var(--gris); font-variant-numeric: tabular-nums; }
.totaux-box .r b { color: var(--encre); font-weight: 600; }
.totaux-box .ttc { border-top: 1px solid var(--ligne); margin-top: 6px; padding-top: 10px; font-size: 15px; color: var(--encre); }
.totaux-box .net { margin-top: 10px; background: var(--sauge); color: #fff; border-radius: 999px; padding: 10px 16px; display: flex; justify-content: space-between; font-weight: 700; letter-spacing: .06em; }
.totaux-box .marge { margin-top: 12px; font-size: 12.5px; color: var(--sauge-fonce); display: flex; justify-content: space-between; }
.cycle { display: flex; flex-wrap: wrap; gap: 6px; }
.cycle span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--fond); color: var(--gris-clair); }
.cycle span.on { background: var(--sauge); color: #fff; font-weight: 600; }
.cycle span.passe { background: var(--menthe-pale); color: var(--sauge-fonce); }
.cycle span.ko { background: var(--alerte-pale); color: var(--alerte); font-weight: 600; }
.journal { font-size: 13px; }
.journal div { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--ligne); }
.journal div span:first-child { color: var(--gris-clair); width: 112px; flex: none; }
.mentions-liste { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--gris); display: flex; flex-direction: column; gap: 4px; }
.sig-apercu { background: var(--fond); border-radius: 14px; padding: 8px; }
.sig-apercu svg { width: 100%; height: 90px; display: block; }

/* Signature au doigt */
.sig-pad { position: relative; border: 2px dashed var(--ligne-forte); border-radius: 16px; background: var(--blanc); touch-action: none; }
.sig-pad canvas { display: block; width: 100%; height: 180px; border-radius: 14px; cursor: crosshair; }
.sig-pad .vide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gris-clair); font-size: 14px; pointer-events: none; }
.sig-pad.signe .vide { display: none; }

/* Import des tarifs */
.map-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.map-table td, .map-table th { padding: 6px 8px; border-bottom: 1px dashed var(--ligne); text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.map-table th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
.depot { border: 2px dashed var(--ligne-forte); border-radius: 16px; padding: 22px; text-align: center; color: var(--gris); background: var(--menthe-voile); }

/* Planning */
.plan { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte); overflow-x: auto; box-shadow: var(--ombre); }
.plan-grid { display: grid; min-width: 860px; }
.plan-h { padding: 10px 10px; font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; border-bottom: 1px solid var(--ligne); background: var(--menthe-voile); }
.plan-h.auj { color: var(--foret); background: var(--menthe-pale); }
.plan-h b { display: block; font-size: 17px; letter-spacing: 0; color: var(--foret); }
.plan-qui { padding: 12px 12px; border-bottom: 1px dashed var(--ligne); display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; position: sticky; left: 0; background: var(--blanc); z-index: 1; }
.plan-qui .s { font-size: 12px; color: var(--gris); font-weight: 400; }
.plan-c { padding: 6px; border-bottom: 1px dashed var(--ligne); border-left: 1px solid var(--fond); min-height: 74px; display: flex; flex-direction: column; gap: 5px; transition: background var(--transition); }
.plan-c.auj { background: #f7fbf9; }
.plan-c.drop-on { background: var(--menthe-pale); }
.plan-c .plus { opacity: 0; border: 0; background: transparent; color: var(--sauge-fonce); font-size: 12px; padding: 2px; border-radius: 8px; text-align: left; }
.plan-c:hover .plus { opacity: 1; }
.ichip { border: 1px solid var(--ligne); border-left: 4px solid var(--sauge); border-radius: 10px; padding: 5px 8px; background: var(--blanc); font-size: 12.5px; cursor: pointer; line-height: 1.3; text-align: left; width: 100%; }
.ichip:hover { border-color: var(--sauge); }
.ichip .h { font-weight: 600; color: var(--foret); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.ichip .x { color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ichip.conflit { border-color: var(--alerte); box-shadow: 0 0 0 2px var(--alerte-pale); }
.ichip.terminee { opacity: .62; }
.ichip.annulee { opacity: .45; text-decoration: line-through; }
.legende { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--gris); }
.legende span { display: inline-flex; gap: 6px; align-items: center; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Vue technicien (téléphone) */
.tech { max-width: 720px; margin: 0 auto; }
.tech-jour { margin: 18px 4px 8px; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--foret); font-weight: 700; }
.tech-card { display: block; width: 100%; text-align: left; background: var(--blanc); border: 1px solid var(--ligne); border-left: 5px solid var(--sauge); border-radius: 18px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--ombre); }
.tech-card .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--foret); }
.tech-card .t { font-weight: 600; font-size: 15.5px; margin-top: 4px; }
.tech-card .s { color: var(--gris); font-size: 13.5px; margin-top: 4px; display: flex; gap: 6px; align-items: flex-start; }
.bon-form .form-row textarea { min-height: 84px; }

@media (max-width: 1100px) {
  .fiche, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .totaux-box { position: static; }
  .etapes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .fgrid, .fgrid.deux { grid-template-columns: minmax(0, 1fr); }
  .carte { height: 420px; }
  .carte-legende { grid-template-columns: repeat(2, auto); }
  .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .barre { grid-template-columns: 110px minmax(0, 1fr) 70px; }
  .lignes { min-width: 760px; }
  .tech-card { padding: 16px; }
  body.role-technicien .top .search { display: none; }
}

/* ------------------------------------------------------------ messagerie */
.msg-page { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte); box-shadow: var(--ombre); overflow: hidden; }
.msg-liste { border-right: 1px solid var(--ligne); display: flex; flex-direction: column; min-height: 0; background: #fbfdfc; }
.msg-cherche { display: flex; align-items: center; gap: 8px; margin: 14px 14px 8px; padding: 0 12px; height: 40px; border: 1px solid var(--ligne); border-radius: 999px; background: var(--blanc); color: var(--gris); }
.msg-cherche input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; }
.msg-notif { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; border: 1px dashed var(--ligne-forte); background: var(--menthe-voile); color: var(--foret); border-radius: 12px; padding: 7px 12px; font-size: 13px; font-weight: 500; }
.msg-resultats { margin: 0 10px 8px; padding: 8px; border-radius: 14px; background: var(--menthe-voile); max-height: 40%; overflow-y: auto; }
.msg-resultats h6 { margin: 2px 4px 6px; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.msg-res { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 10px; font-size: 13px; }
.msg-res:hover { background: var(--blanc); }
.msg-res span { color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-items { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.msg-item { display: flex; gap: 11px; align-items: center; width: 100%; border: 0; background: transparent; padding: 10px; border-radius: 16px; text-align: left; }
.msg-item:hover { background: var(--menthe-voile); }
.msg-item.on { background: var(--menthe-pale); }
.msg-item-l1, .msg-item-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.msg-item-l1 b { font-weight: 600; font-size: 14.5px; }
.msg-item-l1 time { margin-left: auto; font-size: 11.5px; color: var(--gris-clair); flex: none; }
.msg-item-l2 { font-size: 13px; color: var(--gris); margin-top: 2px; }
.msg-item-l2 > span { flex: 1; }
.msg-item-l2 svg.ic { width: 13px; height: 13px; vertical-align: -2px; }
.msg-item.nonlu .msg-item-l1 b, .msg-item.nonlu .msg-item-l2 > span { color: var(--encre); font-weight: 600; }
.msg-item.nonlu .msg-item-l1 time { color: var(--sauge-fonce); font-weight: 600; }
.msg-badge, .tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sauge); color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.msg-arobase { width: 20px; height: 20px; border-radius: 50%; background: var(--ambre-pale); color: var(--ambre); font-style: normal; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.msg-av { position: relative; flex: none; display: inline-flex; }
.msg-av.groupe { width: 36px; height: 36px; border-radius: 13px; background: var(--c); color: #fff; align-items: center; justify-content: center; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--gris-clair); border: 2px solid var(--blanc); }
.presence.on { background: #3fa36b; }
.presence-txt { display: inline-flex; align-items: center; gap: 6px; }
.presence-txt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gris-clair); }
.presence-txt.on { color: #2f7d52; }
.presence-txt.on::before { background: #3fa36b; }
.msg-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msg-conv.vide { align-items: center; justify-content: center; }
.msg-conv.vide .empty { max-width: 360px; text-align: center; }
.msg-tete { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--ligne); }
.msg-tete h2 { margin: 0; font-size: 16.5px; font-weight: 700; color: var(--foret); letter-spacing: .02em; }
.msg-tete p { margin: 1px 0 0; }
.msg-retour { display: none; }
.msg-membres { display: flex; }
.msg-fil { flex: 1; overflow-y: auto; padding: 14px 20px 6px; display: flex; flex-direction: column; gap: 3px; background: linear-gradient(180deg, #fbfdfc, var(--blanc) 120px); }
.msg-plus { align-self: center; margin-bottom: 8px; }
.msg-jour { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.msg-jour::before, .msg-jour::after { content: ""; flex: 1; border-top: 1px solid var(--ligne); }
.msg-ligne { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; margin-top: 8px; }
.msg-ligne.suite { margin-top: 0; }
.msg-ligne.moi { align-self: flex-end; flex-direction: row-reverse; }
.msg-av-vide { width: 30px; flex: none; }
.msg-bulle { position: relative; background: var(--fond); border-radius: 18px 18px 18px 6px; padding: 8px 13px 6px; min-width: 70px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-ligne.suite .msg-bulle { border-radius: 18px 18px 18px 6px; }
.msg-ligne.moi .msg-bulle { background: var(--foret); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg-ligne.cite .msg-bulle { box-shadow: inset 3px 0 0 var(--ambre); background: var(--ambre-pale); }
.msg-bulle p { margin: 0; font-size: 14.5px; line-height: 1.42; }
.msg-bulle .mention { color: var(--sauge-fonce); font-weight: 600; background: var(--menthe-pale); border-radius: 6px; padding: 0 3px; }
.msg-ligne.moi .msg-bulle .mention { background: rgba(187, 222, 205, .22); color: var(--menthe); }
.msg-auteur { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 1px; }
.msg-heure { display: block; text-align: right; font-size: 10.5px; color: var(--gris-clair); margin-top: 2px; }
.msg-ligne.moi .msg-heure { color: #b9d2c6; }
.msg-suppr { position: absolute; top: 6px; left: -30px; width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--gris-clair); display: none; align-items: center; justify-content: center; }
.msg-ligne.moi:hover .msg-suppr { display: inline-flex; }
.msg-suppr:hover { color: var(--alerte); background: var(--alerte-pale); }
.msg-pj { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, .7); border: 1px solid var(--ligne); color: var(--foret); text-decoration: none; font-size: 13px; max-width: 280px; cursor: pointer; }
.msg-pj small { color: var(--gris); flex: none; }
.msg-ligne.moi .msg-pj { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.msg-ligne.moi .msg-pj small { color: #cfe1d7; }
.msg-img img { display: block; max-width: min(280px, 100%); max-height: 240px; border-radius: 12px; margin-top: 6px; }
.msg-lu { align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--sauge-fonce); margin-top: 3px; }
.msg-frappe { min-height: 20px; padding: 0 22px; font-size: 12.5px; color: var(--gris); font-style: italic; }
.msg-mentions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; }
.msg-mentions:empty { display: none; }
.msg-mentions button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 999px; padding: 3px 12px 3px 4px; font-size: 13px; margin-bottom: 6px; }
.msg-mentions button:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.msg-saisie { border-top: 1px solid var(--ligne); padding: 12px 16px; display: flex; gap: 8px; align-items: flex-end; background: #fbfdfc; }
.msg-saisie textarea { flex: 1; min-height: 44px; max-height: 180px; border-radius: 18px; resize: none; }
.msg-joindre { cursor: pointer; height: 44px; width: 44px; }
.msg-choix { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.msg-choix button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; border-radius: 14px; padding: 9px 10px; text-align: left; }
.msg-choix button:hover { background: var(--menthe-voile); }
.msg-choix .grow { display: flex; flex-direction: column; }
/* Messagerie unifiée : sections Projets / Groupes / Messages directs, fils de projet, groupe Terrain. */
.msg-section { margin: 14px 10px 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.msg-section:first-child { margin-top: 6px; }
.msg-fil-item, .msg-canal { display: flex; gap: 11px; align-items: center; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 16px; text-align: left; }
.msg-fil-item:hover, .msg-canal:hover, .msg-canal-sous:hover { background: var(--menthe-voile); }
.msg-fil-item.on, .msg-canal.on, .msg-canal-sous.on { background: var(--menthe-pale); }
.msg-fil-item .badge { width: 36px; height: 36px; border-radius: 12px; font-size: 13px; }
.msg-fil-item.nonlu .msg-item-l1 b, .msg-fil-item.nonlu .msg-item-l2 > span, .msg-canal.nonlu .msg-item-l1 b, .msg-canal.nonlu .msg-item-l2 > span { color: var(--encre); font-weight: 600; }
.msg-fil-item.nonlu .msg-item-l1 time, .msg-canal.nonlu .msg-item-l1 time { color: var(--sauge-fonce); font-weight: 600; }
.msg-canal-sous { display: flex; align-items: center; gap: 9px; width: calc(100% - 46px); margin: 0 0 4px 46px; border: 0; background: transparent; padding: 6px 10px; border-radius: 12px; font-size: 13px; color: var(--foret); text-align: left; }
.msg-canal-sous svg.ic { color: var(--sauge-fonce); }
.msg-atraiter { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ambre-pale); color: var(--ambre); font-size: 11.5px; font-style: normal; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.msg-urgent { width: 20px; height: 20px; border-radius: 50%; background: var(--alerte); color: #fff; font-style: normal; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; animation: pouls 1.6s ease-in-out infinite; }
@keyframes pouls { 50% { box-shadow: 0 0 0 5px rgba(196, 82, 64, .18); } }
.msg-av.terrain { width: 36px; height: 36px; border-radius: 13px; background: linear-gradient(135deg, var(--ambre), #c98f3c); color: #fff; align-items: center; justify-content: center; }
.msg-plus-projets { display: block; margin: 2px 10px 6px 56px; font-size: 13px; }
.msg-vide-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.msg-page .fil-projet { border: 0; border-radius: 0; box-shadow: none; background: var(--blanc); }
.msg-page .fil-projet .convo-head { padding: 12px 20px; gap: 12px; }
.msg-page .fil-projet .convo-head h2 { font-size: 16px; letter-spacing: .06em; }
.msg-page .fil-projet .stream { padding: 12px 20px 6px; }
.fil-membres { display: flex; }
.tr-dans-fil { background: #fdf9f1; }
.tr-dans-fil:hover { background: #fbf4e6; }
.tr-depuis { display: inline-flex; align-items: center; gap: 4px; color: var(--ambre) !important; font-weight: 600; }

/* Groupe Terrain : messages rattachés à un projet, photos, demandes suivies. */
.tr-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 4px; }
.tr-projet { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--blanc); color: var(--foret); border-radius: 999px; padding: 2px 10px 2px 8px; font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--ligne); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-projet::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sauge)); flex: none; }
button.tr-projet:hover { box-shadow: inset 0 0 0 1px var(--sauge); }
.tr-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--sauge-fonce); background: var(--menthe-voile); border-radius: 999px; padding: 2px 9px; }
.tr-type.photo { color: #3f6f8f; background: #e8f0f6; }
.tr-type.demande { color: var(--ambre); background: var(--ambre-pale); }
.tr-urgent { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--alerte); border-radius: 999px; padding: 2px 9px; }
.msg-ligne.tr-msg .msg-bulle { min-width: 180px; }
.msg-ligne.tr-msg.urgent .msg-bulle { box-shadow: inset 3px 0 0 var(--alerte); }
.msg-ligne.moi .tr-projet { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.msg-ligne.moi .tr-type { background: rgba(255, 255, 255, .16); color: #e5f1eb; }
.tr-photos { display: grid; gap: 4px; margin-top: 6px; max-width: 320px; border-radius: 14px; overflow: hidden; }
.tr-photos.n2, .tr-photos.n4 { grid-template-columns: 1fr 1fr; }
.tr-photos.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.tr-photos.n3 .tr-ph:first-child { grid-row: span 2; }
.tr-ph { position: relative; display: block; border: 0; padding: 0; background: var(--fond); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.tr-photos.n1 .tr-ph { aspect-ratio: 16 / 9; }
.tr-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-ph i { position: absolute; inset: 0; background: rgba(23, 38, 31, .55); color: #fff; font-style: normal; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tr-legende { font-size: 12.5px !important; color: var(--gris); margin-top: 4px !important; font-style: italic; }
.msg-ligne.moi .tr-legende { color: #cfe1d7; }
.tr-suivi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--ligne-forte); font-size: 12.5px; }
.msg-ligne.moi .tr-suivi { border-top-color: rgba(255, 255, 255, .25); }
.msg-ligne.moi .tr-suivi .link-btn { color: var(--menthe); }
.tr-statut { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.tr-statut.recue { background: #eef1f0; color: #55625c; }
.tr-statut.encours { background: #e8f0f6; color: #3f6f8f; }
.tr-statut.traitee { background: #e3f3ea; color: #2f7d52; }
.tr-chef { color: var(--gris); }
.msg-ligne.moi .tr-chef { color: #cfe1d7; }
.tr-bon-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--sauge-fonce); font-weight: 600; }
.msg-ligne.moi .tr-bon-ok { color: var(--menthe); }
.tr-gps { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: inherit; opacity: .8; }
.tr-attente .msg-bulle { opacity: .82; background: #2f4a3e; }
.tr-attente-etat { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #d7e6de; }
.tr-attente-etat.erreur { color: #ffd2c8; }
.tr-attente-act { display: flex; gap: 12px; margin-top: 2px; }
.tr-attente-act .link-btn { color: var(--menthe); font-size: 12.5px; }
.tr-attente .spin { width: 12px; height: 12px; border-width: 2px; }
.tr-note { display: flex; align-items: center; gap: 8px; margin: 8px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--ambre-pale); color: var(--ambre); font-size: 13px; }
.tr-saisie { border-top: 1px solid var(--ligne); background: #fbfdfc; }
.tr-saisie .msg-saisie { border-top: 0; padding-top: 6px; }
.tr-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px 0; }
.tr-champ-projet { display: flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 0; color: var(--sauge-fonce); }
.tr-champ-projet .sel { flex: 1; min-width: 0; height: 38px; border-radius: 12px; }
.tr-champ-projet.manque .sel { border-color: var(--ambre); background: var(--ambre-pale); }
.tr-types button { display: inline-flex; align-items: center; gap: 6px; }
.tr-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--foret); border-radius: 999px; padding: 5px 12px; font-size: 13px; min-height: 34px; }
.tr-chip:hover { border-color: var(--sauge); }
.tr-chip.on { background: var(--foret); border-color: var(--foret); color: #fff; }
.tr-chip.urgente.on { background: var(--alerte); border-color: var(--alerte); }
.tr-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--foret); cursor: pointer; }
.tr-check input { width: 18px; height: 18px; accent-color: var(--sauge-fonce); }
.tr-apercus { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; overflow-x: auto; }
.tr-apercu { position: relative; flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--fond); }
.tr-apercu img { width: 100%; height: 100%; object-fit: cover; }
.tr-apercu button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(23, 38, 31, .7); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tr-bouton-photo, .tr-bouton-galerie { cursor: pointer; height: 44px; width: 44px; flex: none; }
.tr-bouton-photo { color: var(--sauge-fonce); }
.tr-visionneuse { margin: 0; }
.tr-visionneuse img { display: block; width: 100%; max-height: 66vh; object-fit: contain; background: #17261f; border-radius: 14px; }
.tr-visionneuse figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--gris); }
.tr-visionneuse figcaption b { color: var(--encre); }

/* Fil terrain (bureau) : filtres, cartes et galerie photos par projet. */
.ft-conv .msg-tete { flex-wrap: wrap; }
.ft-filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 10px 20px; border-bottom: 1px solid var(--ligne); background: #fbfdfc; }
.ft-filtre { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--gris); font-weight: 600; letter-spacing: .04em; }
.ft-filtre .sel { min-width: 140px; max-width: 220px; height: 34px; }
.ft-non-traitees { padding-bottom: 7px; }
.ft-liste { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.ft-carte { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 16px; background: var(--blanc); }
.ft-carte.urgent { border-color: #e7b3a8; box-shadow: inset 3px 0 0 var(--alerte); }
.ft-carte p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.ft-qui { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13.5px; }
.ft-qui .muted { font-size: 12px; }
.ft-galerie h4 { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-size: 14px; color: var(--foret); }
.ft-galerie h4 .badge { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.ft-galerie h4 small { margin-left: auto; font-weight: 500; }
.ft-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ft-vignette { display: flex; flex-direction: column; border: 1px solid var(--ligne); border-radius: 14px; overflow: hidden; padding: 0; background: var(--blanc); text-align: left; cursor: zoom-in; }
.ft-vignette:hover { border-color: var(--sauge); }
.ft-vignette img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--fond); }
.ft-vignette span { display: flex; flex-direction: column; padding: 7px 10px 8px; font-size: 12.5px; }
.ft-vignette b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-vignette small { color: var(--gris); }
.toast.urgent { background: var(--alerte); }
.toast.urgent svg.ic { color: #fff; }
/* Photos du chantier sur le bon d'intervention. */
.bon-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 6px; }
.bon-photos a { display: block; border-radius: 10px; overflow: hidden; background: var(--fond); cursor: zoom-in; aspect-ratio: 4 / 3; }
.bon-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-terrain { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: #fdf9f1; font-size: 13px; }
.doc-terrain b { display: inline-flex; align-items: center; gap: 5px; color: var(--ambre); }
.tabbar button { position: relative; }
.tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10.5px; padding: 0 5px; border: 2px solid var(--foret); box-sizing: content-box; }
@media (max-width: 1100px) {
  .msg-page { grid-template-columns: 270px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .msg-page { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 160px); border-radius: 18px; }
  .msg-page .msg-conv { display: none; }
  .msg-page.ouverte .msg-liste { display: none; }
  .msg-page.ouverte .msg-conv { display: flex; }
  .msg-retour { display: inline-flex; }
  .msg-tete { padding: 10px 12px; gap: 8px; }
  .msg-membres { display: none; }
  .msg-fil { padding: 10px 12px 4px; }
  .msg-ligne { max-width: 90%; }
  .msg-saisie { padding: 10px; }
  .msg-saisie .act-label { display: none; }
  .msg-saisie .btn { padding: 0 14px; }
  .msg-suppr { left: -28px; }
  .msg-ligne.moi .msg-suppr { display: inline-flex; opacity: .5; }
  .msg-page .fil-projet .convo-head { padding: 10px 12px; gap: 8px; }
  .msg-page .fil-projet .convo-head .seg { width: 100%; }
  .msg-page .fil-projet .convo-head .seg button { flex: 1; }
  .msg-page .fil-projet .stream { padding: 10px 12px 4px; }
  .fil-membres { display: none; }
  .msg-page .chat-composer { padding: 10px; }
  .msg-page .chat-composer > .av { display: none; }
  .msg-page .chat-composer .act-label { display: none; }
  .msg-ligne.tr-msg { max-width: 94%; }
  .tr-photos { max-width: 100%; }
  .tr-ligne { padding: 8px 10px 0; gap: 6px; }
  .tr-champ-projet { flex-basis: 100%; }
  .tr-types { width: 100%; }
  .tr-types button { flex: 1; justify-content: center; min-height: 38px; }
  .tr-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tr-chip { flex: none; }
  .tr-apercus { padding: 8px 10px 0; }
  .tr-saisie .msg-saisie { gap: 4px; }
  .tr-bouton-galerie { width: 38px; }
  .tr-vers-fil .act-label, .ft-conv .msg-tete .btn .act-label { display: none; }
  .ft-filtres { padding: 8px 12px; gap: 8px; }
  .ft-filtre { flex: 1 1 45%; }
  .ft-filtre .sel { min-width: 0; max-width: none; width: 100%; }
  .ft-liste { padding: 10px 12px; }
  .ft-carte { padding: 10px; gap: 10px; }
  .ft-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.av.s30 { width: 30px; height: 30px; font-size: 11.5px; }
svg.ic.s14 { width: 14px; height: 14px; }
svg.ic.s36 { width: 36px; height: 36px; }

/* ------------------------------------------------ fiche document, aperçu */
.btn.block { width: 100%; justify-content: center; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--menthe); border-top-color: var(--sauge-fonce); animation: tourne .8s linear infinite; display: inline-block; }
@keyframes tourne { to { transform: rotate(360deg); } }
.local-badge.version { color: var(--sauge-fonce); background: var(--menthe-pale); }
.local-badge.verrou { display: inline-flex; align-items: center; gap: 3px; color: var(--alerte); background: var(--alerte-pale); text-transform: none; letter-spacing: 0; }
.local-badge.verrou svg.ic { width: 11px; height: 11px; }
.doc-outils { display: flex; gap: 6px; flex-wrap: wrap; }
.modal.dfiche-modal .modal-body { padding-top: 6px; }
.dfiche { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; min-height: 60vh; }
.dfiche-apercu { background: var(--fond); border-radius: 16px; min-height: 420px; max-height: 70vh; overflow: auto; display: flex; flex-direction: column; }
.apercu-attente, .apercu-vide { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--gris); text-align: center; padding: 30px; }
.apercu-vide svg.ic { width: 34px; height: 34px; color: var(--sauge); stroke-width: 1.2; }
.apercu-vide p { margin: 0; max-width: 340px; }
.apercu-image { margin: auto; padding: 16px; }
.apercu-image img { display: block; max-width: 100%; max-height: 64vh; border-radius: 10px; box-shadow: var(--ombre); }
.apercu-pdf { border: 0; width: 100%; flex: 1; min-height: 66vh; border-radius: 16px; background: #fff; }
.apercu-texte { margin: 0; padding: 18px 20px; white-space: pre-wrap; word-wrap: break-word; font: 13.5px/1.55 Consolas, 'Courier New', monospace; color: var(--encre); background: var(--blanc); flex: 1; }
.apercu-tableau { padding: 12px; overflow: auto; background: var(--blanc); flex: 1; }
.apercu-email { padding: 16px 18px; background: var(--blanc); flex: 1; display: flex; flex-direction: column; gap: 12px; }
.apercu-email .apercu-texte { padding: 12px 0 0; border-top: 1px solid var(--ligne); }
.apercu-pj { display: flex; gap: 6px; flex-wrap: wrap; }
.apercu-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; }
.apercu-pages img { display: block; max-width: 100%; background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(29, 29, 27, .15); }
.dfiche-panneau { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dfiche-titre { display: flex; gap: 12px; align-items: center; }
.dfiche-titre b { display: block; word-break: break-word; font-size: 15.5px; }
.dfiche-titre .grow { display: flex; flex-direction: column; }
.dfiche-verrou { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--alerte-pale); color: #7b3b2c; }
.dfiche-verrou.moi { background: var(--ambre-pale); color: #6d4a17; }
.dfiche-verrou .grow { display: flex; flex-direction: column; }
.dfiche-bloc { display: flex; flex-direction: column; gap: 8px; }
.dfiche-h { margin: 6px 0 0; font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dfiche-outils { display: flex; flex-wrap: wrap; gap: 6px; }
.dfiche-outil { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--foret); }
.dfiche-outil:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.dfiche-panneau .kv { font-size: 13.5px; }
.dfiche-panneau .kv .sel { max-width: 100%; }
.dfiche-versions { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.dversion { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; }
.dversion.on { background: var(--menthe-voile); }
.dversion .num { width: 34px; height: 26px; border-radius: 8px; background: var(--fond); color: var(--foret); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex: none; }
.dversion .grow { display: flex; flex-direction: column; min-width: 0; }
.dversion .grow b { font-size: 13.5px; font-weight: 600; }
.modal.collabora-modal { width: calc(100vw - 24px) !important; max-width: none; height: calc(100vh - 24px); display: flex; flex-direction: column; }
.modal.collabora-modal .modal-body { flex: 1; display: flex; flex-direction: column; padding: 0 12px; overflow: hidden; }
.collabora-cadre { flex: 1; width: 100%; border: 1px solid var(--ligne); border-radius: 12px; background: var(--blanc); }
.fusion-liste { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; margin-bottom: 14px; }
.fusion-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; cursor: pointer; }
.fusion-item:hover { background: var(--menthe-voile); }
.fusion-item input { width: 18px; height: 18px; accent-color: var(--sauge); }
.fusion-item .ficon { width: 22px; height: 26px; }
.fusion-item .ordre { min-width: 22px; height: 22px; border-radius: 50%; background: var(--sauge); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.fusion-item .ordre:empty { visibility: hidden; }
@media (max-width: 900px) {
  .dfiche { grid-template-columns: minmax(0, 1fr); }
  .dfiche-apercu { min-height: 300px; max-height: 50vh; }
  .doc-outils .act-label { display: none; }
}

/* ------------------------------------------------------------ rentabilité */
.rt-jauge { display: block; height: 8px; border-radius: 999px; background: var(--fond); overflow: hidden; margin-bottom: 4px; }
.rt-jauge i { display: block; height: 100%; border-radius: 999px; background: var(--sauge); }
.rt-jauge.alerte i { background: var(--alerte); }
.rt-neg { color: var(--alerte); font-weight: 600; }
.rt-pos { color: var(--sauge-fonce); }
.tbl tr.rt-total td { font-weight: 700; color: var(--foret); border-top: 1px solid var(--ligne); border-bottom: 0; background: var(--menthe-voile); }
.tbl tr.rt-depasse td { background: #fcf4f1; }
.tbl tr.rt-depasse svg.ic { color: var(--alerte); vertical-align: -3px; }
.rt-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.rt-kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.rt-kpi .lbl { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.rt-kpi b { font-size: 21px; color: var(--foret); font-variant-numeric: tabular-nums; }
.rt-kpi .s { font-size: 12.5px; color: var(--gris); }
.rt-kpi.alerte { border-color: #efc9bf; background: #fdf6f4; }
.rt-kpi.alerte b { color: var(--alerte); }
.rt-alertes { margin: 4px 0 0; padding-left: 18px; }
.rt-barres { display: flex; flex-direction: column; gap: 3px; }
.rt-barres i { display: block; height: 7px; border-radius: 999px; min-width: 2px; }
.rt-barres i.p { background: var(--menthe); }
.rt-barres i.r { background: var(--foret); }
.rt-barres i.r.alerte { background: var(--alerte); }
.tbl td.legende { display: table-cell; font-weight: 400; }
.tbl td.legende span { margin-right: 10px; }
.rt-scenarios tr.on td { background: var(--menthe-voile); }
.rt-liste { display: flex; flex-direction: column; }
.rt-ligne { display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
.rt-ligne + .rt-ligne { border-top: 1px dashed var(--ligne); }
.rt-ligne .grow { display: flex; flex-direction: column; min-width: 0; }
.rt-ligne .s { font-size: 12.5px; color: var(--gris); }
.rt-groupe { margin-top: 14px; }
.rt-groupe-t { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rt-groupe-t .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.rt-lignes .inp.num { text-align: right; }
.rt-lignes td:first-child { min-width: 180px; }
.rt-apercu { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border-radius: 14px; background: var(--menthe-voile); font-size: 12.5px; color: var(--gris); }
.rt-apercu span { display: flex; flex-direction: column; }
.rt-apercu b { font-size: 14px; color: var(--foret); }
.rt-apercu .tot b { font-size: 16px; }
.rt-taux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.rt-taux label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.rt-taux .inp { width: 90px; height: 34px; text-align: right; }
.rt-taux .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
@media (max-width: 1280px) { .rt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .rt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-taux { grid-template-columns: minmax(0, 1fr); }
  .rt-lignes { min-width: 640px; }
  .rt-groupe { overflow-x: auto; }
}

/* ---------------------------------------------- capacités du réseau (carte) */
.carte-reseau { position: absolute; inset: 0; pointer-events: none; }
.carte-poste { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%) rotate(45deg); border: 0; padding: 0; background: transparent; pointer-events: auto; cursor: pointer; }
.carte-poste i { display: block; width: 100%; height: 100%; border-radius: 4px; border: 2.5px solid #fff; box-shadow: 0 1px 6px rgba(29, 29, 27, .4); background: #9aa5a0; }
.carte-poste.vert i, .niv.vert, .carte-reseau-leg i.vert { background: #2f9e5b; }
.carte-poste.orange i, .niv.orange, .carte-reseau-leg i.orange { background: #e08a1e; }
.carte-poste.rouge i, .niv.rouge, .carte-reseau-leg i.rouge { background: #c8452f; }
.carte-poste.inconnu i, .niv.inconnu, .carte-reseau-leg i.inconnu { background: #9aa5a0; }
.carte-poste:hover i, .carte-poste.on i { border-color: var(--foret); transform: scale(1.15); }
.carte-reseau-leg { position: absolute; left: 12px; bottom: 58px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: calc(100% - 24px); background: rgba(255, 255, 255, .95); border-radius: 14px; padding: 7px 12px; font-size: 12px; box-shadow: var(--ombre); color: var(--foret); }
.carte-reseau-leg span { display: inline-flex; align-items: center; gap: 5px; }
.carte-reseau-leg i { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); display: inline-block; }
.carte-reseau-leg em { color: var(--gris); font-size: 11.5px; }
.carte-bulle { position: absolute; z-index: 4; width: 290px; background: var(--blanc); border-radius: 16px; box-shadow: var(--ombre-forte); padding: 14px 16px 12px; font-size: 13px; cursor: default; }
.rb-fermer { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--gris); }
.rb-nom { display: block; font-size: 14.5px; color: var(--foret); padding-right: 18px; }
.rb-s { display: block; font-size: 12px; color: var(--gris); margin-top: 1px; }
.rb-kv { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 5px 12px; margin: 10px 0 8px; align-items: baseline; }
.rb-travaux { margin: 0 0 6px; font-size: 12.5px; color: var(--encre); }
.rb-kv dt { color: var(--gris); font-size: 12px; }
.rb-kv dd { margin: 0; font-weight: 600; text-align: right; }
.rb-kv dd.vert { color: #23804a; }
.rb-kv dd.orange { color: #b06a0f; }
.rb-kv dd.rouge { color: var(--alerte); }
.rb-source { margin: 6px 0 0; font-size: 11.5px; color: var(--gris); }
.rb-avert { margin: 4px 0 0; font-size: 11.5px; color: var(--ambre); font-weight: 500; }
.reseau-panneau { margin-top: 16px; }
.reseau-panneau .card-title { display: inline-flex; align-items: center; gap: 8px; }
.reseau-panneau .card-head .btn { margin-left: 6px; }
.reseau-proches { display: flex; flex-direction: column; }
.reseau-poste + .reseau-poste { border-top: 1px dashed var(--ligne); }
.reseau-poste summary { display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; list-style: none; }
.reseau-poste summary::-webkit-details-marker { display: none; }
.reseau-poste summary .grow { display: flex; flex-direction: column; }
.reseau-poste summary .s { font-size: 12.5px; color: var(--gris); }
.reseau-poste .niv { width: 11px; height: 11px; border-radius: 2px; transform: rotate(45deg); flex: none; }
.reseau-poste .mw { white-space: nowrap; font-size: 13.5px; }
.reseau-poste .mw.vert { color: #23804a; }
.reseau-poste .mw.orange { color: #b06a0f; }
.reseau-poste .mw.rouge { color: var(--alerte); }
.reseau-detail { padding: 2px 4px 10px 22px; font-size: 13px; }
.reseau-detail .rb-nom { display: none; }
.ri-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ri-champs label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--gris); }
@media (max-width: 720px) {
  .carte-reseau-leg { bottom: 56px; font-size: 11px; }
  .carte-bulle { width: min(290px, calc(100% - 16px)); }
  .ri-champs { grid-template-columns: minmax(0, 1fr); }
}
/* ---------------------------------------------- réseau Enedis HTA/BT (carte, fiche, création) */
.carte-bas { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: calc(100% - 24px); pointer-events: none; }
.carte-bas > * { pointer-events: auto; }
.carte-bas .carte-fonds, .carte-bas .carte-reseau-leg { position: static; max-width: 100%; }
.carte-bas .carte-fonds { flex-wrap: wrap; border-radius: 18px; }
.carte-enedis, .carte-liaisons { position: absolute; inset: 0; pointer-events: none; }
.carte-enedis svg, .carte-liaisons svg { position: absolute; left: 0; top: 0; }
.carte-liaisons text { font-family: var(--police); font-size: 11.5px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3.6px; stroke-linejoin: round; }
.carte-enedis-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: 100%; background: rgba(255, 255, 255, .95); border-radius: 14px; padding: 7px 12px; font-size: 12px; box-shadow: var(--ombre); color: var(--foret); }
.carte-enedis-leg[hidden] { display: none; }
.carte-enedis-leg span { display: inline-flex; align-items: center; gap: 6px; }
.carte-enedis-leg i.en-l { width: 22px; height: 0; border-top: 3px solid #e8432c; display: inline-block; }
.carte-enedis-leg i.en-l.bt { border-top: 2px solid #7a3fd6; }
.carte-enedis-leg i.en-l.sout { border-top-style: dashed; }
.carte-enedis-leg i.en-p { width: 9px; height: 9px; background: #ffc61a; border: 1.4px solid #26221a; display: inline-block; }
.carte-enedis-leg em { color: var(--gris); font-size: 11.5px; }
.carte-enedis-leg em.en-erreur { color: var(--alerte); }
.carte-enedis-leg em.en-mention { flex-basis: 100%; font-size: 11px; }
.carte-cad.en-hta input { accent-color: #e8432c; }
.carte-cad.en-bt input { accent-color: #7a3fd6; }
.carte-cad.en-postes input { accent-color: #c99700; }
.carte.en-mini { height: 380px; margin-bottom: 12px; border-radius: 14px; }
.en-mini .carte-enedis-leg { font-size: 11.5px; padding: 5px 10px; gap: 2px 10px; }
.en-mini .carte-enedis-leg em.en-mention { display: none; }
.en-mini .carte-fonds { font-size: 11.5px; }
.en-mini .carte-fonds button { padding: 4px 10px; }
.en-bloc { margin-top: 16px; }
.en-dists { display: flex; flex-direction: column; }
.en-dist { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.en-dist + .en-dist { border-top: 1px dashed var(--ligne); }
.en-dist .grow { display: flex; flex-direction: column; min-width: 0; }
.en-dist .s { font-size: 12.5px; color: var(--gris); }
.en-dist .v { white-space: nowrap; font-size: 14px; color: var(--foret); }
.en-ico { flex: none; display: inline-block; }
.en-ico.hta { width: 18px; height: 0; border-top: 3px solid #e8432c; }
.en-ico.bt { width: 18px; height: 0; border-top: 2px solid #7a3fd6; }
.en-ico.postes { width: 10px; height: 10px; margin: 0 4px; background: #ffc61a; border: 1.4px solid #26221a; }
.en-ico.source { width: 11px; height: 11px; margin: 0 3.5px; border-radius: 2px; transform: rotate(45deg); background: #1d5c46; }
.en-probable { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--menthe-pale, #eef6f1); color: var(--foret); font-size: 13.5px; }
.en-probable .ico, .en-probable svg { flex: none; }
.en-bref .s-dd { font-size: 12px; color: var(--gris); }
.np-reseau { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.np-reseau .en-probable { margin-top: 0; padding: 7px 10px; font-size: 13px; }
@media (max-width: 720px) {
  .carte.en-mini { height: 240px; }
  .carte-bas .carte-fonds { font-size: 11.5px; }
}
.rt-postes td.t, .rt-scenarios th { white-space: nowrap; }
.rt-scenarios td:first-child { min-width: 150px; }
.rt-scenarios td:first-child .t { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
/* ------------------------------------------------------ logo Artolys Énergie (fourni par l'équipe) */
.brand-name.brand-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; line-height: 1; }
.brand-name.brand-logo img { display: block; width: 176px; max-width: 100%; height: auto; }
.brand-name.brand-logo .brand-kicker { font-weight: 600; font-size: 10.5px; letter-spacing: .32em; color: var(--menthe); margin: 0 0 0 2px; white-space: nowrap; }
.brand-name.brand-logo.couleur .brand-kicker { color: var(--sauge); }
.side .brand { padding: 6px 10px 24px; }
.side .brand .brand-mark { display: none; }
.login-art .brand-logo img { width: 220px; }
.login-mobile-brand .brand-logo img { width: 168px; }
@media (max-width: 1100px) {
  .side .brand { padding: 4px 0 20px; }
  .side .brand .brand-mark { display: block; }
}
/* ------------------------------------------------------ Artolys Développement : pictogramme « O » et bandeau */
img.brand-mark, img.top-mobile-brand { object-fit: contain; }
.hero-logo { position: absolute; top: 28px; right: 36px; width: 150px; height: auto; z-index: 1; opacity: .96; pointer-events: none; }
@media (max-width: 900px) { .hero-logo { width: 116px; top: 22px; right: 22px; } }
@media (max-width: 720px) { .hero-logo { display: none; } }

/* ------------------------------------------- pré-analyse de raccordement (indicateur, estimation) */
.pa-pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--foret); white-space: nowrap; vertical-align: middle; }
.pa-pastille i { width: 11px; height: 11px; border-radius: 50%; background: #9aa5a0; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(56, 71, 64, .18); flex: none; }
.pa-pastille.vert i { background: #2f9e5b; }
.pa-pastille.orange i { background: #e08a1e; }
.pa-pastille.rouge i { background: #c8452f; }
.pa-pastille.gris i { background: #9aa5a0; }
.pa-pastille.rouge span { color: #a23a27; }
.pa-pastille.grand { font-size: 14px; }
.pa-pastille.grand i { width: 14px; height: 14px; }
.pcard .t .pa-pastille { margin-left: 4px; }
.pa-tete { display: flex; flex-direction: column; gap: 4px; }
.pa-estim { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--menthe-voile); border: 1px solid var(--ligne); }
.pa-estim .lbl { display: block; font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gris); font-weight: 600; }
.pa-estim b { display: block; font-size: 20px; color: var(--foret); margin: 2px 0; }
.pa-estim .s, .pa-poste .s, .s-dd { display: block; font-size: 12.5px; color: var(--gris); font-weight: 400; }
.pa-detail { margin-top: 10px; }
.pa-detail summary { cursor: pointer; font-weight: 600; color: var(--sauge-fonce); font-size: 13px; }
.pa-ptf { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ligne); display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pa-ptf span { color: var(--gris); font-size: 12.5px; }
.pa-ptf.haut { background: var(--alerte-pale); border-color: #f0c9bf; }
.pa-ptf.bas, .pa-ptf.ok { background: var(--menthe-voile); }
.pa-postes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pa-poste { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.pa-poste .pa-pastille { margin-top: 3px; }
.pa-mention { margin: 10px 0 0; font-size: 12px; font-style: italic; color: #6d4c17; }
dd .pa-mention { margin-top: 4px; font-size: 11.5px; }
.pa-lien { padding: 0; }
.np-site { margin-top: 2px; }
.np-pa { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border: 1px dashed var(--ligne); border-radius: 14px; background: var(--menthe-voile); margin-top: 10px; }
.np-pa .np-estim { flex-basis: 100%; font-size: 13.5px; color: var(--foret); }
.np-pa .pa-mention { flex-basis: 100%; margin: 0; }
.np-geo:empty { display: none; }
.np-choix { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.np-choix .chip { font-size: 12px; height: auto; padding: 4px 10px; }
.pa-synthese { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 14px 20px; margin-bottom: 22px; }
.pa-synth-n { display: flex; align-items: center; gap: 12px; color: var(--foret); }
.pa-synth-n b { display: block; font-size: 22px; line-height: 1.1; }
.pa-synth-n span { font-size: 13px; color: var(--gris); }
.pa-synthese .pa-mention { flex-basis: 100%; margin: 0; }
.leg-pa { display: inline-flex; align-items: center; gap: 6px; }
.leg-pa i { width: 9px !important; height: 9px !important; border-radius: 50% !important; }
.leg-pa i.vert { background: #2f9e5b; } .leg-pa i.orange { background: #e08a1e; } .leg-pa i.rouge { background: #c8452f; } .leg-pa i.gris { background: #9aa5a0; }
.carte-marq .racc { position: absolute; left: 12px; top: -6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: #9aa5a0; box-shadow: 0 1px 3px rgba(29, 29, 27, .35); }
.carte-marq.gauche .racc { left: auto; right: -3px; }
.carte-marq .racc.vert { background: #2f9e5b; } .carte-marq .racc.orange { background: #e08a1e; } .carte-marq .racc.rouge { background: #c8452f; }

/* ---------------------------------------------------------- autoconsommation collective */
.ac-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.ac-nav button { border: 1px solid var(--ligne); background: var(--blanc); color: var(--foret); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.ac-nav button:hover { border-color: var(--sauge); }
.ac-nav button.on { background: var(--sauge-fonce); border-color: var(--sauge-fonce); color: #fff; }
.ac-fiche { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.ac-carte { height: 460px; }
.carte-surcouche { position: absolute; inset: 0; pointer-events: none; }
.ac-cercle { position: absolute; left: 0; top: 0; overflow: visible; }
.ac-poignee { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; background: var(--foret); box-shadow: 0 2px 8px rgba(29, 29, 27, .4); cursor: move; pointer-events: auto; padding: 0; }
.carte-marq .pt.centrale { width: 22px; height: 22px; border-radius: 6px; transform: rotate(45deg); }
.carte-marq .pt.off { opacity: .85; }
.carte-marq .pt.prospect { border: 3px solid #5f86a3; width: 15px; height: 15px; }
.ac-liste { display: flex; flex-direction: column; gap: 6px; }
.ac-ligne { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ligne); border-radius: 14px; background: var(--blanc); font-size: 13.5px; }
.ac-ligne.on { background: var(--menthe-voile); border-color: #cfe3d8; }
.ac-ligne.clic { cursor: pointer; }
.ac-ligne.clic:hover { border-color: var(--sauge); }
.ac-ligne .s { display: block; font-size: 12.5px; color: var(--gris); }
.ac-ligne .grow { min-width: 0; }
.ac-coche input { width: 18px; height: 18px; accent-color: var(--sauge-fonce); }
.ac-conf { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 11px 13px; border-radius: 14px; font-size: 13.5px; }
.ac-conf.ok { background: var(--menthe-pale); color: var(--sauge-fonce); }
.ac-conf.ko { background: var(--alerte-pale); color: var(--alerte); }
.ac-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ac-kpis.petit { margin: 14px 0 0; }
.ac-kpi { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.ac-kpi b { font-size: 19px; color: var(--encre); line-height: 1.15; }
.ac-kpi span { font-size: 12.5px; color: var(--gris); }
.ac-kpi.fort { background: var(--menthe-pale); border-color: #cfe3d8; }
.ac-kpi.fort b { color: var(--sauge-fonce); }
.ac-kpi.neg b { color: var(--alerte); }
.ac-reco { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-size: 13.5px; background: var(--menthe-voile); border: 1px solid var(--ligne); color: var(--foret); }
.ac-reco.conseil { background: var(--ambre-pale); border-color: #ecd9b3; color: #6d4c17; }
.ac-reco.alerte { background: var(--alerte-pale); border-color: #f0c9bf; color: var(--alerte); }
.ac-graph { width: 100%; height: auto; display: block; }
.ac-graph .grille { stroke: var(--ligne); stroke-width: 1; }
.ac-graph .zero { stroke: var(--gris); stroke-width: 1; }
.ac-graph .ax { font-size: 11px; fill: var(--gris); font-family: inherit; }
.ac-graph .b-prod { fill: #f2d49a; }
.ac-graph .b-auto { fill: #4f8a6a; }
.ac-graph .b-conso { fill: #9fb6c6; }
.ac-graph .b-pos { fill: #4f8a6a; }
.ac-graph .b-neg { fill: #d38b7b; }
.legende i.l-prod { background: #f2d49a; } .legende i.l-auto { background: #4f8a6a; } .legende i.l-conso { background: #9fb6c6; }
.ac-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.ac-devis { display: flex; flex-direction: column; gap: 6px; }
.ac-flux td, .ac-flux th { padding: 7px 8px; font-size: 12.5px; }
.ac-courbe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 14px; font-size: 13.5px; }
.ac-courbe .grow { min-width: 220px; }
.ac-courbe .s { display: block; font-size: 12.5px; color: var(--gris); }
.ac-courbe .sel { height: 32px; font-size: 13px; max-width: 200px; }
.ac-mini { display: inline-flex; align-items: flex-end; gap: 2px; height: 28px; }
.ac-mini i { display: block; width: 5px; background: var(--sauge); border-radius: 2px 2px 0 0; }

/* ------------------------------------------------------------------------- suivi ACCTIS */
.acc-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.acc-mode.sim { background: var(--ambre-pale); color: #6d4c17; }
.acc-mode.api { background: var(--menthe-pale); color: var(--sauge-fonce); }
.acc-boucle { margin-bottom: 18px; }
.acc-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.acc-statut { font-size: 15px; }
.acc-statut.vert { color: #2f7d4c; } .acc-statut.orange { color: #b26b12; } .acc-statut.rouge { color: #a23a27; }
.acc-etapes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.acc-etapes > div { position: relative; padding: 10px 12px 10px 30px; border-radius: 12px; background: var(--fond); font-size: 13px; }
.acc-etapes > div i { position: absolute; left: 11px; top: 14px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--gris-clair, #b9c4bf); }
.acc-etapes > div.on { background: var(--menthe-pale); }
.acc-etapes > div.on i { background: var(--sauge-fonce); border-color: var(--sauge-fonce); }
.acc-etapes b { display: block; color: var(--foret); }
.acc-etapes span { font-size: 12px; color: var(--gris); }
.acc-alertes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.acc-alerte { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; }
.acc-alerte.rouge { background: var(--alerte-pale); color: var(--alerte); }
.acc-alerte.orange { background: var(--ambre-pale); color: #6d4c17; }
.acc-alerte.ligne { cursor: pointer; margin-bottom: 6px; }
.acc-alerte.ligne .t { font-weight: 600; }
.acc-alerte.ligne .s { font-size: 12px; opacity: .85; }
.acc-prel { margin-top: 14px; }
.acc-prel td .s { display: block; font-size: 12px; color: var(--gris); margin-top: 2px; }
.acc-st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fond); color: var(--gris); white-space: nowrap; }
.acc-st.verse { background: var(--menthe-pale); color: var(--sauge-fonce); }
.acc-st.preleve { background: #e3edf3; color: #3f6680; }
.acc-st.en_cours { background: var(--ambre-pale); color: #8a5d14; }
.acc-st.incident { background: var(--alerte-pale); color: var(--alerte); }
.carte-reseau-leg[hidden], .carte-bulle[hidden] { display: none; }
.ac-cercle circle.fond { fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .95); stroke-width: 5; }
.ac-cercle circle.trait { fill: none; stroke: #2f5a46; stroke-width: 2.2; stroke-dasharray: 9 6; }
.ac-cercle circle.centre { fill: #2f5a46; stroke: #fff; stroke-width: 1.5; }
.ac-poignee { width: auto; height: auto; margin: 0; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; border: 2px solid #2f5a46; background: #fff; color: var(--foret); font-size: 11.5px; font-weight: 700; white-space: nowrap; z-index: 1; }
.ac-poignee:hover { transform: translate(-50%, -50%) scale(1.06); background: var(--menthe-pale); }@media (max-width: 1100px) { .ac-fiche { grid-template-columns: minmax(0, 1fr); } .acc-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .ac-carte { height: 340px; } .ac-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Flux annuels du business plan : rubrique repliable */
.ac-flux-det > summary { cursor: pointer; list-style: none; }
.ac-flux-det > summary::-webkit-details-marker { display: none; }
.ac-flux-det > summary::after { content: 'Afficher'; margin-left: auto; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--sauge-fonce); }
.ac-flux-det[open] > summary::after { content: 'Masquer'; }
.acc-boucle .card-title::before { display: none; }
.np-site .form-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.np-site .np-gps .inp { min-width: 0; flex: 1 1 0; padding-left: 10px; padding-right: 6px; }
.pa-tranches { table-layout: fixed; width: 100%; }
.pa-tranches td { padding-left: 6px; padding-right: 6px; }
.pa-tranches .inp { width: 100%; min-width: 0; }
.pa-tranches th { white-space: normal; }

/* =====================================================================
   Plateforme (phase 0) : sélecteur de société, réglages de la plateforme
   (sociétés, modules, droits, connecteurs), bons du poseur, démarrage
   ===================================================================== */
.soc-sel {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 14px; flex: none;
  border-radius: 999px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--foret);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: border-color var(--transition), background var(--transition);
}
.soc-sel:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.soc-sel.choisie { border-color: var(--sauge); }
.soc-sel svg.ic { color: var(--gris); }
.soc-pastilles { display: inline-flex; align-items: center; }
.soc-pastilles .soc-pastille + .soc-pastille { margin-left: -4px; }
.soc-pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--blanc); vertical-align: -1px; }
.soc-pastille.grande { width: 20px; height: 20px; box-shadow: 0 0 0 4px var(--menthe-voile); }
.menu .soc-pastilles, .menu > button > .soc-pastille { margin: 0 2px; }

.pf-modal .modal-body { gap: 16px; }
.pf { display: flex; flex-direction: column; gap: 16px; min-height: 360px; }
.pf-onglets { align-self: flex-start; flex-wrap: wrap; }
.pf-onglets button { display: inline-flex; align-items: center; gap: 7px; }
.pf-corps { display: flex; flex-direction: column; gap: 16px; }
.pf .card { box-shadow: none; border: 1px solid var(--ligne); }

.pf-societes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-soc { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.pf-soc.edit { grid-column: 1 / -1; }
.pf-soc-tete { display: flex; align-items: center; gap: 12px; }
.pf-soc-tete b { font-size: 15.5px; color: var(--foret); }
.pf-soc .kv { font-size: 13.5px; }
.pf-flux .tbl td { font-size: 13.5px; }

.pf-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-module, .pf-noyau { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.pf-noyau { background: var(--menthe-voile); }
.pf-mod-tete { display: flex; align-items: flex-start; gap: 12px; }
.pf-mod-tete b { color: var(--foret); font-size: 15px; }
.pf-mod-ic { width: 40px; height: 40px; border-radius: 13px; background: var(--menthe-pale); color: var(--foret); display: grid; place-items: center; flex: none; }
.pf-mod-ic svg.ic { width: 20px; height: 20px; }
.pf-bascules { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-bascule {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 999px;
  border: 1px solid var(--ligne); background: var(--blanc); font-size: 12.5px; color: var(--gris); cursor: pointer; user-select: none;
}
.pf-bascule.on { border-color: var(--sauge); color: var(--foret); font-weight: 500; }
.pf-bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pf-interrupteur { position: relative; width: 28px; height: 18px; border-radius: 999px; background: var(--ligne-forte); flex: none; transition: background var(--transition); }
.pf-interrupteur::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--blanc); box-shadow: 0 1px 2px rgba(29, 29, 27, .2); transition: transform var(--transition); }
.pf-bascule input:checked + .pf-interrupteur { background: var(--sauge); }
.pf-bascule input:checked + .pf-interrupteur::after { transform: translateX(10px); }
.pf-bascule .soc-pastille { width: 10px; height: 10px; }
.pf-bascule input:focus-visible + .pf-interrupteur { box-shadow: 0 0 0 3px rgba(187, 222, 205, .8); }
.pf-bascule input:disabled + .pf-interrupteur { opacity: .55; }
.pf-details > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--sauge-fonce); list-style: none; }
.pf-details > summary::-webkit-details-marker { display: none; }
.pf-details[open] > summary { margin-bottom: 8px; }
.pf-details .kv { font-size: 13px; }

.pf-droits { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-personnes { display: flex; flex-direction: column; gap: 4px; max-height: 560px; overflow: auto; padding-right: 2px; }
.pf-personne {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; background: transparent;
  padding: 8px 10px; border-radius: 14px; text-align: left; font-size: 14px; color: var(--encre);
}
.pf-personne:hover { background: var(--menthe-voile); }
.pf-personne.on { background: var(--menthe-pale); border-color: var(--sauge); }
.pf-personne.off { opacity: .55; }
.pf-personne .small { display: block; }
.pf-fiche-droits { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pf-fiche-tete { flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pf-fiche-tete .form-row { min-width: 200px; flex: 1 1 200px; }
.pf-matrice { font-size: 13px; }
.pf-matrice th { white-space: nowrap; }
.pf-matrice th .soc-pastille { margin-right: 7px; }
.pf-matrice td { padding: 6px 8px; }
.pf-matrice td:first-child { font-weight: 600; color: var(--foret); white-space: nowrap; }
.pf-cell .sel { height: 32px; font-size: 12.5px; padding-left: 10px; padding-right: 26px; min-width: 120px; border-radius: 10px; }
.pf-cell.n0 .sel { color: var(--gris-clair); }
.pf-cell.n1 .sel { background-color: var(--menthe-voile); }
.pf-cell.n2 .sel { background-color: var(--menthe-pale); color: var(--foret); }
.pf-cell.n3 .sel { background-color: #cfe6da; color: var(--foret); font-weight: 600; }
.pf-cell.sur .sel { border-color: var(--ambre); box-shadow: inset 3px 0 0 var(--ambre); }
.pf-cell.off { color: var(--gris-clair); font-size: 12px; font-style: italic; }
.pf-sensibles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.pf-sensible { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--ligne); border-radius: 12px; font-size: 13.5px; }
.pf-sensible .sel { height: 32px; font-size: 12.5px; width: auto; min-width: 128px; border-radius: 10px; }
.pf-journal td { font-size: 13px; vertical-align: top; }

.pf-conn-bandeau { flex-wrap: wrap; justify-content: space-between; }
.pf-connecteurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pf-conn { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-width: 0; }
.pf-conn.ouvert { grid-column: 1 / -1; border-color: var(--sauge); }
.pf-conn.bientot { background: var(--fond); border-style: dashed; }
.pf-conn-tete { display: flex; align-items: center; gap: 10px; }
.pf-conn-tete b { color: var(--foret); font-size: 15px; }
.pf-conn-desc { margin: 0; color: var(--gris); line-height: 1.45; }
.pf-conn-socs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-conn-test { margin: 0; padding: 7px 10px; border-radius: 10px; }
.pf-conn-test.ok { background: var(--menthe-voile); color: var(--sauge-fonce); }
.pf-conn-test.ko { background: var(--alerte-pale); color: var(--alerte); }
.pf-conn-actions { flex-wrap: wrap; gap: 8px; margin-top: auto; }
.pf-conn-reglages { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; border-top: 1px dashed var(--ligne); }
.pf-champs { display: flex; flex-direction: column; gap: 8px; }
.pf-champ { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-champ .inp { flex: 1 1 220px; min-width: 0; }
.pf-champ-nom { width: 170px; flex: none; font-size: 13.5px; font-weight: 600; color: var(--foret); }
.pf-secret { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--beige); color: var(--gris); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pf-secret.ok { background: var(--menthe-pale); color: var(--foret); }
.pf-synchro { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pf-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.pf-check input { width: 17px; height: 17px; accent-color: var(--sauge); }
.pf-avenir { font-weight: 500; color: var(--foret); }
.pf-conn-journal { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pf-conn-journal .tbl td { font-size: 12.5px; padding: 7px 8px; }

.pf-chip-soc { height: 32px; padding: 0 12px; gap: 7px; font-size: 13px; color: var(--gris); }
.pf-chip-soc.on { background: var(--menthe-pale); border-color: var(--sauge); color: var(--foret); font-weight: 600; }
.pf-chip-soc[hidden] { display: none; }
.pf-projet-socs { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.pf-societes-projet .chips, .pf-societes-projet [id$="-intervenantes"] { display: flex; flex-wrap: wrap; gap: 6px; }

.tech-bons .tech-card { border-left-color: var(--ambre); }
.tech-bons .tech-card.signe { border-left-color: var(--sauge); opacity: .85; }
.tech-bon-jour { margin: 18px 4px 8px; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--foret); font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* Écran de démarrage : seulement dans l'application installée (fenêtre autonome) */
.splash { display: none; }
@media (display-mode: standalone) {
  .splash {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    background: var(--fond); transition: opacity 320ms ease, visibility 320ms ease;
  }
  .splash img { width: min(280px, 62vw); height: auto; }
  .splash.fini { opacity: 0; visibility: hidden; pointer-events: none; }
}
.splash-anneau { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--menthe); border-top-color: var(--sauge); animation: splash-tour 900ms linear infinite; }
@keyframes splash-tour { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .pf-connecteurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-droits { grid-template-columns: minmax(0, 1fr); }
  .pf-personnes { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .pf-personne { width: auto; flex: none; }
}
@media (max-width: 720px) {
  .soc-sel { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .soc-sel .soc-nom, .soc-sel > svg.ic { display: none; }
  .pf-modal .modal-head { padding: 18px 18px 4px; }
  .pf-modal .modal-body { padding: 10px 16px 8px; }
  .pf-societes, .pf-modules, .pf-connecteurs, .pf-sensibles { grid-template-columns: minmax(0, 1fr); }
  .pf-onglets { align-self: stretch; overflow-x: auto; flex-wrap: nowrap; }
  .pf-onglets button { padding: 6px 11px; }
  .pf-champ-nom { width: 100%; }
}

/* =========================================================================
   Phase 1 — commercial (CRM), apporteurs, validations, double authentification
   ========================================================================= */
/* Cloche des notifications */
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--alerte); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--fond); }
.menu .notif { align-items: flex-start; max-width: 380px; }
.menu .notif.nonlue { background: var(--menthe-voile); }
.menu .notif.nonlue > svg.ic { color: var(--alerte); }
.menu .notif + .notif { margin-top: 2px; }

/* Commercial : en-têtes, kanban */
.crm-vues button, .val-vues button, .app-vues button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.crm-vues .count, .val-vues .count, .app-vues .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--alerte); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.crm-toolbar .search { min-width: 220px; }
.crm-entete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-socs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.crm-col { background: var(--colonne); border-radius: var(--r-carte); padding: 12px 10px 10px; min-height: 180px; scroll-snap-align: start; transition: background var(--transition); }
.crm-col.survol { background: var(--menthe); }
.crm-col.fin.gagne { background: #dcefe3; }
.crm-col.fin.perdu { background: #efe9e4; }
.crm-col header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.crm-col h3 { margin: 0; flex: 1; min-width: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--foret); }
.crm-col .count { background: var(--blanc); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; color: var(--foret); }
.crm-col-total { font-size: 12.5px; color: var(--gris); padding: 0 4px 8px; margin-top: -4px; font-weight: 600; }
.crm-cartes { display: flex; flex-direction: column; gap: 8px; }
.crm-vide { border: 1.5px dashed var(--ligne-forte); border-radius: 14px; padding: 16px 10px; text-align: center; font-size: 12.5px; color: var(--gris-clair); }
.opp-carte { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; padding: 12px 12px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; position: relative; box-shadow: 0 1px 2px rgba(56, 71, 64, .05); transition: border-color var(--transition), transform var(--transition); }
.opp-carte:hover { border-color: var(--sauge); transform: translateY(-1px); }
.opp-carte.retard { border-left: 4px solid var(--alerte); }
.opp-carte.glisse { opacity: .45; }
.opp-t { font-weight: 600; font-size: 14px; line-height: 1.3; padding-right: 22px; }
.opp-s { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gris); min-width: 0; }
.opp-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--gris); }
.opp-meta b { color: var(--foret); font-size: 13.5px; }
.opp-action { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sauge-fonce); background: var(--menthe-voile); border-radius: 10px; padding: 5px 8px; min-width: 0; }
.opp-action.retard { color: var(--alerte); background: var(--alerte-pale); font-weight: 600; }
.opp-resp { position: absolute; top: 10px; right: 10px; }
.etape-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--menthe-pale); color: var(--foret); white-space: nowrap; }
.etape-pill.gagne { background: var(--foret); color: #fff; }
.etape-pill.perdu { background: var(--beige); color: var(--gris); }
.crm-tbl tr.crm-retard td:first-child { box-shadow: inset 4px 0 0 var(--alerte); }

/* Commercial : fiche opportunité */
.crm-stepper { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.crm-stepper button { flex: 1 0 auto; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 999px; height: 32px; padding: 0 12px; font-size: 12.5px; font-weight: 600; color: var(--gris); white-space: nowrap; }
.crm-stepper button:hover:not([disabled]) { border-color: var(--sauge); color: var(--foret); }
.crm-stepper button.on { background: var(--foret); border-color: var(--foret); color: #fff; }
.crm-stepper button.on.gagne { background: var(--sauge); border-color: var(--sauge); }
.crm-stepper button.on.perdu { background: var(--gris); border-color: var(--gris); }
.crm-stepper button[disabled] { cursor: default; }
.inp.retard { border-color: var(--alerte); color: var(--alerte); }
.crm-liens { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-liens .chip { height: 32px; font-size: 13px; }
.crm-histo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.crm-histo li { padding-left: 14px; position: relative; }
.crm-histo li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--sauge); }
.crm-nouveau-tiers { border: 1px dashed var(--ligne-forte); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--menthe-voile); }
.crm-nouveau-tiers[hidden], .crm-fiche [hidden], .val-fiche [hidden] { display: none; }
.crm-doublons-alerte:empty { display: none; }
.crm-act-types { flex-wrap: wrap; border-radius: 16px; }
.crm-act-types button { display: inline-flex; align-items: center; gap: 6px; }
.form-row[hidden] { display: none; }

/* Commercial : activités */
.crm-act { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 14px; }
.crm-act + .crm-act { border-top: 1px solid var(--ligne); border-radius: 0; }
.crm-act .t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-act .s { font-size: 13px; margin-top: 3px; }
.crm-act.fait { opacity: .6; }
.crm-act.due .crm-act-ic { background: var(--alerte-pale); color: var(--alerte); }
.crm-act-ic { width: 34px; height: 34px; border-radius: 12px; background: var(--menthe-pale); color: var(--foret); display: grid; place-items: center; flex: none; }
.crm-act-ic.t-rdv, .crm-act-ic.t-visite { background: #e3ebf2; color: #4c6f8a; }
.crm-act-ic.t-relance { background: var(--ambre-pale); color: var(--ambre); }

/* Commercial : contacts */
.crm-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.crm-contact { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; cursor: pointer; border: 1px solid var(--ligne); font: inherit; color: inherit; transition: border-color var(--transition); }
.crm-contact:hover { border-color: var(--sauge); }
.crm-contact .count { font-size: 12px; font-weight: 700; background: var(--menthe-pale); color: var(--foret); border-radius: 999px; padding: 2px 9px; }
.crm-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.crm-carte-contact { display: flex; align-items: center; gap: 12px; }
.crm-carte-contact b { font-size: 17px; color: var(--foret); }
.crm-joindre { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-joindre .btn { text-decoration: none; }
.crm-ct-lignes { display: flex; flex-direction: column; gap: 8px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.crm-ct-opp { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 12px; padding: 8px 12px; text-align: left; font-size: 14px; }
.crm-ct-opp:hover { border-color: var(--sauge); }
.crm-ct-opp + .crm-ct-opp { margin-top: 6px; }
.crm-dbl-groupe { border: 1px solid var(--ligne); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.crm-dbl-ligne { display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; }
.crm-dbl-ligne input { accent-color: var(--sauge); width: 17px; height: 17px; }
.crm-dbl-pied { display: flex; justify-content: flex-end; }
.crm-depot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; border: 2px dashed var(--ligne-forte); border-radius: 18px; color: var(--foret); font-weight: 600; cursor: pointer; background: var(--menthe-voile); }
.crm-depot input { display: none; }
.crm-depot svg.ic { width: 30px; height: 30px; color: var(--sauge); }
.crm-imp-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; }
.crm-imp-champs label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .1em; }
.crm-imp-champs .sel { height: 36px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.crm-imp-apercu td, .crm-imp-apercu th { font-size: 12.5px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.crm-pl { display: flex; flex-direction: column; gap: 8px; }
.crm-pl-ligne { display: flex; align-items: center; gap: 8px; }
.crm-pl-ligne .inp[data-k=nom] { flex: 1; }
.crm-pl-prob { display: inline-flex; align-items: center; gap: 4px; color: var(--gris); font-size: 13px; }
.crm-pl-prob .inp { width: 76px; }
.crm-pl-poignee { color: var(--gris-clair); display: grid; place-items: center; }

/* Commercial : tableau de bord */
.crm-barres { display: flex; flex-direction: column; gap: 10px; }
.crm-barre { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13.5px; }
.crm-barre .n { font-weight: 600; color: var(--foret); }
.crm-barre .b { height: 12px; background: var(--fond); border-radius: 999px; overflow: hidden; }
.crm-barre .b i { display: block; height: 100%; background: var(--sauge); border-radius: 999px; }
.crm-barre.gagne .b i { background: var(--foret); }
.crm-barre.perdu .b i { background: var(--gris-clair); }
.crm-barre .v { color: var(--gris); font-size: 13px; white-space: nowrap; }
.late-row .bar.ok { background: var(--sauge); }

/* Apporteurs (équipe) */
.dm-tbl tr.dm-alerte td:first-child { box-shadow: inset 4px 0 0 var(--ambre); }
.dm-statut, .ap-statut, .cm-statut, .val-etat { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--menthe-pale); color: var(--foret); }
.dm-statut.s-a_verifier, .cm-statut.s-a_valider, .ap-statut.s-invite { background: var(--ambre-pale); color: var(--ambre); }
.dm-statut.s-signee, .cm-statut.s-versee, .ap-statut.s-actif, .val-etat.e-valide, .val-etat.e-signe { background: var(--foret); color: #fff; }
.dm-statut.s-perdue, .dm-statut.s-non_retenue, .ap-statut.s-suspendu, .val-etat.e-annule { background: var(--beige); color: var(--gris); }
.dm-statut.s-brouillon { background: var(--fond); color: var(--gris); }
.dm-statut.s-offre, .cm-statut.s-facture_recue { background: #e3ebf2; color: #4c6f8a; }
.val-etat.e-refuse { background: var(--alerte-pale); color: var(--alerte); }
.dm-entete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dm-verif { display: flex; flex-direction: column; gap: 10px; }
.dm-choix { display: flex; flex-direction: column; gap: 4px; }
.dm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dm-grille section { border: 1px solid var(--ligne); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.dm-grille h4 { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--foret); }
.dm-grille .kv { font-size: 13.5px; width: 100%; }
.dm-remarques { margin: 0; padding: 10px 14px; border-left: 3px solid var(--menthe); background: var(--menthe-voile); border-radius: 0 12px 12px 0; font-size: 14px; white-space: pre-wrap; }
.dm-pieces { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-piece { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--ligne); border-radius: 999px; background: var(--blanc); font-size: 13px; color: var(--foret); text-decoration: none; }
a.dm-piece:hover { border-color: var(--sauge); }
.dm-fil { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.dm-msg { align-self: flex-start; max-width: 82%; background: var(--fond); border-radius: 16px 16px 16px 4px; padding: 9px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; white-space: pre-wrap; }
.dm-msg.moi { align-self: flex-end; background: var(--menthe-pale); border-radius: 16px 16px 4px 16px; }
.dm-msg-t { font-size: 12.5px; }
.dm-ecrire { display: flex; flex-direction: column; gap: 8px; }
.dm-ecrire-pied { display: flex; align-items: center; gap: 8px; }
.dm-joindre { cursor: pointer; }
.val-fiche .dm-ecrire { flex-direction: row; align-items: center; }
.val-fiche .dm-ecrire .inp { flex: 1; }
.app-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.app-carte { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.app-carte-t { display: flex; align-items: center; gap: 12px; }
.app-carte-t b { color: var(--foret); font-size: 15.5px; }
.app-carte .kv { font-size: 13.5px; }
.app-carte-pied { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--ligne); }
.app-lien { display: flex; gap: 8px; align-items: center; }
.app-lien .inp { flex: 1; font-size: 13px; }

/* Validations */
.val-ligne { display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; }
.val-ligne:hover { background: var(--menthe-voile); border-color: var(--ligne); }
.val-ligne + .val-ligne { margin-top: 4px; }
.val-ligne.moi { box-shadow: inset 4px 0 0 var(--ambre); }
.val-ligne.retard .val-ic { background: var(--alerte-pale); color: var(--alerte); }
.val-ligne .t { font-weight: 600; font-size: 14.5px; }
.val-ligne .s { font-size: 12.5px; margin-top: 3px; }
.val-ic { width: 36px; height: 36px; border-radius: 12px; background: var(--menthe-pale); color: var(--foret); display: grid; place-items: center; flex: none; }
.val-ic.sig { background: #e3ebf2; color: #4c6f8a; }
.val-chaine { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.val-chaine .muted { margin-left: 6px; }
.val-v { border-radius: 50%; padding: 2px; box-shadow: 0 0 0 2px var(--ligne); display: inline-flex; }
.val-v.v-valide { box-shadow: 0 0 0 2px var(--sauge); }
.val-v.v-a_traiter { box-shadow: 0 0 0 2px var(--ambre); }
.val-v.v-refuse { box-shadow: 0 0 0 2px var(--alerte); }
.val-v.v-en_attente, .val-v.v-sans_objet, .val-v.v-annule { opacity: .5; }
.val-fleche { font-style: normal; color: var(--gris-clair); }
.val-sg { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--fond); color: var(--gris); }
.val-sg.g-signe { background: var(--menthe-pale); color: var(--foret); }
.val-sg.g-ouvert { background: #e3ebf2; color: #4c6f8a; }
.val-sg.g-refuse { background: var(--alerte-pale); color: var(--alerte); }
.val-cible { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 16px; background: var(--menthe-voile); }
.val-cible code { font-size: 12px; }
.val-valideurs, .val-signataires { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.val-valideurs li, .val-signataires li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 14px; }
.val-valideurs li.v-a_traiter, .val-signataires li.g-ouvert, .val-signataires li.g-envoye { border-color: var(--ambre); background: var(--ambre-pale); }
.val-valideurs li.v-valide, .val-signataires li.g-signe { border-color: var(--menthe); }
.val-valideurs li.v-refuse, .val-signataires li.g-refuse { border-color: var(--alerte); background: var(--alerte-pale); }
.val-valideurs li.v-en_attente, .val-valideurs li.v-sans_objet, .val-valideurs li.v-annule { opacity: .65; }
.val-com { margin-top: 4px; font-size: 13.5px; font-style: italic; color: var(--foret); }
.val-decision { border: 1px solid var(--sauge); border-radius: 16px; padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.val-decision .section-label { margin: 12px 0 0; }
.val-decision-b { display: flex; gap: 8px; }
.val-histo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.val-histo li { padding-left: 14px; position: relative; }
.val-histo li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--sauge); }
.val-histo li.com::before { background: #5f86a3; }
.val-histo li div { color: var(--gris); margin-top: 2px; }
.val-ajout { display: flex; gap: 8px; }
.val-ajout .sel { flex: 1; }
.val-choix { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: v; }
.val-choix li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--ligne); border-radius: 12px; font-size: 14px; counter-increment: v; }
.val-choix li::before { content: counter(v); font-size: 12px; font-weight: 700; color: var(--sauge-fonce); width: 14px; }
.val-sig-ligne { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.val-sig-ligne .sel[data-k=uid] { grid-column: 2 / 4; }
.val-sig-ligne [hidden] { display: none; }
.val-courrier { border-bottom: 1px solid var(--ligne); padding: 10px 4px; }
.val-courrier summary { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; list-style: none; }
.val-courrier summary::-webkit-details-marker { display: none; }
.val-courrier b { flex: 1; min-width: 200px; }
.val-courrier pre { white-space: pre-wrap; font-family: var(--police-2); font-size: 13px; background: var(--fond); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.val-courrier-st { font-size: 11.5px; font-weight: 600; color: var(--ambre); text-transform: uppercase; letter-spacing: .1em; }

/* Double authentification */
.da-etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.da-qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.da-qr-img { width: 176px; height: 176px; flex: none; border: 1px solid var(--ligne); border-radius: 16px; background: #fff; padding: 8px; display: grid; place-items: center; }
.da-qr-img svg { width: 100%; height: 100%; display: block; }
.da-qr-vide { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12.5px; color: var(--gris); padding: 10px; }
.da-qr-vide svg.ic { width: 30px; height: 30px; color: var(--sauge); }
.da-qr-cle { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 180px; }
.da-secret { font-size: 14px; letter-spacing: .08em; word-break: break-all; background: var(--fond); border-radius: 10px; padding: 8px 10px; color: var(--foret); font-weight: 600; }
.da-code { font-size: 20px; letter-spacing: .3em; text-align: center; max-width: 220px; }
.da-secours { display: flex; flex-direction: column; gap: 12px; }
.da-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.da-codes code { display: block; font-size: 15px; letter-spacing: .08em; background: var(--fond); border-radius: 10px; padding: 7px 10px; text-align: center; color: var(--foret); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--sauge); flex: none; }
.login-card.etape { width: min(480px, 100%); }
.da-compte { display: flex; flex-direction: column; gap: 12px; }
.da-etat { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.da-etat .pill-mini { height: 26px; font-size: 12.5px; }
.da-bandeau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }

@media (max-width: 900px) {
  .dm-grille { grid-template-columns: minmax(0, 1fr); }
  .crm-barre { grid-template-columns: 110px minmax(0, 1fr); }
  .crm-barre .v { grid-column: 2; }
}
@media (max-width: 720px) {
  .crm-toolbar { gap: 8px; }
  .crm-vues, .val-vues, .app-vues { max-width: 100%; overflow-x: auto; }
  .crm-vues button span, .val-vues button span:not(.count), .app-vues button span:not(.count) { display: none; }
  .crm-vues button.on span, .val-vues button.on span, .app-vues button.on span { display: inline; }
  .crm-toolbar .search, .search.crm-q { min-width: 0; flex: 1 1 160px; width: auto; padding: 0 14px; justify-content: flex-start; border-radius: 999px; }
  .search.crm-q input { display: block; }
  .top-title h1.long { font-size: 13.5px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; }
  .dm-tbl th:nth-child(3), .dm-tbl td:nth-child(3), .dm-tbl th:nth-child(5), .dm-tbl td:nth-child(5) { display: none; }
  .crm-kanban { grid-auto-columns: 82%; }
  .crm-contacts, .app-cartes { grid-template-columns: minmax(0, 1fr); }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .val-sig-ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .val-sig-ligne .sel[data-k=type] { grid-column: 1; }
  .val-sig-ligne .inp, .val-sig-ligne .sel[data-k=uid] { grid-column: 1 / -1; }
  .da-codes { grid-template-columns: minmax(0, 1fr); }
  .da-qr { justify-content: center; }
  .val-decision-b .btn { flex: 1; }
  .dm-msg { max-width: 92%; }
}

/* Portail des apporteurs d'affaires (page séparée, téléphone d'abord) */
body.portail { background: var(--fond); }
.portail-app { min-height: 100vh; display: flex; flex-direction: column; }
.portail-charge { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--gris); padding: 24px; text-align: center; }
.portail-tete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--foret); color: #fff; }
.portail-marque { display: flex; align-items: center; gap: 12px; min-width: 0; }
.portail-marque b { display: block; font-size: 16px; letter-spacing: .02em; }
.portail-marque span:not(.portail-pastille) { display: block; font-size: 12.5px; color: var(--menthe); }
.portail-pastille { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); }
.portail-onglets { display: flex; gap: 4px; margin-left: auto; }
.portail-onglets button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #dbe9e1; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.portail-onglets button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.portail-onglets button.on { background: var(--menthe); color: var(--foret); font-weight: 600; }
.portail-sortie { color: #dbe9e1; }
.portail-sortie:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.portail-demo { background: var(--ambre-pale); color: #6d4c17; font-size: 13px; padding: 8px 24px; display: flex; align-items: center; gap: 8px; }
.portail-corps { width: min(860px, 100%); margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.portail-bas { display: none; }
.portail-accueil { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--ombre); }
.portail-accueil h1, .portail-titre, .portail-fiche h1 { margin: 0; font-size: 22px; color: var(--foret); letter-spacing: .01em; }
.portail-accueil p { margin: 0; }
.portail-gros { height: 50px; font-size: 15.5px; justify-content: center; }
.portail-h2 { margin: 10px 0 4px; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--foret); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.portail-liste { display: flex; flex-direction: column; gap: 8px; }
.portail-carte { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; padding: 14px 16px; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--transition); }
.portail-carte:hover { border-color: var(--sauge); }
.portail-carte.statique { cursor: default; }
.portail-carte b { display: block; font-size: 15px; }
.portail-carte .muted { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.portail-retour { align-self: flex-start; font-size: 14px; }
.portail-fiche { display: flex; flex-direction: column; gap: 14px; }
.portail-fiche-t { display: flex; align-items: flex-start; gap: 12px; }
.portail-suivi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.portail-suivi li { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--gris-clair); font-weight: 600; }
.portail-suivi li span { height: 6px; border-radius: 999px; background: var(--ligne); }
.portail-suivi li.fait { color: var(--foret); }
.portail-suivi li.fait span { background: var(--sauge); }
.portail-suivi li.courant span { background: var(--foret); }
.portail-suivi.fin li.courant span { background: var(--gris-clair); }
.portail-echanges { display: flex; flex-direction: column; gap: 12px; }
.portail-form { display: flex; flex-direction: column; gap: 14px; }
.portail-form .card { display: flex; flex-direction: column; gap: 12px; }
.portail-form .portail-h2 { margin: 0; }
.portail-seg { align-self: flex-start; flex-wrap: wrap; }
.portail-details > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--sauge-fonce); }
.portail-details[open] > summary { margin-bottom: 10px; }
.portail-details .form-row + .form-grid { margin-top: 10px; }
.portail-recherche { display: flex; gap: 8px; }
.portail-recherche .inp { flex: 1; }
.portail-resultats { display: flex; flex-direction: column; gap: 4px; }
.portail-resultats:empty { display: none; }
.portail-resultats button { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--ligne); background: var(--blanc); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.portail-resultats button:hover { border-color: var(--sauge); background: var(--menthe-voile); }
.carte.portail-plan { height: 260px; border-radius: 16px; }
.portail-point { margin: -4px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.portail-joindre { align-self: flex-start; cursor: pointer; }
.portail-accord { border-color: var(--sauge); background: var(--menthe-voile); }
.portail-accord .check-row { font-weight: 600; color: var(--foret); align-items: flex-start; }
.portail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.portail-actions .portail-gros { flex: 1 1 240px; max-width: 360px; }
.portail-regle { display: flex; align-items: center; gap: 14px; }
.portail-regle > svg.ic { width: 28px; height: 28px; color: var(--sauge); }
.portail-regle b { display: block; color: var(--foret); }
.portail-totaux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portail-totaux .card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.portail-totaux b { font-size: 22px; color: var(--foret); }
.portail-montant { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 720px) {
  .portail-tete { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .portail-onglets { display: none; }
  .portail-sortie { margin-left: auto; }
  .portail-demo { padding: 8px 14px; }
  .portail-corps { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); gap: 12px; }
  .portail-bas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--blanc); border-top: 1px solid var(--ligne); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -12px rgba(29, 29, 27, .25); }
  .portail-bas button { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; padding: 6px 2px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--gris); }
  .portail-bas button.on { color: var(--foret); background: var(--menthe-pale); }
  .portail-accueil { padding: 18px; }
  .portail-form .form-grid, .portail-form .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .portail-actions { flex-direction: column-reverse; align-items: stretch; }
  .portail-actions .portail-gros { max-width: none; flex: none; }
  .portail-suivi li { font-size: 10.5px; }
  .portail-toasts, body.portail .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* Page publique de signature (sans compte) */
body.signer { background: var(--fond); }
.signer-app { min-height: 100vh; display: flex; flex-direction: column; }
.signer-corps { width: min(820px, 100%); }
.signer-doc, .signer-panneau { display: flex; flex-direction: column; gap: 12px; }
.signer-doc h1 { margin: 0 0 2px; font-size: 21px; color: var(--foret); }
.signer-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--gris); }
.signer-meta span { display: inline-flex; align-items: center; gap: 6px; }
.signer-pdf { width: 100%; height: 520px; border: 1px solid var(--ligne); border-radius: 14px; background: #fff; }
.signer-pdf.signer-pdf-demo { height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--menthe-voile); color: var(--foret); }
.signer-pdf-demo > svg.ic { width: 34px; height: 34px; color: var(--sauge); }
.signer-doc > .link-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.signer-qui { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.signer-qui li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.signer-qui .badge { width: 30px; height: 30px; font-size: 11.5px; }
.signer-etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: etape; }
.signer-etapes > li { counter-increment: etape; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px 14px 54px; border: 1px solid var(--ligne); border-radius: 16px; background: var(--blanc); }
.signer-etapes > li::before { content: counter(etape); position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--fond); color: var(--gris); }
.signer-etapes > li.courant { border-color: var(--sauge); }
.signer-etapes > li.courant::before { background: var(--foret); color: #fff; }
.signer-etapes > li.fait::before { content: '✓'; background: var(--menthe-pale); color: var(--foret); }
.signer-etapes > li > b { color: var(--foret); font-size: 15px; }
.signer-etapes .inp { width: 100%; }
.signer-etapes .da-code { max-width: 240px; }
.signer-cadre { position: relative; width: 100%; height: 180px; border: 1.5px dashed var(--sauge); border-radius: 14px; background: #fff; touch-action: none; }
.signer-cadre canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; border-radius: 14px; }
.signer-ligne { position: absolute; left: 22px; right: 22px; bottom: 34px; border-top: 1px solid var(--ligne); padding-top: 4px; font-size: 11.5px; color: var(--gris-clair); pointer-events: none; }
.signer-effacer { position: absolute; right: 8px; top: 6px; }
.signer-apercu { width: 100%; min-height: 70px; display: flex; align-items: center; padding: 0 20px; border: 1.5px dashed var(--sauge); border-radius: 14px; background: #fff; font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive; font-size: 30px; color: var(--foret); overflow: hidden; white-space: nowrap; }
.signer-panneau textarea { width: 100%; resize: vertical; }
.signer-etat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 34px 22px; }
.signer-etat > svg.ic { width: 42px; height: 42px; color: var(--ambre); }
.signer-etat.ok > svg.ic { color: var(--sauge); }
.signer-etat h1 { margin: 0; font-size: 22px; color: var(--foret); }
.signer-etat p { margin: 0; max-width: 520px; }
@media (max-width: 720px) {
  .signer-corps { padding-bottom: 32px; }
  .signer-pdf { height: 380px; }
  .signer-pdf.signer-pdf-demo { height: 150px; }
  .signer-etapes > li { padding: 12px 12px 12px 48px; }
  .signer-etapes > li::before { left: 11px; }
  .signer-cadre { height: 160px; }
}

/* Mon compte : état de la double authentification */
span.da-etat { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--fond); color: var(--gris); font-weight: 600; font-size: 13px; flex-wrap: nowrap; }
span.da-etat.on { background: var(--menthe-pale); color: var(--foret); }

/* Page de connexion : une étape (invitation, code, activation) remplace le formulaire */
.login-card[hidden] { display: none; }
.login-card .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-card .form-grid .inp { width: 100%; min-width: 0; }