/* L'Arche Événements — event.ewabi.fr */
:root {
  --bg: #F7F8F4; --surface: #FFFFFF; --sunk: #F1F3EC; --sage: #EBF1E7; --sage-2: #DCE7D6;
  --ink: #22352F; --ink-2: #3F524C; --muted: #6E7A75; --faint: #9AA49F; --line: #E3E7E0; --line-2: #D5DBD2;
  --accent: #2F5D4B; --accent-2: #24493B; --accent-ink: #FFFFFF; --kicker: #7C8C6F;
  --amber: #A76B12; --amber-bg: #FBF2E1; --amber-line: #F0DDB6;
  --red: #B03D32; --red-bg: #FCEDEA; --red-line: #F2CFC9;
  --blue: #2F6488; --blue-bg: #E9F1F7; --blue-line: #CFE0EC;
  --green: #2E7D4F; --green-bg: #E6F4EA;
  --violet: #6A4C93; --violet-bg: #F1ECF8;
  --shadow-1: 0 1px 2px rgba(34, 53, 47, .06);
  --shadow-2: 0 1px 2px rgba(34, 53, 47, .05), 0 10px 30px rgba(34, 53, 47, .07);
  --shadow-3: 0 20px 60px rgba(20, 35, 30, .22);
  --r: 14px; --r-s: 10px; --r-xs: 7px;
  --side: 248px;
  --f-display: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
svg.i.s { width: 15px; height: 15px; vertical-align: -3px; }
.kicker { font: 600 11px/1.2 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--kicker); }

