:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1f2a23;
  --muted: #6b7568;
  --line: #e4dfd3;
  --brand: #2e4839;
  --brand-2: #46705a;
  --brand-soft: #e3ebdf;
  --accent: #b58a55;
  --ok: #2f7d4f;   --ok-bg: #e2f1e7;
  --mid: #a86a0c;  --mid-bg: #fbefd9;
  --ko: #b23b3b;   --ko-bg: #f8e3e1;
  --info: #3a5f86; --info-bg: #e3ecf6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,42,35,.06), 0 4px 14px rgba(31,42,35,.05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
a { color: var(--brand-2); }
.hidden { display: none !important; }

/* ---------- Structure ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: calc(var(--safe-top) + 10px) 16px 12px;
  display: flex; align-items: center; gap: 10px; min-height: 52px;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12px; opacity: .75; font-weight: 400; display: block; }
.topbar .iconbtn { color: #fff; }
.iconbtn { background: none; border: 0; padding: 6px; margin: -6px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; min-width: 40px; min-height: 40px; }
.iconbtn svg { width: 24px; height: 24px; }

main.page { padding: 14px 14px calc(var(--tabbar) + var(--safe-bottom) + 24px); max-width: 860px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-bottom);
}
.tabbar button {
  flex: 1; background: none; border: 0; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; color: var(--muted); cursor: pointer; font-weight: 500;
}
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--brand); }
.tabbar .plus span.bubble { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(46,72,57,.35); margin-top: -10px; }
.tabbar .plus svg { width: 24px; height: 24px; }

/* ---------- Éléments ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card h2, .section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; font-weight: 650; }
.section-title { margin: 20px 4px 8px; display: flex; align-items: center; justify-content: space-between; }
.section-title .link { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--brand-2); background: none; border: 0; font-weight: 600; cursor: pointer; padding: 0; }
.hello { font-size: 22px; font-weight: 700; margin: 4px 4px 2px; }
.hello-sub { color: var(--muted); margin: 0 4px 14px; font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.hero { grid-column: 1 / -1; background: var(--brand); color: #fff; }
.kpi.hero .l { color: rgba(255,255,255,.75); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: #dfe9d4; border-radius: 99px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 600; cursor: pointer;
  min-height: 48px; text-decoration: none; font-size: 16px;
}
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.light { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand-2); }
.btn.danger { background: var(--ko-bg); color: var(--ko); }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns > .btn { flex: 1; }

.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.item:last-child { border-bottom: 0; }
.item:active { background: #faf8f3; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { text-align: right; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.item .r .big { font-weight: 700; }
.item .chev { color: #b9b3a5; flex-shrink: 0; }
.item.inactive { opacity: .5; }

.datebox { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); padding: 5px 0; line-height: 1.05; }
.datebox .d { font-size: 19px; font-weight: 700; }
.datebox .m { font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
.datebox.past { background: #efece4; color: var(--muted); }

.badge { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-mid { background: var(--mid-bg); color: var(--mid); }
.b-ko { background: var(--ko-bg); color: var(--ko); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-mute { background: #eeebe3; color: var(--muted); }

.month { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 4px 8px; }

.seg { display: flex; background: #e9e5da; border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg .count { font-size: 11.5px; background: var(--ko); color: #fff; border-radius: 99px; padding: 1px 6px; margin-left: 4px; }

.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px 11px 38px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 10px; font-size: 15px; -webkit-appearance: none; appearance: none; }
.filters select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7568' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.filters .full { grid-column: 1 / -1; }

.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty svg { width: 42px; height: 42px; color: #c9c2b2; margin-bottom: 6px; }

.alert { display: flex; gap: 10px; align-items: center; background: var(--mid-bg); color: #6d4708; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; cursor: pointer; border: 0; width: 100%; text-align: left; }
.alert svg { width: 22px; height: 22px; flex-shrink: 0; }
.alert b { font-weight: 700; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; min-height: 48px; -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7568' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field input[type=date] { display: block; min-width: 0; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
.field input[readonly] { background: #f3f1ea; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--muted); margin: 5px 2px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 46px; }
.input-suffix span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.dates { display: flex; flex-direction: column; gap: 8px; }
.dates .dl { display: flex; gap: 8px; align-items: center; }
.dates .dl input { flex: 1; }
.check { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex-shrink: 0; }
.check .s { font-size: 13px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.qty:last-child { border-bottom: 0; }
.qty .lbl { flex: 1; }
.qty input { width: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.error { color: var(--ko); background: var(--ko-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* ---------- Photos ---------- */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #ece8de; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photos .ph .del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.photos .ph .del svg { width: 16px; height: 16px; }
.photos .add { aspect-ratio: 1; border-radius: 10px; border: 2px dashed #cfc8b8; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 13px; text-align: center; background: none; }
.photos .add svg { width: 26px; height: 26px; display: block; margin: 0 auto 2px; }
.photos .ph.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.6) center/26px no-repeat; }

