/* Pondéo · design system */

:root {
  --bg: #F3F5EF;
  --bg-2: #EAEFE6;
  --surface: #FFFFFF;
  --surface-2: #F7F9F4;
  --ink: #0F2219;
  --ink-2: #2D4237;
  --muted: #5E6E64;
  --faint: #8A9A90;
  --line: #E0E6DC;
  --line-2: #CFD8CB;
  --brand: #17513A;
  --brand-ink: #FFFFFF;
  --brand-2: #0C3A28;
  --brand-soft: #E2EFE6;
  --yolk: #F2A81D;
  --yolk-2: #C27E05;
  --yolk-soft: #FFF2D3;
  --ok: #1F7F4C;      --ok-bg: #E1F2E7;
  --warn: #A86200;    --warn-bg: #FFF0D6;
  --bad: #BE3329;     --bad-bg: #FCE5E2;
  --info: #23609F;    --info-bg: #E3EDF8;
  --shadow-1: 0 1px 2px rgba(15, 34, 25, .06), 0 1px 1px rgba(15, 34, 25, .03);
  --shadow-2: 0 2px 6px rgba(15, 34, 25, .06), 0 12px 32px -8px rgba(15, 34, 25, .14);
  --radius: 18px;
  --radius-s: 12px;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B130F; --bg-2: #0F1914; --surface: #142019; --surface-2: #18261E; --ink: #E8F0EA; --ink-2: #C9D6CD;
    --muted: #93A69A; --faint: #6E8176; --line: #22322A; --line-2: #2D3F35;
    --brand: #5CC28C; --brand-ink: #062015; --brand-2: #3FA672; --brand-soft: #173326;
    --yolk: #F5B83E; --yolk-2: #F5B83E; --yolk-soft: #33280F;
    --ok: #64C892; --ok-bg: #163324; --warn: #F2B54A; --warn-bg: #352710; --bad: #F2867B; --bad-bg: #3A1A17; --info: #7DB1EA; --info-bg: #15263A;
    --shadow-1: none; --shadow-2: 0 12px 32px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B130F; --bg-2: #0F1914; --surface: #142019; --surface-2: #18261E; --ink: #E8F0EA; --ink-2: #C9D6CD;
  --muted: #93A69A; --faint: #6E8176; --line: #22322A; --line-2: #2D3F35;
  --brand: #5CC28C; --brand-ink: #062015; --brand-2: #3FA672; --brand-soft: #173326;
  --yolk: #F5B83E; --yolk-2: #F5B83E; --yolk-soft: #33280F;
  --ok: #64C892; --ok-bg: #163324; --warn: #F2B54A; --warn-bg: #352710; --bad: #F2867B; --bad-bg: #3A1A17; --info: #7DB1EA; --info-bg: #15263A;
  --shadow-1: none; --shadow-2: 0 12px 32px -8px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased;
  min-height: 100dvh; overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.s { width: 18px; height: 18px; }
.i.l { width: 28px; height: 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--yolk); outline-offset: 2px; border-radius: 6px; }

/* ---------- Coquille ---------- */
.app { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
.main { min-width: 0; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.page { max-width: 1120px; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page, .sheet, .toast { animation: none !important; transition: none !important; } }

.topbar {
  position: sticky; top: 0; z-index: 20; margin: 0 -16px 6px; padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .farm { min-width: 0; flex: 1; }
.topbar .farm small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .farm h1 { font-size: 21px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.page-head h2 { font-size: 24px; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 14px; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.sync.off .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.sync.demo .dot { background: var(--yolk); box-shadow: 0 0 0 3px var(--yolk-soft); }

.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }

/* Barre du bas (téléphone) */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b));
}
.nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; }
.nav a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.nav a[aria-current="page"] { color: var(--brand); }
.nav a[aria-current="page"] .i { stroke-width: 2.2; }
.nav .main-action a { margin-top: -22px; }
.nav .main-action .bubble { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.nav .main-action a[aria-current="page"] .bubble { background: var(--yolk); color: #2B1A00; }
.nav .side-brand, .nav .side-foot, .nav .desk-only { display: none; }

/* Ordinateur : menu à gauche */
@media (min-width: 960px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .main { padding: 0 32px 48px; }
  .topbar { margin: 0 -32px 10px; padding: 18px 32px 14px; }
  .nav { position: sticky; top: 0; height: 100dvh; border-top: 0; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; background: var(--surface); }
  .nav ul { display: grid; grid-template-columns: 1fr; gap: 4px; max-width: none; margin: 0; align-items: stretch; }
  .nav a { grid-auto-flow: column; justify-content: start; gap: 12px; padding: 11px 12px; font-size: 14.5px; }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--brand-soft); }
  .nav .main-action { order: -1; }
  .nav .main-action a { margin: 0 0 10px; background: var(--brand); color: var(--brand-ink); justify-content: center; }
  .nav .main-action a[aria-current="page"] { background: var(--yolk); color: #2B1A00; }
  .nav .main-action .bubble { width: auto; height: auto; background: none; box-shadow: none; color: inherit; border-radius: 0; }
  .nav .main-action a[aria-current="page"] .bubble { background: none; color: inherit; }
  .nav .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
  .nav .side-foot { display: block; margin-top: auto; padding: 12px 8px 0; font-size: 12px; color: var(--faint); }
  .nav .more-only { display: none; }
  .nav .desk-only { display: block; }
}

.brand-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark .logo { width: 36px; height: 36px; flex: none; }
.brand-mark b { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 17px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 500; font-family: var(--body); }
.link { color: var(--brand); font-weight: 700; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; }
.link .i { width: 16px; height: 16px; }

.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 720px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid.dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); min-width: 0; }

