/* Lineria CRM — thème sombre premium (v2). Une seule couleur d'accent ; vert = hausse, rouge = alerte. */
@font-face { font-family: "Inter"; src: local("Inter"), local("Inter Variable"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #12151b;            /* gris anthracite bleuté, jamais noir pur */
  --side: #0f1218;
  --card: #181c24;          /* un ton plus clair */
  --card-2: #1e232d;
  --line: #2a303c;          /* bordure fine */
  --line-2: #222833;
  --text: #e8ebf0;
  --muted: #9aa3b2;
  --dim: #6b7586;
  --accent: #6ea8fe;
  --accent-ink: #0d1626;
  --accent-soft: rgba(110, 168, 254, .12);
  --green: #52b58b;
  --green-soft: rgba(82, 181, 139, .12);
  --red: #d9707a;
  --red-soft: rgba(217, 112, 122, .12);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(5, 8, 14, .35), 0 10px 28px -14px rgba(5, 8, 14, .6);
  --shadow-hover: 0 2px 4px rgba(5, 8, 14, .35), 0 16px 34px -14px rgba(5, 8, 14, .7);
  --sans: "Inter", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.label { font-size: 12px; color: var(--dim); letter-spacing: .01em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- structure */
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: var(--side); border-right: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; text-decoration: none; }
.brand b { font-size: 13px; letter-spacing: .22em; font-weight: 600; }
.brand small { display: block; color: var(--dim); font-size: 10px; letter-spacing: .3em; margin-top: 1px; }
.brand svg { width: 24px; height: 24px; color: var(--text); stroke-width: 1.4; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: var(--card-2); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav a.active svg { color: var(--accent); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 10px; padding: 12px 32px; background: rgba(18, 21, 27, .92); border-bottom: 1px solid var(--line-2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.search-btn { flex: 1; max-width: 420px; justify-content: flex-start; color: var(--dim); background: var(--card); }
.search-btn kbd { margin-left: auto; }
.topbar .spacer { flex: 1; }
.view { padding: 28px 32px 90px; width: 100%; max-width: 1360px; }
.view.enter { animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin-top: 4px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.mt { margin-top: 14px; }

/* ---------- éléments */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #343b49; }
.card h2 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reveal { opacity: 0; animation: reveal .5s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kpi .value { font-size: 32px; font-weight: 600; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .sub { margin-top: 8px; font-size: 12px; color: var(--muted); }
.up { color: var(--green); } .alert { color: var(--red); }
.bar { height: 5px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .9s var(--ease); }
.bar.alert i { background: var(--red); }

button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 7px 12px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .12s, color .15s; }
button:hover, .btn:hover { background: var(--card-2); border-color: #3a4252; }
button:active, .btn:active { transform: scale(.97); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: #8bb9ff; border-color: #8bb9ff; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover, .btn.ghost:hover { color: var(--text); background: var(--card-2); }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--red); }
button.done { color: var(--green); border-color: rgba(82, 181, 139, .35); }
button.done:hover { background: var(--green-soft); border-color: var(--green); }
button:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; pointer-events: none; }
button.icon { padding: 7px; }
kbd { font: 11px var(--sans); color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font: inherit; min-width: 0; transition: border-color .15s; }
input:hover, select:hover, textarea:hover { border-color: #3a4252; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { width: 100%; resize: vertical; }
select { appearance: none; padding-right: 28px; background-image: 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='%236b7586' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); }
label.field input, label.field select { color: var(--text); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; background: transparent; }
.pill.accent { color: var(--accent); border-color: rgba(110, 168, 254, .35); background: var(--accent-soft); }
.pill.green { color: var(--green); border-color: rgba(82, 181, 139, .35); background: var(--green-soft); }
.pill.red { color: var(--red); border-color: rgba(217, 112, 122, .35); background: var(--red-soft); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
button.pill { cursor: pointer; padding: 2px 10px; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { color: var(--dim); padding: 18px 0; text-align: center; font-size: 13px; }

/* ---------- listes */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-top: 1px solid var(--line-2); border-radius: 8px; transition: background .15s, opacity .28s, transform .28s, max-height .28s, padding .28s; max-height: 120px; overflow: hidden; }
.item:first-child { border-top: none; }
.item[data-open] { cursor: pointer; }
.item[data-open]:hover { background: var(--card-2); }
.item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.leaving { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }
.item .btns { display: flex; gap: 6px; flex: none; }
.rank { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.item.prio .rank { border-color: rgba(110, 168, 254, .45); color: var(--accent); background: var(--accent-soft); }
.date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.date.late { color: var(--red); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr[data-open] { cursor: pointer; transition: background .12s; }
tbody tr[data-open]:hover { background: var(--card-2); }
tbody tr.active-row { background: var(--accent-soft); }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search], .filters input[type=text] { width: 230px; }
.filters input.narrow { width: 110px; }
.gauge { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gauge .big { font-size: 32px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------- topbar : menus, cloche */
.menu-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-hover); padding: 6px; z-index: 30; animation: pop .14s var(--ease); }
.popover.wide { width: 340px; max-height: 70vh; overflow: auto; }
.popover button.opt, .popover a.opt { display: flex; width: 100%; justify-content: flex-start; background: transparent; border: none; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.popover .opt:hover { background: var(--card); }
.popover .sep { height: 1px; background: var(--line); margin: 5px 0; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #1b0d10; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- graphique */
.chart { width: 100%; height: auto; aspect-ratio: 640 / 190; display: block; fill: initial; stroke: none; }
.chart text { fill: var(--dim); font-size: 11px; font-family: var(--sans); }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; fill: none; }
.chart .b-signe { fill: #3a4457; } .chart .b-enc { fill: var(--accent); }
.chart .b { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: grow .8s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
@keyframes grow { to { transform: scaleY(1); } }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.funnel { display: flex; flex-direction: column; gap: 12px; }
.f-row { display: grid; grid-template-columns: 96px 1fr 38px 52px; gap: 12px; align-items: center; font-size: 13px; }
.f-row .track { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.f-row .track i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .9s var(--ease); }
.f-row .rate { text-align: right; font-size: 12px; color: var(--muted); }

/* ---------- pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--side); border: 1px solid var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 380px; transition: border-color .15s, background .15s; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col header { padding: 12px 14px 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.col header b { font-weight: 500; }
.col header span { color: var(--dim); font-size: 12px; }
.col .cards { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; flex: 1; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: grab; transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; }
.kcard:hover { transform: translateY(-2px); border-color: #3a4252; box-shadow: var(--shadow-hover); }
.kcard.dragging { opacity: .4; }
.kcard .t { font-weight: 500; } .kcard .s { color: var(--dim); font-size: 12px; margin-top: 1px; }
.kcard .f { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 6px; font-size: 12px; color: var(--muted); }

/* ---------- barre de progression des étapes */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.step { border: none; background: transparent; padding: 0; display: flex; flex-direction: column; gap: 7px; align-items: stretch; text-align: left; font-size: 12px; color: var(--dim); }
.step:hover { background: transparent; }
.step i { display: block; height: 5px; border-radius: 99px; background: var(--line); transition: background .3s; }
.step.done { color: var(--muted); } .step.done i { background: var(--accent); }
.step.current { color: var(--text); } .step.current i { background: rgba(110, 168, 254, .5); }
.mini-steps { display: flex; gap: 3px; width: 110px; }
.mini-steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.mini-steps i.done { background: var(--accent); } .mini-steps i.current { background: rgba(110, 168, 254, .45); }

/* ---------- panneau latéral (fiche) */
.panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(540px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -24px 0 48px -24px rgba(5, 8, 14, .7); transform: translateX(102%); transition: transform .3s var(--ease), width .3s var(--ease); z-index: 20; overflow-y: auto; overscroll-behavior: contain; }
.panel.open { transform: none; }
.panel.full { width: min(1040px, calc(100vw - 224px)); }
.panel-inner { padding: 22px 26px 80px; }
.panel .tools { display: flex; gap: 4px; justify-content: flex-end; margin: -6px -8px 6px 0; }
.fiche-head h1 { font-size: 22px; }
.fiche-head .meta { color: var(--muted); margin-top: 3px; }
.actions-1 { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; }
.actions-1 .btn, .actions-1 button { padding: 6px 11px; font-size: 13px; }
.nextbox { margin-top: 16px; padding: 14px 16px; border: 1px solid rgba(110, 168, 254, .4); background: var(--accent-soft); border-radius: var(--radius); }
.nextbox .label { color: var(--accent); }
.nextbox .what { font-weight: 600; font-size: 16px; margin-top: 3px; }
.nextbox.missing { border-color: rgba(217, 112, 122, .45); background: var(--red-soft); }
.nextbox.missing .label { color: var(--red); }
.sect { margin-top: 24px; }
.sect > .label { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.kv .full { grid-column: 1 / -1; }
.money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.money .cell { border: 1px solid var(--line-2); background: var(--bg); border-radius: 8px; padding: 11px 13px; }
.money .cell .v { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.defect { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; }
.defect::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-top: 8px; flex: none; }
.scorebig { display: flex; align-items: center; gap: 14px; }
.scorebig .n { font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.timeline { display: flex; flex-direction: column; margin-top: 12px; }
.tl { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 7px 0; font-size: 13px; position: relative; }
.tl::before { content: ""; position: absolute; left: 3px; top: 22px; bottom: -8px; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-top: 7px; }
.tl.key i { background: var(--accent); }
.quicknote { display: flex; gap: 8px; margin-top: 10px; }
.quicknote input { flex: 1; }
.actrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
details.more { margin-top: 24px; border-top: 1px solid var(--line-2); padding-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::before { content: "+"; width: 16px; text-align: center; color: var(--dim); }
details.more[open] summary::before { content: "−"; }
.msg { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; margin-top: 10px; }
.msg pre { white-space: pre-wrap; font: 13px/1.55 var(--sans); color: #d7dbe3; margin: 8px 0 0; }
.switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.switch input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.note-sec { font-size: 12px; color: var(--dim); margin-top: 6px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.pay-row:first-child { border-top: none; }
.pay-row.paid .t { color: var(--muted); }

/* ---------- fenêtres, toasts, connexion */
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, 94vw); max-height: 86vh; box-shadow: var(--shadow-hover); }
dialog::backdrop { background: rgba(8, 10, 15, .62); }
dialog[open] { animation: pop .18s var(--ease); }
.mbody { padding: 22px; } .mbody h2 { font-size: 16px; color: var(--text); font-weight: 600; }
.mbody.palette { padding: 14px; } .mbody.palette input { width: 100%; font-size: 15px; padding: 10px 12px; }
.mgrid { display: grid; gap: 12px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; pointer-events: none; }
.toast { background: var(--card-2); border: 1px solid var(--line); padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow-hover); animation: pop .2s var(--ease); font-size: 13px; }
.toast.err { border-color: rgba(217, 112, 122, .5); color: #f0b3b9; }
.login { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.login-box { width: min(340px, 100%); display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.brand-big { font-size: 15px; letter-spacing: .24em; font-weight: 600; } .brand-big small { display: block; color: var(--dim); font-size: 10px; letter-spacing: .3em; margin-top: 3px; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 32px; background: var(--red-soft); color: #f0b3b9; font-size: 13px; border-bottom: 1px solid rgba(217, 112, 122, .3); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 3px; }

/* ---------- mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; } .chart .b { transform: none; }
}

/* ---------- tablette / téléphone */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  html, body { font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .app { display: block; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 15; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); flex-direction: row; border-right: none; border-top: 1px solid var(--line-2); background: rgba(15, 18, 24, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10px; min-width: 52px; }
  .nav a span { white-space: nowrap; } .nav a.active::before { display: none; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  .search-btn kbd { display: none; } .new-label { display: none; }
  .view { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .g4, .g3, .g2, .g21 { grid-template-columns: minmax(0, 1fr); } .g4.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: auto; }
  .kpi .value { font-size: 24px; }
  .banner { padding: 9px 14px; flex-wrap: wrap; }
  .filters input, .filters select { flex: 1 1 calc(50% - 8px); width: auto !important; }
  .tablewrap { border: none; background: transparent; box-shadow: none; overflow: visible; }
  .tablewrap table, .tablewrap tbody { display: block; } .tablewrap thead { display: none; }
  .tablewrap tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
  .tablewrap td { display: block; padding: 0; border: none; } .tablewrap td:empty { display: none; } .tablewrap td:first-child { flex: 1 1 100%; }
  .board { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 12px; }
  .col { scroll-snap-align: start; min-height: 260px; }
  .panel, .panel.full { width: 100vw; } .panel-inner { padding: calc(14px + env(safe-area-inset-top)) 16px calc(60px + env(safe-area-inset-bottom)); }
  .kv, .money, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item { flex-wrap: wrap; } .item .grow { flex: 1 1 150px; }
  .head .row { width: 100%; }
  .item .btns { flex-wrap: wrap; justify-content: flex-end; }
  dialog { width: 100vw; max-width: 100vw; margin: auto auto 0; border-radius: 14px 14px 0 0; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .popover.wide { width: min(340px, 92vw); position: fixed; right: 8px; top: 56px; }
  button, .btn { min-height: 36px; }
}

/* La liste reste visible à côté du panneau sur grand écran */
.main { transition: padding-right .3s var(--ease); }
@media (min-width: 1101px) { body.panel-open:not(.panel-full) .main { padding-right: min(540px, 100vw); } }

.grid > *, .kv > *, .money > *, .settings-grid > * { min-width: 0; }
label.field input, label.field select { width: 100%; }