/* ---------- Fiches ---------- */
.fiches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .fiches { grid-template-columns: repeat(3, 1fr); } }
.fiche { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; border: 0; padding: 0; text-align: left; position: relative; }
.fiche .thumb { aspect-ratio: 3/4; background: #ece8de center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.fiche .thumb svg { width: 40px; height: 40px; }
.fiche .cap { padding: 9px 10px 11px; }
.fiche .cap b { display: block; font-size: 14px; line-height: 1.25; }
.fiche .cap span { font-size: 12px; color: var(--muted); }

/* ---------- Statistiques ---------- */
.stat-row { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: default; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.stat-row .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.bar { height: 6px; border-radius: 99px; background: #eeebe3; margin-top: 7px; position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bar.ok > i { background: var(--ok); } .bar.mid > i { background: #d99a2b; } .bar.ko > i { background: var(--ko); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin: -4px 4px 10px; flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.legend .l-ok::before { background: var(--ok); } .legend .l-mid::before { background: #d99a2b; } .legend .l-ko::before { background: var(--ko); }

/* ---------- Feuille (modale plein écran) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20,28,22,.38); z-index: 50; animation: fade .18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + 10px); z-index: 51;
  background: var(--bg); border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  animation: up .24s cubic-bezier(.2,.8,.2,1); max-width: 760px; margin: 0 auto; box-shadow: 0 -6px 30px rgba(0,0,0,.15);
}
.sheet header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 16px 16px 0 0; }
.sheet header h3 { flex: 1; margin: 0; font-size: 17px; text-align: center; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet header .side { width: 84px; display: flex; }
.sheet header .side.r { justify-content: flex-end; }
.sheet header .tbtn { background: none; border: 0; color: var(--brand-2); font-weight: 600; font-size: 16px; cursor: pointer; padding: 6px 2px; }
.sheet .body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 14px calc(var(--safe-bottom) + 24px); overscroll-behavior: contain; }
.sheet.small { top: auto; max-height: 85vh; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

.viewer { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; }
.viewer .vbar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 8px) 12px 8px; color: #fff; }
.viewer .vbar .iconbtn { color: #fff; }
.viewer .vimg { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px); transform: translateX(-50%) translateY(20px); background: #1f2a23; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; z-index: 90; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

.dialog { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(20,28,22,.4); padding: 24px; animation: fade .15s; }
.dialog .box { background: #fff; border-radius: 16px; max-width: 340px; width: 100%; overflow: hidden; }
.dialog .msg { padding: 20px 18px 16px; text-align: center; }
.dialog .msg b { display: block; font-size: 17px; margin-bottom: 6px; }
.dialog .msg p { margin: 0; color: var(--muted); font-size: 14.5px; }
.dialog .acts { display: flex; border-top: 1px solid var(--line); }
.dialog .acts button { flex: 1; background: none; border: 0; padding: 14px; font-size: 16px; color: var(--brand-2); cursor: pointer; font-weight: 500; }
.dialog .acts button + button { border-left: 1px solid var(--line); }
.dialog .acts .danger { color: var(--ko); font-weight: 650; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-top) + 24px) 22px calc(var(--safe-bottom) + 24px); max-width: 420px; margin: 0 auto; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 14px; display: block; box-shadow: 0 6px 18px rgba(46,72,57,.25); }
.login h1 { text-align: center; font-size: 24px; margin: 0 0 4px; }
.login p.lead { text-align: center; color: var(--muted); margin: 0 0 26px; }
.pwd { position: relative; }
.pwd button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.secret { font: 600 22px/1.2 ui-monospace, Menlo, monospace; background: var(--brand-soft); color: var(--brand); padding: 14px; border-radius: 12px; text-align: center; letter-spacing: .02em; user-select: all; -webkit-user-select: all; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.steps { padding-left: 20px; margin: 6px 0 0; }
.steps li { margin-bottom: 6px; }

/* =================================================================
   Interface ordinateur (siège et DC, écran ≥ 960 px)
   ================================================================= */
body.desk { background: #f3f1ea; }
.desk-layout { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.dside { background: var(--brand); color: #e8efe3; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.dside .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.dside .brand img { width: 34px; height: 34px; border-radius: 9px; }
.dside .brand b { display: block; font-size: 15px; color: #fff; }
.dside .brand span { font-size: 12px; opacity: .7; }
.dside .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 16px 10px 6px; font-weight: 700; }
.dside button.nav { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; color: inherit; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14.5px; text-align: left; }
.dside button.nav svg { width: 19px; height: 19px; opacity: .85; flex-shrink: 0; }
.dside button.nav:hover { background: rgba(255,255,255,.08); }
.dside button.nav.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.dside .me { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding: 14px 10px 0; font-size: 13px; }
.dside .me b { display: block; color: #fff; font-size: 14px; }
.dside .me span { opacity: .7; }
.desk-main { min-width: 0; display: flex; flex-direction: column; }
.dhead { position: sticky; top: 0; z-index: 20; background: rgba(243,241,234,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; gap: 14px; padding: 18px 32px 14px; border-bottom: 1px solid var(--line); }
.dhead h1 { margin: 0; font-size: 22px; flex: 1; font-weight: 700; }
.dhead h1 .sub { display: inline; font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 10px; }
.dpage { padding: 20px 26px 48px; max-width: 1480px; width: 100%; }
.dpage.narrow { max-width: 860px; }
body.desk #toast { bottom: 28px; }

.dkpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.dkpis .kpi { padding: 16px 18px; }
.dkpis .kpi .v { font-size: 26px; }
.dkpis .kpi.hero { grid-column: auto; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dgrid > div { min-width: 0; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel > h2 { font-size: 15px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 650; }
.panel > h2 .link { font-size: 13.5px; color: var(--brand-2); background: none; border: 0; cursor: pointer; font-weight: 600; }
.panel .pbody { padding: 16px 18px; }
.panel .list { box-shadow: none; border-radius: 0; margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=search] { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 30px 8px 11px; font-size: 14px; min-height: 38px; -webkit-appearance: none; appearance: none; }
.toolbar select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7568' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.toolbar input[type=search] { padding-left: 11px; min-width: 240px; }
.toolbar .grow { flex: 1; }
.toolbar .seg { margin: 0; }
.toolbar .btn { min-height: 38px; padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.totals { font-size: 13.5px; color: var(--muted); margin: -4px 2px 10px; }
.totals b { color: var(--ink); }

.tbl-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 230px); }
table.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.dt th { position: sticky; top: 0; background: #faf8f3; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; z-index: 1; }
table.dt th:hover { color: var(--ink); }
table.dt th .ar { opacity: .5; margin-left: 4px; }
table.dt th.sorted { color: var(--brand); }
table.dt th.sorted .ar { opacity: 1; }
table.dt td { padding: 9px 10px; border-bottom: 1px solid #f0ece3; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
table.dt tr.click { cursor: pointer; }
table.dt tbody tr:hover td { background: #f7f5ef; }
table.dt .num { text-align: right; }
table.dt th.num { text-align: right; }
table.dt .muted { color: var(--muted); }
table.dt tr.off td { opacity: .5; }
table.dt tfoot td { position: sticky; bottom: 0; background: #faf8f3; font-weight: 700; border-top: 1px solid var(--line); }
.minibar { display: inline-block; width: 46px; height: 6px; border-radius: 99px; background: #eeebe3; vertical-align: middle; margin-left: 8px; position: relative; overflow: hidden; }
.minibar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.minibar.ok i { background: var(--ok); } .minibar.mid i { background: #d99a2b; } .minibar.ko i { background: var(--ko); }

.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11.5px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 600; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }

/* Fiches de modification : panneau à droite sur ordinateur */
body.desk .sheet, body.desk .sheet.small { left: auto; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); max-height: none; margin: 0; border-radius: 0; animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
body.desk .sheet header { border-radius: 0; padding: 16px 18px; }
body.desk .sheet .body { padding: 20px 22px 32px; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
body.desk .fiches { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

table.dt td .two { display: block; line-height: 1.25; }
table.dt td .two small { display: block; color: var(--muted); font-size: 12px; }