/* Héros */
.hero {
  position: relative; overflow: hidden; color: #fff; border: 0; padding: 22px;
  background: radial-gradient(120% 140% at 100% 0%, #2B7A55 0%, transparent 55%), linear-gradient(160deg, #17513A 0%, #0C3A28 100%);
  box-shadow: var(--shadow-2);
}
:root[data-theme="dark"] .hero { background: radial-gradient(120% 140% at 100% 0%, #1E5E41 0%, transparent 55%), linear-gradient(160deg, #123F2D 0%, #0A2A1D 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: radial-gradient(120% 140% at 100% 0%, #1E5E41 0%, transparent 55%), linear-gradient(160deg, #123F2D 0%, #0A2A1D 100%); } }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 60%); pointer-events: none; }
.hero .lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .78; }
.hero .big { font-family: var(--display); font-size: clamp(44px, 11vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -.03em; margin: 6px 0 4px; }
.hero .big small { font-size: 18px; font-weight: 600; opacity: .8; letter-spacing: 0; margin-left: 6px; }
.hero .meta { font-size: 13.5px; opacity: .86; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; position: relative; z-index: 1; }
.hero .ring { position: relative; width: 96px; height: 96px; flex: none; }
.hero .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero .ring b { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1; }
.hero .ring b small { display: block; font-family: var(--body); font-size: 10.5px; font-weight: 700; opacity: .75; letter-spacing: .04em; margin-top: 3px; }
.hero-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; z-index: 1; align-items: center; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.hero-chip .i { width: 15px; height: 15px; }
.hero .btn.on-dark { background: var(--yolk); color: #2B1A00; }
@media (max-width: 400px) { .hero .ring { width: 80px; height: 80px; } .hero .ring b { font-size: 18px; } }

/* Indicateurs */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; box-shadow: var(--shadow-1); text-decoration: none; color: inherit; display: block; }
.kpi .l { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.kpi .l .i { width: 16px; height: 16px; }
.kpi .v { font-family: var(--display); font-size: 25px; font-weight: 700; margin-top: 6px; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .d { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* Alertes */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.alert .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.alert .ic .i { width: 18px; height: 18px; }
.alert b { display: block; font-size: 14.5px; }
.alert span { font-size: 13.5px; color: var(--ink-2); }
.alert.bad { background: var(--bad-bg); } .alert.bad .ic { background: var(--bad); color: #fff; }
.alert.warn { background: var(--warn-bg); } .alert.warn .ic { background: var(--warn); color: #fff; }
.alert.info { background: var(--info-bg); } .alert.info .ic { background: var(--info); color: #fff; }
.alert.ok { background: var(--ok-bg); } .alert.ok .ic { background: var(--ok); color: #fff; }
.alert .go { margin-left: auto; align-self: center; color: var(--muted); }

/* Listes */
.list { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item.tap { cursor: pointer; }
.item.tap:hover .t { color: var(--brand); }
.item .av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 800; font-family: var(--display); background: var(--brand-soft); color: var(--brand); }
.item .av .i { width: 20px; height: 20px; }
.item .av.yolk { background: var(--yolk-soft); color: var(--yolk-2); }
.item .av.bad { background: var(--bad-bg); color: var(--bad); }
.item .av.info { background: var(--info-bg); color: var(--info); }
.item .av.ok { background: var(--ok-bg); color: var(--ok); }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { text-align: right; flex: none; }
.item .r b { display: block; font-variant-numeric: tabular-nums; }
.item .r small { color: var(--muted); font-size: 12.5px; }
.item .acts { display: flex; gap: 6px; flex: none; }

.rows { display: grid; gap: 9px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14.5px; }
.kv > span:first-child { color: var(--muted); }
.kv b { font-variant-numeric: tabular-nums; text-align: right; }
.kv.total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; font-size: 16px; }
.kv.total > span:first-child { color: var(--ink); font-weight: 700; }

.bar { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.yolk i { background: var(--yolk); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }
table.t tr.hl td { background: var(--brand-soft); }
.tscroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }

/* Graphique */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--body); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 4px; border-radius: 2px; background: var(--c); }

/* ---------- Formulaires ---------- */
form { display: grid; gap: 14px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 380px) { .fields { grid-template-columns: minmax(0, 1fr); } }
label.f { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); min-width: 0; align-content: start; }
label.f .h { font-weight: 500; font-size: 12.5px; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14.5px; }
input, select, textarea {
  width: 100%; min-width: 0; font-size: 16px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 12px 13px; color: var(--ink); transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; -webkit-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='%235E6E64' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); padding: 0; flex: none; }

/* Compteur +/- (gros boutons pour le terrain) */
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: stretch; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.stepper:focus-within { border-color: var(--brand); background: var(--surface); }
.stepper button { border: 0; background: transparent; font-size: 22px; font-weight: 700; color: var(--brand); cursor: pointer; touch-action: manipulation; }
.stepper button:active { background: var(--brand-soft); }
.stepper input { border: 0; background: transparent; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 700; padding: 10px 0; border-radius: 0; }
.stepper input:focus { background: transparent; }
.stepper.big { grid-template-columns: 60px minmax(0, 1fr) 60px; }
.stepper.big input { font-size: 34px; padding: 12px 0; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.total-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--yolk-soft); border: 1px solid color-mix(in srgb, var(--yolk) 40%, transparent); flex-wrap: wrap; }
.total-box b { font-family: var(--display); font-size: 26px; font-weight: 800; }
.total-box span { color: var(--ink-2); font-weight: 600; font-size: 14px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 8px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 800; font-size: 15px; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, filter .15s; touch-action: manipulation; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.yolk { background: var(--yolk); color: #2B1A00; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.wa { background: #1A9E50; color: #fff; }
.btn.sm { padding: 9px 13px; font-size: 13.5px; border-radius: 11px; }
.btn.xs { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn .i { width: 19px; height: 19px; }
.btn.xs .i { width: 15px; height: 15px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns > .btn { flex: 1 1 140px; }

.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--brand) 75%, transparent); cursor: pointer; }
.fab .i { width: 26px; height: 26px; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 32px; } }

/* ---------- États vides, chargement ---------- */
.empty { text-align: center; padding: 28px 12px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .ill { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty b { color: var(--ink); font-size: 16px; font-family: var(--display); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 16px; }

/* ---------- Fenêtre du bas ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; justify-items: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(6, 14, 10, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + var(--safe-b)); transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-2); overscroll-behavior: contain; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 20px; font-weight: 800; }
.sheet-body { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 24px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; padding-bottom: 22px; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-grab { display: none; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-2); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- Écrans d'accueil et connexion ---------- */
.welcome { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .welcome { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.welcome-art {
  position: relative; overflow: hidden; color: #fff; padding: calc(26px + var(--safe-t)) 22px 34px; display: flex; flex-direction: column; gap: 20px;
  background: radial-gradient(90% 70% at 85% 10%, #2E8259 0%, transparent 60%), radial-gradient(70% 60% at 0% 100%, #0A3323 0%, transparent 70%), linear-gradient(165deg, #17513A, #0B3525);
}
.welcome-art .brand-mark { color: #fff; }
.welcome-art h1 { font-size: clamp(34px, 8.5vw, 56px); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; max-width: 14ch; position: relative; }
.welcome-art h1 em { font-style: normal; color: var(--yolk); }
.welcome-art p.lead { font-size: 16.5px; opacity: .88; max-width: 38ch; position: relative; }
.welcome-art .feats { display: grid; gap: 10px; margin-top: 2px; position: relative; }
.welcome-art .feat { display: flex; gap: 12px; align-items: center; font-weight: 600; font-size: 14.5px; }
.welcome-art .feat .ic { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; flex: none; }
.welcome-art .feat .ic .i { width: 19px; height: 19px; }
.welcome-art .eggs { position: absolute; right: -60px; top: 40px; width: 240px; opacity: .13; pointer-events: none; }
@media (min-width: 960px) { .welcome-art { padding: 48px 56px; justify-content: center; } .welcome-art .eggs { width: 420px; top: auto; bottom: -60px; opacity: .18; } }
.welcome-panel { padding: 26px 20px calc(28px + var(--safe-b)); display: grid; align-content: start; gap: 16px; max-width: 460px; width: 100%; margin: 0 auto; }
@media (min-width: 960px) { .welcome-panel { align-content: center; padding: 48px; } }
.welcome-panel h2 { font-size: 24px; font-weight: 800; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; font-weight: 700; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.tabs2 button { border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 800; color: var(--muted); cursor: pointer; }
.tabs2 button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--info-bg); color: var(--ink); font-size: 14px; }
.notice.warn { background: var(--warn-bg); }
.notice.ok { background: var(--ok-bg); }

.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--yolk-soft); border: 1px solid color-mix(in srgb, var(--yolk) 35%, transparent); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; }
.demo-bar b { font-weight: 800; }

/* Menu "Plus" */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); align-content: start; }
.tile:hover { border-color: var(--line-2); }
.tile .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.tile.yolk .ic { background: var(--yolk-soft); color: var(--yolk-2); }
.tile.info .ic { background: var(--info-bg); color: var(--info); }
.tile.bad .ic { background: var(--bad-bg); color: var(--bad); }
.tile b { font-size: 15.5px; }
.tile span { font-size: 12.5px; color: var(--muted); }

.code { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: .18em; text-align: center; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1.5px dashed var(--line-2); }

.phase-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.phase-track div { height: 8px; border-radius: 4px; background: var(--line); }
.phase-track div.done { background: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.phase-track div.now { background: var(--yolk); }
.phase-names { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; gap: 6px; }

@media print {
  .nav, .topbar .sync, .fab, .icon-btn, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Libellés téléphone / ordinateur */
.nav .desk { display: none; }
@media (min-width: 960px) {
  .nav .mob { display: none; }
  .nav .desk { display: inline; }
  .mob-only { display: none !important; }
}
div.f { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); min-width: 0; align-content: start; }
div.f .h { font-weight: 500; font-size: 12.5px; color: var(--muted); }
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }
.demo-bar .row-btns > .btn { flex: none; }
.kpi .v { font-size: clamp(19px, 5.6vw, 25px); }
.vendor { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.vendor b { font-family: var(--display); font-size: 17px; }
@media (max-width: 959px) { .welcome { align-content: start; } }
.report-card { display: grid; gap: 12px; background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.report-card h3 { font-size: 17px; }
.login { min-height: 100dvh; max-width: 440px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 16px calc(24px + var(--safe-b)); display: grid; align-content: start; gap: 18px; }
.login-head { display: flex; align-items: center; gap: 14px; padding: 8px 2px; }
.login-head h1 { font-size: 28px; font-weight: 800; }
.login-head p { color: var(--muted); font-size: 14px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; box-shadow: var(--shadow-1); }
.phase-box { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
.phase-box legend { font-family: var(--display); font-weight: 800; padding: 0 6px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.three input { padding: 10px 8px; }

/* Consignes et tâches */
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.msgs { display: grid; gap: 12px; }
.msg { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.unread { background: var(--yolk-soft); border-color: color-mix(in srgb, var(--yolk) 45%, transparent); }
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-head .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-family: var(--display); flex: none; }
.msg-head b { display: block; font-size: 14.5px; }
.msg-head span { font-size: 12.5px; color: var(--muted); }
.msg-text { font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; }
.msg.big .msg-text { font-size: 17px; font-weight: 600; }
.msg-cta { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.msg-cta > .i:first-child { color: var(--brand); width: 26px; height: 26px; }
.msg-cta span { flex: 1; display: grid; }
.msg-cta small { color: var(--muted); }
.tasks { display: grid; gap: 8px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.task input { width: 26px; height: 26px; margin-top: 1px; }
.task .grow { display: grid; gap: 2px; min-width: 0; }
.task small { color: var(--muted); font-size: 12.5px; }
.task.done { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.task.done b { text-decoration: line-through; color: var(--muted); }