/* ── Mise en page ── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 14px; background: #F0F2EB; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.brand b { display: block; font: 700 15px/1.15 var(--f-display); }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav-sec { margin: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; text-decoration: none; position: relative; }
.nav a:hover { background: rgba(47, 93, 75, .06); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.nav a.on svg { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.nav .count.red { background: var(--red); color: #fff; }
.nav .count.amber { background: var(--amber-bg); color: var(--amber); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.box-pill { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.box-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.box-pill .dot.ok { background: #3BA36A; box-shadow: 0 0 0 3px rgba(59, 163, 106, .15); }
.box-pill .dot.ko { background: var(--red); box-shadow: 0 0 0 3px rgba(176, 61, 50, .15); }
.box-pill .t { min-width: 0; flex: 1; }
.box-pill .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-pill .t span { color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sage-2); color: var(--accent-2); display: grid; place-items: center; font: 700 13px var(--f-display); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me .t { flex: 1; min-width: 0; line-height: 1.25; }
.me .t b { display: block; font-size: 13.5px; }
.me .t span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; padding: 26px 34px 80px; }
.page { max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 860px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top .sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; text-decoration: none; }
.btn:hover { border-color: #C3CBC0; background: #FBFCF9; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .row:focus-visible, .field:focus-visible { outline: 3px solid rgba(47, 93, 75, .3); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 4px 12px rgba(47, 93, 75, .18); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.warn { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(47, 93, 75, .07); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn[disabled], .btn.busy { opacity: .55; cursor: not-allowed; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.armed { background: var(--red); border-color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(176, 61, 50, .15); } }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link:hover { text-decoration: underline; }
.link.muted { color: var(--muted); font-weight: 500; }

/* ── Cartes ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.card-b { padding: 14px 20px 18px; }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ── Pastilles ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.dark { background: var(--ink); color: #fff; }
.chip.out { background: transparent; border-color: var(--line-2); }
button.chip { cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--sunk); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; white-space: nowrap; border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.dotlabel { display: inline-flex; align-items: center; gap: 6px; }
.dotlabel::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dotlabel.ok::before { background: #3BA36A; } .dotlabel.est::before { background: #D49A2A; } .dotlabel.clar::before { background: var(--red); } .dotlabel.eq::before { background: var(--blue); }

/* ── Alertes ── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.alert svg { margin-top: 1px; }
.alert.amber { background: var(--amber-bg); border-color: var(--amber-line); color: #6B4507; }
.alert.red { background: var(--red-bg); border-color: var(--red-line); color: #7A251D; }
.alert.blue { background: var(--blue-bg); border-color: var(--blue-line); color: #1F4762; }
.alert.green { background: var(--green-bg); border-color: #C8E6D2; color: #1D5535; }
.alert b { font-weight: 700; }
.alert .grow { flex: 1; min-width: 0; }
.alert .btn { margin-left: auto; }

/* ── Lignes de dossiers ── */
.list { display: flex; flex-direction: column; }
.list.card { overflow: hidden; }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; background: var(--surface); transition: background .1s; }
.row:first-child { border-top: 0; }
.row:hover { background: #FAFBF8; text-decoration: none; }
.row .who { min-width: 0; }
.row .who b { font-weight: 650; font-size: 14.5px; }
.row .who .l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .who .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who .l2 { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who .l3 { font-size: 13px; margin-top: 3px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.row .go { display: flex; align-items: center; gap: 10px; }
.leaf { width: 52px; height: 56px; border-radius: 11px; background: var(--sunk); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; overflow: hidden; }
.leaf .m { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kicker); }
.leaf .d { font: 700 20px/1.05 var(--f-display); margin: 2px 0 1px; }
.leaf .w { font-size: 10.5px; color: var(--muted); }
.leaf.none .d { font-size: 15px; color: var(--faint); }
.leaf.hot { background: var(--red-bg); border-color: var(--red-line); }
.leaf.hot .m { color: var(--red); }
.leaf.soon { background: var(--sage); border-color: var(--sage-2); }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 2px 10px; }
.sec-title h2 { font-size: 15px; }
.sec-title .n { color: var(--muted); font-weight: 600; font-size: 13px; }
.sec-title .line { flex: 1; height: 1px; background: var(--line); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .big { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; background: var(--sage); display: grid; place-items: center; color: var(--accent); }
.empty .big svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 16px; }

/* ── Accueil ── */
.hello { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; background: linear-gradient(135deg, #EEF4EA 0%, #F7F8F4 70%); border: 1px solid var(--sage-2); margin-bottom: 8px; }
.hello .ring { width: 64px; height: 64px; flex: none; }
.hello h1 { font-size: 24px; }
.hello p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tile { padding: 15px 16px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.tile .v { font: 700 24px/1.1 var(--f-display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .h { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tile .v small { font-size: 14px; font-weight: 600; color: var(--muted); }
.tile.good { border-color: #CDE5D4; background: #F4FAF5; }
.tile.bad { border-color: var(--red-line); background: #FFF8F7; }

/* ── Dossier ── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.d-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.d-head .t { flex: 1; min-width: 260px; }
.d-head h1 { font-size: 27px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.d-head .meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: 13.5px; }
.d-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.steps { display: flex; gap: 4px; margin: 4px 0 18px; overflow-x: auto; padding-bottom: 2px; }
.steps .s { flex: 1; min-width: 92px; }
.steps .bar { height: 5px; border-radius: 3px; background: var(--line); }
.steps .s.done .bar { background: var(--accent); }
.steps .s.cur .bar { background: linear-gradient(90deg, var(--accent) 50%, var(--sage-2) 50%); }
.steps .s span { display: block; margin-top: 6px; font-size: 12px; color: var(--faint); font-weight: 600; }
.steps .s.done span, .steps .s.cur span { color: var(--ink-2); }
.steps .s.cur span { color: var(--accent); }
.next { padding: 20px 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--sage-2); box-shadow: 0 0 0 4px rgba(235, 241, 231, .7), var(--shadow-2); }
.next .lbl { font: 650 18px/1.35 var(--f-display); margin: 6px 0 14px; }
.next .acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.next .more { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 13.5px; }
.next.wait { border-color: var(--line); box-shadow: var(--shadow-1); }
.next.wait .lbl { font-size: 16px; color: var(--ink-2); }
.quote { margin: 4px 0 14px; padding: 12px 14px; border-left: 3px solid var(--sage-2); background: var(--sunk); border-radius: 0 10px 10px 0; white-space: pre-wrap; font-size: 14px; color: var(--ink-2); max-height: 180px; overflow: auto; }
.points { display: flex; flex-direction: column; gap: 8px; }
.point { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg); border: 1px solid var(--amber-line); }
.point.leve { background: var(--sunk); border-color: var(--line); }
.point.leve .pt { color: var(--muted); }
.point.info { background: var(--blue-bg); border-color: var(--blue-line); }
.point .pt { flex: 1; min-width: 0; font-size: 14px; }
.point .pt .by { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.point .pa { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.fields > .field, .client-line > .field { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.field { background: var(--surface); padding: 11px 13px; cursor: pointer; text-align: left; border: 0; min-height: 64px; display: flex; flex-direction: column; gap: 3px; }
.field:hover { background: #FAFBF7; }
.field .k { font-size: 11.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field .val { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.field .val.missing { color: var(--amber); font-weight: 600; }
.field .val.none { color: var(--faint); font-weight: 500; }
.field .val.prop { color: var(--muted); font-weight: 500; font-style: italic; }
.field .cit { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.prov.formulaire, .prov.confirme { background: #3BA36A; }
.prov.estime { background: #D49A2A; }
.prov.a_clarifier { background: var(--red); }
.prov.equipe { background: var(--blue); }
.prov.manquant { background: var(--line-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.client-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; }

.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lines td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.lines tr:first-child td { border-top: 0; }
.lines td.r { text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
.lines .lab { font-weight: 600; }
.lines .det { color: var(--muted); font-size: 12.5px; }
.total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; padding-top: 12px; border-top: 2px solid var(--ink); }
.total b { font: 700 24px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.subtot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.hyp { margin: 12px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.hyp li { padding: 3px 0 3px 18px; position: relative; }
.hyp li::before { content: '≈'; position: absolute; left: 2px; color: var(--amber); font-weight: 700; }
.qs { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.qs li { margin: 4px 0; }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 12px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.msg.out { align-self: flex-end; background: var(--sage); border-color: var(--sage-2); }
.msg .mh { display: flex; gap: 10px; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.msg .mh b { color: var(--ink-2); font-weight: 650; }
.msg .mb { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.msg .mb.clamp { max-height: 210px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 20px; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.journal li:first-child { border-top: 0; }
.journal .w { color: var(--faint); font-size: 12px; }
.journal .by { color: var(--muted); }

/* ── Tiroir (mail) et fenêtres ── */
.scrim { position: fixed; inset: 0; background: rgba(22, 32, 28, .32); backdrop-filter: blur(2px); z-index: 40; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 41; box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-h .t { flex: 1; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.drawer-f { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #FBFCFA; }
.drawer-f .grow { flex: 1; font-size: 12.5px; color: var(--muted); }
.modal { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3); animation: pop .16s ease-out; }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }
.modal-h { padding: 20px 22px 6px; }
.modal-b { padding: 10px 22px 6px; display: flex; flex-direction: column; gap: 12px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.f .hint { font-weight: 500; color: var(--muted); }
.in, select.in, textarea.in { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 14.5px; font-weight: 400; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.in:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 93, 75, .14); }
textarea.in { resize: vertical; line-height: 1.55; }
textarea.mail { min-height: 320px; font-size: 14.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mail-from { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.checks { border-radius: 12px; padding: 11px 13px; font-size: 13.5px; }
.checks.ok { background: var(--green-bg); color: #1D5535; }
.checks.ko { background: var(--red-bg); color: #7A251D; }
.checks ul { margin: 4px 0 0; padding-left: 18px; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; }
.toggle .sw { width: 40px; height: 23px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { left: 20px; }
.toggle input:focus-visible + .sw { outline: 3px solid rgba(47, 93, 75, .3); outline-offset: 2px; }

/* ── Toast ── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: #1E2B27; color: #fff; box-shadow: var(--shadow-3); font-size: 14px; max-width: min(560px, calc(100vw - 32px)); animation: up .2s ease-out; }
.toast.err { background: #7A251D; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ── Calendrier ── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.cal .dh { background: var(--sunk); padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.cal .day { background: var(--surface); min-height: 112px; padding: 7px 7px 9px; display: flex; flex-direction: column; gap: 4px; }
.cal .day.other { background: #FAFBF8; }
.cal .day.other .n { color: var(--faint); }
.cal .day .n { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 1px 4px; align-self: flex-start; border-radius: 6px; }
.cal .day.today .n { background: var(--accent); color: #fff; }
.ev { display: block; padding: 4px 7px; border-radius: 7px; font-size: 12px; line-height: 1.3; border: 1px solid var(--line); background: var(--sunk); color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:hover { text-decoration: none; filter: brightness(.97); }
.ev.confirme { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev.accepte { background: var(--green-bg); border-color: #BFE0C9; color: var(--green); }
.ev.devis { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue); }
.ev.encours { background: #fff; border-style: dashed; }
.ev b { font-weight: 700; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend .ev { display: inline-block; width: 26px; height: 12px; padding: 0; vertical-align: -2px; margin-right: 6px; }

/* ── Tarifs ── */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--sunk); border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t .lab { font-weight: 600; }
table.t .det { color: var(--muted); font-size: 12.5px; }
table.t input.in { min-height: 32px; padding: 4px 8px; width: 96px; text-align: right; }
table.t select.in { min-height: 32px; padding: 4px 8px; width: auto; }
.scroll-x { overflow-x: auto; }

/* ── Pilotage ── */
.status-hero { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); flex-wrap: wrap; }
.status-hero .badge { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; flex: none; }
.status-hero .badge svg { width: 30px; height: 30px; stroke-width: 2.2; }
.status-hero.a_jour { background: linear-gradient(135deg, #EAF6EE, #fff 65%); border-color: #CDE5D4; }
.status-hero.a_jour .badge { background: #3BA36A; color: #fff; }
.status-hero.presque { background: linear-gradient(135deg, #FDF3E2, #fff 65%); border-color: var(--amber-line); }
.status-hero.presque .badge { background: #D49A2A; color: #fff; }
.status-hero.en_retard { background: linear-gradient(135deg, #FCEAE7, #fff 65%); border-color: var(--red-line); }
.status-hero.en_retard .badge { background: var(--red); color: #fff; }
.status-hero h2 { font-size: 21px; }
.status-hero .grow { flex: 1; min-width: 240px; }
.status-hero .who { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.status-hero .who span { display: inline-flex; align-items: center; gap: 6px; }
.online { width: 8px; height: 8px; border-radius: 50%; background: #3BA36A; display: inline-block; box-shadow: 0 0 0 3px rgba(59, 163, 106, .18); }
.offline { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; padding-top: 10px; }
.bars .b { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; position: relative; }
.bars .b .col { border-radius: 6px 6px 3px 3px; background: var(--sage-2); min-height: 3px; position: relative; }
.bars .b .col .m { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 0 0 3px 3px; }
.bars .b .lb { font-size: 10.5px; text-align: center; color: var(--faint); margin-top: 6px; }
.bars .b .vv { font-size: 10.5px; text-align: center; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.bars .b.we .lb { color: var(--kicker); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--sunk); display: grid; place-items: center; color: var(--ink-2); }
.feed .ic.mail { background: var(--blue-bg); color: var(--blue); }
.feed .ic.devis { background: var(--violet-bg); color: var(--violet); }
.feed .ic.ok { background: var(--green-bg); color: var(--green); }
.feed .ic.warn { background: var(--amber-bg); color: var(--amber); }
.feed .tx { font-size: 13.5px; min-width: 0; }
.feed .tx .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.feed .wh { font-size: 12px; color: var(--faint); white-space: nowrap; }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pipe .p { padding: 12px 14px; border-radius: 12px; background: var(--sunk); }
.pipe .p b { display: block; font: 700 20px var(--f-display); }
.pipe .p span { font-size: 12.5px; color: var(--muted); }

/* ── Connexion ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, #E3EEDD 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #E9EFE4 0%, transparent 55%), var(--bg); }
.login .box { width: min(440px, 100%); padding: 34px 32px 28px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--line); text-align: center; }
.login .brand-mark { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 18px; }
.login .brand-mark svg { width: 30px; height: 30px; }
.login h1 { font-size: 25px; }
.login p { color: var(--muted); margin: 8px 0 24px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; text-decoration: none; }
.gbtn:hover { background: #FAFBF8; text-decoration: none; }
.gbtn svg { width: 20px; height: 20px; }
.login .foot { margin-top: 22px; font-size: 12.5px; color: var(--faint); }

/* ── Mobile ── */
.mtop, .mtabs { display: none; }
@media (max-width: 1180px) { .grid2 { grid-template-columns: minmax(0, 1fr) 340px; } .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1020px) {
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: rgba(247, 248, 244, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mtop .brand { padding: 0; flex: 1; }
  .mtop .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .mtabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtabs a, .mtabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; background: none; border: 0; position: relative; cursor: pointer; }
  .mtabs .on { color: var(--accent); }
  .mtabs svg.i { width: 22px; height: 22px; }
  .mtabs .bub { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }
  .main { padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
  .d-head h1 { font-size: 22px; }
  .top { margin-bottom: 16px; }
  .row { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .row .go { grid-column: 2; justify-content: flex-start; }
  .row .go .hide-m { display: none; }
  .leaf { width: 46px; height: 50px; }
  .leaf .d { font-size: 18px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .v { font-size: 20px; }
  .hello { padding: 16px 18px; gap: 14px; }
  .hello .ring { width: 52px; height: 52px; }
  .hello h1 { font-size: 20px; }
  .drawer { width: 100vw; }
  .drawer-h, .drawer-b, .drawer-f { padding-left: 16px; padding-right: 16px; }
  .next { padding: 16px 16px; }
  .next .acts .btn { flex: 1 1 auto; }
  .cal { display: none; }
  .cal-list { display: block !important; }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .bars { gap: 3px; }
  .bars .b .vv { display: none; }
  .status-hero { padding: 18px; align-items: flex-start; }
  .status-hero .badge { width: 46px; height: 46px; border-radius: 14px; }
  .status-hero .who { flex-direction: column; gap: 6px; }
  .toasts { bottom: 86px; }
  .hide-m { display: none !important; }
  .row2 { grid-template-columns: 1fr; }
  .client-line { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .fields { grid-template-columns: 1fr 1fr; } .field { padding: 10px 11px; } }
.cal-list { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); animation: up .18s ease-out; }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 10px; }
.sheet a, .sheet button.it { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; font-weight: 600; color: var(--ink); text-decoration: none; width: 100%; background: none; border: 0; font-size: 15px; cursor: pointer; }
.sheet a:hover, .sheet button.it:hover { background: var(--sunk); }
.sheet .count { margin-left: auto; }
@media (min-width: 861px) { .hide-d { display: none !important; } }
@media print { .side, .mtop, .mtabs { display: none; } .shell { display: block; } }
