/* =========================================================
   SIG de traçabilité — styles propres au tableau de bord
   S'appuie sur les jetons de style.css (couleurs, polices, rayons).
   ========================================================= */
:root { --sheet-w: 400px; --filters-w: 268px; --map-h: clamp(460px, 72vh, 760px); }

.sig-hero { background: var(--forest); color: var(--white); position: relative; overflow: hidden; }
.sig-hero::after { content: ""; position: absolute; inset: 0; background: url("../img/fond-accueil-640.webp") center/cover; opacity: .18; mix-blend-mode: luminosity; }
.sig-hero__inner { position: relative; z-index: 1; padding-block: clamp(36px, 5vw, 64px); display: grid; gap: 12px; }
.sig-hero h1 { color: var(--white); font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.sig-hero p { color: rgba(255,255,255,.86); max-width: 70ch; }
.sig-hero .eyebrow { color: var(--sand); }

.sig-dash { padding-block: 22px 70px; }
.sig-wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sig-wrap > *, .sig-main > *, .sig-charts > * { min-width: 0; }

.sig-demo { display: flex; gap: 10px; align-items: flex-start; background: var(--sand-2); border: 1px solid var(--sand); color: var(--cocoa); border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin: 0; }
.sig-demo svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--gold); }

/* ---------- Barre d'outils ---------- */
.sig-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 40; box-shadow: 0 8px 20px -18px rgba(0,0,0,.4); transition: top .45s var(--ease); }
.header.is-hidden ~ main .sig-toolbar { top: env(safe-area-inset-top, 0px); }
.tb-field { display: grid; gap: 3px; font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tb-field select, .ff select { font: inherit; font-size: .9rem; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); padding: 8px 32px 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23213f23' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; min-width: 0; }
.tb-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 0 12px; min-width: 0; }
.tb-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.tb-search input { border: 0; background: transparent; font: inherit; font-size: .92rem; padding: 9px 0; width: 100%; min-width: 0; color: var(--ink); }
.tb-search:focus-within { border-color: var(--forest-3); box-shadow: 0 0 0 4px rgba(63,115,57,.15); }
.tb-search input:focus { outline: none; }
.tb-reset { background: none; border: 0; color: var(--forest); font-weight: 700; font-size: .86rem; text-decoration: underline; padding: 8px 4px; }
.tb-reset:disabled { color: var(--line); text-decoration: none; cursor: default; }
.tb-spacer { flex: 1 0 0; }
.tb-filters { display: none; }
.badge { min-width: 20px; height: 20px; border-radius: 999px; background: var(--gold); color: var(--white); font-size: .72rem; display: inline-grid; place-items: center; padding: 0 6px; }
.userchip { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; color: var(--forest); }
.btn--danger { --bg: #9b2c23; --fg: #fff; --bd: #9b2c23; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; display: grid; gap: 4px; align-content: start; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi__ic { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--cream); color: var(--forest); }
.kpi__ic svg { width: 17px; height: 17px; }
.kpi__val { padding-right: 34px; }
.kpi__val { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.25rem, 1.8vw, 1.6rem); color: var(--forest); line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__unit { font-size: .62em; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi__label { font-size: .8rem; font-weight: 700; margin-top: 4px; line-height: 1.25; }
.kpi__note { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.kpi--accent { background: var(--forest); border-color: var(--forest); }
.kpi--accent .kpi__ic { background: rgba(255,255,255,.12); color: var(--sand); }
.kpi--accent .kpi__val, .kpi--accent .kpi__label { color: var(--white); }
.kpi--accent .kpi__unit, .kpi--accent .kpi__note { color: rgba(255,255,255,.75); }
.kpi.pulse .kpi__val { animation: kpiPulse .6s var(--ease); }
@keyframes kpiPulse { 40% { transform: scale(1.06); } }
.kpis__note { font-size: .78rem; color: var(--muted); margin: -8px 0 0; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi { padding: 12px; } .kpi__ic { display: none; } .kpi__val { padding-right: 0; } }

/* ---------- Corps : filtres + carte + fiche ---------- */
.sig-main { display: grid; grid-template-columns: var(--filters-w) minmax(0, 1fr); gap: 14px; align-items: start; }
.sig-filters { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 16px; max-height: var(--map-h); overflow: auto; }
.sig-filters h3, .ff label { font-family: var(--f-body); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; display: block; }
.ff select { width: 100%; }
.ff input[type=range] { width: 100%; accent-color: var(--forest-3); }
.ff label b { color: var(--forest); text-transform: none; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip--sm { padding: 5px 10px; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; vertical-align: middle; margin-right: 4px; }
.sw--dash { background-image: repeating-linear-gradient(45deg, transparent 0 2px, rgba(0,0,0,.25) 2px 3px) !important; outline: 1px dashed rgba(0,0,0,.35); }
.cat-list, .legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cat-toggle { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .86rem; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.cat-toggle:hover { background: var(--cream); }
.cat-toggle input { accent-color: var(--forest); }
.cat-toggle b { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.legend .sw { width: 16px; height: 12px; }

.sig-map-wrap { position: relative; isolation: isolate; z-index: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #dfe6d6; box-shadow: var(--shadow); }
.sig-map { height: var(--map-h); width: 100%; background: #e6ead9; font-family: var(--f-body); }
.sig-map.is-offline { background-color: #eef0e4; background-image: linear-gradient(rgba(33,63,35,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(33,63,35,.07) 1px, transparent 1px); background-size: 48px 48px; }
.map-offline { display: none; position: absolute; left: 12px; top: 58px; z-index: 500; background: rgba(251,248,241,.95); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-size: .78rem; color: var(--muted); max-width: min(380px, calc(100% - 80px)); pointer-events: none; }
.sig-map.is-offline ~ .map-offline { display: block; }
.sig-map.is-editing { cursor: crosshair; }
.sig-map.is-editing .leaflet-interactive { cursor: crosshair; }

.map-ui { position: absolute; top: 12px; left: 12px; z-index: 1000; display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(251,248,241,.96); border-radius: 10px; padding: 3px; box-shadow: 0 4px 14px -6px rgba(0,0,0,.35); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .82rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--forest); color: var(--white); }
.map-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: rgba(251,248,241,.96); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: .82rem; color: var(--forest); box-shadow: 0 4px 14px -6px rgba(0,0,0,.35); }
.map-btn svg { width: 16px; height: 16px; }
.map-tools { position: absolute; left: 12px; bottom: 34px; z-index: 1000; display: flex; gap: 8px; flex-wrap: wrap; }
.map-tools .btn { box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); }
.sig-member .map-tools:not([hidden]) { animation: rise .5s var(--ease); }

.editbar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 1200; width: min(620px, calc(100% - 24px)); background: var(--forest); color: var(--white); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.editbar p { margin: 0; font-size: .86rem; grid-column: 1 / -1; color: rgba(255,255,255,.9); }
.editbar__live { font-family: var(--f-display); color: var(--sand); font-size: 1.05rem; }
.editbar__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.editbar .btn--ghost { --fg: var(--white); --bd: rgba(255,255,255,.5); }
.editbar .btn:not(.btn--ghost) { --bg: var(--sand); --fg: var(--forest); --bd: var(--sand); }

/* Leaflet : réglages visuels */
.leaflet-container { font: inherit; }
.leaflet-control-zoom a { color: var(--forest) !important; }
.leaflet-bar { border: 0 !important; box-shadow: 0 4px 14px -6px rgba(0,0,0,.35) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-attribution { font-size: 10px; }
.sig-tip { background: var(--forest); color: var(--white); border: 0; border-radius: 8px; box-shadow: var(--shadow); font-size: .8rem; padding: 6px 10px; }
.sig-tip::before { display: none; }
.pin-wrap { background: none; border: 0; }
.pin { --c: var(--forest); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; border: 2.5px solid #fff; box-shadow: 0 4px 10px -2px rgba(0,0,0,.45); transition: transform .25s var(--ease), opacity .25s; }
.pin svg { width: 17px; height: 17px; }
.pin:hover { transform: scale(1.15); }
.pin.is-sel { transform: scale(1.25); box-shadow: 0 0 0 4px #f2c14e, 0 6px 14px -2px rgba(0,0,0,.5); }
.pin.is-dim { opacity: .35; }
.pin.is-building { border-style: dashed; }
.pin--mini { width: 22px; height: 22px; border-width: 1.5px; box-shadow: none; display: inline-grid; vertical-align: middle; }
.pin--mini svg { width: 12px; height: 12px; }
.vx-wrap { background: none; border: 0; }
.vx { display: block; width: 16px; height: 16px; margin: 1px; border-radius: 50%; background: #fff; border: 3px solid #f2c14e; box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: grab; }
.vx--first { background: #f2c14e; border-color: #fff; cursor: pointer; animation: vxPulse 1.4s ease-in-out infinite; }
.vx--mid { width: 10px; height: 10px; margin: 4px; border-width: 2px; opacity: .85; }
@keyframes vxPulse { 50% { box-shadow: 0 0 0 7px rgba(242,193,78,.35); } }

/* ---------- Fiche latérale ---------- */
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--sheet-w), 100%); z-index: 1100; background: var(--paper); border-left: 1px solid var(--line); box-shadow: -18px 0 40px -24px rgba(0,0,0,.45); transform: translateX(104%); transition: transform .45s var(--ease); display: flex; flex-direction: column; }
.sheet.is-open { transform: none; }
.sheet__close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(251,248,241,.94); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--forest); }
.sheet__close svg { width: 18px; height: 18px; }
.sheet__body { overflow: auto; flex: 1; padding-bottom: 24px; overscroll-behavior: contain; }
.sheet__body > * { margin-inline: 18px; }
.sheet__body > .sh-photo { margin-inline: 0; }
.sh-photo { position: relative; aspect-ratio: 16/10; background: var(--cream); overflow: hidden; }
.sh-photo > img { width: 100%; height: 100%; object-fit: cover; animation: shZoom 1s var(--ease); }
@keyframes shZoom { from { transform: scale(1.06); opacity: .4; } }
.sh-photo--empty { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: .84rem; aspect-ratio: 16/6; }
.sh-photo--empty svg { width: 30px; height: 30px; }
.sh-thumbs { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.sh-thumbs button { width: 44px; height: 34px; border-radius: 6px; overflow: hidden; border: 2px solid #fff; padding: 0; background: none; }
.sh-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sh-head { display: grid; gap: 6px; padding-top: 16px; }
.sh-head h3 { font-size: 1.45rem; }
.sh-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.sh-kicker > svg { width: 16px; height: 16px; }
.sh-status { --c: #777; justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: var(--c); border: 1.5px solid var(--c); border-radius: 999px; padding: 3px 10px; }
.sh-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.sh-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sh-kpis div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.sh-kpis small { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; }
.sh-kpis strong { font-family: var(--f-display); color: var(--forest); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sh-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; background: #fbe9e6; border: 1px solid #e9b3aa; border-radius: 10px; padding: 10px; font-size: .88rem; font-weight: 700; color: #7a2018; }
.sh-list { margin: 14px 18px 0; display: grid; gap: 0; }
.sh-row { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.sh-row dt { color: var(--muted); font-weight: 700; }
.sh-row dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sh-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: .8rem; font-weight: 600; }
.sh-link { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .86rem; font-weight: 600; color: var(--forest); margin-bottom: 6px; text-decoration: none; transition: border-color .2s, transform .25s var(--ease); }
.sh-row dd .sh-link { margin: 0 0 4px; }
.sh-link:hover { border-color: var(--forest-3); transform: translateX(3px); }
.sh-link svg { width: 16px; height: 16px; flex: none; }
.sh-sec { margin-top: 18px; }
.sh-sec h4 { font-family: var(--f-body); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.sh-sec h5 { font-size: .9rem; margin: 14px 0 6px; font-family: var(--f-body); color: var(--forest); }
.sh-sec p { font-size: .9rem; color: var(--ink); }
.sh-sec .sh-list { margin: 0; }
.sh-spark { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sh-spark > div { flex: 1; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 3px; }
.sh-spark .b { align-self: end; width: 100%; max-width: 38px; height: var(--h); min-height: 2px; background: var(--forest-3); border-radius: 4px 4px 0 0; animation: grow-y .8s var(--ease) both; transform-origin: bottom; }
.sh-spark .is-hl .b { background: var(--gold); }
.sh-spark .v { font-size: .72rem; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.sh-spark .y { font-size: .72rem; color: var(--muted); }
@keyframes grow-y { from { transform: scaleY(0); } }
.sh-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .86rem; }
.sh-table caption { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.sh-table th { text-align: left; font-weight: 600; padding: 5px 0; }
.sh-table td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.sh-table tr + tr { border-top: 1px solid var(--line); }
.sh-lots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sh-lots li { display: grid; grid-template-columns: auto auto auto 1fr; gap: 10px; align-items: center; font-size: .8rem; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-variant-numeric: tabular-nums; }
.sh-lots .ok { justify-self: end; font-size: .74rem; }
.sh-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sh-hist li { display: grid; gap: 3px; font-size: .84rem; border-left: 3px solid var(--line); padding-left: 10px; }
.sh-hist small { color: var(--muted); }
.tag-act { display: inline-block; justify-self: start; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border-radius: 4px; padding: 1px 6px; background: var(--cream); color: var(--forest); }
.tag-act--create { background: #e3efd8; color: #2e5a2d; }
.tag-act--delete { background: #f6dcd7; color: #8a2a20; }
.tag-act--update { background: var(--sand-2); color: var(--cocoa); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.ok { display: inline-flex; align-items: center; gap: 5px; color: var(--forest-3); font-weight: 700; }

/* Formulaires de la fiche */
.sh-form { display: grid; gap: 4px; padding-bottom: 80px; }
.sh-form .sh-head { margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .field label, fieldset.field legend { font-size: .8rem; font-weight: 700; color: var(--forest); }
.form-grid .field input, .form-grid .field select, .form-grid .field textarea { width: 100%; font: inherit; font-size: .9rem; padding: 9px 11px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); }
.form-grid .field input:disabled, .form-grid .field select:disabled, .form-grid .field textarea:disabled { background: var(--cream); color: var(--muted); }
.form-grid .field textarea { min-height: 70px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; background: var(--white); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 6px; cursor: pointer; }
.check input { accent-color: var(--forest); }
.check:has(input:checked) { border-color: var(--forest-3); background: #eef4e6; }
.prod-edit { overflow-x: auto; }
.prod-edit table { border-collapse: collapse; width: 100%; font-size: .84rem; }
.prod-edit th { text-align: left; padding: 4px 6px; font-size: .74rem; color: var(--muted); }
.prod-edit td { padding: 3px; }
.prod-edit input { width: 100%; min-width: 64px; font: inherit; font-size: .88rem; padding: 7px 8px; border: 1.5px solid var(--line); border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.prod-edit input:focus { outline: none; border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(63,115,57,.15); }
.ph-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ph-list figure { position: relative; width: 84px; height: 64px; margin: 0; border-radius: 8px; overflow: hidden; background: var(--cream); }
.ph-list img { width: 100%; height: 100%; object-fit: cover; }
.ph-list .doc { display: grid; place-items: center; align-content: center; gap: 2px; font-size: .64rem; padding: 4px; text-align: center; color: var(--muted); }
.ph-list .doc svg { width: 18px; height: 18px; }
.ph-list figure button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
.ph-list figure button svg { width: 12px; height: 12px; }
.file-btn { cursor: pointer; }
.sh-formbar { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 4px; margin-top: 12px; }

/* ---------- Graphiques ---------- */
.sig-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chart { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.chart--wide { grid-column: 1 / -1; }
.chart header h3 { font-size: 1.08rem; }
.chart header p { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.chart__empty { color: var(--muted); font-size: .86rem; }
.bars { display: grid; gap: 6px; }
.chart--wide .bars { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.bars__row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; background: none; border: 0; padding: 4px 6px; border-radius: 8px; font: inherit; text-align: left; color: var(--ink); width: 100%; }
button.bars__row { cursor: pointer; }
button.bars__row:hover { background: var(--cream); }
.bars__label { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__track { height: 12px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.bars__fill { display: block; height: 100%; width: 0; background: var(--forest-3); border-radius: 0 4px 4px 0; transition: width .9s var(--ease); }
.bars__fill.is-in { width: var(--w); }
.bars__row.is-hl .bars__fill { background: var(--gold); }
.bars__row.is-hl { background: var(--sand-2); }
.bars__val { font-size: .8rem; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.cols { display: flex; align-items: flex-end; gap: 14px; height: 200px; border-bottom: 1px solid var(--line); padding-top: 6px; }
.cols__item { flex: 1; height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; }
.cols__val { font-size: .8rem; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.cols__bar { align-self: end; width: 100%; max-width: 54px; height: 0; background: var(--forest-3); border-radius: 4px 4px 0 0; transition: height .9s var(--ease); }
.cols__bar.is-in { height: var(--h); }
.cols__item.is-hl .cols__bar { background: var(--gold); }
.cols__label { font-size: .78rem; color: var(--muted); padding-bottom: 4px; transform: translateY(100%); }
@media (max-width: 1100px) { .sig-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart--wide .bars { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) { .sig-charts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Listes ---------- */
.sig-lists { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 12px; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--forest); border-color: var(--forest); }
.tbl-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { position: sticky; top: 0; background: var(--white); text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr[data-row] { cursor: pointer; transition: background .2s; }
.tbl tr[data-row]:hover, .tbl tr[data-row]:focus { background: var(--cream); outline: none; }
.tbl tr.is-sel { background: var(--sand-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--forest); white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.tbl select { font: inherit; font-size: .86rem; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--line); }

/* ---------- Connexion ---------- */
.login { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(15,26,14,.6); opacity: 0; transition: opacity .3s; }
.login.is-open { opacity: 1; }
.login__card { position: relative; background: var(--paper); border-radius: 20px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; display: grid; gap: 12px; transform: translateY(20px); transition: transform .4s var(--ease); }
.login.is-open .login__card { transform: none; }
.accts { display: grid; gap: 10px; }
.acct { display: grid; gap: 3px; text-align: left; background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; font: inherit; color: var(--ink); transition: border-color .2s, transform .3s var(--ease), box-shadow .3s; }
.acct:hover { border-color: var(--forest-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.acct strong { font-size: 1rem; }
.acct small { color: var(--muted); }
.acct__role { justify-self: start; display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 2px 7px; background: var(--cream); color: var(--forest); }
.acct__role--admin { background: var(--forest); color: var(--white); }
.acct__role--member { background: var(--sand); color: var(--cocoa); }

/* ---------- Adaptation aux écrans ---------- */
@media (max-width: 1100px) {
  .sig-main { grid-template-columns: minmax(0, 1fr); }
  .tb-filters { display: inline-flex; }
  .sig-filters { display: none; max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sig-filters.is-open { display: grid; animation: rise .35s var(--ease); }
  .sig-filters > section:has(.cat-list), .sig-filters > section:has(.chips) { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  :root { --map-h: 68vh; }
  .sig-toolbar { position: static; }
  .tb-field { flex: 1 1 140px; }
  .tb-field select { width: 100%; }
  .sig-filters { grid-template-columns: minmax(0, 1fr); }
  .sheet { top: auto; left: 0; width: 100%; height: 78%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(104%); }
  .sheet.is-open { transform: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .map-ui { right: 60px; }
  .seg button { padding: 6px 9px; }
  .map-btn span { display: none; }
  .bars__row { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .bars__fill, .cols__bar { transition: none; }
}
